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