Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Jul 07, 2011 7:22 pm

copota wrote:Is there a way I can create an action for XBMC2 to trigger that particular event for XBMC Flicks?
There might be a way, I have not tested to control a plugin/addon yet.
Unfortunately I'm at the hospital at the moment (been here for the last two weeks) with only my Android phone, so can't check at the moment.

jonib (Bored to the death at the hospital)
XBMC2 plugin to control XBMC. If you want to flatter me Image

copota
Posts: 32
Joined: Sat Mar 27, 2010 4:08 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by copota » Fri Jul 08, 2011 2:22 am

jonib wrote: There might be a way, I have not tested to control a plugin/addon yet.
Unfortunately I'm at the hospital at the moment (been here for the last two weeks) with only my Android phone, so can't check at the moment.

jonib (Bored to the death at the hospital)
Well, being at the hospital is simply no excuse. Just walk it off and get back to coding!

Joking, of course. Get well soon, or if you're there for a loved on, hope they get well soon too.

Thanks for the reply.

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Jul 08, 2011 1:20 pm

copota wrote:Well, being at the hospital is simply no excuse. Just walk it off and get back to coding!
Actually, I did walk it off but apparently a heart attack wasn't something I could walk off so I was sent to the hospital. :oops:
And I would have loved to be able to do some coding, but doing it on the Android phone and not having access to XBMC or EventGhost was kinda hard. I did look at Python support for the Android but doing it on the phone was just too tedious.
Get well soon
Thanks, now I'm back home and itching to do some coding.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Jul 08, 2011 7:46 pm

copota wrote:I use the XBMC plugin named "XBMC Flicks" which gives an interface for using NetFlix. I would like to add a command to EventGhost that will start the "Instant Moveis and Shows" for the XBMC Flicks plugin.
You need to add a HTTPAPI action from the XBMC2\Experimental folder then you need to configure it like the screenshot below:
XBMCFlix.PNG
And add this code like in the screenshot:

Code: Select all

ActivateWindow(10025,"plugin://plugin.video.xbmcflicks/?mode=0")
I found this code by making the "Instant Moveis and Shows" a favorite in XBMC and then checking the favourites.xml in XBMCs userdata directory.

Hope this is all you need to get it working if not just ask.

Next release will probably include the ActivateWindow (and others too) as a direct function.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

copota
Posts: 32
Joined: Sat Mar 27, 2010 4:08 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by copota » Sat Jul 09, 2011 3:23 pm

Thanks for the quick reply.

Your solution worked. At first I was getting errors, since I didn't have "Allow control of XBMC via HTTP" turned on under settings. Once I turned that on, it worked perfectly.

I added the Macro to my OSD, since I like switching around places with just one button. Adding Netflix to my OSD now saves me about 3 button presses, compared to adding it to favorites for the video menu. WOW, we truly are becoming what the Jetsons depicted :mrgreen:

:D :D :D Get well soon & Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :D :D :D

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sat Jul 09, 2011 5:39 pm

copota wrote:Your solution worked.
Great, luckily the netflix plugin worked without having to login so I could test it.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

mkleynhans
Posts: 2
Joined: Sat Jul 16, 2011 11:31 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by mkleynhans » Sun Jul 17, 2011 7:14 pm

Jonib, firstly, thanks for all the amazing work that you have put into this plugin. I have been trying
to build feedback from XBMC to third party remote controls for ages and this is really good news for
me.
Is there any way to get the parsed results which end up in the log to be accessible? ie. I want to be
able to assign actions or macros to call JSON RPC events on XBMC and then parse the response from
Eventviewer to an AMX or Philips Pronto processor.
The only thing I need to be able to do is to output the XBMC2 results in the log to a processor via either
IP using a TCP client connection or via serial.
Is such a thing possible at the moment?

Thanks,

Mike

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Tue Jul 19, 2011 1:12 pm

mkleynhans wrote:Jonib, firstly, thanks for all the amazing work that you have put into this plugin.
Thanks.
Is there any way to get the parsed results which end up in the log to be accessible?
Hmm, lets see if I understand. If you get a response in the log you can access it via the {eg.result} variable, you don't need the {} if accessing via Python.

