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

A set of sounds. More...

#include <sound_bank.h>

List of all members.

Public Methods

void registerBufferAssoc (CSimpleSound *sound, IBuffer *buffer)
void unregisterBufferAssoc (CSimpleSound *sound, IBuffer *buffer)
void bufferUnloaded (const std::string bufferName)
 Called by CSampleBank when a sample(buffer) is unloaded. More...

void bufferLoaded (const std::string bufferName, IBuffer *buffer)
 Called by CSampleBank when a sample(buffer) is loaded. More...

virtual ~CSoundBank ()
 Destructor. More...

void load ()
 Load all the sound samples. More...

void unload ()
 Remove all the sounds in this bank. More...

bool isLoaded ()
 Returns true if the sounds in this bank have been loaded. More...

CSoundgetSound (const std::string &name)
 Return a sound corresponding to a name. More...

void getNames (std::vector< std::string > &names)
 Return the names of the sounds. More...

uint countSounds ()
 Return the number of sounds in this bank. More...

void addSound (CSound *sound)
void removeSound (const std::string &name)

Static Public Methods

CSoundBank * instance ()
 Release all the loaded sound banks. More...

void release ()

Private Types

typedef std::hash_set< class
CSimpleSound *, THashPtr<
CSimpleSound * > > 
TSimpleSoundContainer
typedef std::hash_map< std::string,
TSimpleSoundContainer
TBufferAssocContainer
typedef std::hash_map< std::string,
CSound * > 
TSoundTable
 Sound names hash map. More...


Private Methods

 CSoundBank ()
 Constructor. More...


Private Attributes

TBufferAssocContainer _BufferAssoc
 Assoc from buffer to sound. Used for sound unloading. More...

TSoundTable _Sounds
bool _Loaded

Static Private Attributes

CSoundBank * _Instance
 CSoundBank singleton instance. More...


Detailed Description

A set of sounds.

Author:
Peter Hanappe \authoe Boris Boucher , Nevrax France
Date:
2001

Definition at line 48 of file sound_bank.h.


Member Typedef Documentation

typedef std::hash_map<std::string, TSimpleSoundContainer > NLSOUND::CSoundBank::TBufferAssocContainer [private]
 

Definition at line 104 of file sound_bank.h.

typedef std::hash_set<class CSimpleSound*, THashPtr<CSimpleSound*> > NLSOUND::CSoundBank::TSimpleSoundContainer [private]
 

Definition at line 103 of file sound_bank.h.

typedef std::hash_map<std::string, CSound*> NLSOUND::CSoundBank::TSoundTable [private]
 

Sound names hash map.

Definition at line 106 of file sound_bank.h.


Constructor & Destructor Documentation

NLSOUND::CSoundBank::~CSoundBank   [virtual]
 

Destructor.

Definition at line 143 of file sound_bank.cpp.

References unload.

NLSOUND::CSoundBank::CSoundBank   [inline, private]
 

Constructor.

Definition at line 97 of file sound_bank.h.

References _Loaded.

Referenced by instance.


Member Function Documentation

void NLSOUND::CSoundBank::addSound CSound   sound
 

Definition at line 148 of file sound_bank.cpp.

References _Sounds.

void NLSOUND::CSoundBank::bufferLoaded const std::string    bufferName,
IBuffer   buffer
 

Called by CSampleBank when a sample(buffer) is loaded.

Regenerate link between CSound and IBuffer.

Definition at line 86 of file sound_bank.cpp.

References _BufferAssoc.

void NLSOUND::CSoundBank::bufferUnloaded const std::string    bufferName
 

Called by CSampleBank when a sample(buffer) is unloaded.

Remove link from CSound to unloaded IBuffer.

Definition at line 68 of file sound_bank.cpp.

References _BufferAssoc.

uint NLSOUND::CSoundBank::countSounds  
 

Return the number of sounds in this bank.

Definition at line 351 of file sound_bank.cpp.

References _Sounds.

void NLSOUND::CSoundBank::getNames std::vector< std::string > &    names
 

Return the names of the sounds.

Definition at line 338 of file sound_bank.cpp.

References _Sounds.

CSound * NLSOUND::CSoundBank::getSound const std::string &    name
 

Return a sound corresponding to a name.

Definition at line 321 of file sound_bank.cpp.

References _Sounds.

CSoundBank * NLSOUND::CSoundBank::instance   [static]
 

Release all the loaded sound banks.

Definition at line 53 of file sound_bank.cpp.

References _Instance, and CSoundBank.

bool NLSOUND::CSoundBank::isLoaded  
 

Returns true if the sounds in this bank have been loaded.

Definition at line 313 of file sound_bank.cpp.

References _Loaded.

void NLSOUND::CSoundBank::load  
 

Load all the sound samples.

Can throw EPathNotFound or ESoundFileNotFound (check Exception)

Definition at line 273 of file sound_bank.cpp.

References _Loaded, NLSOUND::Container, and nlassert.

void NLSOUND::CSoundBank::registerBufferAssoc CSimpleSound   sound,
IBuffer   buffer
 

Definition at line 106 of file sound_bank.cpp.

References _BufferAssoc.

void NLSOUND::CSoundBank::release   [static]
 

Definition at line 60 of file sound_bank.cpp.

References _Instance.

void NLSOUND::CSoundBank::removeSound const std::string &    name
 

Definition at line 153 of file sound_bank.cpp.

References _Sounds.

void NLSOUND::CSoundBank::unload  
 

Remove all the sounds in this bank.

Definition at line 285 of file sound_bank.cpp.

References _Loaded, _Sounds, and nlassert.

Referenced by ~CSoundBank.

void NLSOUND::CSoundBank::unregisterBufferAssoc CSimpleSound   sound,
IBuffer   buffer
 

Definition at line 115 of file sound_bank.cpp.

References _BufferAssoc, and nlassert.


Member Data Documentation

TBufferAssocContainer NLSOUND::CSoundBank::_BufferAssoc [private]
 

Assoc from buffer to sound. Used for sound unloading.

Definition at line 109 of file sound_bank.h.

Referenced by bufferLoaded, bufferUnloaded, registerBufferAssoc, and unregisterBufferAssoc.

CSoundBank * NLSOUND::CSoundBank::_Instance [static, private]
 

CSoundBank singleton instance.

Definition at line 49 of file sound_bank.cpp.

Referenced by instance, and release.

bool NLSOUND::CSoundBank::_Loaded [private]
 

Definition at line 115 of file sound_bank.h.

Referenced by CSoundBank, isLoaded, load, and unload.

TSoundTable NLSOUND::CSoundBank::_Sounds [private]
 

Definition at line 112 of file sound_bank.h.

Referenced by addSound, countSounds, getNames, getSound, removeSound, and unload.


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