SinkInParameter.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Ryujinx.Audio.Renderer.Common;
  2. using Ryujinx.Common.Utilities;
  3. using System;
  4. using System.Runtime.InteropServices;
  5. namespace Ryujinx.Audio.Renderer.Parameter
  6. {
  7. /// <summary>
  8. /// Input information for a sink.
  9. /// </summary>
  10. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  11. public struct SinkInParameter
  12. {
  13. /// <summary>
  14. /// Type of the sink.
  15. /// </summary>
  16. public SinkType Type;
  17. /// <summary>
  18. /// Set to true if the sink is used.
  19. /// </summary>
  20. [MarshalAs(UnmanagedType.I1)]
  21. public bool IsUsed;
  22. /// <summary>
  23. /// Reserved/padding.
  24. /// </summary>
  25. private ushort _reserved1;
  26. /// <summary>
  27. /// The node id of the sink.
  28. /// </summary>
  29. public int NodeId;
  30. /// <summary>
  31. /// Reserved/padding.
  32. /// </summary>
  33. private unsafe fixed ulong _reserved2[3];
  34. /// <summary>
  35. /// Specific data storage.
  36. /// </summary>
  37. private SpecificDataStruct _specificDataStart;
  38. [StructLayout(LayoutKind.Sequential, Size = 0x120, Pack = 1)]
  39. private struct SpecificDataStruct { }
  40. /// <summary>
  41. /// Specific data changing depending of the <see cref="Type"/>. See also the <see cref="Sink"/> namespace.
  42. /// </summary>
  43. public Span<byte> SpecificData => SpanHelpers.AsSpan<SpecificDataStruct, byte>(ref _specificDataStart);
  44. }
  45. }