diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-25 17:36:31 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-25 17:36:31 +0200 |
commit | f3eeedc91a04ca0651e0fe78a2119e7e3e38e391 (patch) | |
tree | fc2265ccc90abcefbdf2eb7670eb2c30c56da300 /src/crepe/Sound.h | |
parent | f4560e02f703f1c6f857c8e5af63fa9fc4ca6438 (diff) |
WIP Audio API + facade
Diffstat (limited to 'src/crepe/Sound.h')
-rw-r--r-- | src/crepe/Sound.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/crepe/Sound.h b/src/crepe/Sound.h new file mode 100644 index 0000000..ac4b7f4 --- /dev/null +++ b/src/crepe/Sound.h @@ -0,0 +1,30 @@ +#pragma once + +#include <soloud.h> + +#include <memory> + +#include "api/Resource.h" + +namespace crepe { + +class Sound { +public: + Sound(std::unique_ptr<api::Resource> res); + virtual ~Sound() = default; + +public: + void pause(); + void play(); + void rewind(); + void set_volume(float volume); + void set_looping(bool looping); + +private: + std::unique_ptr<api::Resource> _res; + SoLoud::handle _handle; + bool _paused; +}; + +} + |