Microsoft DirectX 8.1 (C++)

IDirectMusicSegment8::Clone

The Clone method copies all or part of the segment and the tracks that it contains.

Syntax

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

Parameters

mtStart

Start of the part to copy. If less than 0 or greater than the length of the segment, 0 is used.

mtEnd

End of the part to copy. If this value is past the end of the segment, the segment is copied to the end. A value of 0 or anything less than mtStart also copies to the end.

ppSegment

Address of a variable that receives a pointer to the IDirectMusicSegment interface of the created segment. Use QueryInterface to obtain IDirectMusicSegment8. It is the 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 copy.

If it fails, the method can return one of the error values shown in the following table.

Return code
E_OUTOFMEMORY
E_POINTER

Remarks

Properties of the original segment, including start and loop points, number of repeats, and any toolgraph and default audiopath, are copied to the clone.

For style-based segments, if mtStart is greater than 0, it should be on a measure boundary.

Requirements

  Header: Declared in dmusici.h.

See Also