Index: Slim/Player/Playlist.pm =================================================================== --- Slim/Player/Playlist.pm (revision 3154) +++ Slim/Player/Playlist.pm (working copy) @@ -164,7 +164,9 @@ } } - refreshPlaylist($client,Slim::Buttons::Playlist::browseplaylistindex($client)); + refreshPlaylist($client,Slim::Buttons::Playlist::showingNowPlaying($client) ? + undef : + Slim::Buttons::Playlist::browseplaylistindex($client)); } sub removeMultipleTracks { @@ -270,6 +272,12 @@ my $client = shift; my $index = shift; +if ($::d_playlist) { + Slim::Utils::Misc::msg("refreshPlaylist\n"); + use Data::Dumper; + print Dumper($index); +} + # make sure we're displaying the new current song in the playlist view. for my $everybuddy ($client, Slim::Player::Sync::syncedWith($client)) { if ($everybuddy->isPlayer()) { Index: Slim/Buttons/Playlist.pm =================================================================== --- Slim/Buttons/Playlist.pm (revision 3154) +++ Slim/Buttons/Playlist.pm (working copy) @@ -62,6 +62,7 @@ if ($songcount < 2) { $client->bumpUp() if ($button !~ /repeat/); } else { + $client->param('showingnowplaying',0); $inc = ($inc =~ /\D/) ? -1 : -$inc; my $newposition = Slim::Buttons::Common::scroll($client, $inc, $songcount, browseplaylistindex($client)); if ($newposition != browseplaylistindex($client)) { @@ -78,6 +79,7 @@ if ($songcount < 2) { $client->bumpDown() if ($button !~ /repeat/); } else { + $client->param('showingnowplaying',0); if ($inc =~ /\D/) {$inc = 1} my $newposition = Slim::Buttons::Common::scroll($client, $inc, $songcount, browseplaylistindex($client)); if ($newposition != browseplaylistindex($client)) { @@ -130,7 +132,6 @@ Slim::Control::Command::execute($client, ["playlist", "delete", browseplaylistindex($client)]); $client->showBriefly( $client->string('REMOVING_FROM_PLAYLIST'), $songtitle, undef, 1); } - jump($client); }, 'zap' => sub { @@ -142,12 +143,11 @@ $client->showBriefly( $client->string('ZAPPING_FROM_PLAYLIST'), Slim::Music::Info::standardTitle($client, - Slim::Player::Playlist::song($client, browseplaylistindex($client))), undef, 1 + Slim::Player::Playlist::song($client, browseplaylistindex($client))), undef, 1 ); Slim::Control::Command::execute($client, ["playlist", "zap", browseplaylistindex($client)]); } - jump($client); }, 'play' => sub { @@ -186,11 +186,14 @@ my $client = shift; my $pos = shift; - if (Slim::Buttons::Common::mode($client) eq 'playlist' || showingNowPlaying($client)) { + if (showingNowPlaying($client) || ! defined browseplaylistindex($client)) { if (!defined($pos)) { $pos = Slim::Player::Source::playingSongIndex($client); } - +if ($::d_playlist) { + print "Jump: $pos\n"; + Slim::Utils::Misc::bt(); +} #kill the animation to allow the information to update; $client->killAnimation(); browseplaylistindex($client,$pos); @@ -233,15 +236,26 @@ return ($line1, $line2, undef, $overlay2); } -# this is somewhat confusing. sub showingNowPlaying { my $client = shift; - return ( +if ($::d_playlist) { + Slim::Utils::Misc::msg("showingNowPlaying: browse & playing\n"); + use Data::Dumper; + print Dumper(browseplaylistindex($client), Slim::Player::Source::playingSongIndex($client)); +} + # special case of playlist mode, to indicate when server needs to + # display the now playing details. This includes playlist mode and + # now playing (jump back on wake) screensaver. + my $showing = ( (Slim::Buttons::Common::mode($client) eq 'screensaver') || (Slim::Buttons::Common::mode($client) eq 'playlist') && - (browseplaylistindex($client) == Slim::Player::Source::playingSongIndex($client)) + ((browseplaylistindex($client)|| 0) == Slim::Player::Source::playingSongIndex($client)) ); + + my $was = $client->param('showingnowplaying'); + + return $client->param('showingnowplaying',$showing || $was); } sub browseplaylistindex {