Microsoft DirectX 8.1 (C++) |
The GetObjectInPath method retrieves an interface for an object in the audiopath on which this segment state is playing.
Syntax
HRESULT GetObjectInPath(
DWORD dwPChannel,
DWORD dwStage,
DWORD dwBuffer,
REFGUID guidObject,
DWORD dwIndex,
REFGUID iidInterface,
Void** ppObject
);
Parameters
dwPChannel
dwStage
Stage in the path. Can be one of the values listed in the following table.
Value | Description |
DMUS_PATH_AUDIOPATH | The audiopath on which the segment state is playing. |
DMUS_PATH_AUDIOPATH_GRAPH | The audiopath toolgraph. One is created if none exists. |
DMUS_PATH_AUDIOPATH_TOOL | A tool from the audiopath toolgraph. |
DMUS_PATH_BUFFER | A DirectSound buffer. |
DMUS_PATH_BUFFER_DMO | A |
DMUS_PATH_MIXIN_BUFFER | A global |
DMUS_PATH_MIXIN_BUFFER_DMO | A DMO in a global mix-in buffer. |
DMUS_PATH_PERFORMANCE | The performance. |
DMUS_PATH_PERFORMANCE_GRAPH | The performance toolgraph. One is created if none exists. |
DMUS_PATH_PERFORMANCE_TOOL | A tool in the performance graph. |
DMUS_PATH_PORT | The synthesizer. |
DMUS_PATH_PRIMARY_BUFFER | The primary buffer. |
DMUS_PATH_SEGMENT | The segment that owns this segment state. |
DMUS_PATH_SEGMENT_GRAPH | The segment toolgraph. One is created if none exists. See Remarks. |
DMUS_PATH_SEGMENT_TOOL | A tool from the segment graph. See Remarks. |
DMUS_PATH_SEGMENT_TRACK | A track from the segment. See Remarks. |
dwBuffer
If dwStage is DMUS_PATH_BUFFER_DMO or DMUS_PATH_MIXIN_BUFFER_DMO, the index of the buffer in which that DMO resides. If dwStage is DMUS_PATH_BUFFER or DMUS_PATH_MIXIN_BUFFER, the index of the buffer. Otherwise must be 0.
guidObject
Class identifier of the objector GUID_All_Objects to search for an object of any class. This parameter is ignored if only a single class of object can exist at the stage specified by dwStage, and can be set to GUID_NULL.
dwIndex
Index of the object in the list of matching objects. Set to 0 to find the first matching object. If dwStage is DMUS_PATH_BUFFER or DMUS_PATH_MIXIN_BUFFER, this parameter is ignored, and the buffer index is specified by dwBuffer.
iidInterface
Identifier of the desired interface, such as IID_IDirectMusicGraph.
ppObject
Address of a variable that receives a pointer to the requested interface.
Return Values
If the method succeeds, the return value is S_OK or DMUS_S_GARBAGE_COLLECTED. See Garbage Collection.
If it fails, the method can return one of the error values shown in the following table.
Return code |
DMUS_E_NOT_FOUND |
E_INVALIDARG |
E_NOINTERFACE |
E_OUTOFMEMORY |
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:
Value |
DMUS_PATH_AUDIOPATH_TOOL |
DMUS_PATH_BUFFER |
DMUS_PATH_BUFFER_DMO |
DMUS_PATH_PERFORMANCE_TOOL |
DMUS_PATH_PORT |
DMUS_PATH_SEGMENT_TOOL |
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.
The object returned when DMUS_PATH_SEGMENT_GRAPH or DMUS_PATH_SEGMENT_TOOL is specified in dwStage might not be the same one returned for a different segment state based on the same segment. When a segment is played, its toolgraph is copied and any tools that support the IDirectMusicTool8::Clone method are also cloned.
Requirements
Header: Declared in dmusici.h.
See Also