H3D::X3DSoundSourceNode Class Reference
[Abstract nodes.]

This abstract node type is used to derive node types that can emit audio data. More...

#include <H3D/X3DSoundSourceNode.h>

Inheritance diagram for H3D::X3DSoundSourceNode:

Inheritance graph

List of all members.

Classes

class  ALSoundBuffer
 Field that calls ALrender() when a field routed to it has generated an event. More...
class  TimeHandler
 TimeHandler is extended to stream audio data to OpenAL buffers if the sound source is a streaming source. More...

Public Member Functions

 X3DSoundSourceNode (Inst< SFNode > _metadata=0, Inst< SFString > _description=0, Inst< SFBool > _loop=0, Inst< SFTime > _pauseTime=0, Inst< SFFloat > _pitch=0, Inst< SFTime > _resumeTime=0, Inst< StartTime > _startTime=0, Inst< StopTime > _stopTime=0, Inst< SFTime > _duration_changed=0, Inst< SFTime > _elapsedTime=0, Inst< SFBool > _isActive=0, Inst< SFBool > _isPaused=0, Inst< TimeHandler > _timeHandler=0)
 Constructor.
virtual bool initALBuffers (bool stream)
 Reads new data into the OpenAL from the reader and attaches them to the sound sources that use this sound source.
virtual void ALrender ()
 Perform the OpenAL calls to render the sound.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.
virtual void registerSoundNode (X3DSoundNode *n)
 Register this sound node with the X3DSoundSourceNode.
virtual void unregisterSoundNode (X3DSoundNode *n)
 Unregister this sound node with the X3DSoundSourceNode.
virtual void onPause ()
 On pause, pause the sound.
virtual void onResume ()
 On resume, resume paused sound.
virtual void onStart ()
 On start, initialize AL buffers and start playing.
virtual void onStop ()
 On stop, stop playing the sound.

Public Attributes

auto_ptr< SFStringdescription
 The description field specifies a textual description of the audio source.
auto_ptr< SFFloatpitch
 The pitch field specifies a multiplier for the rate at which sampled sound is played.
auto_ptr< SFTimeduration_changed
 The duration field is the length of time in seconds for one cycle of the audio for a pitch set to 1.0.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

list< X3DSoundNode * > parent_sound_nodes
 The X3DSoundNodes that use this node as sound source.
ALuint al_buffers [NR_STREAM_BUFFERS]
 OpenAL buffer ids used for playing sound.
ALenum al_format
 The OpenAL format of the current sound source.
AutoRef< H3DSoundStreamNodereader
 The H3DSoundStreamNode used to read sound data.
bool sound_as_stream
 Indicates if the current sounds source is being streamed or not.
auto_ptr< ALSoundBuffersound_buffer
 Field that calls ALrender() when a field routed to it has generated an event.


Detailed Description

This abstract node type is used to derive node types that can emit audio data.

Internal routes:
X3DSoundSourceNode.dot

Member Function Documentation

virtual string H3D::X3DSoundSourceNode::defaultXMLContainerField (  )  [inline, virtual]

Returns the default xml containerField attribute value.

For this node it is "children".

Reimplemented from H3D::Node.

bool X3DSoundSourceNode::initALBuffers ( bool  stream  )  [virtual]

Reads new data into the OpenAL from the reader and attaches them to the sound sources that use this sound source.

The stream param indicates if it should init a stream source or a static source.

References al_buffers, al_format, H3D::X3DTimeDependentNode::loop, parent_sound_nodes, reader, and sound_as_stream.

Referenced by H3D::AudioClip::ALrender(), and onStart().

void X3DSoundSourceNode::registerSoundNode ( X3DSoundNode n  )  [virtual]

Register this sound node with the X3DSoundSourceNode.

All X3DSoundSourceNodes that want to play this sound source must register with this function.

References al_buffers, H3D::X3DSoundNode::getALSourceId(), H3D::X3DTimeDependentNode::isActive, H3D::X3DTimeDependentNode::isPaused, H3D::X3DTimeDependentNode::loop, parent_sound_nodes, pitch, sound_as_stream, and sound_buffer.

Referenced by H3D::Sound::SFSoundSourceNode::onAdd().


Member Data Documentation

The description field specifies a textual description of the audio source.

Access type: inputOutput
Default value: ""

X3DSoundSourceNode_description.dot

Referenced by X3DSoundSourceNode().

The duration field is the length of time in seconds for one cycle of the audio for a pitch set to 1.0.

Access type: outputOnly

X3DSoundSourceNode_duration_changed.dot

Referenced by H3D::AudioClip::ALrender(), and X3DSoundSourceNode().

The pitch field specifies a multiplier for the rate at which sampled sound is played.

Values for the pitch field shall be greater than zero.

Access type: inputOutput
Default value: 1.0

X3DSoundSourceNode_pitch.dot

Referenced by ALrender(), registerSoundNode(), and X3DSoundSourceNode().

Field that calls ALrender() when a field routed to it has generated an event.

Referenced by H3D::AudioClip::ALrender(), H3D::AudioClip::AudioClip(), onStart(), registerSoundNode(), and X3DSoundSourceNode().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:31 2008 for H3D API by  doxygen 1.5.7