3#include <AudioSystemPlugin/AudioSystemPluginDLL.h>
5#include <AudioSystemPlugin/ATL/AudioTranslationLayer.h>
6#include <AudioSystemPlugin/Core/AudioSystemData.h>
7#include <AudioSystemPlugin/Core/AudioThread.h>
9#include <Core/GameApplication/GameApplicationBase.h>
10#include <Core/Interfaces/SoundInterface.h>
12#include <Foundation/Configuration/Singleton.h>
13#include <Foundation/Threading/Semaphore.h>
44 float GetMasterChannelVolume()
const override;
50 bool GetMasterChannelMute()
const override;
56 bool GetMasterChannelPaused()
const override;
62 float GetSoundGroupVolume(
plStringView sVcaGroupGuid)
const override;
68 plUInt8 GetNumListeners()
override;
90 [[nodiscard]]
bool IsInitialized()
const;
95 void SendRequestSync(
plVariant&& request);
97 plAudioSystemDataID GetTriggerId(
plStringView sTriggerName)
const;
99 plAudioSystemDataID GetRtpcId(
plStringView sRtpcName)
const;
101 plAudioSystemDataID GetSwitchStateId(
plStringView sSwitchStateName)
const;
103 plAudioSystemDataID GetEnvironmentId(
plStringView sEnvironmentName)
const;
105 plAudioSystemDataID GetBankId(
plStringView sBankName)
const;
113 void UnregisterEntity(plAudioSystemDataID uiId);
114 void UnregisterListener(plAudioSystemDataID uiId);
115 void UnregisterTrigger(plAudioSystemDataID uiId);
116 void UnregisterRtpc(plAudioSystemDataID uiId);
117 void UnregisterSwitchState(plAudioSystemDataID uiId);
118 void UnregisterEnvironment(plAudioSystemDataID uiId);
119 void UnregisterSoundBank(plAudioSystemDataID uiId);
122 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(AudioSystem, AudioSystemPlugin);
129 void UpdateInternal();
131 void StartAudioThread();
132 void StopAudioThread();
134 void QueueRequestCallback(
plVariant&& request,
bool bSync);
145 mutable plMutex m_RequestsMutex;
146 mutable plMutex m_PendingRequestsMutex;
147 mutable plMutex m_BlockingRequestsMutex;
148 mutable plMutex m_PendingRequestCallbacksMutex;
149 mutable plMutex m_BlockingRequestCallbacksMutex;
156 bool m_bListenerOverrideMode;
Base class for an audio middleware bank file.
Definition AudioSystemData.h:224
Base class for an audio middleware environment.
Definition AudioSystemData.h:198
The AudioSystem.
Definition AudioSystem.h:23
void SetNumListeners(plUInt8 uiNumListeners) override
Asks the audio middleware to set the required number of listeners.
Definition AudioSystem.h:65
Base class for an audio middleware RTPC.
Definition AudioSystemData.h:180
Base class for an audio middleware switch state.
Definition AudioSystemData.h:189
Base class for an audio middleware trigger.
Definition AudioSystemData.h:171
The audio thread. Responsible to process asynchronous audio requests.
Definition AudioThread.h:9
The Audio Translation Layer.
Definition AudioTranslationLayer.h:17
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
A semaphore is used to synchronize threads, similar to a mutex (see plMutex).
Definition Semaphore.h:17
Definition SoundInterface.h:7
virtual void SetMasterChannelMute(bool bMute)=0
Allows to mute all sounds. Useful for when the application goes to a background state.
virtual void SetSoundGroupVolume(plStringView sVcaGroupGuid, float fVolume)=0
Specifies the volume for a VCA ('Voltage Control Amplifier').
virtual void SetOverridePlatform(plStringView sPlatform)=0
By default the integration should auto-detect the platform (and thus the config) to use....
virtual void SetListenerOverrideMode(bool bEnabled)=0
The editor activates this to ignore the listener positions from the listener components,...
virtual void SetMasterChannelVolume(float fVolume)=0
Adjusts the master volume. This affects all sounds, with no exception. Value must be between 0....
virtual void UpdateSound()=0
Has to be called once per frame to update all sounds.
virtual void LoadConfiguration(plStringView sFile)=0
Can be called before startup to load the configs from a different file. Otherwise will automatically ...
virtual void SetMasterChannelPaused(bool bPaused)=0
Allows to pause all sounds. Useful for when the application goes to a background state and you want t...
virtual void SetListener(plInt32 iIndex, const plVec3 &vPosition, const plVec3 &vForward, const plVec3 &vUp, const plVec3 &vVelocity)=0
Sets the position for listener N. Index -1 is used for the override mode listener.
virtual plResult OneShotSound(plStringView sResourceID, const plTransform &globalPosition, float fPitch=1.0f, float fVolume=1.0f, bool bBlockIfNotLoaded=true)=0
Plays a sound once. Callced by plSoundInterface::PlaySound().
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition GameApplicationBase.h:32
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54