DirectX SDK

IDirectMusicSegment::SetStartPoint

The IDirectMusicSegment::SetStartPoint method sets the point at which the segment starts playing in response to a call to the IDirectMusicPerformance::PlaySegment method.

HRESULT SetStartPoint(
  MUSIC_TIME mtStart
);

Parameters

mtStart
Point within the segment at which it is to start playing. If this value is less than 0 or greater than the length of the segment, the start point is set to 0.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return DMUS_E_OUT_OF_RANGE.

Remarks

By default, the start point is 0, meaning that the segment starts from the beginning.

The method fails if mtStart is greater than or equal to the length of the segment. If the segment does not already have a length, IDirectMusicSegment::SetLength must be called before this method.

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

The start point of a cached segment persists 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.

Requirements

  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::GetStartPoint, IDirectMusicSegmentState::GetStartPoint, IDirectMusicSegment::SetLength, IDirectMusicSegment::SetLoopPoints, Segment Timing