Audio Manager singleton class. More...
#include <AudioManager.h>
Public Member Functions | |
| void | PlaySound (char *fileName) |
| void | PlayMusic (char *fileName) |
| void | StopMusic () |
| void | Update () |
Static Public Member Functions | |
| static AudioManager * | Instance () |
| static void | DestroyInstance () |
Protected Member Functions | |
| AudioManager () | |
| ~AudioManager () | |
Static Protected Attributes | |
| static AudioManager * | m_instance = 0 |
| Static AudioManager instance which will be returned when the singleton's Instance() method is called. | |
Audio Manager singleton class.
Returns an instance of an audio manager, which can be used to play and stop sound files. Automatically handles audio channels.
| AudioManager::AudioManager | ( | ) | [protected] |
Constructor.
Creates an AudioManager object. Protected as this is a singleton, which is created when Instance() is first called.
| AudioManager::~AudioManager | ( | ) | [protected] |
Destructor.
Destroys the AudioManager object. Protected as this is a singleton, which should instead be deleted using DestroyInstance().
| void AudioManager::DestroyInstance | ( | ) | [static] |
Delete this singleton.
Safely deletes the singleton instance and releases any memory it was using.
| AudioManager * AudioManager::Instance | ( | ) | [static] |
Return the static AudioManager instance.
Returns a static instance of AudioManager. If no AudioManager instance exists, one is created.
| void AudioManager::PlayMusic | ( | char * | fileName | ) |
Play a music file.
Play a background music file (loops the audio until manually stopped).
| [in] | fileName | Name of the audio file to be played. |
| void AudioManager::PlaySound | ( | char * | fileName | ) |
Play a sound.
Play a sound effect file (plays only once).
| [in] | fileName | Name of the audio file to be played. |
| void AudioManager::StopMusic | ( | ) |
Stops music.
Stop any currently playing music files.
| void AudioManager::Update | ( | ) |
Updates the audio channels.
Updates Marmalade's audio channels. Must be called every game update for audio to play correctly.
1.7.1