#include <CSound.h>
Public Member Functions | |
CSound (void) | |
~CSound (void) | |
void | SetModuleHandle (HMODULE hModule) |
Set the connection to the resources. | |
bool | Create (void) |
Initialize the object. | |
void | Destroy (void) |
Uninitialize the object. | |
void | SetPause (bool Pause) |
Pause or resume the sound. | |
bool | IsPaused (void) |
void | PlaySong (ESong Song) |
Start playing a song. | |
void | StopSong (ESong Song) |
Stop playing a specific song. | |
void | PlaySample (ESample Sample) |
Start playing a sample. | |
void | StopAllSamples () |
Stops all samples. | |
void | SetSampleVolume (int VolumePerCent) |
Set the volume for all samples. | |
void | SetSongVolume (ESong Song, int VolumePerCent) |
Set the volume for a specific song. | |
Private Member Functions | |
bool | GetSoundResource (int ResourceID, LPVOID &pData, DWORD &DataSize) |
bool | LoadSample (ESample Sample, int ResourceID) |
void | FreeSample (ESample Sample) |
bool | LoadSong (ESong Song, int ResourceID) |
void | FreeSong (ESong Song) |
Private Attributes | |
HMODULE | m_hModule |
Connection to the resources. | |
bool | m_GlobalPause |
Is the sound paused? | |
bool | m_SoundOK |
Could SDL_mixer be initialized? This may be false if there is no sound card. | |
Mix_Chunk * | m_Samples [NUM_SAMPLES] |
The available samples. | |
Mix_Music * | m_CurrentSong |
The current song. | |
ESong | m_ESong |
current song number |
CSound::CSound | ( | void | ) |
CSound::~CSound | ( | void | ) |
bool CSound::LoadSample | ( | ESample | Sample, | |
int | ResourceID | |||
) | [private] |
void CSound::FreeSample | ( | ESample | Sample | ) | [private] |
bool CSound::LoadSong | ( | ESong | Song, | |
int | ResourceID | |||
) | [private] |
void CSound::FreeSong | ( | ESong | Song | ) | [private] |
void CSound::SetModuleHandle | ( | HMODULE | hModule | ) | [inline] |
Set the connection to the resources.
bool CSound::Create | ( | void | ) |
Initialize the object.
void CSound::Destroy | ( | void | ) |
Uninitialize the object.
void CSound::SetPause | ( | bool | Pause | ) |
Pause or resume the sound.
bool CSound::IsPaused | ( | void | ) | [inline] |
void CSound::PlaySong | ( | ESong | Song | ) |
Start playing a song.
void CSound::StopSong | ( | ESong | Song | ) |
Stop playing a specific song.
void CSound::PlaySample | ( | ESample | Sample | ) |
Start playing a sample.
void CSound::StopAllSamples | ( | ) |
Stops all samples.
void CSound::SetSampleVolume | ( | int | VolumePerCent | ) |
Set the volume for all samples.
void CSound::SetSongVolume | ( | ESong | Song, | |
int | VolumePerCent | |||
) |
Set the volume for a specific song.
HMODULE CSound::m_hModule [private] |
Connection to the resources.
bool CSound::m_GlobalPause [private] |
Is the sound paused?
bool CSound::m_SoundOK [private] |
Could SDL_mixer be initialized? This may be false if there is no sound card.
Mix_Chunk* CSound::m_Samples[NUM_SAMPLES] [private] |
The available samples.
Mix_Music* CSound::m_CurrentSong [private] |
The current song.
ESong CSound::m_ESong [private] |
current song number