The IDirectMusicSegment::InsertTrack method inserts the supplied track into the segment's list of tracks.
HRESULT InsertTrack(
IDirectMusicTrack* pTrack,
DWORD dwGroupBits
);
If the method succeeds, the return value is S_OK.
If it fails, the method may return one of the following error values:
E_FAIL |
E_INVALIDARG |
E_OUTOFMEMORY |
E_POINTER |
Tracks are put in groups in order to link them correctly. For example, a segment might contain two style tracks and two mute tracks. Each style track would be put in a different group along with its associated mute track. For more information on track groups, see Identifying the Track.
If the segment is currently playing, the new track is not included in playback, because the segment state was not initialized with the new 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.
IDirectMusicSegment::RemoveTrack, IDirectMusicSegment::GetTrackGroup