[Slim-Checkins] r9211 - in /trunk/server/Slim: Buttons/Playlist.pm Buttons/ScreenSaver.pm Player/Client.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Mon Aug 28 10:13:25 PDT 2006


Author: adrian
Date: Mon Aug 28 10:13:22 2006
New Revision: 9211

URL: http://svn.slimdevices.com?rev=9211&view=rev
Log:
Bug: N/A
Description: add hook for custom playlist lines function
			 fix bug with screen2 in playlist mode not showing current song

Modified:
    trunk/server/Slim/Buttons/Playlist.pm
    trunk/server/Slim/Buttons/ScreenSaver.pm
    trunk/server/Slim/Player/Client.pm

Modified: trunk/server/Slim/Buttons/Playlist.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Buttons/Playlist.pm?rev=9211&r1=9210&r2=9211&view=diff
==============================================================================
--- trunk/server/Slim/Buttons/Playlist.pm (original)
+++ trunk/server/Slim/Buttons/Playlist.pm Mon Aug 28 10:13:22 2006
@@ -314,7 +314,7 @@
 	my $client = shift;
 	my $how    = shift;
 
-	$client->lines(\&lines);
+	$client->lines( $client->customPlaylistLines() || \&lines );
 
 	if ($how ne 'pop') {
 		jump($client);
@@ -368,7 +368,9 @@
 
 	my ($parts, $line1, $line2);
 
-	if (showingNowPlaying($client) || (Slim::Player::Playlist::count($client) < 1)) {
+	my $nowPlaying = showingNowPlaying($client);
+
+	if ($nowPlaying || (Slim::Player::Playlist::count($client) < 1)) {
 
 		$parts = $client->currentSongLines();
 
@@ -397,7 +399,7 @@
 	}
 
 	if ($client->display->showExtendedText()) {
-		my $song = Slim::Player::Playlist::song($client, browseplaylistindex($client));
+		my $song = Slim::Player::Playlist::song($client, $nowPlaying ? undef : browseplaylistindex($client) );
 
 		$parts->{'screen2'} ||= {
 			'line' => [ 

Modified: trunk/server/Slim/Buttons/ScreenSaver.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Buttons/ScreenSaver.pm?rev=9211&r1=9210&r2=9211&view=diff
==============================================================================
--- trunk/server/Slim/Buttons/ScreenSaver.pm (original)
+++ trunk/server/Slim/Buttons/ScreenSaver.pm Mon Aug 28 10:13:22 2006
@@ -191,17 +191,14 @@
 
 sub setMode {
 	my $client = shift;
+
 	$::d_time && msg("going into screensaver mode");
-	$client->lines(\&lines);
+
+	$client->lines( $client->customPlaylistLines() || \&Slim::Buttons::Playlist::lines );
+
 	# update client every second in this mode
 	$client->param('modeUpdateInterval', 1); # seconds
 	$client->param('screen2', 'screensaver');
-}
-
-sub lines {
-	my $client = shift;
-	$::d_time && msg("getting screensaver lines");
-	return Slim::Buttons::Playlist::lines($client);
 }
 
 =head1 SEE ALSO

Modified: trunk/server/Slim/Player/Client.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Client.pm?rev=9211&r1=9210&r2=9211&view=diff
==============================================================================
--- trunk/server/Slim/Player/Client.pm (original)
+++ trunk/server/Slim/Player/Client.pm Mon Aug 28 10:13:22 2006
@@ -78,7 +78,7 @@
 
 	# The following indexes are unused:
 	# 2, 3, 8, 11, 12, 13, 16, 23, 24, 25, 26, 27, 33, 34, 53
-	# 64, 65, 66, 67, 68, 72, 82, 83, 94
+	# 64, 65, 66, 67, 68, 72, 82, 83
 
 	$client->[0] = $id;
 	$client->[1] = Slim::Utils::Prefs::getClientPrefs($id); # _prefs
@@ -154,6 +154,7 @@
 	$client->[91] = undef; # currentPlaylist
 	$client->[92] = undef; # currentPlaylistModified
 	$client->[93] = undef; # songElapsedSeconds
+	$client->[94] = undef; # customPlaylistLines
 	# 95 is currentPlaylistRender
 	# 96 is currentPlaylistChangeTime
 	$client->[97] = undef; # tempVolume temporary volume setting
@@ -1543,6 +1544,11 @@
 	@_ ? ($r->[93] = shift) : $r->[93];
 }
 
+sub customPlaylistLines {
+	my $r = shift;
+	@_ ? ($r->[94] = shift) : $r->[94];
+}
+
 sub currentPlaylistRender {
 	my $r = shift;
 	@_ ? ($r->[95] = shift) : $r->[95];



More information about the checkins mailing list