Jump to content
  • Advertisement
Sign in to follow this  

How to constantly poll IMediaSeeking for playback position?

This topic is 5219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi - I'm not a game programmer, but I found these forums researching DirectX and you all seem to know your stuff, so hopefully somebody can help. This is probably pretty simple. I'm using IGraphBuilder, IMediaControl, IVideoWindow, IMediaEventEX, IMediaSeeking, IMediaPosition and IVideoFrameStep interfaces to implement an AVI player in my VC++ 6.0 app. Everything is working properly. I now want to implement a progress/slider control to mimic that found in Windows Media Player (a track, a thumbnail, and as the thumb moves, the track changes color to the left of the thumb.) My problem is, I don't know how to constantly poll the IVideoWindow (or whichever interface is appropriate) for the current playback position. Well, that's not even entirely true, I know how to use: hr = g_pMediaSeeking->GetPositions(&pCurrent, &pStop); to capture the current positions, but I'm not sure how I should continually poll that. I tried calling my update code within my HandleGraphEvent method, but that only calls it upon messages, like EC_COMPLETE, EC_PAUSED etc. it's not a continually polling thing.. do I need to add a timer to my property page (upon which my UI elements reside) to constantly call GetPositions() for the update or is there a more appropriate way? Thanks! Paul

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!