in reply to Re: Logitech Media Server/Squeezebox/Squeeze Server/Slim devices help
in thread Logitech Media Server/Squeezebox/Squeeze Server/Slim devices help
It breaks. When I use the normal menu already in the plugin the setmode function has this in it's variables.sub setMode { my $class = shift; my $client = shift; my $method = shift; # Handle requests to exit this mode/plugin by going back to where +the user was before they came # here. If you don't this, pressing LEFT will just put you straig +ht back to where you already # are! (try commenting out the following if statement) if ($method eq 'pop') { # Pop the current mode off the mode stack and restore the prev +ious one Slim::Buttons::Common::popMode($client); return; } if (isBlindTest($client)) { Slim::Buttons::Common::pushMode($client, $modeBlindTest); } else { pushMainMenuMode($client); } }
That's from the brutefirdrcMainMenu function. I'm pretty sure the Slim::Buttons stuff is where it falls apart because I have no idea what that really does or how to duplicate it. This is the menu entry I made that's supposed to do all that.my $valueref = $client->modeParam('valueRef'); if ($$valueref eq 'PLUGIN_BRUTEFIR_DRC_CHANGE_FILTER') { my $baseDir = getFilterDir(); my $currentDir = getCurrentFilterDir($client); $currentDir =~ s/$baseDir//; my @dirs = File::Spec->splitdir($currentDir); $currentDir = $baseDir; # push all directories on the path to current selected fil +ters dir as mode to make left pop them each out foreach my $dir (@dirs) { if ($dir) { Slim::Buttons::Common::pushMode($client, $modeFilt +erSelection, { folder => $currentDir }); $currentDir = File::Spec->catdir($currentDir, $dir +); } } Slim::Buttons::Common::pushModeLeft($client, $modeFilterSe +lection, { folder => getCurrentFilterDir($client) }); }
Any ideas how to make this work. Thanks,sub filterMenu { my ($client, $callback, $args) = @_; my $baseDir = getFilterDir(); my $currentDir = getCurrentFilterDir($client); $currentDir =~ s/$baseDir//; my @dirs = File::Spec->splitdir($currentDir); $currentDir = $baseDir; my $folder = $currentDir; my @filters; my %filters = getFiltersList($folder); my @choices = sort keys %filters; my @choicev = map $filters{$_}, @choices; my $filter = $filters{getCurrentFilter($client)} eq getCurrentFilt +erPath($client) ? getCurrentFilter($client) : ''; opendir DIR, $currentDir or die "cannot open dir $currentDir: $!"; my @file= readdir DIR; closedir DIR; my $items; $items = [{ { name => 'Select a Filter', url => \&filterMenu, },{ name => $filter, url => \&filterMenu, } }]; for my $file (@file) { push @$items, { name => $file, url => sub { my ($client, $cb, $params) = @_; }, nextWindow => 'refresh', }; } $callback->({ items => $items }); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Logitech Media Server/Squeezebox/Squeeze Server/Slim devices help
by CountZero (Bishop) on Nov 22, 2013 at 20:40 UTC |