On 24 May 2010 23:59, Ralph Versteegen <[email protected]> wrote: > On 10 April 2010 09:53, James Paige <[email protected]> wrote: >> There is a PlotTimer.pause member, but I would consider a paused timer >> to still be in use. >> >> ... but looking at the source, PlotTimer.speed = 0 seems to indicate an >> unused timer, so I could just use that. > > Working on timers now. There is a slight problem. When a timer runs > out, its speed is negated (marking it inactive, but also preserving > the speed incase it is reactivated) and preserves all its other > settings (aside from the length). > > For example, currently to restart a timer with all the old settings > intact, "set timer (10, 100)" will suffice. I suppose you're in > trouble if you use both "unused timer" and hardcoded timer ids anyway. > Will just add some big warning notes, unless anyone has a better idea.
You know, actually this sounds exactly like the task for a "new timer" command, and garbage collecting run-out "new" timers (existing in a separate pool) which are not referenced. I could leave out the "unused timer" command for now, as "allocate timers" is good enough? >> --- >> James >> >> On Fri, Apr 09, 2010 at 09:45:14PM +0000, Mike Caron wrote: >>> I can't remember off hand, but there has to be something that indicates >>> whether a timer is in use, or it would fire constantly! >>> ------Original Message------ >>> From: James Paige >>> Sender: [email protected] >>> To: OHR List >>> ReplyTo: OHR List >>> Subject: [Ohrrpgce] one additional timer idea >>> Sent: Apr 9, 2010 5:36 PM >>> >>> Oh, one other timer idea that I forgot to mention. >>> >>> I could easily add something to indicate whether or not a timer is >>> currently in use (or is there something like that already?) >>> >>> Then I could add a command like: >>> >>> new timer >>> >>> which would look through the list and return the first unused timer >>> number. If there are no free timers it would do >>> >>> allocate timer(last available timer + 1) >>> >>> and return that. >>> >>> This would not interfere with any existing scripts that use hard-coded >>> timer functions, but it would easily allow scripters to dynamically >>> allocate their timer numbers and store them in global variables, rather >>> than having to hard-code them. >>> >>> --- >>> James >>> _______________________________________________ >>> Ohrrpgce mailing list >>> [email protected] >>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> >>> >>> >>> -- >>> Mike Caron >>> _______________________________________________ >>> Ohrrpgce mailing list >>> [email protected] >>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> >>> >> _______________________________________________ >> Ohrrpgce mailing list >> [email protected] >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >> > _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
