64,685
社区成员
发帖
与我相关
我的任务
分享
IDirectMusicTrack8::Play
The Play method causes the track to play. It performs any work that the track must do when the segment is played, such as creating and sending messages.
Syntax
HRESULT Play(
void* pStateData,
MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
MUSIC_TIME mtOffset
DWORD dwFlags,
IDirectMusicPerformance* pPerf,
IDirectMusicSegmentState* pSegSt,
DWORD dwVirtualID
);
来自msdn
void CPlayerDlg::OPEN()
{
MCI_PLAY_PARMS mciplayparms;
MCI_OPEN_PARMS mciopenparms;
mciopenparms.lpstrElementName=lpPath;
mciopenparms.lpstrDeviceType=NULL;
// MCIDEVICEID wDeviceID=mciopenparms.wDeviceID;
MCIERROR mcierror=mciSendCommand(NULL,MCI_OPEN,MCI_DEVTYPE_WAVEFORM_AUDIO,(DWORD)(LPVOID)&mciopenparms);
if(mcierror==0)
{
mciSendCommand(mciopenparms.wDeviceID,MCI_PLAY,MCI_NOTIFY,(DWORD)(LPVOID)&mciplayparms);
}
}
void CPlayerDlg::STOP()
{
MCI_GENERIC_PARMS mcistop;
mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE,MCI_WAIT,(DWORD) (LPMCI_GENERIC_PARMS)&mcistop);
}