Microsoft DirectX 8.0 (C++) |
Called when a track is ready to start playing. The method returns a pointer to state data.
HRESULT InitPlay( IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags );
If the method succeeds, the return value is S_OK.
If it fails, the method can return one of the following error values:
DMUS_E_NOT_INIT |
E_OUTOFMEMORY |
E_POINTER |
The dwFlags parameter passes the flags that were handed to the performance in the call to IDirectMusicPerformance8::PlaySegment or IDirectMusicPerformance8::PlaySegmentEx. The track determines how it should perform, based on the DMUS_SEGF_CONTROL and DMUS_SEGF_SECONDARY flags. For example, the tempo track automatically plays the tempo changes only if it is part of a primary segment or a secondary control segment (DMUS_SEGF_SECONDARY is not set, or DMUS_SEGF_CONTROL is set).
A track can return NULL in ppStateData.
Header: Declared in dmplugin.h.