Daryle Tilroe;276302 Wrote: 
> Hi Eric.  I just upgraded to SlimCenter and was please to find someone
> had ported AutoDisplay.  It was a bit my baby since I rewrote the
> algorithim that didn't work correctly and fixed a few bugs.  The port
> seems to work fine but I'm curious about a few things.
> 
> One quesestion is what did you mean about 'issues' and 'hack'?  I've
> used it forever on two SB3's and one SB2 with SS 6.5.x and earlier
> (since 0.4a I suppose) and not had a problem; rock solid.  What was
> happening?  I know the very earliest versions had some time checking
> that was just not good.
> 
> The other is about your code mods.  Now I'm not really a perl or plugin
> guy so I'm syntactically challenged and a little fuzzy on all the
> variables so bear with me.
> 
> First I see in the main "checkOnOff" where you did some factoring of
> $power which is ok and moved $flag which looks fine as long as it can
> never be undefined as was checked just before where it used to be. 
> Assuming it's OK you might want to move the comment "#If autodisplay
> has been set to "ON" then continue..." to where you moved $flag.  Also
> if you are cleaning this up then perhaps the rest of the defines could
> be moved or removed.
> 
> Second I notice the checking (where "checkOnOff" is called) appears to
> be in a few more places and is called a lot more frequently.  The first
> version only checked every 60 seconds to keep the load down.  This might
> still be desirable.  It is this, previously simple, "setTimer" routine
> that I don't understand now.  It has morphed into something more
> complicated that in turn calls two other complicated funtions: "now"
> and "nextTime".  I don't quite have the mental energy to wade though
> them at 2AM and figure them out.  Perhaps when you have a minute you
> could explain what they do.  My gut feeling is that they may be a lot
> more than required for a simple check every minute and they may be a
> higher load than really needed (particularly with multiple boxes).
> 
> PS.  Thanks again for the port!

Well, by "hack" I meant that at first I did a quick hack of it, before
doing some serious porting work.

As for functions, well,now() returns, well, now, in seconds since
midnight.  nextTime() computes when the next change should take place.

So, now instead of checking every minute, it simply computes when the
next needed transition will be and only sets the timer for then.

The logic behind this was that transitions between bright and dim occur
only twice per day per enabled player, so, no need to check every minute
(1440 times per day) when you really only need to do it twice per day
per player, plus when you turn things off or add new players.  Also has
the advantage that the display goes dim at the time specified (ie,
11:00:00) instead of sometime in the next minute, and it goes dim when
the player powers off, rather than going bright for up to a minute, and
then going dim.

Also, I hate polling.  Just as a matter of principle.  Maybe I've been
working in embedded systems too long.... :-)

Hey, it seems to work...

Eric


-- 
kolding

SliMP3 -> the closet
SqueezeBox 1 -> Bose Soundwave
SqueezeBox 2 -> Rotel RSX-1056 -> Totem Acoustic Dreamcatchers
SqueezeBox 3 -> Rotel RX-1052 -> Vandersteen 1B's
------------------------------------------------------------------------
kolding's Profile: http://forums.slimdevices.com/member.php?userid=31
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