Microsoft DirectX 8.1 (Visual Basic)

DirectMusicSegment8.Clone

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

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

Parts

object

Resolves to a DirectMusicSegment8 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

Returns a DirectMusicSegment8 object.

Error Codes

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

Remarks

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

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