From a6cb810a92cd31268e0a822e4467b49668681f5f Mon Sep 17 00:00:00 2001 From: GreemDev Date: Tue, 27 Jan 2026 17:34:51 -0600 Subject: [PATCH] audio backend projects code cleanup --- .../OpenALHardwareDeviceDriver.cs | 5 +++-- .../OpenALHardwareDeviceSession.cs | 5 +++-- src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs | 4 ++-- src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceSession.cs | 4 ++-- .../SoundIoHardwareDeviceDriver.cs | 4 ++-- .../SoundIoHardwareDeviceSession.cs | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceDriver.cs index 18965dfaf..538088b6b 100644 --- a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceDriver.cs +++ b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceDriver.cs @@ -10,7 +10,8 @@ using static Ryujinx.Audio.Integration.IHardwareDeviceDriver; namespace Ryujinx.Audio.Backends.OpenAL { - public class OpenALHardwareDeviceDriver : IHardwareDeviceDriver + // ReSharper disable once InconsistentNaming + public sealed class OpenALHardwareDeviceDriver : IHardwareDeviceDriver { private readonly ALDevice _device; private readonly ALContext _context; @@ -148,7 +149,7 @@ namespace Ryujinx.Audio.Backends.OpenAL Dispose(true); } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing) { diff --git a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs index 7292450a6..61fb4a369 100644 --- a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs +++ b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs @@ -9,7 +9,8 @@ using System.Threading; namespace Ryujinx.Audio.Backends.OpenAL { - class OpenALHardwareDeviceSession : HardwareDeviceSessionOutputBase + // ReSharper disable once InconsistentNaming + sealed class OpenALHardwareDeviceSession : HardwareDeviceSessionOutputBase { private readonly OpenALHardwareDeviceDriver _driver; private readonly int _sourceId; @@ -190,7 +191,7 @@ namespace Ryujinx.Audio.Backends.OpenAL } } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing && _driver.Unregister(this)) { diff --git a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs index acd1582ec..35ff79f16 100644 --- a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs +++ b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceDriver.cs @@ -12,7 +12,7 @@ using static SDL2.SDL; namespace Ryujinx.Audio.Backends.SDL2 { - public class SDL2HardwareDeviceDriver : IHardwareDeviceDriver + public sealed class SDL2HardwareDeviceDriver : IHardwareDeviceDriver { private readonly ManualResetEvent _updateRequiredEvent; private readonly ManualResetEvent _pauseEvent; @@ -164,7 +164,7 @@ namespace Ryujinx.Audio.Backends.SDL2 Dispose(true); } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing) { diff --git a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceSession.cs b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceSession.cs index 9170b73c7..5f7f4b411 100644 --- a/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceSession.cs +++ b/src/Ryujinx.Audio.Backends.SDL2/SDL2HardwareDeviceSession.cs @@ -11,7 +11,7 @@ using static SDL2.SDL; namespace Ryujinx.Audio.Backends.SDL2 { - class SDL2HardwareDeviceSession : HardwareDeviceSessionOutputBase + sealed class SDL2HardwareDeviceSession : HardwareDeviceSessionOutputBase { private readonly SDL2HardwareDeviceDriver _driver; private readonly ConcurrentQueue _queuedBuffers; @@ -211,7 +211,7 @@ namespace Ryujinx.Audio.Backends.SDL2 return driverBuffer.DriverIdentifier != buffer.DataPointer; } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing && _driver.Unregister(this)) { diff --git a/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceDriver.cs b/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceDriver.cs index 76480d7eb..35be21321 100644 --- a/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceDriver.cs +++ b/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceDriver.cs @@ -10,7 +10,7 @@ using static Ryujinx.Audio.Integration.IHardwareDeviceDriver; namespace Ryujinx.Audio.Backends.SoundIo { - public class SoundIoHardwareDeviceDriver : IHardwareDeviceDriver + public sealed class SoundIoHardwareDeviceDriver : IHardwareDeviceDriver { private readonly SoundIoContext _audioContext; private readonly SoundIoDeviceContext _audioDevice; @@ -227,7 +227,7 @@ namespace Ryujinx.Audio.Backends.SoundIo } } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing) { diff --git a/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs b/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs index c751a31a5..74255bb95 100644 --- a/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs +++ b/src/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs @@ -11,7 +11,7 @@ using static Ryujinx.Audio.Backends.SoundIo.Native.SoundIo; namespace Ryujinx.Audio.Backends.SoundIo { - class SoundIoHardwareDeviceSession : HardwareDeviceSessionOutputBase + sealed class SoundIoHardwareDeviceSession : HardwareDeviceSessionOutputBase { private readonly SoundIoHardwareDeviceDriver _driver; private readonly ConcurrentQueue _queuedBuffers; @@ -428,7 +428,7 @@ namespace Ryujinx.Audio.Backends.SoundIo } } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing && _driver.Unregister(this)) {