Package org.jjazz.rhythm.spi
Interface RhythmProvider
- All Known Subinterfaces:
StubRhythmProvider
public interface RhythmProvider
An object that can provide Rhythms instances.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
RhythmProvider descriptive information. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
See getFileRhythms().static final int
See getFileRhythms(). -
Method Summary
Modifier 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().boolean
Return 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.void
Show a modal dialog to modify the user settings of this RhythmProvider.
-
Field Details
-
PREFIX_IGNORED_SUBDIR
See getFileRhythms().- See Also:
-
SUBDIR_MAX_DEPTH
static final int SUBDIR_MAX_DEPTHSee getFileRhythms().- See Also:
-
-
Method Details
-
getInfo
RhythmProvider.Info getInfo()Descriptive information about this provider.- Returns:
-
getBuiltinRhythms
Get 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.
-
getFileRhythms
Get 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.
-
getSupportedFileExtensions
String[] 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.
-
readFast
A 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
-
getAdaptedRhythm
Provide 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.
-
showUserSettingsDialog
void 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:
-
hasUserSettings
boolean hasUserSettings()Return true if RhythmProvider has settings which can be modified by end-user.- Returns:
- See Also:
-