using System;
namespace Ryujinx.Audio.Renderer.Server.Upsampler
{
///
/// Server state for a upsampling.
///
public class UpsamplerState
{
///
/// The output buffer containing the target samples.
///
public Memory OutputBuffer { get; }
///
/// The target sample count.
///
public uint SampleCount { get; }
///
/// The index of the . (used to free it)
///
private int _index;
///
/// The .
///
private UpsamplerManager _manager;
///
/// The source sample count.
///
public uint SourceSampleCount;
///
/// The input buffer indices of the buffers holding the samples that need upsampling.
///
public ushort[] InputBufferIndices;
///
/// State of each input buffer index kept across invocations of the upsampler.
///
public UpsamplerBufferState[] BufferStates;
///
/// Create a new .
///
/// The upsampler manager.
/// The index of the . (used to free it)
/// The output buffer used to contain the target samples.
/// The target sample count.
public UpsamplerState(UpsamplerManager manager, int index, Memory outputBuffer, uint sampleCount)
{
_manager = manager;
_index = index;
OutputBuffer = outputBuffer;
SampleCount = sampleCount;
}
///
/// Release the .
///
public void Release()
{
_manager.Free(_index);
}
}
}