python timers and COM/directshow

Sayanan Sivaraman sayananbig at gmail.com
Tue Sep 23 20:41:11 CEST 2008


You're right.  Let me be more specific.  Firstly, the reason I
included c++ code is because I'm using Microsoft COM, which is
natively in c++, and in fact, to access them through Python I use the
comtypes module [import comtypes] and then GetModule('quartz.dll') to
access the dll's.

I am using the gtk GUI widgets.  I have a gtk.Hscale scrollbar which I
would like to be a trackbar for the video playback.  To coordinate
this in Python, much like in c++, I would like to have a timer thread
synchronizing the scrollbar update.  ie:

def scrollbar_callback(args):
      media_control.CurrentPosition= scrollbar.get_value()

def timer_callback(args):
      #code to update the scrollbar based on video position, something
like
       scrollbar.set_value(media_control.CurrentPosition)

>>>*And, I would like to be able to kill, run the timer based on whether the video is playing or paused, ie

def player(args):
     media_control.Run() #plays video
     timer.run()

def pauser(args):
     media_control.Pause()
     timer.kill

Any tips?

-sayanan







More information about the Python-list mailing list