[Slim-Checkins] r8807 - in /trunk/server: Changelog6.html Slim/Display/Display.pm Slim/Display/Graphics.pm Slim/Player/Player.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Sat Aug 5 03:33:49 PDT 2006


Author: adrian
Date: Sat Aug  5 03:33:45 2006
New Revision: 8807

URL: http://svn.slimdevices.com?rev=8807&view=rev
Log:
Bug: 3064
Description: Invert progress bar for remaining time display.
Implemented for graphics players only as text players would require
additional custom chars.

Modified:
    trunk/server/Changelog6.html
    trunk/server/Slim/Display/Display.pm
    trunk/server/Slim/Display/Graphics.pm
    trunk/server/Slim/Player/Player.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=8807&r1=8806&r2=8807&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Sat Aug  5 03:33:45 2006
@@ -296,6 +296,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3037">#3037</a> - MusicMagic API Playlist Generation Flawed in 6.2.1</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3044">#3044</a> - Lyrics do not display with line spacing correctly.</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3045">#3045</a> - Change in Request.pm 6318 introduced new bug</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3045">#3064</a> - Remaining Time progress bar should be inverted</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3069">#3069</a> - Explicit namesort values can be overwritten</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3073">#3073</a> - Artists containing special characters in iTunes are missing</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3105">#3105</a> - Pressing ADD in Live Music Archive plugin does wrong thing</li>

Modified: trunk/server/Slim/Display/Display.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Display/Display.pm?rev=8807&r1=8806&r2=8807&view=diff
==============================================================================
--- trunk/server/Slim/Display/Display.pm (original)
+++ trunk/server/Slim/Display/Display.pm Sat Aug  5 03:33:45 2006
@@ -467,7 +467,7 @@
 
 sub progressBar {
 	my $display = shift;
-	return $display->sliderBar(shift,(shift)*100,0);
+	return $display->sliderBar(shift,(shift)*100,0,undef,shift);
 }
 
 sub balanceBar {

Modified: trunk/server/Slim/Display/Graphics.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Display/Graphics.pm?rev=8807&r1=8806&r2=8807&view=diff
==============================================================================
--- trunk/server/Slim/Display/Graphics.pm (original)
+++ trunk/server/Slim/Display/Graphics.pm Sat Aug  5 03:33:45 2006
@@ -524,11 +524,15 @@
 # Draws a slider bar, bidirectional or single direction is possible.
 # $value should be pre-processed to be from 0-100
 # $midpoint specifies the position of the divider from 0-100 (use 0 for progressBar)
+# $reverse reverses fill for progressBar only (0 midpoint)
+
 sub sliderBar {
 	my $display = shift;
 	my $width = shift;
 	my $value = shift;
 	my $midpoint = shift;
+	my $fullstep = shift; # unused - only for text sliderBar
+	my $reverse = shift;
 
 	$midpoint = 0 unless defined $midpoint;
 
@@ -580,19 +584,20 @@
 	for (my $i = $divider + 1; $i < $spaces; $i++) {
 		if ($value <= $midpoint) {
 			if ($i == $divider +1 || $i == $spaces - 1) {
-				$chart .= $prog1e;
+				$chart .= $reverse ? $prog1 : $prog1e;
 			} elsif ($i == $divider + 2 || $i == $spaces - 2) {
-				$chart .= $prog2e;
+				$chart .= $reverse ? $prog2 : $prog2e;
 			} else {
-				$chart .= $prog3e;
+				$chart .= $reverse ? $prog3 : $prog3e;
 			}
 		} else {
+			my $pos = $reverse ? ($i <= $dots) : ($i > $dots);
 			if ($i == $divider +1 || $i == $spaces - 1) {
-				$chart .= ($i > $dots) ? $prog1e : $prog1;
+				$chart .= $pos ? $prog1e : $prog1;
 			} elsif ($i == $divider + 2 || $i == $spaces - 2) {
-				$chart .= ($i > $dots) ? $prog2e : $prog2;
+				$chart .= $pos ? $prog2e : $prog2;
 			} else {
-				$chart .= ($i > $dots) ? $prog3e : $prog3;
+				$chart .= $pos ? $prog3e : $prog3;
 			}
 		}
 	}

Modified: trunk/server/Slim/Player/Player.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Player.pm?rev=8807&r1=8806&r2=8807&view=diff
==============================================================================
--- trunk/server/Slim/Player/Player.pm (original)
+++ trunk/server/Slim/Player/Player.pm Sat Aug  5 03:33:45 2006
@@ -568,12 +568,12 @@
 
 		$parts->{line}[1] = Slim::Music::Info::getCurrentTitle($client, Slim::Player::Playlist::url($client));
 
-		$parts->{overlay}[1] = $client->symbols(Slim::Display::Display::symbol('notesymbol'));
+		$parts->{overlay}[1] = $client->symbols('notesymbol');
 
 		# add in the progress bar and time...
 		$client->nowPlayingModeLines($parts);
 	}
-	
+
 	return $parts;
 }
 
@@ -622,7 +622,7 @@
 		# show both the bar and the time
 		my $leftLength = $display->measureText($parts->{line}[0], 1);
 		my $barlen = $displayWidth - $leftLength - $display->measureText($overlay, 1);
-		my $bar    = $display->symbols($client->progressBar($barlen, $fractioncomplete));
+		my $bar    = $display->symbols($client->progressBar($barlen, $fractioncomplete, ($showTime < 0)));
 
 		$overlay = $bar . $songtime;
 	}



More information about the checkins mailing list