SinkInParameter.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.Common;
  18. using Ryujinx.Common.Utilities;
  19. using System;
  20. using System.Runtime.InteropServices;
  21. namespace Ryujinx.Audio.Renderer.Parameter
  22. {
  23. /// <summary>
  24. /// Input information for a sink.
  25. /// </summary>
  26. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  27. public struct SinkInParameter
  28. {
  29. /// <summary>
  30. /// Type of the sink.
  31. /// </summary>
  32. public SinkType Type;
  33. /// <summary>
  34. /// Set to true if the sink is used.
  35. /// </summary>
  36. [MarshalAs(UnmanagedType.I1)]
  37. public bool IsUsed;
  38. /// <summary>
  39. /// Reserved/padding.
  40. /// </summary>
  41. private ushort _reserved1;
  42. /// <summary>
  43. /// The node id of the sink.
  44. /// </summary>
  45. public int NodeId;
  46. /// <summary>
  47. /// Reserved/padding.
  48. /// </summary>
  49. private unsafe fixed ulong _reserved2[3];
  50. /// <summary>
  51. /// Specific data storage.
  52. /// </summary>
  53. private SpecificDataStruct _specificDataStart;
  54. [StructLayout(LayoutKind.Sequential, Size = 0x120, Pack = 1)]
  55. private struct SpecificDataStruct { }
  56. /// <summary>
  57. /// Specific data changing depending of the <see cref="Type"/>. See also the <see cref="Sink"/> namespace.
  58. /// </summary>
  59. public Span<byte> SpecificData => SpanHelpers.AsSpan<SpecificDataStruct, byte>(ref _specificDataStart);
  60. }
  61. }