aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AudioSystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/AudioSystem.h')
-rw-r--r--src/crepe/system/AudioSystem.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/crepe/system/AudioSystem.h b/src/crepe/system/AudioSystem.h
index e037f51..7f41fda 100644
--- a/src/crepe/system/AudioSystem.h
+++ b/src/crepe/system/AudioSystem.h
@@ -1,6 +1,7 @@
#pragma once
#include "../facade/SoundContext.h"
+#include "../api/AudioSource.h"
#include "System.h"
@@ -12,6 +13,26 @@ public:
void update() override;
private:
+ /**
+ * \brief Private data stored by AudioSystem on AudioSource component
+ */
+ struct ComponentPrivate {
+ //! This sample's voice handle
+ SoLoud::handle handle;
+
+ //! Value of \c active after last system update
+ bool last_active = false;
+ //! Value of \c playing after last system update
+ bool last_playing = false;
+ //! Value of \c volume after last system update
+ float last_volume = 1.0;
+ //! Value of \c loop after last system update
+ bool last_loop = false;
+ };
+
+ void update_private(const AudioSource & component, ComponentPrivate & data);
+
+private:
SoundContext context {};
};