Home of the Squeezebox™ & Transporter® network music players.

Go Back   Squeezebox : Community : Forums > User Forums > 3rd Party Plugins
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2006-12-02, 16:21
schiegl schiegl is offline
Senior Member
 
Join Date: Jul 2006
Location: Germany
Posts: 622
schiegl is on a distinguished road
Default title format building using MusicInfoSCR

Hi,

creating customized title formats is really fun! after i've played a while with the different templates a few questions are still left:
- CT, TAGSIZE and VOLUME does nothing? is this okay?
- BITRATE shows bit/s (no surprise ;-), any way to so some calculations to get kbps? e.g. BITRATE/1024 does not work...
- PLAYTIME counts down to 0, is there a template which counts up to SONGTIME? (ELAPSED?)
- any counterparts for PLAYTIME/SONGTIME/"ELAPSED" on the playlist level?

Slimserver 6.5.1 + MusicInfoSCR 3.0

happy customizing :-)

tia & kind regards,
Markus
Reply With Quote
  #2  
Old 2006-12-02, 22:18
mherger's Avatar
mherger mherger is offline
Babelfish's Best Boy
 
Join Date: Apr 2005
Location: Switzerland
Posts: 16,694
mherger is on a distinguished road
Default title format building using MusicInfoSCR

Hi Markus

> creating customized title formats is really fun! after i've played a
> while with the different templates a few questions are still left:


You must be the patient type of guy, testing all these :-).

> - CT, TAGSIZE and VOLUME does nothing? is this okay?


I surely never tested TAGSIZE and VOLUME. VOLUME (sadly translated in the
list, which results in something completely different...) returns the
volume/disk on which my music collection is stored. I thought CT once
worked. I'll see what happened to them (it's not in MusicInfoSCR but in
the server code). But after all it's not the most important tags.

> - 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.

> - PLAYTIME counts down to 0, is there a template which counts up to
> SONGTIME? (ELAPSED?)


PLAYTIME depends on your settings for the Now Playing screen: by
repeatedly hitting the NOW PLAYING button on the remote you can shoose
between the elapsed and the remaining time.

> - any counterparts for PLAYTIME/SONGTIME/"ELAPSED" on the playlist
> level?


This has been asked for before for the server, but it's not there.

> happy customizing :-)


I'm glad you like it.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR
Reply With Quote
  #3  
Old 2006-12-03, 04:16
schiegl schiegl is offline
Senior Member
 
Join Date: Jul 2006
Location: Germany
Posts: 622
schiegl is on a distinguished road
Default

Quote:
Originally Posted by Michael Herger View Post
> creating customized title formats is really fun! after i've played a
> while with the different templates a few questions are still left

You must be the patient type of guy, testing all these :-).
probably - owning the transporter gives you twice (visualizer disabled) the space which almost yells for being filled with data :-)

Quote:
Originally Posted by Michael Herger View Post
> - 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.
thx!

kind regards,
Markus
Reply With Quote
  #4  
Old 2006-12-16, 07:54
schiegl schiegl is offline
Senior Member
 
Join Date: Jul 2006
Location: Germany
Posts: 622
schiegl is on a distinguished road
Default

Quote:
Originally Posted by Michael Herger View Post

> - 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)';
Reply With Quote
  #5  
Old 2006-12-16, 08:10
mherger's Avatar
mherger mherger is offline
Babelfish's Best Boy
 
Join Date: Apr 2005
Location: Switzerland
Posts: 16,694
mherger is on a distinguished road
Default Re: title format building usingMusicInfoSCR

> 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).


Excellent! That's exactly the way to do it.

> Do whatever you wish with this code


I'll integrate it with the plugin :-). Thank you very much!

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR
Reply With Quote
  #6  
Old 2006-12-16, 09:39
schiegl schiegl is offline
Senior Member
 
Join Date: Jul 2006
Location: Germany
Posts: 622
schiegl is on a distinguished road
Default

Quote:
Originally Posted by Michael Herger View Post
> I just was in the mood and did (tried) it myself.
> Do whatever you wish with this code


I'll integrate it with the plugin :-). Thank you very much!
I have to thank you, as extending your plugin was not difficult. One (more) advantage of open source software - even more if it's perl based and therefore has no need for extra compiler, ide,...
Reply With Quote
  #7  
Old 2006-12-17, 07:03
mherger's Avatar
mherger mherger is offline
Babelfish's Best Boy
 
Join Date: Apr 2005
Location: Switzerland
Posts: 16,694
mherger is on a distinguished road
Default Re: title format building usingMusicInfoSCR

>> I'll integrate it with the plugin

I uploaded MusicInfoSCR 3.01 with your patch. Thanks again!

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 20:43.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.