Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,077

    showBriefly in Controller in new track info menu ?

    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:
    Code:
    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:
    Code:
    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;
    }
    Erland Isaksson (My homepage)
    Developer of many plugins/applets

  2. #2
    Quote Originally Posted by erland View Post
    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.

    Code:
    $client->showBriefly( { 'jive' => { 'text'    => [ $message ], } },{'duration' => 1, 'block' => 1, } );
    owner of the stuff at https://tuxreborn.netlify.app/
    (which used to reside at www.tux.org/~peterw/)
    Note: The best way to reach me is email or PM, as I don't spend much time on the forums.
    Free plugins: AllQuiet Auto Dim/AutoDisplay BlankSaver ContextMenu DenonSerial
    FuzzyTime KidsPlay KitchenTimer PlayLog PowerCenter/BottleRocket SaverSwitcher
    SettingsManager SleepFade StatusFirst SyncOptions VolumeLock

  3. #3
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,077
    Quote Originally Posted by peterw View Post
    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.

    Code:
    $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.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •