[Slim-Checkins] r12471 - in /trunk/server/Slim: Control/Commands.pm Control/Queries.pm Player/Player.pm
adrian at svn.slimdevices.com
adrian at svn.slimdevices.com
Thu Aug 2 11:02:35 PDT 2007
Author: adrian
Date: Thu Aug 2 11:02:35 2007
New Revision: 12471
URL: http://svn.slimdevices.com?rev=12471&view=rev
Log:
Bug: N/A
Description: send some customised display updates to jive
Modified:
trunk/server/Slim/Control/Commands.pm
trunk/server/Slim/Control/Queries.pm
trunk/server/Slim/Player/Player.pm
Modified: trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Commands.pm?rev=12471&r1=12470&r2=12471&view=diff
==============================================================================
--- trunk/server/Slim/Control/Commands.pm (original)
+++ trunk/server/Slim/Control/Commands.pm Thu Aug 2 11:02:35 2007
@@ -437,7 +437,7 @@
Slim::Player::Source::rate($client, 1);
# update the display
- $client->update();
+ $client->showBriefly($client->currentSongLines());
}
$request->setStatusDone();
@@ -1063,7 +1063,11 @@
}
my $timeout = $prefs->get('remotestreamtimeout') || 10;
- $client->showBriefly( $line1, $line2, $timeout + 5 );
+
+ $client->showBriefly({
+ 'line' => [$line1, $line2],
+ 'jiv' => { 'icon' => 'play', text => [ $line2 ], 'icon-id' => 0 },
+ }, { 'duration' => $timeout + 5 });
}
}
@@ -1462,6 +1466,17 @@
# don't call Xtracks if we got no songs
if (@tracks) {
+ if ($load || $add) {
+ $client->showBriefly({
+ 'jiv' => {
+ 'icon' => $load ? 'play' : 'add',
+ 'icon-id' => $tracks[0]->album->artwork || 0,
+ 'text' => [ Slim::Music::Info::displayText($client, $tracks[0], 'TITLE'),
+ Slim::Music::Info::displayText($client, $tracks[0], 'ARTIST') ]
+ }
+ });
+ }
+
$cmd .= "tracks";
Slim::Control::Request::executeRequest(
Modified: trunk/server/Slim/Control/Queries.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Queries.pm?rev=12471&r1=12470&r2=12471&view=diff
==============================================================================
--- trunk/server/Slim/Control/Queries.pm (original)
+++ trunk/server/Slim/Control/Queries.pm Thu Aug 2 11:02:35 2007
@@ -784,10 +784,21 @@
$request->addResult("$c$l", $parts->{$c}[$l]) if ($parts->{$c}[$l] ne '');
}
}
+
} elsif ($source eq 'JIV') {
- # send an array to jive from one of the following components
- $request->addResult('display', $parts->{'jiv'} || $parts->{'line'} || $parts->{'center'});
+ # send display to jive from one of the following components
+ if (my $ref = $parts->{'jiv'} && ref $parts->{'jiv'}) {
+ if ($ref eq 'CODE') {
+ $request->addResult('display', $parts->{'jiv'}->() );
+ } elsif($ref eq 'ARRAY') {
+ $request->addResult('display', { 'text' => $parts->{'jiv'} });
+ } else {
+ $request->addResult('display', $parts->{'jiv'} );
+ }
+ } else {
+ $request->addResult('display', { 'text' => $parts->{'line'} || $parts->{'center'} });
+ }
}
$request->privateData({});
Modified: trunk/server/Slim/Player/Player.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Player.pm?rev=12471&r1=12470&r2=12471&view=diff
==============================================================================
--- trunk/server/Slim/Player/Player.pm (original)
+++ trunk/server/Slim/Player/Player.pm Thu Aug 2 11:02:35 2007
@@ -441,7 +441,8 @@
}
}
- my $currentTitle = Slim::Music::Info::getCurrentTitle($client, Slim::Player::Playlist::url($client));
+ my $song = Slim::Player::Playlist::song($client);
+ my $currentTitle = Slim::Music::Info::getCurrentTitle($client, $song->url);
$parts->{line}[1] = $currentTitle;
@@ -455,8 +456,6 @@
my ($s2line1, $s2line2);
- my $song = Slim::Player::Playlist::song($client);
-
if ($song && $song->isRemoteURL) {
my $title = Slim::Music::Info::displayText($client, $song, 'TITLE');
@@ -476,6 +475,12 @@
'line' => [ $s2line1, $s2line2 ],
};
}
+
+ $parts->{'jiv'} = {
+ 'icon' => Slim::Player::Source::playmode($client),
+ 'icon-id' => $song->album ? $song->album->artwork : 0,
+ 'text' => [ $currentTitle, Slim::Music::Info::displayText($client, $song, 'ARTIST') ],
+ };
}
return $parts;
More information about the checkins
mailing list