epoch1970;374831 Wrote: > Gee... Slim::Utils::Alarm->getNextAlarm() and nobody told me anything > ??? :-)) I'm generally finding two things to be helpful in wading through SqueezeCenter's code: 1). run from a svn checked-out copy: all the code is in one directory tree and so stuff is easier to find, and 2). I usually start any investigation by trying to figure out how the CLI does it...which usually entails a search through /usr/share/squeezecenter_trunk/server/Slim/Control/Queries.pm epoch1970;374831 Wrote: > If this sub does the heavy lifting now, then I guess you don't really > need to care about DST. Perhaps the server will miss wake-up / wake-up > too early and go back to sleep twice in the year; anyway what to do in > these corner cases depends on what SBs are programmed to do by SN/SC. I > would say a wait and see posture is reasonable. What's the DST change mnemonic in French? Here in the States, it's "Spring ahead, Fall back." So, if the user has an alarm established on March 7th that is intended to wake them at 6:30am, March 8th (1st day of DST in the US), with no fancy code to account for this, I assume that the server will wake up an hour late. Once it's awake, I also assume that the OS will quickly update the system clock so that SC alarm may not sound at all. I assume that what I'll need is to write some sort of IsDSTChangePending(startdate, enddate) function that will let me know if I need to compensate between "now" (the moment when I get the alarm times) and "then" (the moment when the alarm is to sound). This is a spring-only problem, as far as I've thought it through.
If I can't find a fancy perl function that extracts DST info on the current locale, then I may just punt and include DST start & end dates & times in the plugin's prefs. epoch1970;374831 Wrote: > I suppose you intend to track the player to which belongs the next alarm > as part of your code (to get alarm duration, alarm volume (?), > willingness to be reconnected to SC if on SN...) I'm not planning on anything so elaborate. Basically, every time the plugin puts the system to sleep, it will look up the next alarm time and set the rtc wakeup accordingly. The only question I have (to be answered through testing) is if a particular player has a SC alarm set but is connected to SN at the time I call getNextAlarm(). Will that player be in the list of clients? If not, then perhaps my plan for this code is too simplistic. -- gharris999 ------------------------------------------------------------------------ gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115 View this thread: http://forums.slimdevices.com/showthread.php?t=48521 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/lists/listinfo/plugins
