Elevate Engine 1
Loading...
Searching...
No Matches
SoundEngine.cpp
Go to the documentation of this file.
1#include "SoundEngine.h"
2
3#include <format>
6
7Elevate::SoundEngine* Elevate::SoundEngine::Impl = nullptr;
8
9// Return given arguments if no soundengine is used or no valid implementation is provided.
10#define EE_CHECK_SOUNDENGINE(...) if(EE_NO_SOUNDENGINE == 1 || !Impl) { return __VA_ARGS__; }
11
13{
14 EE_CORE_CWARN(!Impl, "Error : No valid SoundEngine impl. found. Using a null SoundEngine.");
16 bool result = Impl->InitImpl();
17 EE_CERROR(!result, "Error (SoundEngine::Init) : Could not initialize the sound engine.");
18 return result;
19 // todo register to native window callbacks
20}
21
23{
25 Impl->RenderAudioImpl();
26}
27
29{
31 Impl->TerminateImpl();
32}
33
35{
37 Impl->SetDefaultListenerImpl(obj);
38}
39
41{
43 Impl->SetDistanceProbeImpl(obj);
44}
45
47{
49 Impl->UnsetDistanceProbeImpl();
50}
51
53{
55 Impl->RegisterGameObjectImpl(obj);
56}
57
59{
61 Impl->UnregisterGameObjectImpl(obj);
62}
63
65{
67 Impl->UpdateObjectPositionImpl(obj);
68}
69
70void Elevate::SoundEngine::PostEvent(const char* eventName, GameObject* object)
71{
73 Impl->PostEventImpl(eventName, object);
74}
75
76void Elevate::SoundEngine::PostEvent(uint32_t eventId, GameObject* object)
77{
79 Impl->PostEventImpl(eventId, object);
80}
81
82void Elevate::SoundEngine::PostEvent(const char* eventName)
83{
85 Impl->PostEventImpl(eventName);
86}
87
88void Elevate::SoundEngine::PostEvent(uint32_t eventId)
89{
91 Impl->PostEventImpl(eventId);
92}
93
95{
97 Impl->WakeUpImpl();
98}
99
100void Elevate::SoundEngine::Suspend(bool renderAnyway, bool fadeOut)
101{
103 Impl->SuspendImpl(renderAnyway, fadeOut);
104}
105
#define EE_CERROR(condition,...)
Definition Log.h:75
#define EE_CHECK_SOUNDENGINE(...)
static void UpdatePosition(GameObject *obj)
static SoundEngine * GetImpl()
static void Terminate()
static void PostEvent(const char *eventName, GameObject *object)
static void SetDistanceProbe(GameObject *obj)
static void UnregisterGameObject(GameObject *obj)
static void SetDefaultListener(GameObject *obj)
static void Suspend(bool renderAnyway=false, bool fadeOut=true)
static void RegisterGameObject(GameObject *obj)
static void Wakeup()
virtual bool InitImpl()=0
static void RenderAudio()
static void UnsetDistanceProbe()