Microsoft DirectX 8.0 (Visual Basic)

DirectMusicPerformance8.PlaySegmentEx

Begins playback of a segment.

object.PlaySegmentEx( _
  Source As Unknown, _
  lFlags As CONST_DMUS_SEGF_FLAGS, _
  StartTime As Long, _
  [From As Unknown], _
  [AudioPath As Unknown], _
) As DirectMusicSegmentState8

Parts

object
Resolves to a DirectMusicPerformance8 object.
Source
DirectMusicSegment8 object to play.
lFlags
Flags that modify the method's behavior. Can be 0 or one or more constants from the CONST_DMUS_SEGF_FLAGS enumeration.
StartTime
Performance time at which to begin playing the segment, adjusted to any resolution boundary specified in lFlags. The time is in music time unless the DMUS_SEGF_REFTIME flag is set. A value of 0 causes the segment to start playing as soon as possible.
From
Optional DirectMusicSegmentState8 or DirectMusicAudioPath8 object to stop playing when the new segment begins. If it is an audiopath, all segment states playing on that audiopath are stopped.
AudioPath
Optional DirectMusicAudioPath8 object that represents the audiopath on which to play the segment. If Nothing or omitted, the segment plays on the default path.

Return Values

Returns a DirectMusicSegmentState8 object that represents the playing instance of the segment.

Error Codes

If the method fails, an error is raised. Possible values for Err.Number include the following:

DMUS_E_AUDIOPATH_INACTIVE
DMUS_E_AUDIOPATH_NOPORT
DMUS_E_NO_MASTER_CLOCK
DMUS_E_SEGMENT_INIT_FAILED
DMUS_E_TIME_PAST
DMUS_E_OUTOFMEMORY

Remarks

Segments should be greater than 250 milliseconds in length.

The boundary resolutions in lFlags are relative to the primary segment.

If a primary segment is scheduled to play while another primary segment is playing, the first one stops unless you set the DMUS_SEGF_QUEUE flag for the second segment, in which case it plays as soon as the first one finishes.

For more information on the exact start time of segments, see Segment Timing. For information on how the start time of segments can be affected by tempo changes, see Clock Time vs. Music Time.

If DMUS_SEGF_AUTOTRANSITION is specified in lFlags and a segment is playing at StartTime and is being interrupted, the method composes a transition between the two segments and plays it before playing Source.

If Source is a segment, a transitional segment based on a template provided at Transition is composed and played.

See Also

Using Segments, Using Transitions