ucar.unidata.util
Class MidiManager

java.lang.Object
  extended by ucar.unidata.util.MidiManager

public class MidiManager
extends Object

Class MidiManager provides a wrapper around the java sound midi api. This was originally taken from the javasound demo

Version:
$Revision: 1.6 $
Author:
IDV Development Team

Constructor Summary
MidiManager()
          Create a new MidiManager with defaults
MidiManager(MidiProperties props)
          Construct with the specified properties and open it.
 
Method Summary
 void close()
          todo
static Instrument[] getInstrumentList()
          Get the list of instruments
 void open()
          Open up the midi system
 void play(int key, long milliseconds)
          Play.
 void setInstrument(Instrument instrument)
          Set the instrument to use
 void setInstrument(int index)
          Set the current instrument
 void setInstrument(String instrumentName)
          Set the current instrument
 void turnOffInABit(int key, MidiChannel channel, int timeStamp, long milliseconds)
          Turn off in a thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiManager

public MidiManager()
Create a new MidiManager with defaults


MidiManager

public MidiManager(MidiProperties props)
Construct with the specified properties and open it.

Parameters:
props - properties
Method Detail

close

public void close()
todo


open

public void open()
Open up the midi system


setInstrument

public void setInstrument(int index)
Set the current instrument

Parameters:
index - index into the instruments

setInstrument

public void setInstrument(String instrumentName)
Set the current instrument

Parameters:
instrumentName - name of the instrument

setInstrument

public void setInstrument(Instrument instrument)
Set the instrument to use

Parameters:
instrument - the instrument

getInstrumentList

public static Instrument[] getInstrumentList()
Get the list of instruments

Returns:
an array of instruments

play

public void play(int key,
                 long milliseconds)
Play.

Parameters:
key - key to play in
milliseconds - length of time

turnOffInABit

public void turnOffInABit(int key,
                          MidiChannel channel,
                          int timeStamp,
                          long milliseconds)
Turn off in a thread

Parameters:
key - key to play in
channel - channel to play
timeStamp - timestamp
milliseconds - length of time