NLSOUND::ISource Class Reference

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

#include <source.h>

Inherited by NLSOUND::CSourceAL, NLSOUND::CSourceDSound, NLSOUND::CSourceFMod, and NLSOUND::CSourceXAudio2.

List of all members.

Public Types

enum  TFilter { FilterLowPass, FilterBandPass, FilterHighPass }

Public Member Functions

 ISource ()
 Constructor.
virtual ~ISource ()
 Destructor.
Initialization



virtual void setStreaming (bool streaming=true)=0
 This function is used to switch between streaming and static buffer modes.
virtual void setStaticBuffer (IBuffer *buffer)=0
 Sets the buffer that is used for playback by this source.
virtual IBuffergetStaticBuffer ()=0
 Returns the buffer that was attached to this source.
virtual void submitStreamingBuffer (IBuffer *buffer)=0
virtual uint countStreamingBuffers () const =0
 Returns the amount of buffers that are currently in the queue.
Playback control



virtual void setLooping (bool l=true)=0
 This function is used to enable or disable looping this source.
virtual bool getLooping () const =0
 Returns the looping status that was last set by setLooping().
virtual bool play ()=0
 This function is used to enter playing mode.
virtual void stop ()=0
 This function stops playing the source immediately.
virtual void pause ()=0
 This function pauses playback of this source at it's current position.
virtual bool isPlaying () const =0
 Returns if the source is currently playing.
virtual bool isStopped () const =0
 Returns true if the source has not started playing yet, when it has been stopped using the stop() method, or when the static buffer has finished playback.
virtual bool isPaused () const =0
 Returns true if the source has been paused by calling pause().
virtual uint32 getTime ()=0
 Returns the number of milliseconds the current static buffer or streaming queue has effectively been playing.
Source properties



virtual void setPos (const NLMISC::CVector &pos, bool deffered=true)=0
 Set the position vector (default: (0,0,0)).
virtual const NLMISC::CVectorgetPos () const =0
 Get the position vector.
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)).
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 getDirection (NLMISC::CVector &dir) const =0
 Get the direction vector.
virtual void setGain (float gain=NLSOUND_DEFAULT_GAIN)=0
 Set the gain (volume value inside [0 , 1]). (default: 1).
virtual float getGain () const =0
 Get the gain.
virtual void setPitch (float pitch=NLSOUND_DEFAULT_PITCH)=0
 Shift the frequency. 1.0f equals identity, each reduction of 50% equals a pitch shift of one octave.
virtual float getPitch () const =0
 Get the pitch.
virtual void setSourceRelativeMode (bool mode=true)=0
 Set the source relative mode. If true, positions are interpreted relative to the listener position.
virtual bool getSourceRelativeMode () const =0
 Get the source relative mode.
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 getMinMaxDistances (float &mindist, float &maxdist) const =0
 Get the min and max distances.
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 getCone (float &innerAngle, float &outerAngle, float &outerGain) const =0
 Get the cone angles (in radian).
virtual void setAlpha (double a)=0
 Set the alpha value for the volume-distance curve.
Direct output



virtual void setDirect (bool enable=true)=0
 Enable or disable direct output [true/false], default: true.
virtual bool getDirect () const =0
 Return if the direct output is enabled.
virtual void setDirectGain (float gain=NLSOUND_DEFAULT_DIRECT_GAIN)=0
 Set the gain for the direct path.
virtual float getDirectGain () const =0
 Get the gain for the direct path.
virtual void enableDirectFilter (bool enable=true)=0
 Enable or disable the filter for the direct channel.
virtual bool isDirectFilterEnabled () const =0
 Check if the filter on the direct channel is enabled.
virtual void setDirectFilter (TFilter filter, float lowFrequency=NLSOUND_DEFAULT_FILTER_PASS_LF, float highFrequency=NLSOUND_DEFAULT_FILTER_PASS_HF, float passGain=NLSOUND_DEFAULT_FILTER_PASS_GAIN)=0
 Set the filter parameters for the direct channel.
virtual void getDirectFilter (TFilter &filterType, float &lowFrequency, float &highFrequency, float &passGain) const =0
 Get the filter parameters for the direct channel.
