|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.properties.SimpleSound
Implementation of wyvern.lib.Alert, the most basic sound type in Wyvern's audio framework.
It's best not to use new Alert() unless you need to control the volume level. Instead, use Alert.get(path) to get a shared, cached version. Should only be used for very short sounds, since it provides no way to stop the sound or modify its volume. That means that if the sound starts, and a player who hears it moves out of the map, it will continue to play until it's finished.
Field Summary | |
protected double |
gain_
Relative volume at which to play the Alert on the client. |
protected java.lang.String |
path_
Relative path to the sound file. |
Constructor Summary | |
SimpleSound()
No-arg constructor. |
|
SimpleSound(java.lang.String path)
Constructs a new SimpleSound for the specified sound file. |
|
SimpleSound(java.lang.String path,
double gain)
Constructs a new SimpleSound |
Method Summary | |
static Alert |
get(java.lang.String path)
Returns an Alert for the specified file. |
double |
getGain()
Returns the gain for this sound. |
java.lang.String |
getPath()
Returns the relative path to the sound file to play. |
void |
setGain(double gain)
Sets the volume for the alert. |
void |
setPath(java.lang.String path)
Sets the relative path to the sound file to play. |
java.lang.String |
toString()
Returns debugging string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String path_
protected double gain_
Constructor Detail |
public SimpleSound()
public SimpleSound(java.lang.String path)
path
- the path to the sound file to playpublic SimpleSound(java.lang.String path, double gain)
path
- the relative path to the filegain
- the volume to play it at (0.0-1.0)Method Detail |
public static Alert get(java.lang.String path)
path
- the relative path to a sound file
public java.lang.String toString()
public java.lang.String getPath()
getPath
in interface Alert
public void setPath(java.lang.String path)
setPath
in interface Alert
path
- the relative path to the sound file to play.public double getGain()
getGain
in interface Alert
public void setGain(double gain)
setGain
in interface Alert
gain
- the gain (sound volume), from 0.0 to 1.0
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |