// ------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// ------------------------------------------------------------------------------
namespace Win32.Media.Audio.XAudio2;
///
/// IXAudio2
[Guid("2b02e3cf-2e0b-4ec3-be45-1b2a3fe7210d")]
[NativeTypeName("struct IXAudio2 : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct IXAudio2 : IXAudio2.Interface, INativeGuid
{
public static ref readonly Guid IID_IXAudio2
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan data = new byte[] {
0xCF, 0xE3, 0x02, 0x2B,
0x0B, 0x2E,
0xC3, 0x4E,
0xBE,
0x45,
0x1B,
0x2A,
0x3F,
0xE7,
0x21,
0x0D
};
Debug.Assert(data.Length == Unsafe.SizeOf());
return ref Unsafe.As(ref MemoryMarshal.GetReference(data));
}
}
static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IXAudio2));
public void** lpVtbl;
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(0)]
public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((IXAudio2*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(1)]
[return: NativeTypeName("ULONG")]
public uint AddRef()
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((IXAudio2*)Unsafe.AsPointer(ref this));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(2)]
[return: NativeTypeName("ULONG")]
public uint Release()
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((IXAudio2*)Unsafe.AsPointer(ref this));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(3)]
public HResult RegisterForCallbacks(IXAudio2EngineCallback* pCallback)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((IXAudio2*)Unsafe.AsPointer(ref this), pCallback);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(4)]
public void UnregisterForCallbacks(IXAudio2EngineCallback* pCallback)
{
((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((IXAudio2*)Unsafe.AsPointer(ref this), pCallback);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(5)]
public HResult CreateSourceVoice(IXAudio2SourceVoice** ppSourceVoice, Media.Audio.WaveFormatEx* pSourceFormat, uint Flags, float MaxFrequencyRatio, IXAudio2VoiceCallback* pCallback, VoiceSends* pSendList, EffectChain* pEffectChain)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[5]))((IXAudio2*)Unsafe.AsPointer(ref this), ppSourceVoice, pSourceFormat, Flags, MaxFrequencyRatio, pCallback, pSendList, pEffectChain);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(6)]
public HResult CreateSubmixVoice(IXAudio2SubmixVoice** ppSubmixVoice, uint InputChannels, uint InputSampleRate, uint Flags, uint ProcessingStage, VoiceSends* pSendList, EffectChain* pEffectChain)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[6]))((IXAudio2*)Unsafe.AsPointer(ref this), ppSubmixVoice, InputChannels, InputSampleRate, Flags, ProcessingStage, pSendList, pEffectChain);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(7)]
public HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, char* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory StreamCategory)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[7]))((IXAudio2*)Unsafe.AsPointer(ref this), ppMasteringVoice, InputChannels, InputSampleRate, Flags, szDeviceId, pEffectChain, StreamCategory);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(8)]
public HResult StartEngine()
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[8]))((IXAudio2*)Unsafe.AsPointer(ref this));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(9)]
public void StopEngine()
{
((delegate* unmanaged[MemberFunction])(lpVtbl[9]))((IXAudio2*)Unsafe.AsPointer(ref this));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(10)]
public HResult CommitChanges(uint OperationSet)
{
return ((delegate* unmanaged[MemberFunction])(lpVtbl[10]))((IXAudio2*)Unsafe.AsPointer(ref this), OperationSet);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(11)]
public void GetPerformanceData(PerformanceData* pPerfData)
{
((delegate* unmanaged[MemberFunction])(lpVtbl[11]))((IXAudio2*)Unsafe.AsPointer(ref this), pPerfData);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(12)]
public void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved = null)
{
((delegate* unmanaged[MemberFunction])(lpVtbl[12]))((IXAudio2*)Unsafe.AsPointer(ref this), pDebugConfiguration, pReserved);
}
public interface Interface : IUnknown.Interface
{
[VtblIndex(3)]
HResult RegisterForCallbacks(IXAudio2EngineCallback* pCallback);
[VtblIndex(4)]
void UnregisterForCallbacks(IXAudio2EngineCallback* pCallback);
[VtblIndex(5)]
HResult CreateSourceVoice(IXAudio2SourceVoice** ppSourceVoice, Media.Audio.WaveFormatEx* pSourceFormat, uint Flags, float MaxFrequencyRatio, IXAudio2VoiceCallback* pCallback, VoiceSends* pSendList, EffectChain* pEffectChain);
[VtblIndex(6)]
HResult CreateSubmixVoice(IXAudio2SubmixVoice** ppSubmixVoice, uint InputChannels, uint InputSampleRate, uint Flags, uint ProcessingStage, VoiceSends* pSendList, EffectChain* pEffectChain);
[VtblIndex(7)]
HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, char* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory StreamCategory);
[VtblIndex(8)]
HResult StartEngine();
[VtblIndex(9)]
void StopEngine();
[VtblIndex(10)]
HResult CommitChanges(uint OperationSet);
[VtblIndex(11)]
void GetPerformanceData(PerformanceData* pPerfData);
[VtblIndex(12)]
void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved = null);
}
}