IDirectMusicSegment::SetLoopPoints

The IDirectMusicSegment::SetLoopPoints method sets the start and end points inside the segment that will repeat the number of times set by the IDirectMusicSegment::SetRepeats method.

HRESULT SetLoopPoints(
  MUSIC_TIME mtStart,
  MUSIC_TIME mtEnd
);
 

Parameters

mtStart
The point at which to begin the loop.
mtEnd
The point at which to end the loop. A value of 0 loops the entire segment.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method may return DMUS_E_OUT_OF_RANGE.

Remarks

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.

The loop points of a cached segment persist even if the segment is released and then reloaded. To ensure that a segment is not subsequently reloaded from the cache, call IDirectMusicLoader::ReleaseObject on it before releasing it.

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.

See Also

IDirectMusicSegment::GetLoopPoints, Segment Timing