Platform SDK: DirectX

IDirectMusicComposer::ComposeTemplateFromShape

The IDirectMusicComposer::ComposeTemplateFromShape 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.
ppTemp;ate
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

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicComposer::ComposeSegmentFromShape, IDirectMusicComposer::ComposeSegmentFromTemplate, Using Templates