|
|
|
IDirectSoundCaptureBuffer8 Interface |
|
' ***************************************************************************************
' IDirectSoundCaptureBuffer8 Interface
' The IDirectSoundCaptureBuffer8 interface is used to manipulate sound capture buffers.
' To obtain the IDirectSoundCaptureBuffer8 interface, call the
' IDirectSoundCapture8::CreateCaptureBuffer method to obtain IDirectSoundCaptureBuffer,
' then pass IID_IDirectSoundCaptureBuffer8 to IDirectSoundCaptureBuffer::QueryInterface.
' Note IDirectSoundCaptureBuffer8 cannot be obtained if the IDirectSoundCapture8
' interface was obtained by using the DirectSoundCaptureCreate function.
' ***************************************************************************************
' ***************************************************************************************
'DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
'{
' // IUnknown methods
' 0. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
' 1. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
' 2. STDMETHOD_(ULONG,Release) (THIS) PURE;
' // IDirectSoundCaptureBuffer methods
' 3. STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
' 4. STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
' 5. STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
' 6. STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
' 7. STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
' 8. STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
' LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
' 9. STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
' 10. STDMETHOD(Stop) (THIS) PURE;
' 11. STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
'};
' ***************************************************************************************
' ***************************************************************************************
'DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer)
'{
' // IUnknown methods
' 0. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
' 1. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
' 2. STDMETHOD_(ULONG,Release) (THIS) PURE;
' // IDirectSoundCaptureBuffer methods
' 3. STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
' 4. STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
' 5. STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
' 6. STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
' 7. STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
' 8. STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
' LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
' 9. STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
' 10. STDMETHOD(Stop) (THIS) PURE;
' 11. STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
' // IDirectSoundCaptureBuffer8 methods
' 12. STDMETHOD(GetObjectInPath) (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
' 13. STDMETHOD(GetFXStatus) (DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
'};
' ***************************************************************************************
' ***************************************************************************************
' GetCaps
' The GetCaps method retrieves the capabilities of the capture device.
' HRESULT GetCaps(
' LPDSCBCAPS pDSCBCaps
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_GetCaps ALIAS "IDirectSoundCaptureBuffer_GetCaps" ( _
BYVAL pthis AS DWORD PTR, BYREF pDSCaps AS DSCAPS) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[3] USING IDirectSoundCaptureBuffer_GetCaps(pthis, pDSCaps) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' GetCurrentPosition
' The GetCurrentPosition method retrieves the positions of the capture and read cursors in
' the buffer.
' The capture cursor is ahead of the read cursor. The data after the read position up to
' and including the capture position is not necessarily valid data.
' HRESULT GetCurrentPosition(
' LPDWORD pdwCapturePosition,
' LPDWORD pdwReadPosition
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_GetCurrentPosition ALIAS "IDirectSoundCaptureBuffer_GetCurrentPosition" ( _
BYVAL pthis AS DWORD PTR, BYREF pdwCapturePosition AS DWORD, BYREF pdwReadPosition AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[4] USING IDirectSoundCaptureBuffer_GetCurrentPosition(pthis, pdwCapturePosition, pdwReadPosition) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' GetFormat
' The GetFormat method retrieves the waveform format of the capture buffer.
' HRESULT GetFormat(
' LPWAVEFORMATEX pwfxFormat,
' DWORD dwSizeAllocated,
' LPDWORD pdwSizeWritten
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_GetFormat ALIAS "IDirectSoundCaptureBuffer_GetFormat" ( _
BYVAL pthis AS DWORD PTR, BYVAL pwfxFormat AS DWORD, BYVAL dwSizeAllocated AS DWORD, _
BYREF pdwSizeWritten AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[5] USING IDirectSoundCaptureBuffer_GetFormat(pthis, pwfxFormat, dwSizeAllocated, pdwSizeWritten) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' GetStatus
' The GetStatus method retrieves the status of the capture buffer.
' HRESULT GetStatus(
' LPDWORD pdwStatus
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_GetStatus ALIAS "IDirectSoundCaptureBuffer_GetStatus" ( _
BYVAL pthis AS DWORD PTR, BYREF pdwStatus AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[6] USING IDirectSoundCaptureBuffer_GetStatus(pthis, pdwStatus) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' Initialize
' The Initialize method initializes a capture buffer object. Because the
' IDirectSoundCapture8::CreateCaptureBuffer method and the DirectSoundFullDuplexCreate8
' function call the IDirectSoundCaptureBuffer8::Initialize method internally, this method
' is not used by applications.
' HRESULT Initialize(
' LPDIRECTSOUNDCAPTURE pDirectSoundCapture,
' LPCDSCBUFFERDESC pcDSCBufferDesc
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_Initialize ALIAS "IDirectSoundCaptureBuffer_Initialize" ( _
BYVAL pthis AS DWORD PTR, BYVAL pDirectSoundCapture AS DWORD, _
BYREF pcDSCBufferDesc AS DSCBUFFERDESC) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[7] USING IDirectSoundCaptureBuffer_Initialize(pthis, pDirectSoundCapture, pcDSCBufferDesc) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' Lock
' The Lock method locks a portion of the buffer. Locking the buffer returns pointers into
' the buffer, allowing the application to read or write audio data into memory.
' HRESULT Lock(
' DWORD dwOffset,
' DWORD dwBytes,
' LPVOID *ppvAudioPtr1,
' LPDWORD pdwAudioBytes1,
' LPVOID *ppvAudioPtr2,
' LPDWORD pdwAudioBytes2,
' DWORD dwFlags
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_Lock ALIAS "IDirectSoundCaptureBuffer_Lock" ( _
BYVAL pthis AS DWORD PTR, BYVAL dwOffset AS DWORD, BYVAL dwBytes AS DWORD, _
BYREF ppvAudioPtr1 AS DWORD, BYREF pdwAudioBytes1 AS DWORD, BYREF ppvAudioPtr2 AS DWORD, _
BYREF pdwAudioBytes2 AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[8] USING IDirectSoundCaptureBuffer_Lock(pthis, dwOffset, dwBytes, ppvAudioPtr1, pdwAudioBytes1, ppvAudioPtr2, pdwAudioBytes2, dwFlags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' Start
' The Start method begins capturing data into the buffer. If the buffer is already
' capturing, the method has no effect.
' HRESULT Start(
' DWORD dwFlags
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_Start ALIAS "IDirectSoundCaptureBuffer_Start" ( _
BYVAL pthis AS DWORD PTR, BYVAL dwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[9] USING IDirectSoundCaptureBuffer_Start(pthis, dwFlags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' Stop
' The Stop method stops the buffer so that it is no longer capturing data. If the buffer
' is not capturing, the method has no effect.
' HRESULT Stop();
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_Stop ALIAS "IDirectSoundCaptureBuffer_Stop" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[10] USING IDirectSoundCaptureBuffer_Stop(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' Unlock
' The Unlock method unlocks the buffer.
' HRESULT Unlock(
' LPVOID pvAudioPtr1,
' DWORD dwAudioBytes1,
' LPVOID pvAudioPtr2,
' DWORD dwAudioBytes2
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer_Unlock ALIAS "IDirectSoundCaptureBuffer_Unlock" ( _
BYVAL pthis AS DWORD PTR, BYVAL pvAudioPtr1 AS DWORD, BYVAL dwAudioBytes1 AS DWORD, _
BYVAL pvAudioPtr2 AS DWORD, BYVAL dwAudioBytes2 AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[11] USING IDirectSoundCaptureBuffer_Unlock(pthis, pvAudioPtr1, dwAudioBytes1, pvAudioPtr2, dwAudioBytes2) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' GetObjectInPath
' The GetObjectInPath method retrieves an interface to an effect object associated with
' the buffer.
' HRESULT GetObjectInPath(
' REFGUID rguidObject,
' DWORD dwIndex,
' REFGUID rguidInterface,
' LPVOID * ppObject
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer8_GetObjectInPath ALIAS "IDirectSoundCaptureBuffer8_GetObjectInPath" ( _
BYVAL pthis AS DWORD PTR, BYREF rguidObject AS GUID, BYVAL dwIndex AS DWORD, _
BYREF rguidInterface AS GUID, BYREF ppObject AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[12] USING IDirectSoundCaptureBuffer8_GetObjectInPath(pthis, rguidObject, dwIndex, rguidInterface, ppObject) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
' ***************************************************************************************
' GetFXStatus
' The GetFXStatus method retrieves the status of capture effects.
' HRESULT GetFXStatus(
' DWORD dwFXCount,
' LPDWORD pdwFXStatus
' );
' ***************************************************************************************
FUNCTION IDirectSoundCaptureBuffer8_GetFXStatus ALIAS "IDirectSoundCaptureBuffer8_GetFXStatus" ( _
BYVAL pthis AS DWORD PTR, BYVAL dwFXCount AS DWORD, BYVAL pdwFXStatus AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[13] USING IDirectSoundCaptureBuffer8_GetFXStatus(pthis, dwFXCount, pdwFXStatus) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ***************************************************************************************
|
Page last updated on Wednesday, 15 March 2006 01:14:00 +0100