Friday, July 30, 2010

Re: Squeeze Play

0 comments
I believe the current cover request only works for local images.

You need to request the cover art specifically, using the "<playerID> status - 1" command, and sometimes create the URL. The preceding status command will request the status of the player along with one song, starting with the current song. You append the tags for the information you are requesting. For example, I generally request tags:pgsaeluKNr.  You can look up each in the documentation (look at songinfo) but the one you want is K, which is "artwork_url" and is only returned if it is available. 

Therefore, at a minimum, you need:
<playerID> status - 1 tags:K

An abstraction of my code to generate the current song artwork after requesting and parsing the return from the server looks like this:

If (artwork_url) {
  If (find("slacker.com") in artwork_url){
    CoverURL = artwork_url + "?.jpg"
  }
  Else if (find("plugins/") in artwork_url){
    CoverURL = "http://<serverIP:port>/" + artwork_url
  }
  Else if (find("/music") in artwork_url){
    CoverURL = "http://<serverIP:port>/music/" + CurrentTrackID + "/cover_100x100.png"
  }
  Else {
    CoverURL = artwork_url
  }
}
Else {
  CoverURL = "http://<serverIP:port>/music/" + CurrentTrackID + "/cover_100x100.png"
}


The "slacker.com" hack is necessary for Crestron, which need the image name to end in a recognizable extension.

The "plugins/" hack is for certain plugins, where the artwork_url refers to an internal plugin location but isn't a fully formed URL.

The "/music" hack I really can't remember but there must be certain times that the server is returning an internal address as the artwork_url. I seem to have recreated the CoverURL anyway, I believe so that I could control the size of the image. The size above is 100x100 pixels, but in reality that is an option set in my module.

The default if there is no artwork_url requires that you know the current trackID, which is always returned by the status query as something following "id%3A".  Note that you can just use the "cover.png" or "cover.jpg" but if you want the server will generate a specific size by using the "cover_AxA.jpg" form, where A is a number of pixels. I think it works for all local images.

That should help? Let me know if you have any other questions.
-jason

On Fri, Jul 30, 2010 at 12:05 PM, EliteSystemsLV <paul.l.craven@gmail.com> wrote:
I got everything working the way I want it to, except for one thing.
Maybe you guys can offer some advice.

For this install the user will be mostly using internet radio or a
subscription radio service (e.g. Pandora, Last.fm)
I see in the help doc that there is a url that will return the artwork
of the currently playing song for the player like:
http://127.0.0.1:9000/music/current/?player=<playerid>
This works great when playing content that is stored locally, however,
it doesn't seem to update when using Pandora or another subscription
service.  Any ideas?

On Jul 28, 7:50 am, Jason Melvin <jwmel...@gmail.com> wrote:
> Fred, I offer my most heartfelt and since thanks. That document (as
> mentioned, of a rare breed) allowed me to develop a full Crestron
> interface for SBS. It's revolutionized music for me and taught me a
> bit of coding along the way. Squeezebox is without equal for a few
> reasons, but I think the well-documented command line interface is the
> most significant.
>
> -jasonhttp://code.google.com/p/crestron-squeeze/
>
> On Tue, Jul 27, 2010 at 6:23 PM, fred <frederic.thomas...@gmail.com> wrote:
> > Got involved in writing some of this doc, so I appreciate your
> > enthusiasm :)

--
You received this message because you are subscribed to the Google Groups "CommandFusion" group.
To post to this group, send email to commandfusion@googlegroups.com.
To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.


--
You received this message because you are subscribed to the Google Groups "CommandFusion" group.
To post to this group, send email to commandfusion@googlegroups.com.
To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.

Comments

0 comments to "Re: Squeeze Play"

Post a Comment

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com