Sign in to follow this  
mound

How to constantly poll IMediaSeeking for playback position?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this