Michael Herger;159321 Wrote: > > > > - BITRATE shows bit/s (no surprise ;-), any way to so some > calculations > > to get kbps? e.g. BITRATE/1024 does not work... > > > 128000/1024 won't give you the expected 128kbps :-). I'll see what I > can > do. >
I just was in the mood and did (tried) it myself. I do not know if this is the right way doing this, at least it works and gives you another placeholder called KBPS (usable in format tags). Do whatever you wish with this code :-) Code: -------------------- --- MusicInfoSCR/Info.pm.org 2006-10-09 11:03:38.000000000 +0200 +++ MusicInfoSCR/Info.pm 2006-12-16 16:30:27.000000000 +0100 @@ -329,6 +329,15 @@ return $songduration; } +sub getBitrate { + my $song = shift; + + my $bitrate = Slim::Music::Info::getBitrate($song); + my $kbps = int($bitrate / 1000); + + return $kbps; +} + sub buttonIcons { my ($client, $position, $line) = @_; -------------------- Code: -------------------- --- MusicInfoSCR/Plugin.pm.org 2006-10-27 16:29:48.000000000 +0200 +++ MusicInfoSCR/Plugin.pm 2006-12-16 16:21:37.000000000 +0100 @@ -94,6 +94,8 @@ Slim::Web::Setup::addPlayerChild('PLUGIN_SCREENSAVER_MUSICINFO'); Slim::Music::TitleFormatter::addFormat('SONGTIME', \&Plugins::MusicInfoSCR::Info::getSongTime); + + Slim::Music::TitleFormatter::addFormat('KBPS', \&Plugins::MusicInfoSCR::Info::getBitrate); } sub shutdownPlugin { -------------------- Code: -------------------- --- MusicInfoSCR/Setup.pm.org 2006-10-27 16:30:14.000000000 +0200 +++ MusicInfoSCR/Setup.pm 2006-12-16 16:15:35.000000000 +0100 @@ -513,6 +513,7 @@ $formatStrings{'PLAYTIME'} = 'PLAYTIME'; $formatStrings{'PLAYTIME_PROGRESS'} = 'PLAYTIME_PROGRESS'; $formatStrings{'SONGTIME'} = 'SONGTIME'; + $formatStrings{'KBPS'} = 'KBPS'; $formatStrings{'PLAYTIME / SONGTIME'} = 'PLAYTIME / SONGTIME'; $formatStrings{'PLAYLIST'} = 'PLAYLIST'; $formatStrings{'PLAYLIST (X_OF_Y)'} = 'PLAYLIST (X_OF_Y)'; -------------------- -- schiegl ------------------------------------------------------------------------ schiegl's Profile: http://forums.slimdevices.com/member.php?userid=6654 View this thread: http://forums.slimdevices.com/showthread.php?t=30254 _______________________________________________ plugins mailing list plugins@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/plugins