IDirectMusicPerformance::Stop

This method stops playback of one or more segments.

HRESULT Stop(
  IDirectMusicSegment* pSegment,
  IDirectMusicSegmentState* pSegmentState,
  MUSIC_TIME mtTime,
  DWORD dwFlags
); 

Parameters

  • pSegment
    Segment to stop playing. All segment states based on this segment are stopped at mtTime. See Remarks.
  • pSegmentState
    Segment state to stop playing. See Remarks.
  • mtTime
    Time at which to stop the segment, segment state, or both. If the time is in the past or 0 is passed in this parameter, the requested segments and segment states stop playing immediately.
  • dwFlags
    Flag that indicates when the stop should occur. Boundaries are in relation to the current primary segment. Must be one of the following values:
    Flag Description
    0 Stop immediately.
    DMUS_SEGF_GRID Stop on the next grid boundary at or after mtTime.
    DMUS_SEGF_MEASURE Stop on the next measure boundary at or after mtTime.
    DMUS_SEGF_BEAT Stop on the next beat boundary at or after mtTime.
    DMUS_SEGF_DEFAULT Stop on the default boundary, as set by the IDirectMusicSegment::SetDefaultResolution method.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return E_POINTER.

Remarks

If pSegment and pSegmentState are both NULL, all music stops, and all currently cued segments are released. If either pSegment or pSegmentState is not NULL, only the requested segment states are removed from the performance. If both are non-NULL and DMUS_SEGF_DEFAULT is used, the default resolution from the pSegment is used.

If you set all parameters to NULL or 0, everything stops immediately, and controller reset messages and note-off messages are sent to all mapped PChannels.

Requirements

OS Versions: Windows CE .NET 4.0 and Windows CE .NET 4.1.
Header: Dmusici.h.
Link Library: Dmusic.lib.

See Also

IDirectMusicPerformance::PlaySegment | IDirectMusicSegment::SetDefaultResolution | DMUS_SEGF_FLAGS

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.