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

Implementation of UAudioMixer. More...

#include <audio_mixer_user.h>

Inheritance diagram for NLSOUND::CAudioMixerUser:

NLSOUND::UAudioMixer List of all members.

Public Methods

 CAudioMixerUser ()
 Constructor. More...

virtual ~CAudioMixerUser ()
 Destructor. More...

virtual void init ()
 Initialization. More...

virtual void setPriorityReserve (TSoundPriority priorityChannel, uint reserve)
 Set the priority channel reserve. More...

virtual void setLowWaterMark (uint value)
 Set the Low water mark. More...

virtual void reset ()
 Resets the audio system (deletes all the sources, include envsounds). More...

virtual void enable (bool b)
 Disables or reenables the sound. More...

virtual uint32 loadSampleBank (bool async, const std::string &filename, std::vector< std::string > *notfoundfiles=NULL)
 Load buffers. More...

virtual bool unloadSampleBank (const std::string &filename)
 Unload buffers. More...

virtual void reloadSampleBanks (bool async)
 Reload all the sample bank. More...

virtual uint32 getLoadedSampleSize ()
 Return the total size in byte of loaded samples. More...

virtual TSoundId getSoundId (const std::string &name)
 Get a TSoundId from a name (returns NULL if not found). More...

virtual USourcecreateSource (const std::string &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam=NULL, CSoundContext *context=0)
 Add a logical sound source (returns NULL if name not found). More...

virtual USourcecreateSource (TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam=NULL, CSoundContext *context=0)
 Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*). More...

void addSource (CSourceCommon *source)
 Add a source which was created by an EnvSound. More...

virtual void removeSource (CSourceCommon *source)
 Delete a logical sound source. More...

virtual void setListenerPos (const NLMISC::CVector &pos)
 Use this method to set the listener position instead of using getListener->setPos(); It's because we have to update the background sounds in this case. More...

virtual UListenergetListener ()
 Return the listener interface. More...

virtual void selectEnvEffects (const std::string &tag)
 Choose the environmental effect(s) corresponding to tag. More...

virtual void update ()
 Update audio mixer (call evenly). More...

virtual void getSoundNames (std::vector< std::string > &names) const
 Return the names of the sounds (call this method after loadSounds()). More...

virtual uint getPolyphony () const
 Return the number of mixing tracks (voices). More...

virtual uint getSourcesNumber () const
 Return the number of sources (slow). More...

virtual uint getPlayingSourcesNumber () const
 Return the number of playing sources (slow). More...

virtual uint getNumberAvailableTracks () const
 Return the number of available tracks. More...

virtual std::string getSourcesStats () const
 Return a string showing the playing sources (slow). More...

void applyListenerMove (const NLMISC::CVector &listenerpos)
 Take a listener's move into account. More...

const NLMISC::CVectorgetListenPosVector () const
 Return the listen pos vector. More...

virtual void setSamplePath (const std::string &path)
 Set the global path to the sample banks. More...

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

virtual void loadBackgroundSoundFromRegion (const NLLIGO::CPrimRegion &region)
virtual void loadBackgroundEffectsFromRegion (const NLLIGO::CPrimRegion &region)
virtual void loadBackgroundSamplesFromRegion (const NLLIGO::CPrimRegion &region)
virtual void loadBackgroundSound (const std::string &continent)
virtual void playBackgroundSound ()
virtual void stopBackgroundSound ()
ISoundDrivergetSoundDriver ()
 Return the sound driver. More...

void registerBufferAssoc (CSound *sound, IBuffer *buffer)
void unregisterBufferAssoc (CSound *sound, IBuffer *buffer)
void bufferUnloaded (IBuffer *buffer)
void setBackgroundFlags (const TBackgroundFlags &backgroundFlags)
CTrackgetFreeTrack (CSimpleSource *source)
void freeTrack (CTrack *track)
void incPlayingSource ()
void decPlayingSource ()
void registerUpdate (IMixerUpdate *pmixerUpdate)
 Register an object in the update list. More...

void unregisterUpdate (IMixerUpdate *pmixerUpdate)
 Unregister an object from the update list. More...

void addEvent (IMixerEvent *pmixerEvent, const NLMISC::TTime &date)
 Add an event in the future. More...

