|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.htwdd.rosenkoenig.util.SoundList
public class SoundList
Utility class that works as a container for sound clips. Every clip has an identifier to access it. SoundList is designed as a singleton.
| Field Summary | |
|---|---|
private java.util.Hashtable<java.lang.String,javax.sound.sampled.Clip> |
clips
|
private static SoundList |
instance
|
private org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
private |
SoundList()
|
| Method Summary | |
|---|---|
void |
addSound(java.lang.String filename,
java.lang.String identifier)
adds a soundfile to the list |
protected void |
finalize()
|
static SoundList |
getInstance()
|
void |
loadFromFile(java.lang.String filename)
loads a number of sound files at once. |
void |
play(java.lang.String name)
plays a soundfile |
void |
removeSound(java.lang.String name)
remove a soundfile from the list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static SoundList instance
private org.apache.log4j.Logger log
private java.util.Hashtable<java.lang.String,javax.sound.sampled.Clip> clips
| Constructor Detail |
|---|
private SoundList()
| Method Detail |
|---|
public static SoundList getInstance()
public void loadFromFile(java.lang.String filename)
filename - a property file containing filenames and identifiers
public void addSound(java.lang.String filename,
java.lang.String identifier)
filename - the name of the soundfileidentifier - the identifier that is needed to play the soundpublic void removeSound(java.lang.String name)
name - identifier of the clip to be removedpublic void play(java.lang.String name)
name - identifier of the clip to be played
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||