From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- .../doxygen/nel/classNLSOUND_1_1CSourceDSound.html | 2947 ++++++++++++++++++++ 1 file changed, 2947 insertions(+) create mode 100644 docs/doxygen/nel/classNLSOUND_1_1CSourceDSound.html (limited to 'docs/doxygen/nel/classNLSOUND_1_1CSourceDSound.html') diff --git a/docs/doxygen/nel/classNLSOUND_1_1CSourceDSound.html b/docs/doxygen/nel/classNLSOUND_1_1CSourceDSound.html new file mode 100644 index 00000000..c4666aa1 --- /dev/null +++ b/docs/doxygen/nel/classNLSOUND_1_1CSourceDSound.html @@ -0,0 +1,2947 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# 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::CSourceDSound Class Reference

DirectSound sound source. +More... +

+#include <source_dsound.h> +

+

Inheritance diagram for NLSOUND::CSourceDSound: +

+ +NLSOUND::ISource + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 CSourceDSound (uint sourcename=0)
 Constructor. More...

virtual ~CSourceDSound ()
 Destructor. More...

void init (LPDIRECTSOUND directSound)
 Initialize the DirectSound buffers. Called by the sound driver only. More...

uint sourceName ()
 Return the OpenAL source name. More...

IBuffergetBuffer ()
 Returns the buffer associated with this source. More...

void reset ()
void updateVolume (const NLMISC::CVector &listener)
 Update the source's volume according to its distance and fade out curve. It takes the current position of the listener as argument. More...

virtual void setAlpha (double a)
 Set the alpha value for the volume-distance curve. 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...

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

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

virtual bool play ()
 Play the static buffer (or stream in and play). More...

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

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

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

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

virtual bool isPaused () const
 Return the paused state. More...

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

virtual bool update2 ()
 Update the source (e.g. 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 deferred)
 Set the position vector (default: (0,0,0)). More...

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

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

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

virtual void setDirection (const NLMISC::CVector &dir)
 Set the direction vector (3D mode only) (default: (0,0,0) as non-directional). More...

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

virtual void setGain (float gain)
 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. More...

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

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

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

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

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

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

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

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

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

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


Private Methods

void release ()
 Release all DirectSound resources. More...

bool lock (uint32 writePos, uint32 size, uint8 *&ptr1, DWORD &bytes1, uint8 *&ptr2, DWORD &bytes2)
bool unlock (uint8 *ptr1, DWORD bytes1, uint8 *ptr2, DWORD bytes2)
void swap ()
void getFadeOutSize (uint32 writePos, uint32 &xfadeSize, sint16 *&in1, uint32 &writtenTooMuch)
 Calculate the size of the crossfade and set the pointer in the sample buffer to the sample that comes after the write cursor in the DirectSound buffer. More...

bool fill ()
bool silence ()
void crossFade ()
void fadeOut ()
void fadeIn ()
bool needsUpdate ()
 Check whether the play position has advanced enough to require an update. More...

void setUsed (bool v)
bool isUsed ()

Private Attributes

uint _SourceName
uint32 _BufferSize
IBuffer_SwapBuffer
bool _Loop
TSourceDSoundUserState _UserState
LPDIRECTSOUNDBUFFER _SecondaryBuffer
TSourceDSoundBufferState _SecondaryBufferState
LPDIRECTSOUND3DBUFFER _3DBuffer
CRITICAL_SECTION _CriticalSection
uint32 _NextWritePos
uint32 _BytesWritten
uint32 _SilenceWritten
uint32 _EndPosition
TSourceDSoundEndState _EndState
float _Freq
uint32 _SampleRate
bool _IsUsed
sint32 _Volume
float _Gain
double _Alpha
NLMISC::CVector _Pos

Static Private Attributes

uint32 _UpdateCopySize = 16384
uint32 _SwapCopySize = 32768
uint _DefaultChannels = 1
uint _DefaultSampleRate = 22050
uint _DefaultSampleSize = 16
uint32 _XFadeSize = 64
uint32 _SecondaryBufferSize = 65536

Friends

class CSoundDriverDSound
+

Detailed Description

+DirectSound sound source. +

+For arguments as 3D vectors, use the NeL vector coordinate system +

+

+Author:
+Peter Hanappe , Nevrax France
+Date:
+2002
+

+ +

