Package org.jjazz.outputsynth.api
Class MidiSynthManager
java.lang.Object
org.jjazz.outputsynth.api.MidiSynthManager
Manager the list of MidiSynths used during a JJazzLab session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCopy the default Midi files in the app config directory.static class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddMidiSynth(MidiSynth midiSynth) Add the specified MidiSynth.voidAdd PropertyChangeListener.static MidiSynthManagerGet the instance.getMidiSynth(String name) Search a MidiSynth with the specified name.The list of MidiSynths.getMidiSynths(Predicate<MidiSynth> tester) The list of MidiSynths which match the specified criteria.static MidiSynthloadFromResource(Class clazz, String insResourcePath) Read one MidiSynth from an JJazzLab internal .ins resource file.booleanremoveMidiSynth(MidiSynth midiSynth) Remove the specified MidiSynth.voidRemove PropertyChangeListener.Show a dialog to select a MidiSynth definition file.
-
Field Details
-
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
-
JJAZZLAB_SOUNDFONT_GS_SYNTH_NAME
-
JJAZZLAB_SOUNDFONT_XG_SYNTH_NAME
-
YAMAHA_REF_SYNTH_NAME
-
-
Method Details
-
getInstance
Get the instance.Upon creation the MidiSynthManager contains at least the GM/GM2/XG/GS MidiSynths.
- Returns:
-
addMidiSynth
Add the specified MidiSynth.- Parameters:
midiSynth-- Returns:
- True if midiSynth was successfully added, false if midiSynth was already referenced by the MidiSynthManager.
-
removeMidiSynth
Remove the specified MidiSynth.- Parameters:
midiSynth-- Returns:
-
getMidiSynths
The list of MidiSynths.- Returns:
- Can be empty.
-
getMidiSynths
The list of MidiSynths which match the specified criteria.- Parameters:
tester-- Returns:
- An unmodifiable list, which can be empty.
-
getMidiSynth
Search a MidiSynth with the specified name.- Parameters:
name-- Returns:
- Can be null.
-
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
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
Add PropertyChangeListener.- Parameters:
listener-
-
removePropertyChangeListener
Remove PropertyChangeListener.- Parameters:
listener-
-