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 »

Talguy wrote:I'll wait patiently till a fix is provided as I am in no dire need to create custom json commands.
Fuck that I hate waiting, so here is a cool (and not freezing) version of the plugin (hopefully wink wink nudge nudge)
Was just trying to do some testing at the time.
Yes, I used to love testing now its too much work. That's why I had to fix the most ugly code that should never have been.
As for the latest update I can report back that the events received from kodi have been working great. My macros triggered by these events seem to be working about 100% of the time
Great to hear.


So here is another test version that should fix the problem with some JSON-RPC commands totally freezing EventGhost, and you have to kill it with fire.

The problem was that I added the option to paste a complete JSON-RPC command like this

Code: Select all

{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}
That you might have gotten from somewhere. Unfortunetly I had done (apparently) no testing and there ware no error checking, so any commands it didn't like froze EventGhost.
These commands should now work properly.

@ wolfgr: Would you mind testing this version and see if the events work with Kodi, if not could you post a log where it fails to detect Kodi after changing line 1695:

Code: Select all

debug = False
to

Code: Select all

debug = True
It should give a bit more details, thanks.

jonib
Attachments
__init__.py
XBMC2 test ver 0.6.18 UnFreezing edition.
(110.13 KiB) Downloaded 149 times
XBMC2 plugin to control XBMC. If you want to flatter me Image
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

I tested it (unfreezing edition :) ) with XBMC 13.2 and it still works, although when I clicked 'Update Actions' I got an error message, by the looks. Thanks for continuing to support this. Great to hear it will work with KODI too.
Attachments
Capture.JPG
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 »

blaher wrote:I tested it (unfreezing edition :) ) with XBMC 13.2 and it still works,
Nice.
although when I clicked 'Update Actions' I got an error message, by the looks.
I knew I should have tested it, :shock: the problem seems to be the site name change to Kodi.tv. I'll try to fix soon.
Thanks for continuing to support this. Great to hear it will work with KODI too.
Jupp, I try slowly.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
hasmak
Posts: 3
Joined: Sun Oct 06, 2013 2:06 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by hasmak »

the problem seems to be the site name change to Kodi.com.
Thanks for the continued support :D
The site name is actually http://kodi.tv/
Cheers
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 »

hasmak wrote:Thanks for the continued support :D
Thanks, I think.
The site name is actually http://kodi.tv/
Well that part wasn't the important part was it? :twisted:

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 »

blaher wrote:although when I clicked 'Update Actions' I got an error message, by the looks. Thanks for continuing to support this.
Now the 'Update Actions' should work again.

So I assumed that the website name change from "xbmc" to "kodi", was the reason 'Update Actions' stopped working. The xbmc address gets redirected to kodi.tv so no code change needed (until they remove the redirect).
And several debugging hours later I discovered that the address had nothing to do with it, there was a minimal change on the page that made my code crash. Basically there is a "code" tag too much, that wasn't there when I added the code. :oops:

Damn I need to clean up the code it's so fucking ugly. :x

jonib
Attachments
xbmcclient.py
Support file
(22.38 KiB) Downloaded 130 times
__init__.py
XBMC2 test ver 0.6.19 the frustrating edition.
(111.95 KiB) Downloaded 180 times
XBMC2 plugin to control XBMC. If you want to flatter me Image
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher »

jonib wrote:Now the 'Update Actions' should work again.
They sure do, thanks.
perezbalen
Posts: 5
Joined: Sun Feb 15, 2015 4:11 pm

One Button, Two Things in Kodi/XBMC

Post by perezbalen »

I've been using Event Ghost for a while, and I've done some interesting things, but I'm in no way an expert.

I maynly use it for XBMC/Kodi. And right now I'm trying to make one button do two things depending on the Kodi window ( http://kodi.wiki/view/Window_IDs ) that is active.

For example: The Up button moves the selection up, if I'm in the Video Files (Movies or TV) window, but
turns the Volume Up if I'm in the Fullscreen Video window.

So far I managed to do this using kodi's keyboard.xml, but I'm looking for a way to do it in Eventghost.

I think the way must be for EventGhost to ask Kodi which is the active window, and do something acordingly, but so far have been unable to ask Kodi.

Any ideas?

Thanks in advance.
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 »

blaher wrote:
jonib wrote:Now the 'Update Actions' should work again.
They sure do, thanks.
Great. Thanks for reporting back.

I'll see if I can do some more tweaks in the week, and if there are no reports about stuff not working I'll get it included in the next EventGhost next week.

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: One Button, Two Things in Kodi/XBMC

Post by jonib »

perezbalen wrote:I maynly use it for XBMC/Kodi. And right now I'm trying to make one button do two things depending on the Kodi window ( http://kodi.wiki/view/Window_IDs ) that is active.