+Definition at line 93 of file source_dsound.h.


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + +
NLSOUND::CSourceDSound::CSourceDSound uint   sourcename = 0
+
+ + + + + +
+   + + +

+Constructor. +

+ +

+Definition at line 98 of file source_dsound.cpp. +

+References _3DBuffer, _Alpha, _BufferSize, _BytesWritten, _CriticalSection, _DefaultSampleRate, _EndPosition, _EndState, _Freq, _Gain, _IsUsed, _Loop, _NextWritePos, _SampleRate, _SecondaryBuffer, _SecondaryBufferState, _SilenceWritten, _SwapBuffer, _UserState, _Volume, NLSOUND::NL_DSOUND_SILENCED, NLSOUND::NL_DSOUND_STOPPED, and NLSOUND::NL_DSOUND_TAIL1.

+

+ + + + +
+ + + + + + + + + +
NLSOUND::CSourceDSound::~CSourceDSound   [virtual]
+
+ + + + + +
+   + + +

+Destructor. +

+ +

+Definition at line 124 of file source_dsound.cpp. +

+References _CriticalSection, nldebug, and release.

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::crossFade   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1618 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _CriticalSection, _Freq, _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, _SecondaryBufferState, _SilenceWritten, _SwapBuffer, _SwapCopySize, DBGPOS, getFadeOutSize, INITTIME, NLSOUND::NL_DSOUND_FILLING, NLSOUND::NL_DSOUND_SILENCING, and setPitch. +

+Referenced by play.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::fadeIn   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 2065 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _EndPosition, _EndState, _Freq, _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, _SecondaryBufferState, _SilenceWritten, _SwapCopySize, _UserState, data, DBGPOS, INITTIME, lock, NLSOUND::NL_DSOUND_FILLING, NLSOUND::NL_DSOUND_SILENCING, NLSOUND::NL_DSOUND_STOPPED, NLSOUND::NL_DSOUND_TAIL1, NLSOUND::NL_DSOUND_TAIL2, NLSOUND_MIN, res, setPitch, and updateVolume. +

+Referenced by play.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::fadeOut   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1881 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _EndPosition, _EndState, _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, _SecondaryBufferState, _SilenceWritten, _SwapCopySize, _UserState, DBGPOS, getFadeOutSize, INITTIME, NLSOUND::NL_DSOUND_SILENCING, NLSOUND::NL_DSOUND_STOPPED, NLSOUND::NL_DSOUND_TAIL1, and NLSOUND::NL_DSOUND_TAIL2. +

+Referenced by pause, and stop.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::fill   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1186 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _EndPosition, _EndState, _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, _SecondaryBufferState, _SilenceWritten, _UpdateCopySize, _UserState, data, DBGPOS, INITTIME, lock, NLSOUND::NL_DSOUND_SILENCING, NLSOUND::NL_DSOUND_STOPPED, NLSOUND::NL_DSOUND_TAIL1, NLSOUND::NL_DSOUND_TAIL2, NLSOUND_MIN, and res. +

+Referenced by update2.

+

+ + + + +
+ + + + + + + + + +
IBuffer * NLSOUND::CSourceDSound::getBuffer  
+
+ + + + + +
+   + + +

+Returns the buffer associated with this source. +

+ +

+Definition at line 1088 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::getCone float &   innerAngle,
float &   outerAngle,
float &   outerGain
const [virtual]
+
+ + + + + +
+   + + +

+Get the cone angles (in radian). +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 1039 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, and NLMISC::Pi.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::getDirection NLMISC::CVector  dir const [virtual]
+
+ + + + + +
+   + + +

+Get the direction vector. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 696 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, NLMISC::CVector::set, and v.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::getFadeOutSize uint32   writePos,
uint32  xfadeSize,
sint16 *&   in1,
uint32  writtenTooMuch
[private]
+
+ + + + + +
+   + + +

+Calculate the size of the crossfade and set the pointer in the sample buffer to the sample that comes after the write cursor in the DirectSound buffer. +

+This method also returns the number of samples that have been written after the write cursor. +

+Definition at line 1524 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _NextWritePos, _SecondaryBufferSize, _SilenceWritten, _XFadeSize, data, DBGPOS, and NLSOUND_DISTANCE. +

+Referenced by crossFade, and fadeOut.

+

+ + + + +
+ + + + + + + + + +
float NLSOUND::CSourceDSound::getGain   const [virtual]
+
+ + + + + +
+   + + +

