aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Sound.h
diff options
context:
space:
mode:
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