IDirectSound3DListener8 Interface

 

 

' ***************************************************************************************
' IDirectSound3DListener8 Interface
' The IDirectSound3DListener8 interface is used to retrieve and set parameters that
' describe a listener's position, orientation, and listening environment in 3-D space.
' The interface can be obtained by calling the IDirectSoundBuffer8::QueryInterface method
' on a primary buffer created with the DSBCAPS_CTRL3D flag.
' ***************************************************************************************

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

'    // IDirectSound3DListener methods
'  3.  STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER pListener) PURE;
'  4.  STDMETHOD(GetDistanceFactor)        (THIS_ D3DVALUE* pflDistanceFactor) PURE;
'  5.  STDMETHOD(GetDopplerFactor)         (THIS_ D3DVALUE* pflDopplerFactor) PURE;
'  6.  STDMETHOD(GetOrientation)           (THIS_ D3DVECTOR* pvOrientFront, D3DVECTOR* pvOrientTop) PURE;
'  7.  STDMETHOD(GetPosition)              (THIS_ D3DVECTOR* pvPosition) PURE;
'  8.  STDMETHOD(GetRolloffFactor)         (THIS_ D3DVALUE* pflRolloffFactor) PURE;
'  9.  STDMETHOD(GetVelocity)              (THIS_ D3DVECTOR* pvVelocity) PURE;
' 10.  STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER pcListener, DWORD dwApply) PURE;
' 11.  STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
' 12.  STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
' 13.  STDMETHOD(SetOrientation)           (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront,
'                                                 D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
' 14.  STDMETHOD(SetPosition)              (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
' 16.  STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
' 16.  STDMETHOD(SetVelocity)              (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
' 17.  STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
'};
' ***************************************************************************************

' ***************************************************************************************
' GetAllParameters
' The GetAllParameters method retrieves all 3-D parameters of the sound environment and
' the listener.
' HRESULT GetAllParameters(
'   LPDS3DLISTENER pListener
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetAllParameters ALIAS "IDirectSound3DListener8_GetAllParameters" ( _
    BYVAL pthis AS DWORD PTR, BYREF pListener AS DS3DLISTENER) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetDistanceFactor
' The GetDistanceFactor method retrieves the distance factor, which is the number of
' meters in a vector unit.
' HRESULT GetDistanceFactor(
'   D3DVALUE * pflDistanceFactor
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetDistanceFactor ALIAS "IDirectSound3DListener8_GetDistanceFactor" ( _
    BYVAL pthis AS DWORD PTR, BYREF pflDistanceFactor AS SINGLE) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetDopplerFactor
' The GetDopplerFactor method retrieves the multiplier for the Doppler effect.
' HRESULT GetDopplerFactor(
'   D3DVALUE * pflDopplerFactor
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetDopplerFactor ALIAS "IDirectSound3DListener8_GetDopplerFactor" ( _
    BYVAL pthis AS DWORD PTR, BYREF pflDopplerFactor AS SINGLE) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetOrientation
' The GetOrientation method retrieves the orientation of the listener's head.
' HRESULT GetOrientation(
'   D3DVECTOR * pvOrientFront,
'   D3DVECTOR * pvOrientTop
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetOrientation ALIAS "IDirectSound3DListener8_GetOrientation" ( _
    BYVAL pthis AS DWORD PTR, BYREF pvOrientFront AS D3DVECTOR, _
    BYREF pvOrientTop AS D3DVECTOR) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetPosition
' The GetPosition method retrieves the listener's position.
' HRESULT GetPosition(
'   D3DVECTOR * pvPosition
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetPosition ALIAS "IDirectSound3DListener8_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[7] USING IDirectSound3DListener8_GetPosition(pthis, pvPosition) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' GetRolloffFactor
' The GetRolloffFactor method retrieves the rolloff factor, which determines the rate of
' attenuation over distance.
' HRESULT GetRolloffFactor(
'   D3DVALUE * pflRolloffFactor
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetRolloffFactor ALIAS "IDirectSound3DListener8_GetRolloffFactor" ( _
    BYVAL pthis AS DWORD PTR, BYREF pflRolloffFactor AS SINGLE) EXPORT AS LONG

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

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

