using System; using System.Runtime.InteropServices; namespace SharpDX.X3DAudio { /// /// No documentation. /// /// /// X3DAUDIO_DSP_SETTINGS public partial class DspSettings { /// /// Initializes a new instance of the class. /// /// The source channel count. /// The destination channel count. public DspSettings(int sourceChannelCount, int destinationChannelCount) { SourceChannelCount = sourceChannelCount; DestinationChannelCount = destinationChannelCount; MatrixCoefficients = new float[sourceChannelCount * destinationChannelCount]; DelayTimes = new float[destinationChannelCount]; } /// /// The matrix coefficients /// public readonly float[] MatrixCoefficients; /// /// The delay times /// public readonly float[] DelayTimes; // Internal native struct used for marshalling [StructLayout(LayoutKind.Sequential, Pack = 1)] internal partial struct __Native { public System.IntPtr MatrixCoefficientsPointer; public System.IntPtr DelayTimesPointer; public int SrcChannelCount; public int DstChannelCount; public float LPFDirectCoefficient; public float LPFReverbCoefficient; public float ReverbLevel; public float DopplerFactor; public float EmitterToListenerAngle; public float EmitterToListenerDistance; public float EmitterVelocityComponent; public float ListenerVelocityComponent; } // Method to marshal from native to managed struct internal unsafe void __MarshalFrom(ref __Native @ref) { this.LpfDirectCoefficient = @ref.LPFDirectCoefficient; this.LpfReverbCoefficient = @ref.LPFReverbCoefficient; this.ReverbLevel = @ref.ReverbLevel; this.DopplerFactor = @ref.DopplerFactor; this.EmitterToListenerAngle = @ref.EmitterToListenerAngle; this.EmitterToListenerDistance = @ref.EmitterToListenerDistance; this.EmitterVelocityComponent = @ref.EmitterVelocityComponent; this.ListenerVelocityComponent = @ref.ListenerVelocityComponent; } } }