' ########################################################################################
' Microsoft Windows
' File: MPEGType.inc
' Contents: MPEG system stream compound type definition
' 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_mpegtype_PBI)
#DEFINE PBX_mpegtype_PBI
%EQUATE `MPEGTYPE_INC = 1
#INCLUDE ONCE "Legacy/UI/uuids.inc"
#INCLUDE ONCE "Legacy/System/strmif.inc"
#INCLUDE ONCE "Legacy/System/MMReg.inc"
'//
'// AM_MPEGSYSTEMTYPE defines the format block contents for
'// data of type MEDIATYPE_MPEG1System when the format
'// block GUID is FORMAT_MPEG1System
'//
'// The format block consists of elements of type
'// AM_MPEGSYSTEMTYPE up to the length of the format block
'// Each format block is 8-byte aligned from the start of
'// the format block
'//
' // Size = 84 bytes
TYPE AM_MPEGSTREAMTYPE DWORD
 dwStreamId AS DWORD ' DWORD // Stream id of stream to process
 dwReserved AS DWORD ' DWORD // 8-byte alignment
 mt AS AM_MEDIA_TYPE ' // Type for substream - pbFormat is NULL
 bFormat(0) AS BYTE ' BYTE // Format data
END TYPE
' // Size = 92 bytes
TYPE AM_MPEGSYSTEMTYPE DWORD
 dwBitRate AS DWORD ' DWORD // Bits per second
 cStreams AS DWORD ' DWORD // Number of streams
 Streams(0) AS AM_MPEGSTREAMTYPE
END TYPE
'//
'// Helper macros for AM_MPEGSTREAMTYPE
'//
'#define AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) \
' FIELD_OFFSET(AM_MPEGSTREAMTYPE, bFormat[(pStreamType)->mt.cbFormat])
'#define AM_MPEGSTREAMTYPE_NEXT(pStreamType) \
' ((AM_MPEGSTREAMTYPE *)((PBYTE)(pStreamType) + \
' ((AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) + 7) & ~7)))
'//
'// IMpegAudioDecoder
'//
'// Values for DualMode
%EQUATE `AM_MPEG_AUDIO_DUAL_MERGE = 0
%EQUATE `AM_MPEG_AUDIO_DUAL_LEFT = 1
%EQUATE `AM_MPEG_AUDIO_DUAL_RIGHT = 2
' ########################################################################################
' Interface name = IMpegAudioDecoder
' IID = B45DD570-3C77-11D1-ABE1-00A0C905F375
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMpegAudioDecoder_INTERFACE_DEFINED)
 %IMpegAudioDecoder_INTERFACE_DEFINED = 1
INTERFACE IMpegAudioDecoder $IID_IMpegAudioDecoder
 INHERIT IUnknown
 ' =====================================================================================
 METHOD get_FrequencyDivider ( ' VTable offset = 12
 BYREF pDivider AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_FrequencyDivider ( ' VTable offset = 16
 BYVAL Divider AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_DecoderAccuracy ( ' VTable offset = 20
 BYREF pAccuracy AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_DecoderAccuracy ( ' VTable offset = 24
 BYVAL Accuracy AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_Stereo ( ' VTable offset = 28
 BYREF pStereo AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_Stereo ( ' VTable offset = 32
 BYVAL Stereo AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_DecoderWordSize ( ' VTable offset = 36
 BYREF pWordSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_DecoderWordSize ( ' VTable offset = 40
 BYVAL WordSize AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_IntegerDecode ( ' VTable offset = 44
 BYREF pIntDecode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_IntegerDecode ( ' VTable offset = 48
 BYVAL IntDecode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_DualMode ( ' VTable offset = 52
 BYREF pIntDecode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD put_DualMode ( ' VTable offset = 56
 BYVAL IntDecode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD get_AudioFormat ( ' VTable offset = 60
 BYREF lpFmt AS MPEG1WAVEFORMAT
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMpegAudioDecoder_INTERFACE_DEFINED__ */
#ENDIF