void removeEvents (IMixerEvent *pmixerEvent)
 Remove any event programmed for this object. More...

void addSourceWaitingForPlay (CSimpleSource *source)
 Add a source for play as possible (for non discadable sound). More...

uint32 curTime ()

Static Public Methods

CAudioMixerUser * instance ()
 Return the audio mixer object. More...


Public Attributes

TSourceContainer _Sources
 All Logical sources. More...

uint32 _PlayingSources
 The source that wanted to play. More...

CTrack_Tracks [MAX_TRACKS]
 Physical sources array. More...

uint _NbTracks
 Size of the physical sources array (must be <= MAX_TRACKS). More...

uint _MaxNbTracks
 Max _NbTracks. More...

bool _Leaving
 Flag set in destructor. More...

NLMISC::TTicks _StartTime
double _UpdateTime
double _CreateTime
uint32 _UpdateCount
uint32 _CreateCount

Protected Methods

void getFreeTracks (uint nb, CTrack **tracks)
 Returns nb available tracks (or NULL). More...

virtual void getPlayingSoundsPos (std::vector< std::pair< bool, NLMISC::CVector > > &pos)
 See removeSource(USource*) and removeMySource(USource*). More...


Protected Attributes

TMixerUpdateContainer _UpdateList
 List of object to update. More...

std::vector< std::pair< IMixerUpdate *,
bool > > 
_UpdateEventList
 List of update to add or remove (bool param of the pair). More...

TTimedEventContainer _EventList
 List of event ordered by time. More...

TEventContainer _Events
 List of event ordered by event ptr with there respective multimap iterator. More...

std::vector< std::pair< NLMISC::TTime,
IMixerEvent * > > 
_EventListUpdate
 List of update for the event list. More...


Private Types

typedef std::hash_set< CSourceCommon *,
THashPtr< CSourceCommon * > > 
TSourceContainer
typedef std::hash_set< IMixerUpdate *,
THashPtr< IMixerUpdate * > > 
TMixerUpdateContainer
typedef std::hash_map< IBuffer *,
std::vector< class CSound * >,
THashPtr< IBuffer * > > 
TBufferToSourceContainer
typedef std::multimap< NLMISC::TTime,
IMixerEvent * > 
TTimedEventContainer
typedef std::multimap< IMixerEvent *,
TTimedEventContainer::iterator > 
TEventContainer

Private Attributes

std::vector< CTrack * > _FreeTracks
 The vector of curently free tracks. More...

std::list< CSimpleSource * > _SourceWaitingForPlay
 The list of non discardable sound to play as soon as possible in order of arrival. More...

uint32 _PriorityReserve [NbSoundPriorities]
 Table of track reserve for each priority. More...

uint32 _ReserveUsage [NbSoundPriorities]
 Table of current playing source for each priority. More...

uint32 _LowWaterMark
 Low water mark. After this number of free voice is reach, reserve can't be overloaded. More...

ISoundDriver_SoundDriver
 The sound driver instance. More...

CBackgroundSoundManager_BackgroundSoundManager
 Intance of the background sound manager. More...

CListenerUser _Listener
 The listener instance. More...

NLMISC::CVector _ListenPosition
 Listener position vector. More...

std::string _SamplePath
 The path to the sample banks. This should be specified in the config file. More...

TBufferToSourceContainer _BufferToSources
 Assoc between buffer and source. Used when buffers are unloaded. More...

CEnvEffect_CurEnvEffect
 Current effect. More...


Static Private Attributes

CAudioMixerUser * _Instance = NULL
 The audio mixer singleton instance. More...


Friends

struct displaySoundInfoClass

Detailed Description

Implementation of UAudioMixer.

The logical sources (_Sources) are the sources representing all entities in the world, from the client's point of view. The tracks (_Tracks) are the physical sources played by the sound driver. Their number is small.

When there are more sources than tracks, the process of choosing which sources go into the tracks is called "balancing". The source are auto-balanced according to the argument passed to init(). The sources are also balanced when

  • Adding a new source
  • Removing a new source
  • Entering/Exiting from an envsound area
