Interface RhythmProvider

All Known Subinterfaces:
StubRhythmProvider

public interface RhythmProvider
An object that can provide Rhythms instances.
  • Field Details

  • Method Details

    • getInfo

      Descriptive information about this provider.
      Returns:
    • getBuiltinRhythms

      List<Rhythm> getBuiltinRhythms(MultipleErrorsReport errRpt)
      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

      List<Rhythm> getFileRhythms(boolean forceRescan, MultipleErrorsReport errRpt)
      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

      Rhythm readFast(File f) throws IOException
      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

      AdaptedRhythm getAdaptedRhythm(Rhythm r, TimeSignature ts)
      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: