home *** CD-ROM | disk | FTP | other *** search
- #ifndef __Sound_h__
- #define __Sound_h__
-
- //#include "console.h"
- #include "SDL_mixer.h"
- #include "vectormath.h"
- #include "CVar.h"
- #include "SoundInfo.h"
-
- enum channels_e{
- SOUND_COMPUTER_CHANNEL,
- SOUND_RADIO_CHANNEL,
- SOUND_ANNOUNCER_CHANNEL,
-
- SOUND_FIRST_EFFECT_CHANNEL,
-
- SOUND_NUM_CHANNELS
- };
-
- class Sound{
- // subsystem interface
- public:
- static SoundInfo info;
-
- static bool init();
- static bool shutdown();
- static bool wasInit();
-
- static bool registerCVarsAndCCmds();
- static bool unregisterCVarsAndCCmds();
-
- protected:
- static bool initialized;
-
-
- public:
- // static Mix_Chunk* samples[SOUND_NUM_SAMPLES];
- static int effectChannelsGroup;
-
- static bool loadSamples();
- static void freeSamples();
- static Mix_Chunk* loadWAV(const char* filename);
-
- static void playSample(int channel, Mix_Chunk* chunk, int numLoops=0);
-
- static void playEffect(vec3_t pos, Mix_Chunk* chunk, int numLoops=0);
- static int aquireEffectChannel();
-
-
-
- static Mix_Music* loadMusic(const char* filename);
- static void playMusic(Mix_Music* music, int numLoops);
- static void stopMusic();
- };
-
- #endif /* __Sound_h__ */
-