#include <sound.h>
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 |
Definition at line 59 of file sound.h.
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 | ( | ) |
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 | ( | ) |
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 | ( | ) |
SDL_AudioSpec Sound::spec [private] |
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] |
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] |
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] |
char* Sound::bgm_name [private] |
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] |