Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes

AudioManager Class Reference

Audio Manager singleton class. More...

#include <AudioManager.h>

List of all members.

Public Member Functions

void PlaySound (char *fileName)
void PlayMusic (char *fileName)
void StopMusic ()
void Update ()

Static Public Member Functions

static AudioManagerInstance ()
static void DestroyInstance ()

Protected Member Functions

 AudioManager ()
 ~AudioManager ()

Static Protected Attributes

static AudioManagerm_instance = 0
 Static AudioManager instance which will be returned when the singleton's Instance() method is called.

Detailed Description

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.


Constructor & Destructor Documentation

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


Member Function Documentation

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.

Returns:
Static AudioManager instance.
void AudioManager::PlayMusic ( char *  fileName  ) 

Play a music file.

Play a background music file (loops the audio until manually stopped).

Parameters:
[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).

Parameters:
[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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations