Classes | |
struct | _Sample |
Audio struct representing music or sound effect. More... | |
Typedefs | |
typedef struct _Sample | Sample |
typedef std::map < ustring, Sample > | AudioMap |
Typedef'd map for audio samples. | |
typedef std::map < int, Mix_Chunk * > | ChannelMap |
Typedef'd map of sound effects. | |
Enumerations | |
enum | EffectChannel { CHANNEL_DIALOGUE = 0, CHANNEL_SCRIPT, CHANNEL_GUI } |
Channels for sound effects. | |
enum | SampleType { SAMPLE_EFFECT, SAMPLE_MUSIC } |
Types of audio samples. | |
Functions | |
bool | loadSample (const ustring &path, Sample &sample) |
Load an audio sample from file. | |
void | playEffect (const ustring &id, EffectChannel channel) |
Play a sound effect sample. | |
void | playMusic (const ustring &id) |
Play a music sample. | |
bool | isMusicPlaying () |
See if music is playing. | |
void | haltMusic () |
Halt music playback. | |
void | pushAudio (const ustring &id, const Sample &sample) |
Add an audio sample to the internal map. | |
void | popAudio (const ustring &id) |
Remove an audio sample from the internal map. | |
Audio::Sample * | queryAudio (const ustring &id) |
Get an audio sample from the internal map. | |
void | clearAudioStack () |
Clear the audio stack. | |
Variables | |
bool | g_Output |
Flag whether or not to output sound. | |
Mix_Music * | g_Music = NULL |
The music currently playing. | |
bool | g_Output |
Flag whether or not to output sound. | |
static AudioMap | g_Audio |
Internal map of audio. | |
static ChannelMap | Channels |
Internal map of sound effects. | |
Mix_Music * | g_Music |
The music currently playing. |
bool Audio::isMusicPlaying | ( | ) |
See if music is playing.
bool Audio::loadSample | ( | const ustring & | path, | |
Sample & | sample | |||
) |
Load an audio sample from file.
path | The path to the audio sample | |
sample | The audio sample object to load the data into |
void Audio::playEffect | ( | const ustring & | id, | |
EffectChannel | channel | |||
) |
Play a sound effect sample.
id | The ID of the sample | |
channel | The channel to play the sound effect on |
void Audio::playMusic | ( | const ustring & | id | ) |
Play a music sample.
id | The ID of the sample |
void Audio::popAudio | ( | const ustring & | id | ) |
Remove an audio sample from the internal map.
id | The ID of the sample to remove |
void Audio::pushAudio | ( | const ustring & | id, | |
const Sample & | sample | |||
) |
Add an audio sample to the internal map.
id | The ID of the audio sample | |
sample | The audio sample to add |
Sample * Audio::queryAudio | ( | const ustring & | id | ) |
Get an audio sample from the internal map.
id | The ID of the sample to get |