Package org.jjazz.midimix.api
Class MidiMixManager
java.lang.Object
org.jjazz.midimix.api.MidiMixManager
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
Global instance to obtain MidiMixes for songs and rhythms.
-
Method Summary
Modifier and TypeMethodDescriptionCreate a MidiMix for the specified rhythm.Create a new MidiMix for the specified song.Find a mix which must be existing.Try to get a MidiMix for the specified Rhythm in the following order:Get a MidiMix for the specified song in the following order.static MidiMixManager
void
-
Method Details
-
getInstance
-
findMix
Get a MidiMix for the specified song in the following order.1. If the mix for song s already exists, just return it
2. Load mix from song mix file
3. Create a new mix for s using findMix(Rhythm) for each song's rhythm- Parameters:
s
-- Returns:
- A valid MidiMix usable for the specified song.
- Throws:
MidiUnavailableException
-
findExistingMix
Find a mix which must be existing.If you're not sure if a MidiMix was already created for the specified song, use findMix(Song) instead.
- Parameters:
s
-- Returns:
- Can't be null
- Throws:
IllegalStateException
- If no mix found
-
findMix
Try to get a MidiMix for the specified Rhythm in the following order:1. Load mix from the default rhythm mix file
2. Create a new mix for r- Parameters:
r
-- Returns:
- Can't be null
-
createMix
Create a new MidiMix for the specified song.Use the default rhythm mix for each song's rhythm. Create UserRhythmVoices key if song as some user phrases.
- Parameters:
sg
-- Returns:
- Throws:
MidiUnavailableException
- If there is not enough available channels to accomodate song's rhythms, or other errors.
-
createMix
Create a MidiMix for the specified rhythm.Create one InstrumentMix per rhythm voice, using rhythm voice's preferred instrument and settings, and preferred channel (except if several voices share the same preferred channel) .
- Parameters:
r
- If r is- Returns:
- A MidiMix associated to this rhythm. Rhythm voices are used as keys for InstrumentMixes.
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-