CHAI3D  3.0.0
chai3d::cAudioDevice Class Reference

This class implements an audio device context. More...

#include <CAudioDevice.h>

Public Member Functions

 cAudioDevice ()
 Constructor of cAudioDevice. More...
 
virtual ~cAudioDevice ()
 Destructor of cAudioDevice. More...
 
bool setListenerPos (const cVector3d &a_listenerPos)
 This method sets the position of the listener in world coordinates. More...
 
cVector3d getListenerPos ()
 This method returns the position of the listener in world coordinates. More...
 
bool setListenerRot (const cMatrix3d &a_listenerRot)
 This method sets the orientation of the listener in world coordinates. More...
 
bool setListenerRot (const cVector3d &a_lookAt, const cVector3d &a_up)
 This method sets orientation of the listener in world coordinates. More...
 
cMatrix3d getListenerRot ()
 This method returns the position of the listener in world coordinates. More...
 
bool setListenerVel (const cVector3d &a_listenerVel)
 This method sets the linear velocity of the listener in world coordinates. More...
 
cVector3d getListenerVel ()
 This method sets the linear velocity of the listener in world coordinates. More...
 
cAudioBuffer * newAudioBuffer ()
 This method creates a new audio buffer that holds audio data. More...
 
bool deleteAudioBuffer (cAudioBuffer *a_audioBuffer)
 This method deletes an audio buffer passed as argument. More...
 
void deleteAllAudioBuffers ()
 This method deletes all allocated audio buffers. More...
 
cAudioSource * newAudioSource ()
 This method creates a new audio source. More...
 
bool deleteAudioSource (cAudioSource *a_audioSource)
 This method deletes an audio source passed as argument. More...
 
void deleteAllAudioSources ()
 This method deletes all audio buffers. More...
 

Protected Member Functions

bool open ()
 This method opens this audio device context. More...
 
bool close ()
 This method closes this audio device context. More...
 
bool checkError ()
 This method checks for any OpenAL errors. More...
 

Protected Attributes

void * m_device
 Audio device (of type ALCdevice*). More...
 
void * m_context
 Audio context (of type ALCcontext*). More...
 
cVector3d m_listenerPos
 Position of listener in world coordinates. More...
 
cMatrix3d m_listenerRot
 Orientation of listener in world coordinates. More...
 
cVector3d m_listenerVel
 Linear velocity of listener in world coordinates. More...
 
bool m_active
 Flag that indicates if the connection to audio device was opened successfully by calling method open(). More...
 
std::vector< cAudioBuffer * > m_audioBuffers
 List of allocated audio buffers. More...
 
std::vector< cAudioSource * > m_audioSources
 List of allocated audio sources. More...
 

Detailed Description

This class implements an audio display context for outputting sounds to loud speakers. Optionally, 3D spatial sound is modeled by defining the position and orientation of a listener placed inside the virtual world (cWorld)

Constructor & Destructor Documentation

chai3d::cAudioDevice::cAudioDevice ( )

Constructor of cAudioDevice.

chai3d::cAudioDevice::~cAudioDevice ( )
virtual

Destructor of cAudioDevice.

Member Function Documentation

bool chai3d::cAudioDevice::setListenerPos ( const cVector3d &  a_listenerPos)

This method sets the position of the listener in world coordinates.

Parameters
a_listenerPosPosition of listener in world coordinates.
Returns
true if no errors occurred, false otherwise.
cVector3d chai3d::cAudioDevice::getListenerPos ( )
inline
bool chai3d::cAudioDevice::setListenerRot ( const cMatrix3d &  a_listenerRot)

This method sets the orientation of the listener in world coordinates.

Parameters
a_listenerRotOrientation of the listener in world coordinates.
Returns
true if no errors occurred, false otherwise.
bool chai3d::cAudioDevice::setListenerRot ( const cVector3d &  a_lookAt,
const cVector3d &  a_up 
)

This method sets the orientation of the listener in world coordinates.

Parameters
a_lookAtLook at position of listener.
a_upUp vector of listener.
Returns
true if no errors occurred, false otherwise.
cMatrix3d chai3d::cAudioDevice::getListenerRot ( )
inline
bool chai3d::cAudioDevice::setListenerVel ( const cVector3d &  a_listenerVel)

This method sets the linear velocity of the listener in world coordinates.

Parameters
a_listenerVelLinear velocity of listener in world coordinates.
Returns
true if no errors occurred, false otherwise.
cVector3d chai3d::cAudioDevice::getListenerVel ( )
inline
cAudioBuffer * chai3d::cAudioDevice::newAudioBuffer ( )

This method creates a new audio buffer.

Returns
Pointer to audio buffer.
bool chai3d::cAudioDevice::deleteAudioBuffer ( cAudioBuffer *  a_audioBuffer)

This method deletes an audio buffer passed as argument.

Parameters
a_audioBufferAudio buffer.
Returns
true if no errors occurred, false otherwise.
void chai3d::cAudioDevice::deleteAllAudioBuffers ( )

This method deletes all audio buffers.

Returns
true if no errors occurred, false otherwise.
cAudioSource * chai3d::cAudioDevice::newAudioSource ( )

This method creates a new audio source.

Returns
Pointer to new audio source.
bool chai3d::cAudioDevice::deleteAudioSource ( cAudioSource *  a_audioSource)

This method deletes an audio source passed as argument.

Parameters
a_audioSourceAudio source.
Returns
true if no errors occurred, false otherwise.
void chai3d::cAudioDevice::deleteAllAudioSources ( )

This method deletes all audio sources.

bool chai3d::cAudioDevice::open ( )
protected

This method opens this audio device context.

Returns
true if no errors occurred, false otherwise.
bool chai3d::cAudioDevice::close ( )
protected

This method closes this audio device context.

Returns
true if no errors occurred, false otherwise.
bool chai3d::cAudioDevice::checkError ( )
protected

This method checks for any OpenAL errors.

Returns
true if no errors occurred, false otherwise.

Member Data Documentation

void* chai3d::cAudioDevice::m_device
protected
void* chai3d::cAudioDevice::m_context
protected
cVector3d chai3d::cAudioDevice::m_listenerPos
protected
cMatrix3d chai3d::cAudioDevice::m_listenerRot
protected
cVector3d chai3d::cAudioDevice::m_listenerVel
protected
bool chai3d::cAudioDevice::m_active
protected
std::vector<cAudioBuffer*> chai3d::cAudioDevice::m_audioBuffers
protected
std::vector<cAudioSource*> chai3d::cAudioDevice::m_audioSources
protected

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

CHAI3D 3.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2015 - CHAI3D
All Rights Reserved.