I've been contemplating a Squeezebox for the bedroom & thinking about my
wife's habit of setting clocks a few minutes fast for early morning
motivation. A Squeezebox would need to be dark or lie about the time to
please her. Enter FuzzyTime.
http://www.tux.org/~peterw/slim/FuzzyTime.pm

It's much like the standard Date and Time Screensaver, but it allows
you to use the web interface, on a per-player basis, to set how many
minutes the FuzzyTime screensaver can be "ahead" of real time. You can
choose a  Fixed amount of time (e.g., always exactly 5 minutes ahead),
or a Random amount (e.g., 0 seconds to 5 minutes ahead, so you don't
know how much the screensaver is fudging the time, if at all). 

Also, I've designed it so that other plugins can make use of its
drifting capabilities. The following code snippet shows how I modified
SuperDateTime 4.0.6 so that it would use FuzzyTime's code to lie about
the current time (but tell me the truth about the weather forecast).

Comments & suggestions appreciated,

-Peter


Code:
--------------------
    
  @@ -3168,11 +3168,20 @@
  Slim::Utils::Timers::killTimers($client, \&nextDisplayItem);
  Slim::Utils::Timers::killTimers($client, \&topLineSet);
  }
  +
  +sub getTime($) {
  +      my $client = shift;
  +      if ( defined($Plugins::FuzzyTime::apiVersion) ) {
  +               return int(Plugins::FuzzyTime::getClientTime($client));
  +       }
  +       return time();
  +}
  +
  sub screensaverSuperDateTimelines {
  my $client = shift;
  
  if ($nowshowing{$client} == 0) { #Show time and temperature
  -               my $time = Slim::Utils::Misc::timeF();
  +               my $time = Slim::Utils::Misc::timeF(&getTime($client),undef);
  $displayLine2{$client} = $weatherString;
  $displayLine2{$client} =~ s/%1/$time/;
  
--------------------


-- 
peterw
------------------------------------------------------------------------
peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107
View this thread: http://forums.slimdevices.com/showthread.php?t=31878

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

Reply via email to