virtual void setDirectFilterPassGain (float passGain=NLSOUND_DEFAULT_FILTER_PASS_GAIN)=0
 Set the direct filter gain.
virtual float getDirectFilterPassGain () const =0
 Get the direct filter gain.
Effect output



virtual void setEffect (IReverbEffect *reverbEffect)=0
 Set the effect send for this source, NULL to disable. [IEffect], default: NULL.
virtual IEffect * getEffect () const =0
 Get the effect send for this source.
virtual void setEffectGain (float gain=NLSOUND_DEFAULT_EFFECT_GAIN)=0
 Set the gain for the effect path.
virtual float getEffectGain () const =0
 Get the gain for the effect path.
virtual void enableEffectFilter (bool enable=true)=0
 Enable or disable the filter for the effect channel.
virtual bool isEffectFilterEnabled () const =0
 Check if the filter on the effect channel is enabled.
virtual void setEffectFilter (TFilter filter, float lowFrequency=NLSOUND_DEFAULT_FILTER_PASS_LF, float highFrequency=NLSOUND_DEFAULT_FILTER_PASS_HF, float passGain=NLSOUND_DEFAULT_FILTER_PASS_GAIN)=0
 Set the filter parameters for the effect channel.
virtual void getEffectFilter (TFilter &filterType, float &lowFrequency, float &highFrequency, float &passGain) const =0
 Get the filter parameters for the effect channel.
virtual void setEffectFilterPassGain (float passGain=NLSOUND_DEFAULT_FILTER_PASS_GAIN)=0
 Set the effect filter gain.
virtual float getEffectFilterPassGain () const =0
 Get the effect filter gain.

Static Protected Member Functions

static sint32 computeManualRollOff (sint32 volumeMB, sint32 mbMin, sint32 mbMax, double alpha, float sqrdist, float distMin, float distMax)
static float computeManualRolloff (double alpha, float sqrdist, float distMin, float distMax)

Detailed Description

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

Author:
Olivier Cado
Nevrax France
Jan Boon (Kaetemi)
Date:
2001-2009 Interface for physical sound sources.

Definition at line 148 of file source.h.


Member Enumeration Documentation

Enumerator:
FilterLowPass 
FilterBandPass 
FilterHighPass 

Definition at line 151 of file source.h.


Constructor & Destructor Documentation

NLSOUND::ISource::ISource (  )  [inline]

Constructor.

Definition at line 159 of file source.h.

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

Destructor.

Definition at line 161 of file source.h.


Member Function Documentation

float NLSOUND::ISource::computeManualRolloff ( double  alpha,
float  sqrdist,
float  distMin,
float  distMax 
) [static, protected]
sint32 NLSOUND::ISource::computeManualRollOff ( sint32  volumeMB,
sint32  mbMin,
sint32  mbMax,
double  alpha,
float  sqrdist,
float  distMin,
float  distMax 
) [static, protected]

Definition at line 33 of file source.cpp.

References NLMISC::clamp().

Referenced by computeManualRolloff(), and NLSOUND::CSourceDSound::updateVolume().

virtual uint NLSOUND::ISource::countStreamingBuffers (  )  const [pure virtual]

Returns the amount of buffers that are currently in the queue.

This includes buffers that are waiting to be played, as well as the buffer that is currently playing. Buffers that have finished playing are removed from the queue, and do not count towards the result of this function. It is recommended to have at least 2 or 3 buffers queued up when streaming, to avoid sound stopping glitches. If you need to know the total amount of buffers that were added into the queue, you should count them manually by increasing a value each time 'submitStreamingBuffer' is called. This function always returns 0 when the source is in static mode, when the source is stopped, or when no buffers have been added yet into the queue. Get the number of buffers in the streaming queue.

Returns:
The number of buffers in the queue.

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

virtual void NLSOUND::ISource::enableDirectFilter ( bool  enable = true  )  [pure virtual]

Enable or disable the filter for the direct channel.

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

virtual void NLSOUND::ISource::enableEffectFilter ( bool  enable = true  )  [pure virtual]

Enable or disable the filter for the effect channel.

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

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

Get the cone angles (in radian).

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

virtual bool NLSOUND::ISource::getDirect (  )  const [pure virtual]

Return if the direct output is enabled.

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

