PDA

View Full Version : how can i get a function to execute every time the song changes?



damage
2005-05-21, 09:17
i'm modifying xpl.pm and i'd like it to send out an xpl message every time my slimp3 starts playing a new song. which module/function is called every time a new song starts playing?

kdf
2005-05-21, 10:08
Quoting damage <damage.1pe3rb (AT) no-mx (DOT) forums.slimdevices.com>:

>
> i'm modifying xpl.pm and i'd like it to send out an xpl message every
> time my slimp3 starts playing a new song. which module/function is
> called every time a new song starts playing?

Source.pm, trackStartEvent() (going from memory).

you can also use setExecuteCallback() in Control/Command.pm and set your own
callback function to do what you need for any given event. My Random plugin,
and Execute plugin make use of this if you want to see an example.
SlimScrobbler as well.

-kdf