Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SOUND_HPP_INCLUDED
00016 #define SOUND_HPP_INCLUDED
00017
00018 #include "events.hpp"
00019
00020 #include <string>
00021
00022 class config;
00023
00024 namespace sound {
00025
00026 enum channel_group {
00027 NULL_CHANNEL = -1,
00028 SOUND_SOURCES = 0,
00029 SOUND_BELL,
00030 SOUND_TIMER,
00031 SOUND_UI,
00032 SOUND_FX
00033 };
00034
00035 bool init_sound();
00036 void close_sound();
00037 void reset_sound();
00038
00039 void stop_music();
00040 void stop_sound();
00041 void stop_UI_sound();
00042 void stop_bell();
00043
00044
00045 void play_music_config(const config &music_node);
00046
00047 void commit_music_changes();
00048
00049
00050 void play_music_repeatedly(const std::string& id);
00051
00052 void play_music_once(const std::string& id);
00053
00054 void empty_playlist();
00055
00056 void play_music();
00057
00058
00059 void reposition_sound(int id, unsigned int distance);
00060 #define DISTANCE_SILENT 255
00061
00062
00063 bool is_sound_playing(int id);
00064
00065
00066 void stop_sound(int id);
00067
00068
00069 void play_sound(const std::string& files, channel_group group = SOUND_FX, unsigned int repeats = 0);
00070
00071
00072
00073 void play_sound_positioned(const std::string &files, int id, int repeats, unsigned int distance);
00074
00075
00076 void play_bell(const std::string& files);
00077
00078
00079 void play_timer(const std::string& files, int loop_ticks, int fadein_ticks);
00080
00081
00082 void play_UI_sound(const std::string& files);
00083
00084
00085 class music_thinker : public events::pump_monitor {
00086 void process(events::pump_info &info);
00087 };
00088
00089
00090 void write_music_play_list(config& snapshot);
00091
00092 void set_music_volume(int vol);
00093 void set_sound_volume(int vol);
00094 void set_bell_volume(int vol);
00095 void set_UI_volume(int vol);
00096
00097 }
00098
00099 #endif