Quoting jonheal <[EMAIL PROTECTED]>:
I added a line to print all values of the $slimCommand to the debug log
(within the commandCallback sub). Neither "button, play" nor "button
play" appeared in the log.
However, if I changed this line:
elsif ($slimCommand eq "play")
to this:
elsif ($slimCommand eq "play" || "button, play")
that will always be TRUE, since "button, play" is a value and not a
conditional.
it doesn't phrase like spoken language, you have to do the logic each time:
elsif ($slimCommand eq "play" || $climCommand eq "button, play")
However, that isn't what you need to find anyway.
what you want to look for is:
elsif ($slimCommand eq "play || ($slimCommand eq "button" && $paramOne
eq "play"))
and that will only work when there is actually a play event. However,
as it turns out, there isn't always such a thing. if you load a
playlist, it will start playing as part of the load and there is no
play event. However, that's how slimserver works and I really don't
have to motivation to go on a mission to change that. Execute will
still do what is says...run a script on a play event.
Depending on what your script is doing, you may want to stick with
checking for "newsong" or some other event. "newsong" will at least
be a good one if you want to update a blog entry with the new song
infomation, for example.
using the 6.2.2 version, the debug needs to be --d_stdio to get the
command watcher output. in 6.5 versions, I changed to the more
standard d_plugins. The point of that was to provide the tools for
people, such as yourself, to easily change the events to be whatever
they want. Simply match the $slimCommand, $paramOne or any other
params at will and you can hijack any of the four events to be
whatever suits your needs.
as another note, copy line 159 (the setExecuteCallback) to just above
the last } in the initPlugin function (two lines above "sub lines") to
make the plugin activate on startup instead of having to activate
manually each time.
-k
_______________________________________________
Discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss