using System;
using System.Runtime.InteropServices;
using NAudio.Wave;
namespace NAudio.CoreAudioApi.Interfaces
{
///
/// n.b. WORK IN PROGRESS - this code will probably do nothing but crash at the moment
/// Defined in AudioClient.h
///
[Guid("1CB9AD4C-DBFA-4c32-B178-C2F568A703B2"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IAudioClient
{
void Initialize(AudioClientShareMode shareMode,
AudioClientStreamFlags StreamFlags,
long hnsBufferDuration, // REFERENCE_TIME
long hnsPeriodicity, // REFERENCE_TIME
[In] WaveFormat pFormat,
[In] ref Guid AudioSessionGuid);
///
/// The GetBufferSize method retrieves the size (maximum capacity) of the endpoint buffer.
///
void GetBufferSize(out uint bufferSize);
[return: MarshalAs(UnmanagedType.I8)]
long GetStreamLatency();
void GetCurrentPadding(out int currentPadding);
[PreserveSig]
int IsFormatSupported(
AudioClientShareMode shareMode,
[In] WaveFormat pFormat,
[Out, MarshalAs(UnmanagedType.LPStruct)] out WaveFormatExtensible closestMatchFormat);
void GetMixFormat(out IntPtr deviceFormatPointer);
// REFERENCE_TIME is 64 bit int
void GetDevicePeriod(out long defaultDevicePeriod, out long minimumDevicePeriod);
void Start();
void Stop();
void Reset();
void SetEventHandle(IntPtr eventHandle);
void GetService(ref Guid interfaceId, [MarshalAs(UnmanagedType.IUnknown)] out object interfacePointer);
}
}