00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __MIXER_H_
00021 #define __MIXER_H_
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #ifdef DEBUG
00028 # ifndef NO_DEBUG_MIXER
00029 # define DEBUG_MIXER
00030 # endif
00031 #else
00032 # ifdef DEBUG_MIXER
00033 # error DEBUG_MIXER defined without DEBUG
00034 # endif
00035 #endif
00036
00037 #include <exception>
00038 #include <map>
00039
00040 class channel;
00041
00042 class sound_renderer;
00043
00051 class mixer {
00052 private:
00053 std::map<int, channel *> _channels;
00054 int _frequency;
00055 short * _sound;
00056 sound_renderer * _out;
00057 public:
00058 mixer() throw();
00059 int get_frequency() const throw() { return _frequency; }
00060 virtual ~mixer() throw();
00071 bool init(sound_renderer * out, int freq, int size) throw();
00080 channel * find_channel(int track) throw();
00090 bool add_channel(int track, channel * c) throw(std::exception);
00097 bool handle_frame() throw(std::exception);
00102 bool stop() throw(std::exception);
00103 };
00104
00105 #endif