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

OpenAL sound driver. More...

#include <sound_driver_al.h>

Inheritance diagram for NLSOUND::CSoundDriverAL:

NLSOUND::ISoundDriver List of all members.

Public Methods

 CSoundDriverAL ()
 Constructor. More...

virtual bool init ()
 Initialization. More...

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

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

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

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

void applyRolloffFactor (float f)
 Change the rolloff factor and apply to all sources. More...

virtual bool loadWavFile (IBuffer *destbuffer, const char *filename)
 Temp. More...

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

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

virtual ~CSoundDriverAL ()
 Destructor. More...


Static Public Methods

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


Protected Methods

friend CBufferAL::~CBufferAL ()
friend CSourceAL::~CSourceAL ()
void removeBuffer (IBuffer *buffer)
 Remove a buffer. More...

void removeSource (ISource *source)
 Remove a source. More...

void allocateNewItems (TGenFunctionAL algenfunc, TTestFunctionAL altestfunc, std::vector< ALuint > &names, uint index, uint nb)
 Allocate nb new buffers or sources. More...

void generateItems (TGenFunctionAL algenfunc, TTestFunctionAL altestfunc, uint nb, ALuint *array)
 Generate nb buffers. More...

uint compactAliveNames (std::vector< ALuint > &names, TTestFunctionAL testfunc)
 Remove names of deleted items and return the number of valid items. More...

ALuint createItem (TGenFunctionAL algenfunc, TTestFunctionAL altestfunc, std::vector< ALuint > &names, uint &index, uint allocrate)
 Create a sound buffer or a sound source. More...

bool deleteItem (ALuint name, TGenFunctionAL aldeletefunc, std::vector< ALuint > &names)
 Delete a buffer or a source. More...


Private Attributes

std::vector< ALuint > _Buffers
std::vector< ALuint > _Sources
uint _NbExpBuffers
uint _NbExpSources
float _RolloffFactor

Static Private Attributes

CSoundDriverAL * _Instance = NULL

Detailed Description

OpenAL sound driver.

The caller of the create methods is responsible for the deletion of the created objects These objects must be deleted before deleting the ISoundDriver instance.

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 87 of file sound_driver_al.h.


Constructor & Destructor Documentation

NLSOUND::CSoundDriverAL::CSoundDriverAL  
 

Constructor.

Definition at line 126 of file sound_driver_al.cpp.

References _Instance, and nlerror.

Referenced by instance.

NLSOUND::CSoundDriverAL::~CSoundDriverAL   [virtual]
 

Destructor.

Definition at line 143 of file sound_driver_al.cpp.

References _Buffers, _Instance, _Sources, and compactAliveNames.

NLSOUND::CSoundDriverAL::CBufferAL::~CBufferAL   [protected]
 

NLSOUND::CSoundDriverAL::CSourceAL::~CSourceAL   [protected]
 


Member Function Documentation

void NLSOUND::CSoundDriverAL::allocateNewItems TGenFunctionAL    algenfunc,
TTestFunctionAL    altestfunc,
std::vector< ALuint > &    names,
uint    index,
uint    nb
[protected]
 

Allocate nb new buffers or sources.

Definition at line 212 of file sound_driver_al.cpp.

References generateItems, index, nlassert, NLSOUND::TGenFunctionAL, and NLSOUND::TTestFunctionAL.

Referenced by createItem, and init.

void NLSOUND::CSoundDriverAL::applyRolloffFactor float    f
 

Change the rolloff factor and apply to all sources.

Definition at line 393 of file sound_driver_al.cpp.

References _RolloffFactor, _Sources, and TestALError.

virtual void NLSOUND::CSoundDriverAL::commit3DChanges   [inline, virtual]
 

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

Implements NLSOUND::ISoundDriver.

Definition at line 119 of file sound_driver_al.h.

uint NLSOUND::CSoundDriverAL::compactAliveNames std::vector< ALuint > &    names,
TTestFunctionAL    testfunc
[protected]
 

Remove names of deleted items and return the number of valid items.

Definition at line 317 of file sound_driver_al.cpp.

References nlassert, and NLSOUND::TTestFunctionAL.

Referenced by createItem, and ~CSoundDriverAL.

virtual uint NLSOUND::CSoundDriverAL::countMaxSources   [inline, virtual]
 

Return the maximum number of sources that can created.

Implements NLSOUND::ISoundDriver.

Definition at line 107 of file sound_driver_al.h.

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

Create a sound buffer.

Implements NLSOUND::ISoundDriver.

Definition at line 261 of file sound_driver_al.cpp.

References _Buffers, _NbExpBuffers, BUFFER_ALLOC_RATE, and createItem.

ALuint NLSOUND::CSoundDriverAL::createItem TGenFunctionAL    algenfunc,
TTestFunctionAL    altestfunc,
std::vector< ALuint > &    names,
uint   index,
uint    allocrate
[protected]
 

Create a sound buffer or a sound source.

Definition at line 284 of file sound_driver_al.cpp.

References allocateNewItems, compactAliveNames, generateItems, index, nlassert, NLSOUND::TGenFunctionAL, and NLSOUND::TTestFunctionAL.

Referenced by createBuffer, and createSource.

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

Create the listener instance.

Implements NLSOUND::ISoundDriver.

Definition at line 383 of file sound_driver_al.cpp.

References nlassert.

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

Create a source.

Implements NLSOUND::ISoundDriver.

Definition at line 270 of file sound_driver_al.cpp.

References _NbExpSources, _RolloffFactor, _Sources, createItem, ROLLOFF_FACTOR_DEFAULT, and SOURCE_ALLOC_RATE.

bool NLSOUND::CSoundDriverAL::deleteItem ALuint    name,
TGenFunctionAL    aldeletefunc,
std::vector< ALuint > &    names
[protected]
 

Delete a buffer or a source.

Definition at line 366 of file sound_driver_al.cpp.

References TestALError, and NLSOUND::TGenFunctionAL.

Referenced by removeBuffer, and removeSource.

void NLSOUND::CSoundDriverAL::generateItems TGenFunctionAL    algenfunc,
TTestFunctionAL    altestfunc,
uint    nb,
ALuint *    array
[protected]
 

Generate nb buffers.

Definition at line 237 of file sound_driver_al.cpp.

References NLSOUND::TGenFunctionAL, NLSOUND::ThrowGenException, and NLSOUND::TTestFunctionAL.

Referenced by allocateNewItems, and createItem.

bool NLSOUND::CSoundDriverAL::init   [virtual]
 

Initialization.

Definition at line 159 of file sound_driver_al.cpp.

References _Buffers, _NbExpBuffers, _NbExpSources, _Sources, allocateNewItems, INITIAL_BUFFERS, INITIAL_SOURCES, nlinfo, and TestALError.

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

Return the instance of the singleton.

Definition at line 95 of file sound_driver_al.h.

References _Instance, and CSoundDriverAL.

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

Temp.

Implements NLSOUND::ISoundDriver.

Definition at line 424 of file sound_driver_al.cpp.

References NLSOUND::ALtoNLSoundFormat, data, and format.

void NLSOUND::CSoundDriverAL::removeBuffer IBuffer   buffer [protected, virtual]
 

Remove a buffer.

Implements NLSOUND::ISoundDriver.

Definition at line 338 of file sound_driver_al.cpp.

References _Buffers, deleteItem, nlassert, and nlwarning.

void NLSOUND::CSoundDriverAL::removeSource ISource   source [protected, virtual]
 

Remove a source.

Implements NLSOUND::ISoundDriver.

Definition at line 352 of file sound_driver_al.cpp.

References _Sources, deleteItem, nlassert, and nlwarning.

virtual void NLSOUND::CSoundDriverAL::writeProfile std::ostream &    out [inline, virtual]
 

Write information about the driver to the output stream.

Implements NLSOUND::ISoundDriver.

Definition at line 122 of file sound_driver_al.h.


Member Data Documentation

std::vector<ALuint> NLSOUND::CSoundDriverAL::_Buffers [private]
 

Definition at line 167 of file sound_driver_al.h.

Referenced by createBuffer, init, removeBuffer, and ~CSoundDriverAL.

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

Definition at line 120 of file sound_driver_al.cpp.

Referenced by CSoundDriverAL, instance, and ~CSoundDriverAL.

uint NLSOUND::CSoundDriverAL::_NbExpBuffers [private]
 

Definition at line 173 of file sound_driver_al.h.

Referenced by createBuffer, and init.

uint NLSOUND::CSoundDriverAL::_NbExpSources [private]
 

Definition at line 176 of file sound_driver_al.h.

Referenced by createSource, and init.

float NLSOUND::CSoundDriverAL::_RolloffFactor [private]
 

Definition at line 179 of file sound_driver_al.h.

Referenced by applyRolloffFactor, and createSource.

std::vector<ALuint> NLSOUND::CSoundDriverAL::_Sources [private]
 

Definition at line 170 of file sound_driver_al.h.

Referenced by applyRolloffFactor, createSource, init, removeSource, and ~CSoundDriverAL.


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