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

#include <sound_driver_dsound.h>

Inheritance diagram for NLSOUND::CSoundDriverDSound:

NLSOUND::ISoundDriver List of all members.

Public Methods

 CSoundDriverDSound ()
 Constructor. More...

virtual ~CSoundDriverDSound ()
virtual IListenercreateListener ()
 Create the listener instance. More...

virtual bool init (HWND wnd)
 Initialization. More...

virtual IBuffercreateBuffer ()
 Create a sound buffer. More...

virtual bool loadWavFile (IBuffer *destbuffer, const char *filename)
 Load a wave file in to the buffer. More...

virtual ISourcecreateSource ()
 Create a source. More...

virtual void commit3DChanges ()
 Commit all the changes made to 3D settings of listener and sources. More...

virtual uint countMaxSources ()
 Return the maximum number of sources that can created. More...

uint countHw3DBuffers ()
 Count the number of available hardware streaming 3D buffers. More...

uint countHw2DBuffers ()
 Count the number of available hardware streaming 2D buffers. More...

uint countPlayingSources ()
 Count the number of sources that are actually playing. More...

void update ()
 Update all the driver and its sources. To be called only by the timer callback. More...

void writeProfile (std::ostream &out)
 Write information about the driver to the output stream. More...

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

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


Static Public Methods

CSoundDriverDSound * instance ()
 Return the instance of the singleton. More...


Private Methods

friend CBufferDSound::~CBufferDSound ()
friend CSourceDSound::~CSourceDSound ()
virtual void removeBuffer (IBuffer *buffer)
 Remove a buffer (should be called by the friend destructor of the buffer class). More...

virtual void removeSource (ISource *source)
 Remove a source (should be called by the friend destructor of the source class). More...


Static Private Methods

void CALLBACK TimerCallback (UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)

Private Attributes

LPDIRECTSOUND _DirectSound
LPDIRECTSOUNDBUFFER _PrimaryBuffer
DSCAPS _Caps
std::set< CSourceDSound * > _Sources
uint _SourceCount
UINT _TimerID
uint32 _TimerResolution

Static Private Attributes

CSoundDriverDSound * _Instance = NULL
uint32 _TimerPeriod = 100

Constructor & Destructor Documentation

NLSOUND::CSoundDriverDSound::CSoundDriverDSound  
 

Constructor.

Definition at line 135 of file sound_driver_dsound.cpp.

References _DirectSound, _Instance, _PrimaryBuffer, _SourceCount, _TimerID, and nlerror.

Referenced by instance, and TimerCallback.

NLSOUND::CSoundDriverDSound::~CSoundDriverDSound   [virtual]
 

Definition at line 164 of file sound_driver_dsound.cpp.

References _DirectSound, _Instance, _PrimaryBuffer, _Sources, _TimerID, _TimerResolution, and nldebug.

NLSOUND::CSoundDriverDSound::CBufferDSound::~CBufferDSound   [private]
 

NLSOUND::CSoundDriverDSound::CSourceDSound::~CSourceDSound   [private]
 


Member Function Documentation

void NLSOUND::CSoundDriverDSound::commit3DChanges   [virtual]
 

Commit all the changes made to 3D settings of listener and sources.

Implements NLSOUND::ISoundDriver.

Definition at line 656 of file sound_driver_dsound.cpp.

References _Sources.

uint NLSOUND::CSoundDriverDSound::countHw2DBuffers  
 

Count the number of available hardware streaming 2D buffers.

Definition at line 564 of file sound_driver_dsound.cpp.

References _DirectSound.

Referenced by countMaxSources, and init.

uint NLSOUND::CSoundDriverDSound::countHw3DBuffers  
 

Count the number of available hardware streaming 3D buffers.

Definition at line 549 of file sound_driver_dsound.cpp.

References _DirectSound.

Referenced by countMaxSources, and init.

uint NLSOUND::CSoundDriverDSound::countMaxSources   [virtual]
 

Return the maximum number of sources that can created.

Implements NLSOUND::ISoundDriver.

Definition at line 443 of file sound_driver_dsound.cpp.

References countHw2DBuffers, and countHw3DBuffers.

uint NLSOUND::CSoundDriverDSound::countPlayingSources  
 

Count the number of sources that are actually playing.

Definition at line 681 of file sound_driver_dsound.cpp.

References _Sources.

Referenced by writeProfile.

IBuffer * NLSOUND::CSoundDriverDSound::createBuffer   [virtual]
 

Create a sound buffer.

Implements NLSOUND::ISoundDriver.

Definition at line 604 of file sound_driver_dsound.cpp.

References _PrimaryBuffer.

IListener * NLSOUND::CSoundDriverDSound::createListener   [virtual]
 

Create the listener instance.

Implements NLSOUND::ISoundDriver.

Definition at line 579 of file sound_driver_dsound.cpp.

References _PrimaryBuffer, and nlwarning.

ISource * NLSOUND::CSoundDriverDSound::createSource   [virtual]
 

Create a source.

Implements NLSOUND::ISoundDriver.

