IDirectMusicComposer8::ComposeSegmentFromTemplate

DirectMusic

Microsoft DirectX 9.0 SDK Update (Summer 2004)

IDirectMusicComposer8::ComposeSegmentFromTemplate

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

Syntax

HRESULT ComposeSegmentFromTemplate(
  IDirectMusicStyle* pStyle, 
  IDirectMusicSegment* pTemplate, 
  WORD wActivity, 
  IDirectMusicChordMap* pChordMap, 
  IDirectMusicSegment** ppSegment
);

Parameters

pStyle

IDirectMusicStyle8 interface pointer that specifies the style from which to create the segment.

pTemplate

IDirectMusicSegment8 interface pointer that specifies the 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

IDirectMusicChordMap8 interface pointer that specifies the chordmap from which to create the segment.

ppSegment

Address of a variable that receives a pointer to the created segment.

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
E_INVALIDARG
E_OUTOFMEMORY
E_POINTER

Remarks

If pStyle is not 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 not 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.

The default start point and loop points of the created segment are 0, regardless of the values in the template segment.

Requirements

  Header: Declared in dmusici.h.

See Also


© 2004 Microsoft Corporation. All rights reserved.