AudioRendererConfiguration.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Ryujinx.Audio.Renderer.Server.Types;
  2. using System.Runtime.InteropServices;
  3. namespace Ryujinx.Audio.Renderer.Parameter
  4. {
  5. /// <summary>
  6. /// Audio Renderer user configuration.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  9. public struct AudioRendererConfiguration
  10. {
  11. /// <summary>
  12. /// The target sample rate of the user.
  13. /// </summary>
  14. /// <remarks>Only 32000Hz and 48000Hz are considered valid, other sample rates will cause undefined behaviour.</remarks>
  15. public uint SampleRate;
  16. /// <summary>
  17. /// The target sample count per <see cref="Dsp.AudioProcessor"/> updates.
  18. /// </summary>
  19. public uint SampleCount;
  20. /// <summary>
  21. /// The maximum mix buffer count.
  22. /// </summary>
  23. public uint MixBufferCount;
  24. /// <summary>
  25. /// The maximum amount of sub mixes that could be used by the user.
  26. /// </summary>
  27. public uint SubMixBufferCount;
  28. /// <summary>
  29. /// The maximum amount of voices that could be used by the user.
  30. /// </summary>
  31. public uint VoiceCount;
  32. /// <summary>
  33. /// The maximum amount of sinks that could be used by the user.
  34. /// </summary>
  35. public uint SinkCount;
  36. /// <summary>
  37. /// The maximum amount of effects that could be used by the user.
  38. /// </summary>
  39. public uint EffectCount;
  40. /// <summary>
  41. /// The maximum amount of performance metric frames that could be used by the user.
  42. /// </summary>
  43. public uint PerformanceMetricFramesCount;
  44. /// <summary>
  45. /// Set to true if the user allows the <see cref="Server.AudioRenderSystem"/> to drop voices.
  46. /// </summary>
  47. /// <seealso cref="Server.AudioRenderSystem.ComputeVoiceDrop(Server.CommandBuffer, long, long)"/>
  48. [MarshalAs(UnmanagedType.I1)]
  49. public bool VoiceDropEnabled;
  50. /// <summary>
  51. /// Reserved/unused
  52. /// </summary>
  53. private byte _reserved;
  54. /// <summary>
  55. /// The target rendering device.
  56. /// </summary>
  57. /// <remarks>Must be <see cref="AudioRendererRenderingDevice.Dsp"/></remarks>
  58. public AudioRendererRenderingDevice RenderingDevice;
  59. /// <summary>
  60. /// The target execution mode.
  61. /// </summary>
  62. /// <remarks>Must be <see cref="AudioRendererExecutionMode.Auto"/></remarks>
  63. public AudioRendererExecutionMode ExecutionMode;
  64. /// <summary>
  65. /// The maximum amount of splitters that could be used by the user.
  66. /// </summary>
  67. public uint SplitterCount;
  68. /// <summary>
  69. /// The maximum amount of splitters destinations that could be used by the user.
  70. /// </summary>
  71. public uint SplitterDestinationCount;
  72. /// <summary>
  73. /// The size of the external context.
  74. /// </summary>
  75. /// <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>
  76. public uint ExternalContextSize;
  77. /// <summary>
  78. /// The user audio revision
  79. /// </summary>
  80. /// <seealso cref="Server.BehaviourContext"/>
  81. public int Revision;
  82. }
  83. }