PDA

View Full Version : showBriefly in Controller in new track info menu ?



erland
2008-07-02, 09:22
When I create a new information provider for the new TrackInfo menu in 7.1 and use the 'showBriefly' feature, this works correctly in the player interface which shows a message and then returns to the previous menu.

However, in the Controller interface it executes the 'showBriefly' but it doesn't return to the parent menu. Is this something that is supposed to work or is the 'showBriefly' element not supported in the Controller interface yet ?

The coderef that generates the OPML looks like this:


sub changeRating {
my $client = shift;
my $callback = shift;
my $track = shift;

my $rating = Slim::Schema->rating($track) || 0;
my $currentRating = floor(($rating+10)/20)*20;

my @item = ();
for my $value (qw(0 20 40 60 80 100)) {
my $ratingValue = {
'type' => 'opml',
'name' => cstring($client, 'RATING') . cstring($client, 'COLON') . ' ' .$value.'/100',
'url' => sub {
my $client = shift;
my $callback = shift;
my $passthrough = shift;

$client->execute(['rating',$track->id,$value]);
$callback->({
'type' => 'opml',
'showBriefly' => 1,
'name' => 'New rating '.$value,
});
},
};
push @item,$ratingValue;
}
$callback->(\@item);
}


And the modification of the Rating info item in Slim/Menu/TrackInfo.pm:


sub infoRating {
my ( $client, $url, $track ) = @_;

my $item;

my $rating = Slim::Schema->rating($track) || 0;
$item = {
type => 'opml',
name => cstring($client, 'RATING') . cstring($client, 'COLON') . ' ' . $rating.'/100',
url => \&changeRating,
passthrough => [$track],
};
return $item;
}

peterw
2008-07-02, 10:58
When I create a new information provider for the new TrackInfo menu in 7.1 and use the 'showBriefly' feature, this works correctly in the player interface which shows a message and then returns to the previous menu.

However, in the Controller interface it executes the 'showBriefly' but it doesn't return to the parent menu. Is this something that is supposed to work or is the 'showBriefly' element not supported in the Controller interface yet ?

I have not tried any 7.1 builds, but in 7.0, the old showBriefly() method causes a transparent popup from the bottom of the Controller screen if passed a 'jive' argument, e.g.



$client->showBriefly( { 'jive' => { 'text' => [ $message ], } },{'duration' => 1, 'block' => 1, } );

erland
2008-07-02, 11:11
I have not tried any 7.1 builds, but in 7.0, the old showBriefly() method causes a transparent popup from the bottom of the Controller screen if passed a 'jive' argument, e.g.



$client->showBriefly( { 'jive' => { 'text' => [ $message ], } },{'duration' => 1, 'block' => 1, } );


It still do (I think) but that's not the problem.
There is a popup shown, but the problem is when I have a showBriefly in the OPML structure it browse down into the item besides showing the popup.