Important: The user is responsible for deleting the sources that have been allocated by createSource(), before deleting the audio mixer object.

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 97 of file audio_mixer_user.h.


Member Typedef Documentation

typedef std::hash_map<IBuffer*, std::vector<class CSound*>, THashPtr<IBuffer*> > NLSOUND::CAudioMixerUser::TBufferToSourceContainer [private]
 

Definition at line 309 of file audio_mixer_user.h.

typedef std::multimap<IMixerEvent*, TTimedEventContainer::iterator> NLSOUND::CAudioMixerUser::TEventContainer [private]
 

Definition at line 311 of file audio_mixer_user.h.

typedef std::hash_set<IMixerUpdate*, THashPtr<IMixerUpdate*> > NLSOUND::CAudioMixerUser::TMixerUpdateContainer [private]
 

Definition at line 308 of file audio_mixer_user.h.

typedef std::hash_set<CSourceCommon*, THashPtr<CSourceCommon*> > NLSOUND::CAudioMixerUser::TSourceContainer [private]
 

Definition at line 307 of file audio_mixer_user.h.

typedef std::multimap<NLMISC::TTime, IMixerEvent*> NLSOUND::CAudioMixerUser::TTimedEventContainer [private]
 

Definition at line 310 of file audio_mixer_user.h.


Constructor & Destructor Documentation

NLSOUND::CAudioMixerUser::CAudioMixerUser  
 

Constructor.

Definition at line 101 of file audio_mixer_user.cpp.

References _CreateCount, _CreateTime, _Instance, _UpdateCount, _UpdateTime, and nlerror.

Referenced by instance.

NLSOUND::CAudioMixerUser::~CAudioMixerUser   [virtual]
 

Destructor.

Definition at line 133 of file audio_mixer_user.cpp.

References _BackgroundSoundManager, _Instance, _Leaving, _NbTracks, _SoundDriver, _Tracks, nldebug, and reset.


Member Function Documentation

void NLSOUND::CAudioMixerUser::addEvent IMixerEvent   pmixerEvent,
const NLMISC::TTime   date
 

Add an event in the future.

void NLSOUND::CAudioMixerUser::addSource CSourceCommon   source
 

Add a source which was created by an EnvSound.

Definition at line 762 of file audio_mixer_user.cpp.

References _Sources, and nlassert.

void NLSOUND::CAudioMixerUser::addSourceWaitingForPlay CSimpleSource   source
 

Add a source for play as possible (for non discadable sound).

Definition at line 231 of file audio_mixer_user.cpp.

References _SourceWaitingForPlay.

void NLSOUND::CAudioMixerUser::applyListenerMove const NLMISC::CVector   listenerpos
 

Take a listener's move into account.

Definition at line 456 of file audio_mixer_user.cpp.

References _ListenPosition.

void NLSOUND::CAudioMixerUser::bufferUnloaded IBuffer   buffer
 

Definition at line 353 of file audio_mixer_user.cpp.

References _NbTracks, and _Tracks.

USource * NLSOUND::CAudioMixerUser::createSource TSoundId    id,
bool    spawn = false,
TSpawnEndCallback    cb = NULL,
void *    cbUserParam = NULL,
CSoundContext   context = 0
[virtual]
 

Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*).

Implements NLSOUND::UAudioMixer.

Definition at line 775 of file audio_mixer_user.cpp.

References _CreateCount, _CreateTime, _ListenPosition, _profile, createSource, curTime, getNumberAvailableTracks, getPlayingSourcesNumber, getSourcesNumber, id, nlassert, nldebug, nlwarning, NLSOUND::TSoundId, NLSOUND::TSpawnEndCallback, and NLMISC::TTicks.

USource * NLSOUND::CAudioMixerUser::createSource const std::string &    name,
bool    spawn = false,
TSpawnEndCallback    cb = NULL,
void *    cbUserParam = NULL,
CSoundContext   context = 0
[virtual]
 

Add a logical sound source (returns NULL if name not found).

If spawn is true, the source will auto-delete after playing. If so, the return USource* pointer is valid only before the time when calling play() plus the duration of the sound. You can pass a callback function that will be called (if not NULL) just before deleting the spawned source.

Implements NLSOUND::UAudioMixer.

