DelayParameter.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.Delay"/>.
  8. /// </summary>
  9. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  10. public struct DelayParameter
  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. /// The maximum delay time in milliseconds.
  30. /// </summary>
  31. public uint DelayTimeMax;
  32. /// <summary>
  33. /// The delay time in milliseconds.
  34. /// </summary>
  35. public uint DelayTime;
  36. /// <summary>
  37. /// The target sample rate. (Q15)
  38. /// </summary>
  39. public uint SampleRate;
  40. /// <summary>
  41. /// The input gain. (Q15)
  42. /// </summary>
  43. public uint InGain;
  44. /// <summary>
  45. /// The feedback gain. (Q15)
  46. /// </summary>
  47. public uint FeedbackGain;
  48. /// <summary>
  49. /// The output gain. (Q15)
  50. /// </summary>
  51. public uint OutGain;
  52. /// <summary>
  53. /// The dry gain. (Q15)
  54. /// </summary>
  55. public uint DryGain;
  56. /// <summary>
  57. /// The channel spread of the <see cref="FeedbackGain"/>. (Q15)
  58. /// </summary>
  59. public uint ChannelSpread;
  60. /// <summary>
  61. /// The low pass amount. (Q15)
  62. /// </summary>
  63. public uint LowPassAmount;
  64. /// <summary>
  65. /// The current usage status of the effect on the client side.
  66. /// </summary>
  67. public UsageState Status;
  68. /// <summary>
  69. /// Check if the <see cref="ChannelCount"/> is valid.
  70. /// </summary>
  71. /// <returns>Returns true if the <see cref="ChannelCount"/> is valid.</returns>
  72. public bool IsChannelCountValid()
  73. {
  74. return EffectInParameterVersion1.IsChannelCountValid(ChannelCount);
  75. }
  76. /// <summary>
  77. /// Check if the <see cref="ChannelCountMax"/> is valid.
  78. /// </summary>
  79. /// <returns>Returns true if the <see cref="ChannelCountMax"/> is valid.</returns>
  80. public bool IsChannelCountMaxValid()
  81. {
  82. return EffectInParameterVersion1.IsChannelCountValid(ChannelCountMax);
  83. }
  84. }
  85. }