|
||||||||||
| 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.MP3Player
MP3Player loops over a given MP3 file while providing fading
functionality.
| Field Summary |
|---|
| 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 | |
|---|---|
MP3Player(java.lang.String filename)
Creates an MP3Player for the file with the given file name. |
|
MP3Player(java.lang.String filename,
int loop)
Creates an MP3Player for the file with the given file name. |
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
|
protected void |
play()
Plays the file in a loop until isPlaying() returns
false or until the file is done looping, in which case
stop() should be called. |
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, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MP3Player(java.lang.String filename)
MP3Player for the file with the given file name.
filename - the name of the MP3 file
public MP3Player(java.lang.String filename,
int loop)
MP3Player for the file with the given file name.
filename - the name of the MP3 fileloop - the number of times to loop, -1 for infinite| Method Detail |
|---|
public void updateVolume()
Fadeable
updateVolume in interface FadeableupdateVolume in class SoundFilePlayerprotected void play()
SoundFilePlayerisPlaying() returns
false or until the file is done looping, in which case
stop() should be called.
play in class SoundFilePlayerpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||