Michael
I have tested your new version and it seems to work perfectly with my
TrackStat plugin that adds custom items. I have verified it both with
6.2.2 and 6.5.
I really appreciate that you have decided to add my changes to your
code.
Here are some samples from my TrackStat plugin that shows how to
implement custom items:
Code:
--------------------
To add custom items the following methods needs to be implemented in
your own plugin. The text shown in custom items will be replaced at
the following times:
- Screensaver activation
- Track change
getMusicInfoSCRCustomItems
- This method should return a map with all custom items implemented by
your plugin.
Example code from the TrackStat plugin:
my %musicInfoSCRItems = (
'TRACKSTAT_RATING_DYNAMIC' => 'TRACKSTAT_RATING_DYNAMIC',
'TRACKSTAT_RATING_NUMBER' => 'TRACKSTAT_RATING_NUMBER');
sub getMusicInfoSCRCustomItems()
{
return \%musicInfoSCRItems;
}
getMusicInfoSCRCustomItem
- This methods will be called when one of your custom items is found. It
is the responsiblity of your plugin to replace your custom items with
real information.
Example code from the TrackStat plugin:
sub getMusicInfoSCRCustomItem()
{
my $client = shift;
my $formattedString = shift;
if ($formattedString =~ /TRACKSTAT_RATING_DYNAMIC/) {
my $playStatus = getTrackInfo($client);
my $string = ($playStatus->currentSongRating()?' *' x
$playStatus->currentSongRating():'');
$formattedString =~ s/TRACKSTAT_RATING_DYNAMIC/$string/g;
}
if ($formattedString =~ /TRACKSTAT_RATING_NUMBER/) {
my $playStatus = getTrackInfo($client);
my $string =
($playStatus->currentSongRating()?$playStatus->currentSongRating():'');
$formattedString =~ s/TRACKSTAT_RATING_NUMBER/$string/g;
}
return $formattedString;
}
--------------------
--
erland
Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=20016
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins