diff options
Diffstat (limited to 'Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs')
-rw-r--r-- | Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs b/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs index e15165b9..303de9bb 100644 --- a/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs +++ b/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs @@ -78,7 +78,7 @@ namespace Ryujinx.Audio.Renderer.Dsp } } - public void Start(IHardwareDeviceDriver deviceDriver) + public void Start(IHardwareDeviceDriver deviceDriver, float volume) { OutputDevices = new IHardwareDevice[Constants.AudioRendererSessionCountMax]; @@ -89,7 +89,7 @@ namespace Ryujinx.Audio.Renderer.Dsp for (int i = 0; i < OutputDevices.Length; i++) { // TODO: Don't hardcode sample rate. - OutputDevices[i] = new HardwareDeviceImpl(deviceDriver, channelCount, Constants.TargetSampleRate); + OutputDevices[i] = new HardwareDeviceImpl(deviceDriver, channelCount, Constants.TargetSampleRate, volume); } _mailbox = new Mailbox<MailboxMessage>(); @@ -245,6 +245,33 @@ namespace Ryujinx.Audio.Renderer.Dsp _mailbox.SendResponse(MailboxMessage.Stop); } + public float GetVolume() + { + if (OutputDevices != null) + { + foreach (IHardwareDevice outputDevice in OutputDevices) + { + if (outputDevice != null) + { + return outputDevice.GetVolume(); + } + } + } + + return 0f; + } + + public void SetVolume(float volume) + { + if (OutputDevices != null) + { + foreach (IHardwareDevice outputDevice in OutputDevices) + { + outputDevice?.SetVolume(volume); + } + } + } + public void Dispose() { Dispose(true); |