+Get the gain. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 744 of file source_dsound.cpp. +

+References _Gain.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::getLooping   const [virtual]
+
+ + + + + +
+   + + +

+Return the looping state. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 317 of file source_dsound.cpp. +

+References _Loop.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::getMinMaxDistances float &   mindist,
float &   maxdist
const [virtual]
+
+ + + + + +
+   + + +

+Get the min and max distances. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 878 of file source_dsound.cpp. +

+References _3DBuffer, min, and nlwarning. +

+Referenced by updateVolume.

+

+ + + + +
+ + + + + + + + + +
float NLSOUND::CSourceDSound::getPitch   const [virtual]
+
+ + + + + +
+   + + +

+Get the pitch. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 778 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _SecondaryBuffer, format, nlwarning, and NLSOUND::TSampleFormat.

+

+ + + + +
+ + + + + + + + + +
const NLMISC::CVector & NLSOUND::CSourceDSound::getPos   const [virtual]
+
+ + + + + +
+   + + +

+Get the position vector. +

+See setPos() for details. +

+Implements NLSOUND::ISource. +

+Definition at line 610 of file source_dsound.cpp. +

+References _Pos. +

+Referenced by updateVolume.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::getSourceRelativeMode   const [virtual]
+
+ + + + + +
+   + + +

+Get the source relative mode. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 832 of file source_dsound.cpp. +

+References _3DBuffer, and nlwarning.

+

+ + + + +
+ + + + + + + + + + +
virtual uint32 NLSOUND::CSourceDSound::getTime void   [inline, virtual]
+
+ + + + + +
+   + + +

+Returns the number of milliseconds the source has been playing. +

+ +

+Reimplemented from NLSOUND::ISource. +

+Definition at line 159 of file source_dsound.h. +

+References _BytesWritten, and _SampleRate.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::getVelocity NLMISC::CVector  vel const [virtual]
+
+ + + + + +
+   + + +

+Get the velocity vector. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 653 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, NLMISC::CVector::set, and v.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::init LPDIRECTSOUND   directSound
+
+ + + + + +
+   + + +

+Initialize the DirectSound buffers. Called by the sound driver only. +

+ +

+Definition at line 168 of file source_dsound.cpp. +

+References _3DBuffer, _DefaultChannels, _DefaultSampleRate, _DefaultSampleSize, _SecondaryBuffer, _SecondaryBufferSize, CSoundDriverDSound, format, and nlwarning.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::isPaused   const [virtual]
+
+ + + + + +
+   + + +

+Return the paused state. +

+ +

+Definition at line 469 of file source_dsound.cpp. +

+References _UserState, and NLSOUND::NL_DSOUND_PAUSED.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::isPlaying   const [virtual]
+
+ + + + + +
+   + + +

+Return the playing state. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 461 of file source_dsound.cpp. +

