|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.genuts.audio.SoundList
Loads and holds a bunch of audio files whose locations are specified relative to a fixed base URL.
Once an instance of SoundList is created, each audio clip is loaded with
the method startLoading
. Then you can choose
to play it one time or in loop.
A sound list can be muted. In mute mode, all audio clips in loop are stopped and no more sounds are played. When the mute mode is leaved, all audio clips in loop are started and new audio clips are played.
AudioClip loading is done asynchronously. First, the relative URL is used, in
resources, to try to get the AudioClip from the jarfile. If it doesn't
work, the URL formed with the base URL and the relative URL is used. If
once again, it doesn't work, the URL formed with only the relative
URL is used.
If the AudioClip is not found, an error is writen to the error output stream.
This object can be used in an Applet (using java 1.1) or in an application (using java 2).
Constructor Summary | |
SoundList(java.applet.Applet applet,
java.net.URL baseURL)
Creates a new sound list for an Applet. |
|
SoundList(java.net.URL baseURL)
Creates a new sound list for an Application. |
Method Summary | |
boolean |
isMute()
Indicates if this sound list is in mute mode. |
void |
loopClip(java.lang.String relativeURL)
Starts playing the audio clip with the specidied relative URL in a loop. |
void |
playClip(java.lang.String relativeURL)
Starts playing the audio clip with the specidied relative URL. |
void |
setMute(boolean mute)
Sets the mute mode for this sound list. |
void |
startLoading(java.lang.String relativeURL)
Starts loading an audio clip. |
void |
stopClip(java.lang.String relativeURL)
Stops playing the audio clip with the specidied relative URL. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SoundList(java.applet.Applet applet, java.net.URL baseURL)
applet
- Applet associated with this sound list.baseURL
- Base URL from which audio clips will be loaded.public SoundList(java.net.URL baseURL)
baseURL
- Base URL from which audio clips will be loaded.Method Detail |
public void startLoading(java.lang.String relativeURL)
relativeURL
- Relative URL from which the audio
clip will be load.public void stopClip(java.lang.String relativeURL)
relativeURL
- Relative URL of the audio clip
which has to be stopped.public void playClip(java.lang.String relativeURL)
If this sound list is in mute mode, this method does nothing.
relativeURL
- Relative URL of the audio clip
which has to be played.public void loopClip(java.lang.String relativeURL)
relativeURL
- Relative URL of the audio clip
which has to be played in loop.public void setMute(boolean mute)
mute
- true
to mute all audio clips which
were muted, otherwise mutes all audio clips which are played in
loop.public boolean isMute()
true
if this sound list is in mute
mode, false
otherwise.
|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |