|Microsoft DirectX 9.0|
The SetVariation method sets the variations to be played by a part in the track.
HRESULT SetVariation( IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, DWORD dwPart );
Address of the IDirectMusicSegmentState8 interface representing the playing instance of the segment that contains the track.
Bitmask where a bit is set for each variation that is to be played.
Identifier for the part containing the variations. This is the number assigned to the part in the authoring application, and is equivalent to the
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.
Variations can be set for only one part at a time. Each time this method is called, it overrides previous calls.
The following example code plays variations 16 and 32 on performance channel 1.
// pPattern is an IDirectMusicPatternTrack8 pointer. // pSegmentState is an IDirectMusicSegmentState8 pointer. #define VARIATION(v) (1 << ((v) - 1)) HRESULT hr = pPattern->SetVariation( pSegmentState, VARIATION(32) | VARIATION(16), 1);
Header: Declared in dmusici.h.