Microsoft DirectX 9.0

IDirectMusicPatternTrack8::CreateSegment

The CreateSegment method creates a segment containing the pattern track.

Syntax

HRESULT CreateSegment(
  IDirectMusicStyle* pStyle,
  IDirectMusicSegment** ppSegment
);

Parameters

pStyle

Style to use in creating the segment.

ppSegment

Address of a variable that receives an IDirectMusicSegment interface pointer for the created segment. Use QueryInterface to obtain IDirectMusicSegment8.

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_NOT_INIT
E_OUTOFMEMORY

Remarks

A pattern track is usually obtained from a segment object loaded from a file or resource, in which case the application already has the IDirectMusicSegment interface. This method is used for creating a segment when the pattern track object has been created by using CoCreateInstance.

This method does not assign a pattern to the track. The style in pStyle provides only the tempo, time signature, and band. To assign a pattern, use IDirectMusicPatternTrack8::SetPatternByName.

Requirements

  Header: Declared in dmusici.h.

See Also