+References _UserState, and NLSOUND::NL_DSOUND_PLAYING.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::isStopped   const [virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implements NLSOUND::ISource. +

+Definition at line 477 of file source_dsound.cpp. +

+References _UserState, and NLSOUND::NL_DSOUND_STOPPED.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::isUsed   [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 379 of file source_dsound.h. +

+References _IsUsed.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLSOUND::CSourceDSound::lock uint32   writePos,
uint32   size,
uint8 *&   ptr1,
DWORD &   bytes1,
uint8 *&   ptr2,
DWORD &   bytes2
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1096 of file source_dsound.cpp. +

+References _NextWritePos, _SecondaryBuffer, _UpdateCopySize, and nlwarning. +

+Referenced by fadeIn, fill, and silence.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::needsUpdate   [private]
+
+ + + + + +
+   + + +

+Check whether the play position has advanced enough to require an update. +

+ +

+Definition at line 485 of file source_dsound.cpp. +

+References _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, and _UpdateCopySize.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::pause   [virtual]
+
+ + + + + +
+   + + +

+Pause. Call play() to resume. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 440 of file source_dsound.cpp. +

+References _CriticalSection, _UserState, DBGPOS, fadeOut, NLSOUND::NL_DSOUND_PAUSED, NLSOUND::NL_DSOUND_PLAYING, and NLSOUND::TSourceDSoundUserState.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::play   [virtual]
+
+ + + + + +
+   + + +

+Play the static buffer (or stream in and play). +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 335 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BytesWritten, _CriticalSection, _SecondaryBufferState, _SwapBuffer, _UserState, crossFade, DBGPOS, fadeIn, NLSOUND::NL_DSOUND_FILLING, NLSOUND::NL_DSOUND_PLAYING, NLSOUND::NL_DSOUND_SILENCED, NLSOUND::NL_DSOUND_SILENCING, and swap.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::release   [private]
+
+ + + + + +
+   + + +

+Release all DirectSound resources. +

+ +

+Definition at line 143 of file source_dsound.cpp. +

+References _3DBuffer, NLSOUND::ISource::_Buffer, and _SecondaryBuffer. +

+Referenced by ~CSourceDSound.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::reset  
+
+ + + + + +
+   + + +

+ +

+Definition at line 273 of file source_dsound.cpp. +

+References setGain, setLooping, and setPitch.

+

+ + + + +
+ + + + + + + + + + +
virtual void NLSOUND::CSourceDSound::setAlpha double   a [inline, virtual]
+
+ + + + + +
+   + + +

+Set the alpha value for the volume-distance curve. +

+alpha = 0.0: the volume will decrease linearly between 0dB and -100 dB alpha = 1.0: the volume will decrease linearly between 1.0 and 0.0 (linear scale) alpha = -1.0: the volume will decrease inversely with the distance (1/dist). This is the default used by DirectSound/OpenAL +

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

+Reimplemented from NLSOUND::ISource. +

+Definition at line 257 of file source_dsound.h. +

+References _Alpha.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::setCone float   innerAngle,
float   outerAngle,
float   outerGain
[virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implements NLSOUND::ISource. +

+Definition at line 965 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, and NLMISC::Pi.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setDirection const NLMISC::CVector  dir [virtual]
+
+ + + + + +
+   + + +

+Set the direction vector (3D mode only) (default: (0,0,0) as non-directional). +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 678 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::setEAXProperty uint   prop,
void *   value,
uint   valuesize
[virtual]
+
+ + + + + +
+   + + +

+Set any EAX source property if EAX available. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 1075 of file source_dsound.cpp. +

+References _SourceName, and value.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setGain float   gain [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. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 721 of file source_dsound.cpp. +

+References _Gain, _Volume, and NLMISC::clamp. +

+Referenced by reset.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setLooping bool   l [virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implements NLSOUND::ISource. +

+Definition at line 309 of file source_dsound.cpp. +

+References _Loop, and NLAISCRIPT::l. +

+Referenced by reset.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::setMinMaxDistances float   mindist,
float   maxdist,
bool   deferred
[virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implements NLSOUND::ISource. +

+Definition at line 856 of file source_dsound.cpp. +

+References _3DBuffer, and nlwarning.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setPitch float   pitch [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. +

+Implements NLSOUND::ISource. +

+Definition at line 752 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _SampleRate, _SecondaryBuffer, format, nlwarning, and NLSOUND::TSampleFormat. +

+Referenced by crossFade, fadeIn, and reset.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::setPos const NLMISC::CVector  pos,
bool   deferred
[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

+Parameters:
+ + +
deferred  +false to apply position immediatly
+
+

+Implements NLSOUND::ISource. +

+Definition at line 590 of file source_dsound.cpp. +

+References _3DBuffer, _Pos, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setSourceRelativeMode bool   mode [virtual]
+
+ + + + + +
+   + + +

+Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false). +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 803 of file source_dsound.cpp. +

+References _3DBuffer, and nlwarning.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setStaticBuffer IBuffer  buffer [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. +

+Set NULL to set "no buffer" +

+Reimplemented from NLSOUND::ISource. +

+Definition at line 283 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, _CriticalSection, _SwapBuffer, and stop.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::setUsed bool   v [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 376 of file source_dsound.h. +

+References _IsUsed, and v.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLSOUND::CSourceDSound::setVelocity const NLMISC::CVector  vel,
bool   deferred
[virtual]
+
+ + + + + +
+   + + +

+Set the velocity vector (3D mode only) (default: (0,0,0)). +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 639 of file source_dsound.cpp. +

+References _3DBuffer, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::silence   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1394 of file source_dsound.cpp. +

+References _BufferSize, _BytesWritten, _EndPosition, _EndState, _NextWritePos, _SecondaryBuffer, _SecondaryBufferSize, _SecondaryBufferState, _SilenceWritten, _UpdateCopySize, _UserState, DBGPOS, INITTIME, lock, NLSOUND::NL_DSOUND_ENDED, NLSOUND::NL_DSOUND_PLAYING, NLSOUND::NL_DSOUND_SILENCED, NLSOUND::NL_DSOUND_STOPPED, NLSOUND::NL_DSOUND_TAIL1, and NLSOUND::NL_DSOUND_TAIL2. +

+Referenced by update2.

+

+ + + + +
+ + + + + + + + + +
uint NLSOUND::CSourceDSound::sourceName   [inline]
+
+ + + + + +
+   + + +

+Return the OpenAL source name. +

+ +

+Definition at line 234 of file source_dsound.h. +

+References _SourceName.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::stop   [virtual]
+
+ + + + + +
+   + + +

+Stop playing. +

+ +

+Implements NLSOUND::ISource. +

+Definition at line 417 of file source_dsound.cpp. +

+References _BytesWritten, _CriticalSection, _UserState, DBGPOS, fadeOut, NLSOUND::NL_DSOUND_PLAYING, NLSOUND::NL_DSOUND_STOPPED, and NLSOUND::TSourceDSoundUserState. +

+Referenced by setStaticBuffer.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::swap   [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 325 of file source_dsound.cpp. +

+References NLSOUND::ISource::_Buffer, _BufferSize, _BytesWritten, and _SwapBuffer. +

+Referenced by play.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLSOUND::CSourceDSound::unlock uint8  ptr1,
DWORD   bytes1,
uint8  ptr2,
DWORD   bytes2
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1125 of file source_dsound.cpp. +

+References _SecondaryBuffer.

+

+ + + + +
+ + + + + + + + + +
void NLSOUND::CSourceDSound::update   [virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implements NLSOUND::ISource. +

+Definition at line 519 of file source_dsound.cpp. +

+References update2.

+

+ + + + +
+ + + + + + + + + +
bool NLSOUND::CSourceDSound::update2   [virtual]
+
+ + + + + +
+   + + +

+Update the source (e.g. +

+continue to stream the data in) Returns an indication whether the source actually streamed data or not. +

+Definition at line 526 of file source_dsound.cpp. +

+References _CriticalSection, _NextWritePos, _SecondaryBufferSize, _UpdateCopySize, fill, INITTIME, NLSOUND::NL_DSOUND_FILLING, NLSOUND::NL_DSOUND_SILENCED, NLSOUND::NL_DSOUND_SILENCING, res, and silence. +

+Referenced by update.

+

+ + + + +
+ + + + + + + + + + +
void NLSOUND::CSourceDSound::updateVolume const NLMISC::CVector  listener
+
+ + + + + +
+   + + +

+Update the source's volume according to its distance and fade out curve. It takes the current position of the listener as argument. +

+ +

+Definition at line 907 of file source_dsound.cpp. +

+References _Alpha, _SecondaryBuffer, _Volume, NLMISC::clamp, getMinMaxDistances, getPos, min, and NLMISC::CVector::sqrnorm. +

+Referenced by fadeIn.

+


Friends And Related Function Documentation

+

+ + + + +
+ + +
friend class CSoundDriverDSound [friend] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 96 of file source_dsound.h. +

+Referenced by init.

+


Member Data Documentation

+

+ + + + +
+ + +
LPDIRECTSOUND3DBUFFER NLSOUND::CSourceDSound::_3DBuffer [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 342 of file source_dsound.h. +

+Referenced by CSourceDSound, getCone, getDirection, getMinMaxDistances, getSourceRelativeMode, getVelocity, init, release, setCone, setDirection, setMinMaxDistances, setPos, setSourceRelativeMode, and setVelocity.

+

+ + + + +
+ + +
double NLSOUND::CSourceDSound::_Alpha [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 384 of file source_dsound.h. +

+Referenced by CSourceDSound, setAlpha, and updateVolume.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_BufferSize [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 321 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, getFadeOutSize, setStaticBuffer, silence, and swap.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_BytesWritten [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 351 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, getFadeOutSize, getTime, play, setStaticBuffer, silence, stop, and swap.

+

+ + + + +
+ + +
CRITICAL_SECTION NLSOUND::CSourceDSound::_CriticalSection [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 345 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, pause, play, setStaticBuffer, stop, update2, and ~CSourceDSound.

+

+ + + + +
+ + +
uint NLSOUND::CSourceDSound::_DefaultChannels = 1 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 64 of file source_dsound.cpp. +

+Referenced by init.

+

+ + + + +
+ + +
uint NLSOUND::CSourceDSound::_DefaultSampleRate = 22050 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 65 of file source_dsound.cpp. +

+Referenced by CSourceDSound, and init.

+

+ + + + +
+ + +
uint NLSOUND::CSourceDSound::_DefaultSampleSize = 16 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 66 of file source_dsound.cpp. +

+Referenced by init.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_EndPosition [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 357 of file source_dsound.h. +

+Referenced by CSourceDSound, fadeIn, fadeOut, fill, and silence.

+

+ + + + +
+ + +
TSourceDSoundEndState NLSOUND::CSourceDSound::_EndState [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 364 of file source_dsound.h. +

+Referenced by CSourceDSound, fadeIn, fadeOut, fill, and silence.

+

+ + + + +
+ + +
float NLSOUND::CSourceDSound::_Freq [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 367 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, and fadeIn.

+

+ + + + +
+ + +
float NLSOUND::CSourceDSound::_Gain [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 382 of file source_dsound.h. +

+Referenced by CSourceDSound, getGain, and setGain.

+

+ + + + +
+ + +
bool NLSOUND::CSourceDSound::_IsUsed [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 373 of file source_dsound.h. +

+Referenced by CSourceDSound, isUsed, and setUsed.

+

+ + + + +
+ + +
bool NLSOUND::CSourceDSound::_Loop [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 327 of file source_dsound.h. +

+Referenced by CSourceDSound, getLooping, and setLooping.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_NextWritePos [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 348 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, getFadeOutSize, lock, needsUpdate, silence, and update2.

+

+ + + + +
+ + +
NLMISC::CVector NLSOUND::CSourceDSound::_Pos [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 386 of file source_dsound.h. +

+Referenced by getPos, and setPos.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_SampleRate [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 370 of file source_dsound.h. +

+Referenced by CSourceDSound, getTime, and setPitch.

+

+ + + + +
+ + +
LPDIRECTSOUNDBUFFER NLSOUND::CSourceDSound::_SecondaryBuffer [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 333 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, getPitch, init, lock, needsUpdate, release, setPitch, silence, unlock, and updateVolume.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_SecondaryBufferSize = 65536 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 60 of file source_dsound.cpp. +

+Referenced by crossFade, fadeIn, fadeOut, fill, getFadeOutSize, init, needsUpdate, silence, and update2.

+

+ + + + +
+ + +
TSourceDSoundBufferState NLSOUND::CSourceDSound::_SecondaryBufferState [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 339 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, play, and silence.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_SilenceWritten [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 354 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, fadeIn, fadeOut, fill, getFadeOutSize, and silence.

+

+ + + + +
+ + +
uint NLSOUND::CSourceDSound::_SourceName [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 318 of file source_dsound.h. +

+Referenced by setEAXProperty, and sourceName.

+

+ + + + +
+ + +
IBuffer* NLSOUND::CSourceDSound::_SwapBuffer [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 324 of file source_dsound.h. +

+Referenced by crossFade, CSourceDSound, play, setStaticBuffer, and swap.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_SwapCopySize = 32768 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 61 of file source_dsound.cpp. +

+Referenced by crossFade, fadeIn, and fadeOut.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_UpdateCopySize = 16384 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 62 of file source_dsound.cpp. +

+Referenced by fill, lock, needsUpdate, silence, and update2.

+

+ + + + +
+ + +
TSourceDSoundUserState NLSOUND::CSourceDSound::_UserState [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 330 of file source_dsound.h. +

+Referenced by CSourceDSound, fadeIn, fadeOut, fill, isPaused, isPlaying, isStopped, pause, play, silence, and stop.

+

+ + + + +
+ + +
sint32 NLSOUND::CSourceDSound::_Volume [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 381 of file source_dsound.h. +

+Referenced by CSourceDSound, setGain, and updateVolume.

+

+ + + + +
+ + +
uint32 NLSOUND::CSourceDSound::_XFadeSize = 64 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 63 of file source_dsound.cpp. +

+Referenced by getFadeOutSize.

+


The documentation for this class was generated from the following files: + + + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1