PDA

View Full Version : Question MusicInfoSCR.pm



Ralph Edington
2005-02-07, 13:24
Hello Mr. Herger,

I have a neat idea for an additional option on the MusicInfoScr.pm module.

Would it be possible to have the name of the currently playing playlist as
one of the displayable options?

Option for displaying filename with or without the filename extension (.m3u,
..pls etc) would be nice too.

The driving force for this request is: When listening to radio stations (at
least those accessed by a saved .m3u file), it would be neat if the top line
could display the playlist title (i.e. the name of the radio station, if
I've saved my .m3u "correctly"), and then the bottom could display just the
song "title" (usually preformatted to ARTIST-TITLE by the radio station.)

What do you think? I'm just trying to eke out a little more "MusicInfo"
when listening to radio stations...

Thanks,

RE

mherger
2005-02-07, 14:08
> Hello Mr. Herger,

You can call me Michael :-)

> I have a neat idea for an additional option on the MusicInfoScr.pm
> module.
>
> Would it be possible to have the name of the currently playing playlist
> as one of the displayable options?

I'll have to look into this. Basically I'm using the formats defined in
"Server settings/Formats/Title formats", I only added some stuff like
PLAYTIME and XofY.

> Option for displaying filename with or without the filename extension
> (.m3u, .pls etc) would be nice too.

I don't know if it's possible to get the playlist's name. I'd need some
help from the core developpers.

[..]
> What do you think? I'm just trying to eke out a little more "MusicInfo"
> when listening to radio stations...

It's a good idea! I only did a hack to fill the empty first line with that
"now playing" instead of using something more usefull. I'll dig through
the code...

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

kdf
2005-02-07, 15:07
Quoting Michael Herger <slim (AT) herger (DOT) net>:


> > Option for displaying filename with or without the filename extension
> > (.m3u, .pls etc) would be nice too.
>
> I don't know if it's possible to get the playlist's name. I'd need some
> help from the core developpers.

try somethign like these:
$client->currentPlaylist();
$client->currentPlaylistModified();
Slim::Music::Info::standardTitle($client, $client->currentPlaylist());

the first is a raw filename, second is a flag saying the playlist has been
modified since loading, and the last is the friendly name for the playlist file
(usually just the filename w/o extension).

-kdf

mherger
2005-02-07, 15:28
>> > Option for displaying filename with or without the filename extension
>> > (.m3u, .pls etc) would be nice too.
>>
>> I don't know if it's possible to get the playlist's name. I'd need some
>> help from the core developpers.
>
> try somethign like these:
> $client->currentPlaylist();
> $client->currentPlaylistModified();
> Slim::Music::Info::standardTitle($client, $client->currentPlaylist());
>
> the first is a raw filename, second is a flag saying the playlist has
> been
> modified since loading, and the last is the friendly name for the
> playlist file
> (usually just the filename w/o extension).

Thanks for this! I was already digging my way through several modules
without finding where to start.

When you say "try something like these" you're aware of the fact, that I'm
only able to do this for my plugin, aren't you? I tried to understand
Slim::Music::Info::infoFormat()...

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

kdf
2005-02-07, 15:52
Quoting Michael Herger <slim (AT) herger (DOT) net>:

> >> > Option for displaying filename with or without the filename extension
> >> > (.m3u, .pls etc) would be nice too.
> >>
> >> I don't know if it's possible to get the playlist's name. I'd need some
> >> help from the core developpers.
> >
> > try somethign like these:
> > $client->currentPlaylist();
> > $client->currentPlaylistModified();
> > Slim::Music::Info::standardTitle($client, $client->currentPlaylist());
> >
> > the first is a raw filename, second is a flag saying the playlist has
> > been
> > modified since loading, and the last is the friendly name for the
> > playlist file
> > (usually just the filename w/o extension).
>
> Thanks for this! I was already digging my way through several modules
> without finding where to start.
>
> When you say "try something like these" you're aware of the fact, that I'm
> only able to do this for my plugin, aren't you? I tried to understand
> Slim::Music::Info::infoFormat()...
>
yeah...do NOT go into that mess. you'll never be seen again.

There was a request on bugs (#584) to add Current Time to the now playing
options. There is a patch included there, which so far Dean has been reluctant
to add, since the now playing display is tied down by too much legacy to go
adding option after option. Your plugin is a great place to provide this
option, however, and you can probably leverage a lot of what is in that patch.
-kdf

mherger
2005-02-08, 00:39
>> > Option for displaying filename with or without the filename extension
>> > (.m3u, .pls etc) would be nice too.
>>
>> I don't know if it's possible to get the playlist's name. I'd need some
>> help from the core developpers.
>
> try somethign like these:
> $client->currentPlaylist();
> $client->currentPlaylistModified();
> Slim::Music::Info::standardTitle($client, $client->currentPlaylist());

These only work if I explicitly select a playlist. Pretty often I just hit
the play button to continue from where I left. In this case
currentPlaylist() seems to be empty. Is that right?

And I'll add that "CURRENTTIME" tag.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

kdf
2005-02-08, 00:42
Quoting Michael Herger <slim (AT) herger (DOT) net>:

> >> > Option for displaying filename with or without the filename extension
> >> > (.m3u, .pls etc) would be nice too.
> >>
> >> I don't know if it's possible to get the playlist's name. I'd need some
> >> help from the core developpers.
> >
> > try somethign like these:
> > $client->currentPlaylist();
> > $client->currentPlaylistModified();
> > Slim::Music::Info::standardTitle($client, $client->currentPlaylist());
>
> These only work if I explicitly select a playlist. Pretty often I just hit
> the play button to continue from where I left. In this case
> currentPlaylist() seems to be empty. Is that right?

that's how the function works on the right side of the web UI as well :)

> And I'll add that "CURRENTTIME" tag.
>
cool :)

you rock, man!

-kdf