|Microsoft DirectX 9.0|
The Play Multi sample shows how to play multiple segments simultaneously, one as a primary segment and the others as secondary segments.
Source: (SDK root)\Samples\C++\DirectMusic\PlayMulti
Executable: (SDK root)\Samples\C++\DirectMusic\Bin
Use the default segments, or choose others by using the Browse buttons. The primary segment should be style-based so that it contains the rhythmic information necessary for proper cuing of the secondary segments.
Play the primary segment. Select a play boundary for a secondary segment and play it. Notice that the secondary segment begins playing on the specified boundary.
Select Controlling Segment to make a secondary segment the control segment. This will have an effect only if the secondary segment has a mute track, command track, tempo track, or chord track. Try loading a secondary segment that has a different tempo than the primary segment and playing it as the control segment. The tempo of the primary segment changes to match that of the secondary segment.
The flags for IDirectMusicPerformance8::PlaySegmentEx are set in the OnPlay function and passed to the CMusicSegment::Play method in the sample framework.