Separated funcs_video.h into imp + proto. Added simple global physics.
[luagame.git] / SoundEngine.h
blobc53380ac7121abc50bf33fc1e9a0c75a75105abb
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 play_sample(const char *filename);
32 private:
33 static Mix_Music *_music; // the music pointer
34 static std::string _m_filename; //the music filename
35 static std::map<std::string, Mix_Chunk *> _samples; //the sample cache
36 static const int _channels = 16; //the number of mixing channels
37 static const int _rate = 44100; //the mix rate in Hz
38 static const int _format = MIX_DEFAULT_FORMAT; //the output format
39 static const int _op_channels = 2; //output channels, 2 == stereo
40 static const int _chunksize = 2048; //output chunk size
42 #endif