|
abc4j API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectabc.midi.TunePlayer
public class TunePlayer
TunePlayer objects enable you to play tunes using default MIDI sequencer.
| Constructor Summary | |
|---|---|
TunePlayer()
Constructs a tune player with default midi converter. |
|
TunePlayer(MidiConverterInterface converter)
Constructs a tune player with the specified midi converter. |
|
| Method Summary | |
|---|---|
void |
addListener(TunePlayerListenerInterface listener)
Adds a listener to this tune player. |
javax.sound.midi.Instrument |
getInstrument()
Returns the instrument currently used for sequence playback. |
int |
getTempo()
Returns the tempo currently used to play tunes. |
Tune |
getTune()
The tune that is currently played, |
boolean |
isPlaying()
Returns true if this player is currently playing a tune. |
void |
meta(javax.sound.midi.MetaMessage meta)
|
void |
play(Tune tune)
Plays the given tune. |
void |
removeListener(TunePlayerListenerInterface listener)
Removes a listener from this tune player. |
void |
setInstrument(javax.sound.midi.Instrument instr)
Sets the instrument to be used for sequence playback. |
void |
setTempo(int tempo)
Sets the tempo used to play the tune. |
void |
start()
Starts the player so that it can play tunes. |
void |
stop()
Stops this player. |
void |
stopPlaying()
Stops the playing of the current tune if any. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TunePlayer()
BasicMidiConverterpublic TunePlayer(MidiConverterInterface converter)
| Method Detail |
|---|
public void addListener(TunePlayerListenerInterface listener)
listener - The listener to be added to this tune player.public void removeListener(TunePlayerListenerInterface listener)
listener - The listener to be removed from this tune player.public void setTempo(int tempo)
tempo - the tempo used to play the tune.public int getTempo()
public javax.sound.midi.Instrument getInstrument()
public void setInstrument(javax.sound.midi.Instrument instr)
throws javax.sound.midi.MidiUnavailableException
instr - The instrument to be used for sequence playback.
javax.sound.midi.MidiUnavailableExceptionpublic Tune getTune()
public void play(Tune tune)
throws java.lang.IllegalStateException
tune - The tune to be played.
java.lang.IllegalStateException - Thrown if the player hasn't been started
before.public boolean isPlaying()
public void meta(javax.sound.midi.MetaMessage meta)
meta in interface javax.sound.midi.MetaEventListenerpublic void start()
public void stopPlaying()
public void stop()
|
abc4j API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||