Platform SDK: DirectX

DirectMusicSegment.SetLoopPoints

The DirectMusicSegment.SetLoopPoints method sets the start and end points inside the segment to repeat the number of times set by the DirectMusicSegment.SetRepeats method.

object.SetLoopPoints(mtStart As Long, mtEnd As Long)

Parameters

object
Object expression that resolves to a DirectMusicSegment object.
mtStart
Point at which to begin the loop, in music time.
mtEnd
Point at which to end the loop, in music time. A value of 0 loops the entire segment.

Error Codes

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

Remarks

When the segment is played, it plays from the segment start time until mtEnd, then loops to mtStart, plays the looped portion the number of times set by DirectMusicSegment.SetRepeats, then plays to the end.

The default values are set to loop the entire segment from beginning to end.

The method fails if mtStart is greater than or equal to the length of the segment, or if mtEnd is greater than the length of the segment. If mtEnd is 0, mtStart must be 0 as well.

This method does not affect any currently playing segment states created from this segment.

A segment that is reused might be loaded from an internal cache, in which case it has the same loop points that it had the last time these values were set. It is a good idea to reset the loop points to 0 before releasing or resetting the object.

See Also

DirectMusicSegment.GetLoopPointStart, DirectMusicSegment.GetLoopPointEnd, DirectMusicSegment.SetRepeats