Re: [Rhythmbox-devel] Callback every 1/2 second

Hey Justin,

On Tue, 2009-07-07 at 10:29 -0700, EmbeddedMicro wrote:
> I am writing a plugin in python and I need to get a piece of code to run
> every 1/2 second. It seems like I saw how to do this before but I can't seem
> to find it again. Any help is great.

Try using glib.idle_add() or glib.idle_add_seconds(). The latter is
generally considered to be better form if seconds-based accuracy is
acceptable since it is much easier on laptop batteries.

You could also use use the "tick" signal on the player, if you only want
the code to run while RB is actually playing.


⎊ Michael Gratton. "Mea navis aëricumbens anguillis abundat."
⎈ <>

Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]