SplitterInParameter.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 System.Runtime.InteropServices;
  18. namespace Ryujinx.Audio.Renderer.Parameter
  19. {
  20. /// <summary>
  21. /// Input header for a splitter state update.
  22. /// </summary>
  23. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  24. public struct SplitterInParameter
  25. {
  26. /// <summary>
  27. /// Magic of the input header.
  28. /// </summary>
  29. public uint Magic;
  30. /// <summary>
  31. /// Target splitter id.
  32. /// </summary>
  33. public int Id;
  34. /// <summary>
  35. /// Target sample rate to use on the splitter.
  36. /// </summary>
  37. public uint SampleRate;
  38. /// <summary>
  39. /// Count of splitter destinations.
  40. /// </summary>
  41. /// <remarks>Splitter destination ids are defined right after this header.</remarks>
  42. public int DestinationCount;
  43. /// <summary>
  44. /// The expected constant of any input header.
  45. /// </summary>
  46. private const uint ValidMagic = 0x49444E53;
  47. /// <summary>
  48. /// Check if the magic is valid.
  49. /// </summary>
  50. /// <returns>Returns true if the magic is valid.</returns>
  51. public bool IsMagicValid()
  52. {
  53. return Magic == ValidMagic;
  54. }
  55. }
  56. }