# 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::USource Class Reference

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

#include <u_source.h>

Inheritance diagram for NLSOUND::USource:

NLSOUND::CSourceCommon NLSOUND::CBackgroundSource NLSOUND::CComplexSource NLSOUND::CSimpleSource List of all members.

Public Methods

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

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

virtual ~USource ()
 Destructor. More...

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

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

virtual void play ()=0
 Play. More...

virtual void stop ()=0
 Stop playing. More...

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

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

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

Source properties
virtual void setPos (const NLMISC::CVector &pos)=0
 Set the position vector (default: (0,0,0)). More...

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

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

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

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

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

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

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

virtual void setRelativeGain (float gain)=0
 Set the gain amount (value inside [0, 1]) to map between 0 and the nominal gain (which is getSource()->getGain()). More...

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

virtual void setPitch (float pitch)=0
 Shift the frequency. More...

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

virtual void setSourceRelativeMode (bool mode)=0
 Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false). More...

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


Protected Methods

 USource ()
 Constructor. More...


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.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 180 of file u_source.h.

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

Constructor.

Definition at line 185 of file u_source.h.

Referenced by NLSOUND::CComplexSource::play.


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.

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.

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

The source must be of the same type as the source (ie simple or complex or background sound).

Implemented in NLSOUND::CBackgroundSource.

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.

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.

Referenced by NL3D::CPSSoundInstanceImpl::isPlaying.

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

Play.

Implemented in NLSOUND::CBackgroundSource.

Referenced by NL3D::CPSSoundInstanceImpl::play.

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.

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.

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

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

Implemented in NLSOUND::CSimpleSource.

Referenced by NL3D::CPSSoundServImpl::createSound.

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.

Referenced by NL3D::CPSSoundInstanceImpl::setSoundParams.

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.

Referenced by NL3D::CPSSoundInstanceImpl::setSoundParams.

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

Change the priority of the source.

Implemented in NLSOUND::CSourceCommon.

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.

Referenced by NL3D::CPSSoundInstanceImpl::setSoundParams.

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.

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.

Referenced by NL3D::CPSSoundInstanceImpl::setSoundParams.

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

Stop playing.

Implemented in NLSOUND::CBackgroundSource.

Referenced by NL3D::CPSSoundInstanceImpl::stop.

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: