From 311e98572c26750e4a4695079fa80ca5648d109e Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 1 Oct 2024 17:21:37 +0200 Subject: implement remaining Sound functions --- src/crepe/SoundSystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/crepe/SoundSystem.h') diff --git a/src/crepe/SoundSystem.h b/src/crepe/SoundSystem.h index da3927a..34dd6c5 100644 --- a/src/crepe/SoundSystem.h +++ b/src/crepe/SoundSystem.h @@ -12,7 +12,7 @@ private: virtual ~SoundSystem(); // singleton - static SoundSystem & instance(); + static SoundSystem & get_instance(); SoundSystem(const SoundSystem &) = delete; SoundSystem(SoundSystem &&) = delete; SoundSystem &operator=(const SoundSystem &) = delete; -- cgit v1.2.3 From fe9bf1344ceae0fac9144e4a28fdcdbcb2267850 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 1 Oct 2024 17:23:33 +0200 Subject: rename SoundSystem to SoundContext (1/2) --- src/crepe/SoundContext.cpp | 21 +++++++++++++++++++++ src/crepe/SoundContext.h | 27 +++++++++++++++++++++++++++ src/crepe/SoundSystem.cpp | 21 --------------------- src/crepe/SoundSystem.h | 27 --------------------------- 4 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 src/crepe/SoundContext.cpp create mode 100644 src/crepe/SoundContext.h delete mode 100644 src/crepe/SoundSystem.cpp delete mode 100644 src/crepe/SoundSystem.h (limited to 'src/crepe/SoundSystem.h') diff --git a/src/crepe/SoundContext.cpp b/src/crepe/SoundContext.cpp new file mode 100644 index 0000000..b57e51a --- /dev/null +++ b/src/crepe/SoundContext.cpp @@ -0,0 +1,21 @@ +#include "util/log.h" + +#include "SoundSystem.h" + +using namespace crepe; + +SoundSystem & SoundSystem::get_instance() { + static SoundSystem instance; + return instance; +} + +SoundSystem::SoundSystem() { + dbg_trace(); + engine.init(); +} + +SoundSystem::~SoundSystem() { + dbg_trace(); + engine.deinit(); +} + diff --git a/src/crepe/SoundContext.h b/src/crepe/SoundContext.h new file mode 100644 index 0000000..34dd6c5 --- /dev/null +++ b/src/crepe/SoundContext.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "Sound.h" + +namespace crepe { + +class SoundSystem { +private: + SoundSystem(); + virtual ~SoundSystem(); + + // singleton + static SoundSystem & get_instance(); + SoundSystem(const SoundSystem &) = delete; + SoundSystem(SoundSystem &&) = delete; + SoundSystem &operator=(const SoundSystem &) = delete; + SoundSystem &operator=(SoundSystem &&) = delete; + +private: + SoLoud::Soloud engine; + friend class Sound; +}; + +} + diff --git a/src/crepe/SoundSystem.cpp b/src/crepe/SoundSystem.cpp deleted file mode 100644 index b57e51a..0000000 --- a/src/crepe/SoundSystem.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "util/log.h" - -#include "SoundSystem.h" - -using namespace crepe; - -SoundSystem & SoundSystem::get_instance() { - static SoundSystem instance; - return instance; -} - -SoundSystem::SoundSystem() { - dbg_trace(); - engine.init(); -} - -SoundSystem::~SoundSystem() { - dbg_trace(); - engine.deinit(); -} - diff --git a/src/crepe/SoundSystem.h b/src/crepe/SoundSystem.h deleted file mode 100644 index 34dd6c5..0000000 --- a/src/crepe/SoundSystem.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include - -#include "Sound.h" - -namespace crepe { - -class SoundSystem { -private: - SoundSystem(); - virtual ~SoundSystem(); - - // singleton - static SoundSystem & get_instance(); - SoundSystem(const SoundSystem &) = delete; - SoundSystem(SoundSystem &&) = delete; - SoundSystem &operator=(const SoundSystem &) = delete; - SoundSystem &operator=(SoundSystem &&) = delete; - -private: - SoLoud::Soloud engine; - friend class Sound; -}; - -} - -- cgit v1.2.3