org.xith3d.sound.drivers.joal
Class SoundDriverImpl

java.lang.Object
  extended by org.xith3d.sound.drivers.joal.SoundDriverImpl
All Implemented Interfaces:
SoundDriver

public class SoundDriverImpl
extends java.lang.Object
implements SoundDriver

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


Constructor Summary
SoundDriverImpl()
           
 
Method Summary
 SoundBuffer allocateSoundBuffer()
          
 SoundSource allocateSoundSource()
          
protected  void checkError()
           
protected  java.lang.String decodeSoundError(int error)
           
 void delete(SoundBuffer buffer)
          
 void delete(SoundSource source)
          
protected  net.java.games.joal.AL getAL()
           
 float getDopplerFactor()
          
 float getDopplerVelocity()
          
 float getListenerVolume()
          
 int getNumAvailableSources()
          
 int getNumSources()
          
 boolean isOnline()
          
 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)
          
 void shutdown()
          
 
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 net.java.games.joal.AL getAL()

decodeSoundError

protected java.lang.String decodeSoundError(int error)

checkError

protected void checkError()

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 interface 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 interface SoundDriver

setListenerVelocity

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

Specified by:
setListenerVelocity in interface SoundDriver

setListenerPosition

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

Specified by:
setListenerPosition in interface SoundDriver

setListenerOrientation

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

Specified by:
setListenerOrientation in interface SoundDriver

setListenerVolume

public void setListenerVolume(float gain)

Specified by:
setListenerVolume in interface SoundDriver

getListenerVolume

public float getListenerVolume()

Specified by:
getListenerVolume in interface SoundDriver

setDopplerVelocity

public void setDopplerVelocity(float velocity)

Specified by:
setDopplerVelocity in interface SoundDriver

getDopplerVelocity

public float getDopplerVelocity()

Specified by:
getDopplerVelocity in interface SoundDriver

setDopplerFactor

public void setDopplerFactor(float factor)

Specified by:
setDopplerFactor in interface SoundDriver

getDopplerFactor

public float getDopplerFactor()

Specified by:
getDopplerFactor in interface SoundDriver

allocateSoundSource

public SoundSource allocateSoundSource()
                                throws SoundException

Specified by:
allocateSoundSource in interface SoundDriver
Throws:
SoundException

allocateSoundBuffer

public SoundBuffer allocateSoundBuffer()

Specified by:
allocateSoundBuffer in interface SoundDriver

delete

public void delete(SoundSource source)

Specified by:
delete in interface SoundDriver

delete

public void delete(SoundBuffer buffer)

Specified by:
delete in interface SoundDriver

getNumAvailableSources

public int getNumAvailableSources()

Specified by:
getNumAvailableSources in interface SoundDriver

getNumSources

public int getNumSources()

Specified by:
getNumSources in interface SoundDriver

shutdown

public void shutdown()

Specified by:
shutdown in interface SoundDriver

isOnline

public final boolean isOnline()

Specified by:
isOnline in interface SoundDriver