Interface MidiMixManager

All Known Implementing Classes:
DefaultMidiMixManager

public interface MidiMixManager
A service provider to obtain MidiMix instances for songs and rhythms.
  • Method Details

    • getDefault

      static MidiMixManager getDefault()
    • 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

      MidiMix findExistingMix(Song s)
      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

      MidiMix findMix(Rhythm r)
      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

      MidiMix createMix(Song sg) throws MidiUnavailableException
      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

      MidiMix createMix(Rhythm r)
      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.