AudioRendererConfiguration.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // Copyright (c) 2019-2021 Ryujinx
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. //
  17. using Ryujinx.Audio.Renderer.Server.Types;
  18. using System.Runtime.InteropServices;
  19. namespace Ryujinx.Audio.Renderer.Parameter
  20. {
  21. /// <summary>
  22. /// Audio Renderer user configuration.
  23. /// </summary>
  24. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  25. public struct AudioRendererConfiguration
  26. {
  27. /// <summary>
  28. /// The target sample rate of the user.
  29. /// </summary>
  30. /// <remarks>Only 32000Hz and 48000Hz are considered valid, other sample rates will cause undefined behaviour.</remarks>
  31. public uint SampleRate;
  32. /// <summary>
  33. /// The target sample count per <see cref="Dsp.AudioProcessor"/> updates.
  34. /// </summary>
  35. public uint SampleCount;
  36. /// <summary>
  37. /// The maximum mix buffer count.
  38. /// </summary>
  39. public uint MixBufferCount;
  40. /// <summary>
  41. /// The maximum amount of sub mixes that could be used by the user.
  42. /// </summary>
  43. public uint SubMixBufferCount;
  44. /// <summary>
  45. /// The maximum amount of voices that could be used by the user.
  46. /// </summary>
  47. public uint VoiceCount;
  48. /// <summary>
  49. /// The maximum amount of sinks that could be used by the user.
  50. /// </summary>
  51. public uint SinkCount;
  52. /// <summary>
  53. /// The maximum amount of effects that could be used by the user.
  54. /// </summary>
  55. public uint EffectCount;
  56. /// <summary>
  57. /// The maximum amount of performance metric frames that could be used by the user.
  58. /// </summary>
  59. public uint PerformanceMetricFramesCount;
  60. /// <summary>
  61. /// Set to true if the user allows the <see cref="Server.AudioRenderSystem"/> to drop voices.
  62. /// </summary>
  63. /// <seealso cref="Server.AudioRenderSystem.ComputeVoiceDrop(Server.CommandBuffer, long, long)"/>
  64. [MarshalAs(UnmanagedType.I1)]
  65. public bool VoiceDropEnabled;
  66. /// <summary>
  67. /// Reserved/unused
  68. /// </summary>
  69. private byte _reserved;
  70. /// <summary>
  71. /// The target rendering device.
  72. /// </summary>
  73. /// <remarks>Must be <see cref="AudioRendererRenderingDevice.Dsp"/></remarks>
  74. public AudioRendererRenderingDevice RenderingDevice;
  75. /// <summary>
  76. /// The target execution mode.
  77. /// </summary>
  78. /// <remarks>Must be <see cref="AudioRendererExecutionMode.Auto"/></remarks>
  79. public AudioRendererExecutionMode ExecutionMode;
  80. /// <summary>
  81. /// The maximum amount of splitters that could be used by the user.
  82. /// </summary>
  83. public uint SplitterCount;
  84. /// <summary>
  85. /// The maximum amount of splitters destinations that could be used by the user.
  86. /// </summary>
  87. public uint SplitterDestinationCount;
  88. /// <summary>
  89. /// The size of the external context.
  90. /// </summary>
  91. /// <remarks>This is a leftover of the old "codec" interface system that was present between 1.0.0 and 3.0.0. This was entirely removed from the server side with REV8.</remarks>
  92. public uint ExternalContextSize;
  93. /// <summary>
  94. /// The user audio revision
  95. /// </summary>
  96. /// <seealso cref="Server.BehaviourContext"/>
  97. public int Revision;
  98. }
  99. }