Atavism Version 2018.1AGIS API

atavism.server.plugins
Class WorldManagerClient.SoundMessage

java.lang.Object
  extended by atavism.msgsys.Message
      extended by atavism.msgsys.SubjectMessage
          extended by atavism.server.plugins.WorldManagerClient.SoundMessage
All Implemented Interfaces:
HasTarget, ClientMessage, java.io.Serializable
Enclosing class:
WorldManagerClient

public static class WorldManagerClient.SoundMessage
extends SubjectMessage
implements ClientMessage, HasTarget

Control sounds played on the client. A sound message is a set of sound start commands and sound stop commands. Additionally, the message may have a clear all sound flag. The sounds are processed in the order: clear flag, stop commands, start commands. A sound message describes either point sounds or ambient sounds. Point sounds emit from a single object and attentuate over distance. Ambient sounds have no source object and do not attenuate. The 'add' methods start sounds, the 'remove' methods stop sounds. Start sounds are described with a SoundData object. Stop sounds are identified by their (file) name.

See Also:
Serialized Form

Field Summary
static byte soundTypeAmbient
           
static byte soundTypePoint
           
 
Fields inherited from class atavism.msgsys.SubjectMessage
oid
 
Constructor Summary
WorldManagerClient.SoundMessage()
           
WorldManagerClient.SoundMessage(OID oid)
           
 
Method Summary
 void addSound(SoundData data)
          Add a sound to start.
 void addSound(java.lang.String fileName, boolean looping)
          Add a sound.
 void addSound(java.lang.String fileName, boolean looping, float gain)
          Add a sound.
 boolean getClearFlag()
          Get the clear flag.
 java.util.List<SoundData> getSoundData()
          Get the sounds to start.
 OID getTarget()
           
 byte getType()
          Get the sound message type.
 void removeSound(java.lang.String fileName)
          Stop a sound.
 void setClearFlag(boolean val)
          Set the clear flag.
 void setSoundData(java.util.List<SoundData> soundData)
          Set the sounds to start.
 void setTarget(OID target)
           
 void setType(byte type)
          Set the sound message type.
 AOByteBuffer toBuffer()
           
 java.lang.String toString()
           
 
Methods inherited from class atavism.msgsys.SubjectMessage
getSubject, setSubject
 
Methods inherited from class atavism.msgsys.Message
getEnqueueTime, getMsgId, getMsgType, getSenderName, isRPC, setEnqueueTime, setEnqueueTime, setMsgType, toBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

soundTypePoint

public static final byte soundTypePoint
See Also:
Constant Field Values

soundTypeAmbient

public static final byte soundTypeAmbient
See Also:
Constant Field Values
Constructor Detail

WorldManagerClient.SoundMessage

public WorldManagerClient.SoundMessage()

WorldManagerClient.SoundMessage

public WorldManagerClient.SoundMessage(OID oid)
Method Detail

getTarget

public OID getTarget()
Specified by:
getTarget in interface HasTarget

setTarget

public void setTarget(OID target)
Specified by:
setTarget in interface HasTarget

setSoundData

public void setSoundData(java.util.List<SoundData> soundData)
Set the sounds to start.


getSoundData

public java.util.List<SoundData> getSoundData()
Get the sounds to start.


addSound

public void addSound(SoundData data)
Add a sound to start.


setType

public void setType(byte type)
Set the sound message type.


getType

public byte getType()
Get the sound message type.


setClearFlag

public void setClearFlag(boolean val)
Set the clear flag. Current sounds are cleared before starting new sounds.


getClearFlag

public boolean getClearFlag()
Get the clear flag.


addSound

public void addSound(java.lang.String fileName,
                     boolean looping)
Add a sound.

Parameters:
fileName - the sound name
looping - start a looping sound. Sets the "Loop" property to "true" or "false".

addSound

public void addSound(java.lang.String fileName,
                     boolean looping,
                     float gain)
Add a sound.

Parameters:
fileName - the sound name
looping - start a looping sound. Sets the "Loop" property to "true" or "false".
gain - the initial sound gain (volume). Ranges from 0.0 to 1.0.

removeSound

public void removeSound(java.lang.String fileName)
Stop a sound.


toString

public java.lang.String toString()
Overrides:
toString in class SubjectMessage

toBuffer

public AOByteBuffer toBuffer()
Specified by:
toBuffer in interface ClientMessage


Copyright © 2018 Dragonsan Studios Sp. z o.o.