Redcloud Remote Configuration For Multiple Remotes Via XML
Posted: Mon Jan 18, 2010 8:05 am
Here's the hardware that I am running:
Windows XP
EventGhost 0.3.7.r1366
Xbox hacked DVDIR remote receiver
Redcloud remote drivers
At first I was receiving 'Unknown Code' errors with my remotes (non xbox remotes), but I was able to get this working pretty basically after manually editing the 'xbcdrc_mapping' dictionary variable. Noticing that the plugin system here is built off of Python, I thought that it might be interesting to be able to define remote codes and event names via xml, so I created a testing file using this structure:
'
<xml>
<remote>
<name>XBox Remote</name>
<eventPrefix>TV</eventPrefix>
<buttons>
<button>
<event>UP</event>
<code>006a60a</code>
</button>
<button>
<event>DOWN</event>
<code>006a70a</code>
</button>
<button>
<event>LEFT</event>
<code>006a90a</code>
</button>
<button>
<event>RIGHT</event>
<code>006a80a</code>
</button>
<button>
<event>POWER</event>
<code>006d500</code>
</button>
</buttons>
</remote>
</xml>
'
I was able to append this xml to the xbcdrc_mapping using the following code in an external installation of Python (using Idle):
'
import xml.dom.minidom
xmlDoc=xml.dom.minidom.parse("buttonMap.xml") # Open the xml button map document
root=xmlDoc.childNodes[0]
remotes=root.childNodes
for remote in xmlDoc.getElementsByTagName('remote'): # Traverse each remote node
prefixNode=remote.getElementsByTagName('eventPrefix') # Retrieve remote's prefix to be used
prefix= prefixNode[0].childNodes[0].data # in the event name
for button in remote.getElementsByTagName('button'): # Traverse each remote's button
codeNode=button.getElementsByTagName('code') # Retrieve the event code
code=codeNode[0].firstChild.data
eventNode=button.getElementsByTagName('event') # Retrieve the event name
event=eventNode[0].firstChild.data
xbcdrc_mapping[str(code)]=str(prefix+'_'+event)
'
It seems as though there is a full installation of Python included, and EventGhost is using v2.6, which is the same version I am running Idle on... I'm probably doing something really stupid, probably in combination due to the fact that I just picked up python today, and it's near 3am, hahaha.
Could anyone assist me in this? I think I just only need to know how to include xml.dom.minidom properly. Being able to control all my media on my pc via universal remotes is so close I can practically taste it...
PS, thanks for all the hard work on EventGhost... Soooo much better than LIRC (even on linux) I had almost given up on being able to be able to control XBMC, etc in windows with my 5 dollar remote reciever... You guys are awesome!
*Edit*
Crap. Tabs were removed... I'll upload the files I was working with. I think that should be it. If anyone needs anything else, just let me know...
Windows XP
EventGhost 0.3.7.r1366
Xbox hacked DVDIR remote receiver
Redcloud remote drivers
At first I was receiving 'Unknown Code' errors with my remotes (non xbox remotes), but I was able to get this working pretty basically after manually editing the 'xbcdrc_mapping' dictionary variable. Noticing that the plugin system here is built off of Python, I thought that it might be interesting to be able to define remote codes and event names via xml, so I created a testing file using this structure:
'
<xml>
<remote>
<name>XBox Remote</name>
<eventPrefix>TV</eventPrefix>
<buttons>
<button>
<event>UP</event>
<code>006a60a</code>
</button>
<button>
<event>DOWN</event>
<code>006a70a</code>
</button>
<button>
<event>LEFT</event>
<code>006a90a</code>
</button>
<button>
<event>RIGHT</event>
<code>006a80a</code>
</button>
<button>
<event>POWER</event>
<code>006d500</code>
</button>
</buttons>
</remote>
</xml>
'
I was able to append this xml to the xbcdrc_mapping using the following code in an external installation of Python (using Idle):
'
import xml.dom.minidom
xmlDoc=xml.dom.minidom.parse("buttonMap.xml") # Open the xml button map document
root=xmlDoc.childNodes[0]
remotes=root.childNodes
for remote in xmlDoc.getElementsByTagName('remote'): # Traverse each remote node
prefixNode=remote.getElementsByTagName('eventPrefix') # Retrieve remote's prefix to be used
prefix= prefixNode[0].childNodes[0].data # in the event name
for button in remote.getElementsByTagName('button'): # Traverse each remote's button
codeNode=button.getElementsByTagName('code') # Retrieve the event code
code=codeNode[0].firstChild.data
eventNode=button.getElementsByTagName('event') # Retrieve the event name
event=eventNode[0].firstChild.data
xbcdrc_mapping[str(code)]=str(prefix+'_'+event)
'
It seems as though there is a full installation of Python included, and EventGhost is using v2.6, which is the same version I am running Idle on... I'm probably doing something really stupid, probably in combination due to the fact that I just picked up python today, and it's near 3am, hahaha.
Could anyone assist me in this? I think I just only need to know how to include xml.dom.minidom properly. Being able to control all my media on my pc via universal remotes is so close I can practically taste it...
PS, thanks for all the hard work on EventGhost... Soooo much better than LIRC (even on linux) I had almost given up on being able to be able to control XBMC, etc in windows with my 5 dollar remote reciever... You guys are awesome!
*Edit*
Crap. Tabs were removed... I'll upload the files I was working with. I think that should be it. If anyone needs anything else, just let me know...