org.xith3d.sound.drivers.javasound
Class SoundDriverImpl

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

public class SoundDriverImpl
extends SoundDriver

JavaSound sound driver implementation.


Field Summary
 
Fields inherited from class org.xith3d.sound.SoundDriver
availableSources, buffers, sources
 
Constructor Summary
SoundDriverImpl()
           
 
Method Summary
 SoundBuffer allocateSoundBuffer()
          
protected  SoundSource createSoundSource()
          
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.
protected  void shutdownImpl()
          
protected  void startImpl()
          
 
Methods inherited from class org.xith3d.sound.SoundDriver
allocateSoundSource, delete, delete, getDopplerFactor, getDopplerVelocity, getListenerVolume, getNumActiveSources, getNumAvailableSources, getNumSources, isOnline, setDopplerFactor, setDopplerVelocity, setListenerOrientation, setListenerPosition, setListenerVelocity, setListenerVolume, 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

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

createSoundSource

protected SoundSource createSoundSource()

Specified by:
createSoundSource in class SoundDriver

allocateSoundBuffer

public SoundBuffer allocateSoundBuffer()

Specified by:
allocateSoundBuffer in class SoundDriver

shutdownImpl

protected void shutdownImpl()

Specified by:
shutdownImpl in class SoundDriver

initSoundDevice

protected void initSoundDevice()

Specified by:
initSoundDevice in class SoundDriver