' ***************************************************************************************
' GetVelocity
' The GetVelocity method retrieves the listener's velocity.
' HRESULT GetVelocity(
'   D3DVECTOR * pvVelocity
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_GetVelocity ALIAS "IDirectSound3DListener8_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[9] USING IDirectSound3DListener8_GetVelocity(pthis, pvVelocity) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetAllParameters
' The SetAllParameters method sets all 3-D parameters of the sound environment and the
' listener.
' HRESULT SetAllParameters(
'   LPCDS3DLISTENER pcListener,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetAllParameters ALIAS "IDirectSound3DListener8_SetAllParameters" ( _
    BYVAL pthis AS DWORD PTR, BYREF pcListener AS DS3DLISTENER, BYVAL dwApply AS DWORD) EXPORT AS LONG

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

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

' ***************************************************************************************
' SetDistanceFactor
' The SetDistanceFactor method sets the distance factor, which is the number of meters in
' a vector unit.
' HRESULT SetDistanceFactor(
'   D3DVALUE flDistanceFactor,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetDistanceFactor ALIAS "IDirectSound3DListener8_SetDistanceFactor" ( _
    BYVAL pthis AS DWORD PTR, BYVAL flDistanceFactor 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[11] USING IDirectSound3DListener8_SetDistanceFactor(pthis, flDistanceFactor, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetDopplerFactor
' The SetDopplerFactor method sets the multiplier for the Doppler effect.
' HRESULT SetDopplerFactor(
'   D3DVALUE flDopplerFactor,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetDopplerFactor ALIAS "IDirectSound3DListener8_SetDopplerFactor" ( _
    BYVAL pthis AS DWORD PTR, BYVAL flDopplerFactor 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[12] USING IDirectSound3DListener8_SetDopplerFactor(pthis, flDopplerFactor, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetOrientation
' The SetOrientation method sets the orientation of the listener's head.
' HRESULT SetOrientation(
'   D3DVALUE xFront,
'   D3DVALUE yFront,
'   D3DVALUE zFront,
'   D3DVALUE xTop,
'   D3DVALUE yTop,
'   D3DVALUE zTop,
'   DWORD  dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetOrientation ALIAS "IDirectSound3DListener8_SetOrientation" ( _
    BYVAL pthis AS DWORD PTR, BYVAL xFront AS SINGLE, BYVAL yFront AS SINGLE, _
    BYVAL zFront AS SINGLE, BYVAL xTop AS SINGLE, BYVAL yTop AS SINGLE, _
    BYVAL zTop 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[13] USING IDirectSound3DListener8_SetOrientation(pthis, xFront, yFront, zFront, xTop, yTop, zTop, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetPosition
' The SetPosition method sets the listener's position.
' HRESULT SetPosition(
'   D3DVALUE x,
'   D3DVALUE y,
'   D3DVALUE z,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetPosition ALIAS "IDirectSound3DListener8_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[14] USING IDirectSound3DListener8_SetPosition(pthis, z, y, z, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetRolloffFactor
' The SetRolloffFactor method sets the rolloff factor, which determines the rate of
' attenuation over distance.
' HRESULT SetRolloffFactor(
'   D3DVALUE flRolloffFactor,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetRolloffFactor ALIAS "IDirectSound3DListener8_SetRolloffFactor" (_
    BYVAL pthis AS DWORD PTR, BYVAL flRolloffFactor 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[15] USING IDirectSound3DListener8_SetRolloffFactor(pthis, flRolloffFactor, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' SetVelocity
' The SetVelocity method sets the listener's velocity.
' HRESULT SetVelocity(
'   D3DVALUE x,
'   D3DVALUE y,
'   D3DVALUE z,
'   DWORD dwApply
' );
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_SetVelocity ALIAS "IDirectSound3DListener8_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[16] USING IDirectSound3DListener8_SetVelocity(pthis, z, y, z, dwApply) TO HRESULT
    FUNCTION = HRESULT

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

' ***************************************************************************************
' CommitDeferredSettings
' The CommitDeferredSettings method commits any deferred settings made since the last call
' to this method.
' HRESULT CommitDeferredSettings();
' ***************************************************************************************
FUNCTION IDirectSound3DListener8_CommitDeferredSettings ALIAS "IDirectSound3DListener8_CommitDeferredSettings" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

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

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

 

Page last updated on Wednesday, 15 March 2006 01:05:16 +0100