DeviceParameter.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using Ryujinx.Common.Memory;
  2. using Ryujinx.Common.Utilities;
  3. using System;
  4. using System.Runtime.InteropServices;
  5. namespace Ryujinx.Audio.Renderer.Parameter.Sink
  6. {
  7. /// <summary>
  8. /// <see cref="SinkInParameter.SpecificData"/> for <see cref="Common.SinkType.Device"/>.
  9. /// </summary>
  10. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  11. public struct DeviceParameter
  12. {
  13. /// <summary>
  14. /// Device name storage.
  15. /// </summary>
  16. private DeviceNameStruct _deviceName;
  17. /// <summary>
  18. /// Reserved/padding.
  19. /// </summary>
  20. private byte _padding;
  21. /// <summary>
  22. /// The total count of channels to output to the device.
  23. /// </summary>
  24. public uint InputCount;
  25. /// <summary>
  26. /// The input channels index that will be used.
  27. /// </summary>
  28. public Array6<byte> Input;
  29. /// <summary>
  30. /// Reserved/padding.
  31. /// </summary>
  32. private byte _reserved;
  33. /// <summary>
  34. /// Set to true if the user controls Surround to Stereo downmixing coefficients.
  35. /// </summary>
  36. [MarshalAs(UnmanagedType.I1)]
  37. public bool DownMixParameterEnabled;
  38. /// <summary>
  39. /// The user Surround to Stereo downmixing coefficients.
  40. /// </summary>
  41. public Array4<float> DownMixParameter;
  42. [StructLayout(LayoutKind.Sequential, Size = 0xFF, Pack = 1)]
  43. private struct DeviceNameStruct { }
  44. /// <summary>
  45. /// The output device name.
  46. /// </summary>
  47. public Span<byte> DeviceName => SpanHelpers.AsSpan<DeviceNameStruct, byte>(ref _deviceName);
  48. }
  49. }