ReverbParameter.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using Ryujinx.Audio.Renderer.Common;
  2. using Ryujinx.Audio.Renderer.Server.Effect;
  3. using Ryujinx.Common.Memory;
  4. using System.Runtime.InteropServices;
  5. namespace Ryujinx.Audio.Renderer.Parameter.Effect
  6. {
  7. /// <summary>
  8. /// <see cref="IEffectInParameter.SpecificData"/> for <see cref="Common.EffectType.Reverb"/>.
  9. /// </summary>
  10. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  11. public struct ReverbParameter
  12. {
  13. /// <summary>
  14. /// The input channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
  15. /// </summary>
  16. public Array6<byte> Input;
  17. /// <summary>
  18. /// The output channel indices that will be used by the <see cref="Dsp.AudioProcessor"/>.
  19. /// </summary>
  20. public Array6<byte> Output;
  21. /// <summary>
  22. /// The maximum number of channels supported.
  23. /// </summary>
  24. public ushort ChannelCountMax;
  25. /// <summary>
  26. /// The total channel count used.
  27. /// </summary>
  28. public ushort ChannelCount;
  29. /// <summary>
  30. /// The target sample rate. (Q15)
  31. /// </summary>
  32. /// <remarks>This is in kHz.</remarks>
  33. public int SampleRate;
  34. /// <summary>
  35. /// The early mode to use.
  36. /// </summary>
  37. public ReverbEarlyMode EarlyMode;
  38. /// <summary>
  39. /// The gain to apply to the result of the early reflection. (Q15)
  40. /// </summary>
  41. public int EarlyGain;
  42. /// <summary>
  43. /// The pre-delay time in milliseconds. (Q15)
  44. /// </summary>
  45. public int PreDelayTime;
  46. /// <summary>
  47. /// The late mode to use.
  48. /// </summary>
  49. public ReverbLateMode LateMode;
  50. /// <summary>
  51. /// The gain to apply to the result of the late reflection. (Q15)
  52. /// </summary>
  53. public int LateGain;
  54. /// <summary>
  55. /// The decay time. (Q15)
  56. /// </summary>
  57. public int DecayTime;
  58. /// <summary>
  59. /// The high frequency decay ratio. (Q15)
  60. /// </summary>
  61. /// <remarks>If <see cref="HighFrequencyDecayRatio"/> >= 0.995f, it is considered disabled.</remarks>
  62. public int HighFrequencyDecayRatio;
  63. /// <summary>
  64. /// The coloration of the decay. (Q15)
  65. /// </summary>
  66. public int Coloration;
  67. /// <summary>
  68. /// The reverb gain. (Q15)
  69. /// </summary>
  70. public int ReverbGain;
  71. /// <summary>
  72. /// The output gain. (Q15)
  73. /// </summary>
  74. public int OutGain;
  75. /// <summary>
  76. /// The dry gain. (Q15)
  77. /// </summary>
  78. public int DryGain;
  79. /// <summary>
  80. /// The current usage status of the effect on the client side.
  81. /// </summary>
  82. public UsageState Status;
  83. /// <summary>
  84. /// Check if the <see cref="ChannelCount"/> is valid.
  85. /// </summary>
  86. /// <returns>Returns true if the <see cref="ChannelCount"/> is valid.</returns>
  87. public bool IsChannelCountValid()
  88. {
  89. return EffectInParameterVersion1.IsChannelCountValid(ChannelCount);
  90. }
  91. /// <summary>
  92. /// Check if the <see cref="ChannelCountMax"/> is valid.
  93. /// </summary>
  94. /// <returns>Returns true if the <see cref="ChannelCountMax"/> is valid.</returns>
  95. public bool IsChannelCountMaxValid()
  96. {
  97. return EffectInParameterVersion1.IsChannelCountValid(ChannelCountMax);
  98. }
  99. }
  100. }