Re: Squeezebox Server (former SqueezeCenter)
Posted: Sat Oct 15, 2011 8:24 am
It doesn't seem to workThe functions "preset_x.hold"
Support Forum
http://www.eventghost.net:80/forum/
It doesn't seem to workThe functions "preset_x.hold"
Hi Walter,krambriw wrote:Below are the available commands for "Button functions" in the CLI I'm using.
If I add those links as hyperlinks in the Eventghost Webserver, I will be able to play the files/directories/playlists etc. by clicking that link.
import urllib
urllib.urlopen('http://192.168.1.7:9001/status_header.h ... %3Cc3%3Acb')
Code: Select all
00%3A04%3A20%3A12%3A12%3Bc9 display ? ?Code: Select all
ZoomPlayer2.5110 [u'00%3A04%3A20%3A12%3A12%3Bc9 display Speelt%20nu LOVE%20REMEMBERS%20--%20Craig%20Morgan']Hi, the current plugin does only support commands. I am using functions inside the player.py and there are many more that I do not use (like get current title, current artist etc). I would suggest that you check those first and then experiment with them a bit. The file player.py is in the plugin folder of the plugin.Walter, do you think you could extend your plugin with the capabilities of receiving back information and sending TCP commands, based on the Zoomplayer plugin? Or maybe I overlooked it, and it is already included in your plugin????
Code: Select all
try:
dummy #Only used to initialise some variables at startup
except NameError:
dummy = 0 #after the first run, the variable dummy is set, so it skips below on subsequent runs.
eg.globals.song = False #these are global variables I use to show on the Eventghost website
eg.globals.titlebar = False
a = eg.event.payload
q = str(a).split('%') # to check if the event has enough information (i.e. if the squeezebox is on)
if len(q) < 25: # I just assumed the number 25 as normal log has way more than 25
eg.Exit() # if insufficient info, i.e. player is off, don't bother retreiving info. As the status info is also in event, I will switch to that eventually...
else:
print a #I have included many print commands which I normally use to check to see what is going on...
import re # needed to work with the regular expression search later on
b = str(a).split('current_title') #split the event at the part where it starts with the song title
c = str(b[1]).split('time') # split the second part right after the song title
#print c[0]
d = c[0] #this is then the song title, still with the % stuff in it
e = re.split( r"[%][0-9A-F]{2}" , str(d) ) #this uses the regular expression search to get rid of all % signs and two characters behind it, consisting of a number and letter
f = ' '.join(e) # the previous result was a list (at least I think it is called a list....), which we now turn into a string again
print f
g = str(b[1]).split('title') #this part does the same as the above procedure, only for the radio station part
#print "g[1]" + g[1] #again, just a print command to see what g[1] actually looks like in the logs
h = str(g[1]).split('playlist')
#print "h[0]" + h[0]
i = re.split( r"[%][0-9A-F]{2}" , str(h[0]) )
j = ' '.join(i)
print j
eg.globals.song = j #so now we have the song that is playing, which we can assign to the global variable for the EG website
titlebar = f # and radiostation (or the other way around....)
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1544">
<Action>
ZoomPlayer.MyCommand(u'00%3A04%3A20%3A12%3A12%3Bc9 status - 2 subscribe:300')
</Action>
</EventGhost>Thanks, I appreciate that!krambriw wrote:PS I will try to make a little sample based on on your script with websocket that updates something...