Plasma Engine  2.0
Loading...
Searching...
No Matches
AudioSystemData.h
1#pragma once
2
3#include <AudioSystemPlugin/AudioSystemPluginDLL.h>
4
5#include <Foundation/Reflection/Reflection.h>
6#include <Foundation/Types/Types.h>
7
8using plAudioSystemDataID = plUInt64;
9using plAudioSystemControlID = plUInt64;
10
13constexpr plAudioSystemDataID kInvalidAudioSystemId = 0;
14
16struct PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemTransform
17{
19 plVec3 m_vPosition{0, 0, 0};
20
22 plVec3 m_vVelocity{0, 0, 0};
23
25 plVec3 m_vForward{0, 0, 0};
26
28 plVec3 m_vUp{0, 0, 0};
29
30 bool operator==(const plAudioSystemTransform& rhs) const
31 {
32 return m_vPosition == rhs.m_vPosition && m_vForward == rhs.m_vForward && m_vUp == rhs.m_vUp && m_vVelocity == rhs.m_vVelocity;
33 }
34
35 bool operator!=(const plAudioSystemTransform& rhs) const
36 {
37 return !(*this == rhs);
38 }
39};
40
41template <>
43{
44 PL_ALWAYS_INLINE static plUInt32 Hash(const plAudioSystemTransform& value)
45 {
53 }
54
55 PL_ALWAYS_INLINE static bool Equal(const plAudioSystemTransform& a, const plAudioSystemTransform& b)
56 {
57 return a == b;
58 }
59};
60
61PL_DECLARE_REFLECTABLE_TYPE(PL_AUDIOSYSTEMPLUGIN_DLL, plAudioSystemTransform);
62
65struct PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemSoundObstructionType
66{
67 using StorageType = plUInt8;
68
69 enum Enum : StorageType
70 {
73 None = 0,
74
80
84
85 Default = SingleRay
86 };
87
88 PL_ENUM_TO_STRING(None, SingleRay, MultipleRay);
89};
90
91PL_DECLARE_REFLECTABLE_TYPE(PL_AUDIOSYSTEMPLUGIN_DLL, plAudioSystemSoundObstructionType);
92
94struct PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemTriggerState
95{
96 using StorageType = plUInt8;
97
98 enum Enum : StorageType
99 {
102 Invalid = 0,
103
105 Playing = 1,
106
109 Ready = 2,
110
112 Loading = 3,
113
115 Unloading = 4,
116
118 Starting = 5,
119
121 Stopping = 6,
122
124 Stopped = 7,
125
126 Default = Invalid,
127 };
128
129 PL_ENUM_TO_STRING(Invalid, Playing, Ready, Loading, Unloading, Starting, Stopping, Stopped);
130};
131
132PL_DECLARE_REFLECTABLE_TYPE(PL_AUDIOSYSTEMPLUGIN_DLL, plAudioSystemTriggerState);
133
135enum class plAudioSystemEventState : plUInt8
136{
139 Invalid = 0,
140
142 Playing = 1,
143
145 Loading = 2,
146
148 Unloading = 3,
149};
150
152class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemEntityData : public plReflectedClass
153{
154 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemEntityData, plReflectedClass);
155
156public:
157 ~plAudioSystemEntityData() override = default;
158};
159
161class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemListenerData : public plReflectedClass
162{
163 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemListenerData, plReflectedClass);
164
165public:
166 ~plAudioSystemListenerData() override = default;
167};
168
170class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemTriggerData : public plReflectedClass
171{
172 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemTriggerData, plReflectedClass);
173
174public:
175 ~plAudioSystemTriggerData() override = default;
176};
177
179class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemRtpcData : public plReflectedClass
180{
181 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemRtpcData, plReflectedClass);
182
183public:
184 ~plAudioSystemRtpcData() override = default;
185};
186
188class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemSwitchStateData : public plReflectedClass
189{
190 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemSwitchStateData, plReflectedClass);
191
192public:
193 ~plAudioSystemSwitchStateData() override = default;
194};
195
197class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemEnvironmentData : public plReflectedClass
198{
199 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemEnvironmentData, plReflectedClass);
200
201public:
202 ~plAudioSystemEnvironmentData() override = default;
203};
204
206class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemEventData : public plReflectedClass
207{
208 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemEventData, plReflectedClass);
209
210 ~plAudioSystemEventData() override = default;
211};
212
214class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemSourceData : public plReflectedClass
215{
216 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemSourceData, plReflectedClass);
217
218public:
219 ~plAudioSystemSourceData() override = default;
220};
221
223class PL_AUDIOSYSTEMPLUGIN_DLL plAudioSystemBankData : public plReflectedClass
224{
225 PL_ADD_DYNAMIC_REFLECTION(plAudioSystemBankData, plReflectedClass);
226
227public:
228 ~plAudioSystemBankData() override = default;
229};
Base class for an audio middleware bank file.
Definition AudioSystemData.h:224
Base class for an audio middleware entity.
Definition AudioSystemData.h:153
Base class for an audio middleware environment.
Definition AudioSystemData.h:198
Base class for an audio middleware event.
Definition AudioSystemData.h:207
Base class for an audio middleware listener.
Definition AudioSystemData.h:162
Base class for an audio middleware RTPC.
Definition AudioSystemData.h:180
Base class for an audio middleware source.
Definition AudioSystemData.h:215
Base class for an audio middleware switch state.
Definition AudioSystemData.h:189
Base class for an audio middleware trigger.
Definition AudioSystemData.h:171
static constexpr plUInt32 CombineHashValues32(plUInt32 ui0, plUInt32 ui1)
Combines two 32 bit hash values into one.
Definition HashingUtils_inl.h:144
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
constexpr plInt32 FloatToInt(float value)
Casts the float to an integer, removes the fractional part.
Definition Math_inl.h:462
The obstruction type applied to a sound. This affects the way that ray casting works for an audio sou...
Definition AudioSystemData.h:66
Enum
Definition AudioSystemData.h:70
@ MultipleRay
Multiple rays are shot at each frame. The occlusion and obstructions values will be averaged over tim...
Definition AudioSystemData.h:83
@ SingleRay
Only one ray is shot at each frame. The occlusion value will be averaged over time....
Definition AudioSystemData.h:79
Stores the transformation data for an audio entity.
Definition AudioSystemData.h:17
plVec3 m_vPosition
The position of the entity in world space.
Definition AudioSystemData.h:19
plVec3 m_vVelocity
The velocity of the entity.
Definition AudioSystemData.h:22
plVec3 m_vUp
The up direction of the entity in world space.
Definition AudioSystemData.h:28
plVec3 m_vForward
The forward direction of the entity in world space.
Definition AudioSystemData.h:25
The state of an audio trigger.
Definition AudioSystemData.h:95
Enum
Definition AudioSystemData.h:99
Helper struct to calculate the Hash of different types.
Definition HashingUtils.h:75