VoiceChannelResource.cs 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Ryujinx.Common.Memory;
  2. using System.Runtime.InteropServices;
  3. namespace Ryujinx.Audio.Renderer.Server.Voice
  4. {
  5. /// <summary>
  6. /// Server state for a voice channel resource.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Size = 0xD0, Pack = Alignment)]
  9. public struct VoiceChannelResource
  10. {
  11. public const int Alignment = 0x10;
  12. /// <summary>
  13. /// Mix volumes for the resource.
  14. /// </summary>
  15. public Array24<float> Mix;
  16. /// <summary>
  17. /// Previous mix volumes for resource.
  18. /// </summary>
  19. public Array24<float> PreviousMix;
  20. /// <summary>
  21. /// The id of the resource.
  22. /// </summary>
  23. public uint Id;
  24. /// <summary>
  25. /// Indicate if the resource is used.
  26. /// </summary>
  27. [MarshalAs(UnmanagedType.I1)]
  28. public bool IsUsed;
  29. public void UpdateState()
  30. {
  31. Mix.AsSpan().CopyTo(PreviousMix.AsSpan());
  32. }
  33. }
  34. }