|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object world.sound.tunes.MusicBox
public class MusicBox
Represents/initializes the MIDI synthesizer and manages the channels/instruments in the MIDI program. Based in part on a class originally designed by Viera K. Proulx.
Field Summary |
---|
Constructor Summary | |
---|---|
MusicBox()
The default constructor just initializes the MIDI synthesizer and sets the default program for the instruments. |
|
MusicBox(int... instruments)
The MIDI synthesizer can also be initialized with a list of instrument numbers rather than setting the default program. |
Method Summary | |
---|---|
int |
getProgram(int channel)
Produce the instrument currently assigned to the given channel. |
void |
initChannels()
Initialize the program to the default set of instruments defined in SoundConstants . |
void |
initChannels(int... instruments)
Initialize the MIDI channels to the given set of instruments. |
boolean |
isReady()
Has this music box been initialized? |
void |
playOff(java.util.ArrayList<Tune> tunes)
Stop playing all tunes in the given list of Tune s. |
void |
playOn(java.util.ArrayList<Tune> tunes)
Play all tunes in the given list of Tune s |
void |
playTune(Tune tune)
Play the given tune on the channel assigned to it. |
void |
stopTune(Tune tune)
Stop playing the given tune on the channel assigned to it. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MusicBox()
public MusicBox(int... instruments)
Method Detail |
---|
public void initChannels()
SoundConstants
.
public void initChannels(int... instruments)
SoundConstants
) to assign to the channels.
public int getProgram(int channel)
public void playOn(java.util.ArrayList<Tune> tunes)
Tune
s
public void playTune(Tune tune)
public void playOff(java.util.ArrayList<Tune> tunes)
Tune
s.
public void stopTune(Tune tune)
public boolean isReady()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |