' ########################################################################################
' Microsoft Windows (Windows 7)
' File: AudioEngineEndpoint.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_AudioEngineEndpoint_PBI)
#DEFINE PBX_AudioEngineEndpoint_PBI
%EQUATE `AUDIOENGINEENDPOINT_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
#INCLUDE ONCE "Legacy/System/PropIdl.inc"
#INCLUDE ONCE "Legacy/Media/AudioAPOTypes.inc"
#INCLUDE ONCE "Legacy/System/MMReg.inc"
' // Size = 64 bytes
TYPE AUDIO_ENDPOINT_EXCLUSIVE_CREATE_PARAMS ' Must be 8 bytes aligned
 u32Size AS DWORD ' UINT32
 filler1 AS DWORD ' // TO keep QWORD alignment
 hConnection AS QUAD ' LONGLONG
 bIsRtCapable AS LONG
 filler2 AS DWORD ' // TO keep QWORD alignment
 hnsBufferDuration AS QUAD ' HNSTIME
 hnsPeriod AS QUAD ' HNSTIME
 u32LatencyCoefficient AS DWORD ' UINT32
 wfxDeviceFormat AS WAVEFORMATEX ' WAVEFORMATEX
 filler3 AS WORD ' // TO keep QWORD alignment
END TYPE
' // Size = 28 bytes
TYPE AUDIO_ENDPOINT_SHARED_CREATE_PARAMS DWORD
 u32Size AS DWORD ' UINT32
 u32TSSessionId AS DWORD ' UINT32
 wfxDeviceFormat AS WAVEFORMATEX ' WAVEFORMATEX
END TYPE
' AE_POSITION_FLAGS enum
%EQUATE `POSITION_INVALID = 0
%EQUATE `POSITION_DISCONTINUOUS = 1
%EQUATE `POSITION_CONTINUOUS = 2
%EQUATE `POSITION_QPC_ERROR = 4
' // Size = 40 bytes
TYPE AE_CURRENT_POSITION ' Must be 8 bytes aligned
 u64DevicePosition AS QUAD ' UINT64
 u64StreamPosition AS QUAD ' UINT64
 u64PaddingFrames AS QUAD ' UINT64
 hnsQPCPosition AS QUAD ' HNSTIME
 f32FramesPerSecond AS SINGLE ' FLOAT32
 Flag AS LONG ' AE_POSITION_FLAGS
END TYPE
' ########################################################################################
' Interface name = IAudioEndpoint
' IID = 30A99515-1527-4451-AF9F-00C5F0234DAF
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioEndpoint_INTERFACE_DEFINED)
 %IAudioEndpoint_INTERFACE_DEFINED = 1
$IID_IAudioEndpoint = GUID$("{30A99515-1527-4451-AF9F-00C5F0234DAF}")
INTERFACE IAudioEndpoint $IID_IAudioEndpoint
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetFrameFormat ( ' VTable offset = 12
 BYREF ppFormat AS WAVEFORMATEX
 ) AS LONG
 ' =====================================================================================
 METHOD GetFramesPerPacket ( ' VTable offset = 16
 BYREF pFramesPerPacket AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLatency ( ' VTable offset = 20
 BYREF pLatency AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD SetStreamFlags ( ' VTable offset = 24
 BYVAL streamFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetEventHandle ( ' VTable offset = 28
 BYVAL eventHandle AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioEndpoint_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IAudioEndpointRT
' IID = DFD2005F-A6E5-4d39-A265-939ADA9FBB4D
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioEndpointRT_INTERFACE_DEFINED)
 %IAudioEndpointRT_INTERFACE_DEFINED = 1
$IID_IAudioEndpointRT = GUID$("{DFD2005F-A6E5-4d39-A265-939ADA9FBB4D}")
INTERFACE IAudioEndpointRT $IID_IAudioEndpointRT
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetCurrentPadding ( ' VTable offset = 12
 BYREF pPadding AS QUAD
 , BYREF pAeCurrentPosition AS AE_CURRENT_POSITION
 ) ' void
 ' =====================================================================================
 METHOD ProcessingComplete ( ' VTable offset = 16
 ) ' void
 ' =====================================================================================
 METHOD SetPinInactive ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD SetPinActive ( ' VTable offset = 24
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioEndpointRT_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IAudioInputEndpointRT
' IID = 8026AB61-92B2-43C1-A1DF-5C37EBD08D82
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioInputEndpointRT_INTERFACE_DEFINED)
 %IAudioInputEndpointRT_INTERFACE_DEFINED = 1
$IID_IAudioInputEndpointRT = GUID$("{8026AB61-92B2-43C1-A1DF-5C37EBD08D82}")
INTERFACE IAudioInputEndpointRT $IID_IAudioInputEndpointRT
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetInputDataPointer ( ' VTable offset = 12
 BYREF pConnectionProperty AS APO_CONNECTION_PROPERTY
 , BYREF pAeTimeStamp AS AE_CURRENT_POSITION
 ) ' void
 ' =====================================================================================
 METHOD ReleaseInputDataPointer ( ' VTable offset = 16
 BYVAL u32FrameCount AS DWORD
 , BYVAL pDataPointer AS DWORD
 ) ' void
 ' =====================================================================================
 METHOD PulseEndpoint ( ' VTable offset = 20
 ) ' void
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioInputEndpointRT_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IAudioOutputEndpointRT
' IID = 8FA906E4-C31C-4E31-932E-19A66385E9AA
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioOutputEndpointRT_INTERFACE_DEFINED)
 %IAudioOutputEndpointRT_INTERFACE_DEFINED = 1
$IID_IAudioOutputEndpointRT = GUID$("{8FA906E4-C31C-4E31-932E-19A66385E9AA}")
INTERFACE IAudioOutputEndpointRT $IID_IAudioOutputEndpointRT
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetOutputDataPointer ( ' VTable offset = 12
 BYVAL u32FrameCount AS DWORD
 , BYREF pAeTimeStamp AS AE_CURRENT_POSITION
 ) AS DWORD ' UINT_PTR
 ' =====================================================================================
 METHOD ReleaseOutputDataPointer ( ' VTable offset = 16
 BYREF pConnectionProperty AS APO_CONNECTION_PROPERTY
 ) ' void
 ' =====================================================================================
 METHOD PulseEndpoint ( ' VTable offset = 20
 ) ' void
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioOutputEndpointRT_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IAudioDeviceEndpoint
' IID = D4952F5A-A0B2-4cc4-8B82-9358488DD8AC
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioDeviceEndpoint_INTERFACE_DEFINED)
 %IAudioDeviceEndpoint_INTERFACE_DEFINED = 1
$IID_IAudioDeviceEndpoint = GUID$("{D4952F5A-A0B2-4cc4-8B82-9358488DD8AC}")
INTERFACE IAudioDeviceEndpoint $IID_IAudioDeviceEndpoint
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetBuffer ( ' VTable offset = 12
 BYVAL MaxPeriod AS QUAD
 , BYVAL u32LatencyCoefficient AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRTCaps ( ' VTable offset = 16
 BYREF pbIsRTCapable AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetEventDrivenCapable ( ' VTable offset = 20
 BYREF pbisEventCapable AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD WriteExclusiveModeParametersToSharedMemory ( ' VTable offset = 24
 BYVAL hTargetProcess AS DWORD
 , BYVAL hnsPeriod AS QUAD
 , BYVAL hnsBufferDuration AS QUAD
 , BYVAL u32LatencyCoefficient AS DWORD
 , BYREF pu32SharedMemorySize AS DWORD
 , BYREF phSharedMemory AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioDeviceEndpoint_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IAudioEndpointControl
' IID = C684B72A-6DF4-4774-BDF9-76B77509B653
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IAudioEndpointControl_INTERFACE_DEFINED)
 %IAudioEndpointControl_INTERFACE_DEFINED = 1
$IID_IAudioEndpointControl = GUID$("{C684B72A-6DF4-4774-BDF9-76B77509B653}")
INTERFACE IAudioEndpointControl $IID_IAudioEndpointControl
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Start ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD Reset ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
 METHOD Stop ( ' VTable offset = 18
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IAudioEndpointControl_INTERFACE_DEFINED__ */
#ENDIF
