8 This is sorta a wrapper around SDL_Mixer
9 It handles the sample cache though, so things don't get loaded
10 way too many times. SDL_Mixer is a really quite nice
11 and simple audio implementation.
13 Copyright (c)2006 - Brett Lajzer
19 #include "SDL/SDL_mixer.h"
25 SoundEngine(){}; //don't ever instantiate this class. seriously.
28 static void play_music(const char *filename
, int loops
); //loops = -1 -> loops forever
29 static void stop_music();
30 static void play_sample(const char *filename
);
31 static void load_sample(const char *filename
);
32 static void unload_sample(const char *filename
);
33 static void clear_samples();
36 static Mix_Music
*_music
; // the music pointer
37 static std::string _m_filename
; //the music filename
38 static std::map
<std::string
, Mix_Chunk
*> _samples
; //the sample cache
39 static const int _channels
= 16; //the number of mixing channels
40 static const int _rate
= 44100; //the mix rate in Hz
41 static const int _format
= MIX_DEFAULT_FORMAT
; //the output format
42 static const int _op_channels
= 2; //output channels, 2 == stereo
43 static const int _chunksize
= 2048; //output chunk size