# SoundManager Class Reference

`#include <SoundManager.h>`

Inheritance diagram for SoundManager:

List of all members.

## Classes
struct | SoundInstance
## Public Member Functions
| SoundManager ()
| ~SoundManager ()
void | Initialise (int freq=44100, Uint16 samples=1024, Uint8 channels=1)
void | Shutdown ()
SoundID | CreateSoundSong (const bool &bPreCreate, const UInt &bpm, const UInt &numUniqueSections, const UInt &lengthInSections, const UInt &timePerSection)
SoundInstanceID | PlaySoundID (const SoundID &sid, bool loop=false)
bool | PauseSound (const SoundInstanceID &siid)
bool | StopSound (const SoundInstanceID &siid)
void | Update ()
void | Output ()
void | IncreaseVolume ()
void | DecreaseVolume ()
void | HandleAudioBuffer (void *userdata, Uint8 *stream, int len)
SDL_AudioSpec * | GetAudioSpec ()
virtual bool | HandleEvent (IEvent *pEvent)
## Static Public Member Functions
static void | MixBuffers (Sint16 *pBuf1, Sint16 *pBuf2, size_t sz)
static void | SDLAudioCallback (void *userdata, Uint8 *stream, int len)
static SoundManager * | getSingleton ()
static void | deleteSingleton ()
## Protected Member Functions
void | ApplyVolumeToStream (Sint16 *pStream, size_t sz)
## Protected Attributes
std::vector< ISound * > | m_vSounds
std::vector< SoundInstance * > | m_vInstances
unsigned long | m_lastUpdate
SDL_AudioSpec * | m_pAudioSpec
int | m_volume
## Static Protected Attributes
static SoundManager * | m_pInstance = NULL

## Detailed Description

Definition at line 19 of file SoundManager.h.

## Constructor & Destructor Documentation

SoundManager::SoundManager | ( |  | ) |

Definition at line 21 of file SoundManager.cpp.

SoundManager::~SoundManager | ( |  | ) |

Definition at line 27 of file SoundManager.cpp.

## Member Function Documentation

void SoundManager::ApplyVolumeToStream | ( | Sint16 * | pStream,
|  | size_t | sz |
| ) |  |  | `[protected]`

Definition at line 242 of file SoundManager.cpp.

SoundID SoundManager::CreateSoundSong | ( | const bool & | bPreCreate,
|  | const UInt & | bpm,
|  | const UInt & | numUniqueSections,
|  | const UInt & | lengthInSections,
|  | const UInt & | timePerSection |
| ) |  |  |

Definition at line 77 of file SoundManager.cpp.

void SoundManager::DecreaseVolume | ( |  | ) |

Definition at line 205 of file SoundManager.cpp.

static void TSingleton< SoundManager >::deleteSingleton | ( |  | ) | `[inline, static, inherited]`

Definition at line 22 of file TSingleton.h.

SDL_AudioSpec* SoundManager::GetAudioSpec | ( |  | ) | `[inline]`

Definition at line 41 of file SoundManager.h.

static SoundManager * TSingleton< SoundManager >::getSingleton | ( |  | ) | `[inline, static, inherited]`

Definition at line 15 of file TSingleton.h.

void SoundManager::HandleAudioBuffer | ( | void * | userdata,
|  | Uint8 * | stream,
|  | int | len |
| ) |  |  |

Definition at line 159 of file SoundManager.cpp.

bool SoundManager::HandleEvent | ( | IEvent * | pEvent | ) | `[virtual]`

Implements IEventListener.

Definition at line 212 of file SoundManager.cpp.

void SoundManager::IncreaseVolume | ( |  | ) |

Definition at line 198 of file SoundManager.cpp.

void SoundManager::Initialise | ( | int | freq = `44100`,
|  | Uint16 | samples = `1024`,
|  | Uint8 | channels = `1` |
| ) |  |  |

Definition at line 31 of file SoundManager.cpp.

void SoundManager::MixBuffers | ( | Sint16 * | pBuf1,
|  | Sint16 * | pBuf2,
|  | size_t | sz |
| ) |  |  | `[static]`

Definition at line 145 of file SoundManager.cpp.

void SoundManager::Output | ( |  | ) |

Definition at line 68 of file SoundManager.cpp.

bool SoundManager::PauseSound | ( | const SoundInstanceID & | siid | ) |

Definition at line 108 of file SoundManager.cpp.

SoundInstanceID SoundManager::PlaySoundID | ( | const SoundID & | sid,
|  | bool | loop = `false` |
| ) |  |  |

Definition at line 88 of file SoundManager.cpp.

void SoundManager::SDLAudioCallback | ( | void * | userdata,
|  | Uint8 * | stream,
|  | int | len |
| ) |  |  | `[static]`

Definition at line 237 of file SoundManager.cpp.

void SoundManager::Shutdown | ( |  | ) |

Definition at line 54 of file SoundManager.cpp.

bool SoundManager::StopSound | ( | const SoundInstanceID & | siid | ) |

Definition at line 120 of file SoundManager.cpp.

void SoundManager::Update | ( |  | ) |

Definition at line 133 of file SoundManager.cpp.

## Member Data Documentation

unsigned long SoundManager::m_lastUpdate`[protected]`

Definition at line 65 of file SoundManager.h.

SDL_AudioSpec* SoundManager::m_pAudioSpec`[protected]`

Definition at line 66 of file SoundManager.h.

SoundManager * TSingleton< SoundManager >::m_pInstance = NULL`[inline, static, protected, inherited]`

Definition at line 29 of file TSingleton.h.

std::vector<SoundInstance*> SoundManager::m_vInstances`[protected]`

Definition at line 63 of file SoundManager.h.

int SoundManager::m_volume`[protected]`

Definition at line 67 of file SoundManager.h.

std::vector<ISound*> SoundManager::m_vSounds`[protected]`

Definition at line 62 of file SoundManager.h.

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

- C:/Users/Public/AGS Final Folder/BFLETCHER D4010283/Source/Game/Source/SoundManager.h
- C:/Users/Public/AGS Final Folder/BFLETCHER D4010283/Source/Game/Source/SoundManager.cpp