|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.sound.ClipPlayer
public class ClipPlayer
Utility for loading and playing sound clips. Stores a preference in the user preferences for being silent. The property will persist and be reloaded after the virtual machine has been stopped and restarted.
| Method Summary | |
|---|---|
boolean |
getBeSilent()
Will we make noise? |
static ClipPlayer |
getInstance()
|
void |
playClip(java.lang.String clipName,
java.lang.Class<SoundPath> resourceLocation)
Clips are located using Class.getResource(). |
void |
preLoadClip(java.lang.String clipName,
java.lang.Class<SoundPath> resourceLocation)
To reduce the delay when the clip is first played, we can preload clips here. |
void |
setBeSilent(boolean aBool)
If set to true, no sounds will play. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ClipPlayer getInstance()
public boolean getBeSilent()
public void setBeSilent(boolean aBool)
public void playClip(java.lang.String clipName,
java.lang.Class<SoundPath> resourceLocation)
clipName - String - the file name of the clipresourceLocation - Class - the location of the clip.
public void preLoadClip(java.lang.String clipName,
java.lang.Class<SoundPath> resourceLocation)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||