using Ryujinx.Audio.Renderer.Common;
using Ryujinx.Audio.Renderer.Server.Effect;
using Ryujinx.Common.Memory;
using System.Runtime.InteropServices;
namespace Ryujinx.Audio.Renderer.Parameter.Effect
{
/// <summary>
/// <see cref="IEffectInParameter.SpecificData"/> for <see cref="Common.EffectType.Reverb"/>.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ReverbParameter
/// The input channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
public Array6<byte> Input;
/// The output channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
public Array6<byte> Output;
/// The maximum number of channels supported.
public ushort ChannelCountMax;
/// The total channel count used.
public ushort ChannelCount;
/// The target sample rate. (Q15)
/// <remarks>This is in kHz.</remarks>
public int SampleRate;
/// The early mode to use.
public ReverbEarlyMode EarlyMode;
/// The gain to apply to the result of the early reflection. (Q15)
public int EarlyGain;
/// The pre-delay time in milliseconds. (Q15)
public int PreDelayTime;
/// The late mode to use.
public ReverbLateMode LateMode;
/// The gain to apply to the result of the late reflection. (Q15)
public int LateGain;
/// The decay time. (Q15)
public int DecayTime;
/// The high frequency decay ratio. (Q15)
/// <remarks>If <see cref="HighFrequencyDecayRatio"/> >= 0.995f, it is considered disabled.</remarks>
public int HighFrequencyDecayRatio;
/// The coloration of the decay. (Q15)
public int Coloration;
/// The reverb gain. (Q15)
public int ReverbGain;
/// The output gain. (Q15)
public int OutGain;
/// The dry gain. (Q15)
public int DryGain;
/// The current usage status of the effect on the client side.
public UsageState Status;
/// Check if the <see cref="ChannelCount"/> is valid.
/// <returns>Returns true if the <see cref="ChannelCount"/> is valid.</returns>
public bool IsChannelCountValid()
return EffectInParameterVersion1.IsChannelCountValid(ChannelCount);
}
/// Check if the <see cref="ChannelCountMax"/> is valid.
/// <returns>Returns true if the <see cref="ChannelCountMax"/> is valid.</returns>
public bool IsChannelCountMaxValid()
return EffectInParameterVersion1.IsChannelCountValid(ChannelCountMax);