Topic: chumby_timer_expires and widget switching/cycling

OK, I see how I can use chumby_timer_expires to tell me how much time a widget has left.  Problem is, the user can extend the time.

I have a widget that uses _pipeOpen(), and I would like to call _pipeClose() when the widget is switched out.  To do this, I'd need to call a function at the point the widget is being switched out, not some number of seconds before it is switch out.  Is there such a function available to widgets?

Re: chumby_timer_expires and widget switching/cycling

I second that, I have the exact same problem, I'm starting an MPlayer instance via pipeOpen and I need to be able to close it when the widget gets unloaded. How do we do that?

BTW, where did you find that chumby_timer_expires call? I can't find any details on it anywhere. How is that used?

Thanks,
Razvan

Re: chumby_timer_expires and widget switching/cycling

I am not sure if that is really possible to do inside your widget.
The control panel is switching it, so it will stop to work and can't call any functions.
But on the other hand I don't know that much flash to be 100% sure.

Is the timer just seconds or a bit more exact?
You could close the pipe when only 1 second is left and when the user really wants to extend it at that moment, you could restart the pipe and reuse the old commands.

Or you try to rebuild the heartbeat of the control panel and write an "is active" state to a file (or whatever is possible with the access restrictions) and have a second program check that file for it.