org.xith3d.sound
Class SoundProcessor

java.lang.Object
  extended by org.xith3d.sound.SoundProcessor

public class SoundProcessor
extends java.lang.Object

A SoundProcessor is responsible for processing Sound Nodes in relation to a View.

Most parts are taken from other classes originally coded by David Yazel.


Method Summary
 void addSound(Sound sound, BranchGroup rootBranch)
          Adds a Sound to the SoundProcessor.
 void clearSoundList()
          Removes all stored Sound Nodes from the list.
static SoundProcessor getInstance()
          Returns the soundProcessor's singleton instance.
 SoundDriver getSoundDriver()
          Returns the used SoundDriver (default=javasound).
 void processAll(BranchGroup rootBranch, View view, long frameId)
          Process all Sound Nodes, that have been collected from the scenegraph.
 void processAll(BranchGroup rootBranch, View view, long frameId, boolean force)
          Process all Sound Nodes, that have been collected from the scenegraph.
 boolean removeSound(Sound sound)
          Removes a Sound Node from the SoundProcessor.
 void setSoundDriver(SoundDriver soundDriver)
          Sets the SoundDriver to be used by this SoundProcessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final SoundProcessor getInstance()
Returns the soundProcessor's singleton instance.

Returns:
the soundProcessor's singleton instance.

setSoundDriver

public void setSoundDriver(SoundDriver soundDriver)
Sets the SoundDriver to be used by this SoundProcessor.

Parameters:
soundDriver -

getSoundDriver

public final SoundDriver getSoundDriver()
Returns the used SoundDriver (default=javasound).

Returns:
the used SoundDriver.

addSound

public void addSound(Sound sound,
                     BranchGroup rootBranch)
Adds a Sound to the SoundProcessor.

Parameters:
sound - the Sound Node to be added

removeSound

public boolean removeSound(Sound sound)
Removes a Sound Node from the SoundProcessor.

Parameters:
sound - the Sound Node to be removed
Returns:
true, if the Sound was presend before removing

clearSoundList

public void clearSoundList()
Removes all stored Sound Nodes from the list.


processAll

public void processAll(BranchGroup rootBranch,
                       View view,
                       long frameId,
                       boolean force)
Process all Sound Nodes, that have been collected from the scenegraph.


processAll

public void processAll(BranchGroup rootBranch,
                       View view,
                       long frameId)
Process all Sound Nodes, that have been collected from the scenegraph.