Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <SoundManager.h>
Public Member Functions | |
Listener * | createListener (scene::Node *parent=NULL) |
Creates a listener to be managed by sound manager. | |
Listener * | createListener (const std::string &name, scene::Node *parent=NULL) |
Sound * | createSound (SoundData *soundData, scene::Node *parent=NULL) |
Sound * | createSound (const std::string &name, SoundData *soundData, scene::Node *parent=NULL) |
Sound * | createSound (const std::string &filename, scene::Node *parent=NULL) |
Creates a sound to be managed by sound manager. | |
Sound * | createSound (const std::string &name, const std::string &filename, scene::Node *parent=NULL) |
Listener * | getActiveListener () |
Retrieve a pointer to the active listener. | |
f32 | getDopplerFactor () const |
Returns the Doppler factor. | |
Listener * | getListener (const u32 &id) |
Retrieves a pointer to the a listener. | |
u32 | getNumberOfListeners () const |
Retrieves the total number of created listeners. | |
u32 | getNumberOfSounds () const |
Retrieves the total number of created sounds. | |
Sound * | getSound (const u32 &id) |
Retrieves a pointer to a sound by id. | |
f32 | getSoundSpeed () const |
Returns the speed of sound. | |
void | initializeObjects () |
Initialize all sound elements waiting to be initialized. | |
void | removeAllListeners () |
Removes all listeners. | |
void | removeAllSounds () |
Removes (and destroys) all sounds. | |
void | removeListener (Listener *listener) |
Removes a listener. | |
void | removeListener (const u32 &id) |
Removes a listener. | |
void | removeSound (Sound *sound) |
Removes a sound. | |
void | removeSound (const u32 &id) |
Removes a sound. | |
void | removeSoundDriver () |
void | removeSoundFactory () |
void | setActiveListener (Listener *listener) |
Sets a pointer to the active listener. | |
void | setDopplerFactor (f32 dopplerFactor) |
void | setSoundDriver (SoundDriver *driver) |
void | setSoundFactory (SoundFactory *factory) |
void | setSoundSpeed (f32 soundSpeed) |
SoundManager () | |
void | start () |
void | stop () |
~SoundManager () | |
Static Public Member Functions | |
static SoundManager * | getInstance () |
Get instance. | |
Protected Member Functions | |
void | initializeImpl () |
void | uninitializeImpl () |
void | updateImpl (f32 elapsedTime) |
Protected Attributes | |
Listener * | mActiveListener |
f32 | mDopplerFactor |
std::map< u32, Listener * > | mListeners |
Central list of listeners - for easy memory management and lookup. | |
SoundDriver * | mSoundDriver |
SoundFactory * | mSoundFactory |
std::map< u32, Sound * > | mSounds |
Central list of sounds - for easy memory management and lookup. | |
f32 | mSoundSpeed |
Friends | |
class | ResourceManager |
sound::SoundManager::SoundManager | ( | ) |
sound::SoundManager::~SoundManager | ( | ) |
References getInstance().
Listener * sound::SoundManager::createListener | ( | scene::Node * | parent = NULL | ) |
Creates a listener to be managed by sound manager.
References engine::Object::getID(), getInstance(), and mListeners.
Listener * sound::SoundManager::createListener | ( | const std::string & | name, |
scene::Node * | parent = NULL |
||
) |
References engine::Object::getID(), getInstance(), and mListeners.
Sound * sound::SoundManager::createSound | ( | const std::string & | name, |
const std::string & | filename, | ||
scene::Node * | parent = NULL |
||
) |
Sound * sound::SoundManager::createSound | ( | SoundData * | soundData, |
scene::Node * | parent = NULL |
||
) |
References sound::SoundFactory::createSound(), engine::Object::getID(), getInstance(), mSoundFactory, and mSounds.
Sound * sound::SoundManager::createSound | ( | const std::string & | filename, |
scene::Node * | parent = NULL |
||
) |
Creates a sound to be managed by sound manager.
References sound::SoundFactory::createSound(), engine::Object::getID(), getInstance(), mSoundFactory, mSounds, and resource::RT_RESOURCE_SOUND_DATA.
Sound * sound::SoundManager::createSound | ( | const std::string & | name, |
SoundData * | soundData, | ||
scene::Node * | parent = NULL |
||
) |
References sound::SoundFactory::createSound(), engine::Object::getID(), getInstance(), mSoundFactory, and mSounds.
Listener * sound::SoundManager::getActiveListener | ( | ) |
Retrieve a pointer to the active listener.
References mActiveListener.
f32 sound::SoundManager::getDopplerFactor | ( | ) | const |
Returns the Doppler factor.
References mDopplerFactor.
SoundManager * sound::SoundManager::getInstance | ( | ) | [static] |
Get instance.
Reimplemented from core::Singleton< SoundManager >.
Referenced by createListener(), createSound(), initializeImpl(), scene::Scene::removeAllNodes(), removeListener(), removeSound(), SoundManager(), start(), stop(), uninitializeImpl(), and ~SoundManager().
Retrieves a pointer to the a listener.
References mListeners.
u32 sound::SoundManager::getNumberOfListeners | ( | ) | const |
Retrieves the total number of created listeners.
References mListeners.
u32 sound::SoundManager::getNumberOfSounds | ( | ) | const |
Retrieves the total number of created sounds.
References mSounds.
Retrieves a pointer to a sound by id.
References mSounds.
f32 sound::SoundManager::getSoundSpeed | ( | ) | const |
Returns the speed of sound.
References mSoundSpeed.
void sound::SoundManager::initializeImpl | ( | ) | [protected, virtual] |
Reimplemented from engine::Object.
References getInstance(), sound::SoundDriver::initialize(), and mSoundDriver.
void sound::SoundManager::initializeObjects | ( | ) |
Initialize all sound elements waiting to be initialized.
void sound::SoundManager::removeAllListeners | ( | ) |
Removes all listeners.
References scene::SceneManager::getInstance(), and mListeners.
void sound::SoundManager::removeAllSounds | ( | ) |
Removes (and destroys) all sounds.
References scene::SceneManager::getInstance(), and mSounds.
Referenced by uninitializeImpl().
void sound::SoundManager::removeListener | ( | Listener * | listener | ) |
Removes a listener.
References engine::Object::getID().
void sound::SoundManager::removeListener | ( | const u32 & | id | ) |
Removes a listener.
References getInstance(), and mListeners.
void sound::SoundManager::removeSound | ( | const u32 & | id | ) |
Removes a sound.
References getInstance(), and mSounds.
void sound::SoundManager::removeSound | ( | Sound * | sound | ) |
Removes a sound.
References engine::Object::getID().
void sound::SoundManager::removeSoundDriver | ( | ) |
References mSoundDriver.
void sound::SoundManager::removeSoundFactory | ( | ) |
References mSoundFactory.
void sound::SoundManager::setActiveListener | ( | Listener * | listener | ) |
Sets a pointer to the active listener.
References mActiveListener.
void sound::SoundManager::setDopplerFactor | ( | f32 | dopplerFactor | ) |
Sets the Doppler factor. The Doppler factor is a simple scaling factor of the source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the Doppler Effect Calculations.
References mDopplerFactor, mSoundDriver, and sound::SoundDriver::setDopplerFactor().
void sound::SoundManager::setSoundDriver | ( | SoundDriver * | driver | ) |
References mSoundDriver.
void sound::SoundManager::setSoundFactory | ( | SoundFactory * | factory | ) |
References mSoundFactory.
void sound::SoundManager::setSoundSpeed | ( | f32 | soundSpeed | ) |
Sets the speed of sound used in the Doppler calculations. This sets the propagation speed used in the Doppler calculations. The default is 343.3 m/s (Speed of sound through air).
References mSoundDriver, mSoundSpeed, and sound::SoundDriver::setSoundSpeed().
void sound::SoundManager::start | ( | ) |
References getInstance(), mSoundDriver, and sound::SoundDriver::start().
Referenced by engine::EngineManager::start().
void sound::SoundManager::stop | ( | ) |
References getInstance(), mSoundDriver, and sound::SoundDriver::stop().
Referenced by engine::EngineManager::stop().
void sound::SoundManager::uninitializeImpl | ( | ) | [protected, virtual] |
Reimplemented from engine::Object.
References getInstance(), and removeAllSounds().
void sound::SoundManager::updateImpl | ( | f32 | elapsedTime | ) | [protected, virtual] |
Reimplemented from engine::Object.
References mActiveListener, mSoundDriver, sound::SoundDriver::update(), and sound::SoundDriver::updateListener().
friend class ResourceManager [friend] |
Listener* sound::SoundManager::mActiveListener [protected] |
Referenced by getActiveListener(), setActiveListener(), SoundManager(), and updateImpl().
f32 sound::SoundManager::mDopplerFactor [protected] |
Referenced by getDopplerFactor(), setDopplerFactor(), and SoundManager().
std::map<u32, Listener*> sound::SoundManager::mListeners [protected] |
Central list of listeners - for easy memory management and lookup.
Referenced by createListener(), getListener(), getNumberOfListeners(), removeAllListeners(), and removeListener().
SoundDriver* sound::SoundManager::mSoundDriver [protected] |
Referenced by initializeImpl(), removeSoundDriver(), setDopplerFactor(), setSoundDriver(), setSoundSpeed(), SoundManager(), start(), stop(), and updateImpl().
SoundFactory* sound::SoundManager::mSoundFactory [protected] |
Referenced by createSound(), removeSoundFactory(), setSoundFactory(), and SoundManager().
std::map<u32, Sound*> sound::SoundManager::mSounds [protected] |
Central list of sounds - for easy memory management and lookup.
Referenced by createSound(), getNumberOfSounds(), getSound(), removeAllSounds(), and removeSound().
f32 sound::SoundManager::mSoundSpeed [protected] |
Referenced by getSoundSpeed(), setSoundSpeed(), and SoundManager().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by
Doxygen
(1.7.4)
|