wyvern.lib
Interface Sound

All Superinterfaces:
Alert, Music
All Known Implementing Classes:
MovableSoundSource

public interface Sound
extends Music

Represents a physical sound. Physical sounds have to stop when a listener leaves the map.

Version:
1.0, Jul 25, 2003
Author:
Steve Yegge

Field Summary
 
Fields inherited from interface wyvern.lib.Music
DEFAULT_COMBAT_MUSIC, DEFAULT_FUNERAL_MUSIC, DEFAULT_GAIN, DEFAULT_LEVELUP_MUSIC, DEFAULT_LOW_HP_COMBAT_MUSIC, DEFAULT_REPEAT_DELAY, DEFAULT_REPEATS, LOOP_FOREVER, PRIORITY_HIGH, PRIORITY_NORMAL
 
Method Summary
 void broadcast()
          Plays the sound to everyone in range.
 java.lang.String getID()
          Specifies a unique ID for this sound, so it can be cancelled later.
 java.lang.String getStopSubject()
          Pubsub subject for notification from the client when the sound has finished playing.
 void stop()
          Stops playing the sound (for everyone who can hear it).
 
Methods inherited from interface wyvern.lib.Music
getRepeatDelay, getRepeats, setRepeatDelay, setRepeats
 
Methods inherited from interface wyvern.lib.Alert
getGain, getPath, setGain, setPath
 

Method Detail

getStopSubject

public java.lang.String getStopSubject()
Pubsub subject for notification from the client when the sound has finished playing. If you want to know when a particular player has finished listening to a sound, use Kernel.subscribe() with this subject string to receive the notification.

Returns:
a subject to listen for, via wyvern.lib.Kernel.subscribe(), that says that this particular instance of a RemoteSound has finished playing Message body is the name of the player that notified us that the sound has stopped.

Returns null if this is not a stoppable sound, i.e. the ID is "-1".


broadcast

public void broadcast()
Plays the sound to everyone in range. Only used by the server.


getID

public java.lang.String getID()
Specifies a unique ID for this sound, so it can be cancelled later.


stop

public void stop()
Stops playing the sound (for everyone who can hear it). (Optional operation)