#include <listener_user.h>
Inheritance diagram for NLSOUND::CListenerUser:
This implementation does not check if the properties have changed or not. Therefore it is suggested to test them and not to call the set methods if there is no change.
Nevrax France
Definition at line 49 of file listener_user.h.
Public Member Functions | |
CListenerUser () | |
Constructor. | |
IListener * | getListener () |
Direct access granted to the audio mixer. | |
void | init (ISoundDriver *sd) |
Init. | |
virtual | ~CListenerUser () |
Destructor. | |
Listener properties | |
virtual float | getGain () const |
Get the gain. | |
virtual void | getOrientation (NLMISC::CVector &front, NLMISC::CVector &up) const |
Get the orientation vectors. | |
virtual const NLMISC::CVector & | getPos () const |
virtual void | getVelocity (NLMISC::CVector &vel) const |
Get the velocity vector. | |
virtual void | setGain (float gain) |
virtual void | setOrientation (const NLMISC::CVector &front, const NLMISC::CVector &up) |
Set the orientation vectors (3D mode only, ignored in stereo mode) (default: (0,1,0), (0,0,1) ). | |
virtual void | setPos (const NLMISC::CVector &pos) |
Set the position vector (default: (0,0,0)) (3D mode only). | |
virtual void | setVelocity (const NLMISC::CVector &vel) |
Set the velocity vector (3D mode only, ignored in stereo mode) (default: (0,0,0)). | |
Private Attributes | |
IListener * | _DrvListener |
Listener property. |
|
Constructor.
Definition at line 54 of file listener_user.h. References _DrvListener.
00054 : _DrvListener (NULL) {} |
|
Destructor.
Definition at line 58 of file listener_user.h. References _DrvListener.
00058 { if ( _DrvListener!=NULL ) delete _DrvListener; } |
|
Get the gain.
Implements NLSOUND::UListener. Definition at line 87 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::getGain().
00087 { return _DrvListener->getGain(); } |
|
Direct access granted to the audio mixer.
Definition at line 92 of file listener_user.h. References _DrvListener.
00092 { return _DrvListener; } |
|
Get the orientation vectors.
Implements NLSOUND::UListener. Definition at line 77 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::getOrientation(). Referenced by NLSOUND::CAudioMixerUser::update().
00078 { _DrvListener->getOrientation( front, up ); } |
|
Get the position vector. See setPos() for details. Implements NLSOUND::UListener. Definition at line 68 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::getPos().
00068 { return _DrvListener->getPos(); } |
|
Get the velocity vector.
Implements NLSOUND::UListener. Definition at line 72 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::getVelocity().
00072 { _DrvListener->getVelocity( vel ); } |
|
Init.
Definition at line 56 of file listener_user.h. References _DrvListener, NLSOUND::ISoundDriver::createListener(), and nlassert. Referenced by NLSOUND::CAudioMixerUser::init().
00056 { nlassert( sd ); _DrvListener = sd->createListener(); } |
|
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::UListener. Definition at line 85 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::setGain().
00085 { _DrvListener->setGain( gain ); } |
|
Set the orientation vectors (3D mode only, ignored in stereo mode) (default: (0,1,0), (0,0,1) ).
Implements NLSOUND::UListener. Definition at line 74 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::setOrientation().
00075 { _DrvListener->setOrientation( front, up ); } |
|
Set the position vector (default: (0,0,0)) (3D mode only).
Implements NLSOUND::UListener. Definition at line 38 of file listener_user.cpp. References _DrvListener, and NLSOUND::IListener::setPos(). Referenced by NLSOUND::CAudioMixerUser::setListenerPos().
00039 { 00040 // Change position 00041 _DrvListener->setPos( pos ); 00042 00043 // Select environment effect 00044 CAudioMixerUser::instance()->applyListenerMove( pos ); 00045 } |
|
Set the velocity vector (3D mode only, ignored in stereo mode) (default: (0,0,0)).
Implements NLSOUND::UListener. Definition at line 70 of file listener_user.h. References _DrvListener, and NLSOUND::IListener::setVelocity().
00070 { _DrvListener->setVelocity( vel ); } |
|
Listener property.
Definition at line 97 of file listener_user.h. Referenced by CListenerUser(), getGain(), getListener(), getOrientation(), getPos(), getVelocity(), init(), setGain(), setOrientation(), setPos(), setVelocity(), and ~CListenerUser(). |