From f3eeedc91a04ca0651e0fe78a2119e7e3e38e391 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 25 Sep 2024 17:36:31 +0200 Subject: WIP Audio API + facade --- src/crepe/Sound.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/crepe/Sound.h (limited to 'src/crepe/Sound.h') 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 + +#include + +#include "api/Resource.h" + +namespace crepe { + +class Sound { +public: + Sound(std::unique_ptr 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 _res; + SoLoud::handle _handle; + bool _paused; +}; + +} + -- cgit v1.2.3