Reverb3dParameter.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using Ryujinx.Audio.Renderer.Server.Effect;
  2. using Ryujinx.Common.Memory;
  3. using System.Runtime.InteropServices;
  4. namespace Ryujinx.Audio.Renderer.Parameter.Effect
  5. {
  6. /// <summary>
  7. /// <see cref="IEffectInParameter.SpecificData"/> for <see cref="Common.EffectType.Reverb3d"/>.
  8. /// </summary>
  9. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  10. public struct Reverb3dParameter
  11. {
  12. /// <summary>
  13. /// The input channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
  14. /// </summary>
  15. public Array6<byte> Input;
  16. /// <summary>
  17. /// The output channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
  18. /// </summary>
  19. public Array6<byte> Output;
  20. /// <summary>
  21. /// The maximum number of channels supported.
  22. /// </summary>
  23. public ushort ChannelCountMax;
  24. /// <summary>
  25. /// The total channel count used.
  26. /// </summary>
  27. public ushort ChannelCount;
  28. /// <summary>
  29. /// Reserved/unused.
  30. /// </summary>
  31. private uint _reserved;
  32. /// <summary>
  33. /// The target sample rate.
  34. /// </summary>
  35. /// <remarks>This is in kHz.</remarks>
  36. public uint SampleRate;
  37. /// <summary>
  38. /// Gain of the room high-frequency effect.
  39. /// </summary>
  40. public float RoomHf;
  41. /// <summary>
  42. /// Reference high frequency.
  43. /// </summary>
  44. public float HfReference;
  45. /// <summary>
  46. /// Reverberation decay time at low frequencies.
  47. /// </summary>
  48. public float DecayTime;
  49. /// <summary>
  50. /// Ratio of the decay time at high frequencies to the decay time at low frequencies.
  51. /// </summary>
  52. public float HfDecayRatio;
  53. /// <summary>
  54. /// Gain of the room effect.
  55. /// </summary>
  56. public float RoomGain;
  57. /// <summary>
  58. /// Gain of the early reflections relative to <see cref="RoomGain"/>.
  59. /// </summary>
  60. public float ReflectionsGain;
  61. /// <summary>
  62. /// Gain of the late reverberation relative to <see cref="RoomGain"/>.
  63. /// </summary>
  64. public float ReverbGain;
  65. /// <summary>
  66. /// Echo density in the late reverberation decay.
  67. /// </summary>
  68. public float Diffusion;
  69. /// <summary>
  70. /// Modal density in the late reverberation decay.
  71. /// </summary>
  72. public float ReflectionDelay;
  73. /// <summary>
  74. /// Time limit between the early reflections and the late reverberation relative to the time of the first reflection.
  75. /// </summary>
  76. public float ReverbDelayTime;
  77. /// <summary>
  78. /// Modal density in the late reverberation decay.
  79. /// </summary>
  80. public float Density;
  81. /// <summary>
  82. /// The dry gain.
  83. /// </summary>
  84. public float DryGain;
  85. /// <summary>
  86. /// The current usage status of the effect on the client side.
  87. /// </summary>
  88. public UsageState ParameterStatus;
  89. /// <summary>
  90. /// Check if the <see cref="ChannelCount"/> is valid.
  91. /// </summary>
  92. /// <returns>Returns true if the <see cref="ChannelCount"/> is valid.</returns>
  93. public bool IsChannelCountValid()
  94. {
  95. return EffectInParameterVersion1.IsChannelCountValid(ChannelCount);
  96. }
  97. /// <summary>
  98. /// Check if the <see cref="ChannelCountMax"/> is valid.
  99. /// </summary>
  100. /// <returns>Returns true if the <see cref="ChannelCountMax"/> is valid.</returns>
  101. public bool IsChannelCountMaxValid()
  102. {
  103. return EffectInParameterVersion1.IsChannelCountValid(ChannelCountMax);
  104. }
  105. }
  106. }