Definition at line 874 of file audio_mixer_user.cpp.

References getSoundId, and NLSOUND::TSpawnEndCallback.

Referenced by createSource.

uint32 NLSOUND::CAudioMixerUser::curTime   [inline]
 

Definition at line 431 of file audio_mixer_user.h.

References _StartTime, and NLMISC::CTime::getLocalTime.

Referenced by createSource, and writeProfile.

void NLSOUND::CAudioMixerUser::decPlayingSource   [inline]
 

Definition at line 274 of file audio_mixer_user.h.

References _PlayingSources.

void NLSOUND::CAudioMixerUser::enable bool    b [virtual]
 

Disables or reenables the sound.

Implements NLSOUND::UAudioMixer.

Definition at line 374 of file audio_mixer_user.cpp.

References nlassert.

void NLSOUND::CAudioMixerUser::freeTrack CTrack   track
 

Definition at line 544 of file audio_mixer_user.cpp.

References _FreeTracks, _ReserveUsage, and nlassert.

CBackgroundSoundManager* NLSOUND::CAudioMixerUser::getBackgroundSoundManager   [inline]
 

Definition at line 244 of file audio_mixer_user.h.

References _BackgroundSoundManager.

CTrack * NLSOUND::CAudioMixerUser::getFreeTrack CSimpleSource   source
 

Definition at line 481 of file audio_mixer_user.cpp.

References _FreeTracks, _ListenPosition, _LowWaterMark, _NbTracks, _PriorityReserve, _ReserveUsage, _SourceWaitingForPlay, _Tracks, NLSOUND::HighestPri, nldebug, and nlwarning.

void NLSOUND::CAudioMixerUser::getFreeTracks uint    nb,
CTrack **    tracks
[protected]
 

Returns nb available tracks (or NULL).

Definition at line 444 of file audio_mixer_user.cpp.

References _FreeTracks.

virtual UListener* NLSOUND::CAudioMixerUser::getListener   [inline, virtual]
 

Return the listener interface.

Implements NLSOUND::UAudioMixer.

Definition at line 201 of file audio_mixer_user.h.

References _Listener.

const NLMISC::CVector& NLSOUND::CAudioMixerUser::getListenPosVector   const [inline]
 

Return the listen pos vector.

Definition at line 230 of file audio_mixer_user.h.

uint32 NLSOUND::CAudioMixerUser::getLoadedSampleSize   [virtual]
 

Return the total size in byte of loaded samples.

Implements NLSOUND::UAudioMixer.

Definition at line 1107 of file audio_mixer_user.cpp.

uint NLSOUND::CAudioMixerUser::getNumberAvailableTracks   const [virtual]
 

Return the number of available tracks.

Implements NLSOUND::UAudioMixer.

Definition at line 1015 of file audio_mixer_user.cpp.

References _FreeTracks.

Referenced by createSource, and writeProfile.

void NLSOUND::CAudioMixerUser::getPlayingSoundsPos std::vector< std::pair< bool, NLMISC::CVector > > &    pos [protected, virtual]
 

See removeSource(USource*) and removeMySource(USource*).

Implements NLSOUND::UAudioMixer.

Definition at line 557 of file audio_mixer_user.cpp.

References _Sources.

uint NLSOUND::CAudioMixerUser::getPlayingSourcesNumber   const [virtual]
 

Return the number of playing sources (slow).

Implements NLSOUND::UAudioMixer.

Definition at line 1008 of file audio_mixer_user.cpp.

References _PlayingSources.

Referenced by createSource, and writeProfile.

virtual uint NLSOUND::CAudioMixerUser::getPolyphony   const [inline, virtual]
 

Return the number of mixing tracks (voices).

Implements NLSOUND::UAudioMixer.

Definition at line 213 of file audio_mixer_user.h.

References _NbTracks.

ISoundDriver * NLSOUND::CAudioMixerUser::getSoundDriver  
 

Return the sound driver.

Definition at line 404 of file audio_mixer_user.cpp.

References _SoundDriver.

TSoundId NLSOUND::CAudioMixerUser::getSoundId const std::string &    name [virtual]
 

Get a TSoundId from a name (returns NULL if not found).

Implements NLSOUND::UAudioMixer.

