Classes | |
struct | chunk_load_exception |
class | music_thinker |
Enumerations | |
enum | channel_group { NULL_CHANNEL = -1, SOUND_SOURCES = 0, SOUND_BELL, SOUND_TIMER, SOUND_UI, SOUND_FX } |
Functions | |
static void | play_sound_internal (const std::string &files, channel_group group, unsigned int repeats=0, unsigned int distance=0, int id=-1, int loop_ticks=0, int fadein_ticks=0) |
static void | channel_finished_hook (int channel) |
bool | init_sound () |
void | close_sound () |
void | reset_sound () |
void | stop_music () |
void | stop_sound () |
void | stop_bell () |
void | stop_UI_sound () |
void | play_music_once (const std::string &file) |
void | play_no_music () |
void | play_music () |
static void | play_new_music () |
void | play_music_repeatedly (const std::string &name) |
void | play_music_config (const config &music) |
void | commit_music_changes () |
void | write_music_play_list (config &snapshot) |
void | reposition_sound (int id, unsigned int distance) |
bool | is_sound_playing (int id) |
void | stop_sound (int id) |
void | play_sound_positioned (const std::string &files, int id, int repeats, unsigned int distance) |
static Mix_Chunk * | load_chunk (const std::string &file, channel_group group) |
void | play_sound (const std::string &files, channel_group group, unsigned int repeats) |
void | play_bell (const std::string &files) |
void | play_timer (const std::string &files, int loop_ticks, int fadein_ticks) |
void | play_UI_sound (const std::string &files) |
void | set_music_volume (int vol) |
void | set_sound_volume (int vol) |
void | set_bell_volume (int vol) |
void | set_UI_volume (int vol) |
Variables | |
std::vector< Mix_Chunk * > | channel_chunks |
std::vector< int > | channel_ids |
This module provides the ability to play music and sounds. Setting music volume to 0 will stop the music.
enum sound::channel_group |
static void sound::channel_finished_hook | ( | int | channel | ) | [static] |
Definition at line 327 of file sound.cpp.
References channel_chunks, and channel_ids.
Referenced by init_sound().
void sound::close_sound | ( | ) |
Definition at line 374 of file sound.cpp.
References ERR_AUDIO, LOG_AUDIO, mix_ok, stop_bell(), stop_music(), stop_sound(), and stop_UI_sound().
Referenced by reset_sound(), preferences::set_music(), preferences::set_sound(), preferences::set_turn_bell(), and preferences::set_UI_sound().
void sound::commit_music_changes | ( | ) |
Definition at line 630 of file sound.cpp.
References choose_track(), current_track(), current_track_list, and play_music().
Referenced by playsingle_controller::play_scenario().
bool sound::init_sound | ( | ) |
Definition at line 333 of file sound.cpp.
References bell_channel, preferences::bell_volume(), channel_chunks, channel_finished_hook(), channel_ids, ERR_AUDIO, LOG_AUDIO, mix_ok, preferences::music_volume(), n_of_channels, n_reserved_channels, play_music(), preferences::sample_rate(), set_bell_volume(), set_music_volume(), set_sound_volume(), set_UI_volume(), SOUND_BELL, preferences::sound_buffer_size(), SOUND_FX, SOUND_SOURCES, SOUND_TIMER, SOUND_UI, preferences::sound_volume(), source_channel_last, source_channel_start, timer_channel, UI_sound_channel, and preferences::UI_volume().
Referenced by reset_sound(), preferences::set_music(), preferences::set_sound(), preferences::set_turn_bell(), and preferences::set_UI_sound().
bool sound::is_sound_playing | ( | int | id | ) |
Definition at line 684 of file sound.cpp.
References channel_ids.
Referenced by soundsource::positional_source::update(), and soundsource::positional_source::update_positions().
static Mix_Chunk* sound::load_chunk | ( | const std::string & | file, | |
channel_group | group | |||
) | [static] |
Definition at line 704 of file sound.cpp.
References channel_chunks, ERR_AUDIO, get_binary_file_location(), LOG_AUDIO, max_cached_chunks, and NULL_CHANNEL.
Referenced by play_sound_internal().
void sound::play_bell | ( | const std::string & | files | ) |
Definition at line 831 of file sound.cpp.
References play_sound_internal(), SOUND_BELL, preferences::sound_on(), and preferences::turn_bell().
Referenced by playsingle_controller::before_human_turn().
void sound::play_music | ( | ) |
Definition at line 502 of file sound.cpp.
References current_track(), fadingout_time, music_start_time, no_fading, and want_new_music.
Referenced by commit_music_changes(), init_sound(), play_music_config(), play_music_once(), play_music_repeatedly(), and preferences::set_music().
void sound::play_music_config | ( | const config & | music | ) |
Definition at line 568 of file sound.cpp.
References current_track(), current_track_list, ERR_AUDIO, play_music(), and utils::string_bool().
Referenced by playsingle_controller::play_scenario().
void sound::play_music_once | ( | const std::string & | file | ) |
Definition at line 484 of file sound.cpp.
References current_track(), current_track_list, and play_music().
void sound::play_music_repeatedly | ( | const std::string & | name | ) |
Definition at line 553 of file sound.cpp.
References current_track(), current_track_list, and play_music().
Referenced by mp::lobby::lobby(), play_game(), and show_intro_part().
static void sound::play_new_music | ( | ) | [static] |
Definition at line 510 of file sound.cpp.
References current_track(), ERR_AUDIO, get_binary_file_location(), last_track(), LOG_AUDIO, mix_ok, preferences::music_on(), music_start_time, no_fading, and want_new_music.
Referenced by sound::music_thinker::process().
void sound::play_no_music | ( | ) |
Definition at line 492 of file sound.cpp.
References current_track(), current_track_list, mix_ok, and preferences::music_on().
Referenced by play_game().
void sound::play_sound | ( | const std::string & | files, | |
channel_group | group, | |||
unsigned int | repeats | |||
) |
Definition at line 823 of file sound.cpp.
References play_sound_internal(), and preferences::sound_on().
Referenced by play_controller::init_side(), unit_frame::redraw(), and unit::redraw_unit().
void sound::play_sound_internal | ( | const std::string & | files, | |
channel_group | group, | |||
unsigned int | repeats = 0 , |
|||
unsigned int | distance = 0 , |
|||
int | id = -1 , |
|||
int | loop_ticks = 0 , |
|||
int | fadein_ticks = 0 | |||
) | [static] |
Definition at line 758 of file sound.cpp.
References channel, channel_chunks, channel_ids, DISTANCE_SILENT, ERR_AUDIO, file, load_chunk(), LOG_AUDIO, mix_ok, pick_one(), and SOUND_UI.
Referenced by play_bell(), play_sound(), play_sound_positioned(), play_timer(), and play_UI_sound().
void sound::play_sound_positioned | ( | const std::string & | files, | |
int | id, | |||
int | repeats, | |||
unsigned int | distance | |||
) |
Definition at line 695 of file sound.cpp.
References play_sound_internal(), preferences::sound_on(), and SOUND_SOURCES.
Referenced by soundsource::positional_source::update().
void sound::play_timer | ( | const std::string & | files, | |
int | loop_ticks, | |||
int | fadein_ticks | |||
) |
Definition at line 839 of file sound.cpp.
References play_sound_internal(), preferences::sound_on(), and SOUND_TIMER.
Referenced by playmp_controller::think_about_countdown().
void sound::play_UI_sound | ( | const std::string & | files | ) |
Definition at line 847 of file sound.cpp.
References play_sound_internal(), SOUND_UI, and preferences::UI_sound_on().
Referenced by game_display::add_chat_message(), help::help_menu::contract(), help::help_menu::expand(), gui::slider::handle_event(), gui::menu::handle_event(), gui::slider::mouse_down(), gui::button::mouse_down(), gui::slider::mouse_motion(), gui::button::mouse_up(), gui::dialog::process(), mp::ui::process_message(), events::mouse_handler::select_hex(), gui::menu::set_selection_pos(), and mp::ui::set_user_list().
void sound::reposition_sound | ( | int | id, | |
unsigned int | distance | |||
) |
Definition at line 668 of file sound.cpp.
References channel_ids, and DISTANCE_SILENT.
Referenced by stop_sound(), soundsource::positional_source::update_positions(), and soundsource::positional_source::~positional_source().
void sound::reset_sound | ( | ) |
Definition at line 401 of file sound.cpp.
References close_sound(), ERR_AUDIO, init_sound(), preferences::music_on(), preferences::sound_on(), stop_bell(), stop_music(), stop_sound(), stop_UI_sound(), preferences::turn_bell(), and preferences::UI_sound_on().
Referenced by preferences::save_sample_rate(), and preferences::save_sound_buffer_size().
void sound::set_bell_volume | ( | int | vol | ) |
Definition at line 883 of file sound.cpp.
References bell_channel, mix_ok, and timer_channel.
Referenced by init_sound(), and preferences::set_bell_volume().
void sound::set_music_volume | ( | int | vol | ) |
Definition at line 855 of file sound.cpp.
References mix_ok.
Referenced by init_sound(), and preferences::set_music_volume().
void sound::set_sound_volume | ( | int | vol | ) |
Definition at line 865 of file sound.cpp.
References bell_channel, mix_ok, n_of_channels, timer_channel, and UI_sound_channel.
Referenced by init_sound(), and preferences::set_sound_volume().
void sound::set_UI_volume | ( | int | vol | ) |
Definition at line 894 of file sound.cpp.
References mix_ok, and UI_sound_channel.
Referenced by init_sound(), and preferences::set_UI_volume().
void sound::stop_bell | ( | ) |
Definition at line 453 of file sound.cpp.
References mix_ok, SOUND_BELL, and SOUND_TIMER.
Referenced by close_sound(), playmp_controller::finish_side_turn(), playmp_controller::linger(), reset_sound(), preferences::set_turn_bell(), and playmp_controller::~playmp_controller().
void sound::stop_music | ( | ) |
Definition at line 423 of file sound.cpp.
References mix_ok.
Referenced by close_sound(), reset_sound(), and preferences::set_music().
void sound::stop_sound | ( | int | id | ) |
void sound::stop_sound | ( | ) |
Definition at line 434 of file sound.cpp.
References mix_ok, SOUND_FX, and SOUND_SOURCES.
Referenced by close_sound(), reset_sound(), and preferences::set_sound().
void sound::stop_UI_sound | ( | ) |
Definition at line 469 of file sound.cpp.
References mix_ok, and SOUND_UI.
Referenced by close_sound(), reset_sound(), and preferences::set_UI_sound().
void sound::write_music_play_list | ( | config & | snapshot | ) |
Definition at line 656 of file sound.cpp.
References current_track_list.
Referenced by events::menu_handler::write_game_snapshot().
std::vector<Mix_Chunk*> sound::channel_chunks |
Definition at line 37 of file sound.cpp.
Referenced by channel_finished_hook(), init_sound(), load_chunk(), and play_sound_internal().
std::vector<int> sound::channel_ids |
Definition at line 41 of file sound.cpp.
Referenced by channel_finished_hook(), init_sound(), is_sound_playing(), play_sound_internal(), and reposition_sound().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |