BFSound.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "Common.h"
  3. NS_BF_BEGIN;
  4. #define MAX_SOURCE_SOUNDS 1024
  5. #define MAX_CHANNELS 32
  6. class BFSoundInstance
  7. {
  8. public:
  9. virtual ~BFSoundInstance() {}
  10. virtual void Release() = 0;
  11. virtual void SetBaseVolume(float theBaseVolume) = 0;
  12. virtual void SetBasePan(int theBasePan) = 0;
  13. virtual void SetVolume(float theVolume) = 0;
  14. virtual void SetPan(int thePosition) = 0; //-hundredth db to +hundredth db = left to right
  15. virtual void AdjustPitch(float theNumSteps) = 0;
  16. virtual bool Play(bool looping, bool autoRelease) = 0;
  17. virtual void Stop() = 0;
  18. virtual bool IsPlaying() = 0;
  19. virtual bool IsReleased() = 0;
  20. virtual float GetVolume() = 0;
  21. };
  22. class BFSoundManager
  23. {
  24. public:
  25. virtual ~BFSoundManager() {}
  26. virtual bool Initialized() = 0;
  27. virtual bool LoadSound(unsigned int theSfxID, const StringImpl& theFilename) = 0;
  28. virtual int LoadSound(const StringImpl& theFilename) = 0;
  29. virtual void ReleaseSound(unsigned int theSfxID) = 0;
  30. virtual void SetVolume(float theVolume) = 0;
  31. virtual bool SetBaseVolume(unsigned int theSfxID, float theBaseVolume) = 0;
  32. virtual bool SetBasePan(unsigned int theSfxID, int theBasePan) = 0;
  33. virtual BFSoundInstance* GetSoundInstance(unsigned int theSfxID) = 0;
  34. virtual void ReleaseSounds() = 0;
  35. virtual void ReleaseChannels() = 0;
  36. virtual float GetMasterVolume() = 0;
  37. virtual void SetMasterVolume(float theVolume) = 0;
  38. virtual void Flush() = 0;
  39. virtual void StopAllSounds() = 0;
  40. virtual int GetFreeSoundId() = 0;
  41. virtual int GetNumSounds() = 0;
  42. };
  43. NS_BF_END;