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
Modifier and TypeClassDescriptionstatic class
Copy the default Midi files in the app config directory.static class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addMidiSynth
(MidiSynth midiSynth) Add the specified MidiSynth.void
Add PropertyChangeListener.static MidiSynthManager
Get 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 MidiSynth
loadFromResource
(Class clazz, String insResourcePath) Read one MidiSynth from an JJazzLab internal .ins resource file.boolean
removeMidiSynth
(MidiSynth midiSynth) Remove the specified MidiSynth.void
Remove 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
-
-