gxaudio.h 990 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef GXAUDIO_H
  2. #define GXAUDIO_H
  3. #include <string>
  4. #include "gxsound.h"
  5. class gxRuntime;
  6. struct FSOUND_SAMPLE;
  7. class gxAudio{
  8. public:
  9. gxRuntime *runtime;
  10. gxAudio( gxRuntime *runtime );
  11. ~gxAudio();
  12. gxChannel *play( FSOUND_SAMPLE *sample );
  13. gxChannel *play3d( FSOUND_SAMPLE *sample,const float pos[3],const float vel[3] );
  14. void pause();
  15. void resume();
  16. private:
  17. /***** GX INTERFACE *****/
  18. public:
  19. enum{
  20. CD_MODE_ONCE=1,CD_MODE_LOOP,CD_MODE_ALL
  21. };
  22. gxSound *loadSound( const std::string &filename,bool use_3d );
  23. gxSound *verifySound( gxSound *sound );
  24. void freeSound( gxSound *sound );
  25. void setPaused( bool paused ); //master pause
  26. void setVolume( float volume ); //master volume
  27. void set3dOptions( float roll,float dopp,float dist );
  28. void set3dListener( const float pos[3],const float vel[3],const float forward[3],const float up[3] );
  29. gxChannel *playCDTrack( int track,int mode );
  30. gxChannel *playFile( const std::string &filename,bool use_3d );
  31. };
  32. #endif