virtual void NLSOUND::ISource::getDirectFilter ( TFilter filterType,
float lowFrequency,
float highFrequency,
float passGain 
) const [pure virtual]

Get the filter parameters for the direct channel.

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

virtual float NLSOUND::ISource::getDirectFilterPassGain (  )  const [pure virtual]

Get the direct filter gain.

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

virtual float NLSOUND::ISource::getDirectGain (  )  const [pure virtual]

Get the gain for the direct path.

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

virtual void NLSOUND::ISource::getDirection ( NLMISC::CVector dir  )  const [pure virtual]
virtual IEffect* NLSOUND::ISource::getEffect (  )  const [pure virtual]

Get the effect send for this source.

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

virtual void NLSOUND::ISource::getEffectFilter ( TFilter filterType,
float lowFrequency,
float highFrequency,
float passGain 
) const [pure virtual]

Get the filter parameters for the effect channel.

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

virtual float NLSOUND::ISource::getEffectFilterPassGain (  )  const [pure virtual]

Get the effect filter gain.

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

virtual float NLSOUND::ISource::getEffectGain (  )  const [pure virtual]

Get the gain for the effect path.

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

virtual float NLSOUND::ISource::getGain (  )  const [pure virtual]
virtual bool NLSOUND::ISource::getLooping (  )  const [pure virtual]

Returns the looping status that was last set by setLooping().

This function will always return the last set looping option. If you call this while in streaming mode, the result will be the setting that will be used when you go back to static buffer mode. Looping has no effect on streaming. Get the currently set looping status.

Returns:
Returns true if looping is enabled, false if disabled.

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

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

Get the min and max distances.

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

virtual float NLSOUND::ISource::getPitch (  )  const [pure virtual]
virtual const NLMISC::CVector& NLSOUND::ISource::getPos (  )  const [pure virtual]
virtual bool NLSOUND::ISource::getSourceRelativeMode (  )  const [pure virtual]

Get the source relative mode.

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

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

Returns the buffer that was attached to this source.

A buffer can by attached to this source by calling setStaticBuffer(). If no static buffer is set, or if the source is in streaming mode, this function will return NULL. Get the buffer that is attached to this source.

Returns:
A pointer to the attached IBuffer, or NULL if none.

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

virtual uint32 NLSOUND::ISource::getTime (  )  [pure virtual]

Returns the number of milliseconds the current static buffer or streaming queue has effectively been playing.

In streaming mode, the time spent during buffer outruns is not counted towards the playback time, and the playback time is be the current time position in the entire submitted queue. When using static buffers, the result is the tot time that the attached buffer has been playing. If the source is looping, the time will be the total of all playbacks of the buffer. When the source is stopped, this will return the time where the source was stopped. The value is reset to 0 when re-entering playing status. A buffer that is played at a higher pitch will result in a lower playback time. The result is not the buffer's playback position, but the actual time that has passed playing. It is not guaranteed that this function returns an accurate value, or that it even works. If it is not implemented, the result will always be 0. Get the current playback time in milliseconds.

Returns:
Returns the current playback time in milliseconds.

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

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

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

Check if the filter on the direct channel is enabled.

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

virtual bool NLSOUND::ISource::isEffectFilterEnabled (  )  const [pure virtual]

Check if the filter on the effect channel is enabled.

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

virtual bool NLSOUND::ISource::isPaused (  )  const [pure virtual]

Returns true if the source has been paused by calling pause().

If the source is playing, stopped, or has finished playback this returns false. Get the paused state.

Returns:
Returns the paused state.

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

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

Returns if the source is currently playing.

In streaming mode this will return true, even if no buffers are available for playback when in playing status. This will return false if the source is paused. To know if the source has been stopped, or if it has finished playback, you should use isStopped() instead. Get the playing state.

Returns:
Returns the playing state.

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

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

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

Returns true if the source has not started playing yet, when it has been stopped using the stop() method, or when the static buffer has finished playback.

If the source is playing or paused, this returns false. Get the stopped state.

Returns:
Returns the stopped state.

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

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

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

This function pauses playback of this source at it's current position.

If the source is stopped or already paused, this function does nothing. You can verify if the source is paused by calling isPaused(). To resume playback, you must call play(). Pause playback.

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

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

