[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

@@ -7,7 +7,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
{
public class ReverbState
{
private static readonly float[] FdnDelayTimes = new float[20]
private static readonly float[] _fdnDelayTimes = new float[20]
{
// Room
53.953247f, 79.192566f, 116.238770f, 130.615295f,
@@ -21,7 +21,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
53.953247f, 79.192566f, 116.238770f, 170.615295f,
};
private static readonly float[] DecayDelayTimes = new float[20]
private static readonly float[] _decayDelayTimes = new float[20]
{
// Room
7f, 9f, 13f, 17f,
@@ -35,7 +35,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
7f, 9f, 13f, 17f,
};
private static readonly float[] EarlyDelayTimes = new float[50]
private static readonly float[] _earlyDelayTimes = new float[50]
{
// Room
0.0f, 3.5f, 2.8f, 3.9f, 2.7f, 13.4f, 7.9f, 8.4f, 9.9f, 12.0f,
@@ -46,10 +46,10 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
33.1f, 43.3f, 22.8f, 37.9f, 14.9f, 35.3f, 17.9f, 34.2f, 0.0f, 43.3f,
// Disabled
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
};
private static readonly float[] EarlyGainBase = new float[50]
private static readonly float[] _earlyGainBase = new float[50]
{
// Room
0.70f, 0.68f, 0.70f, 0.68f, 0.70f, 0.68f, 0.70f, 0.68f, 0.68f, 0.68f,
@@ -60,10 +60,10 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
0.93f, 0.92f, 0.87f, 0.86f, 0.94f, 0.81f, 0.80f, 0.77f, 0.76f, 0.65f,
// Disabled
0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f
0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f,
};
private static readonly float[] PreDelayTimes = new float[5]
private static readonly float[] _preDelayTimes = new float[5]
{
// Room
12.5f,
@@ -74,7 +74,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
50.0f,
// Disabled
0.0f
0.0f,
};
public DelayLine[] FdnDelayLines { get; }
@@ -93,14 +93,14 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
private const int FixedPointPrecision = 14;
private ReadOnlySpan<float> GetFdnDelayTimesByLateMode(ReverbLateMode lateMode)
private static ReadOnlySpan<float> GetFdnDelayTimesByLateMode(ReverbLateMode lateMode)
{
return FdnDelayTimes.AsSpan((int)lateMode * 4, 4);
return _fdnDelayTimes.AsSpan((int)lateMode * 4, 4);
}
private ReadOnlySpan<float> GetDecayDelayTimesByLateMode(ReverbLateMode lateMode)
private static ReadOnlySpan<float> GetDecayDelayTimesByLateMode(ReverbLateMode lateMode)
{
return DecayDelayTimes.AsSpan((int)lateMode * 4, 4);
return _decayDelayTimes.AsSpan((int)lateMode * 4, 4);
}
public ReverbState(ref ReverbParameter parameter, ulong workBuffer, bool isLongSizePreDelaySupported)
@@ -148,8 +148,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
for (int i = 0; i < 10; i++)
{
EarlyDelayTime[i] = Math.Min(IDelayLine.GetSampleCount(sampleRate, EarlyDelayTimes[i] + preDelayTimeInMilliseconds), PreDelayLine.SampleCountMax) + 1;
EarlyGain[i] = EarlyGainBase[i] * earlyGain;
EarlyDelayTime[i] = Math.Min(IDelayLine.GetSampleCount(sampleRate, _earlyDelayTimes[i] + preDelayTimeInMilliseconds), PreDelayLine.SampleCountMax) + 1;
EarlyGain[i] = _earlyGainBase[i] * earlyGain;
}
if (parameter.ChannelCount == 2)
@@ -158,7 +158,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
EarlyGain[5] = EarlyGain[5] * 0.5f;
}
PreDelayLineDelayTime = Math.Min(IDelayLine.GetSampleCount(sampleRate, PreDelayTimes[(int)parameter.EarlyMode] + preDelayTimeInMilliseconds), PreDelayLine.SampleCountMax);
PreDelayLineDelayTime = Math.Min(IDelayLine.GetSampleCount(sampleRate, _preDelayTimes[(int)parameter.EarlyMode] + preDelayTimeInMilliseconds), PreDelayLine.SampleCountMax);
ReadOnlySpan<float> fdnDelayTimes = GetFdnDelayTimesByLateMode(parameter.LateMode);
ReadOnlySpan<float> decayDelayTimes = GetDecayDelayTimesByLateMode(parameter.LateMode);
@@ -201,4 +201,4 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
}
}
}
}
}