home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / Sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-06  |  1.1 KB  |  57 lines

  1. #ifndef __Sound_h__
  2. #define __Sound_h__
  3.  
  4. //#include "console.h"
  5. #include "SDL_mixer.h"
  6. #include "vectormath.h"
  7. #include "CVar.h"
  8. #include "SoundInfo.h"
  9.  
  10. enum channels_e{
  11.     SOUND_COMPUTER_CHANNEL,
  12.     SOUND_RADIO_CHANNEL,
  13.     SOUND_ANNOUNCER_CHANNEL,
  14.  
  15.     SOUND_FIRST_EFFECT_CHANNEL,
  16.  
  17.     SOUND_NUM_CHANNELS
  18. };
  19.  
  20. class Sound{
  21.     // subsystem interface
  22. public:
  23.     static SoundInfo info;
  24.  
  25.     static bool init();
  26.     static bool shutdown();
  27.     static bool wasInit();
  28.  
  29.     static bool registerCVarsAndCCmds();
  30.     static bool unregisterCVarsAndCCmds();
  31.  
  32. protected:
  33.     static bool initialized;
  34.  
  35.  
  36. public:
  37. //    static Mix_Chunk* samples[SOUND_NUM_SAMPLES];
  38.     static int effectChannelsGroup;
  39.  
  40.     static bool loadSamples();
  41.     static void freeSamples();
  42.     static Mix_Chunk* loadWAV(const char* filename);
  43.  
  44.     static void playSample(int channel, Mix_Chunk* chunk, int numLoops=0);
  45.  
  46.     static void playEffect(vec3_t pos, Mix_Chunk* chunk, int numLoops=0);
  47.     static int aquireEffectChannel();
  48.  
  49.  
  50.  
  51.     static Mix_Music* loadMusic(const char* filename);
  52.     static void playMusic(Mix_Music* music, int numLoops);
  53.     static void stopMusic();
  54. };
  55.  
  56. #endif    /* __Sound_h__ */
  57.