Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Relay playback to XBMC (Read 3239 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Relay playback to XBMC

I want to make a really simple plugin, but I need some help to get started!

My idea is to make a plugin that relays playback of a file to XBMC. Do do this in the simplest way possible it should only react to pause, stop and play.

When a file starts to play the plugin should get the path and name of the file I want to play, replace stuff like "D:/" to the proper samba path (eg. "smb://MY_COMP/D/") and send it to XBMC by accessing the URL:
http://192.168.0.7/xbmcCmds/xbmcHttp?comma...meter=file_path

When I hit stop or pause it should send similar commands.

To keep regular playback on my computer for the times I use the computer speakers, I guess a DSP-plugin would do the trick, or can this be done like a general purpose plugin?

The easiest way to do this would be to find a plugin that reacts to play/pause/stop and executes a command via the shell. That way I can use very simple python scripts to execute the 3 commands. Does anyone know of a plugin that works like that?



For those of you who doesn't know what XBMC is:
http://xbmc.org/

Relay playback to XBMC

Reply #1
This should be trivially doable by implementing play_callback and performing the relevant actions in the assorted member functions of it.
The HTTP request should be somewhat easy to do with WinInet, curl or some other API.
Stay sane, exile.

Relay playback to XBMC

Reply #2
OK, started today and the first version is now done. Did it in c++, as a general purpose plug-in as described in my first post. I even got the seek function working!

I'll make it available when I have fixed a settings dialog... If anyone wants it...

BTW; a few more examples would be great!