Definition at line 755 of file audio_mixer_user.cpp.

References NLSOUND::TSoundId.

Referenced by createSource.

void NLSOUND::CAudioMixerUser::getSoundNames std::vector< std::string > &    names const [virtual]
 

Return the names of the sounds (call this method after loadSounds()).

Implements NLSOUND::UAudioMixer.

Definition at line 1000 of file audio_mixer_user.cpp.

virtual uint NLSOUND::CAudioMixerUser::getSourcesNumber   const [inline, virtual]
 

Return the number of sources (slow).

Implements NLSOUND::UAudioMixer.

Definition at line 215 of file audio_mixer_user.h.

References _Sources.

Referenced by createSource.

string NLSOUND::CAudioMixerUser::getSourcesStats   const [virtual]
 

Return a string showing the playing sources (slow).

Implements NLSOUND::UAudioMixer.

Definition at line 1023 of file audio_mixer_user.cpp.

References _Sources, and s.

void NLSOUND::CAudioMixerUser::incPlayingSource   [inline]
 

Definition at line 273 of file audio_mixer_user.h.

References _PlayingSources.

void NLSOUND::CAudioMixerUser::init   [virtual]
 

Initialization.

In case of failure, can throw one of these ESoundDriver (Exception) objects: ESoundDriverNotFound, ESoundDriverCorrupted, ESoundDriverOldVersion, ESoundDriverUnknownVersion.

The sources will be auto-balanced every "balance_period" calls to update() (set 0 for "never auto-balance")

Implements NLSOUND::UAudioMixer.

Definition at line 276 of file audio_mixer_user.cpp.

References _BackgroundSoundManager, _FreeTracks, _Instance, _Listener, _LowWaterMark, _MaxNbTracks, _NbTracks, _PriorityReserve, _profile, _ReserveUsage, _SoundDriver, _StartTime, _Tracks, NLSOUND::MAX_TRACKS, NLSOUND::NbSoundPriorities, nldebug, and nlinfo.

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

Return the audio mixer object.

Definition at line 104 of file audio_mixer_user.h.

References _Instance, and CAudioMixerUser.

virtual void NLSOUND::CAudioMixerUser::loadBackgroundEffectsFromRegion const NLLIGO::CPrimRegion   region [virtual]
 

Implements NLSOUND::UAudioMixer.

virtual void NLSOUND::CAudioMixerUser::loadBackgroundSamplesFromRegion const NLLIGO::CPrimRegion   region [virtual]
 

Implements NLSOUND::UAudioMixer.

virtual void NLSOUND::CAudioMixerUser::loadBackgroundSound const std::string &    continent [virtual]
 

Implements NLSOUND::UAudioMixer.

virtual void NLSOUND::CAudioMixerUser::loadBackgroundSoundFromRegion const NLLIGO::CPrimRegion   region [virtual]
 

Implements NLSOUND::UAudioMixer.

uint32 NLSOUND::CAudioMixerUser::loadSampleBank bool    async,
const std::string &    filename,
std::vector< std::string > *    notfoundfiles = NULL
[virtual]
 

Load buffers.

Returns the number of buffers successfully loaded. If you specify a non null notfoundfiles vector, it is filled with the names of missing files if any. You can call this method several times, to load several sound banks.

Implements NLSOUND::UAudioMixer.

Definition at line 945 of file audio_mixer_user.cpp.

References _SamplePath, _SoundDriver, nldebug, and nlwarning.

virtual void NLSOUND::CAudioMixerUser::playBackgroundSound   [virtual]
 

Implements NLSOUND::UAudioMixer.

void NLSOUND::CAudioMixerUser::registerBufferAssoc CSound   sound,
IBuffer   buffer
 

void NLSOUND::CAudioMixerUser::registerUpdate IMixerUpdate   pmixerUpdate
 

Register an object in the update list.

void NLSOUND::CAudioMixerUser::reloadSampleBanks bool    async [virtual]
 

Reload all the sample bank.

Thid method use provided for use in a sound editor or sound tool to update the list of available samples. \async If true, the samples are loaded in a background thread.

Implements NLSOUND::UAudioMixer.

Definition at line 474 of file audio_mixer_user.cpp.

