|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabc.midi.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. |
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 |
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()
BasicMidiConverter
public 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 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.MetaEventListener
public void start()
public void stopPlaying()
public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |