Index: Slim/Player/Player.pm =================================================================== --- Slim/Player/Player.pm (revision 4647) +++ Slim/Player/Player.pm (working copy) @@ -543,6 +543,7 @@ # 3 = server side push & bumpLeft/Right # 4 = server side bumpUp/Down # 5 = server side showBriefly +# 6 = clear scrolling (used for scrollonce and end scrolling mode) # # scrollState: # 0 = no scrolling @@ -553,7 +554,8 @@ sub update { my $client = shift; my $lines = shift; - my $scrollMode = shift; # 0 = normal scroll, 1 = scroll once only, 2 = no scroll, 3 = ticker scroll + my $scrollMode = shift; # 0 = normal scroll, 1 = scroll once only, 2 = no scroll, 3 = ticker scroll, + # 4 = scroll once and end (used for showBriefly mode which clears once scroll is completed) # return if updates are blocked return if ($client->updateMode() == 2); @@ -573,6 +575,7 @@ $scrollMode = 1 if ($parts->{scrollmode} eq 'scrollonce'); $scrollMode = 2 if ($parts->{scrollmode} eq 'noscroll'); $scrollMode = 3 if ($parts->{scrollmode} eq 'ticker'); + $scrollMode = 4 if ($parts->{scrollmode} eq 'scrollonceend'); } elsif (!defined($scrollMode)) { $scrollMode = $client->paramOrPref('scrollMode'); } @@ -582,6 +585,7 @@ elsif ($scrollMode == 1) { $scroll = 1; $scrollonce = 1; $ticker = 0; } elsif ($scrollMode == 2) { $scroll = 0; $scrollonce = 0; $ticker = 0; } elsif ($scrollMode == 3) { $scroll = 2; $scrollonce = 1; $ticker = 1; } + elsif ($scrollMode == 4) { $scroll = 1; $scrollonce = 2; $ticker = 0; } my $render = $client->render($parts, $scroll); @@ -672,23 +676,23 @@ $parsed = $client->parseLines([$line1,$line2]); } - my $duration = shift; - my $firstLineIfDoubled = shift; - my $blockUpdate = shift; + my $duration = shift || 1; # duration - default to 1 second + my $firstLineIfDoubled = shift; # use 1st line in doubled mode + my $blockUpdate = shift; # block other updates from cancelling + my $scrollToEnd = shift; # scroll text once before cancelling if scrolling is necessary if ($firstLineIfDoubled && ($client->linesPerScreen() == 1)) { $parsed->{line2} = $parsed->{line1}; } - $client->update($parsed); + $client->update($parsed, $scrollToEnd ? 4 : undef); - if (!$duration) { - $duration = 1; - } - $client->updateMode( $blockUpdate ? 2 : 1 ); $client->animateState(5); - Slim::Utils::Timers::setTimer($client,Time::HiRes::time() + $duration, \&endAnimation); + + if (!$scrollToEnd || !$client->scrollData()) { + Slim::Utils::Timers::setTimer($client,Time::HiRes::time() + $duration, \&endAnimation); + } } sub block { @@ -808,7 +812,8 @@ sub scrollInit { my $client = shift; my $render = shift; - my $scrollonce = shift; # 0 = continue scrolling after pause, 1 = scroll to endscroll and then stop + my $scrollonce = shift; # 0 = continue scrolling after pause, 1 = scroll to endscroll and then stop, + # 2 = scroll to endscroll and then end animation (causing new update) my $ticker = shift; # 0 = normal pause-scroll, 1 = ticker mode my $refresh = $client->paramOrPref($client->linesPerScreen() == 1 ? 'scrollRateDouble': 'scrollRate'); @@ -820,7 +825,8 @@ my $scroll = { 'endscroll' => $render->{endscroll}, 'offset' => 0, - 'scrollonce' => $scrollonce, + 'scrollonce' => $scrollonce ? 1 : 0, + 'scrollonceend' => ($scrollonce == 2) ? 1 : 0, 'refreshInt' => $refresh, 'pauseInt' => $pause, 'pauseUntil' => $start, @@ -1018,9 +1024,15 @@ # finished scrolling at next scrollUpdate $scroll->{scrollonce} = 2; } elsif ($scroll->{scrollonce} == 2) { - # transition to permanent scroll pause state, don't schedule a new update + # transition to permanent scroll pause state $scroll->{offset} = 0; $scroll->{paused} = 1; + if ($scroll->{scrollonceend}) { + # schedule endAnimaton to kill off scrolling and display new screen + $client->animateState(6); + my $end = ($scroll->{pauseInt} > 0.5) ? $scroll->{pauseInt} : 0.5; + Slim::Utils::Timers::setTimer($client, $timenow + $end, \&endAnimation); + } return; } } elsif ($scroll->{pauseInt} > 0) { @@ -1042,7 +1054,7 @@ my $animate = $client->animateState(); Slim::Utils::Timers::killTimers($client, \&update) if ($animate == 2); Slim::Utils::Timers::killTimers($client, \&pushUpdate) if ($animate == 3); - Slim::Utils::Timers::killTimers($client, \&endAnimation) if ($animate == 4 || $animate == 5); + Slim::Utils::Timers::killTimers($client, \&endAnimation) if ($animate == 4 || $animate == 5 || $animate == 6); $client->scrollStop() if (($client->scrollState() > 0) && !$exceptScroll) ; $client->animateState(0); $client->updateMode(0); @@ -1063,7 +1075,7 @@ # call update using lines stored in render cache except for showBriefly and bump Up/Down my $screen; my $animate = $client->animateState(); - $screen = $client->renderCache() unless ($animate == 4 || $animate == 5); + $screen = $client->renderCache() unless ($animate == 4 || $animate == 5 || $animate == 6); $client->animateState(0); $client->updateMode(0); $client->update($screen); Index: Slim/Player/SqueezeboxG.pm =================================================================== --- Slim/Player/SqueezeboxG.pm (revision 4647) +++ Slim/Player/SqueezeboxG.pm (working copy) @@ -768,7 +768,7 @@ Slim::Utils::Timers::killTimers($client, \&Slim::Player::Player::update) if ($animate == 2); Slim::Utils::Timers::killTimers($client, \&pushUpdate) if ($animate == 3); Slim::Utils::Timers::killTimers($client, \&endAnimation) if ($animate == 4); - Slim::Utils::Timers::killTimers($client, \&Slim::Player::Player::endAnimation) if ($animate == 5); + Slim::Utils::Timers::killTimers($client, \&Slim::Player::Player::endAnimation) if ($animate == 5 || $animate == 6); $client->scrollStop() if (($client->scrollState() > 0) && !$exceptScroll) ; $client->animateState(0); $client->updateMode(0);