Class FavoriteRhythmProvider

java.lang.Object
org.jjazz.rhythmdatabaseimpl.api.FavoriteRhythmProvider
All Implemented Interfaces:
RhythmProvider

public class FavoriteRhythmProvider extends Object implements RhythmProvider
A RhythmProvider instance which only provides the rhythms from the FavoriteRhythms instance.

  • Method Details

    • getInstance

      public static FavoriteRhythmProvider getInstance()
    • getBuiltinRhythmInfos

      public List<RhythmInfo> getBuiltinRhythmInfos()
      Get the list of favorite rhythms.
      Returns:
    • getInfo

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

      public List<Rhythm> getBuiltinRhythms(MultipleErrorsReport errRpt)
      Return an empty list.

      See getBuiltinRhythmInfos().

      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:
    • getFileRhythms

      public List<Rhythm> getFileRhythms(boolean forceRescan, MultipleErrorsReport errRpt)
      Return an empty list.

      See getBuiltinRhythmInfos().

      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:
    • 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()
    • getSupportedFileExtensions

      public 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.
    • readFast

      public Rhythm readFast(File f) throws IOException
      Description copied from interface: RhythmProvider
      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).

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