PDA

View Full Version : CLI message to ask source of music (mp3 file orstreaming radio)



stuart
2006-04-27, 22:18
Hi...

Is there a CLI message to ask for the source of music. Specifically if
the source is an mp3 file or streaming radio station?

...thanks

mherger
2006-04-27, 23:45
> Is there a CLI message to ask for the source of music. Specifically if
> the source is an mp3 file or streaming radio station?

for the currently running song I'm (ab-)using the status command with the
d tag:

<playerid> status - 1 tags:d

will return the duration for the current song which is undefined for radio
stations...

--

Michael

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

TheEndless
2006-04-28, 12:18
You can also use "tags:u" to check the url of the song. If the url starts with "file://" then you know it's a local file.

TheEndless

Fred
2006-04-28, 16:03
Ok guys, stop abusing it and ask for a source value or something....

mherger
2006-04-28, 23:16
> Ok guys, stop abusing it and ask for a source value or something....

I'm sure you're already working on it, aren't you? :-)

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Stuart
2006-05-01, 10:06
Hi guys, thanks for your help...

TheEndless wrote:
> You can also use "tags:u" to check the url of the song. If the url
> starts with "file://" then you know it's a local file.
>
> TheEndless
>
>

....but I must be as dense as mud. I get 100s of characters back much of
it the same and not what I want. At the very end of this data are some
difference. Are you saying I need to parse all this data and look for
the one labeled "url" or "duration"? That is, I think, TheEndless is
saying to parse everything, look for "url" then look at it's argument?
If the argument is "file" the server is playing an album. If anything
else, then the server is playing from a stream?

As long as you are reading - I'd like to ask another question along the
same lines (well, I think it is). Is there a way to see the title of
what is currently streaming? So far, the only way I have been able to
do this is to grab the 2nd line of the display. However, the titles are
truncated to 20 characters if done this way.

...thanks

Fred
2006-05-01, 10:25
Will work on something, yes, including streaming song name. In 6.5, couple of days.

Fred

TheEndless
2006-05-01, 12:50
Hi guys, thanks for your help...
....but I must be as dense as mud. I get 100s of characters back much of
it the same and not what I want. At the very end of this data are some
difference. Are you saying I need to parse all this data and look for
the one labeled "url" or "duration"? That is, I think, TheEndless is
saying to parse everything, look for "url" then look at it's argument?
If the argument is "file" the server is playing an album. If anything
else, then the server is playing from a stream?
Issuing "<playerid> status 0 1 tags:ud" should return a url encoded string something like this:
00%3A00%3A00%3A00%3A00%3A00 status 0 1 tags%3Au player_name%3ABedroom player_connected%3A1 power%3A1 mode%3Aplay mixer%20volume%3A100 mixer%20treble%3A50 mixer%20bass%3A50 mixer%20pitch%3A100 playlist%20repeat%3A2 playlist%20shuffle%3A0 playlist_cur_index%3A0 playlist_tracks%3A2 playlist%20index%3A0 id%3A22766 title%3A(%231%20-%20732%2F11567)%20Radio%20Paradise%20-%20DJ-mixed%20modern%20%26%20classic%20rock%2C%20world%2 C%20electronica%20%26%20more%20-%20info%3A%20radioparadise.com url%3Ahttp%3A%2F%2F64.236.34.97%3A80%2Fstream%2F10 48
Decoded, that data looks like this:
<playerid> status 0 1 tags:ud
player_name:Bedroom
player_connected:1
power:1
mode:play
mixer volume:100
mixer treble:50
mixer bass:50
mixer pitch:100
playlist repeat:2
playlist shuffle:0
playlist_cur_index:0
playlist_tracks:2
playlist index:0
id:22766
title:(#1 - 732/11567) Radio Paradise - DJ-mixed modern & classic rock, world, electronica & more - info: radioparadise.com
url:http://64.236.34.97:80/stream/1048
The first line is just a repeat of the original request. The next few lines are the status of the player (which is actually what you're requesting with the status command). The last three lines are what you're most interested in. If you're playing an internet radio station (as is the case here), the url will start with "http://", "mms://", "radioio://", etc. If you're playing a local file, then the url will start with "file://". Also note that, even though we requested a duration (the "d" in the "tags:ud" part of the request), no duration was returned, which is what mherger was referring to. I hope that's a bit clearer.


As long as you are reading - I'd like to ask another question along the
same lines (well, I think it is). Is there a way to see the title of
what is currently streaming? So far, the only way I have been able to
do this is to grab the 2nd line of the display. However, the titles are
truncated to 20 characters if done this way.

...thanks
"<playerid> title ?" should give you the current track title. If you're playing an internet radio stream, it only returns the name of the radio station, not the actual song playing.

TheEndless

Stuart
2006-05-01, 22:40
Hi Fred...

I take it you are a slimserver developer?

If so, and if the feature pile isn't already to high, could the "listen"
command also recognize title updates for streaming audio?

...thanks


Fred wrote:
> Will work on something, yes, including streaming song name. In 6.5,
> couple of days.
>
> Fred
>
>

Fred
2006-05-02, 03:27
I take it you are a slimserver developer?

Yes, mostly for CLI stuff.


If so, and if the feature pile isn't already to high, could the "listen"
command also recognize title updates for streaming audio?

That'd be nice, yes.

Fred

Fred
2006-05-02, 17:56
OK added current_title and remote field/queries. Have a look in next nightly.

Does not work with listen for now, working on it.

Fred

mherger
2006-05-03, 02:04
> OK added current_title and remote field/queries. Have a look in next
> nightly.

Fred, what exactly does current_title return?

--

Michael

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

mherger
2006-05-03, 02:17
> Fred, what exactly does current_title return?

Forget it... I RTFM :-)

--

Michael

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

Fred
2006-05-03, 17:06
If so, and if the feature pile isn't already to high, could the "listen"
command also recognize title updates for streaming audio?

Turns out it should already send you a "playlist newsong" when the title is updated. I've added (next nightly) to that the current_title if this is triggered by a radio song change. Works for you?

Fred

Stuart
2006-05-03, 21:42
Hi Fred...

I'm a little new at using nightlies.

I don't think I see "playlist newsong" in the 6.2.1 release of
Slimserver I am using when playing radio stations. I take it I would
have to use a 6.3.x release in order to see this working?

When you talk about the nightlies I assume you are talking about these
files:
http://www.slimdevices.com/downloads/nightly/SlimServer_v2006-05-03/
....for last night (5/3/06). And that the changes you talk about here
will be built in:
http://www.slimdevices.com/downloads/nightly/SlimServer_v2006-05-04/

Is there a reason there are no rpm files in:
http://www.slimdevices.com/downloads/nightly/SlimServer_v2006-05-03/

This all shounds like it will work well.

...thanks

Fred wrote:
> Stuart Wrote:
>
>>If so, and if the feature pile isn't already to high, could the "listen"
>>
>>command also recognize title updates for streaming audio?
>
>
> Turns out it should already send you a "playlist newsong" when the
> title is updated. I've added (next nightly) to that the current_title
> if this is triggered by a radio song change. Works for you?
>
> Fred
>
>

mherger
2006-05-03, 23:03
> I don't think I see "playlist newsong" in the 6.2.1 release of
> Slimserver I am using when playing radio stations. I take it I would
> have to use a 6.3.x release in order to see this working?

The 6.2.x CLI has not changed a lot recently. Most of the work is done in
the 6.5 (trunk) only. So are the changes Fred mentioned.

> Is there a reason there are no rpm files in:
> http://www.slimdevices.com/downloads/nightly/SlimServer_v2006-05-03/

Yes: the build process was broken.

--

Michael

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

Fred
2006-05-04, 05:53
And to be crystal clear: all of this is happening on 6.5 only. Re. 6.2.2, this can hardly be named "bug fixing" so I can't put it in there. 6.3.x is new and I am not sure how much of the underlying major changes we want to port over from 6.5.

The CLI in 6.5 is a completely different implementation in 6.2/6.3 than in 6.5, so it is really twice the work for me to do it both places, not to mention I am not even sure it can support it (along with the new 6.5 implementation came new behaviours).

HTH

Fred

Stuart
2006-05-04, 07:04
Hi Fred...

I appreciate the work you put into this. Especially as I code up really
convoluted (obfuscated??) client code to get similar information out of
6.2.1. It will be nice to revert to only a few lines of code when we
start using 6.5.

Along those lines, does anyone run both a stable and alpha slimserver on
the same system? Well, not at the same time :-). I would like to try
Fred's new code but don't want to give up the option of running a stable
Slimserver for normal client development.

...thanks

Fred wrote:
> And to be crystal clear: all of this is happening on 6.5 only. Re.
> 6.2.2, this can hardly be named "bug fixing" so I can't put it in
> there. 6.3.x is new and I am not sure how much of the underlying major
> changes we want to port over from 6.5.
>
> The CLI in 6.5 is a completely different implementation in 6.2/6.3 than
> in 6.5, so it is really twice the work for me to do it both places, not
> to mention I am not even sure it can support it (along with the new 6.5
> implementation came new behaviours).
>
> HTH
>
> Fred
>
>

mherger
2006-05-04, 07:10
> Along those lines, does anyone run both a stable and alpha slimserver on
> the same system? Well, not at the same time :-). I would like to try
> Fred's new code but don't want to give up the option of running a stable
> Slimserver for normal client development.

I'm still using 6.2.2 on my main system (which we just expect to work for
everyday usage, alarm clock etc.). But while developping I'm running the
latest trunk on my laptop. So when I have to test I simply swap server in
my application.

You could even run both at the same time, setting ports differently etc. -
there should be a wiki article about it.

--

Michael

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