Package org.jjazz.rhythm.spi
Interface RhythmProvider
- All Known Subinterfaces:
- StubRhythmProvider
public interface RhythmProvider
An object that can provide Rhythms instances.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classRhythmProvider descriptive information.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringSee getFileRhythms().static final intSee getFileRhythms().
- 
Method SummaryModifier and TypeMethodDescriptiongetAdaptedRhythm(Rhythm r, TimeSignature ts) Provide a new rhythm which is an adapted version of r for a different time signature.Get the built-in rhythms.getFileRhythms(boolean forceRescan, MultipleErrorsReport errRpt) Get the file-based rhythms.getInfo()Descriptive information about this provider.String[]Get the file extensions accepted by readFast().booleanReturn true if RhythmProvider has settings which can be modified by end-user.A fast method to read specified rhythm file and extract only information needed for description/catalog purposes.voidShow a modal dialog to modify the user settings of this RhythmProvider.
- 
Field Details- 
PREFIX_IGNORED_SUBDIRSee getFileRhythms().- See Also:
 
- 
SUBDIR_MAX_DEPTHstatic final int SUBDIR_MAX_DEPTHSee getFileRhythms().- See Also:
 
 
- 
- 
Method Details- 
getInfoRhythmProvider.Info getInfo()Descriptive information about this provider.- Returns:
 
- 
getBuiltinRhythmsGet the built-in rhythms.- Parameters:
- errRpt- Can't be null. RhythmProvider should update this object so that the framework can notify user about problems.
- Returns:
- All non file-based rhythms provided by this RhythmProvider. List can be empty but not null.
 
- 
getFileRhythmsGet the file-based rhythms.User-provided rhythm files should be scanned in the User directory for rhythm files, see FileDirectoryManager.getUserRhythmDirectory(). SUBDIR_MAX_DEPTH levels of subdirectories should be scanned. Subdirectories starting with PREFIX_IGNORED_SUBDIR must be ignored. - Parameters:
- forceRescan- If true RhythmProvider should not rely on its cached data.
- errRpt- Can't be null. RhythmProvider should update this object so that the framework can notify user about problems.
- Returns:
- All non builtin rhythms provided by this RhythmProvider. List can be empty but not null.
 
- 
getSupportedFileExtensionsString[] getSupportedFileExtensions()Get the file extensions accepted by readFast().No dot, lowercase. - Returns:
- E.g. "prs", "sty". Can be an empty list if RhythmProvider has only builtin rhythms.
 
- 
readFastA fast method to read specified rhythm file and extract only information needed for description/catalog purposes.Caller must use loadResources() on the returned rhythm before using it to generate music (possibly lenghty operation, eg if new file reading required). - Parameters:
- f-
- Returns:
- Throws:
- IOException
 
- 
getAdaptedRhythmProvide a new rhythm which is an adapted version of r for a different time signature.- Parameters:
- r-
- ts-
- Returns:
- Can be null if no adapted rhythm is available.
- Throws:
- IllegalArgumentException- If ts is already the time signature of r.
 
- 
showUserSettingsDialogvoid showUserSettingsDialog()Show a modal dialog to modify the user settings of this RhythmProvider.The RhythmProvider is responsible for the persistence of its settings. The method does nothing if hasUserSettings() returns false. - See Also:
 
- 
hasUserSettingsboolean hasUserSettings()Return true if RhythmProvider has settings which can be modified by end-user.- Returns:
- See Also:
 
 
-