Class MidiSynthManager

java.lang.Object
org.jjazz.outputsynth.api.MidiSynthManager

public class MidiSynthManager extends Object
Manager the list of MidiSynths used during a JJazzLab session.
  • Field Details

    • PROP_MIDISYNTH_LIST

      public static String PROP_MIDISYNTH_LIST
      Property change event fired when a MidiSynth is added or removed.

      If added: oldValue=null, newValue=added MidiSynth
      If removed: oldValue=removed MidiSynth, newValue=null

    • JJAZZLAB_SOUNDFONT_GM2_SYNTH_NAME

      public static String JJAZZLAB_SOUNDFONT_GM2_SYNTH_NAME
    • JJAZZLAB_SOUNDFONT_GS_SYNTH_NAME

      public static String JJAZZLAB_SOUNDFONT_GS_SYNTH_NAME
    • JJAZZLAB_SOUNDFONT_XG_SYNTH_NAME

      public static String JJAZZLAB_SOUNDFONT_XG_SYNTH_NAME
    • YAMAHA_REF_SYNTH_NAME

      public static String YAMAHA_REF_SYNTH_NAME
  • Method Details

    • getInstance

      public static MidiSynthManager getInstance()
      Get the instance.

      Upon creation the MidiSynthManager contains at least the GM/GM2/XG/GS MidiSynths.

      Returns:
    • addMidiSynth

      public boolean addMidiSynth(MidiSynth midiSynth)
      Add the specified MidiSynth.

      Parameters:
      midiSynth -
      Returns:
      True if midiSynth was successfully added, false if midiSynth was already referenced by the MidiSynthManager.
    • removeMidiSynth

      public boolean removeMidiSynth(MidiSynth midiSynth)
      Remove the specified MidiSynth.

      Parameters:
      midiSynth -
      Returns:
    • getMidiSynths

      public List<MidiSynth> getMidiSynths()
      The list of MidiSynths.

      Returns:
      Can be empty.
    • getMidiSynths

      public List<MidiSynth> getMidiSynths(Predicate<MidiSynth> tester)
      The list of MidiSynths which match the specified criteria.

      Parameters:
      tester -
      Returns:
      An unmodifiable list, which can be empty.
    • getMidiSynth

      public MidiSynth getMidiSynth(String name)
      Search a MidiSynth with the specified name.
      Parameters:
      name -
      Returns:
      Can be null.
    • showSelectSynthFileDialog

      public File showSelectSynthFileDialog()
      Show a dialog to select a MidiSynth definition file.

      Use the file extensions managed by the MidiSynthFileReaders found in the global lookup.

      Returns:
      The selected file. Null if user cancelled or no selection.
    • loadFromResource

      public static MidiSynth loadFromResource(Class clazz, String insResourcePath)
      Read one MidiSynth from an JJazzLab internal .ins resource file.
      Parameters:
      clazz -
      insResourcePath - Resource path relative to clazz. Must contain only 1 MidiSynth
      Returns:
      Can't be null
      Throws:
      IllegalStateException - If resource could not be read
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Add PropertyChangeListener.
      Parameters:
      listener -
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Remove PropertyChangeListener.
      Parameters:
      listener -