Class DefaultMidiMixManager

java.lang.Object
org.jjazz.midimix.api.DefaultMidiMixManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, MidiMixManager

public class DefaultMidiMixManager extends Object implements MidiMixManager, PropertyChangeListener
  • Constructor Details

    • DefaultMidiMixManager

      public DefaultMidiMixManager()
  • Method Details

    • getInstance

      public static DefaultMidiMixManager getInstance()
    • findMix

      public MidiMix findMix(Song s) throws MidiUnavailableException
      Description copied from interface: MidiMixManager
      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

      Specified by:
      findMix in interface MidiMixManager
      Parameters:
      s -
      Returns:
      A valid MidiMix usable for the specified song.
      Throws:
      MidiUnavailableException
    • findExistingMix

      public MidiMix findExistingMix(Song s)
      Description copied from interface: MidiMixManager
      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.

      Specified by:
      findExistingMix in interface MidiMixManager
      Parameters:
      s -
      Returns:
      Can't be null
    • findMix

      public MidiMix findMix(Rhythm r)
      Description copied from interface: MidiMixManager
      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

      Specified by:
      findMix in interface MidiMixManager
      Parameters:
      r -
      Returns:
      Can't be null
    • createMix

      public MidiMix createMix(Song sg) throws MidiUnavailableException
      Description copied from interface: MidiMixManager
      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.

      Specified by:
      createMix in interface MidiMixManager
      Parameters:
      sg -
      Returns:
      Throws:
      MidiUnavailableException - If there is not enough available channels to accomodate song's rhythms, or other errors.
    • createMix

      public MidiMix createMix(Rhythm r)
      Description copied from interface: MidiMixManager
      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) .

      Specified by:
      createMix in interface MidiMixManager
      Parameters:
      r - If r is
      Returns:
      A MidiMix associated to this rhythm. Rhythm voices are used as keys for InstrumentMixes.
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Specified by:
      propertyChange in interface PropertyChangeListener