Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Support for XBMC2 plugin (formerly XBMCRepeat)

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

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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: 33
Joined: Sat Mar 27, 2010 4:08 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by copota »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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: 33
Joined: Sat Mar 27, 2010 4:08 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by copota »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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 »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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 »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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 »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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 »

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: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

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