VoiceChannelResource.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 System.Runtime.InteropServices;
  19. namespace Ryujinx.Audio.Renderer.Server.Voice
  20. {
  21. /// <summary>
  22. /// Server state for a voice channel resource.
  23. /// </summary>
  24. [StructLayout(LayoutKind.Sequential, Size = 0xD0, Pack = Alignment)]
  25. public struct VoiceChannelResource
  26. {
  27. public const int Alignment = 0x10;
  28. /// <summary>
  29. /// Mix volumes for the resource.
  30. /// </summary>
  31. public Array24<float> Mix;
  32. /// <summary>
  33. /// Previous mix volumes for resource.
  34. /// </summary>
  35. public Array24<float> PreviousMix;
  36. /// <summary>
  37. /// The id of the resource.
  38. /// </summary>
  39. public uint Id;
  40. /// <summary>
  41. /// Indicate if the resource is used.
  42. /// </summary>
  43. [MarshalAs(UnmanagedType.I1)]
  44. public bool IsUsed;
  45. public void UpdateState()
  46. {
  47. Mix.ToSpan().CopyTo(PreviousMix.ToSpan());
  48. }
  49. }
  50. }