Platform SDK: DirectX

DirectMusicSegment.Clone

The DirectMusicSegment.Clone method creates a copy of all or part of the segment.

object.Clone(mtStart As Long, _
    mtEnd As Long) As DirectMusicSegment

Parameters

object
Object expression that resolves to a DirectMusicSegment object.
mtStart
Start of the part to clone, in music time. If less than 0 or greater than the length of the segment, 0 is used.
mtEnd
End of the part to clone, in music time. If this value is past the end of the segment, the segment is cloned to the end. A value of 0 or anything less than mtStart also clones to the end.

Return Values

If the method succeeds, it returns a DirectMusicSegment object.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to DMUS_E_OUTOFMEMORY.

Remarks

The start point and loop points set by the DirectMusicSegment.SetStartPoint and DirectMusicSegment.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 also reset to 0.

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