SPIN Framework
|
The base class for 3D audio nodes. More...
#include <DSPNode.h>
Public Member Functions | |
DSPNode (SceneManager *sceneManager, const char *initID) | |
virtual void | callbackUpdate (osg::NodeVisitor *nv) |
SoundConnection * | getConnection (DSPNode *snk) |
SoundConnection * | getConnection (const char *snk) |
void | connect (DSPNode *snk) |
void | connect (const char *snk) |
void | connectSource (const char *src) |
void | disconnect (const char *snk) |
virtual void | setURI (const char *uri) |
const char * | getURI () const |
virtual void | setActive (int i) |
int | getActive () const |
virtual std::vector< lo_message > | getState () const |
virtual void | setRolloff (const char *newvalue) |
virtual void | setSpread (float newvalue) |
virtual void | setLength (float newvalue) |
virtual void | setRadius (float newvalue) |
void | setDebugColor (float r, float g, float b, float a) |
void | setVUmeterFlag (float newFlag) |
void | setDirectivityFlag (float newFlag) |
void | setLaserFlag (float newFlag) |
void | setRadiusFlag (float newFlag) |
void | setIntensity (float newvalue) |
const char * | getRolloff () const |
float | getSpread () const |
float | getLength () const |
float | getRadius () const |
osg::Vec4 | getDebugColor () const |
float | getVUmeterFlag () const |
float | getDirectivityFlag () const |
float | getLaserFlag () const |
float | getRadiusFlag () const |
void | updateVUmeter () |
void | updateLaser () |
void | drawVUmeter () |
void | drawDirectivity () |
void | drawLaser () |
void | drawRadius () |
Public Attributes | |
std::vector< SoundConnection * > | connectTO |
std::vector< SoundConnection * > | connectFROM |
The base class for 3D audio nodes.
This class allows for spatially localized sounds in the scene. However, this should not be instantiated directly, rather, one needs to create a subclass for each audio representation.
The main feature of this class is that it maintains the connection logic that describes which node sends sound to another. The connect() and disconnect() methods create the interface for managing connections for all derived classes
void spin::DSPNode::callbackUpdate | ( | osg::NodeVisitor * | nv | ) | [virtual] |
For nodes that require regular programmatic control, there is a callback that is evaluated with every refresh. This function can thus be used for animations, or any other periodic updates.
Note that changes to the scene graph structure (eg, moving/deleting nodes should NOT be done within this callback because traversals stacks will become corrupted. The technique is rather to enable a flag and then do the actual change in the SceneManager::updateGraph() method.
Reimplemented from spin::GroupNode.
Reimplemented in spin::Listener, and spin::SoundNode.
void spin::DSPNode::connectSource | ( | const char * | src | ) |
Sets the current node as a sink to the specified node.
SoundConnection * spin::DSPNode::getConnection | ( | DSPNode * | snk | ) |
Returns the SoundConnection object that exists between the current node and the sink or null if none is found.
snk | a pointer to the sink node |
SoundConnection * spin::DSPNode::getConnection | ( | const char * | snk | ) |
Returns the SoundConnection object that exists between the current node and the sink or null if none is found.
snk | the name of the sink node to search for |
std::vector< lo_message > spin::DSPNode::getState | ( | ) | const [virtual] |
For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node
Reimplemented from spin::GroupNode.
Reimplemented in spin::Listener, spin::SoundNode, and spin::SoundSpace.
void spin::DSPNode::setActive | ( | int | i | ) | [virtual] |
Activate or deactivate the DSP processing
void spin::DSPNode::setURI | ( | const char * | uri | ) | [virtual] |
Set the media for the sound node using a URI pattern.
Examples: file://soundfilename.wav file:///home/johndoe/soundfilename.wav http://www.server.com/soundfile.wav adc://1:1 adc://1 content://media/external/audio/media/710 mms://some_media_stream rtsp://127.0.0.1:12311 pd_plugin://audio_plugin_patch.pd
Reimplemented in spin::Listener, and spin::SoundNode.
std::vector<SoundConnection*> spin::DSPNode::connectFROM |
We maintian 2 lists of all SoundConnection for this node (it is redundant, but useful to have both forward and backward connection pointers).
std::vector<SoundConnection*> spin::DSPNode::connectTO |
We maintain 2 lists of all SoundConnection for this node (it is redundant, but useful to have both forward and backward connection pointers).