Game Develop C++ Platform: SoundManager Class Reference

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SoundManager Class Reference
Sound engine

Manage sounds and musics played by games. More...

`#include <SoundManager.h>`

## Public Member Functions

boost::shared_ptr< Music > & | GetMusicOnChannel (int channel)
void | SetMusicOnChannel (int channel, boost::shared_ptr< Music > music)
boost::shared_ptr< Sound > & | GetSoundOnChannel (int channel)
void | SetSoundOnChannel (int channel, boost::shared_ptr< Sound > sound)
float | GetGlobalVolume () const
void | SetGlobalVolume (float volume)
void | ClearAllSoundsAndMusics ()
void | ManageGarbage ()

## Static Public Member Functions

static SoundManager * | GetInstance ()
static void | DestroySingleton ()

## Public Attributes

vector< boost::shared_ptr < Music > > | musics
vector< boost::shared_ptr < Sound > > | sounds

## Detailed Description

Manage sounds and musics played by games.

See Also
  Sound
  Music

## Member Function Documentation

void SoundManager::ClearAllSoundsAndMusics | ( | ) |  |

inline

Destroy all sounds and musics

float SoundManager::GetGlobalVolume | ( | ) |  | const

inline

Get global game sound volume. Example :

float currentVolume = SoundManager::GetInstance()->GetGlobalVolume();

boost::shared_ptr< Music > & SoundManager::GetMusicOnChannel | ( | int | channel) |  |

Return pointer to a music on a channel

boost::shared_ptr< Sound > & SoundManager::GetSoundOnChannel | ( | int | channel) |  |

Return pointer to a sound on a channel

void SoundManager::ManageGarbage | ( | ) |  |

Ensure sounds and musics without channels and stopped are destroyed.

void SoundManager::SetGlobalVolume | ( | float | volume) |  |

Change global game sound volume. Example :

SoundManager::GetInstance()->SetGlobalVolume(50);

void SoundManager::SetMusicOnChannel | ( | int | channel,
|  | boost::shared_ptr< Music > | music
| ) |  |

Change music on a channel. Automatically destroy the old music.

void SoundManager::SetSoundOnChannel | ( | int | channel,
|  | boost::shared_ptr< Sound > | sound
| ) |  |

Change sound on a channel. Automatically destroy the old sound.

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

- SoundManager.h
- SoundManager.cpp