IDirectMusicSegment::InsertTrack

The IDirectMusicSegment::InsertTrack method inserts the supplied track into the segment's list of tracks.

HRESULT InsertTrack(
  IDirectMusicTrack* pTrack,
  DWORD dwGroupBits
);
 

Parameters

pTrack
The track to add to the segment.
dwGroupBits
Group or groups into which to insert the track. This value cannot be 0.

Return Values

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

Remarks

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.

QuickInfo

  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::RemoveTrack, IDirectMusicSegment::GetTrackGroup