Plasma Engine  2.0
Loading...
Searching...
No Matches
SoundInterface.h
1#pragma once
2
3#include <Core/CoreDLL.h>
4#include <Foundation/Basics.h>
5
7{
8public:
11 virtual void LoadConfiguration(plStringView sFile) = 0;
12
15 virtual void SetOverridePlatform(plStringView sPlatform) = 0;
16
18 virtual void UpdateSound() = 0;
19
21 virtual void SetMasterChannelVolume(float fVolume) = 0;
22 virtual float GetMasterChannelVolume() const = 0;
23
25 virtual void SetMasterChannelMute(bool bMute) = 0;
26 virtual bool GetMasterChannelMute() const = 0;
27
30 virtual void SetMasterChannelPaused(bool bPaused) = 0;
31 virtual bool GetMasterChannelPaused() const = 0;
32
37 virtual void SetSoundGroupVolume(plStringView sVcaGroupGuid, float fVolume) = 0;
38 virtual float GetSoundGroupVolume(plStringView sVcaGroupGuid) const = 0;
39
41 virtual void SetNumListeners(plUInt8 uiNumListeners) = 0;
42 virtual plUInt8 GetNumListeners() = 0;
43
46 virtual void SetListenerOverrideMode(bool bEnabled) = 0;
47
49 virtual void SetListener(plInt32 iIndex, const plVec3& vPosition, const plVec3& vForward, const plVec3& vUp, const plVec3& vVelocity) = 0;
50
52 virtual plResult OneShotSound(plStringView sResourceID, const plTransform& globalPosition, float fPitch = 1.0f, float fVolume = 1.0f, bool bBlockIfNotLoaded = true) = 0;
53
69 PL_CORE_DLL static plResult PlaySound(plStringView sResourceID, const plTransform& globalPosition, float fPitch = 1.0f, float fVolume = 1.0f, bool bBlockIfNotLoaded = true);
70};
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').
static PL_CORE_DLL plResult PlaySound(plStringView sResourceID, const plTransform &globalPosition, float fPitch=1.0f, float fVolume=1.0f, bool bBlockIfNotLoaded=true)
Plays a sound once.
Definition SoundInterface.cpp:6
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 SetNumListeners(plUInt8 uiNumListeners)=0
Default is 1. Allows to set how many virtual listeners the sound is mixed for (split screen game play...
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
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54