Class YamahaRhythmProvider

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

public class YamahaRhythmProvider extends Object implements RhythmProvider
A provider of standard Yamaha style rhythms.
  • Field Details

  • Constructor Details

    • YamahaRhythmProvider

      public YamahaRhythmProvider()
      Public because of @ServiceProvider
  • Method Details

    • getInstance

      public static YamahaRhythmProvider 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 stdFile) throws IOException
      Quickly read a file only to get enough information to build a minimal Rhythm object.

      Specified by:
      readFast in interface RhythmProvider
      Parameters:
      stdFile -
      Returns:
      Throws:
      IOException
    • getAdaptedRhythm

      public AdaptedRhythm 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)