org.xith3d.sound.drivers.joal
Class SoundDriverImpl

java.lang.Object
  extended by org.xith3d.sound.SoundDriver
      extended by org.xith3d.sound.drivers.joal.SoundDriverImpl

public class SoundDriverImpl
extends SoundDriver

Sound Driver Implementation for JOAL (Java Open Audio Library, OpenAL binding).


Field Summary
 
Fields inherited from class org.xith3d.sound.SoundDriver
availableSources, buffers, sources
 
Constructor Summary
SoundDriverImpl()
           
 
Method Summary
 SoundBuffer allocateSoundBuffer()
          
protected  void checkError()
           
protected  SoundSource createSoundSource()
          
protected  java.lang.String decodeSoundError(int error)
           
 boolean delete(SoundSource source)
          
protected  net.java.games.joal.AL getAL()
           
protected  void initSoundDevice()
          
 void newFrameAsync()
          Call this method once a frame to check and possibly load the next buffer from all the streaming sources, as well as dequeue all processed buffers.
 void newFrameSync()
          Call this method once a frame to check and possibly load the next buffer from all the streaming sources, as well as dequeue all processed buffers.
 void setDopplerFactor(float factor)
          
 void setDopplerVelocity(float velocity)
          
 void setListenerOrientation(org.openmali.vecmath2.Tuple3f direction, org.openmali.vecmath2.Tuple3f up)
          
 void setListenerPosition(org.openmali.vecmath2.Tuple3f position)
          
 void setListenerVelocity(org.openmali.vecmath2.Tuple3f velocity)
          
 void setListenerVolume(float gain)
          
protected  void shutdownImpl()
          
protected  void startImpl()
          
 
Methods inherited from class org.xith3d.sound.SoundDriver
allocateSoundSource, delete, getDopplerFactor, getDopplerVelocity, getListenerVolume, getNumActiveSources, getNumAvailableSources, getNumSources, isOnline, setOnline, shutdown, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundDriverImpl

public SoundDriverImpl()
Method Detail

getAL

protected final net.java.games.joal.AL getAL()

decodeSoundError

protected java.lang.String decodeSoundError(int error)

checkError

protected void checkError()

startImpl

protected void startImpl()

Specified by:
startImpl in class SoundDriver

newFrameSync

public void newFrameSync()
Call this method once a frame to check and possibly load the next buffer from all the streaming sources, as well as dequeue all processed buffers. This will operate synchronously, so it will not return until the work is complete.

Specified by:
newFrameSync in class SoundDriver

newFrameAsync

public void newFrameAsync()
Call this method once a frame to check and possibly load the next buffer from all the streaming sources, as well as dequeue all processed buffers. This will operate asynchronously and will return immediately. If it is already processing from the last frame then it will skip this frame. The thread used is a high priority thread so that it can complete its task in as little time as possible while still reducing frame stutter. This is because this is mostly I/O bound and will enter wait states, thus freeing CPU for rendering.

Specified by:
newFrameAsync in class SoundDriver

setListenerVelocity

public void setListenerVelocity(org.openmali.vecmath2.Tuple3f velocity)

Overrides:
setListenerVelocity in class SoundDriver

setListenerPosition

public void setListenerPosition(org.openmali.vecmath2.Tuple3f position)

Overrides:
setListenerPosition in class SoundDriver

setListenerOrientation

public void setListenerOrientation(org.openmali.vecmath2.Tuple3f direction,
                                   org.openmali.vecmath2.Tuple3f up)

Overrides:
setListenerOrientation in class SoundDriver

setListenerVolume

public void setListenerVolume(float gain)

Overrides:
setListenerVolume in class SoundDriver

setDopplerVelocity

public void setDopplerVelocity(float velocity)

Overrides:
setDopplerVelocity in class SoundDriver

setDopplerFactor

public void setDopplerFactor(float factor)

Overrides:
setDopplerFactor in class SoundDriver

createSoundSource

protected SoundSource createSoundSource()

Specified by:
createSoundSource in class SoundDriver

allocateSoundBuffer

public SoundBuffer allocateSoundBuffer()

Specified by:
allocateSoundBuffer in class SoundDriver

delete

public boolean delete(SoundSource source)

Overrides:
delete in class SoundDriver
Returns:
true, if the source was part of this driver, false otherwise.

shutdownImpl

protected void shutdownImpl()

Specified by:
shutdownImpl in class SoundDriver

initSoundDevice

protected void initSoundDevice()

Specified by:
initSoundDevice in class SoundDriver