aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AudioSystem.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-29 17:30:45 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-29 17:30:45 +0100
commit693355f55193cb2ea4c29616073227e37665afc1 (patch)
tree37d2bd3e916b909fbac58ae836e8001166edf384 /src/crepe/system/AudioSystem.h
parentc59d460f12e1393e0ddbaaa1c6f5522eb12f8ff9 (diff)
more audio system WIP
Diffstat (limited to 'src/crepe/system/AudioSystem.h')
-rw-r--r--src/crepe/system/AudioSystem.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/crepe/system/AudioSystem.h b/src/crepe/system/AudioSystem.h
index 7f41fda..4650178 100644
--- a/src/crepe/system/AudioSystem.h
+++ b/src/crepe/system/AudioSystem.h
@@ -1,6 +1,7 @@
#pragma once
#include "../facade/SoundContext.h"
+#include "../facade/Sound.h"
#include "../api/AudioSource.h"
#include "System.h"
@@ -18,19 +19,22 @@ private:
*/
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;
+ Sound::Handle handle;
+
+ /**
+ * \name State diffing variables
+ * \{
+ */
+ typeof(AudioSource::active) last_active;
+ typeof(AudioSource::playing) last_playing;
+ typeof(AudioSource::volume) last_volume;
+ typeof(AudioSource::loop) last_loop;
+ //! \}
};
- void update_private(const AudioSource & component, ComponentPrivate & data);
+ void update_last(const AudioSource & component, ComponentPrivate & data);
+
+ void diff_update(AudioSource & component, const ComponentPrivate & data, Sound & resource);
private:
SoundContext context {};