If this wasn't what you wanted could you provide an example and a screenshot of the log.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

mkleynhans
Posts: 2
Joined: Sat Jul 16, 2011 11:31 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by mkleynhans » Thu Jul 21, 2011 9:56 pm

Hi again, I have been sitting here figuring out what the best screenshot should be and then thought
it best to try and explain.

Basically, when I call the JSON.RPC command in eventghost for say, Audio, Get Artists, it returns
a list of all the artists that I have in my XBMC collection in the eventghost log. I need to try and
get this out of eventghost somehow and send this to one of two remote control system processors.
I was hoping to send the eventghost log data returned when calling the JSON command using
either a TCP client connection to my processor or by sending it directly out of the serial port of
the pc running eventghost. Hopefully this makes a bit more sense...

Is there any way of doing this?

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Jul 22, 2011 12:28 am

mkleynhans wrote:Basically, when I call the JSON.RPC command in eventghost for say, Audio, Get Artists, it returns
a list of all the artists that I have in my XBMC collection in the eventghost log. I need to try and
get this out of eventghost somehow and send this to one of two remote control system processors.
I was hoping to send the eventghost log data returned when calling the JSON command using
either a TCP client connection to my processor or by sending it directly out of the serial port of
the pc running eventghost. Hopefully this makes a bit more sense...
The output in the log is just to show what data you got, to actually use the returned data you use a variable "eg.result" it contains different data depending on what JSONRPC method you use. the eg.result is the standard way you use any returned info in EventGhost and to use in other actions.

Below screenshot shows my test macro and log output:
egJSON1.PNG
I limited the GetArtists method to return 2 artists to keep the log short:
egJSON2.PNG
I use the Show OSD action to show the output. To use the eg.result variable in here I need to enclose it with "{}" to access the data in the variable, you don't need to do that if using it directly in Python.

Code: Select all

{eg.result["artists"][0]["artist"]}
This shows the first "artist" from the result which is "2Pac" from my log. You need to know a bit about how to work with Python variable types to use the result.
egJSON3.PNG
Hopefully this gets you started.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Aug 04, 2011 8:21 am

So mkleynhans, was my instructions useful?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Hitcher
Posts: 3
Joined: Wed May 28, 2008 11:49 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Hitcher » Fri Aug 05, 2011 3:09 pm

Great plugin but there's one control I can't get to work and that's the OSD for Music Visualisation. Even trying the event directly doesn't bring up the OSD.

Thanks.

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Aug 05, 2011 5:21 pm

Hitcher wrote:Great plugin but there's one control I can't get to work and that's the OSD for Music Visualisation. Even trying the event directly doesn't bring up the OSD.
Yes it doesn't work don't know why, based on this documentation it should work, and my plugin is sending the right command, as it works for videos.

XBMC2\Buttons\Remote\Menu works to show the OSD, or you can send a HTTPAPI command ExecBuiltIn(ActivateWindow(MusicOSD)).

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

garbear
Posts: 1
Joined: Sun Aug 28, 2011 5:08 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by garbear » Sun Aug 28, 2011 6:41 am

Hi jonib,

XBMC has a problem where you can toggle Shuffle or Repeat via XBMC:Random and XBMC:Repeat, but you have no way of knowing the current shuffle/repeat state of XBMC. This has been fixed in the XBMC source code by giving PlayerControl(Random) a second parameter called Notify. XBMC2 script can use this new parameter by updating the two lines mentioned here, http://forum.xbmc.org/showthread.php?t=108436.

The change is backwards compatible, of course, so if you're using an XBMC build older than 28 August 2011 it will safely ignore the Notify parameter.

Regards,
garbear

jonib
Plugin Developer
Posts: 1280
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Aug 29, 2011 12:10 am

garbear wrote:XBMC2 script can use this new parameter by updating the two lines mentioned here, http://forum.xbmc.org/showthread.php?t=108436.
Sure no problem, I'll add them when a nightly with support is released. Hopefully I'll make a release shortly after.

edit: looks like it's supported already :oops: I failed at my quick test before.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Post Reply