aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Sound.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-08 13:48:01 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-08 13:48:01 +0200
commit6b7a670d60fec808e4fd1fcf3a8df2c503dcbdf4 (patch)
treeaeb947a0001088ae2caddca85062845a276ceffb /src/crepe/Sound.h
parentc6cbde11c080c994577a7ebe4b966c25870dec1f (diff)
parent515aab5ab7e3281d2d77177724aae42cffc6faae (diff)
Merge branch 'loek/cleanup' of github.com:lonkaars/crepe
Diffstat (limited to 'src/crepe/Sound.h')
-rw-r--r--src/crepe/Sound.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/crepe/Sound.h b/src/crepe/Sound.h
index 163c5b4..1ac20a7 100644
--- a/src/crepe/Sound.h
+++ b/src/crepe/Sound.h
@@ -5,7 +5,7 @@
#include <memory>
-#include "api/Resource.h"
+#include "Asset.h"
namespace crepe {
@@ -46,24 +46,37 @@ public:
*/
void set_volume(float volume);
/**
+ * \brief Get playback volume / gain
+ *
+ * \return Volume
+ */
+ float get_volume() const { return this->volume; }
+ /**
* \brief Set looping behavior for this sample
*
* \param looping Looping behavior (false = one-shot, true = loop)
*/
void set_looping(bool looping);
+ /**
+ * \brief Get looping behavior
+ *
+ * \return true if looping, false if one-shot
+ */
+ bool get_looping() const { return this->looping; }
public:
Sound(const char * src);
- Sound(std::unique_ptr<api::Resource> res);
+ Sound(std::unique_ptr<Asset> res);
private:
- void load(std::unique_ptr<api::Resource> res);
+ void load(std::unique_ptr<Asset> res);
private:
- std::unique_ptr<api::Resource> res;
SoLoud::Wav sample;
SoLoud::handle handle;
-};
-}
+ float volume = 1.0f;
+ bool looping = false;
+};
+} // namespace crepe