SoundSystem Class Reference

#include <sound.h>

List of all members.

Public Member Functions

 SoundSystem (bool muteEffects, bool muteMusic, bool off)
 Sets up ASC's sound system.
void setEffectsMute (bool mute)
 Turns the sound on and off.
bool areEffectsMuted ()
 can sounds be played right now ?
bool isOff ()
 is the soundsystem completely disabled ?
void playMusic (MusicPlayList *playlist)
 plays the pieces of music which are referenced in the playlist
void pauseMusic ()
 Pauses the music that is currently being played.
void resumeMusic ()
 resumes the music
void resumePauseMusic ()
 resumes or resumes the music, depending whether is music is paused or playing
void setMusicVolume (int Volume)
 Sets the music volume. Range is 0 .. 100.
void setEffectVolume (int Volume)
 Sets the sound effect volume. Range is 0 .. 100.
int getEffectVolume ()
 Returns the sound effect volume. This is already normalized to the 0 .. 128 range of SDL_Mixer !
ASCString getDiagnosticText ()
 ~SoundSystem ()

Static Public Member Functions

static SoundSystemgetInstance ()

Friends

class Sound
 loads a sound from the wave file called name to an Mix_buffer.


Detailed Description

Definition at line 63 of file sound.h.


Constructor & Destructor Documentation

SoundSystem::SoundSystem ( bool  muteEffects,
bool  muteMusic,
bool  off 
)

Sets up ASC's sound system.

Parameters:
muteEffects The sound is going to be initialized, but no sounds played. Sounds can be enabled at runtime
muteMusic The sound is going to be initialized, but no music played. Music can be enabled at runtime
off The sound system is not even going to be initiliazed. Can only be restartet by restarting ASC

Definition at line 59 of file sound.cpp.

References displayLogMessage(), fatalError(), and warningMessage().

SoundSystem::~SoundSystem (  ) 

Definition at line 277 of file sound.cpp.

References SoundSystem_InternalData::musicBuf.


Member Function Documentation

void SoundSystem::setEffectsMute ( bool  mute  ) 

Turns the sound on and off.

Definition at line 128 of file sound.cpp.

Referenced by executeUserAction().

bool SoundSystem::areEffectsMuted (  )  [inline]

can sounds be played right now ?

Definition at line 101 of file sound.h.

Referenced by executeUserAction().

bool SoundSystem::isOff (  )  [inline]

is the soundsystem completely disabled ?

Definition at line 104 of file sound.h.

void SoundSystem::playMusic ( MusicPlayList playlist  ) 

plays the pieces of music which are referenced in the playlist

Definition at line 212 of file sound.cpp.

References SoundSystem_InternalData::currentPlaylist.

Referenced by PlayListSelector::buttonpressed(), and startMusic().

void SoundSystem::pauseMusic (  ) 

Pauses the music that is currently being played.

Definition at line 219 of file sound.cpp.

Referenced by executeUserAction(), and resumePauseMusic().

void SoundSystem::resumeMusic (  ) 

resumes the music

Definition at line 230 of file sound.cpp.

Referenced by executeUserAction(), and resumePauseMusic().

void SoundSystem::resumePauseMusic (  ) 

resumes or resumes the music, depending whether is music is paused or playing

Definition at line 248 of file sound.cpp.

References pauseMusic(), and resumeMusic().

void SoundSystem::setMusicVolume ( int  Volume  ) 

Sets the music volume. Range is 0 .. 100.

Definition at line 256 of file sound.cpp.

void SoundSystem::setEffectVolume ( int  Volume  ) 

Sets the sound effect volume. Range is 0 .. 100.

Definition at line 266 of file sound.cpp.

int SoundSystem::getEffectVolume (  )  [inline]

Returns the sound effect volume. This is already normalized to the 0 .. 128 range of SDL_Mixer !

Definition at line 125 of file sound.h.

static SoundSystem* SoundSystem::getInstance (  )  [inline, static]

Definition at line 127 of file sound.h.

Referenced by PlayListSelector::buttonpressed(), SoundSettings::diag(), executeUserAction(), SoundList::getSound(), and startMusic().

ASCString SoundSystem::getDiagnosticText (  ) 

Definition at line 150 of file sound.cpp.

References SoundSystem_InternalData::currentPlaylist, MusicPlayList::getDiagnosticText(), SoundSystem_InternalData::lastMusicMessage, and ASCString::toString().

Referenced by SoundSettings::diag().


Friends And Related Function Documentation

friend class Sound [friend]

loads a sound from the wave file called name to an Mix_buffer.

Definition at line 87 of file sound.h.


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:30 2012 for Advanced Strategic Command by  doxygen 1.5.1