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.Reverb3d"/>.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Reverb3dParameter
/// 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;
/// Reserved/unused.
private uint _reserved;
/// The target sample rate.
/// <remarks>This is in kHz.</remarks>
public uint SampleRate;
/// Gain of the room high-frequency effect.
public float RoomHf;
/// Reference high frequency.
public float HfReference;
/// Reverberation decay time at low frequencies.
public float DecayTime;
/// Ratio of the decay time at high frequencies to the decay time at low frequencies.
public float HfDecayRatio;
/// Gain of the room effect.
public float RoomGain;
/// Gain of the early reflections relative to <see cref="RoomGain"/>.
public float ReflectionsGain;
/// Gain of the late reverberation relative to <see cref="RoomGain"/>.
public float ReverbGain;
/// Echo density in the late reverberation decay.
public float Diffusion;
/// Modal density in the late reverberation decay.
public float ReflectionDelay;
/// Time limit between the early reflections and the late reverberation relative to the time of the first reflection.
public float ReverbDelayTime;
public float Density;
/// The dry gain.
public float DryGain;
/// The current usage status of the effect on the client side.
public UsageState ParameterStatus;
/// 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);