aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/SoundEffect.hpp
diff options
context:
space:
mode:
author Nemrav <50055236+Nemrav@users.noreply.github.com>2024-08-03 21:38:25 +0200
committer GitHub <noreply@github.com>2024-08-03 21:38:25 +0200
commitadc7eb8ad07170ba8da18f684321a92d01447c2c (patch)
treeeedd074580ff5a81b4eff4b8bc43163b7cf59f0e /src/openvic-simulation/misc/SoundEffect.hpp
parent1f42a6255226b79d271df5060a8391f4ea00fc0a (diff)
parent0b4732befaaf4a742acb319256c535eb449668a7 (diff)
Merge pull request #181 from OpenVicProject/sim_music
Music and Sound Effect define loading
Diffstat (limited to 'src/openvic-simulation/misc/SoundEffect.hpp')
-rw-r--r--src/openvic-simulation/misc/SoundEffect.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/openvic-simulation/misc/SoundEffect.hpp b/src/openvic-simulation/misc/SoundEffect.hpp
new file mode 100644
index 0000000..7f18dce
--- /dev/null
+++ b/src/openvic-simulation/misc/SoundEffect.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <openvic-simulation/types/fixed_point/FixedPoint.hpp>
+#include <openvic-simulation/types/IdentifierRegistry.hpp>
+
+namespace OpenVic {
+ /*For interface/Sound.sfx */
+ struct SoundEffectManager;
+ struct SoundEffect : HasIdentifier {
+ private:
+ friend struct SoundEffectManager;
+ std::string PROPERTY(file);
+ fixed_point_t PROPERTY(volume);
+ SoundEffect(std::string_view new_identifier, std::string_view new_file, fixed_point_t new_volume);
+
+ public:
+ SoundEffect(SoundEffect&&) = default;
+ };
+
+ struct SoundEffectManager {
+
+ private:
+ IdentifierRegistry<SoundEffect> IDENTIFIER_REGISTRY(sound_effect);
+ bool _load_sound_define(std::string_view sfx_identifier, ast::NodeCPtr root);
+
+ public:
+ bool load_sound_defines_file(ast::NodeCPtr root);
+ };
+} \ No newline at end of file