For example: The Up button moves the selection up, if I'm in the Video Files (Movies or TV) window, but
turns the Volume Up if I'm in the Fullscreen Video window.
I'll assume you are not using the XBMC2 plugin to control XBMC/Kodi? You should be able to do all that you want with this plugin, read the first post here for basic info.
If you are using Kodi and want events to work you need the last test version here.

Please post if you get it to work or you have any questions.

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 »

Phil wrote:I'm having the same issue as wolfgr with 13.2 (openlelec version on raspberry pi). If I start eventghost after XBMC it picks it up fine, if its the other way around it doesnt work.
This is from 3 different XBMC boxes to 2 different PCs (one windows 8.1 one windows server 2012), with the default plugin in Eventghost, 6.16 and 6.17.
all Upnp turned on, http on, I think pretty much every switch I can turn on in xbmc has been turned on!
Would you mind testing (if you haven't already) this test version?
and if it doesn't work could you post a log where it fails to detect Kodi after changing line 1716:

Code: Select all

    debug = False
to

Code: Select all

    debug = True
It should give a bit more details, thanks.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
perezbalen
Posts: 5
Joined: Sun Feb 15, 2015 4:11 pm

Re: One Button, Two Things in Kodi/XBMC

Post by perezbalen »

jonib wrote:
perezbalen wrote:I maynly use it for XBMC/Kodi. And right now I'm trying to make one button do two things depending on the Kodi window ( http://kodi.wiki/view/Window_IDs ) that is active.

For example: The Up button moves the selection up, if I'm in the Video Files (Movies or TV) window, but
turns the Volume Up if I'm in the Fullscreen Video window.
I'll assume you are not using the XBMC2 plugin to control XBMC/Kodi? You should be able to do all that you want with this plugin, read the first post here for basic info.
If you are using Kodi and want events to work you need the last test version here.

Please post if you get it to work or you have any questions.

jonib
HI.

Actually, I do use XBMC2 (in conjunction with keyboard.xml).

The thing is that I have a small remote (apple remote), so I have to maximize the usability. Since it has only 6 buttons, I use the UP as volume UP when in Playback mode, but its the UP function when in Library mode. It's a very nice and comfortable way to navigate XBMC once you get the hang of things.

The thing is that the code is very complicated, and to do more interesting things (and to simplify it) I need to make decisions depending on whether the user is watching a movie, navigating a library, playing music, reading comics, browsing system files, etc.

And I know XBMC can tell an outside program which is the active interface (Window), with stuff like this:

Code: Select all

XBMC2: JSONRPC: GUI.GetProperties {"properties": ["currentwindow"]}
The thing is that I can't figure out how to use the returned information.

I want to do stuff like:

Code: Select all

If
        "label": "Fullscreen video" <-- This is a returned value of GUI.GetProperties
Then 
         Do Volume Up
Else If
       "label": "Videos"
Then 
        Do Key Up
etc.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: One Button, Two Things in Kodi/XBMC

Post by jonib »

perezbalen wrote:Actually, I do use XBMC2 (in conjunction with keyboard.xml).
OK.
The thing is that I have a small remote (apple remote), so I have to maximize the usability. Since it has only 6 buttons, I use the UP as volume UP when in Playback mode, but its the UP function when in Library mode. It's a very nice and comfortable way to navigate XBMC once you get the hang of things.
I added support for the AppleRemote a while a go, unfortunately some buttons did not work correctly in all situations (Don't know if the problem is XBMC or the plugin). I'll try to test it today and see if it works better. Link to post with the problem.
Try the buttons in XBMC2\Buttons\AppleRemote, they use the "joystick.AppleRemote.xml" keymap if you need to change the defaults.

Edit: Are you using direct actions (XBMC2\Actions) or Remote buttons (XBMC2\Buttons\Remote)?
Edit2: Could you post your EventGhost config and maybe your keyboard.xml, so I have an idea about your setup?
And I know XBMC can tell an outside program which is the active interface (Window), with stuff like this:

Code: Select all

XBMC2: JSONRPC: GUI.GetProperties {"properties": ["currentwindow"]}
The thing is that I can't figure out how to use the returned information.

I want to do stuff like:

Code: Select all

If
        "label": "Fullscreen video" <-- This is a returned value of GUI.GetProperties
Then 
         Do Volume Up
Else If
       "label": "Videos"
Then 
        Do Key Up
etc.
I'll see if I can make an example out of you, sorry, an example for you. :lol:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
perezbalen
Posts: 5
Joined: Sun Feb 15, 2015 4:11 pm

Re: One Button, Two Things in Kodi/XBMC

Post by perezbalen »

jonib wrote:I'll see if I can make an example out of you, sorry, an example for you. :lol:

jonib
Hi.

I use Flirc to simulate a Keyboard command like this:
Image

And this simulates a gamepad button, which goes to gamepad.xml, where the magic happens:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
     <!-- GLOBAL -->
     <global>
          <gamepad>
               <!-- UP (Dpad)-->	
               <dpadup>Up</dpadup>
               <!-- DOWN (Dpad) -->
               <dpaddown>Down</dpaddown>	
               <!-- LEFT (Dpad) -->	
               <dpadleft>Left</dpadleft>
               <!-- RIGHT (Dpad) -->
               <dpadright>Right</dpadright>	
               <!-- PLAY (A) -->
               <A>Select</A>
               <!-- MENU (B) -->		
               <B>Back</B>
                    
               <!-- UP HOLD (Left Shoulder Button)-->	
               <black>Up</black> 
               <!-- DOWN HOLD (Right Shoulder Button)-->
               <white>Down</white>	
               <!-- LEFT HOLD (back)-->	
               <back>Left</back>
               <!-- RIGHT HOLD (start)-->
               <start>Right</start>	
               <!-- PLAY HOLD (Y)-->
               <Y>ContextMenu</Y>
               <!-- MENU HOLD (X) -->		
               <X>PreviousMenu</X>
               
               <!-- UP 2x (Up on right stick)-->	
               <rightthumbstickup>Up</rightthumbstickup>
               <!-- DOWN 2x (Down on right stick)-->
               <rightthumbstickdown>Down</rightthumbstickdown>	
               <!-- LEFT 2x (Left on right stick)-->	
               <rightthumbstickleft>Left</rightthumbstickleft>
               <!-- RIGHT 2x (Right on right stick)-->
               <rightthumbstickright>Right</rightthumbstickright>	
               <!-- PLAY 2x (LeftTrigger)-->
               <leftthumbbutton>ContextMenu</leftthumbbutton>
               <!-- MENU 2x (RightTrigger) -->		
               <rightthumbbutton>FullScreen</rightthumbbutton>	
          </gamepad>
     </global>
               
     <!-- FULL SCREEN VIDEO -->
     <FullscreenVideo>
          <gamepad>
               <!-- UP (Dpad)-->	
               <dpadup>VolumeUp</dpadup>
               <!-- DOWN (Dpad) -->
               <dpaddown>VolumeDown</dpaddown>	
               <!-- LEFT (Dpad) -->	
               <dpadleft>StepBack</dpadleft>
               <!-- RIGHT (Dpad) -->
               <dpadright>StepForward</dpadright>	
               <!-- PLAY (A) -->
               <A>Pause</A>
               <!-- MENU (B) -->		
               <B>Back</B>
               
               <!-- UP HOLD (Left Shoulder Button)-->	
               <black>VolumeUp</black> 
               <!-- DOWN HOLD (Right Shoulder Button)-->
               <white>VolumeDown</white>	
               <!-- LEFT HOLD (back)-->	<!-- Old  Rewind-->
               <back>StepBack</back>
               <!-- RIGHT HOLD (start)--> <!-- Old  FastForward-->
               <start>StepForward</start>	
               <!-- PLAY HOLD (Y)-->
               <Y>Stop</Y>
               <!-- MENU HOLD (X) -->		
               <X>PreviousMenu</X>
          
               <!-- UP 2x (Up on right stick)-->	
               <rightthumbstickup>SmallStepBack</rightthumbstickup>
               <!-- DOWN 2x (Down on right stick)-->
               <rightthumbstickdown>Mute</rightthumbstickdown>	
               <!-- LEFT 2x (Left on right stick)-->	<!-- Old BigStepBack -->
               <rightthumbstickleft>Rewind</rightthumbstickleft>
               <!-- RIGHT 2x (Right on right stick)-->	<!-- Old BigStepForward -->
               <rightthumbstickright>FastForward</rightthumbstickright>	
               <!-- PLAY 2x (LeftTrigger)-->
               <leftthumbbutton>OSD</leftthumbbutton>
               <!-- MENU 2x (RightTrigger) -->		
               <rightthumbbutton>XBMC.ActivateWindow(videofiles)</rightthumbbutton>
          </gamepad>
     </FullscreenVideo>

     <!-- Home -->
     <Home>
          <gamepad>
               <!-- MENU (B) -->		
               <B>FullScreen</B>
               <!-- MENU HOLD (X) -->		
               <X>XBMC.ActivateWindow(ShutdownMenu)</X>
          </gamepad>
     </Home>
      -->
      
     <!-- VIDEO Files -- >
     <VideoFiles>
          <gamepad>
               <! -- MENU 2x (RightTrigger) -- >		
               <rightthumbbutton>XBMC.ActivateWindow(home)</rightthumbbutton>
          </gamepad>
     </VideoFiles>
      -->
</keymap>
Now, as you can see, the signal goes from the control, to Flirc, to keyboard combination, to eventghost, to a "gamepad", to kodi. There's just to many steps!
perezbalen
Posts: 5
Joined: Sun Feb 15, 2015 4:11 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by perezbalen »

does someone know of a way to call the "show subtitles search window" with an eventghost action?. So far I can only open it using the OSD menu, and then selecting the option.
Post Reply