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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*!
  2. * \file include/system/SoundAL.h
  3. * \brief This is the OpenAL audio manager Header
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SOUND_AL_H_
  8. #define _SOUND_AL_H_
  9. #include <vector>
  10. class SoundAL {
  11. public:
  12. static int initialize();
  13. static void shutdown();
  14. static void clear();
  15. static int numBuffers();
  16. static int loadBuffer(unsigned char* buffer, unsigned int length);
  17. static int numSources(bool atListener);
  18. static int addSource(int buffer, float volume, bool atListener, bool loop);
  19. static int sourceAt(int source, glm::vec3 pos);
  20. static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up);
  21. static void play(int source, bool atListener);
  22. static void stop(int source);
  23. static void stopAll();
  24. static void setEnabled(bool on);
  25. static bool getEnabled();
  26. static void setVolume(float vol);
  27. static float getVolume();
  28. private:
  29. static bool init;
  30. static bool enabled;
  31. static float volume;
  32. static std::vector<unsigned int> buffers;
  33. static std::vector<unsigned int> sources;
  34. static std::vector<unsigned int> listenerSources;
  35. static glm::vec3 lastPosition;
  36. };
  37. #endif