Orxonox: orxonox::SoundManager Class Reference

# orxonox::SoundManager Class Reference

`#include <src/orxonox/sound/SoundManager.h>`

Inheritance diagram for orxonox::SoundManager:

List of all members.

## Public Member Functions

void | addSound (SoundBase *sound)
bool | isSoundAvailable ()
void | removeSound (SoundBase *sound)
| SoundManager ()
void | tick (float dt)
| ~SoundManager ()

## Static Public Member Functions

static SoundManager & | getInstance ()

## Private Attributes

ALCcontext * | context_
ALCdevice * | device_
bool | soundavailable_
std::list< SoundBase * > | soundlist_

## Static Private Attributes

static SoundManager * | singletonRef_s = NULL

## Detailed Description

The SoundManager class manages the OpenAL device, context and listener position. It has a list of all SoundBase objects and calls their update function every tick. It is a singleton.

## Constructor & Destructor Documentation

orxonox::SoundManager::SoundManager | ( |  | ) |

Default constructor

References context_, COUT, device_, singletonRef_s, and soundavailable_.

orxonox::SoundManager::~SoundManager | ( |  | ) |

References context_, device_, and singletonRef_s.

## Member Function Documentation

void orxonox::SoundManager::addSound | ( | SoundBase * | sound | ) |

Add a SoundBase object to the list. Every SoundBase object should be in this list.

Parameters:

  | sound | Pointer to the SoundBase object to add

References soundlist_.

Referenced by orxonox::SoundBase::SoundBase().

static SoundManager& orxonox::SoundManager::getInstance | ( |  | ) | `[inline, static]`

Referenced by orxonox::SoundBase::loadFile(), and orxonox::SoundBase::SoundBase().

bool orxonox::SoundManager::isSoundAvailable | ( |  | ) |

Check if sound is available

References soundavailable_.

void orxonox::SoundManager::removeSound | ( | SoundBase * | sound | ) |

Remove a SoundBase object from the list and destroy it.

References soundlist_.

void orxonox::SoundManager::tick | ( | float | dt | ) | `[virtual]`

Tick function, updates listener and registred SoundBase objects

Parameters:

  | dt |

See also:
  Orxonox::Tickable

Implements orxonox::Tickable.

References COUT, orxonox::CameraManager::getActiveCamera(), orxonox::CameraManager::getInstance(), orxonox::CameraManager::getInstancePtr(), orxonox::WorldEntity::getOrientation(), orxonox::WorldEntity::getPosition(), orxonox::MT_Type::Quaternion, soundlist_, and orxonox::MT_Type::Vector3.

## Member Data Documentation

ALCcontext* orxonox::SoundManager::context_`[private]`

Referenced by SoundManager(), and ~SoundManager().

ALCdevice* orxonox::SoundManager::device_`[private]`

Referenced by SoundManager(), and ~SoundManager().

SoundManager * orxonox::SoundManager::singletonRef_s = NULL`[static, private]`

Referenced by SoundManager(), and ~SoundManager().

bool orxonox::SoundManager::soundavailable_`[private]`

Referenced by isSoundAvailable(), and SoundManager().

std::list<SoundBase*> orxonox::SoundManager::soundlist_`[private]`

Referenced by addSound(), removeSound(), and tick().

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

- src/orxonox/sound/SoundManager.h
- src/orxonox/sound/SoundManager.cc