From 85dbb9559ad317a657dafd24da27fec4b3f5250f Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 4 Dec 2018 14:23:37 -0600 Subject: Adjust naming conventions and general refactoring in HLE Project (#490) * Rename enum fields * Naming conventions * Remove unneeded ".this" * Remove unneeded semicolons * Remove unused Usings * Don't use var * Remove unneeded enum underlying types * Explicitly label class visibility * Remove unneeded @ prefixes * Remove unneeded commas * Remove unneeded if expressions * Method doesn't use unsafe code * Remove unneeded casts * Initialized objects don't need an empty constructor * Remove settings from DotSettings * Revert "Explicitly label class visibility" This reverts commit ad5eb5787cc5b27a4631cd46ef5f551c4ae95e51. * Small changes * Revert external enum renaming * Changes from feedback * Remove unneeded property setters --- .../Services/Aud/IHardwareOpusDecoderManager.cs | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 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 875dc74c..495c8ab4 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs @@ -5,68 +5,68 @@ namespace Ryujinx.HLE.HOS.Services.Aud { class IHardwareOpusDecoderManager : IpcService { - private Dictionary m_Commands; + private Dictionary _commands; - public override IReadOnlyDictionary Commands => m_Commands; + public override IReadOnlyDictionary Commands => _commands; public IHardwareOpusDecoderManager() { - m_Commands = new Dictionary() + _commands = new Dictionary { { 0, Initialize }, { 1, GetWorkBufferSize } }; } - public long Initialize(ServiceCtx Context) + public long Initialize(ServiceCtx context) { - int SampleRate = Context.RequestData.ReadInt32(); - int ChannelsCount = Context.RequestData.ReadInt32(); + int sampleRate = context.RequestData.ReadInt32(); + int channelsCount = context.RequestData.ReadInt32(); - MakeObject(Context, new IHardwareOpusDecoder(SampleRate, ChannelsCount)); + MakeObject(context, new IHardwareOpusDecoder(sampleRate, channelsCount)); return 0; } - public long GetWorkBufferSize(ServiceCtx Context) + public long GetWorkBufferSize(ServiceCtx context) { //Note: The sample rate is ignored because it is fixed to 48KHz. - int SampleRate = Context.RequestData.ReadInt32(); - int ChannelsCount = Context.RequestData.ReadInt32(); + int sampleRate = context.RequestData.ReadInt32(); + int channelsCount = context.RequestData.ReadInt32(); - Context.ResponseData.Write(GetOpusDecoderSize(ChannelsCount)); + context.ResponseData.Write(GetOpusDecoderSize(channelsCount)); return 0; } - private static int GetOpusDecoderSize(int ChannelsCount) + private static int GetOpusDecoderSize(int channelsCount) { - const int SilkDecoderSize = 0x2198; + const int silkDecoderSize = 0x2198; - if (ChannelsCount < 1 || ChannelsCount > 2) + if (channelsCount < 1 || channelsCount > 2) { return 0; } - int CeltDecoderSize = GetCeltDecoderSize(ChannelsCount); + int celtDecoderSize = GetCeltDecoderSize(channelsCount); - int OpusDecoderSize = (ChannelsCount * 0x800 + 0x4807) & -0x800 | 0x50; + int opusDecoderSize = (channelsCount * 0x800 + 0x4807) & -0x800 | 0x50; - return OpusDecoderSize + SilkDecoderSize + CeltDecoderSize; + return opusDecoderSize + silkDecoderSize + celtDecoderSize; } - private static int GetCeltDecoderSize(int ChannelsCount) + private static int GetCeltDecoderSize(int channelsCount) { - const int DecodeBufferSize = 0x2030; - const int CeltDecoderSize = 0x58; - const int CeltSigSize = 0x4; - const int Overlap = 120; - const int EBandsCount = 21; - - return (DecodeBufferSize + Overlap * 4) * ChannelsCount + - EBandsCount * 16 + - CeltDecoderSize + - CeltSigSize; + const int decodeBufferSize = 0x2030; + const int celtDecoderSize = 0x58; + const int celtSigSize = 0x4; + const int overlap = 120; + const int eBandsCount = 21; + + return (decodeBufferSize + overlap * 4) * channelsCount + + eBandsCount * 16 + + celtDecoderSize + + celtSigSize; } } } -- cgit v1.2.3