void NLSOUND::CAudioMixerUser::removeEvents IMixerEvent   pmixerEvent
 

Remove any event programmed for this object.

void NLSOUND::CAudioMixerUser::removeSource CSourceCommon   source [virtual]
 

Delete a logical sound source.

If you don't call it, the source will be auto-deleted when deleting the audio mixer object

Definition at line 882 of file audio_mixer_user.cpp.

References _Sources, and nlassert.

void NLSOUND::CAudioMixerUser::reset   [virtual]
 

Resets the audio system (deletes all the sources, include envsounds).

Implements NLSOUND::UAudioMixer.

Definition at line 239 of file audio_mixer_user.cpp.

References _Leaving, _NbTracks, _Sources, _SourceWaitingForPlay, _Tracks, and src.

Referenced by ~CAudioMixerUser.

void NLSOUND::CAudioMixerUser::selectEnvEffects const std::string &    tag [virtual]
 

Choose the environmental effect(s) corresponding to tag.

Implements NLSOUND::UAudioMixer.

Definition at line 893 of file audio_mixer_user.cpp.

References nlassertex.

void NLSOUND::CAudioMixerUser::setBackgroundFlags const TBackgroundFlags &    backgroundFlags [virtual]
 

Implements NLSOUND::UAudioMixer.

void NLSOUND::CAudioMixerUser::setListenerPos const NLMISC::CVector   pos [virtual]
 

Use this method to set the listener position instead of using getListener->setPos(); It's because we have to update the background sounds in this case.

Implements NLSOUND::UAudioMixer.

Definition at line 1216 of file audio_mixer_user.cpp.

References _BackgroundSoundManager, and _Listener.

void NLSOUND::CAudioMixerUser::setLowWaterMark uint    value [virtual]
 

Set the Low water mark.

This value is use to mute sound source that try to play when there priority channel is full (see setPriorityReserve). Set a value 1 to 4 to keep some extra track available when a HighestPri source need to play. By default, the value is set to 0, witch mean no special treatment is done and the mixer will mute sound with no user control at all. Note also that the availability of a track is not guarantie if the sum of the priority reserve (see setPriorityReserve) is grater than the number od available tracks (witch is almos alwais the case). But this value will help the mixer make it's best.

Implements NLSOUND::UAudioMixer.

Definition at line 173 of file audio_mixer_user.cpp.

References _LowWaterMark, _NbTracks, min, and value.

void NLSOUND::CAudioMixerUser::setPriorityReserve TSoundPriority    priorityChannel,
uint    reserve
[virtual]
 

Set the priority channel reserve.

Each priority channel can be assign a restrictive reserve value. This value is used when the number free track available for playing drop under the low water mark value (see setLowWaterMark). The mixer count the number of playing source in each priority channel. A priority channel can orverflow it's reserve value only if the low water mark is not reach. In other word, when the number of played source increase, you can control a 'smooth' cut in priority layer. The idea is to try to keep some free track for the HighestPri source. By default, reserve are set for each channel to the number of available tracks.

Implements NLSOUND::UAudioMixer.

Definition at line 168 of file audio_mixer_user.cpp.

References _NbTracks, _PriorityReserve, min, and NLSOUND::TSoundPriority.

virtual void NLSOUND::CAudioMixerUser::setSamplePath const std::string &    path [inline, virtual]
 

Set the global path to the sample banks.

when not allocated by new, as the CAmbiantSource channels)

Implements NLSOUND::UAudioMixer.

Definition at line 241 of file audio_mixer_user.h.

References _SamplePath.

virtual void NLSOUND::CAudioMixerUser::stopBackgroundSound   [virtual]
 

Implements NLSOUND::UAudioMixer.

bool NLSOUND::CAudioMixerUser::unloadSampleBank const std::string &    filename [virtual]
 

Unload buffers.

Implements NLSOUND::UAudioMixer.

Definition at line 980 of file audio_mixer_user.cpp.

References _SamplePath, and nldebug.

void NLSOUND::CAudioMixerUser::unregisterBufferAssoc CSound   sound,
IBuffer   buffer
 

void NLSOUND::CAudioMixerUser::unregisterUpdate IMixerUpdate   pmixerUpdate
 

