NLSOUND::ISource Class Reference

#include <source.h>

Inheritance diagram for NLSOUND::ISource:

NLSOUND::CSourceAL NLSOUND::CSourceDSound

Detailed Description

Sound source interface (implemented in sound driver dynamic library)

Author:
Olivier Cado

Nevrax France

Date:
2001

Definition at line 59 of file source.h.

Source properties

virtual void getCone (float &innerAngle, float &outerAngle, float &outerGain) const=0
 Get the cone angles (in radian).

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

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

virtual void getMinMaxDistances (float &mindist, float &maxdist) const=0
 Get the min and max distances.

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

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

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

virtual void setAlpha (double a)
 Testing.

virtual void setCone (float innerAngle, float outerAngle, float outerGain)=0
 Set the cone angles (in radian) and gain (in [0 , 1]) (default: 2PI, 2PI, 0).

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 setEAXProperty (uint prop, void *value, uint valuesize)=0
 Set any EAX source property if EAX available.

virtual void setGain (float gain)=0
virtual void setMinMaxDistances (float mindist, float maxdist, bool deferred=true)=0
 Set the min and max distances (default: 1, MAX_FLOAT) (3D mode only).

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

virtual void setVelocity (const NLMISC::CVector &vel, bool deferred=true)=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 ()
 Returns the number of milliseconds the source has been playing.

virtual bool isPlaying () const=0
 Return the playing state.

virtual bool isStopped () const=0
 Return true if playing is finished or stop() has been called.

virtual void pause ()=0
 Pause. Call play() to resume.

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

virtual void stop ()=0
 Stop playing.

virtual bool update ()=0
 Update the source (e.g. continue to stream the data in).


Initialization

virtual IBuffergetStaticBuffer ()=0
 Return the buffer, or NULL if streaming is used.

virtual void setStaticBuffer (IBuffer *buffer)=0
virtual void setStreamLoader (ILoader *loader)

Public Member Functions

 ISource ()
 Constructor.

virtual ~ISource ()
 Destructor.


Protected Attributes

ILoader_Loader


Constructor & Destructor Documentation

NLSOUND::ISource::ISource  )  [inline]
 

Constructor.

Definition at line 159 of file source.h.

References _Loader.

00159 : /*_Buffer(NULL),*/ _Loader(NULL) {}

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

Destructor.

Definition at line 162 of file source.h.

References _Loader.

00162 { /*_Buffer=NULL;*/ _Loader=NULL; }


Member Function Documentation

virtual void NLSOUND::ISource::getCone float &  innerAngle,
float &  outerAngle,
float &  outerGain
const [pure virtual]
 

Get the cone angles (in radian).

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Get the direction vector.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Get the gain.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Return the looping state.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual void NLSOUND::ISource::getMinMaxDistances float &  mindist,
float &  maxdist
const [pure virtual]
 

Get the min and max distances.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Get the pitch.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Get the position vector. See setPos() for details.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

Get the source relative mode.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual IBuffer* NLSOUND::ISource::getStaticBuffer  )  [pure virtual]
 

Return the buffer, or NULL if streaming is used.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual uint32 NLSOUND::ISource::getTime void   )  [inline, virtual]
 

Returns the number of milliseconds the source has been playing.

Reimplemented in NLSOUND::CSourceDSound.

Definition at line 101 of file source.h.

References uint32.

Referenced by NLSOUND::CSimpleSource::getTime().

00101 { return 0; }

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

Get the velocity vector.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual bool NLSOUND::ISource::isPlaying  )  const [pure virtual]
 

Return the playing state.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CTrack::isPlaying().

virtual bool NLSOUND::ISource::isStopped  )  const [pure virtual]
 

Return true if playing is finished or stop() has been called.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CTrack::isAvailable().

virtual void NLSOUND::ISource::pause  )  [pure virtual]
 

Pause. Call play() to resume.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual bool NLSOUND::ISource::play  )  [pure virtual]
 

Play the static buffer (or stream in and play). This method can return false if the sample for this sound is unloaded.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play().

virtual void NLSOUND::ISource::setAlpha double  a  )  [inline, virtual]
 

Testing.

Reimplemented in NLSOUND::CSourceDSound.

Definition at line 154 of file source.h.

Referenced by NLSOUND::CSimpleSource::play().

00154 {  }

virtual void NLSOUND::ISource::setCone float  innerAngle,
float  outerAngle,
float  outerGain
[pure virtual]
 

Set the cone angles (in radian) and gain (in [0 , 1]) (default: 2PI, 2PI, 0).

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

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

virtual void NLSOUND::ISource::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::CSourceDSound, and NLSOUND::CSourceAL.

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

virtual void NLSOUND::ISource::setEAXProperty uint  prop,
void *  value,
uint  valuesize
[pure virtual]
 

Set any EAX source property if EAX available.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

virtual void NLSOUND::ISource::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::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), NLSOUND::CSimpleSource::setGain(), and NLSOUND::CSimpleSource::setRelativeGain().

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

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

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::setLooping().

virtual void NLSOUND::ISource::setMinMaxDistances float  mindist,
float  maxdist,
bool  deferred = true
[pure virtual]
 

Set the min and max distances (default: 1, MAX_FLOAT) (3D mode only).

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play().

virtual void NLSOUND::ISource::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::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::setPitch().

virtual void NLSOUND::ISource::setPos const NLMISC::CVector pos,
bool  deffered = true
[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::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::setPos().

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

Set the source relative mode. If true, positions are interpreted relative to the listener position.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::setSourceRelativeMode().

virtual void NLSOUND::ISource::setStaticBuffer IBuffer buffer  )  [pure virtual]
 

Set the buffer that will be played (no streaming) If the buffer is stereo, the source mode becomes stereo and the source relative mode is on, otherwise the source is considered as a 3D source.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::stop().

virtual void NLSOUND::ISource::setStreamLoader ILoader loader  )  [inline, virtual]
 

Set the sound loader that will be used to stream in the data to play If the buffer is stereo, the source mode becomes stereo and the source relative mode is on, otherwise the source is considered as a 3D source.

Definition at line 76 of file source.h.

References _Loader.

00076 { _Loader = loader; }

virtual void NLSOUND::ISource::setVelocity const NLMISC::CVector vel,
bool  deferred = true
[pure virtual]
 

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

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::play(), and NLSOUND::CSimpleSource::setVelocity().

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

Stop playing.

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.

Referenced by NLSOUND::CSimpleSource::stop().

virtual bool NLSOUND::ISource::update  )  [pure virtual]
 

Update the source (e.g. continue to stream the data in).

Implemented in NLSOUND::CSourceDSound, and NLSOUND::CSourceAL.


Field Documentation

ILoader* NLSOUND::ISource::_Loader [protected]
 

Definition at line 170 of file source.h.

Referenced by ISource(), setStreamLoader(), and ~ISource().


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