Package org.jjazz.activesong.spi
Interface ActiveSongManager
public interface ActiveSongManager
A service provider which manages the active song and MidiMix.
Midi messages are sent upon MidiMix changes depending on getSendMessagePolicy(). If last song is closed, active song is reset to null.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
When to send Midi Messages. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Listen the active song changes.void
static ActiveSongManager
Get the default implementation.isActivable
(Song sg) void
void
void
Send the Midi messages upon activation of a MidiMix.void
Send the midi messages to initialize all the instrument mixes of the active MidiMix.void
Send the midi messages to set the volume of all the instruments of the active MidiMix.boolean
Set the specified song and MidiMix as active:
- send MidiMessages for all MidiMix parameters at activation
- listen to MidiMix changes and send the related Midi messages according to the SendPolicy
- reset MusicController session
- Fire a PROP_ACTIVE_SONG change event (oldValue=mm, newValue=sg)void
-
Field Details
-
PROP_ACTIVE_SONG
oldValue=MidiMix, newValue=Song- See Also:
-
-
Method Details
-
getDefault
Get the default implementation.- Returns:
- Can't be null
-
getActiveMidiMix
MidiMix getActiveMidiMix() -
getActiveSong
Song getActiveSong() -
setActive
Set the specified song and MidiMix as active:
- send MidiMessages for all MidiMix parameters at activation
- listen to MidiMix changes and send the related Midi messages according to the SendPolicy
- reset MusicController session
- Fire a PROP_ACTIVE_SONG change event (oldValue=mm, newValue=sg)- Parameters:
sg
- If null, mm will be set to null as well.mm
-- Returns:
- False is mm could not be activated.
-
getSendMidiMessagePolicy
EnumSet<ActiveSongManager.SendMidiMessagePolicy> getSendMidiMessagePolicy() -
isActivable
- Parameters:
sg
-- Returns:
- Null if song can be activated, otherwise a string explaining the reason why it can not be activated.
-
addPropertyListener
Listen the active song changes.- Parameters:
l
-
-
addPropertyListener
-
removePropertyListener
-
removePropertyListener
-
sendActivationMessages
void sendActivationMessages()Send the Midi messages upon activation of a MidiMix. -
sendAllMidiMixMessages
void sendAllMidiMixMessages()Send the midi messages to initialize all the instrument mixes of the active MidiMix. -
sendAllMidiVolumeMessages
void sendAllMidiVolumeMessages()Send the midi messages to set the volume of all the instruments of the active MidiMix. -
setSendMidiMessagePolicy
-