org.xith3d.sound.drivers.joal
Class SoundSourceImpl

java.lang.Object
  extended by org.xith3d.sound.drivers.joal.SoundSourceImpl
All Implemented Interfaces:
SoundSource

public class SoundSourceImpl
extends java.lang.Object
implements SoundSource

JOAL implementation of SoundSource.


Constructor Summary
SoundSourceImpl(SoundDriverImpl driver)
           
 
Method Summary
 SoundDriver getSoundDriver()
           
 SoundState getState()
           
 boolean isPlaying()
           
 void pause()
           
 void play()
           
 void queueBuffer(SoundBuffer buffer)
          Description: Specify the current Buffer object, which means the head entry in its queue.
 void rewind()
           
 void setBuffer(SoundBuffer buffer)
           
 void setContainer(SoundContainer container)
          An alternate to explicitly providing the buffers via the queueBuffer method is to provide a sound data container which will generate the data needed to create the buffers.
 void setDirection(float dirX, float dirY, float dirZ)
          Description: If DIRECTION does not equal the zero vector, the Source is directional.
 void setDirection(org.openmali.vecmath2.Tuple3f direction)
          Description: If DIRECTION does not equal the zero vector, the Source is directional.
 void setLoop(boolean loop)
          LOOPING is a flag that indicates that the Source will not be in STOPPED state once it reaches the end of last buffer in the buffer queue.
 void setMaxDistance(float maxDistance)
           
 void setMaxTime(long ms)
           
 void setMaxVolume(float maxVolume)
           
 void setMinVolume(float minVolume)
           
 void setPosition(float posX, float posY, float posZ)
           
 void setPosition(org.openmali.vecmath2.Tuple3f position)
           
 void setReferenceDistance(float refDistance)
          REFERENCE_DISTANCE is the distance at which the Listener will experience GAIN (unless the implementation had to clamp effective GAIN to the available dynamic range).
 void setRelative(boolean relative)
          SOURCE_RELATIVE set to TRUE indicates that the values specified by POSITION are to be interpreted relative to the listener position
 void setRolloffFactor(float factor)
          Set to zero if this is an unattenuated sound, 1 would be normal otherwise
 void setVelocity(float veloX, float veloY, float veloZ)
           
 void setVelocity(org.openmali.vecmath2.Tuple3f velocity)
           
 void setVolume(float gain)
           
 void stop()
           
 int[] unqueueProcessedBuffers()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundSourceImpl

public SoundSourceImpl(SoundDriverImpl driver)
Method Detail

queueBuffer

public void queueBuffer(SoundBuffer buffer)
Description copied from interface: SoundSource
Description: Specify the current Buffer object, which means the head entry in its queue. Using BUFFER with the Source command on a STOPPED or INITIAL Source empties the entire queue, then appends the one Buffer specified.

For a PLAYING or PAUSED Source, using the Source command with BUFFER is an INVALID_OPERATION. It can be applied to INITIAL and STOPPED Sources only. Specifying an invalid bufferName will result in an INVALID_VALUE error while specifying an invalid sourceName results in an INVALID_NAME error.

Specified by:
queueBuffer in interface SoundSource

unqueueProcessedBuffers

public int[] unqueueProcessedBuffers()

setBuffer

public void setBuffer(SoundBuffer buffer)

setContainer

public void setContainer(SoundContainer container)
Description copied from interface: SoundSource
An alternate to explicitly providing the buffers via the queueBuffer method is to provide a sound data container which will generate the data needed to create the buffers. All the loaders provided in xith3d.sound.loaders create SoundDataContainers. Setting a sound container is the only way to play streaming sounds as the sound manager will make sure to continue to request sounds from the container.

Specified by:
setContainer in interface SoundSource

setVolume

public void setVolume(float gain)
Specified by:
setVolume in interface SoundSource

play

public void play()
Specified by:
play in interface SoundSource

pause

public void pause()
Specified by:
pause in interface SoundSource

rewind

public void rewind()
Specified by:
rewind in interface SoundSource

stop

public void stop()
Specified by:
stop in interface SoundSource

isPlaying

public boolean isPlaying()
Specified by:
isPlaying in interface SoundSource

setPosition

public void setPosition(float posX,
                        float posY,
                        float posZ)
Specified by:
setPosition in interface SoundSource

setPosition

public void setPosition(org.openmali.vecmath2.Tuple3f position)
Specified by:
setPosition in interface SoundSource

setVelocity

public void setVelocity(float veloX,
                        float veloY,
                        float veloZ)
Specified by:
setVelocity in interface SoundSource

setVelocity

public void setVelocity(org.openmali.vecmath2.Tuple3f velocity)
Specified by:
setVelocity in interface SoundSource

setDirection

public void setDirection(float dirX,
                         float dirY,
                         float dirZ)
Description copied from interface: SoundSource
Description: If DIRECTION does not equal the zero vector, the Source is directional. The sound emission is presumed to be symmetric around the direction vector (cylinder symmetry). Sources are not oriented in full 3 degrees of freedom, only two angles are effectively needed. The zero vector is default, indicating that a Source is not directional. Specifying a non-zero vector will make the Source directional. Specifying a zero vector for a directional Source will effectively mark it as nondirectional.

Specified by:
setDirection in interface SoundSource

setDirection

public void setDirection(org.openmali.vecmath2.Tuple3f direction)
Description copied from interface: SoundSource
Description: If DIRECTION does not equal the zero vector, the Source is directional. The sound emission is presumed to be symmetric around the direction vector (cylinder symmetry). Sources are not oriented in full 3 degrees of freedom, only two angles are effectively needed. The zero vector is default, indicating that a Source is not directional. Specifying a non-zero vector will make the Source directional. Specifying a zero vector for a directional Source will effectively mark it as nondirectional.

Specified by:
setDirection in interface SoundSource

getState

public SoundState getState()
Specified by:
getState in interface SoundSource

setReferenceDistance

public void setReferenceDistance(float refDistance)
Description copied from interface: SoundSource
REFERENCE_DISTANCE is the distance at which the Listener will experience GAIN (unless the implementation had to clamp effective GAIN to the available dynamic range).

Specified by:
setReferenceDistance in interface SoundSource

setRolloffFactor

public void setRolloffFactor(float factor)
Set to zero if this is an unattenuated sound, 1 would be normal otherwise

Specified by:
setRolloffFactor in interface SoundSource
Parameters:
factor -

setRelative

public void setRelative(boolean relative)
Description copied from interface: SoundSource
SOURCE_RELATIVE set to TRUE indicates that the values specified by POSITION are to be interpreted relative to the listener position

Specified by:
setRelative in interface SoundSource

setLoop

public void setLoop(boolean loop)
Description copied from interface: SoundSource
LOOPING is a flag that indicates that the Source will not be in STOPPED state once it reaches the end of last buffer in the buffer queue. Instead, the Source will immediately promote to INITIAL and PLAYING. The default value is FALSE. LOOPING can be changed on a Source in any execution state. In particular, it can be changed on a PLAYING Source

Specified by:
setLoop in interface SoundSource

setMaxVolume

public void setMaxVolume(float maxVolume)
Specified by:
setMaxVolume in interface SoundSource

setMinVolume

public void setMinVolume(float minVolume)
Specified by:
setMinVolume in interface SoundSource

setMaxDistance

public void setMaxDistance(float maxDistance)
Specified by:
setMaxDistance in interface SoundSource

setMaxTime

public void setMaxTime(long ms)
Specified by:
setMaxTime in interface SoundSource

getSoundDriver

public SoundDriver getSoundDriver()
Specified by:
getSoundDriver in interface SoundSource