Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
sound::SoundManager Class Reference

#include <SoundManager.h>

Inheritance diagram for sound::SoundManager:
engine::Object core::Singleton< SoundManager >

List of all members.

Public Member Functions

ListenercreateListener (scene::Node *parent=NULL)
 Creates a listener to be managed by sound manager.
ListenercreateListener (const std::string &name, scene::Node *parent=NULL)
SoundcreateSound (SoundData *soundData, scene::Node *parent=NULL)
SoundcreateSound (const std::string &name, SoundData *soundData, scene::Node *parent=NULL)
SoundcreateSound (const std::string &filename, scene::Node *parent=NULL)
 Creates a sound to be managed by sound manager.
SoundcreateSound (const std::string &name, const std::string &filename, scene::Node *parent=NULL)
ListenergetActiveListener ()
 Retrieve a pointer to the active listener.
f32 getDopplerFactor () const
 Returns the Doppler factor.
ListenergetListener (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.
SoundgetSound (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 SoundManagergetInstance ()
 Get instance.

Protected Member Functions

void initializeImpl ()
void uninitializeImpl ()
void updateImpl (f32 elapsedTime)

Protected Attributes

ListenermActiveListener
f32 mDopplerFactor
std::map< u32, Listener * > mListeners
 Central list of listeners - for easy memory management and lookup.
SoundDrivermSoundDriver
SoundFactorymSoundFactory
std::map< u32, Sound * > mSounds
 Central list of sounds - for easy memory management and lookup.
f32 mSoundSpeed

Friends

class ResourceManager

Detailed Description

Sound Manager.

This class handles everything related to sound.

Author:
: Kat'Oun
Version:
: 1.0

Constructor & Destructor Documentation

sound::SoundManager::SoundManager ( )
sound::SoundManager::~SoundManager ( )

References getInstance().


Member Function Documentation

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 
)
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 
)
Sound * sound::SoundManager::createSound ( const std::string &  filename,
scene::Node parent = NULL 
)
Sound * sound::SoundManager::createSound ( const std::string &  name,
SoundData soundData,
scene::Node parent = NULL 
)
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]
Listener * sound::SoundManager::getListener ( const u32 id)

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.

Sound * sound::SoundManager::getSound ( const u32 id)

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]
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 ( )
void sound::SoundManager::stop ( )
void sound::SoundManager::uninitializeImpl ( ) [protected, virtual]

Reimplemented from engine::Object.

References getInstance(), and removeAllSounds().

void sound::SoundManager::updateImpl ( f32  elapsedTime) [protected, virtual]

Friends And Related Function Documentation

friend class ResourceManager [friend]

Member Data Documentation

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().

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().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by Doxygen (1.7.4)