# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLSOUND::CListenerAL Class Reference

OpenAL sound listener. More...

#include <listener_al.h>

Inheritance diagram for NLSOUND::CListenerAL:

NLSOUND::IListener List of all members.

Public Methods

 CListenerAL ()
 Constructor. More...

virtual ~CListenerAL ()
 Destructor. More...

Listener properties
virtual void setPos (const NLMISC::CVector &pos)
 Set the position vector (default: (0,0,0)) (3D mode only). More...

virtual const NLMISC::CVectorgetPos () const
 Get the position vector. More...

virtual void setVelocity (const NLMISC::CVector &vel)
 Set the velocity vector (3D mode only) (default: (0,0,0)). More...

virtual void getVelocity (NLMISC::CVector &vel) const
 Get the velocity vector. More...

virtual void setOrientation (const NLMISC::CVector &front, const NLMISC::CVector &up)
 Set the orientation vectors (3D mode only) (default: (0,1,0), (0,0,1)). More...

virtual void getOrientation (NLMISC::CVector &front, NLMISC::CVector &up) const
 Get the orientation vectors. More...

virtual void setGain (float gain)
 Set the gain (volume value inside [0 , 1]). More...

virtual float getGain () const
 Get the gain. More...

Global properties
virtual void setDopplerFactor (float f)
 Set the doppler factor (default: 1) to exaggerate or not the doppler effect. More...

virtual void setRolloffFactor (float f)
 Set the rolloff factor (default: 1) to scale the distance attenuation effect. More...

virtual void setEnvironment (uint env, float size=7.5f)
 Set DSPROPERTY_EAXLISTENER_ENVIRONMENT and DSPROPERTY_EAXLISTENER_ENVIRONMENTSIZE if EAX available (see EAX listener properties). More...

virtual void setEAXProperty (uint prop, void *value, uint valuesize)
 Set any EAX listener property if EAX available. More...


Static Public Methods

CListenerAL * instance ()
 Return the instance of the singleton. More...


Private Attributes

NLMISC::CVector _Pos

Static Private Attributes

CListenerAL * _Instance = NULL

Detailed Description

OpenAL sound listener.

For arguments as 3D vectors, use the NeL vector coordinate system (not OpenAL/OpenGL's one).

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 46 of file listener_al.h.


Constructor & Destructor Documentation

NLSOUND::CListenerAL::CListenerAL  
 

Constructor.

Definition at line 44 of file listener_al.cpp.

References _Instance, and nlerror.

Referenced by instance.

virtual NLSOUND::CListenerAL::~CListenerAL   [inline, virtual]
 

Destructor.

Definition at line 96 of file listener_al.h.

References _Instance.


Member Function Documentation

float NLSOUND::CListenerAL::getGain   const [virtual]
 

Get the gain.

Implements NLSOUND::IListener.

Definition at line 176 of file listener_al.cpp.

References TestALError.

void NLSOUND::CListenerAL::getOrientation NLMISC::CVector   front,
NLMISC::CVector   up
const [virtual]
 

Get the orientation vectors.

Implements NLSOUND::IListener.

Definition at line 148 of file listener_al.cpp.

References NLMISC::CVector::set, TestALError, and v.

const NLMISC::CVector & NLSOUND::CListenerAL::getPos   const [virtual]
 

Get the position vector.

See setPos() for details.

Implements NLSOUND::IListener.

Definition at line 72 of file listener_al.cpp.

References _Pos.

void NLSOUND::CListenerAL::getVelocity NLMISC::CVector   vel const [virtual]
 

Get the velocity vector.

Implements NLSOUND::IListener.

Definition at line 109 of file listener_al.cpp.

References NLMISC::CVector::set, TestALError, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

CListenerAL* NLSOUND::CListenerAL::instance   [inline, static]
 

Return the instance of the singleton.

Definition at line 54 of file listener_al.h.

References _Instance, and CListenerAL.

void NLSOUND::CListenerAL::setDopplerFactor float    f [virtual]
 

Set the doppler factor (default: 1) to exaggerate or not the doppler effect.

Implements NLSOUND::IListener.

Definition at line 192 of file listener_al.cpp.

References TestALError.

void NLSOUND::CListenerAL::setEAXProperty uint    prop,
void *    value,
uint    valuesize
[virtual]
 

Set any EAX listener property if EAX available.

Implements NLSOUND::IListener.

Definition at line 227 of file listener_al.cpp.

References value.

void NLSOUND::CListenerAL::setEnvironment uint    env,
float    size = 7.5f
[virtual]
 

Set DSPROPERTY_EAXLISTENER_ENVIRONMENT and DSPROPERTY_EAXLISTENER_ENVIRONMENTSIZE if EAX available (see EAX listener properties).

Implements NLSOUND::IListener.

Definition at line 212 of file listener_al.cpp.

void NLSOUND::CListenerAL::setGain float    gain [virtual]
 

Set the gain (volume value inside [0 , 1]).

(default: 1) 0.0 -> silence 0.5 -> -6dB 1.0 -> no attenuation values > 1 (amplification) not supported by most drivers

Implements NLSOUND::IListener.

Definition at line 166 of file listener_al.cpp.

References TestALError.

void NLSOUND::CListenerAL::setOrientation const NLMISC::CVector   front,
const NLMISC::CVector   up
[virtual]
 

Set the orientation vectors (3D mode only) (default: (0,1,0), (0,0,1)).

Implements NLSOUND::IListener.

Definition at line 129 of file listener_al.cpp.

References TestALError, v, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

void NLSOUND::CListenerAL::setPos const NLMISC::CVector   pos [virtual]
 

Set the position vector (default: (0,0,0)) (3D mode only).

Implements NLSOUND::IListener.

Definition at line 60 of file listener_al.cpp.

References _Pos, TestALError, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

void NLSOUND::CListenerAL::setRolloffFactor float    f [virtual]
 

Set the rolloff factor (default: 1) to scale the distance attenuation effect.

Implements NLSOUND::IListener.

Definition at line 202 of file listener_al.cpp.

References nlassert.

void NLSOUND::CListenerAL::setVelocity const NLMISC::CVector   vel [virtual]
 

Set the velocity vector (3D mode only) (default: (0,0,0)).

Implements NLSOUND::IListener.

Definition at line 98 of file listener_al.cpp.

References TestALError, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.


Member Data Documentation

CListenerAL * NLSOUND::CListenerAL::_Instance = NULL [static, private]
 

Definition at line 38 of file listener_al.cpp.

Referenced by CListenerAL, instance, and ~CListenerAL.

NLMISC::CVector NLSOUND::CListenerAL::_Pos [private]
 

Definition at line 103 of file listener_al.h.

Referenced by getPos, and setPos.


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