Sound Class Reference

#include <sound.h>

List of all members.

Public Member Functions

 Sound (int)
 Sound ()
 ~Sound ()
int load_bgm (string filename)
int load_sfx (string filename)
int get_status ()
int play_bgm ()
int play_sample_name (string name)
int play_sample_number (int number)
int stop_all ()
int pause_all ()
int resume_all ()
void raise_volume ()
void lower_volume ()
void set_volume (int volume)

Private Attributes

SDL_AudioSpec spec
int NUM_SAMPLES
Mix_Music * bgm
struct Mix_Chunk * sfx
vector< string > sfx_name
int sfx_loaded []
int bgm_loop
char * bgm_name
int bgm_loaded
int play_flag
int volume

Static Private Attributes

static int init_done = 0


Detailed Description

Definition at line 59 of file sound.h.


Constructor & Destructor Documentation

Sound::Sound ( int  max_samples  ) 

Definition at line 34 of file sound.cpp.

References bgm, bgm_loaded, bgm_loop, bgm_name, init_done, NUM_SAMPLES, sfx, sfx_loaded, sfx_name, SOUND_DEBUG, and spec.

Sound::Sound (  ) 

Definition at line 77 of file sound.cpp.

Sound::~Sound (  ) 

Definition at line 81 of file sound.cpp.

References bgm, NUM_SAMPLES, sfx, and SOUND_DEBUG.


Member Function Documentation

int Sound::load_bgm ( string  filename  ) 

Definition at line 117 of file sound.cpp.

References bgm, bgm_loaded, bgm_name, and SOUND_DEBUG.

Referenced by Menu::load_menu_data(), and main().

int Sound::load_sfx ( string  filename  ) 

Definition at line 130 of file sound.cpp.

References NUM_SAMPLES, sfx, sfx_loaded, sfx_name, and SOUND_DEBUG.

Referenced by main().

int Sound::get_status (  ) 

Definition at line 149 of file sound.cpp.

References bgm_loaded, NUM_SAMPLES, and sfx_loaded.

int Sound::play_bgm (  ) 

Definition at line 158 of file sound.cpp.

References bgm, bgm_loaded, and play_flag.

Referenced by main(), and Menu::run().

int Sound::play_sample_name ( string  name  ) 

Definition at line 167 of file sound.cpp.

References NUM_SAMPLES, play_flag, sfx, sfx_loaded, sfx_name, and SOUND_DEBUG.

Referenced by main(), and Menu::run().

int Sound::play_sample_number ( int  number  ) 

Definition at line 184 of file sound.cpp.

References NUM_SAMPLES, play_flag, sfx, sfx_loaded, and SOUND_DEBUG.

int Sound::stop_all (  ) 

Definition at line 193 of file sound.cpp.

References play_flag.

Referenced by Menu::run().

int Sound::pause_all (  ) 

Definition at line 200 of file sound.cpp.

References play_flag.

int Sound::resume_all (  ) 

Definition at line 207 of file sound.cpp.

References play_flag.

void Sound::raise_volume (  ) 

Definition at line 214 of file sound.cpp.

References volume.

void Sound::lower_volume (  ) 

Definition at line 223 of file sound.cpp.

References volume.

void Sound::set_volume ( int  volume  ) 

Definition at line 232 of file sound.cpp.

References volume.


Member Data Documentation

SDL_AudioSpec Sound::spec [private]

Definition at line 61 of file sound.h.

Referenced by Sound().

int Sound::NUM_SAMPLES [private]

Definition at line 62 of file sound.h.

Referenced by get_status(), load_sfx(), main(), play_sample_name(), play_sample_number(), Sound(), and ~Sound().

Mix_Music* Sound::bgm [private]

Definition at line 63 of file sound.h.

Referenced by load_bgm(), play_bgm(), Sound(), and ~Sound().

struct Mix_Chunk* Sound::sfx [read, private]

Definition at line 64 of file sound.h.

Referenced by load_sfx(), play_sample_name(), play_sample_number(), Sound(), and ~Sound().

vector<string> Sound::sfx_name [private]

Definition at line 65 of file sound.h.

Referenced by load_sfx(), play_sample_name(), and Sound().

int Sound::sfx_loaded[] [private]

Definition at line 66 of file sound.h.

Referenced by get_status(), load_sfx(), play_sample_name(), play_sample_number(), and Sound().

int Sound::bgm_loop [private]

Definition at line 67 of file sound.h.

Referenced by Sound().

char* Sound::bgm_name [private]

Definition at line 68 of file sound.h.

Referenced by load_bgm(), and Sound().

int Sound::bgm_loaded [private]

Definition at line 69 of file sound.h.

Referenced by get_status(), load_bgm(), play_bgm(), and Sound().

int Sound::play_flag [private]

Definition at line 70 of file sound.h.

Referenced by pause_all(), play_bgm(), play_sample_name(), play_sample_number(), resume_all(), and stop_all().

int Sound::volume [private]

Definition at line 71 of file sound.h.

Referenced by lower_volume(), main(), raise_volume(), and set_volume().

int Sound::init_done = 0 [static, private]

Definition at line 72 of file sound.h.

Referenced by Sound().


The documentation for this class was generated from the following files:

Generated on Thu May 22 10:42:43 2008 for piedmont by  doxygen 1.5.5