DeviceParameter.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // Copyright (c) 2019-2020 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.Common.Memory;
  18. using Ryujinx.Common.Utilities;
  19. using System;
  20. using System.Runtime.InteropServices;
  21. namespace Ryujinx.Audio.Renderer.Parameter.Sink
  22. {
  23. /// <summary>
  24. /// <see cref="SinkInParameter.SpecificData"/> for <see cref="Common.SinkType.Device"/>.
  25. /// </summary>
  26. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  27. public struct DeviceParameter
  28. {
  29. /// <summary>
  30. /// Device name storage.
  31. /// </summary>
  32. private DeviceNameStruct _deviceName;
  33. /// <summary>
  34. /// Reserved/padding.
  35. /// </summary>
  36. private byte _padding;
  37. /// <summary>
  38. /// The total count of channels to output to the device.
  39. /// </summary>
  40. public uint InputCount;
  41. /// <summary>
  42. /// The input channels index that will be used.
  43. /// </summary>
  44. public Array6<byte> Input;
  45. /// <summary>
  46. /// Reserved/padding.
  47. /// </summary>
  48. private byte _reserved;
  49. /// <summary>
  50. /// Set to true if the user controls Surround to Stereo downmixing coefficients.
  51. /// </summary>
  52. [MarshalAs(UnmanagedType.I1)]
  53. public bool DownMixParameterEnabled;
  54. /// <summary>
  55. /// The user Surround to Stereo downmixing coefficients.
  56. /// </summary>
  57. public Array4<float> DownMixParameter;
  58. [StructLayout(LayoutKind.Sequential, Size = 0xFF, Pack = 1)]
  59. private struct DeviceNameStruct { }
  60. /// <summary>
  61. /// The output device name.
  62. /// </summary>
  63. public Span<byte> DeviceName => SpanHelpers.AsSpan<DeviceNameStruct, byte>(ref _deviceName);
  64. }
  65. }