00001 #ifndef __SOUND_H_
00002 #define __SOUND_H_
00003
00004 #include <SDL/SDL_mixer.h>
00005 #include <vector>
00006 #include "sample.h"
00007 #include "music.h"
00008
00009
00010 using namespace std;
00011
00012
00013
00014 #define UFO_SOUND DATAFILE("sound" DIR_SEP "ufo.wav")
00015
00016 #define GUN_SHOT DATAFILE("sound" DIR_SEP "shot.wav")
00017
00018 #define WALK_SOUND DATAFILE("sound" DIR_SEP "walk.wav")
00019
00020 #define BEAR_WALK_SOUND_1 DATAFILE("sound" DIR_SEP "squeak_walk.wav")
00021
00022
00023
00024 #define THEME_MUSIC DATAFILE("sound" DIR_SEP "nnc1.ogg")
00025 #define ALTERNATE_THEME DATAFILE("sound" DIR_SEP "nnc2.ogg")
00026
00027
00028 enum sound {
00029 UFO_NOISE, GUNSHOT, WALKING, BEAR_WALK
00030 };
00031
00032 class Sound {
00033 public:
00034 Sound(int n = 32);
00035 ~Sound();
00036 static void PlaySample(sound s);
00037 static void PlayTheme( int loops );
00038 static void StopTheme();
00039 static void LoadTheme(string path);
00040 static bool ThemeIsPlaying();
00041 static bool SampleIsPlaying(sound s);
00042 private:
00043 int numchannels;
00044 static vector<Sample *> sEffects;
00045 static Music *theme;
00046 };
00047
00048 #endif