NLSOUND::USource Class Reference

#include <u_source.h>

Inheritance diagram for NLSOUND::USource:

NLSOUND::CSourceCommon NLSOUND::CBackgroundSource NLSOUND::CComplexSource NLSOUND::CSimpleSource

Detailed Description

Game interface for sound sources (stereo or 3D sound instances).

The mode is 3D if the sound buffer (specified by its Sound Id) is mono, otherwise it is stereo.

For arguments as 3D vectors, use the NeL vector coordinate system:

* (top) * z * | y (front) * | / * -----x (right) * * The default priority is MidPri. * Some properties are assigned at initialization's time, from the * specified sound id (use NeL Sources Sound Builder to set these * initial values). * *
Author:
Olivier Cado

Nevrax France

Date:
2001

Definition at line 103 of file u_source.h.

Public Member Functions

virtual TSoundId getSound ()=0
 Return the sound binded to the source (or NULL if there is no sound).

virtual void setPriority (TSoundPriority pr)=0
 Change the priority of the source.

virtual ~USource ()
 Destructor.

Source properties
virtual void getDirection (NLMISC::CVector &dir) const=0
 Get the direction vector.

virtual float getGain () const=0
 Get the gain.

virtual float getPitch () const=0
 Get the pitch.

virtual const NLMISC::CVectorgetPos () const=0
 Get the position vector (3D mode only).

virtual float getRelativeGain () const=0
 Return the relative gain (see setRelativeGain()), or the absolute gain if getSource() is null.

virtual bool getSourceRelativeMode () const=0
 Get the source relative mode.

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

virtual void setDirection (const NLMISC::CVector &dir)=0
 Set the direction vector (3D mode only, ignored in stereo mode) (default: (0,0,0) as non-directional).

virtual void setGain (float gain)=0
virtual void setPitch (float pitch)=0
virtual void setPos (const NLMISC::CVector &pos)=0
virtual void setRelativeGain (float gain)=0
virtual void setSourceRelativeMode (bool mode)=0
 Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false).

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

Playback control
virtual bool getLooping () const=0
 Return the looping state.

virtual uint32 getTime ()=0
 Returns the number of milliseconds the source has been playing.

virtual bool isPlaying ()=0
 Get playing state. Return false even if the source has stopped on its own.

virtual void play ()=0
 Play.

virtual void setLooping (bool l)=0
 Set looping on/off for future playbacks (default: off).

virtual void stop ()=0
 Stop playing.

virtual void unregisterSpawnCallBack ()=0
 Tells this source not to call its callbacks when it ends. This is valid for spawned sources only.


Protected Member Functions

 USource ()
 Constructor.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 177 of file u_source.h.

00177 {}

NLSOUND::USource::USource  )  [inline, protected]
 

Constructor.

Definition at line 182 of file u_source.h.

00182 {}


Member Function Documentation

virtual void NLSOUND::USource::getDirection NLMISC::CVector dir  )  const [pure virtual]
 

Get the direction vector.

Implemented in NLSOUND::CSourceCommon.

virtual float NLSOUND::USource::getGain  )  const [pure virtual]
 

Get the gain.

Implemented in NLSOUND::CSourceCommon.

Referenced by NLSOUND::CAudioMixerUser::createSource().

virtual bool NLSOUND::USource::getLooping  )  const [pure virtual]
 

Return the looping state.

Implemented in NLSOUND::CSourceCommon.

virtual float NLSOUND::USource::getPitch  )  const [pure virtual]
 

Get the pitch.

Implemented in NLSOUND::CSourceCommon.

Referenced by NLSOUND::CAudioMixerUser::createSource(), and NL3D::CPSSoundInstanceImpl::getPitch().

virtual const NLMISC::CVector& NLSOUND::USource::getPos  )  const [pure virtual]
 

Get the position vector (3D mode only).

Implemented in NLSOUND::CSourceCommon.

virtual float NLSOUND::USource::getRelativeGain  )  const [pure virtual]
 

Return the relative gain (see setRelativeGain()), or the absolute gain if getSource() is null.

Implemented in NLSOUND::CSourceCommon.

virtual TSoundId NLSOUND::USource::getSound  )  [pure virtual]
 

Return the sound binded to the source (or NULL if there is no sound).

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, and NLSOUND::CSimpleSource.

Referenced by NLSOUND::CAudioMixerUser::addUserControledSource(), NLSOUND::CComplexSource::checkup(), NLSOUND::CComplexSource::onEvent(), NLSOUND::CComplexSource::onUpdate(), NLSOUND::CComplexSource::playStuf(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual bool NLSOUND::USource::getSourceRelativeMode  )  const [pure virtual]
 

