From 560ccbeb2d55a4426ad2827bf7534d4a695431c2 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Fri, 12 Jul 2019 03:13:43 +0200 Subject: Refactoring commands handling (#728) * Refactoring commands handling - Use Reflection to handle commands ID. - Add all symbols (from SwIPC so not all time accurate). - Re-sort some services commands methods. - Some cleanup. - Keep some empty constructor for consistency. * Fix order in IProfile --- .../Services/Aud/IHardwareOpusDecoderManager.cs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs') diff --git a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs index e66a9fe6..2724fb29 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs @@ -1,24 +1,12 @@ -using Ryujinx.HLE.HOS.Ipc; -using System.Collections.Generic; - namespace Ryujinx.HLE.HOS.Services.Aud { [Service("hwopus")] class IHardwareOpusDecoderManager : IpcService { - private Dictionary _commands; - - public override IReadOnlyDictionary Commands => _commands; - - public IHardwareOpusDecoderManager(ServiceCtx context) - { - _commands = new Dictionary - { - { 0, Initialize }, - { 1, GetWorkBufferSize } - }; - } + public IHardwareOpusDecoderManager(ServiceCtx context) { } + [Command(0)] + // Initialize(bytes<8, 4>, u32, handle) -> object public long Initialize(ServiceCtx context) { int sampleRate = context.RequestData.ReadInt32(); @@ -29,6 +17,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud return 0; } + [Command(1)] + // GetWorkBufferSize(bytes<8, 4>) -> u32 public long GetWorkBufferSize(ServiceCtx context) { // Note: The sample rate is ignored because it is fixed to 48KHz. @@ -70,4 +60,4 @@ namespace Ryujinx.HLE.HOS.Services.Aud celtSigSize; } } -} +} \ No newline at end of file -- cgit v1.2.3