IDirectMusicSegment::Clone

The IDirectMusicSegment::Clone method creates a copy of the segment and all the tracks it contains.

HRESULT Clone(
  MUSIC_TIME mtStart, 
  MUSIC_TIME mtEnd, 
  IDirectMusicSegment** ppSegment
);
 

Parameters

mtStart
The start of the part to clone. If less than 0, or greater than the length of the segment, 0 will be used.
mtEnd
The end of the part to clone. If this value is past the end of the segment, the segment will be cloned to the end. A value of 0 or anything less than mtStart will also clone to the end.
ppSegment
Address of a variable to receive a pointer to the created segment, if successful. It is caller's responsibility to call Release when finished with the segment.

Return Values

If the method succeeds, the return value is S_OK, or S_FALSE if some tracks failed to clone.

If it fails, the method may return one of the following error values:

E_OUTOFMEMORY
E_POINTER

Remarks

If an IDirectMusicGraph exists in the segment, a copy of the pointer is included in the clone and the reference count is incremented. The start point and loop points set by the IDirectMusicSegment::SetStartPoint and IDirectMusicSegment::SetLoopPoints methods are set to their default values (0, and 0 to the end of the segment respectively) inside the clone. The number of repeats is reset to 0. The resolution set by the IDirectMusicSegment::SetDefaultResolution method is copied into the clone.

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.