IDirectSoundBuffer8 Interface

 

 

' ***************************************************************************************
' IDirectSoundBuffer8 Interface
' The IDirectSoundBuffer8 interface is used to manage sound buffers.
' The IDirectSoundBuffer8 interface supersedes IDirectSoundBuffer and adds new methods.
' To obtain the interface, use the IDirectSound8::CreateSoundBuffer method to retrieve
' IDirectSoundBuffer, and then pass IID_IDirectSoundBuffer8 to
' IDirectSoundBuffer::QueryInterface.
' For the primary buffer, you must use the IDirectSoundBuffer interface;
' IDirectSoundBuffer8 is not available. IDirectSoundBuffer is not documented separately.
' For documentation, see the corresponding IDirectSoundBuffer8 methods.
' Not all methods of IDirectSoundBuffer are valid for primary buffers. For example,
' SetCurrentPosition will fail. See the reference topics for individual methods.
' ***************************************************************************************

' ***************************************************************************************
'DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
'{
'    // IUnknown methods
'  0.  STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)       (THIS) PURE;

'    // IDirectSoundBuffer methods
'  3.  STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
'  4.  STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
'  5.  STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
'  6.  STDMETHOD(GetVolume)            (THIS_ LPLONG plVolume) PURE;
'  7.  STDMETHOD(GetPan)               (THIS_ LPLONG plPan) PURE;
'  8.  STDMETHOD(GetFrequency)         (THIS_ LPDWORD pdwFrequency) PURE;
'  9.  STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
' 10.  STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
' 11.  STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
'                                             LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
' 12.  STDMETHOD(Play)                 (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
' 13.  STDMETHOD(SetCurrentPosition)   (THIS_ DWORD dwNewPosition) PURE;
' 14.  STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
' 15.  STDMETHOD(SetVolume)            (THIS_ LONG lVolume) PURE;
' 16.  STDMETHOD(SetPan)               (THIS_ LONG lPan) PURE;
' 17.  STDMETHOD(SetFrequency)         (THIS_ DWORD dwFrequency) PURE;
' 18.  STDMETHOD(Stop)                 (THIS) PURE;
' 19.  STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
' 20.  STDMETHOD(Restore)              (THIS) PURE;
'};
' ***************************************************************************************

' ***************************************************************************************
'DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer)
'{
'    // IUnknown methods
'  0.  STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)       (THIS) PURE;

'    // IDirectSoundBuffer methods
'  3.  STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
'  4.  STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
'  5.  STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
'  6.  STDMETHOD(GetVolume)            (THIS_ LPLONG plVolume) PURE;
'  7.  STDMETHOD(GetPan)               (THIS_ LPLONG plPan) PURE;
'  8.  STDMETHOD(GetFrequency)         (THIS_ LPDWORD pdwFrequency) PURE;
'  9.  STDMETHOD(GetStatus)            (THIS_ LPDWORD pdwStatus) PURE;
' 10.  STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
' 11.  STDMETHOD(Lock)                 (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
'                                             LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
' 12.  STDMETHOD(Play)                 (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
' 13.  STDMETHOD(SetCurrentPosition)   (THIS_ DWORD dwNewPosition) PURE;
' 14.  STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
' 15.  STDMETHOD(SetVolume)            (THIS_ LONG lVolume) PURE;
' 16.  STDMETHOD(SetPan)               (THIS_ LONG lPan) PURE;
' 17.  STDMETHOD(SetFrequency)         (THIS_ DWORD dwFrequency) PURE;
' 18.  STDMETHOD(Stop)                 (THIS) PURE;
' 19.  STDMETHOD(Unlock)               (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
' 20.  STDMETHOD(Restore)              (THIS) PURE;

'    // IDirectSoundBuffer8 methods
' 21.  STDMETHOD(SetFX)                (THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
' 22.  STDMETHOD(AcquireResources)     (THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
' 23.  STDMETHOD(GetObjectInPath)      (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
'};
' ***************************************************************************************

' ***************************************************************************************
' GetCaps
' The GetCaps method retrieves the capabilities of the buffer object.
' HRESULT GetCaps(
'   LPDSBCAPS pDSBufferCaps
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetCaps ALIAS "IDirectSoundBuffer_GetCaps" ( _
    BYVAL pthis AS DWORD PTR, BYREF pDSBufferCaps AS DSBCAPS) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IDirectSoundBuffer_GetCaps(pthis, pDSBufferCaps) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GetCurrentPosition
' The GetCurrentPosition method retrieves the position of the play and write cursors in
' the sound buffer.
' HRESULT GetCurrentPosition(
'   LPDWORD pdwCurrentPlayCursor,
'   LPDWORD pdwCurrentWriteCursor
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetCurrentPosition ALIAS "IDirectSoundBuffer_GetCurrentPosition" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdwCurrentPlayCursor AS DWORD, _
    BYREF pdwCurrentWriteCursor AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[4] USING IDirectSoundBuffer_GetCurrentPosition(pthis, pdwCurrentPlayCursor, pdwCurrentWriteCursor) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GetFormat
