IDirectSound3DBuffer8 Interface

 

 

' ***************************************************************************************
' IDirectSound3DBuffer8 Interface
' The IDirectSound3DBuffer8 interface is used to retrieve and set parameters that describe
' the position, orientation, and environment of a sound buffer in 3-D space.
' IDirectSound3DBuffer8 is a define for IDirectSound3DBuffer. The two interface names are
' interchangeable.
' The IDirectSound3DBuffer8 interface is obtained from a buffer that was created with the
' DSBCAPS_CTRL3D flag. You can get it from the IDirectSoundBuffer8 interface by using the
' QueryInterface method, or retrieve it from an audiopath by using
' IDirectMusicSegmentState8::GetObjectInPath or IDirectMusicAudioPath8::GetObjectInPath.
' ***************************************************************************************

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

'    // IDirectSound3DBuffer methods
'  3.  STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER pDs3dBuffer) PURE;
'  4.  STDMETHOD(GetConeAngles)        (THIS_ LPDWORD pdwInsideConeAngle, LPDWORD pdwOutsideConeAngle) PURE;
'  5.  STDMETHOD(GetConeOrientation)   (THIS_ D3DVECTOR* pvOrientation) PURE;
'  6.  STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG plConeOutsideVolume) PURE;
'  7.  STDMETHOD(GetMaxDistance)       (THIS_ D3DVALUE* pflMaxDistance) PURE;
'  8.  STDMETHOD(GetMinDistance)       (THIS_ D3DVALUE* pflMinDistance) PURE;
'  9.  STDMETHOD(GetMode)              (THIS_ LPDWORD pdwMode) PURE;
' 10.  STDMETHOD(GetPosition)          (THIS_ D3DVECTOR* pvPosition) PURE;
' 11.  STDMETHOD(GetVelocity)          (THIS_ D3DVECTOR* pvVelocity) PURE;
' 12.  STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE;
' 13.  STDMETHOD(SetConeAngles)        (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
' 14.  STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
' 15.  STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
' 16.  STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
' 17.  STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
' 18.  STDMETHOD(SetMode)              (THIS_ DWORD dwMode, DWORD dwApply) PURE;
' 19.  STDMETHOD(SetPosition)          (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
' 20.  STDMETHOD(SetVelocity)          (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
'};
' ***************************************************************************************

' ***************************************************************************************
' GetAllParameters
' The GetAllParameters method retrieves the 3-D properties of the sound buffer.
' HRESULT GetAllParameters(
'   LPDS3DBUFFER pDs3dBuffer
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetAllParameters ALIAS "IDirectSound3DBuffer8_GetAllParameters" (_
    BYVAL pthis AS DWORD PTR, BYREF pDs3dBuffer AS DS3DBUFFER) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetConeAngles
