BsOAAudioSource.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsOAPrerequisites.h"
  5. #include "BsAudioSource.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup OpenAudio
  9. * @{
  10. */
  11. /** OpenAL implementation of an AudioSource. */
  12. class BS_OA_EXPORT OAAudioSource : public AudioSource
  13. {
  14. public:
  15. OAAudioSource();
  16. virtual ~OAAudioSource();
  17. /** @copydoc AudioSource::setClip */
  18. void setClip(const HAudioClip& clip) override;
  19. /** @copydoc AudioSource::setPosition */
  20. void setPosition(const Vector3& position) override;
  21. /** @copydoc AudioSource::setVelocity */
  22. void setVelocity(const Vector3& velocity) override;
  23. /** @copydoc AudioSource::setVolume */
  24. void setVolume(float volume) override;
  25. /** @copydoc AudioSource::setPitch */
  26. void setPitch(float pitch) override;
  27. /** @copydoc AudioSource::setIsLooping */
  28. void setIsLooping(bool loop) override;
  29. /** @copydoc AudioSource::setPriority */
  30. void setPriority(UINT32 priority) override;
  31. /** @copydoc AudioSource::setMinDistance */
  32. void setMinDistance(float distance) override;
  33. /** @copydoc AudioSource::setAttenuation */
  34. void setAttenuation(float attenuation) override;
  35. /** @copydoc AudioSource::play */
  36. void play() override;
  37. /** @copydoc AudioSource::pause */
  38. void pause() override;
  39. /** @copydoc AudioSource::stop */
  40. void stop() override;
  41. private:
  42. friend class OAAudio;
  43. /** Destroys the internal representation of the audio source. */
  44. void clear();
  45. /** Rebuilds the internal representation of an audio source. */
  46. void rebuild();
  47. Vector<UINT32> mSourceIDs;
  48. };
  49. /** @} */
  50. }