IDirectMusicComposer8::AutoTransition

The AutoTransition method composes a transition from inside a performance's primary segment (or from silence) to another segment, and then cues the transition and the second segment to play.

Syntax

HRESULT AutoTransition(
  IDirectMusicPerformance* pPerformance,
  IDirectMusicSegment* pToSeg,
  WORD wCommand,
  DWORD dwFlags,
  IDirectMusicChordMap* pChordMap,
  IDirectMusicSegment** ppTransSeg,
  IDirectMusicSegmentState** ppToSegState, 
  IDirectMusicSegmentState** ppTransSegState
);

Parameters

pPerformance

Performance in which to make the transition.

pToSeg

Segment to which the transition should smoothly flow. (See Remarks.)

wCommand

Embellishment to use when composing the transition. This can be one of the values of the DMUS_COMMANDT_TYPES enumeration, or a value defined in DirectMusic Producer as a custom embellishment. If this value is DMUS_COMMANDT_ENDANDINTRO, the method composes a segment containing both an ending to the current primary segment and an introduction to pToSeg.

dwFlags

Composition options. See DMUS_COMPOSEF_FLAGS.

pChordMap

Pointer to the IDirectMusicChordMap8 interface of the chordmap to be used when composing the transition.

ppTransSeg

Address of a variable that receives a pointer to the created segment. This value can be NULL, in which case the pointer is not returned.

ppToSegState

Address of a variable that receives a pointer to the segment state created by the performance (pPerformance) for the segment following the transition (pToSeg). (See Remarks.)

ppTransSegState

Address of a variable that receives a pointer to the segment state created by the performance (pPerformance) for the created segment (ppTransSeg). (See Remarks.)

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the error values shown in the following table.

Return code
DMUS_E_NO_MASTER_CLOCK
E_INVALIDARG
E_POINTER

Remarks

The value in pToSeg can be NULL as long as dwFlags does not include DMUS_COMPOSEF_MODULATE. If pToSeg is NULL or does not contain a style track (as would be the case if it is based on a MIDI file), introductory embellishments are not valid. If the currently playing segment is NULL or does not contain a style track, then fill, break, end, and groove embellishments are not valid. If no style track is available either in the currently playing segment or in the one represented by pToSeg, all embellishments are invalid, and no transition occurs*.* In that case, both ppTransSeg and ppTransSegState return NULL, but the method succeeds and cues the segment represented by pToSeg, if that pointer is not NULL.

The value in pChordMap can be NULL. If it is, the composition engine attempts to obtain a chordmap from a chordmap track, first from pToSeg, and then from the performance's primary segment. If neither of these segments contains a chordmap track, the chord occurring at the current time in the primary segment is used as the chord in the transition.

Requirements

**  Header:** Dmusici.h
  Library: Dmcompos.dll, Dmcompod.dll

See Also

© 2004 Microsoft Corporation. All rights reserved.