Unregister an object from the update list.

void NLSOUND::CAudioMixerUser::update   [virtual]
 

Update audio mixer (call evenly).

Implements NLSOUND::UAudioMixer.

Definition at line 592 of file audio_mixer_user.cpp.

References _EventList, _EventListUpdate, _Events, _NbTracks, _SoundDriver, _Sources, _SourceWaitingForPlay, _Tracks, _UpdateCount, _UpdateEventList, _UpdateList, _UpdateTime, NLMISC::CTime::getLocalTime, nldebug, range, NLMISC::TTicks, and NLMISC::TTime.

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

Write profiling information about the mixer to the output stream.

Implements NLSOUND::UAudioMixer.

Definition at line 181 of file audio_mixer_user.cpp.

References _CreateCount, _CreateTime, _NbTracks, _PlayingSources, _ReserveUsage, _SoundDriver, _SourceWaitingForPlay, _UpdateCount, _UpdateTime, curTime, getNumberAvailableTracks, getPlayingSourcesNumber, NLSOUND::HighestPri, NLSOUND::HighPri, NLSOUND::LowPri, NLSOUND::MidPri, and sint.


Friends And Related Function Documentation

friend struct displaySoundInfoClass [friend]
 

Definition at line 444 of file audio_mixer_user.h.


Member Data Documentation

CBackgroundSoundManager* NLSOUND::CAudioMixerUser::_BackgroundSoundManager [private]
 

Intance of the background sound manager.

Definition at line 366 of file audio_mixer_user.h.

Referenced by getBackgroundSoundManager, init, setListenerPos, and ~CAudioMixerUser.

TBufferToSourceContainer NLSOUND::CAudioMixerUser::_BufferToSources [private]
 

Assoc between buffer and source. Used when buffers are unloaded.

Definition at line 392 of file audio_mixer_user.h.

uint32 NLSOUND::CAudioMixerUser::_CreateCount
 

Definition at line 441 of file audio_mixer_user.h.

Referenced by CAudioMixerUser, createSource, and writeProfile.

double NLSOUND::CAudioMixerUser::_CreateTime
 

Definition at line 439 of file audio_mixer_user.h.

Referenced by CAudioMixerUser, createSource, and writeProfile.

CEnvEffect* NLSOUND::CAudioMixerUser::_CurEnvEffect [private]
 

Current effect.

Definition at line 413 of file audio_mixer_user.h.

TTimedEventContainer NLSOUND::CAudioMixerUser::_EventList [protected]
 

List of event ordered by time.

Definition at line 321 of file audio_mixer_user.h.

Referenced by update.

std::vector<std::pair<NLMISC::TTime, IMixerEvent*> > NLSOUND::CAudioMixerUser::_EventListUpdate [protected]
 

List of update for the event list.

Definition at line 325 of file audio_mixer_user.h.

Referenced by update.

TEventContainer NLSOUND::CAudioMixerUser::_Events [protected]
 

List of event ordered by event ptr with there respective multimap iterator.

Definition at line 323 of file audio_mixer_user.h.

Referenced by update.

std::vector<CTrack*> NLSOUND::CAudioMixerUser::_FreeTracks [private]
 

The vector of curently free tracks.

Definition at line 347 of file audio_mixer_user.h.

Referenced by freeTrack, getFreeTrack, getFreeTracks, getNumberAvailableTracks, and init.

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

The audio mixer singleton instance.

Definition at line 76 of file audio_mixer_user.cpp.

Referenced by CAudioMixerUser, init, instance, and ~CAudioMixerUser.

bool NLSOUND::CAudioMixerUser::_Leaving
 

Flag set in destructor.

Definition at line 427 of file audio_mixer_user.h.

Referenced by reset, and ~CAudioMixerUser.

CListenerUser NLSOUND::CAudioMixerUser::_Listener [private]
 

The listener instance.

Definition at line 375 of file audio_mixer_user.h.

Referenced by getListener, init, and setListenerPos.

NLMISC::CVector NLSOUND::CAudioMixerUser::_ListenPosition [private]
 

Listener position vector.

Definition at line 378 of file audio_mixer_user.h.

Referenced by applyListenerMove, createSource, and getFreeTrack.

uint32 NLSOUND::CAudioMixerUser::_LowWaterMark [private]
 

Low water mark. After this number of free voice is reach, reserve can't be overloaded.

Definition at line 357 of file audio_mixer_user.h.

Referenced by getFreeTrack, init, and setLowWaterMark.

uint NLSOUND::CAudioMixerUser::_MaxNbTracks
 

Max _NbTracks.

Definition at line 424 of file audio_mixer_user.h.

Referenced by init.

uint NLSOUND::CAudioMixerUser::_NbTracks
 

Size of the physical sources array (must be <= MAX_TRACKS).

Definition at line 421 of file audio_mixer_user.h.

Referenced by bufferUnloaded, getFreeTrack, getPolyphony, init, reset, setLowWaterMark, setPriorityReserve, update, writeProfile, and ~CAudioMixerUser.

uint32 NLSOUND::CAudioMixerUser::_PlayingSources
 

The source that wanted to play.

Definition at line 404 of file audio_mixer_user.h.

Referenced by decPlayingSource, getPlayingSourcesNumber, incPlayingSource, and writeProfile.

uint32 NLSOUND::CAudioMixerUser::_PriorityReserve[NbSoundPriorities] [private]
 

Table of track reserve for each priority.

Definition at line 353 of file audio_mixer_user.h.

Referenced by getFreeTrack, init, and setPriorityReserve.

uint32 NLSOUND::CAudioMixerUser::_ReserveUsage[NbSoundPriorities] [private]
 

Table of current playing source for each priority.

Definition at line 355 of file audio_mixer_user.h.

Referenced by freeTrack, getFreeTrack, init, and writeProfile.

std::string NLSOUND::CAudioMixerUser::_SamplePath [private]
 

The path to the sample banks. This should be specified in the config file.

Deprecated:

Definition at line 389 of file audio_mixer_user.h.

Referenced by loadSampleBank, setSamplePath, and unloadSampleBank.

ISoundDriver* NLSOUND::CAudioMixerUser::_SoundDriver [private]
 

The sound driver instance.

Definition at line 363 of file audio_mixer_user.h.

Referenced by getSoundDriver, init, loadSampleBank, update, writeProfile, and ~CAudioMixerUser.

TSourceContainer NLSOUND::CAudioMixerUser::_Sources
 

All Logical sources.

Definition at line 400 of file audio_mixer_user.h.

Referenced by addSource, getPlayingSoundsPos, getSourcesNumber, getSourcesStats, removeSource, reset, and update.

std::list<CSimpleSource*> NLSOUND::CAudioMixerUser::_SourceWaitingForPlay [private]
 

The list of non discardable sound to play as soon as possible in order of arrival.

Definition at line 350 of file audio_mixer_user.h.

Referenced by addSourceWaitingForPlay, getFreeTrack, reset, update, and writeProfile.

NLMISC::TTicks NLSOUND::CAudioMixerUser::_StartTime
 

Definition at line 429 of file audio_mixer_user.h.

Referenced by curTime, and init.

CTrack* NLSOUND::CAudioMixerUser::_Tracks[MAX_TRACKS]
 

Physical sources array.

Definition at line 418 of file audio_mixer_user.h.

Referenced by bufferUnloaded, getFreeTrack, init, reset, update, and ~CAudioMixerUser.

uint32 NLSOUND::CAudioMixerUser::_UpdateCount
 

Definition at line 440 of file audio_mixer_user.h.

Referenced by CAudioMixerUser, update, and writeProfile.

std::vector<std::pair<IMixerUpdate*, bool> > NLSOUND::CAudioMixerUser::_UpdateEventList [protected]
 

List of update to add or remove (bool param of the pair).

Definition at line 317 of file audio_mixer_user.h.

Referenced by update.

TMixerUpdateContainer NLSOUND::CAudioMixerUser::_UpdateList [protected]
 

List of object to update.

Definition at line 315 of file audio_mixer_user.h.

Referenced by update.

double NLSOUND::CAudioMixerUser::_UpdateTime
 

Definition at line 438 of file audio_mixer_user.h.

Referenced by CAudioMixerUser, update, and writeProfile.


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