IR remote to control Subsonic jukebox

General discussions.

Moderator: moderators

IR remote to control Subsonic jukebox

Postby matzmann » Wed Jan 19, 2011 5:08 pm

Hi there,

I'm happily beginning to use Subsonic in a jukebox installation on my
living room PC.

As far as I understand, I can use the API to access some jukebox functions.

Now, it would be great to use my IR remote (which is known to the PC)
to e.g. skip to the next track or to play a random selection (but skipping
forward [and maybe backwards] would be most important).

I can configure the remote (its driver) to execute commands on the PC.

How would I send commands to Subsonic that way?

Did anybody setup something like this to control his/her Subsonic jukebox
and would be willing to share his/her knowledge?

I'd just like to ask before digging in to deep....

Best regards
Matthias
matzmann
 
Posts: 8
Joined: Wed Jan 19, 2011 4:58 pm

Postby bushman4 » Wed Jan 19, 2011 6:29 pm

I've never done anything similar, but how are your scripting skills?

A quick poke at the API documentation located at http://www.subsonic.org/pages/api.jsp shows that there is a command that will do what you want... kind of.

There is a command called "jukeboxControl" that has the capability, but it will take a bit of work...

It has a "skip" command, but it looks to be a "skip to an absolute playlist entry" command, not a "skip ahead/behind" but with a little scripting I'm sure it's possible...
The first thing I would try is to use a referenced based approach to the skip command to see if it works. In a DOS batch file or command prompt, that could be:

Code: Select all
WGET http://your-server/rest/jukeboxControl.view?u=joe&p=sesame&v=1.5.0&c=myapp&action=skip&id=+1


That may or may not work... it would be nice if it did, because it would be a one line command for your software.

If that does not work, you will have to get the currently playing track, and add or subtract from that...

In it's most basic form, a DOS batch file, I would imagine the following:


Code: Select all
REM First get the current playlist
WGET http://your-server/rest/jukeboxControl.view?u=joe&p=sesame&v=1.5.0&c=myapp&action=get -output-file=temp.txt
REM Now we need to parse the playlist to find the currently playing item
REM I'd have to see the output file to figure that part out
REM
REM Then we can create a variable, call it @NewID, that is that number + 1
REM Then we issue a skip command using that new ID.
WGET http://your-server/rest/jukeboxControl.view?u=joe&p=sesame&v=1.5.0&c=myapp&action=skip&id=@NewID


I can play more at home to try to bang something together if you don't have any luck...

HTH,

Glenn
User avatar
bushman4
 
Posts: 867
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Postby ccandreva » Wed Jan 19, 2011 11:28 pm

This won't work, because the REST api creates a second jukebox player to send commands to. It won't sned commands to the one you control from the web interface.

I've just asked Sindre about this on the dev list.
User avatar
ccandreva
 
Posts: 104
Joined: Fri May 28, 2010 8:22 pm

Postby matzmann » Mon Jan 24, 2011 4:53 pm

Thanks very much,

so that sounds like I can bury the idea of skipping tracks via IR remote? :(

Best regards
Matthias
matzmann
 
Posts: 8
Joined: Wed Jan 19, 2011 4:58 pm

Postby ccandreva » Mon Jan 24, 2011 4:57 pm

Sindre says he going to look at making one Jukebox player, so stay tuned.

My Jukebox server is actually a combined Subsonic / Mythtv backend in my basement. I wanted to make a little box with an LCD and some buttons that would act like a CD player panel, and talk to the backened maybe over a plain-old serial port. So we could skip tracks/disks without actually booting up a computer.
User avatar
ccandreva
 
Posts: 104
Joined: Fri May 28, 2010 8:22 pm

Postby matzmann » Tue Jan 25, 2011 12:32 pm

Sindre says he going to look at making one Jukebox player, so stay tuned.


OK, thanks. I will. :)

Best regards
Matthias[/quote]
matzmann
 
Posts: 8
Joined: Wed Jan 19, 2011 4:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 4 guests