次の方法で共有


Self-Controlling Segments

A self-controlling segment ignores any control information from the control segment that duplicates control information in the self-controlling segment. For example, if the segment has a command track, it can use its own commands (such as groove levels) rather than the commands in the control segment.

Segments can define for each track where it gets its controlling information, as follows:

  • From tracks in the control segment. This is the default behavior.
  • From tracks in the primary segment, regardless of whether it is the control segment.
  • From tracks in the same segment.

Configuring a segment as self-controlling is usually done by the author. However, applications can configure individual tracks within segments by setting or clearing the following flags, using the IDirectMusicSegment8::SetTrackConfig or IDirectMusicSegmentState8::SetTrackConfig method:

Flag Effect
DMUS_TRACKCONFIG_OVERRIDE_ALL The track should get parameters from this segment before control and primary segment tracks.
DMUS_TRACKCONFIG_OVERRIDE_PRIMARY The track should get parameters from this segment before primary segment tracks.
DMUS_TRACKCONFIG_FALLBACK The track should get parameters from this segment if the primary and control segments do not return the needed information.

The following example code, where pSegment is an IDirectMusicSegment8 interface pointer, instructs the style track to get all its parameters from other tracks in the same segment, ensuring that chords, groove levels, and mute commands do not come from the control segment.

HRESULT hr = pSegment ->SetTrackConfig(CLSID_DirectMusicStyleTrack,
    -1, DMUS_SEG_ALLTRACKS, DMUS_TRACKCONFIG_OVERRIDE_ALL, 0);

See Also

© 2004 Microsoft Corporation. All rights reserved.