Below is the code for the logic that goes into the mixer behavior on the
controller.
Code:
--------------------
sub _mixers {
my $Imports = Slim::Music::Import->importers;
my @mixers = ();
for my $import (keys %{$Imports}) {
next if !$Imports->{$import}->{'mixer'};
next if !$Imports->{$import}->{'use'};
next if !$Imports->{$import}->{'cliBase'};
next if !$Imports->{$import}->{'contextToken'};
push @mixers, $import;
}
return ($Imports, [EMAIL PROTECTED]);
}
sub _mixerBase {
my ($Imports, $mixers) = _mixers();
# one enabled mixer available
if ( scalar(@$mixers) == 1 ) {
return $Imports->{$mixers->[0]}->{'cliBase'};
} elsif (@$mixers) {
return {
player => 0,
cmd => ['contextmenu'],
params => {
menu => '1',
},
itemsParams => 'params',
};
} else {
return undef;
}
}
--------------------
The controller UI differs from the playerUI and webUI in that it uses a
"base" item to save JSON bandwidth. So for example if you have a list of
1200 albums coming from SC, rather than send the identical cli callback
with every element in the JSON, the base element contains everything
needed for the item handler except for (typically) the object id that
is a parameter to the cli callback.
The play-hold handler for mixers is no exception to this. When
executing a cli request from the controller, it checks for what and how
many mixers are available through Slim::Music::Import->importers (see
_mixers() above for details). Then based on how many mixers are
available it decides what the cli callback will be: directly to the
mixer if only one mixer is available, or a mixer context menu if more
than one are available.
Given that structure, my question to you is this-- how can I query the
mixer through Slim::Music::Import->importers to know whether a
particular type of object is not available for mixing? Is that even
possible?
cheers,
#!/ben
--
bklaas
Logitech Developer:
Squeezeplay/SqueezeOS/SqueezeboxController/SqueezeCenter
Community Developer: Nokia770Skin
http://www.last.fm/user/bklaas/
'KHAAAN!' (http://khaaan.com/)...'BUNNIES!'
(http://home.pacbell.net/bettychu/2003allbreedbisris/BIS.html)
------------------------------------------------------------------------
bklaas's Profile: http://forums.slimdevices.com/member.php?userid=58
View this thread: http://forums.slimdevices.com/showthread.php?t=50744
_______________________________________________
jive mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive