#include <u_source.h>
Inheritance diagram for NLSOUND::USource:
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). * *
Nevrax France
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::CVector & | getPos () 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. |
|
Destructor.
Definition at line 177 of file u_source.h.
00177 {} |
|
Constructor.
Definition at line 182 of file u_source.h.
00182 {} |
|
Get the direction vector.
Implemented in NLSOUND::CSourceCommon. |
|
Get the gain.
Implemented in NLSOUND::CSourceCommon. Referenced by NLSOUND::CAudioMixerUser::createSource(). |
|
Return the looping state.
Implemented in NLSOUND::CSourceCommon. |
|
Get the pitch.
Implemented in NLSOUND::CSourceCommon. Referenced by NLSOUND::CAudioMixerUser::createSource(), and NL3D::CPSSoundInstanceImpl::getPitch(). |
|
Get the position vector (3D mode only).
Implemented in NLSOUND::CSourceCommon. |
|
Return the relative gain (see setRelativeGain()), or the absolute gain if getSource() is null.
Implemented in NLSOUND::CSourceCommon. |
|
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(). |
|
Get the source relative mode.
Implemented in NLSOUND::CSourceCommon. |
|
Returns the number of milliseconds the source has been playing.
Implemented in NLSOUND::CComplexSource, NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon. |
|
Get the velocity vector.
Implemented in NLSOUND::CSourceCommon. |
|
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(). |
|
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
Change the priority of the source.
Implemented in NLSOUND::CSourceCommon. Referenced by NLSOUND::CComplexSource::onEvent(), NLSOUND::CBackgroundSource::play(), and NLSOUND::CComplexSource::playStuf(). |
|
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(). |
|
Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false).
Implemented in NLSOUND::CSimpleSource, and NLSOUND::CSourceCommon. |
|
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(). |
|
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(). |
|
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(). |