IDirectMusicComposer::ComposeTemplateFromShape

This method creates a new template segment, based on a predefined shape.

HRESULT ComposeTemplateFromShape(
  WORD wNumMeasures,
  WORD wShape,
  BOOL fIntro,
  BOOL fEnd,
  WORD wEndLength,
  IDirectMusicSegment** ppTemplate
);

Parameters

  • wNumMeasures
    Length, in measures, of the segment to be composed. This value must be greater than 0.
  • wShape
    Shape of the segment to be composed. Possible values are of the DMUS_SHAPET_TYPES enumerated type.
  • fIntro
    TRUE if an introduction is to be composed for the segment.
  • fEnd
    TRUE if an ending is to be composed for the segment.
  • wEndLength
    Length in measures of the ending, if one is to be composed. If fEnd is TRUE, this value must be greater than 0 and equal to or less than the number of measures available (that is, not used in the introduction). See also Remarks.
  • ppTemplate
    Address of a variable to receive a pointer to the created template segment.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the following error values:

E_INVALIDARG
E_OUTOFMEMORY
E_POINTER

Remarks

The value of wEndLength should not be greater than the length of the longest ending available in any style likely to be associated with this template through the IDirectMusicComposer::ComposeSegmentFromTemplate method. The ending starts playing at wEndLength measures before the end of the segment. If the ending is less than wEndLength measures long, the music then reverts to the basic groove level.

Requirements

OS Versions: Windows CE .NET 4.0 and Windows CE .NET 4.1.
Header: Dmusici.h.
Link Library: Dmusic.lib.

See Also

Using Templates | DMUS_SHAPET_TYPES | IDirectMusicComposer::ComposeSegmentFromShape | IDirectMusicComposer::ComposeSegmentFromTemplate

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.