IDirectMusicSegment::GetTrack
The IDirectMusicSegment::GetTrack method searches the list of tracks for the one with the supplied type, group, and index, and retrieves a pointer to the DirectMusicTrack object.
HRESULT GetTrack(
REFGUID rguidType,
DWORD dwGroupBits,
DWORD dwIndex,
IDirectMusicTrack** ppTrack
);
Parameters
- rguidType
- Address of (C) or reference to (C++) the identifier of the track to find (for example, CLSID_DirectMusicChordTrack). A value of GUID_NULL will retrieve any track. For the track identifiers, see IDirectMusicTrack.
- dwGroupBits
- Track groups in which to scan for the track. A value of 0 is invalid. Each bit in dwGroupBits corresponds to a track group. To scan all tracks regardless of groups, set this parameter to 0xFFFFFFFF.
- dwIndex
- Zero-based index into the list of tracks of type rguidType and in group dwGroupBits to return. If multiple groups are selected in dwGroupBits, this index will indicate the nth track of type rguidType encountered in the union of the groups selected.
- ppTrack
- Address of a variable to receive a pointer to the track. The variable set to NULL if the track is not found.
Return Values
If the method succeeds, the return value is S_OK.
If it fails, the method may return E_FAIL.
Remarks
To enumerate all tracks, use GUID_NULL for the rguidType and 0xFFFFFFFF for dwGroupBits. Call GetTrack starting with 0 for dwIndex, incrementing dwIndex until the method no longer returns a success code.
For more information on track groups, see Identifying the Track.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dmusici.h.
See Also
IDirectMusicSegment::InsertTrack