Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.directX   Previous This
Package
Next

 


Class DirectSound3dListener

public class DirectSound3dListener implements 
            IDirectSound3dListener
{
  // Methods
  public void commitDeferredSettings();
  public void getAllParameters(DS3dListener listener);
  public void getDistanceFactor(float[] distanceFactor);
  public void getDopplerFactor(float[] dopplerFactor);
  public void getOrientation(D3dVector orientFront,
        D3dVector orientTop);
  public void getPosition(D3dVector position);
  public void getRolloffFactor(float[] rolloffFactor);
  public void getVelocity(D3dVector velocity);
  public void setAllParameters(DS3dListener listener,
        int applyFlag);
  public void setDistanceFactor(float distanceFactor,
        int applyFlag);
  public void setDopplerFactor(float dopplerFactor, int applyFlag);
  public void setOrientation(float xFront, float yFront,
        float zFront, float xTop, float yTop, float zTop,
        int applyFlag);
  public void setPosition(float x, float y, float z, int applyFlag);
  public void setRolloffFactor(float rolloffFactor, int applyFlag);
  public void setVelocity(float x, float y, float z, int applyFlag);
}

Methods

commitDeferredSettings

public void commitDeferredSettings();

Commits any deferred settings made since the last call to this method.

Return Value:

No return value.

getAllParameters

public void getAllParameters(DS3dListener listener);

Retrieves information that describes the current state of the 3D world and listener.

Return Value:

No return value.

ParameterDescription
listener The DS3dListener object that contains the current state of the 3D world and listener.

getDistanceFactor

public void getDistanceFactor(float[] distanceFactor);

Retrieves the current distance factor.

Return Value:

No return value.

ParameterDescription
distanceFactor The array that will contain the current distance factor values.

getDopplerFactor

public void getDopplerFactor(float[] dopplerFactor);

Retrieves the current Doppler effect factor.

Return Value:

No return value.

ParameterDescription
dopplerFactor The array that will contain the current Doppler factor values.

Remarks:

This Doppler factor has a range of 0 (no Doppler effects) to 10.0 (10 times the Doppler effects found in the physical world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).

getOrientation

public void getOrientation(D3dVector orientFront, D3dVector orientTop);

Retrieves the listener's current orientation in vectors: a front vector and a top vector.

Return Value:

No return value.

ParameterDescription
orientFront The D3dVector object that will contain the listener's front orientation vector.
orientTop The D3dVector object that will contain the listener's top orientation vector.

Remarks:

The front vector points in the direction of the listener's nose, and the top vector points out the top of the listener's head. By default, the front vector is (0,0,1.0) and the top vector is (0,1.0,0).

getPosition

public void getPosition(D3dVector position);

Retrieves the listener's current position in distance units. By default, these units are meters, but this can be changed by calling the setDistanceFactor method.

Return Value:

No return value.

ParameterDescription
position The D3dVector that will contain the listener's position vector.

getRolloffFactor

public void getRolloffFactor(float[] rolloffFactor);

Retrieves the current rolloff factor.

Return Value:

No return value.

ParameterDescription
rolloffFactor Tha array that will contain the current rolloff factor values.

Remarks:

The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For additional information about the rolloff factor, see Rolloff Factor.

getVelocity

public void getVelocity(D3dVector velocity);

Retrieves the listener's current velocity.

Return Value:

No return value.

ParameterDescription
velocity The D3dVector that will contain the listener's current velocity.

Remarks:

Velocity is used only for Doppler effects. It does not actually move the listener. To change the listener's position, use the setPosition method. The default velocity is (0,0,0).

setAllParameters

public void setAllParameters(DS3dListener listener, int applyFlag);

Sets all 3D listener parameters from a given DS3dListener class that describes all aspects of the 3D listener at a moment in time.

Return Value:

No return value.

ParameterDescription
listener Address of a DS3dListener class that contains information describing all current 3D listener parameters.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

setDistanceFactor

public void setDistanceFactor(float distanceFactor, int applyFlag);

Sets the current distance factor.

Return Value:

No return value.

ParameterDescription
distanceFactor New distance factor.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

setDopplerFactor

public void setDopplerFactor(float dopplerFactor, int applyFlag);

Sets the current Doppler effect factor.

Return Value:

No return value.

ParameterDescription
dopplerFactor New Doppler factor value.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

Remarks:

This Doppler factor has a range of 0 (no Doppler effects) to 10.0 (10 times the Doppler effects found in the physical world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).

setOrientation

public void setOrientation(float xFront, float yFront, float zFront,
        float xTop, float yTop, float zTop, int applyFlag);

Sets the listeners orientation, given a front vector and a top vector.

Return Value:

No return value.

ParameterDescription
xFront The x component of the front vector.
yFront The y component of the front vector.
zFront The z component of the front vector.
xTop The x component of the top vector.
yTop The y component of the top vector.
ztop The x component of the top vector.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

Remarks:

The front vector points in the direction of the listener's nose, and the top vector points out the top of the listener's head.

setPosition

public void setPosition(float x, float y, float z, int applyFlag);

Retrieves the listener's current position in distance units. By default, these units are meters, but this can be changed by calling the DirectSound3dListener.setDistanceFactor method.

Return Value:

No return value.

ParameterDescription
x The x component of the vector that will contain the listener's position.
y The y component of the vector that will contain the listener's position.
z The z component of the vector that will contain the listener's position.
applyFlag Flag values.

setRolloffFactor

public void setRolloffFactor(float rolloffFactor, int applyFlag);

Sets the rolloff factor.

Return Value:

No return value.

ParameterDescription
rolloffFactor New rolloff factor.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

Remarks:

The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For additional information about the rolloff factor, see Rolloff Factor.

setVelocity

public void setVelocity(float x, float y, float z, int applyFlag);

Sets the listener's velocity.

Return Value:

No return value.

ParameterDescription
x The x coordinate of the listener's new velocity vector.
y The y coordinate of the listener's new velocity vector.
z The z-coordinate of the listener's new velocity vector.
applyFlag Value indicating when the setting should be applied. This value must be one of the following:
DS3D_DEFERRED
DS3D_IMMEDIATE

Remarks:

Velocity is used only for Doppler effects. It does not actually move the listener. To change the listener's position, use the setPosition method. The default velocity is (0,0,0).

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.