' The GetConeAngles method retrieves the inside and outside angles of the sound projection
' cone.
' HRESULT GetConeAngles(
'   LPDWORD pdwInsideConeAngle,
'   LPDWORD pdwOutsideConeAngle
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetConeAngles ALIAS "IDirectSound3DBuffer8_GetConeAngles" (_
    BYVAL pthis AS DWORD PTR, BYREF pdwInsideConeAngle AS DWORD, BYREF pdwOutsideConeAngle AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetConeOrientation
' The GetConeOrientation method retrieves the orientation of the sound projection cone.
' HRESULT GetConeOrientation(
'   D3DVECTOR * pvOrientation
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetConeOrientation ALIAS "IDirectSound3DBuffer8_GetConeOrientation" (_
    BYVAL pthis AS DWORD PTR, BYREF pvOrientation AS D3DVECTOR) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetConeOutsideVolume
' The GetConeOutsideVolume method retrieves the volume of the sound outside the outside
' angle of the sound projection cone.
' HRESULT GetConeOutsideVolume(
'   LPLONG plConeOutsideVolume
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetConeOutsideVolume ALIAS "IDirectSound3DBuffer8_GetConeOutsideVolume" (_
    BYVAL pthis AS DWORD PTR, BYREF plConeOutsideVolume AS LONG) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetMaxDistance
' The GetMaxDistance method retrieves the maximum distance, which is the distance from the
' listener beyond which sounds in this buffer are no longer attenuated.
' HRESULT GetMaxDistance(
'   D3DVALUE * pflMaxDistance
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetMaxDistance ALIAS "IDirectSound3DBuffer8_GetMaxDistance" (_
    BYVAL pthis AS DWORD PTR, BYREF pflMaxDistance AS SINGLE) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetMinDistance
' The GetMinDistance method retrieves the minimum distance, which is the distance from the
' listener at which sounds in this buffer begin to be attenuated.
' HRESULT GetMinDistance(
'   D3DVALUE * pflMinDistance
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetMinDistance ALIAS "IDirectSound3DBuffer8_GetMinDistance" (_
    BYVAL pthis AS DWORD PTR, BYREF pflMinDistance AS SINGLE) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetMode
' The GetMode method retrieves the operation mode for 3-D sound processing.
' HRESULT GetMode(
'   LPDWORD pdwMode
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetMode ALIAS "IDirectSound3DBuffer8_GetMode" (_
    BYVAL pthis AS DWORD PTR, BYREF pdwMode AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetPosition
' The GetPosition method retrieves the position of the sound source.
' HRESULT GetPosition(
'   D3DVECTOR * pvPosition
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetPosition ALIAS "IDirectSound3DBuffer8_GetPosition" (_
    BYVAL pthis AS DWORD PTR, BYREF pvPosition AS D3DVECTOR) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetVelocity
' The GetVelocity method retrieves the velocity of the sound source.
' HRESULT GetVelocity(
'   D3DVECTOR * pvVelocity
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_GetVelocity ALIAS "IDirectSound3DBuffer8_GetVelocity" (_
    BYVAL pthis AS DWORD PTR, BYREF pvVelocity AS D3DVECTOR) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetAllParameters
' The SetAllParameters method sets all 3-D sound buffer properties.
' HRESULT SetAllParameters(
'   LPCDS3DBUFFER pcDs3dBuffer,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetAllParameters ALIAS "IDirectSound3DBuffer8_SetAllParameters" (_
    BYVAL pthis AS DWORD PTR, BYREF pcDs3dBuffer AS DS3DBUFFER, BYVAL dwApply AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[12] USING IDirectSound3DBuffer8_SetAllParameters(pthis, pcDs3dBuffer, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetConeAngles
' The SetConeAngles method sets the inside and outside angles of the sound projection cone.
' HRESULT SetConeAngles(
'   DWORD dwInsideConeAngle,
'   DWORD dwOutsideConeAngle,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetConeAngles ALIAS "IDirectSound3DBuffer8_SetConeAngles" (_
    BYVAL pthis AS DWORD PTR, BYVAL dwInsideConeAngle AS DWORD, BYVAL dwOutsideConeAngle AS DWORD, _
    BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetConeOrientation
' The SetConeOrientation method sets the orientation of the sound projection cone.
' HRESULT SetConeOrientation(
'   D3DVALUE x,
'   D3DVALUE y,
'   D3DVALUE z,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetConeOrientation ALIAS "IDirectSound3DBuffer8_SetConeOrientation" (_
    BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
    BYVAL z AS SINGLE, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetConeOutsideVolume
' The SetConeOutsideVolume method sets the volume of the sound outside the outside angle
' of the sound projection cone.
' HRESULT SetConeOutsideVolume(
'   LONG lConeOutsideVolume,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetConeOutsideVolume ALIAS "IDirectSound3DBuffer8_SetConeOutsideVolume" (_
    BYVAL pthis AS DWORD PTR, BYVAL lConeOutsideVolume AS LONG, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetMaxDistance
' The SetMaxDistance method sets the maximum distance, which is the distance from the
' listener beyond which sounds in this buffer are no longer attenuated.
' HRESULT SetMaxDistance(
'   D3DVALUE flMaxDistance,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetMaxDistance ALIAS "IDirectSound3DBuffer8_SetMaxDistance" (_
    BYVAL pthis AS DWORD PTR, BYVAL flMaxDistance AS SINGLE, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetMinDistance
' The SetMinDistance method sets the minimum distance, which is the distance from the
' listener at which sounds in this buffer begin to be attenuated.
' HRESULT SetMinDistance(
'   D3DVALUE flMinDistance,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetMinDistance ALIAS "IDirectSound3DBuffer8_SetMinDistance" (_
    BYVAL pthis AS DWORD PTR, BYVAL flMinDistance AS SINGLE, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetMode
' The SetMode method sets the operation mode for 3-D sound processing.
' HRESULT SetMode(
'   DWORD dwMode,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetMode ALIAS "IDirectSound3DBuffer8_SetMode" (_
    BYVAL pthis AS DWORD PTR, BYVAL dwMode AS DWORD, BYVAL dwApply AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[18] USING IDirectSound3DBuffer8_SetMode(pthis, dwMode, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetPosition
' The SetPosition method sets the position of the sound source.
' HRESULT SetPosition(
'   D3DVALUE x,
'   D3DVALUE y,
'   D3DVALUE z,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetPosition ALIAS "IDirectSound3DBuffer8_SetPosition" (_
    BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
    BYVAL z AS SINGLE, BYVAL dwApply AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[19] USING IDirectSound3DBuffer8_SetPosition(pthis, x, y, x, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetVelocity
' The SetVelocity method sets the velocity of the sound source.
' HRESULT SetVelocity(
'   D3DVALUE x,
'   D3DVALUE y,
'   D3DVALUE z,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DBuffer8_SetVelocity ALIAS "IDirectSound3DBuffer8_SetVelocity" (_
    BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
    BYVAL z AS SINGLE, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

 

Page last updated on Wednesday, 15 March 2006 01:08:20 +0100