Index: Slim/Buttons/AlarmClock.pm =================================================================== --- Slim/Buttons/AlarmClock.pm (revision 18724) +++ Slim/Buttons/AlarmClock.pm (working copy) @@ -39,6 +39,7 @@ my $FADESECONDS = 20; # fade-in of 20 seconds my %menuSelection; +my %snooze = (); our %specialPlaylists; our %menuParams = (); our %functions = (); @@ -486,6 +487,9 @@ if ($time == $alarmtime) { $client->execute(['stop']); + + # register handler for starting mix of last type on remote button press [Default is press and hold shuffle] + # Slim::Buttons::Common::setFunction('snooze', \&snoozeCallback); my $volume = $prefs->client($client)->get('alarmvolume')->[ $day ]; @@ -554,6 +558,44 @@ Slim::Utils::Timers::setTimer($client, Time::HiRes::time() + 2, \&visibleAlarm, $client); } +sub snooze { + my $client = shift; + + # don't snooze again if we're already snoozing. + if (!$snooze{$client}) { + $client->execute(['stop']); + + # set up 10m snooze + $snooze{$client} = Time::HiRes::time() + (10 * 60); + + Slim::Utils::Timers::setTimer($client, $snooze{$client}, \&snoozeEnd, $client); + + $client->showBriefly({ + 'line' => [$client->string('ALARM_NOW_PLAYING'),$client->string('PLUGIN_ALARM_SNOOZE')], + 'duration' => 3, + 'block' => 1, + }); + } + + +} + +sub snoozeEnd { + my $client = shift; + + $snooze{$client} = 0; + + $client->execute(["playlist", "jump", "+1"]); + + Slim::Player::Playlist::refreshPlaylist($client); + + $client->showBriefly({ + 'line' => [$client->string('ALARM_NOW_PLAYING'),$client->string('PLUGIN_ALARM_WAKEUP')], + 'duration' => 3, + 'block' => 1, + }); +} + # temporary lines shown after alarm triggers, just to let the user know why the music started. sub alarmLines { my $client = shift; @@ -583,6 +625,7 @@ # show visible alert for 30s $client->showBriefly(alarmLines($client), 30); + $client->modeParam('alarmactive',1); } sub overlayFunc { Index: Slim/Buttons/Common.pm =================================================================== --- Slim/Buttons/Common.pm (revision 18724) +++ Slim/Buttons/Common.pm (working copy) @@ -966,9 +966,25 @@ $client->execute(["mixer", "muting", $mute]); }, + 'snooze' => sub { + my $client = shift; + + if ($client->modeParam('alarmactive')) { + Slim::Buttons::AlarmClock::snooze($client); + } + }, + 'sleep' => sub { my $client = shift; + # sleep function is overridden when alarm activates + if ($client->modeParam('alarmactive')) { + + $log->info("Alarm Active: sleep function override for snooze"); + Slim::Buttons::AlarmClock::snooze($client); + return; + } + # Bug: 2151 some extra stuff to add the option to sleep after the current song. # first make sure we're playing, and its a valid song. my $remaining = 0; Index: Slim/Plugin/RSSNews/Plugin.pm =================================================================== --- Slim/Plugin/RSSNews/Plugin.pm (revision 18724) +++ Slim/Plugin/RSSNews/Plugin.pm (working copy) @@ -357,8 +357,12 @@ my $parts = { 'line' => [ $savers->{$client}->{line1} || '' ], 'ticker' => [], + 'screen2' => Plugins::WeatherTime::Plugin::screensaverWeatherTimelines($client), }; + $client->display->screen2updateOK(1); + Plugins::WeatherTime::Plugin::setScreensaverParams($client); + # check after the update calling this function is complete to see if ticker is empty # (to refill ticker on font size change as this clears current ticker) Slim::Utils::Timers::killTimers( $client, \&tickerUpdateCheck ); @@ -469,6 +473,7 @@ 'line' => [ $line1 ], 'overlay' => [ Slim::Utils::DateTime::timeF(undef,$format) ], 'ticker' => [ undef, $line2 ], + 'screen2' => Plugins::WeatherTime::Plugin::screensaverWeatherTimelines($client), }; $savers->{$client}->{line1} = $line1; Index: IR/Default.map =================================================================== --- IR/Default.map (revision 18724) +++ IR/Default.map (working copy) @@ -55,7 +55,10 @@ power_on = power_on add.single = add add.hold = zap -sleep = sleep +sleep.single = sleep +sleep.hold = sleep +snooze.single = snooze +snooze.hold = sleep stop = stop voldown = volume_down voldown.repeat = volume_down Index: IR/Front_Panel.ir =================================================================== --- IR/Front_Panel.ir (revision 18724) +++ IR/Front_Panel.ir (working copy) @@ -40,7 +40,7 @@ preset_4.down = 00010023 # Boom: Preset 4 preset_5.down = 00010024 # Boom: Preset 5 preset_6.down = 00010025 # Boom: Preset 6 -sleep.down = 00010026 # Boom: Sleep +snooze.down = 00010026 # Boom: Sleep knob_left = 0001005a # Boom: Knob left knob_right = 0001005b # Boom: Knob right @@ -82,4 +82,4 @@ preset_4.up = 00020023 # Boom: Preset 4 preset_5.up = 00020024 # Boom: Preset 5 preset_6.up = 00020025 # Boom: Preset 6 -sleep.up = 00020026 # Boom: Sleep +snooze.up = 00020026 # Boom: Sleep