aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-02-22 16:58:33 -0300
committerGitHub <noreply@github.com>2024-02-22 16:58:33 -0300
commitd4d0a48bfe89d6e8e12ce16829bb2c440b56007c (patch)
tree2376566ed2c06181b3dbc547b1f99f5b533d918b /src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
parent57d8afd0c99bb43d1ba1e3cc630d257c5da92741 (diff)
Migrate Audio service to new IPC (#6285)1.1.1211
* Migrate audren to new IPC * Migrate audout * Migrate audin * Migrate hwopus * Bye bye old audio service * Switch volume control to IHardwareDeviceDriver * Somewhat unrelated changes * Remove Concentus reference from HLE * Implement OpenAudioRendererForManualExecution * Remove SetVolume/GetVolume methods that are not necessary * Remove SetVolume/GetVolume methods that are not necessary (2) * Fix incorrect volume update * PR feedback * PR feedback * Stub audrec * Init outParameter * Make FinalOutputRecorderParameter/Internal readonly * Make FinalOutputRecorder IDisposable * Fix HardwareOpusDecoderManager parameter buffers * Opus work buffer size and error handling improvements * Add AudioInProtocolName enum * Fix potential divisions by zero
Diffstat (limited to 'src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs')
-rw-r--r--src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
index b83e63db..e39bfe54 100644
--- a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
+++ b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs
@@ -20,6 +20,8 @@ namespace Ryujinx.Audio.Backends.SDL2
private readonly bool _supportSurroundConfiguration;
+ public float Volume { get; set; }
+
// TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec.
#pragma warning disable SYSLIB1054
@@ -48,6 +50,8 @@ namespace Ryujinx.Audio.Backends.SDL2
{
_supportSurroundConfiguration = spec.channels >= 6;
}
+
+ Volume = 1f;
}
public static bool IsSupported => IsSupportedInternal();
@@ -74,7 +78,7 @@ namespace Ryujinx.Audio.Backends.SDL2
return _pauseEvent;
}
- public IHardwareDeviceSession OpenDeviceSession(Direction direction, IVirtualMemoryManager memoryManager, SampleFormat sampleFormat, uint sampleRate, uint channelCount, float volume)
+ public IHardwareDeviceSession OpenDeviceSession(Direction direction, IVirtualMemoryManager memoryManager, SampleFormat sampleFormat, uint sampleRate, uint channelCount)
{
if (channelCount == 0)
{
@@ -91,7 +95,7 @@ namespace Ryujinx.Audio.Backends.SDL2
throw new NotImplementedException("Input direction is currently not implemented on SDL2 backend!");
}
- SDL2HardwareDeviceSession session = new(this, memoryManager, sampleFormat, sampleRate, channelCount, volume);
+ SDL2HardwareDeviceSession session = new(this, memoryManager, sampleFormat, sampleRate, channelCount);
_sessions.TryAdd(session, 0);