2014-04-16, 02:59
(2014-04-15, 18:57)giftie Wrote:(2014-04-15, 18:34)dezblack Wrote: I am on a gotham nightly
Then you can add the following to the home_automation.py file(that exists in your userdata/addon_data/script.cinema.experience folder)
insert after line 15:
Code:if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
_3d_mode_query = '''{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": { "setting": "videoscreen.stereoscopicmode" }, "id": 1}'''
_3d_modes = [ "none",
"over_under",
"side_by_side",
"anaglyph_cyan_red",
"anaglyph_green_magenta",
"interlaced",
"hardware",
"mono_2d",
"",
"",
"",
"",
]
Then replace the movie trigger with:
Code:elif trigger == "Movie" and ha_settings[ "ha_movie" ]:
utils.broadcastUDP( "<b>CE_Automate<li>movie_start</b>" )
xbmc.sleep(250)
result = xbmc.executeJSONRPC( _3d_mode_query )
_3d_mode = 'mono'
json = simplejson.loads( result)
if json.has_key('result'):
if json[ 'result' ].has_key( 'value' ):
_3d_mode = _3d_modes[ int( json[ 'result' ][ 'value' ] ) ]
utils.broadcastUDP( "<b>CE_Automate<li>3D_Mode_Event<%s></b>" % _3d_mode )
You are then able to create events based on the actual screen format. Eventghost will see "CE_Automate<li>3D_Mode_Event<xxxx>" with 'xxxx' representing the stereoscopic mode of XBMC's video screen. You may need to add some more delay before the query, as XBMC may need some time to switch modes, xbmc.sleep(250) provides 250ms of delay, playing around with this time(in milliseconds) will allow you to fine tune the delay.
None of this is tested, though I took most of the code from my personal 3D Mode broadcaster - https://github.com/Giftie/service.3dmode_broadcaster. I use this to switch my TV through my control system
Perfect, thank you! Now I need to figure out why my 3d sbs movies have the right eye blacked out when using CE. they work fine when just playing without CE.