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 stop_samples();
31 static void play_sample(Mix_Chunk
*s
);
32 static Mix_Chunk
*load_sample(const char *filename
);
33 static void unload_sample(const char *filename
);
34 static void clear_samples();
37 static Mix_Music
*_music
; // the music pointer
38 static std::string _m_filename
; //the music filename
39 static std::map
<std::string
, Mix_Chunk
*> _samples
; //the sample cache
40 static const int _channels
= 16; //the number of mixing channels
41 static const int _rate
= MIX_DEFAULT_FREQUENCY
; //the mix rate in Hz
42 static const int _format
= MIX_DEFAULT_FORMAT
; //the output format
43 static const int _op_channels
= 2; //output channels, 2 == stereo
44 static const int _chunksize
= 512; //output chunk size