diff options
Diffstat (limited to 'Ryujinx.Audio/Renderer/Server/CommandBuffer.cs')
| -rw-r--r-- | Ryujinx.Audio/Renderer/Server/CommandBuffer.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Ryujinx.Audio/Renderer/Server/CommandBuffer.cs b/Ryujinx.Audio/Renderer/Server/CommandBuffer.cs index deb20f3d..0e74c301 100644 --- a/Ryujinx.Audio/Renderer/Server/CommandBuffer.cs +++ b/Ryujinx.Audio/Renderer/Server/CommandBuffer.cs @@ -24,6 +24,7 @@ using Ryujinx.Audio.Renderer.Server.Performance; using Ryujinx.Audio.Renderer.Server.Sink; using Ryujinx.Audio.Renderer.Server.Upsampler; using Ryujinx.Audio.Renderer.Server.Voice; +using Ryujinx.Common.Memory; using System; using CpuAddress = System.UInt64; @@ -221,6 +222,25 @@ namespace Ryujinx.Audio.Renderer.Server } /// <summary> + /// Create a new <see cref="GroupedBiquadFilterCommand"/>. + /// </summary> + /// <param name="baseIndex">The base index of the input and output buffer.</param> + /// <param name="filters">The biquad filter parameters.</param> + /// <param name="biquadFilterStatesMemory">The biquad states.</param> + /// <param name="inputBufferOffset">The input buffer offset.</param> + /// <param name="outputBufferOffset">The output buffer offset.</param> + /// <param name="isInitialized">Set to true if the biquad filter state is initialized.</param> + /// <param name="nodeId">The node id associated to this command.</param> + public void GenerateGroupedBiquadFilter(int baseIndex, ReadOnlySpan<BiquadFilterParameter> filters, Memory<BiquadFilterState> biquadFilterStatesMemory, int inputBufferOffset, int outputBufferOffset, ReadOnlySpan<bool> isInitialized, int nodeId) + { + GroupedBiquadFilterCommand command = new GroupedBiquadFilterCommand(baseIndex, filters, biquadFilterStatesMemory, inputBufferOffset, outputBufferOffset, isInitialized, nodeId); + + command.EstimatedProcessingTime = _commandProcessingTimeEstimator.Estimate(command); + + AddCommand(command); + } + + /// <summary> /// Generate a new <see cref="MixRampGroupedCommand"/>. /// </summary> /// <param name="mixBufferCount">The mix buffer count.</param> @@ -441,6 +461,30 @@ namespace Ryujinx.Audio.Renderer.Server } /// <summary> + /// Generate a new <see cref="CaptureBufferCommand"/>. + /// </summary> + /// <param name="bufferOffset">The target buffer offset.</param> + /// <param name="inputBufferOffset">The input buffer offset.</param> + /// <param name="sendBufferInfo">The capture state.</param> + /// <param name="isEnabled">Set to true if the effect should be active.</param> + /// <param name="countMax">The limit of the circular buffer.</param> + /// <param name="outputBuffer">The guest address of the output buffer.</param> + /// <param name="updateCount">The count to add on the offset after write operations.</param> + /// <param name="writeOffset">The write offset.</param> + /// <param name="nodeId">The node id associated to this command.</param> + public void GenerateCaptureEffect(uint bufferOffset, byte inputBufferOffset, ulong sendBufferInfo, bool isEnabled, uint countMax, CpuAddress outputBuffer, uint updateCount, uint writeOffset, int nodeId) + { + if (sendBufferInfo != 0) + { + CaptureBufferCommand command = new CaptureBufferCommand(bufferOffset, inputBufferOffset, sendBufferInfo, isEnabled, countMax, outputBuffer, updateCount, writeOffset, nodeId); + + command.EstimatedProcessingTime = _commandProcessingTimeEstimator.Estimate(command); + + AddCommand(command); + } + } + + /// <summary> /// Generate a new <see cref="VolumeCommand"/>. /// </summary> /// <param name="volume">The target volume to apply.</param> |
