Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.


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 54 of file sound.cpp.

References displayLogMessage(), fatalError(), Sound_Init(), and warning().

SoundSystem::~SoundSystem  ) 
 

Definition at line 272 of file sound.cpp.

References SoundSystem_InternalData::musicBuf.


Member Function Documentation

bool SoundSystem::areEffectsMuted  )  [inline]
 

can sounds be played right now ?

Definition at line 101 of file sound.h.

Referenced by Sound::play(), Sound::playLoop(), and Sound::playWait().

ASCString SoundSystem::getDiagnosticText  ) 
 

Definition at line 145 of file sound.cpp.

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

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(), execuseraction(), SoundList::getSound(), and startMusic().

bool SoundSystem::isOff  )  [inline]
 

is the soundsystem completely disabled ?

Definition at line 104 of file sound.h.

void SoundSystem::pauseMusic  ) 
 

Pauses the music that is currently being played.

Definition at line 214 of file sound.cpp.

Referenced by resumePauseMusic().

void SoundSystem::playMusic MusicPlayList playlist  ) 
 

plays the pieces of music which are referenced in the playlist

Definition at line 207 of file sound.cpp.

References SoundSystem_InternalData::currentPlaylist.

void SoundSystem::resumeMusic  ) 
 

resumes the music

Definition at line 225 of file sound.cpp.

Referenced by resumePauseMusic().

void SoundSystem::resumePauseMusic  ) 
 

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

Definition at line 243 of file sound.cpp.

References pauseMusic(), and resumeMusic().

void SoundSystem::setEffectsMute bool  mute  ) 
 

Turns the sound on and off.

Definition at line 123 of file sound.cpp.

void SoundSystem::setEffectVolume int  Volume  ) 
 

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

Definition at line 261 of file sound.cpp.

Referenced by main().

void SoundSystem::setMusicVolume int  Volume  ) 
 

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

Definition at line 251 of file sound.cpp.

Referenced by main().


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 Tue Jun 24 02:20:54 2008 for Advanced Strategic Command by  doxygen 1.4.2