kolding;276739 Wrote: 
> 
> setTimer() only gets called from checkOnOff(), and checkOnOff() is only
> called if a: the timer fires (twice a day per enabled player), b: a
> change in state takes place (player on/off, only a few times a day, or
> new player detected, even less often, probably), or c: you change the
> options (very infrequently).  I have no idea how the timer mechanism in
> SqueezeCenter is implemented.  I'd assume as a priority queue, and this
> would be way down that queue most of the time.

I would think that somehow that timer code must be running through
every second or things would not happen with that one second time
resolution (this is where my shallow knowledge of the whole plugin
architecture and coding fails me).  I may be mistaken but this implies
that every second you are doing all the calculations in setTimer() and
nextTime().  In any event all your advantages are maintained if you
blow all of setTimer(), now(), and netTime() away and replace it with
the old setTimer() code with the much simpler trigger (also adding back
the $time variable setting code back into checkOnOff() ).  I did it and
everything *seems* fine so far and a quick look at the before and after
process load suggests it *may* to be lower.  YMMV.

> 
> Anyhow, it works, and this probably isn't the best forum for a
> code/design review.
> 

Sure but it can always work better ;-).  I don't know what a better
forum would be.  The last time around it was emails between Tobias and
myself cc'ing Felix.


-- 
Daryle Tilroe
------------------------------------------------------------------------
Daryle Tilroe's Profile: http://forums.slimdevices.com/member.php?userid=434
View this thread: http://forums.slimdevices.com/showthread.php?t=43104

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to