|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uiuc.cs397rhc.sound.SoundFilePlayer
edu.uiuc.cs397rhc.sound.MidiPlayer
Plays a MIDI file or Sequence. Filename can be passed on the
command line.
| Field Summary | |
|---|---|
static boolean |
DEFAULT_INSPECT
Whether or not to inspect by default the file being played. |
| Fields inherited from class edu.uiuc.cs397rhc.sound.SoundFilePlayer |
|---|
DEFAULT_LOOP |
| Fields inherited from interface edu.uiuc.cs397rhc.sound.Fadeable |
|---|
DEFAULT_FADE_DURATION, DEFAULT_SLEEP_INTERVAL |
| Constructor Summary | |
|---|---|
MidiPlayer(javax.sound.midi.Sequence sequence,
int loop,
boolean inspect)
Creates a MIDI player for the given sequence, looping the specified number of times, and optionally inspecting the playback. |
|
MidiPlayer(java.lang.String file)
|
|
MidiPlayer(java.lang.String file,
boolean inspect)
|
|
MidiPlayer(java.lang.String file,
int loop)
|
|
MidiPlayer(java.lang.String file,
int loop,
boolean inspect)
|
|
| Method Summary | |
|---|---|
javax.sound.midi.Sequence |
getSequence()
Returns the MIDI sequence this player is using. |
protected javax.sound.midi.Transmitter |
getTransmitter()
|
static void |
main(java.lang.String[] args)
Plays the MIDI file specified, optionally printing out extra information. |
protected void |
play()
Begins playback of the sequence. |
static void |
play(java.io.File file)
Plays the MIDI from the specified file. |
static void |
play(javax.sound.midi.Sequence sequence)
Plays the specified MIDI sequence, using default values for inspection and looping. |
static void |
play(javax.sound.midi.Sequence sequence,
boolean inspect)
Plays the specified MIDI sequence, optionally inspecting it, using the default looping. |
static void |
play(javax.sound.midi.Sequence sequence,
int loop,
boolean inspect)
Plays the specified MIDI sequence, optionally inspecting it, using the specified looping method. |
static void |
play(java.lang.String file)
Plays the MIDI from the file specified by the string, using the default value for inspection. |
static void |
play(java.lang.String file,
boolean inspect)
Plays the MIDI from the file specified by the string. |
void |
stop()
Causes the playback to stop. |
protected void |
stopSound()
|
void |
updateVolume()
Update the volume to reflect the current fade multiplier. |
| Methods inherited from class edu.uiuc.cs397rhc.sound.SoundFilePlayer |
|---|
fade, fade, fade, getFadeMultiplier, getFile, getLoopCount, getVolumeMultiplier, getVolumePercentage, isFading, isPlaying, setFadeMultiplier, setVolumePercentage, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_INSPECT
| Constructor Detail |
|---|
public MidiPlayer(javax.sound.midi.Sequence sequence,
int loop,
boolean inspect)
sequence - the sequence this instance will playloop - the number of times to loop the sequenceinspect - whether or not to inspect during playbackpublic MidiPlayer(java.lang.String file)
public MidiPlayer(java.lang.String file,
int loop)
public MidiPlayer(java.lang.String file,
boolean inspect)
public MidiPlayer(java.lang.String file,
int loop,
boolean inspect)
| Method Detail |
|---|
public javax.sound.midi.Sequence getSequence()
public void updateVolume()
Fadeable
updateVolume in interface FadeableupdateVolume in class SoundFilePlayerprotected javax.sound.midi.Transmitter getTransmitter()
protected void play()
inspect is true,
additional information about the MIDI system is displayed. A thread
is started that monitors playback to determine when it has stopped.
play in class SoundFilePlayerprotected void stopSound()
public void stop()
stop in class SoundFilePlayer
public static void play(java.lang.String file,
boolean inspect)
file - name of the file to playinspect - whether or not print out messages from the filepublic static void play(java.lang.String file)
file - name of the file to playpublic static void play(java.io.File file)
file - the file to playpublic static void play(javax.sound.midi.Sequence sequence)
sequence - the sequence to play
public static void play(javax.sound.midi.Sequence sequence,
boolean inspect)
sequence - the sequence to playinspect - whether or not to print out messages from the file
public static void play(javax.sound.midi.Sequence sequence,
int loop,
boolean inspect)
sequence - the sequence to playloop - the looping method to useinspect - whether or not to print out messages from the filepublic static void main(java.lang.String[] args)
args - the first element should be the name of the file to play;
if there are two arguments, information from the MIDI file will be
displayed as it is played
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||