Removed global physics. Changed "angle" to "heading".
[luagame.git] / SoundEngine.h
blob2107614f7f9c39ad9a39fef905a03d27ccfe2688
1 /*
2 =================
3 = SoundEngine.h =
4 =================
6 The sound engine.
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
16 #ifndef SOUNDENGINE_H
17 #define SOUNDENGINE_H
19 #include "SDL/SDL_mixer.h"
20 #include <map>
21 #include <string>
23 class SoundEngine{
24 public:
25 SoundEngine(){}; //don't ever instantiate this class. seriously.
26 static void open();
27 static void close();
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();
36 private:
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
46 #endif