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

Sound source interface (implemented in sound driver dynamic library). More...

#include <source.h>

Inheritance diagram for NLSOUND::ISource:

NLSOUND::CSourceAL NLSOUND::CSourceDSound List of all members.

Public Methods

 ISource ()
 Constructor. More...

virtual ~ISource ()
 Destructor. More...

Initialization
virtual void setStaticBuffer (IBuffer *buffer)
 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. More...

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

virtual void setStreamLoader (ILoader *loader)
 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. 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 bool play ()=0
 Play the static buffer (or stream in and play). More...

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

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

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

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

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

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

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

virtual const NLMISC::CVectorgetPos () const=0
 Get the position vector. More...

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

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

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

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

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

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

virtual void setEAXProperty (uint prop, void *value, uint valuesize)=0
 Set any EAX source property if EAX available. More...

virtual void setAlpha (double a)
 Testing. More...


Protected Attributes

IBuffer_Buffer
ILoader_Loader

Detailed Description

Sound source interface (implemented in sound driver dynamic library).

  • If the buffer is mono, the source is played in 3D mode. For arguments as 3D vectors, use the NeL vector coordinate system:
     *     (top)
     *       z    
     *       |  y (front)
     *       | /
     *       -----x (right)
     * 
  • If the buffer is stereo, the source is played in stereo mode.
Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 59 of file source.h.


Constructor & Destructor Documentation

NLSOUND::ISource::ISource   [inline]
 

Constructor.

Definition at line 159 of file source.h.

References _Buffer, and _Loader.

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

Destructor.

Definition at line 162 of file source.h.

References _Buffer, and _Loader.


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.

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

Get the direction vector.

Implemented in NLSOUND::CSourceDSound.

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

Get the gain.

Implemented in NLSOUND::CSourceDSound.

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

Return the looping state.

Implemented in NLSOUND::CSourceDSound.

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

Get the min and max distances.

Implemented in NLSOUND::CSourceDSound.

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

Get the pitch.

Implemented in NLSOUND::CSourceDSound.

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

Get the position vector.

See setPos() for details.

Implemented in NLSOUND::CSourceDSound.

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

Get the source relative mode.

Implemented in NLSOUND::CSourceDSound.

virtual IBuffer* NLSOUND::ISource::getStaticBuffer   [inline, virtual]
 

Return the buffer, or NULL if streaming is used.

Definition at line 71 of file source.h.

References _Buffer.

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.

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

Get the velocity vector.

Implemented in NLSOUND::CSourceDSound.

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

Return the playing state.

Implemented in NLSOUND::CSourceDSound.

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

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

Implemented in NLSOUND::CSourceDSound.

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

Pause. Call play() to resume.

Implemented in NLSOUND::CSourceDSound.

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.

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

Testing.

Reimplemented in NLSOUND::CSourceDSound.

Definition at line 154 of file source.h.

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.

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.

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.

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.

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

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

Implemented in NLSOUND::CSourceDSound.

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.

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.

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.

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.

virtual void NLSOUND::ISource::setStaticBuffer IBuffer   buffer [inline, 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.

Reimplemented in NLSOUND::CSourceDSound.

Definition at line 69 of file source.h.

References _Buffer.

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.

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.

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

Stop playing.

Implemented in NLSOUND::CSourceDSound.

virtual void NLSOUND::ISource::update   [pure virtual]
 

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

Implemented in NLSOUND::CSourceDSound.


Member Data Documentation

IBuffer* NLSOUND::ISource::_Buffer [protected]
 

Definition at line 167 of file source.h.

Referenced by NLSOUND::CSourceDSound::crossFade, NLSOUND::CSourceDSound::fadeIn, NLSOUND::CSourceDSound::fadeOut, NLSOUND::CSourceDSound::fill, NLSOUND::CSourceDSound::getBuffer, NLSOUND::CSourceDSound::getFadeOutSize, NLSOUND::CSourceDSound::getPitch, getStaticBuffer, ISource, NLSOUND::CSourceAL::pause, NLSOUND::CSourceDSound::play, NLSOUND::CSourceAL::play, NLSOUND::CSourceDSound::release, NLSOUND::CSourceDSound::setPitch, NLSOUND::CSourceDSound::setStaticBuffer, setStaticBuffer, NLSOUND::CSourceAL::stop, NLSOUND::CSourceDSound::swap, and ~ISource.

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: