Erland:
I have the call to Slim::Control::Jive::registerPluginMenu in
initPlugin(). See below. Like .ompl, I can never get initPlugin it to
print a debug line to the log. getDisplayName() never gets called, and
it does on .ompl
Here's the code, derived from Random Mix, with substitutions and lines
commented out to avoid bringing in all the Random Mix code:
So - I expect to see something on the RADIO menu?
Thanks for your help,
sub donothing {
}
sub initPlugin {
my $class = shift;
# playlist commands that will stop random play
%stopcommands = (
'clear' => 1,
'loadtracks' => 1, # multiple play
'playtracks' => 1, # single play
'load' => 1, # old style url load (no play)
'play' => 1, # old style url play
'loadalbum' => 1, # old style multi-item load
'playalbum' => 1, # old style multi-item play
);
%displayText = (
'track' => 'PLUGIN_XMRADIO_NATIVE',
'album' => 'PLUGIN_XMRADIO_LOW',
'contributor' => 'PLUGIN_XMRADIO_ALPHA',
'year' => 'PLUGIN_XMRADIO_SHORT_NAME'
);
%mixTypeMap = (
'tracks' => 'track',
'contributors' => 'contributor',
'albums' => 'album',
'year' => 'year',
'artists' => 'contributor',
);
$log->debug("In initPlugin");
my %seen;
@mixTypes = map { $mixTypeMap{$_} } grep (!$seen{$mixTypeMap{$_}}++,
keys %mixTypeMap);
# create function map
foreach (keys %mixTypeMap) {
my $type = $mixTypeMap{$_};
$functions{$_} = sub { donothing(shift, $type); }
}
# generateGenreNameMap();
$class->SUPER::initPlugin();
# set up our subscription
# Slim::Control::Request::subscribe(\&commandCallback,
# [['playlist'], ['newsong', 'delete', keys %stopcommands]]);
# Regenerate the genre map after a rescan.
# Slim::Control::Request::subscribe(\&generateGenreNameMap,
[['rescan'], ['done']]);
# |requires Client
# | |is a Query
# | | |has Tags
# | | | |Function to call
# C Q T F
Slim::Control::Request::addDispatch(['xmneilplay', '_mode'],
[1, 0, 0, \&donothing]);
Slim::Control::Request::addDispatch(['xmneilplaygenrelist', '_index',
'_quantity'],
[1, 1, 0, \&donothing]);
Slim::Control::Request::addDispatch(['xmneilplaychoosegenre',
'_genre', '_value'],
[1, 0, 0, \&donothing]);
Slim::Control::Request::addDispatch(['xmneilplaygenreselectall',
'_value'],
[1, 0, 0, \&donothing]);
# Slim::Player::ProtocolHandlers->registerHandler(
# xmneilplay => 'Slim::Plugin::xmneilPlay::ProtocolHandler'
# );
# register handler for starting mix of last type on remote button
press [Default is press and hold shuffle]
Slim::Buttons::Common::setFunction('rafheuys', \&donothing);
my @item = (
{
stringToken => 'PLUGIN_XMRADIO_NATIVE',
id => 'xmneiltracks',
weight => 10,
style => 'itemplay',
nextWindow => 'nowPlaying',
node => 'xmneilplay',
actions => {
play => {
player => 0,
cmd => [ 'xmneilplay', 'tracks' ],
},
go => {
player => 0,
cmd => [ 'xmneilplay', 'tracks' ],
},
},
},
{
stringToken => 'PLUGIN_XMRADIO_LOW',
id => 'xmneilalbums',
weight => 20,
style => 'itemplay',
nextWindow => 'nowPlaying',
node => 'xmneilplay',
actions => {
play => {
player => 0,
cmd => [ 'xmneilplay', 'albums' ],
},
go => {
player => 0,
cmd => [ 'xmneilplay', 'albums' ],
},
},
},
{
stringToken => 'PLUGIN_XMRADIO_ALPHA',
id => 'xmneilartists',
weight => 30,
style => 'itemplay',
nextWindow => 'nowPlaying',
node => 'xmneilplay',
actions => {
play => {
player => 0,
cmd => [ 'xmneilplay',
'contributors' ],
},
go => {
player => 0,
cmd => [ 'xmneilplay',
'contributors' ],
},
},
},
{
stringToken => 'PLUGIN_XMRADIO_SHORT_NAME',
id => 'xmneilyears',
weight => 40,
style => 'itemplay',
nextWindow => 'nowPlaying',
node => 'xmneilplay',
actions => {
play => {
player => 0,
cmd => [ 'xmneilplay', 'year' ],
},
go => {
player => 0,
cmd => [ 'xmneilplay', 'year' ],
},
},
},
{
stringToken => 'PLUGIN_XMRADIO_SHORT_NAME',
id => 'xmneilchoosegenres',
weight => 50,
window => { titleStyle => 'xmneil' },
node => 'xmneilplay',
actions => {
go => {
player => 0,
cmd => [ 'xmneilplaygenrelist' ],
},
},
},
{
stringToken => getDisplayName(),
weight => 60,
id => 'xmneilplay',
node => 'myMusic',
isANode => 1,
window => { titleStyle => 'xmneil' },
},
);
Slim::Control::Jive::registerPluginMenu(\...@item);
}
--
wharfrat
------------------------------------------------------------------------
wharfrat's Profile: http://forums.slimdevices.com/member.php?userid=29248
View this thread: http://forums.slimdevices.com/showthread.php?t=61106
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins