PDA

View Full Version : CLI / Playlists - guidance please



NickLocke
2008-07-31, 13:52
I'm building an interface to work with C-Bus HomeGate. It's going really well - the CLI is very easy to work with.

One requirement is to display the "next five songs" that are queued up to play behind the current one - ie, the five songs next in the playlist. At the moment, I am doing this with:

<playerid> status - 10 tags:

That works (I then parse the string looking for "playlist%20index%3A" and, from there, can find everything I need. I ignore the first occurrence (as that is the current song) and then just use the next five. The other "stuff" that comes back before the playlist means that I get a lot of data back. I'm not sure why I need to use "10" (if I use a lower number, then I don't always seem to get all six playlist entries back) - it may just be me, but itemsPerResponse seems to be pretty random on this call.

I guess I could also do:

<playerid> playlist index ?

Followed by a number of calls like (assuming that ? is 5)

<playerid> playlist title 6 ?
<playerid> playlist title 7 ?
<playerid> playlist title 8 ?

That's more "round trips", but, maybe gives me more control and less need to parse strings.

Clues please on which of those is better (ie more reliable). Maybe I am missing something and there is actually a completely different/better way.

Thanks,

Nick

NickLocke
2008-08-07, 13:57
Nobody knows / got time to help?

Please??

mherger
2008-08-07, 14:09
I'd go with the status query. You can tweak tags to only get what you want
(can make a considerable difference in response time). But it's a one time
round trip. It's what we're using to keep the web UI up to date.

If you can reproduce the issue about the count you should file a bug
report on http://bugs.slimdevices.com - thanks!

Michael

NickLocke
2008-08-07, 14:53
Thanks Michael,

On the subject of the incorrect count, I think that might be down to my lack of knowledge of what was going on - but if I do find it to be a bug, I will certainly post the details.

With regard to the tags, I have not had much luck with cutting down the returned data. Is it possible to get rid of everything that is not "playlist related"? In other words, all of the earlier part of the message?

Thanks again and clues welcome.

mherger
2008-08-08, 01:48
> With regard to the tags, I have not had much luck with cutting down the
> returned data. Is it possible to get rid of everything that is not
> "playlist related"?

No, I don't think so. The player status is what this command is about.

Michael