[pygtk] gobject.timeout_add()
dj
westli1 at yahoo.com
Thu Jan 21 13:22:14 WST 2010
I hope this is the right place to ask this...
I have a python program (using Glade to create the gui) that periodically launches ecasound to make audio recordings of various lengths. In order to keep the gui viable, ecasound runs in a separate thread. In order to keep the program from getting ahead of itself and trying to launch ecasound before the current recording process has finished, I use gobject.timeout_add() for the length of the recording (plus a second or two for safety).
Most of the calls to gobject.timeout_add() are in separate functions with different intervals. All but one of them work. The last one only works if gobject.timeout_add(..., ...)/return False is appended to the end of the function that needs it, rather than calling it.
I feel like if I use gobject.timeout_add() and it works, it's just dumb luck.
I changed some functions that are well ahead of the one function which required the timeout to be part of it. Now it doesn't take the timeout. The program tries to start the next recording as soon as the first one starts.
Changing the function to call the timeout as a separate function like the others still doesn't work.
I have the 1300+ messages in this forum and nobody seems to be having the same problem. All the references and tutorials either don't seem to apply or present examples that look just like my code. So my understanding of this function, such as it is, is missing something.
Any ideas?
More information about the pygtk
mailing list