' The GetFormat method retrieves a description of the format of the sound data in the
' buffer, or the buffer size needed to retrieve the format description.
' pwfxFormat is the address of a WAVEFORMATEX or WAVEFORMATEXTENSIBLE structure that
' receives a description of the sound data in the buffer. To retrieve the buffer size
' needed to contain the format description, specify NULL. In this case the variable at
' pdwSizeWritten receives the size of the structure needed to receive the data. Use
' VARPTR to pass the address of the WAVEFORMATEX or WAVEFORMATEXTENSIBLE structure.
' HRESULT GetFormat(
'   LPWAVEFORMATEX pwfxFormat,
'   DWORD dwSizeAllocated,
'   LPDWORD pdwSizeWritten
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetFormat ALIAS "IDirectSoundBuffer_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 IDirectSoundBuffer_GetFormat(pthis, pwfxFormat, dwSizeAllocated, pdwSizeWritten) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GetVolume
' The GetVolume method retrieves the attenuation of the sound.
' HRESULT GetVolume(
'   LPLONG plVolume
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetVolume ALIAS "IDirectSoundBuffer_GetVolume" ( _
    BYVAL pthis AS DWORD PTR, BYREF plVolume AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[6] USING IDirectSoundBuffer_GetVolume(pthis, plVolume) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' The GetPan method retrieves the relative volume of the left and right audio channels.
' HRESULT GetPan(
'   LPLONG plPan
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetPan ALIAS "IDirectSoundBuffer8_GetPan" ( _
    BYVAL pthis AS DWORD PTR, BYREF plPan AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING IDirectSoundBuffer8_GetPan(pthis, plPan) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GetFrequency
' The GetFrequency method retrieves the frequency, in samples per second, at which the
' buffer is playing.
' HRESULT GetFrequency(
'   LPDWORD pdwFrequency
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetFrequency ALIAS "IDirectSoundBuffer_GetFrequency" ( _
    BYVAL pthis AS DWORD PTR, BYREF pdwFrequency AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[8] USING IDirectSoundBuffer_GetFrequency(pthis, pdwFrequency) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GerStatus
' The GetStatus method retrieves the status of the sound buffer.
' HRESULT GetStatus(
'   LPDWORD pdwStatus
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_GetStatus ALIAS "IDirectSoundBuffer_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[9] USING IDirectSoundBuffer_GetStatus(pthis, pdwStatus) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Initialize
' The Initialize method initializes a sound buffer object if it has not yet been
' initialized.
' HRESULT Initialize(
'   LPDIRECTSOUND pDirectSound,
'   LPCDSBUFFERDESC pcDSBufferDesc
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Initialize ALIAS "IDirectSoundBuffer_Initialize" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pDirectSound AS DWORD, _
    BYREF pcDSBufferDesc AS DSBUFFERDESC) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[10] USING IDirectSoundBuffer_Initialize(pthis, pDirectSound, pcDSBufferDesc) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Lock
' The Lock method readies all or part of the buffer for a data write and returns pointers
' to which data can be written.
' HRESULT Lock(
'   DWORD dwOffset,
'   DWORD dwBytes,
'   LPVOID * ppvAudioPtr1,
'   LPDWORD pdwAudioBytes1,
'   LPVOID * ppvAudioPtr2,
'   LPDWORD pdwAudioBytes2,
'   DWORD dwFlags
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Lock ALIAS "IDirectSoundBuffer_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[11] USING IDirectSoundBuffer_Lock(pthis, dwOffset, dwBytes, ppvAudioPtr1, pdwAudioBytes1, ppvAudioPtr2, pdwAudioBytes2, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Play
' The Play method causes the sound buffer to play, starting at the play cursor.
' HRESULT Play(
'   DWORD dwReserved1,
'   DWORD dwPriority,
'   DWORD dwFlags
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Play ALIAS "IDirectSoundBuffer_Play" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwReserved1 AS DWORD, BYVAL dwPriority 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[12] USING IDirectSoundBuffer_Play(pthis, dwReserved1, dwPriority, dwFlags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetCurrentPosition
' The SetCurrentPosition method sets the position of the play cursor, which is the point
' at which the next byte of data is read from the buffer.
' HRESULT SetCurrentPosition(
'   DWORD dwNewPosition
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_SetCurrentPosition ALIAS "IDirectSoundBuffer_SetCurrentPosition" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwNewPosition AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[13] USING IDirectSoundBuffer_SetCurrentPosition(pthis, dwNewPosition) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetFormat
' The SetFormat method sets the format of the primary buffer. Whenever this application
' has the input focus, DirectSound will set the primary buffer to the specified format.
' Because primary sound buffers do not support the IDirectSoundBuffer8 interface, this
' method must be called on IDirectSoundBuffer.
' On WDM drivers, setting the primary buffer format has no effect. The output format is
' determined by the kernel mixer. For more information, see DirectSound Driver Models.
' HRESULT SetFormat(
'   LPCWAVEFORMATEX pcfxFormat
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_SetFormat ALIAS "IDirectSoundBuffer_SetFormat" ( _
    BYVAL pthis AS DWORD PTR, BYREF pcfxFormat AS WAVEFORMATEX) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[14] USING IDirectSoundBuffer_SetFormat(pthis, pcfxFormat) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetVolume
' The SetVolume method sets the attenuation of the sound.
' HRESULT SetVolume(
'   LONG lVolume
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_SetVolume ALIAS "IDirectSoundBuffer_SetVolume" ( _
    BYVAL pthis AS DWORD PTR, BYVAL lVolume AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[15] USING IDirectSoundBuffer_SetVolume(pthis, lVolume) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetPan
' The SetPan method sets the relative volume of the left and right channels.
' HRESULT SetPan(
'   LONG lPan
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_SetPan ALIAS "IDirectSoundBuffer_SetPan" ( _
    BYVAL pthis AS DWORD PTR, BYVAL lPan AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[16] USING IDirectSoundBuffer_SetPan(pthis, lPan) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetFrequency
' The SetFrequency method sets the frequency at which the audio samples are played.
' HRESULT SetFrequency(
'   DWORD dwFrequency
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_SetFrequency ALIAS "IDirectSoundBuffer_SetFrequency" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwFrequency AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[17] USING IDirectSoundBuffer_SetFrequency(pthis, dwFrequency) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Stop
' The Stop method causes the sound buffer to stop playing.
' HRESULT Stop();
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Stop ALIAS "IDirectSoundBuffer_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[18] USING IDirectSoundBuffer_Stop(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Unlock
' The Unlock method releases a locked sound buffer.
' HRESULT Unlock(
'   LPVOID pvAudioPtr1,
'   DWORD dwAudioBytes1,
'   LPVOID pvAudioPtr2,
'   DWORD dwAudioBytes2
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Unlock ALIAS "IDirectSoundBuffer_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[19] USING IDirectSoundBuffer_Unlock(pthis, pvAudioPtr1, dwAudioBytes1, pvAudioPtr2, dwAudioBytes2) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Restore
' The Restore method restores the memory allocation for a lost sound buffer.
' HRESULT Restore();
' ***************************************************************************************
FUNCTION IDirectSoundBuffer_Restore ALIAS "IDirectSoundBuffer_Restore" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[20] USING IDirectSoundBuffer_Restore(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' SetFX
' The SetFX method enables effects on a buffer.
' For this method to succeed, CoInitialize must have been called. This is done
' automatically in applications that create DirectSound by using
' IDirectMusicPerformance8::InitAudio. However, applications that create DirectSound by
' using DirectSoundCreate8 must also call CoInitialize.
' The buffer must not be playing or locked.
' HRESULT SetFX(
'   DWORD dwEffectsCount,
'   LPDSEFFECTDESC pDSFXDesc,
'   LPDWORD pdwResultCodes
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer8_SetFX ALIAS "IDirectSoundBuffer8_SetFX" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwEffectsCount AS DWORD, BYVAL pDSFXDesc AS DWORD, _
    BYVAL pdwResultCodes AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[21] USING IDirectSoundBuffer8_SetFX(pthis, dwEffectsCount, pDSFXDesc, pdwResultCodes) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' AcquireResources
' The AcquireResources method allocates resources for a buffer that was created with the
' DSBCAPS_LOCDEFER flag in the DSBUFFERDESC structure.
' HRESULT AcquireResources(
'   DWORD dwFlags,
'   DWORD dwEffectsCount,
'   LPDWORD pdwResultCodes
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer8_AcquireResources ALIAS "IDirectSoundBuffer8_AcquireResources" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwFlags AS DWORD, BYVAL dwEffectsCount AS DWORD, _
    BYVAL pdwResultCodes AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[22] USING IDirectSoundBuffer8_AcquireResources(pthis, dwFlags, dwEffectsCount, pdwResultCodes) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' GetObjectInPath
' The GetObjectInPath method retrieves an interface for an effect object associated with
' the buffer.
' HRESULT GetObjectInPath(
'   REFGUID rguidObject,
'   DWORD dwIndex,
'   REFGUID rguidInterface,
'   LPVOID * ppObject
' );
' ***************************************************************************************
FUNCTION IDirectSoundBuffer8_GetObjectInPath ALIAS "IDirectSoundBuffer8_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[23] USING IDirectSoundBuffer8_GetObjectInPath(pthis, rguidObject, dwIndex, rguidInterface, ppObject) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************
 

 

Page last updated on Wednesday, 15 March 2006 01:02:13 +0100