NLSOUND::CListenerUser Class Reference

#include <listener_user.h>

Inheritance diagram for NLSOUND::CListenerUser:

NLSOUND::UListener

Detailed Description

Implementation of UListener

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.

Author:
Olivier Cado

Nevrax France

Date:
2001

Definition at line 49 of file listener_user.h.

Public Member Functions

 CListenerUser ()
 Constructor.

IListenergetListener ()
 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::CVectorgetPos () 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 & Destructor Documentation

NLSOUND::CListenerUser::CListenerUser  )  [inline]
 

Constructor.

Definition at line 54 of file listener_user.h.

References _DrvListener.

00054 : _DrvListener (NULL) {}

virtual NLSOUND::CListenerUser::~CListenerUser  )  [inline, virtual]
 

Destructor.

Definition at line 58 of file listener_user.h.

References _DrvListener.

00058 { if ( _DrvListener!=NULL ) delete _DrvListener; }


Member Function Documentation

virtual float NLSOUND::CListenerUser::getGain void   )  const [inline, virtual]
 

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(); }

IListener* NLSOUND::CListenerUser::getListener  )  [inline]
 

Direct access granted to the audio mixer.

Definition at line 92 of file listener_user.h.

References _DrvListener.

00092 { return _DrvListener; }

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

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 ); }

virtual const NLMISC::CVector& NLSOUND::CListenerUser::getPos void   )  const [inline, virtual]
 

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(); }

virtual void NLSOUND::CListenerUser::getVelocity NLMISC::CVector vel  )  const [inline, virtual]
 

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 ); }

void NLSOUND::CListenerUser::init ISoundDriver sd  )  [inline]
 

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(); }

virtual void NLSOUND::CListenerUser::setGain float  gain  )  [inline, 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::UListener.

Definition at line 85 of file listener_user.h.

References _DrvListener, and NLSOUND::IListener::setGain().

00085 { _DrvListener->setGain( gain ); }

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

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 ); }

void NLSOUND::CListenerUser::setPos const NLMISC::CVector pos  )  [virtual]
 

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 }

virtual void NLSOUND::CListenerUser::setVelocity const NLMISC::CVector vel  )  [inline, virtual]
 

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 ); }


Field Documentation

IListener* NLSOUND::CListenerUser::_DrvListener [private]
 

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().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 14:39:31 2004 for NeL by doxygen 1.3.6