This function is used to enter playing mode.

It will return true in case of success. The playing status can also be verified by calling isPlaying() on this source. If the source is stopped, or has not started playing yet, the source will start playing from the beginning from the currently attached static buffer when in static mode. If no static buffer was set, the source will remain in stopped mode, and this will return false. A buffer can be attached to this source by calling the setStaticBuffer() method. When the source is stopped and in streaming mode, this function will always enter playing state. If no buffers were queued yet, it will effectively start playing this source once the first buffer has been submitted. It is recommended to queue up the first few buffers before calling play() to avoid running out of buffers early. In streaming mode, buffers can be submitted to the queue by calling the submitStreamingBuffer() method. If the source is in paused mode, it will simply resume. In case it was already in playing mode, the source will be automatically stopped before re-entering playing status. In static buffer mode this is essentially the same as restarting the source from the beginning, while doing this in streaming mode will result in the streaming queue being cleared. Start or resume playback.

Returns:
Returns true in case of success.

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

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

virtual void NLSOUND::ISource::setAlpha ( double  a  )  [pure virtual]

Set the alpha value for the volume-distance curve.

Used only with OptionManualRolloff. Value ranges from -1.0 to 1.0, the default is 0.0.

  • alpha = 0.0: The volume will decrease linearly between 0dB and -100 dB.
  • alpha = 1.0: The volume will decrease linearly between 1.0f and 0.0f (linear scale).
  • alpha = -1.0: The volume will decrease inversely with the distance (1/dist). This is the default distance attenuation used without OptionManualRolloff.

For any other value of alpha, an interpolation is be done between the two adjacent curves. For example, if alpha equals 0.5, the volume will be halfway between the linear dB curve and the linear amplitude curve. Set the alpha value for the volume-distance curve

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

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

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, NLSOUND::CSourceFMod, NLSOUND::CSourceAL, and NLSOUND::CSourceXAudio2.

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

virtual void NLSOUND::ISource::setDirect ( bool  enable = true  )  [pure virtual]

Enable or disable direct output [true/false], default: true.

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

virtual void NLSOUND::ISource::setDirectFilter ( TFilter  filter,
float  lowFrequency = NLSOUND_DEFAULT_FILTER_PASS_LF,
float  highFrequency = NLSOUND_DEFAULT_FILTER_PASS_HF,
float  passGain = NLSOUND_DEFAULT_FILTER_PASS_GAIN 
) [pure virtual]

Set the filter parameters for the direct channel.

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

virtual void NLSOUND::ISource::setDirectFilterPassGain ( float  passGain = NLSOUND_DEFAULT_FILTER_PASS_GAIN  )  [pure virtual]

Set the direct filter gain.

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

virtual void NLSOUND::ISource::setDirectGain ( float  gain = NLSOUND_DEFAULT_DIRECT_GAIN  )  [pure virtual]

Set the gain for the direct path.

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

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, NLSOUND::CSourceFMod, NLSOUND::CSourceAL, and NLSOUND::CSourceXAudio2.

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

virtual void NLSOUND::ISource::setEffect ( IReverbEffect reverbEffect  )  [pure virtual]

Set the effect send for this source, NULL to disable. [IEffect], default: NULL.

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

Referenced by NLSOUND::CAudioMixerUser::freeTrackWithoutSource(), and NLSOUND::CAudioMixerUser::getFreeTrackWithoutSource().

virtual void NLSOUND::ISource::setEffectFilter ( TFilter  filter,
float  lowFrequency = NLSOUND_DEFAULT_FILTER_PASS_LF,
float  highFrequency = NLSOUND_DEFAULT_FILTER_PASS_HF,
float  passGain = NLSOUND_DEFAULT_FILTER_PASS_GAIN 
) [pure virtual]

Set the filter parameters for the effect channel.

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

virtual void NLSOUND::ISource::setEffectFilterPassGain ( float  passGain = NLSOUND_DEFAULT_FILTER_PASS_GAIN  )  [pure virtual]

Set the effect filter gain.

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

virtual void NLSOUND::ISource::setEffectGain ( float  gain = NLSOUND_DEFAULT_EFFECT_GAIN  )  [pure virtual]

Set the gain for the effect path.

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

