Class YamJJazzRhythmProvider

java.lang.Object
org.jjazz.yamjjazz.rhythm.api.YamJJazzRhythmProvider
All Implemented Interfaces:
RhythmProvider

public class YamJJazzRhythmProvider extends Object implements RhythmProvider
A provider of YamJJazz rhythms.
  • Field Details

  • Constructor Details

    • YamJJazzRhythmProvider

      public YamJJazzRhythmProvider()
  • Method Details

    • getInstance

      public static YamJJazzRhythmProvider getInstance()
    • getSupportedFileExtensions

      public final String[] getSupportedFileExtensions()
      Description copied from interface: RhythmProvider
      Get the file extensions accepted by readFast().

      No dot, lowercase.

      Specified by:
      getSupportedFileExtensions in interface RhythmProvider
      Returns:
      E.g. "prs", "sty". Can be an empty list if RhythmProvider has only builtin rhythms.
    • getInfo

      public RhythmProvider.Info getInfo()
      Description copied from interface: RhythmProvider
      Descriptive information about this provider.
      Specified by:
      getInfo in interface RhythmProvider
      Returns:
    • showUserSettingsDialog

      public void showUserSettingsDialog()
      Description copied from interface: RhythmProvider
      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.

      Specified by:
      showUserSettingsDialog in interface RhythmProvider
      See Also:
    • hasUserSettings

      public boolean hasUserSettings()
      Description copied from interface: RhythmProvider
      Return true if RhythmProvider has settings which can be modified by end-user.

      Specified by:
      hasUserSettings in interface RhythmProvider
      Returns:
      @see showUserSettingsDialog()
    • getBuiltinRhythms

      public List<Rhythm> getBuiltinRhythms(MultipleErrorsReport errRpt)
      Description copied from interface: RhythmProvider
      Get the built-in rhythms.

      Specified by:
      getBuiltinRhythms in interface RhythmProvider
      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

      public List<Rhythm> getFileRhythms(boolean forceRescan, MultipleErrorsReport errRpt)
      Description copied from interface: RhythmProvider
      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.

      Specified by:
      getFileRhythms in interface RhythmProvider
      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.
    • readFast

      public Rhythm readFast(File extFile) throws IOException
      Read extFile plus the content of the associated Yamaha standard file .sty or .prs.
      Specified by:
      readFast in interface RhythmProvider
      Parameters:
      extFile - The extension file (.yjz)
      Returns:
      Can't be null
      Throws:
      IOException - In case of file reading problem
    • getAdaptedRhythm

      public YamJJazzAdaptedRhythm getAdaptedRhythm(Rhythm r, TimeSignature ts)
      Description copied from interface: RhythmProvider
      Provide a new rhythm which is an adapted version of r for a different time signature.

      Specified by:
      getAdaptedRhythm in interface RhythmProvider
      Parameters:
      r -
      ts -
      Returns:
      Can be null if no adapted rhythm is available.
    • isMine

      public static boolean isMine(RhythmInfo ri)