Get the source relative mode.

Implemented in NLSOUND::CSourceCommon.

virtual uint32 NLSOUND::USource::getTime  )  [pure virtual]
 

Returns the number of milliseconds the source has been playing.

Implemented in NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

virtual void NLSOUND::USource::getVelocity NLMISC::CVector vel  )  const [pure virtual]
 

Get the velocity vector.

Implemented in NLSOUND::CSourceCommon.

virtual bool NLSOUND::USource::isPlaying  )  [pure virtual]
 

Get playing state. Return false even if the source has stopped on its own.

Implemented in NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::checkup(), NL3D::CPSSoundInstanceImpl::isPlaying(), NLSOUND::CBackgroundSource::onUpdate(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::play  )  [pure virtual]
 

Play.

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::checkup(), NLSOUND::CComplexSource::onEvent(), NLSOUND::CBackgroundSource::onUpdate(), NL3D::CPSSoundInstanceImpl::play(), NLSOUND::CSoundAnimMarker::play(), NLSOUND::CComplexSource::playStuf(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::setDirection const NLMISC::CVector dir  )  [pure virtual]
 

Set the direction vector (3D mode only, ignored in stereo mode) (default: (0,0,0) as non-directional).

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::setDirection().

virtual void NLSOUND::USource::setGain float  gain  )  [pure 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

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CAudioMixerUser::createSource(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::setLooping bool  l  )  [pure virtual]
 

Set looping on/off for future playbacks (default: off).

Implemented in NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NL3D::CPSSoundServImpl::createSound(), NL3D::CPSSoundInstanceImpl::setLooping(), and NLSOUND::CClusteredSound::update().

virtual void NLSOUND::USource::setPitch float  pitch  )  [pure virtual]
 

Shift the frequency. 1.0f equals identity, each reduction of 50% equals a pitch shift of one octave. 0 is not a legal value.

Implemented in NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CAudioMixerUser::createSource(), NLSOUND::CComplexSource::onEvent(), NLSOUND::CComplexSource::playStuf(), NL3D::CPSSoundInstanceImpl::setSoundParams(), and NLSOUND::CBackgroundSource::updateFilterValues().

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

Set the position vector (default: (0,0,0)). 3D mode -> 3D position st mode -> x is the pan value (from left (-1) to right (1)), set y and z to 0

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::onEvent(), NLSOUND::CSoundAnimMarker::play(), NLSOUND::CComplexSource::playStuf(), NLSOUND::CComplexSource::setPos(), NL3D::CPSSoundInstanceImpl::setSoundParams(), NLSOUND::CClusteredSound::update(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::setPriority TSoundPriority  pr  )  [pure virtual]
 

Change the priority of the source.

Implemented in NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::onEvent(), NLSOUND::CBackgroundSource::play(), and NLSOUND::CComplexSource::playStuf().

virtual void NLSOUND::USource::setRelativeGain float  gain  )  [pure virtual]
 

Set the gain amount (value inside [0, 1]) to map between 0 and the nominal gain (which is getSource()->getGain()). Does nothing if getSource() is null.

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NLSOUND::CComplexSource::onEvent(), NLSOUND::CComplexSource::onUpdate(), NLSOUND::CSoundAnimMarker::play(), NLSOUND::CComplexSource::playStuf(), NLSOUND::CComplexSource::setGain(), NLSOUND::CComplexSource::setRelativeGain(), NL3D::CPSSoundInstanceImpl::setSoundParams(), NLSOUND::CClusteredSound::update(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::setSourceRelativeMode bool  mode  )  [pure virtual]
 

Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false).

Implemented in NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

virtual void NLSOUND::USource::setVelocity const NLMISC::CVector vel  )  [pure virtual]
 

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

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NL3D::CPSSoundInstanceImpl::setSoundParams(), and NLSOUND::CComplexSource::setVelocity().

virtual void NLSOUND::USource::stop  )  [pure virtual]
 

Stop playing.

Implemented in NLSOUND::CBackgroundSource, NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon.

Referenced by NL3D::CPSSoundInstanceImpl::stop(), NLSOUND::CComplexSource::stop(), and NLSOUND::CBackgroundSource::updateFilterValues().

virtual void NLSOUND::USource::unregisterSpawnCallBack  )  [pure virtual]
 

Tells this source not to call its callbacks when it ends. This is valid for spawned sources only.

Implemented in NLSOUND::CSourceCommon.

Referenced by NL3D::CPSSoundInstanceImpl::release().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 14:54:00 2004 for NeL by doxygen 1.3.6