using Ryujinx.Common.Utilities;
using System;
using System.Runtime.InteropServices;
namespace Ryujinx.Audio.Renderer.Parameter
{
/// <summary>
/// Input header for a splitter destination update.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SplitterDestinationInParameter
/// Magic of the input header.
public uint Magic;
/// Target splitter destination data id.
public int Id;
/// Mix buffer volumes storage.
private MixArray _mixBufferVolume;
/// The mix to output the result of the splitter.
public int DestinationId;
/// Set to true if in use.
[MarshalAs(UnmanagedType.I1)]
public bool IsUsed;
/// Reserved/padding.
private unsafe fixed byte _reserved[3];
[StructLayout(LayoutKind.Sequential, Size = 4 * Constants.MixBufferCountMax, Pack = 1)]
private struct MixArray { }
/// Mix buffer volumes.
/// <remarks>Used when a splitter id is specified in the mix.</remarks>
public Span<float> MixBufferVolume => SpanHelpers.AsSpan<MixArray, float>(ref _mixBufferVolume);
/// The expected constant of any input header.
private const uint ValidMagic = 0x44444E53;
/// Check if the magic is valid.
/// <returns>Returns true if the magic is valid.</returns>
public bool IsMagicValid()
return Magic == ValidMagic;
}