Poll: Most Desired Feature To Be Added
Other Movie Ratings
Download Movie Trailers
Home Automation scripting
Other Movie Streaming Location
Trivia Intro Fixed
Cartoon Video Option
More Videos for before Feature(s) - Specify how many
[Show Results]
 

[RELEASE] Cinema Experience - the new Home Theater Experience Script

  Thread Rating:
  • 23 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
dezblack Offline
Junior Member
Posts: 20
Joined: Jan 2014
Reputation: 0
Post: #3691
I am on a gotham nightly
find quote
giftie Offline
Skilled Python Coder
Posts: 2,326
Joined: Mar 2010
Reputation: 53
Location: Calgary, Alberta
Post: #3692
(Yesterday 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

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
revned Offline
Member
Posts: 92
Joined: Aug 2009
Reputation: 0
Post: #3693
(Yesterday 18:25)giftie Wrote:  
(Yesterday 10:22)revned Wrote:  Is it possible to let the script play a random movie from the library?

Since the removal of HTTP-API from XBMC(now going on 2 years) there is no direct method of randomly choosing a movie to play. A script can be created that can poll XBMC for all of the Movie ID's then randomly choose an ID. Then it can call the script with the ID.

Thanks for your answer. Unfortunately I have no idea how to do this Sad
find quote
dezblack Offline
Junior Member
Posts: 20
Joined: Jan 2014
Reputation: 0
Post: #3694
(Yesterday 18:57)giftie Wrote:  
(Yesterday 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.
find quote
Mungo Offline
Member
Posts: 80
Joined: Jan 2012
Reputation: 2
Location: QLD Australia
Post: #3695
(Yesterday 01:33)Mungo Wrote:  
(2014-04-14 19:49)giftie Wrote:  Require a full debug log

Will change the path again, recreate and grab that tonight. Smile

Cheers,

Mungo

Apologies for the lateness - I was out last night for B-day celebrations.

It's weird, and unfortunate - but changing my folder name back to "intro's" to try and reproduce this issue didn't really work. For some reason, it now appears to play all files successfully, where before it didn't - even after going through the gui and putting all the path's back in multiple times. In having said that - the log does still show (for one path at least) the issue I had described, on line 989:

http://xbmclogs.com/show.php?id=174960

This path was also what was visible in the GUI (but again, isn't now, when I'm trying to reproduce the issue)

Hopefully it's of some help. Otherwise, I'll just try and refrain from using special characters in my paths.

Cheers,

Mungo
find quote
Post Reply