[Ryujinx.Audio] Address dotnet-format issues (#5362)

* dotnet format style --severity info

Some changes were manually reverted.

* dotnet format analyzers --serverity info

Some changes have been minimally adapted.

* Restore a few unused methods and variables

* Silence dotnet format IDE0060 warnings

* Silence dotnet format IDE0052 warnings

* Address dotnet format CA1816 warnings

* Address or silence dotnet format CA2208 warnings

* Address or silence dotnet format CA2211 warnings

* Address review comments

* Address most dotnet format whitespace warnings

* Apply dotnet format whitespace formatting

A few of them have been manually reverted and the corresponding warning was silenced

* Format if-blocks correctly

* Run dotnet format whitespace after rebase

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Add comments to disabled warnings

* Remove a few unused parameters

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Start working on disabled warnings

* Fix and silence a few dotnet-format warnings again

* Address IDE0251 warnings

* Silence IDE0060 in .editorconfig

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* Fix naming rule violations, remove redundant code and fix build issues

* Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Add trailing commas

* Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Address review feedback

---------

Co-authored-by: Ac_K <Acoustik666@gmail.com>
This commit is contained in:
TSRBerry
2023-07-02 01:27:18 +02:00
committed by GitHub
parent 0684b00b3c
commit 515fc32b21
207 changed files with 1354 additions and 1670 deletions

View File

@@ -17,14 +17,14 @@ namespace Ryujinx.Audio.Renderer.Server
{
public class CommandGenerator
{
private CommandBuffer _commandBuffer;
private RendererSystemContext _rendererContext;
private VoiceContext _voiceContext;
private MixContext _mixContext;
private EffectContext _effectContext;
private SinkContext _sinkContext;
private SplitterContext _splitterContext;
private PerformanceManager _performanceManager;
private readonly CommandBuffer _commandBuffer;
private readonly RendererSystemContext _rendererContext;
private readonly VoiceContext _voiceContext;
private readonly MixContext _mixContext;
private readonly EffectContext _effectContext;
private readonly SinkContext _sinkContext;
private readonly SplitterContext _splitterContext;
private readonly PerformanceManager _performanceManager;
public CommandGenerator(CommandBuffer commandBuffer, RendererSystemContext rendererContext, VoiceContext voiceContext, MixContext mixContext, EffectContext effectContext, SinkContext sinkContext, SplitterContext splitterContext, PerformanceManager performanceManager)
{
@@ -138,7 +138,7 @@ namespace Ryujinx.Audio.Renderer.Server
if (supportsOptimizedPath && voiceState.BiquadFilters[0].Enable && voiceState.BiquadFilters[1].Enable)
{
Memory<byte> biquadStateRawMemory = SpanMemoryManager<byte>.Cast(state).Slice(VoiceUpdateState.BiquadStateOffset, VoiceUpdateState.BiquadStateSize * Constants.VoiceBiquadFilterCount);
Memory<byte> biquadStateRawMemory = SpanMemoryManager<byte>.Cast(state)[..(VoiceUpdateState.BiquadStateSize * Constants.VoiceBiquadFilterCount)];
Memory<BiquadFilterState> stateMemory = SpanMemoryManager<BiquadFilterState>.Cast(biquadStateRawMemory);
_commandBuffer.GenerateGroupedBiquadFilter(baseIndex, voiceState.BiquadFilters.AsSpan(), stateMemory, bufferOffset, bufferOffset, voiceState.BiquadFilterNeedInitialization, nodeId);
@@ -151,7 +151,7 @@ namespace Ryujinx.Audio.Renderer.Server
if (filter.Enable)
{
Memory<byte> biquadStateRawMemory = SpanMemoryManager<byte>.Cast(state).Slice(VoiceUpdateState.BiquadStateOffset, VoiceUpdateState.BiquadStateSize * Constants.VoiceBiquadFilterCount);
Memory<byte> biquadStateRawMemory = SpanMemoryManager<byte>.Cast(state)[..(VoiceUpdateState.BiquadStateSize * Constants.VoiceBiquadFilterCount)];
Memory<BiquadFilterState> stateMemory = SpanMemoryManager<BiquadFilterState>.Cast(biquadStateRawMemory);
@@ -224,7 +224,7 @@ namespace Ryujinx.Audio.Renderer.Server
bool performanceInitialized = false;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
if (_performanceManager != null && _performanceManager.IsTargetNodeId(nodeId) && _performanceManager.GetNextEntry(out performanceEntry, dataSourceDetailType, PerformanceEntryType.Voice, nodeId))
{
@@ -371,7 +371,7 @@ namespace Ryujinx.Audio.Renderer.Server
{
int nodeId = sortedState.NodeId;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
bool performanceInitialized = false;
@@ -502,9 +502,11 @@ namespace Ryujinx.Audio.Renderer.Server
bool needInitialization = effect.Parameter.Status == UsageState.Invalid ||
(effect.Parameter.Status == UsageState.New && !_rendererContext.BehaviourContext.IsBiquadFilterEffectStateClearBugFixed());
BiquadFilterParameter parameter = new BiquadFilterParameter();
BiquadFilterParameter parameter = new()
{
Enable = true,
};
parameter.Enable = true;
effect.Parameter.Denominator.AsSpan().CopyTo(parameter.Denominator.AsSpan());
effect.Parameter.Numerator.AsSpan().CopyTo(parameter.Numerator.AsSpan());
@@ -623,7 +625,7 @@ namespace Ryujinx.Audio.Renderer.Server
bool isFinalMix = mix.MixId == Constants.FinalMixId;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
bool performanceInitialized = false;
@@ -789,7 +791,7 @@ namespace Ryujinx.Audio.Renderer.Server
GenerateEffects(ref subMix);
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
int nodeId = subMix.NodeId;
@@ -820,7 +822,7 @@ namespace Ryujinx.Audio.Renderer.Server
{
int nodeId = sortedState.NodeId;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
bool performanceInitialized = false;
@@ -853,7 +855,7 @@ namespace Ryujinx.Audio.Renderer.Server
GenerateEffects(ref finalMix);
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
int nodeId = finalMix.NodeId;
@@ -901,7 +903,7 @@ namespace Ryujinx.Audio.Renderer.Server
{
int nodeId = _mixContext.GetFinalState().NodeId;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
bool performanceInitialized = false;
@@ -977,7 +979,7 @@ namespace Ryujinx.Audio.Renderer.Server
{
bool performanceInitialized = false;
PerformanceEntryAddresses performanceEntry = new PerformanceEntryAddresses();
PerformanceEntryAddresses performanceEntry = new();
if (_performanceManager != null && _performanceManager.GetNextEntry(out performanceEntry, PerformanceEntryType.Sink, sink.NodeId))
{
@@ -1025,4 +1027,4 @@ namespace Ryujinx.Audio.Renderer.Server
}
}
}
}
}