IDirectMusicComposer::ComposeSegmentFromTemplate

The IDirectMusicComposer::ComposeSegmentFromTemplate method creates an original segment from a style, chordmap, and template.

HRESULT ComposeSegmentFromTemplate(
  IDirectMusicStyle* pStyle, 
  IDirectMusicSegment* pTempSeg, 
  WORD wActivity, 
  IDirectMusicChordMap* pChordMap, 
  IDirectMusicSegment** ppSectionSeg
);
 

Parameters

pStyle
Style from which to create the segment.
pTempSeg
Template from which to create the segment.
wActivity
Rate of harmonic motion. Valid values are 0 through 3. Lower values mean more chord changes.
pChordMap
Chordmap from which to create the segment.
ppSectionSeg
Address of a variable to receive a pointer to the created segment.

Return Values

If the method succeeds, the return value is S_OK.

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

E_INVALIDARG
E_POINTER

Remarks

If pStyle is non-NULL, it is used in composing the segment; if it is NULL, a style is retrieved from the template specified in pTempSeg. Similarly, if pChordMap is non-NULL, it is used in composing the segment; if it is NULL, a chordmap is retrieved from the template.

If pStyle is NULL and there is no style track in the template, or pChordMap is NULL and there is no chordmap track, the method returns E_INVALIDARG.

The length of the segment is equal to the length of the template passed in.

QuickInfo

  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::ComposeTemplateFromShape, Using Templates