Purpose: The audiopath manages the stages of
data flow from the performance to the final mixer
Remark: The returns values are based on the DirectX9
constants except DM_FAILED
The functions raise a CDMusicException
exception type with the error
data.
Member functions:
Function:
Activate
Declaration: HRESULT CAudioPath::Activate(BOOL bActivate)
Purpose: Activates or deactivates
the audiopath
Parameters:
bActivate [in]: Boolean that specifies whether to activate (TRUE) or deactivate (FALSE) the audiopath
Returns:
S_OK |
Succeeds |
Throws:
S_FALSE | the audiopath is already in the requested state |
DM_FAILED | Error, see DirectMidi causes |
Function:
Get3DBuffer
Declaration: HRESULT CAudioPath::Get3DBuffer(C3DBuffer &_3DBuffer)
Purpose: Retrieves a reference to a
C3DBuffer object
Parameters:
_3DBuffer [out]: A reference to the 3D buffer
Returns:
S_OK |
Succeeds |
Throws:
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
E_OUTOFMEMORY | Insufficient memory to complete the task |
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
DMUS_E_NOT_FOUND | The requested item is not contained by the object |
DM_FAILED | Error, see DirectMidi causes |
Function:
Get3DListener
Declaration: HRESULT CAudioPath::Get3DListener(C3DListener &_3DListener)
Purpose: Retrieves a reference to a
C3DListener object
Parameters:
_3DListener [out]: A reference to the 3D listener
Returns:
S_OK |
Succeeds |
Throws:
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
E_OUTOFMEMORY | Insufficient memory to complete the task |
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
DMUS_E_NOT_FOUND | The requested item is not contained by the object |
DM_FAILED | Error, see DirectMidi causes |
Function:
GetObjectInPath
Declaration: HRESULT CAudioPath::GetObjectInPath(DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject,DWORD dwIndex,REFGUID iidInterface,void **ppObject)
Purpose: Retrieves an interface for
an object in the audiopath
Parameters:
dwPChannel
[in]:
dwStage [in]: Stage in the audiopath. Can be one of the values in the following table
Value | Description |
DMUS_PATH_AUDIOPATH_GRAPH | Get the audiopath toolgraph. One is created if none exists. |
DMUS_PATH_AUDIOPATH_TOOL | Get a tool from the audiopath toolgraph. |
DMUS_PATH_BUFFER | Get a DirectSound buffer. |
DMUS_PATH_BUFFER_DMO | Get a |
DMUS_PATH_MIXIN_BUFFER | Get a
global |
DMUS_PATH_MIXIN_BUFFER_DMO | Get a DMO in a global mix-in buffer. |
DMUS_PATH_PERFORMANCE | Get the performance. |
DMUS_PATH_PERFORMANCE_GRAPH | Get the performance toolgraph. One is created if none exists. |
DMUS_PATH_PERFORMANCE_TOOL | Get a tool from the performance toolgraph. |
DMUS_PATH_PORT | Get the synthesizer. |
DMUS_PATH_PRIMARY_BUFFER | Get the |
Remarks
The value in dwPChannel must be 0 for any stage that is not channel-specific. Objects in the following stages are channel-specific and can be retrieved by setting a channel number or DMUS_PCHANNEL_ALL in dwPChannel:
DMUS_PATH_AUDIOPATH_TOOL
DMUS_PATH_BUFFER
DMUS_PATH_BUFFER_DMO
DMUS_PATH_PERFORMANCE_TOOL
DMUS_PATH_PORT
The precedence of the parameters in filtering out unwanted objects is as follows:
If a matching object is found but the interface specified by iidInterface cannot be obtained, the method fails
Returns:
S_OK |
Succeeds |
Throws:
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_NOINTERFACE | No object interface is available |
E_OUTOFMEMORY | Insufficient memory to complete the task |
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
DMUS_E_NOT_FOUND | The requested item is not contained by the object |
DM_FAILED | Error, see DirectMidi causes |
Function:
ReleaseAudioPath
Declaration: HRESULT CAudioPath::ReleaseAudioPath()
Purpose: Releases the audiopath
Parameters: none
Returns:
S_FALSE | Error |
S_OK |
Succeeds |
Function:
SetVolume
Declaration: HRESULT CAudioPath::SetVolume(long lVolume,DWORD dwDuration)
Purpose: Sets the audio volume on
the audiopath. The volume can be faded in or out
Parameters:
lVolume
[in]: Value that specifies the attenuation,
in hundredths of a decibel.
This value must be in the range
from -9600 to 0. Zero is full volume
dwDuration [in]: Value that specifies the time, in milliseconds, over which the volume change takes place. A value of 0 ensures maximum efficiency
Returns:
S_OK |
Succeeds |
Throws:
E_INVALIDARG | Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method |
DMUS_E_NOT_INIT | A required object is not initialized or failed to initialize |
DM_FAILED | Error, see DirectMidi causes |