Platform SDK: DirectX

DirectMusicPerformance.Stop

The DirectMusicPerformance.Stop method stops playback of one or more segments.

object.Stop(segment As DirectMusicSegment, _
    segmentState As DirectMusicSegmentState, _
    mtTime As Long, _
    lFlags As Long)

Parameters

object
Object expression that resolves to a DirectMusicPerformance object.
segment
DirectMusicSegment to stop playing. All segment states based on this segment are stopped at mtTime. See Remarks.
segmentState
DirectMusicSegmentState object representing the instance of the segment to stop playing. See Remarks.
mtTime
Music time at which to stop the segment, segment state, or both. If the time is in the past or this value is 0, the requested segments and segment states stop playing immediately.
lFlags
Flag that indicates when the stop should occur. Boundaries are in relation to the current primary segment. Must be one of the following values:
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.

Error Codes

If the method fails, it raises an error, and Err.Number is set.

Remarks

If segment and segmentState are both Nothing, all music stops, and all currently cued segments are released. If either segment or segmentState is not Nothing, only the requested segment states are removed from the performance.

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

See Also

DirectMusicPerformance.PlaySegment, CONST_DMUS_SEGF_FLAGS