DirectX SDK

Segments

[C++]

The basic chunk of data in DirectMusic is called a segment. A segment is represented by an IDirectMusicSegment interface. You can create a segment in any of the following ways:

Each segment consists of one or more tracks, each represented by an IDirectMusicTrack interface. Tracks contain most of the data for the segment, whether that data consists of note events, band changes, tempo changes, or other timed events. Applications generally do not need to use this interface because the tracks are managed through the segment object. For more information, see Tracks.

[Visual Basic]

The basic chunk of data in DirectMusic is called a segment. A segment is represented by a DirectMusicSegment object. You can create a segment in any of the following ways:

Segments can serve different purposes. The following are the kinds of segments that you are most likely to use:

[C++]

The playback of segments is controlled by the IDirectMusicPerformance interface and begins with a call to IDirectMusicPerformance::PlaySegment. An instance of a playing segment is represented by an IDirectMusicSegmentState interface, which can be used to retrieve information about the current state of the segment.

[Visual Basic]

The playback of segments is controlled by the DirectMusicPerformance object and begins with a call to DirectMusicPerformance.PlaySegment. An instance of a playing segment is represented by a DirectMusicSegmentState object, which can be used to retrieve information about the current state of the segment.

Only one primary segment can play inside a performance. When you cue a primary segment for playback, you can specify that it is to be played after the currently playing segment is finished, or you can use it to replace the current primary segment.

Secondary segments, on the other hand, play over the current primary segment, and any number of secondary segments can be playing simultaneously.

Secondary segments do not normally alter the performance of the primary segment. For example, a secondary segment can be based on a different style without affecting the style of the primary segment.

[C++]

However, a secondary segment can be designated as a control segment, in which case it takes over the task of responding to IDirectMusicPerformance::SetParam and IDirectMusicPerformance::GetParam calls, which normally go to tracks in the primary segment. Thus a control segment might control the current chord or groove level. For more information, see Tracks.

For more information on playing secondary segments as control segments, see DMUS_SEGF_FLAGS.

[Visual Basic]

However, a secondary segment can be designated a control segment, in which case it takes over the task of responding to certain calls such as DirectMusicPerformance.GetCommand and would also control some aspects of the music, such as the current chord or groove level.

For more information on playing secondary segments as control segments, see CONST_DMUS_SEGF_FLAGS.

For more information on segment playback, see Segment Timing.