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.

  • Field Details

  • Method Details

    • getDefault

      static ActiveSongManager getDefault()
      Get the default implementation.
      Returns:
      Can't be null
    • getActiveMidiMix

      MidiMix getActiveMidiMix()
    • getActiveSong

      Song getActiveSong()
    • setActive

      boolean setActive(Song sg, MidiMix mm)
      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

    • isActivable

      String isActivable(Song sg)
      Parameters:
      sg -
      Returns:
      Null if song can be activated, otherwise a string explaining the reason why it can not be activated.
    • addPropertyListener

      void addPropertyListener(PropertyChangeListener l)
      Listen the active song changes.
      Parameters:
      l -
    • addPropertyListener

      void addPropertyListener(String prop, PropertyChangeListener l)
    • removePropertyListener

      void removePropertyListener(PropertyChangeListener l)
    • removePropertyListener

      void removePropertyListener(String prop, PropertyChangeListener l)
    • 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

      void setSendMidiMessagePolicy(EnumSet<ActiveSongManager.SendMidiMessagePolicy> policy)