|Microsoft DirectX 9.0|
The IDirectMusicTrack8::InitPlay method is 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 );
Address of the calling IDirectMusicSegmentState or IDirectMusicSegmentState8 interface.
Address of the calling IDirectMusicPerformance or IDirectMusicPerformance8 interface.
Address of a variable that receives a pointer to state information. The format and use of the data is specific to the track. The data should be created in the InitPlay method and freed in the IDirectMusicTrack8::EndPlay method. The pointer is passed to the IDirectMusicTrack8::Play and IDirectMusicTrack8::PlayEx methods.
Virtual track ID assigned to this track instance.
DMUS_SEGF_FLAGS that control the track's behavior. See Remarks.
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.
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.