Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SoundManager.h 955B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. * \file include/SoundManager.h
  3. * \brief This is the audio manager Header
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SOUNDMANAGER_H_
  8. #define _SOUNDMANAGER_H_
  9. #include <vector>
  10. struct SoundSource {
  11. float x, y, z;
  12. int id, flags;
  13. SoundSource(float _x, float _y, float _z, int i, int f)
  14. : x(_x), y(_y), z(_z), id(i), flags(f) { }
  15. };
  16. struct SoundDetail {
  17. int sample;
  18. float volume;
  19. SoundDetail(int s, float v) : sample(s), volume(v) { }
  20. };
  21. class SoundManager {
  22. public:
  23. void clear();
  24. void addSoundSource(float x, float y, float z, int id, int flags);
  25. void addSoundMapEntry(int id);
  26. void addSoundDetail(int sample, float volume);
  27. void addSampleIndex(int index);
  28. int playSound(int index);
  29. private:
  30. std::vector<SoundSource> soundSources;
  31. std::vector<int> soundMap;
  32. std::vector<SoundDetail> soundDetails;
  33. std::vector<int> sampleIndices;
  34. };
  35. SoundManager& getSoundManager();
  36. #endif