virtual void NLSOUND::ISource::setGain ( float  gain = NLSOUND_DEFAULT_GAIN  )  [pure virtual]
virtual void NLSOUND::ISource::setLooping ( bool  l = true  )  [pure virtual]

This function is used to enable or disable looping this source.

By default, looping is off. The current looping status can be obtained by calling getLooping(). It is possible to call this function either before the source has started playing, or while it is already playing. To cleanly exit a loop, you can call setLooping(false) instead of using stop(). Calling stop() on a source that is looping will immediately stop the source, which may suffer sound clicks. The looping state is useful on static buffers only. Setting this while in streaming mode will have no effect, however, the loop setting will be remembered when switching back to static mode. Enable or disable looping this source.

Parameters:
l Set to true to enable, false to disable looping or to exit the current loop.

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

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, NLSOUND::CSourceFMod, NLSOUND::CSourceAL, and NLSOUND::CSourceXAudio2.

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

virtual void NLSOUND::ISource::setPitch ( float  pitch = NLSOUND_DEFAULT_PITCH  )  [pure virtual]

Shift the frequency. 1.0f equals identity, each reduction of 50% equals a pitch shift of one octave.

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

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

virtual void NLSOUND::ISource::setPos ( const NLMISC::CVector pos,
bool  deffered = true 
) [pure virtual]
virtual void NLSOUND::ISource::setSourceRelativeMode ( bool  mode = true  )  [pure virtual]

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

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

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

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

Sets the buffer that is used for playback by this source.

The static buffer will remain active on the source until this function is called with a NULL parameter, or until the mode is changed to streaming. It is possible to play or loop this buffer as often as needed, as long as it is attached to this source. If you attach a multichannel (stereo) buffer, the source will automatically be set to relative mode. Setting a mono channel buffer will automatically set the relative mode back to it's original setting. It is not possible to enable relative mode with a multichannel buffer, instead you must manually split the sound data into multiple channels and use multiple sources. You cannot use this function in streaming mode, where you must use submitStreamingBuffer() instead. A buffer can be attached to more than once source. Before destroying a buffer, it must be detached from all sources it's attached to, which can be done by calling this function with a NULL parameter as buffer on all relevant sources. If you set the buffer while the source is already playing or in paused status, this function does nothing. You must stop() the source, or wait until it isStopped() before changing the buffer. Attach a buffer to this source.

Parameters:
buffer The buffer to be attached on this source. It must be created on the same sound driver instance as this source. Set this parameter to NULL to detach a previously set buffer.

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

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

virtual void NLSOUND::ISource::setStreaming ( bool  streaming = true  )  [pure virtual]

This function is used to switch between streaming and static buffer modes.

By default, streaming mode is off. Streaming mode must be enabled before calling functions related to buffer streaming, such as 'submitStreamingBuffer' and 'countStreamingBuffers'. In the default static buffer mode, only one buffer is set active on this source, and can be replayed or looped as many times as needed. When in streaming mode, multiple buffers are chained after each other, and you must make sure that the source does not run out of data, to avoid sound stopping glitches. The source must be stopped before trying to change the mode, if a static buffer was set it must be detached as well. Switch between streaming and static buffer modes.

Parameters:
streaming Set to true to enable streaming mode, or false to use static buffers. If you omit this parameter, it will be set as true, and streaming will be enabled.

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

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, NLSOUND::CSourceFMod, NLSOUND::CSourceAL, and NLSOUND::CSourceXAudio2.

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

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

This function stops playing the source immediately.

If the source is already stopped, it does nothing. If the source was paused, this will do the same as if it was playing. When the source is in static mode, the attached buffer will remain attached for later usage. To exit a loop, it is recommended to call setLooping(false) instead of stop(), to avoid sound clicks. The source will enter stopped state automatically when it has finished playing. If this source uses streaming buffers, calling this function will immediately stop output, and clear the buffer queue, which means that any queued buffers that have not played yet are lost. Stop playback.

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

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

virtual void NLSOUND::ISource::submitStreamingBuffer ( IBuffer buffer  )  [pure virtual]

The documentation for this class was generated from the following files:

Generated on Thu Jan 7 08:30:23 2010 for NeL by  doxygen 1.6.1