diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-08-11 18:07:37 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-11 18:07:37 -0300 |
| commit | a5ff0024fb33964c802e1712e5b11a52390603e7 (patch) | |
| tree | fdc0b7781541215cd728b8e0288b729f73dbad88 /Ryujinx.Audio/Renderer | |
| parent | f9661a54d21c3020783d14fd9935bb7b741a6915 (diff) | |
Rename ToSpan to AsSpan (#3556)
Diffstat (limited to 'Ryujinx.Audio/Renderer')
7 files changed, 24 insertions, 24 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs b/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs index eda57326..5ca1ddba 100644 --- a/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs +++ b/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs @@ -76,7 +76,7 @@ namespace Ryujinx.Audio.Renderer.Dsp if (!info.DecodingBehaviour.HasFlag(DecodingBehaviour.SkipPitchAndSampleRateConversion)) { - voiceState.Pitch.ToSpan().Slice(0, pitchMaxLength).CopyTo(tempBuffer); + voiceState.Pitch.AsSpan().Slice(0, pitchMaxLength).CopyTo(tempBuffer); tempBufferIndex += pitchMaxLength; } @@ -239,7 +239,7 @@ namespace Ryujinx.Audio.Renderer.Dsp ResamplerHelper.Resample(outputBuffer, tempBuffer, sampleRateRatio, ref fraction, sampleCountToProcess, info.SrcQuality, y != sourceSampleCountToProcess || info.Pitch != 1.0f); - tempBuffer.Slice(sampleCountToDecode, pitchMaxLength).CopyTo(voiceState.Pitch.ToSpan()); + tempBuffer.Slice(sampleCountToDecode, pitchMaxLength).CopyTo(voiceState.Pitch.AsSpan()); } i += sampleCountToProcess; diff --git a/Ryujinx.Audio/Renderer/Parameter/Effect/LimiterStatistics.cs b/Ryujinx.Audio/Renderer/Parameter/Effect/LimiterStatistics.cs index af4c02f2..f353f18d 100644 --- a/Ryujinx.Audio/Renderer/Parameter/Effect/LimiterStatistics.cs +++ b/Ryujinx.Audio/Renderer/Parameter/Effect/LimiterStatistics.cs @@ -24,8 +24,8 @@ namespace Ryujinx.Audio.Renderer.Parameter.Effect /// </summary> public void Reset() { - InputMax.ToSpan().Fill(0.0f); - CompressionGainMin.ToSpan().Fill(1.0f); + InputMax.AsSpan().Fill(0.0f); + CompressionGainMin.AsSpan().Fill(1.0f); } } }
\ No newline at end of file diff --git a/Ryujinx.Audio/Renderer/Server/CommandGenerator.cs b/Ryujinx.Audio/Renderer/Server/CommandGenerator.cs index 514279f1..87e5c77f 100644 --- a/Ryujinx.Audio/Renderer/Server/CommandGenerator.cs +++ b/Ryujinx.Audio/Renderer/Server/CommandGenerator.cs @@ -141,7 +141,7 @@ namespace Ryujinx.Audio.Renderer.Server Memory<byte> biquadStateRawMemory = SpanMemoryManager<byte>.Cast(state).Slice(VoiceUpdateState.BiquadStateOffset, VoiceUpdateState.BiquadStateSize * Constants.VoiceBiquadFilterCount); Memory<BiquadFilterState> stateMemory = SpanMemoryManager<BiquadFilterState>.Cast(biquadStateRawMemory); - _commandBuffer.GenerateGroupedBiquadFilter(baseIndex, voiceState.BiquadFilters.ToSpan(), stateMemory, bufferOffset, bufferOffset, voiceState.BiquadFilterNeedInitialization, nodeId); + _commandBuffer.GenerateGroupedBiquadFilter(baseIndex, voiceState.BiquadFilters.AsSpan(), stateMemory, bufferOffset, bufferOffset, voiceState.BiquadFilterNeedInitialization, nodeId); } else { @@ -337,8 +337,8 @@ namespace Ryujinx.Audio.Renderer.Server GeneratePerformance(ref performanceEntry, PerformanceCommand.Type.Start, nodeId); } - GenerateVoiceMix(channelResource.Mix.ToSpan(), - channelResource.PreviousMix.ToSpan(), + GenerateVoiceMix(channelResource.Mix.AsSpan(), + channelResource.PreviousMix.AsSpan(), dspStateMemory, mix.BufferOffset, mix.BufferCount, @@ -505,8 +505,8 @@ namespace Ryujinx.Audio.Renderer.Server BiquadFilterParameter parameter = new BiquadFilterParameter(); parameter.Enable = true; - effect.Parameter.Denominator.ToSpan().CopyTo(parameter.Denominator.ToSpan()); - effect.Parameter.Numerator.ToSpan().CopyTo(parameter.Numerator.ToSpan()); + effect.Parameter.Denominator.AsSpan().CopyTo(parameter.Denominator.AsSpan()); + effect.Parameter.Numerator.AsSpan().CopyTo(parameter.Numerator.AsSpan()); for (int i = 0; i < effect.Parameter.ChannelCount; i++) { @@ -923,8 +923,8 @@ namespace Ryujinx.Audio.Renderer.Server if (useCustomDownMixingCommand) { _commandBuffer.GenerateDownMixSurroundToStereo(finalMix.BufferOffset, - sink.Parameter.Input.ToSpan(), - sink.Parameter.Input.ToSpan(), + sink.Parameter.Input.AsSpan(), + sink.Parameter.Input.AsSpan(), sink.DownMixCoefficients, Constants.InvalidNodeId); } @@ -932,8 +932,8 @@ namespace Ryujinx.Audio.Renderer.Server else if (_rendererContext.ChannelCount == 2 && sink.Parameter.InputCount == 6) { _commandBuffer.GenerateDownMixSurroundToStereo(finalMix.BufferOffset, - sink.Parameter.Input.ToSpan(), - sink.Parameter.Input.ToSpan(), + sink.Parameter.Input.AsSpan(), + sink.Parameter.Input.AsSpan(), Constants.DefaultSurroundToStereoCoefficients, Constants.InvalidNodeId); } @@ -945,7 +945,7 @@ namespace Ryujinx.Audio.Renderer.Server _commandBuffer.GenerateUpsample(finalMix.BufferOffset, sink.UpsamplerState, sink.Parameter.InputCount, - sink.Parameter.Input.ToSpan(), + sink.Parameter.Input.AsSpan(), commandList.BufferCount, commandList.SampleCount, commandList.SampleRate, diff --git a/Ryujinx.Audio/Renderer/Server/Sink/DeviceSink.cs b/Ryujinx.Audio/Renderer/Server/Sink/DeviceSink.cs index 970e145e..de345d3a 100644 --- a/Ryujinx.Audio/Renderer/Server/Sink/DeviceSink.cs +++ b/Ryujinx.Audio/Renderer/Server/Sink/DeviceSink.cs @@ -63,10 +63,10 @@ namespace Ryujinx.Audio.Renderer.Server.Sink else { Parameter.DownMixParameterEnabled = inputDeviceParameter.DownMixParameterEnabled; - inputDeviceParameter.DownMixParameter.ToSpan().CopyTo(Parameter.DownMixParameter.ToSpan()); + inputDeviceParameter.DownMixParameter.AsSpan().CopyTo(Parameter.DownMixParameter.AsSpan()); } - Parameter.DownMixParameter.ToSpan().CopyTo(DownMixCoefficients.AsSpan()); + Parameter.DownMixParameter.AsSpan().CopyTo(DownMixCoefficients.AsSpan()); errorInfo = new BehaviourParameter.ErrorInfo(); outStatus = new SinkOutStatus(); diff --git a/Ryujinx.Audio/Renderer/Server/StateUpdater.cs b/Ryujinx.Audio/Renderer/Server/StateUpdater.cs index 0514c355..0c2cfa7e 100644 --- a/Ryujinx.Audio/Renderer/Server/StateUpdater.cs +++ b/Ryujinx.Audio/Renderer/Server/StateUpdater.cs @@ -119,7 +119,7 @@ namespace Ryujinx.Audio.Renderer.Server ref VoiceChannelResource resource = ref context.GetChannelResource(i); resource.Id = parameter.Id; - parameter.Mix.ToSpan().CopyTo(resource.Mix.ToSpan()); + parameter.Mix.AsSpan().CopyTo(resource.Mix.AsSpan()); resource.IsUsed = parameter.IsUsed; } @@ -587,7 +587,7 @@ namespace Ryujinx.Audio.Renderer.Server { ref BehaviourErrorInfoOutStatus outStatus = ref SpanIOHelper.GetWriteRef<BehaviourErrorInfoOutStatus>(ref _output)[0]; - _behaviourContext.CopyErrorInfo(outStatus.ErrorInfos.ToSpan(), out outStatus.ErrorInfosCount); + _behaviourContext.CopyErrorInfo(outStatus.ErrorInfos.AsSpan(), out outStatus.ErrorInfosCount); OutputHeader.BehaviourSize = (uint)Unsafe.SizeOf<BehaviourErrorInfoOutStatus>(); OutputHeader.TotalSize += OutputHeader.BehaviourSize; diff --git a/Ryujinx.Audio/Renderer/Server/Voice/VoiceChannelResource.cs b/Ryujinx.Audio/Renderer/Server/Voice/VoiceChannelResource.cs index 81736630..939d9294 100644 --- a/Ryujinx.Audio/Renderer/Server/Voice/VoiceChannelResource.cs +++ b/Ryujinx.Audio/Renderer/Server/Voice/VoiceChannelResource.cs @@ -34,7 +34,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice public void UpdateState() { - Mix.ToSpan().CopyTo(PreviousMix.ToSpan()); + Mix.AsSpan().CopyTo(PreviousMix.AsSpan()); } } }
\ No newline at end of file diff --git a/Ryujinx.Audio/Renderer/Server/Voice/VoiceState.cs b/Ryujinx.Audio/Renderer/Server/Voice/VoiceState.cs index 004b5aa2..006d6dd3 100644 --- a/Ryujinx.Audio/Renderer/Server/Voice/VoiceState.cs +++ b/Ryujinx.Audio/Renderer/Server/Voice/VoiceState.cs @@ -202,7 +202,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice Pitch = 0.0f; Volume = 0.0f; PreviousVolume = 0.0f; - BiquadFilters.ToSpan().Fill(new BiquadFilterParameter()); + BiquadFilters.AsSpan().Fill(new BiquadFilterParameter()); WaveBuffersCount = 0; WaveBuffersIndex = 0; MixId = Constants.UnusedMixId; @@ -288,7 +288,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice ChannelsCount = parameter.ChannelCount; Pitch = parameter.Pitch; Volume = parameter.Volume; - parameter.BiquadFilters.ToSpan().CopyTo(BiquadFilters.ToSpan()); + parameter.BiquadFilters.AsSpan().CopyTo(BiquadFilters.AsSpan()); WaveBuffersCount = parameter.WaveBuffersCount; WaveBuffersIndex = parameter.WaveBuffersIndex; @@ -308,7 +308,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice SplitterId = Constants.UnusedSplitterId; } - parameter.ChannelResourceIds.ToSpan().CopyTo(ChannelResourceIds.ToSpan()); + parameter.ChannelResourceIds.AsSpan().CopyTo(ChannelResourceIds.AsSpan()); DecodingBehaviour behaviour = DecodingBehaviour.Default; @@ -638,7 +638,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice voiceUpdateState.Offset = 0; voiceUpdateState.PlayedSampleCount = 0; - voiceUpdateState.Pitch.ToSpan().Fill(0); + voiceUpdateState.Pitch.AsSpan().Fill(0); voiceUpdateState.Fraction = 0; voiceUpdateState.LoopContext = new Dsp.State.AdpcmLoopContext(); } @@ -650,7 +650,7 @@ namespace Ryujinx.Audio.Renderer.Server.Voice case Types.PlayState.Stopped: case Types.PlayState.Paused: - foreach (ref WaveBuffer wavebuffer in WaveBuffers.ToSpan()) + foreach (ref WaveBuffer wavebuffer in WaveBuffers.AsSpan()) { wavebuffer.BufferAddressInfo.GetReference(true); wavebuffer.ContextAddressInfo.GetReference(true); |
