WMP Player 9(CWMPPlayer4) frame control and dragging
-
Hi, To support both mpeg files and wmv files, I had just updated and embeded WMP Player 6 to 9 ActiveX control in my c++ application. Everything went well with .mpg file, like frame step forward and backward. Also image kept moving while dragging a slider ctrl. But that didn't work with .wmv file! As described in WMPlayer SDK document, I couldn't find "m_MP.GetControls().step()" function in CWMPPlayer4 class.I find newly WM Player 9.0 has this funcion: Enhanced->Play speed control: there are 2 small button which can step forward and backward. I dragged the slider ctrl but the image didn't refresh. After I dragged to a new position and excuted play() function, it moved again. My code is like following: void CMyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { double dblPosi; ... if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); m_nTimeSlider = m_TimeSlider.GetPos(); dblPosi = g_pMediaPlayer->GetControls().SetCurrentPosition((double)m_nTimeSlider); CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } void CMyDlg::OnStep() { if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); // forward m_nOneFrame = 0.04 (PAL) g_pMediaPlayer->GetControls().SetCurrentPosition((double)m_nOneFrame); } Anybody who know that plz give me some suggestion? Thanks a lot. No pains, no gains.
-
Hi, To support both mpeg files and wmv files, I had just updated and embeded WMP Player 6 to 9 ActiveX control in my c++ application. Everything went well with .mpg file, like frame step forward and backward. Also image kept moving while dragging a slider ctrl. But that didn't work with .wmv file! As described in WMPlayer SDK document, I couldn't find "m_MP.GetControls().step()" function in CWMPPlayer4 class.I find newly WM Player 9.0 has this funcion: Enhanced->Play speed control: there are 2 small button which can step forward and backward. I dragged the slider ctrl but the image didn't refresh. After I dragged to a new position and excuted play() function, it moved again. My code is like following: void CMyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { double dblPosi; ... if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); m_nTimeSlider = m_TimeSlider.GetPos(); dblPosi = g_pMediaPlayer->GetControls().SetCurrentPosition((double)m_nTimeSlider); CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } void CMyDlg::OnStep() { if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); // forward m_nOneFrame = 0.04 (PAL) g_pMediaPlayer->GetControls().SetCurrentPosition((double)m_nOneFrame); } Anybody who know that plz give me some suggestion? Thanks a lot. No pains, no gains.
I had a small mistake in the above post. void CMyDlg::OnStep() { if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); // forward m_nOneFrame = 0.04 (PAL) g_pMediaPlayer->GetControls().SetCurrentPosition((double)m_nOneFrame); } should be: void CMyDlg::OnStep() { ... if (MPState == MP_PLAYING) g_pMediaPlayer->GetControls().pause(); // forward m_nOneFrame = 0.04 (PAL) g_pMediaPlayer->GetControls().SetCurrentPosition((double)(m_nCurrPos + m_nOneFrame)); } No pains, no gains.