using Ryujinx.Audio.Renderer.Server.Effect;
using Ryujinx.Common.Memory;
using System.Runtime.InteropServices;
namespace Ryujinx.Audio.Renderer.Parameter.Effect
{
///
/// for .
///
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LimiterParameter
{
///
/// The input channel indices that will be used by the .
///
public Array6 Input;
///
/// The output channel indices that will be used by the .
///
public Array6 Output;
///
/// The maximum number of channels supported.
///
public ushort ChannelCountMax;
///
/// The total channel count used.
///
public ushort ChannelCount;
///
/// The target sample rate.
///
/// This is in kHz.
public int SampleRate;
///
/// The look ahead max time.
/// This is in microseconds.
///
public int LookAheadTimeMax;
///
/// The attack time.
/// This is in microseconds.
///
public int AttackTime;
///
/// The release time.
/// This is in microseconds.
///
public int ReleaseTime;
///
/// The look ahead time.
/// This is in microseconds.
///
public int LookAheadTime;
///
/// The attack coefficient.
///
public float AttackCoefficient;
///
/// The release coefficient.
///
public float ReleaseCoefficient;
///
/// The threshold.
///
public float Threshold;
///
/// The input gain.
///
public float InputGain;
///
/// The output gain.
///
public float OutputGain;
///
/// The minimum samples stored in the delay buffer.
///
public int DelayBufferSampleCountMin;
///
/// The maximum samples stored in the delay buffer.
///
public int DelayBufferSampleCountMax;
///
/// The current usage status of the effect on the client side.
///
public UsageState Status;
///
/// Indicate if the limiter effect should output statistics.
///
[MarshalAs(UnmanagedType.I1)]
public bool StatisticsEnabled;
///
/// Indicate to the DSP that the user did a statistics reset.
///
[MarshalAs(UnmanagedType.I1)]
public bool StatisticsReset;
///
/// Reserved/padding.
///
private byte _reserved;
///
/// Check if the is valid.
///
/// Returns true if the is valid.
public bool IsChannelCountValid()
{
return EffectInParameterVersion1.IsChannelCountValid(ChannelCount);
}
///
/// Check if the is valid.
///
/// Returns true if the is valid.
public bool IsChannelCountMaxValid()
{
return EffectInParameterVersion1.IsChannelCountValid(ChannelCountMax);
}
}
}