Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WMP Player 9(CWMPPlayer4) frame control and dragging

WMP Player 9(CWMPPlayer4) frame control and dragging

Scheduled Pinned Locked Moved C / C++ / MFC
c++comperformancequestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RichardWdy
    wrote on last edited by
    #1

    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.

    R 1 Reply Last reply
    0
    • R RichardWdy

      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.

      R Offline
      R Offline
      RichardWdy
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups