The IDirectMusicTrack::Play method causes the track to play. It performs any work the track must do when the segment is played, such as creating and sending messages.
HRESULT Play(
void* pStateData,
MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
MUSIC_TIME mtOffset
DWORD dwFlags,
IDirectMusicPerformance* pPerf,
IDirectMusicSegmentState* pSegSt,
DWORD dwVirtualID
);
If the method succeeds, the return value may be S_OK or DMUS_S_END.
If it fails, the method may return one of the following error values:
DMUS_E_NOT_INIT |
E_POINTER |
If the track is empty, the method returns DMUS_S_END.
Tracks generate messages in a medium-priority thread. You can call time-consuming functions, such as code to stream data from a file, from within a track's Play method. However, be sure to follow the guidelines for safe multithreading.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dmusici.h.