Definition at line 631 of file sound_driver_dsound.cpp.

References _DirectSound, _PrimaryBuffer, _Sources, and src.

float NLSOUND::CSoundDriverDSound::getGain  
 

Get the gain.

Definition at line 732 of file sound_driver_dsound.cpp.

References _PrimaryBuffer, and nldebug.

bool NLSOUND::CSoundDriverDSound::init HWND    wnd [virtual]
 

Initialization.

Definition at line 252 of file sound_driver_dsound.cpp.

References _Caps, _DirectSound, _PrimaryBuffer, _TimerID, _TimerPeriod, _TimerResolution, countHw2DBuffers, countHw3DBuffers, NLSOUND::CSoundDriverDSoundEnumCallback, format, nldebug, and nlwarning.

CSoundDriverDSound* NLSOUND::CSoundDriverDSound::instance   [inline, static]
 

Return the instance of the singleton.

Definition at line 53 of file sound_driver_dsound.h.

References _Instance, and CSoundDriverDSound.

bool NLSOUND::CSoundDriverDSound::loadWavFile IBuffer   destbuffer,
const char *    filename
[virtual]
 

Load a wave file in to the buffer.

Implements NLSOUND::ISoundDriver.

Definition at line 624 of file sound_driver_dsound.cpp.

void NLSOUND::CSoundDriverDSound::removeBuffer IBuffer   buffer [private, virtual]
 

Remove a buffer (should be called by the friend destructor of the buffer class).

Implements NLSOUND::ISoundDriver.

Definition at line 618 of file sound_driver_dsound.cpp.

void NLSOUND::CSoundDriverDSound::removeSource ISource   source [private, virtual]
 

Remove a source (should be called by the friend destructor of the source class).

Implements NLSOUND::ISoundDriver.

Definition at line 649 of file sound_driver_dsound.cpp.

References _Sources.

void NLSOUND::CSoundDriverDSound::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

Definition at line 700 of file sound_driver_dsound.cpp.

References _PrimaryBuffer, and nldebug.

void CALLBACK NLSOUND::CSoundDriverDSound::TimerCallback UINT    uID,
UINT    uMsg,
DWORD    dwUser,
DWORD    dw1,
DWORD    dw2
[static, private]
 

Definition at line 509 of file sound_driver_dsound.cpp.

References CSoundDriverDSound.

void NLSOUND::CSoundDriverDSound::update  
 

Update all the driver and its sources. To be called only by the timer callback.

Definition at line 517 of file sound_driver_dsound.cpp.

References _Sources, and NLMISC::TTicks.

void NLSOUND::CSoundDriverDSound::writeProfile std::ostream &    out [virtual]
 

Write information about the driver to the output stream.

Implements NLSOUND::ISoundDriver.

Definition at line 465 of file sound_driver_dsound.cpp.

References _DirectSound, and countPlayingSources.


Member Data Documentation

DSCAPS NLSOUND::CSoundDriverDSound::_Caps [private]
 

Definition at line 132 of file sound_driver_dsound.h.

Referenced by init.

LPDIRECTSOUND NLSOUND::CSoundDriverDSound::_DirectSound [private]
 

Definition at line 126 of file sound_driver_dsound.h.

Referenced by countHw2DBuffers, countHw3DBuffers, createSource, CSoundDriverDSound, init, writeProfile, and ~CSoundDriverDSound.

CSoundDriverDSound * NLSOUND::CSoundDriverDSound::_Instance = NULL [static, private]
 

Definition at line 44 of file sound_driver_dsound.cpp.

Referenced by CSoundDriverDSound, instance, and ~CSoundDriverDSound.

LPDIRECTSOUNDBUFFER NLSOUND::CSoundDriverDSound::_PrimaryBuffer [private]
 

Definition at line 129 of file sound_driver_dsound.h.

Referenced by createBuffer, createListener, createSource, CSoundDriverDSound, getGain, init, setGain, and ~CSoundDriverDSound.

uint NLSOUND::CSoundDriverDSound::_SourceCount [private]
 

Definition at line 139 of file sound_driver_dsound.h.

Referenced by CSoundDriverDSound.

std::set<CSourceDSound*> NLSOUND::CSoundDriverDSound::_Sources [private]
 

Definition at line 136 of file sound_driver_dsound.h.

Referenced by commit3DChanges, countPlayingSources, createSource, removeSource, update, and ~CSoundDriverDSound.

UINT NLSOUND::CSoundDriverDSound::_TimerID [private]
 

Definition at line 142 of file sound_driver_dsound.h.

Referenced by CSoundDriverDSound, init, and ~CSoundDriverDSound.

uint32 NLSOUND::CSoundDriverDSound::_TimerPeriod = 100 [static, private]
 

Definition at line 45 of file sound_driver_dsound.cpp.

Referenced by init.

uint32 NLSOUND::CSoundDriverDSound::_TimerResolution [private]
 

Definition at line 145 of file sound_driver_dsound.h.

Referenced by init, and ~CSoundDriverDSound.


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