Hi Folks,

I'm trying to create a plugin that creates a new CLI command. From
reading notes and other source files, I have tried:-

sub initPlugin {
my $class = shift;

Slim::Control::Request::addDispatch(['play','dog'], [1, 0, 0,
\&doPlayDog]);

$::d_plugins && msg("Dog Alert Plugin Has been inited and is
enabled : $dogEnabled\n");

}

sub doPlayDog {
my $request = shift;
my $client = $request->client();

$::d_plugins && msg("Doing play dog");

if( $dogEnabled == 1) {
$client->execute(["playlist", "save", "doodleloo"]);
$client->execute(["playlist", "play",
"/home/NAS/TransferArea/bark.mp3"]);
}
}

The Init method is getting called fine. However, when I execute the CLI
command

<player id> play dog

doPlayDog is not called.

Where am I going wrong?

Do I have to create a CLI command that enhances an existing command or
can I make up my own command name and syntax?

Do I have to do something special from the CLI to identify my plugin's
commands?

Any help gratefully received.

Thanks

Dave


-- 
comet
------------------------------------------------------------------------
comet's Profile: http://forums.slimdevices.com/member.php?userid=13170
View this thread: http://forums.slimdevices.com/showthread.php?t=38384

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to