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

The set of players. More...

#include <sound_anim_manager.h>

List of all members.

Public Methods

 CSoundAnimManager (UAudioMixer *mixer)
virtual ~CSoundAnimManager ()
virtual TSoundAnimId loadAnimation (std::string &name)
 Load the sound animation with the specified name. More...

virtual TSoundAnimId createAnimation (std::string &name)
 Create a new sound animation with the specified name. More...

virtual void saveAnimation (CSoundAnimation *anim, std::string &filname)
 Save the sound animation in the specified file. More...

virtual TSoundAnimId getAnimationFromName (std::string &name)
 Start playing a sound animation. More...

virtual CSoundAnimationfindAnimation (std::string &name)
 Returns the animation corresponding to a name. More...

virtual TSoundAnimPlayId playAnimation (TSoundAnimId id, float time, CSoundContext &context)
 Start playing a sound animation. More...

virtual TSoundAnimPlayId playAnimation (std::string &name, float time, CSoundContext &context)
 Start playing a sound animation. More...

virtual void stopAnimation (TSoundAnimPlayId playbackId)
 Stop the playing of a sound animation. More...

virtual bool isPlaying (TSoundAnimPlayId playbackId)
 Returns true is the animation with the specified playback ID is playing. More...

virtual void update (float lastTime, float curTime)
 Update all the sound animations during playback. More...

virtual void playAnimation (TSoundAnimId id, float lastTime, float curTime, CSoundContext &context)
 Play all the events of an animation in the interval between lastTime and curTime. More...

virtual std::string idToName (TSoundAnimId id)
 Convert back from an anim ID to the anim name. More...


Static Public Methods

CSoundAnimManager * instance ()

Protected Attributes

UAudioMixer_Mixer
 The mixer. More...

TSoundAnimMap _IdMap
 The conversion table from animation name to id. More...

TSoundAnimVector _Animations
 The vector of all defined animations. More...


Static Protected Attributes

CSoundAnimManager * _Instance = 0
 The one and only singleton instance. More...


Detailed Description

The set of players.

Definition at line 72 of file sound_anim_manager.h.


Constructor & Destructor Documentation

NLSOUND::CSoundAnimManager::CSoundAnimManager UAudioMixer   mixer
 

Definition at line 44 of file sound_anim_manager.cpp.

References _Instance.

Referenced by instance.

NLSOUND::CSoundAnimManager::~CSoundAnimManager   [virtual]
 

Definition at line 57 of file sound_anim_manager.cpp.

References _Instance.


Member Function Documentation

TSoundAnimId NLSOUND::CSoundAnimManager::createAnimation std::string &    name [virtual]
 

Create a new sound animation with the specified name.

Returns CSoundAnimation::NoId if the creation fails (duplicate name).

Parameters:
name  The name of the animation to load.

Definition at line 118 of file sound_anim_manager.cpp.

References _Animations, _IdMap, NLSOUND::CSoundAnimationNoId, id, nlassert, nlwarning, and NLSOUND::TSoundAnimId.

Referenced by loadAnimation.

CSoundAnimation * NLSOUND::CSoundAnimManager::findAnimation std::string &    name [virtual]
 

Returns the animation corresponding to a name.

Parameters:
name  The name of the animation to load.

Definition at line 142 of file sound_anim_manager.cpp.

References _Animations, and _IdMap.

TSoundAnimId NLSOUND::CSoundAnimManager::getAnimationFromName std::string &    name [virtual]
 

Start playing a sound animation.

Returns true is the animation was found and is playing.

Parameters:
name  The name of the animation to load.

Definition at line 150 of file sound_anim_manager.cpp.

References _IdMap, NLSOUND::CSoundAnimationNoId, and NLSOUND::TSoundAnimId.

std::string NLSOUND::CSoundAnimManager::idToName TSoundAnimId    id [virtual]
 

Convert back from an anim ID to the anim name.

Definition at line 203 of file sound_anim_manager.cpp.

References _IdMap, id, and NLSOUND::TSoundAnimId.

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

Definition at line 76 of file sound_anim_manager.h.

References _Instance, and CSoundAnimManager.

bool NLSOUND::CSoundAnimManager::isPlaying TSoundAnimPlayId    playbackId [virtual]
 

Returns true is the animation with the specified playback ID is playing.

Parameters:
name  The playback id that was returned by playAnimation.

Definition at line 268 of file sound_anim_manager.cpp.

References NLSOUND::TSoundAnimPlayId.

TSoundAnimId NLSOUND::CSoundAnimManager::loadAnimation std::string &    name [virtual]
 

Load the sound animation with the specified name.

Returns the id of the new animation, or CSoundAnimationNoId is the file could not be found.

Parameters:
name  The name of the animation to load.

Definition at line 76 of file sound_anim_manager.cpp.

References _Animations, createAnimation, NLSOUND::CSoundAnimationNoId, id, nlassert, and NLSOUND::TSoundAnimId.

void NLSOUND::CSoundAnimManager::playAnimation TSoundAnimId    id,
float    lastTime,
float    curTime,
CSoundContext   context
[virtual]
 

Play all the events of an animation in the interval between lastTime and curTime.

Both lastTime and curTime are measured relatively from the beginning of the animation.

Definition at line 215 of file sound_anim_manager.cpp.

References _Animations, _Mixer, NLSOUND::CSoundAnimationNoId, id, nlassert, and NLSOUND::TSoundAnimId.

TSoundAnimPlayId NLSOUND::CSoundAnimManager::playAnimation std::string &    name,
float    time,
CSoundContext   context
[virtual]
 

Start playing a sound animation.

Returns an id number of this playback instance or -1 if the animation was not found.

Parameters:
name  The name of the animation to play.

Definition at line 239 of file sound_anim_manager.cpp.

References NLSOUND::TSoundAnimPlayId.

TSoundAnimPlayId NLSOUND::CSoundAnimManager::playAnimation TSoundAnimId    id,
float    time,
CSoundContext   context
[virtual]
 

Start playing a sound animation.

Returns an id number of this playback instance or -1 if the animation was not found.

Parameters:
name  The id of the animation to play.

Definition at line 233 of file sound_anim_manager.cpp.

References id, NLSOUND::TSoundAnimId, and NLSOUND::TSoundAnimPlayId.

void NLSOUND::CSoundAnimManager::saveAnimation CSoundAnimation   anim,
std::string &    filname
[virtual]
 

Save the sound animation in the specified file.

Parameters:
filename  The name of the file to save the animation in.

Definition at line 158 of file sound_anim_manager.cpp.

References nlassert.

void NLSOUND::CSoundAnimManager::stopAnimation TSoundAnimPlayId    playbackId [virtual]
 

Stop the playing of a sound animation.

Parameters:
name  The playback id that was returned by playAnimation.

Definition at line 250 of file sound_anim_manager.cpp.

References NLSOUND::TSoundAnimPlayId.

void NLSOUND::CSoundAnimManager::update float    lastTime,
float    curTime
[virtual]
 

Update all the sound animations during playback.

Definition at line 287 of file sound_anim_manager.cpp.


Member Data Documentation

TSoundAnimVector NLSOUND::CSoundAnimManager::_Animations [protected]
 

The vector of all defined animations.

Definition at line 158 of file sound_anim_manager.h.

Referenced by createAnimation, findAnimation, loadAnimation, and playAnimation.

TSoundAnimMap NLSOUND::CSoundAnimManager::_IdMap [protected]
 

The conversion table from animation name to id.

Definition at line 155 of file sound_anim_manager.h.

Referenced by createAnimation, findAnimation, getAnimationFromName, and idToName.

CSoundAnimManager * NLSOUND::CSoundAnimManager::_Instance = 0 [static, protected]
 

The one and only singleton instance.

Definition at line 40 of file sound_anim_manager.cpp.

Referenced by CSoundAnimManager, instance, and ~CSoundAnimManager.

UAudioMixer* NLSOUND::CSoundAnimManager::_Mixer [protected]
 

The mixer.

Definition at line 152 of file sound_anim_manager.h.

Referenced by playAnimation.


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