Add-on:Cinema Experience: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Addon-Bot repo category update)
Tag: Manual revert
 
(206 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Addon  
{{Addon  
|Name=Cinema Experience
|Name=Cinema Experience
|provider-name=Giftie - nuka1195
|provider-name=Giftie
|ID=script.cinema.experience
|ID=script.cinema.experience
|latest-version=3.0.4
|latest-version=4.0.11
|extension point=xbmc.python.script
|extension point=xbmc.python.script
|provides=
|provides=
Line 15: Line 15:
|Source=https://github.com/Giftie/script.cinema.experience
|Source=https://github.com/Giftie/script.cinema.experience
|Email=
|Email=
|broken=
|broken=
|icon url=http://mirrors.xbmc.org/addons/frodo/script.cinema.experience/icon.png}}
|icon url=http://mirrors.kodi.tv/addons/leia/script.cinema.experience/icon.png}}


= About Cinema Experience =
== History ==
== What is Cinema Experience ==
This add-on has a lot of history. It started life in 2009 as the Home Theatre Experience script, written by an amazing and skilled Python programmer '''nuka1195'''. Through out its life it has brought many changes to XBMC. In December 2010, '''giftie''' took the reigns, and the script was modified to work with the new add-on engine in XBMC's Dharma. The name was changed, and the incarnation of Cinema Experience you know was born.
This scripts will add the wow factor to your home theatre and give you the true cinema experience you deserve(except you still have to supply the popcorn and drinks).  This script allows you to play slides, previews(trailers) and other videos that give the full cinema feel(Intro's and Outro's)  Slides can consist in almost any jpg picture(many Movie Q&A, Movie Stills, Movie Fact packs already exist). The Feature Presentation Movie(s) must be in your Video Library.  It can stream or download from Apple Movie Trailers, play locally stored trailer that are on you system or play trailers from your Movie Library.


== History ==
In the beginning, the script was only being maintained to function with XBMC. Then the script needed some functional repairs. Later, some major changes (and even some that brought about negative feedback). Now it's 2013, and XBMC Frodo is here. Cinema Experience is here to stay. Cinema Experience is currently maintained and improved by '''giftie'''. He's added numerous features to the script, and provides invaluable support via the [https://forum.kodi.tv/showthread.php?tid=87563 Kodi forums].
This add-on has a lot of history, starting its life in 2009 as the Home Theatre Experience script, by an amazing and skilled python programmer nuka1195. Through out its life it had brought changes to XBMC.  In December 2010, the script was modified to work with the new add-on engine in XBMC's Dharma version, and changed names to Cinema Experience.  In the start, the script was only being maintained to function with XBMC, then functional repairs, then some big changes(some brought about some negative feedback). Now it's 2013 and XBMC Frodo is here, so is Cinema Experience..


== How to get it ==
== What does it do? ==
At the moment this add-on is only available through zip-file downloads.  The Frodo version will be soon added to the Official Repo, making it easier to get. But for the time being...
The Cinema Experience script will add that WOW factor to your home theater, and give you a true Cinema Experience! Yes, you will still have to supply the popcorn and drinks. There's not much we can do about that. This script allows you to play trivia slides, movie trailers and other videos (intros and outros) that will help you get that Cinema Experience - just like at the local theater. Trivia slides can be any JPG or PNG image (many Movie Trivia, Stills, and Movie Fact packs already exist). The Feature Presentation Movie(s) must be in your Video Library. Cinema Experience can stream trailers, download them from Apple Movie Trailers, or play locally stored trailer(s) that are on your system or in your Movie Library.


Dharma Version: http://www.mediafire.com/file/6r7d1pqnfeib7xx/script.cinema.experience.1.0.53.zip
== What doesn't it do? ==
The Cinema Experience script will NOT work with any movies that are NOT local and scraped into your Movie Library. This means that any streaming content (let's use Netflix as an example, but this applies to any and all Video Add-ons that stream content to XBMC) either supported and in the official repository or not supported and in a third party repository will not work with the Cinema Experience script.


Eden Version: https://www.dropbox.com/s/9xqnclvosuhm2o1/script.cinema.experience.2.0.57.zip
== How do I get it? ==
At the moment, for XBMC Dharma and Eden this add-on is only available through installable ZIP files. The Frodo version has been added to the Official Official XBMC Repository, making it easier to get.


Frodo Version: Available from the Official Repo
* Dharma: [http://www.mediafire.com/file/6r7d1pqnfeib7xx/script.cinema.experience.1.0.53.zip Download]
* Eden: [https://www.dropbox.com/s/9xqnclvosuhm2o1/script.cinema.experience.2.0.57.zip Download]
* Frodo: Available from the Official XBMC Repository


== Reporting bugs and requesting features ==
== Reporting Bugs & Requesting Features ==
Since this script is always an evolving creature, getting better with every release, bugs do come up. When they do, a bug report needs to be made. These are to be made on the Cinema Experience [http://forum.xbmc.org/showthread.php?tid=87563 forum thread]. A [http://wiki.xbmc.org/index.php?title=Debug_log debug log] is always(repeat, ALWAYS) required, along with the steps to create the bug.
Cinema Experience is an evolving creature, getting better and more feature-rich with each release. That said, ''bugs happen''. When they do, a bug report needs to be made. These are to be made on the Cinema Experience [http://forum.kodi.tv/showthread.php?tid=87563 forum thread]. A [[Log_file|debug log]] is '''ALWAYS''' required, along with the steps needed to re-create the bug. I won't be able to help you if I can't understand what's happening.


Also on this forum thread I will accept feature requests.
=== Reporting Bugs: Method 1 ===
Use the Debug Log Script.


= Now the fun stuff =
=== Reporting Bugs: Method 2 ===
Manually [[Log_file|locate your Kodi.log file]].
Copy & paste your Kodi.log file to [https://paste.kodi.tv/ Kodi Paste] (or a similar site).


== Cinema Experience Sequence ==
''Note:'' If you feel that you have private information in your log file that you don't want the public be able to see, set up an account on [https://pastebin.com/ pastebin.com] and store it as a private paste.
Cinema Experience gives you the ability to enable or disable any introduction videos, or the trivia slideshow. You have the power to customize your cinema experience. The following is an example of the complete script flow:


# Numbered list item Trivia Intro Video(s)
=== Uploading Logs ===
# Numbered list item Trivia Slides with Optional Music Playlist
# Put XBMC into Debug Mode.
# Numbered list item Trivia Outro Video(s)
# Restart XBMC.
# Numbered list item Movie Theater Intro Video(s)
# If you have add-ons that run automatically when XBMC starts, wait a few minutes for these scripts to run (ShareThe.TV, Weather.com Plus, etc.).
# Numbered list item Coming Attractions Intro Video(s)
# Run Cinema Experience.
# Numbered list item Trailer(s)
# Upload your '''FULL''' xbmc.log file to [https://paste.kodi.tv/ Kodi Paste] (or a similar site).
# Numbered list item Coming Attractions Outro Video(s)
# Create a new forum message in [http://forum.kodi.tv/showthread.php?tid=87563 this thread]. Includethe  steps required to reproduce the bug and your [http://pastebin.com/ pastebin.com] URL.
# Numbered list item Feature Presentation Intro Video(s)
# Numbered list item Rating Video (MPAA, BBFC and FSK ratings are currently supported)
# Numbered list item Audio Format Video
# Numbered list item Countdown Video
# Numbered list item FEATURE PRESENTATION
# Numbered list item Intermission Video(s) <small>''(note)''</small>
# Numbered list item Rating Video (MPAA, BBFC and FSK ratings are currently supported)
# Numbered list item Audio Format Video
# Numbered list item FEATURE PRESENTATION 2
# Numbered list item Rating Video (MPAA, BBFC and FSK ratings are currently supported)
# Numbered list item Audio Format Video
# Numbered list item FEATURE PRESENTATION 3
# Numbered list item Rating Video (MPAA, BBFC and FSK ratings are currently supported)
# Numbered list item Audio Format Video
# Numbered list item FEATURE PRESENTATION 4
# Numbered list item Rating Video (MPAA, BBFC and FSK ratings are currently supported)
# Numbered list item Audio Format Video
# Numbered list item FEATURE PRESENTATION 5 <small>''(end note)''</small>
# Numbered list item Feature Presentation Outro Video(s)
# Numbered list item Movie Theater Outro Video(s)


<small>''(note)''</small> At this point in the script, if multiple features have been queued and the skin uses home menu integration, multiple rating videos, audio format videos, features, and intermission videos will take the place of a single feature. A total of 5 features can be queued. This option can be even larger if you use one of the starting methods suggested in the Script Starting methods section.
=== Requesting Features ===
I accept feature requests in [http://forum.kodi.tv/showthread.php?tid=87563 this thread]. Be sure to be specific about what you'd like to see added.


== Video Folder Outline ==
== Information & Setup ==
The only folder that need to be in a specific format is Audio Format folder. This is because the script uses the name of the Audio Format(DTS, Dolby Digital, etc) to find the appropriate videos.
=== Supported Ratings Systems ===
Cinema Experience currently supports the [http://www.mpaa.org/ MPAA], [http://www.bbfc.co.uk/ BBFC], [http://www.fsk.de/ FSK] and [http://www.mj.gov.br/classificacao DEJUS] ratings systems. If you'd like a new rating system supported, post in [http://forum.kodi.tv/showthread.php?tid=87563 this thread]. You may need to provide a database file, or some screenshots of the table. I need to know each different rating in that column. What I need to see will depend on your database. If you are using the default database format (i.e. you haven't made any changes to XBMC) you can post the database file to ''Google Drive'' or ''Drop Box'' and then PM me a link to the file. If you are using MySQL, you will need to access it yourself (using a viewer of some sort) and send me some screenshots '''movieview''' table. Generally, column '''c12''' contains the ratings.


== Home Automation Integration ==
The database you need depends on the OS you are using. [[Databases|This Wiki Page]] will help you find the proper file. The Video database is named '''MyVideosXX.db''' - with XX representing the database version. Use the one with the latest date.


Here the Home Automation feature will be explained.
=== Sequence Overview ===
Cinema Experience gives you the ability to enable or disable any introduction videos, or the trivia slideshow. You have the power to customize your cinema experience. The following is an example of the complete script flow:


= Settings Explained =
'''
:# Trivia Intro Video(s)
:# Trivia Slides with Optional Music Playlist
:# Trivia Outro Video(s)
:# Movie Theater Intro Video(s)
:# Coming Attractions Intro Video(s)
:# Trailer(s)
:# Coming Attractions Outro Video(s)
:# 3D Intro Video(s) - if upcoming Movie is in 3D format
:# 3D Trailers( from folder as I haven't found a site that has them really available) - if upcoming Movie is in 3D format
:# '''''Countdown Video'''''
:# '''''Feature Presentation Intro Video(s)'''''
:# '''''Rating Video''''' (MPAA, BBFC and FSK ratings are currently supported)
:# '''''Audio Format Video'''''
:# FEATURE PRESENTATION
:# '''''Intermission Video(s)''''' (note)
:# '''''Rating Video'''''
:# '''''Audio Format Video'''''
:# FEATURE PRESENTATION 2
:# '''''Intermission Video(s)''''' (note)
:# '''''Rating Video'''''
:# '''''Audio Format Video'''''
:# FEATURE PRESENTATION 3
:# '''''Intermission Video(s)''''' (note)
:# '''''Rating Video'''''
:# '''''Audio Format Video'''''
:# FEATURE PRESENTATION 4
:# '''''Intermission Video(s)''''' (note)
:# '''''Rating Video'''''
:# '''''Audio Format Video'''''
:# FEATURE PRESENTATION 5 (end note)
:# '''''Feature Presentation Outro Video(s)'''''
:# 3D Outro Video(s) - if upcoming Movie is in 3D format
:# Movie Theater Outro Video(s)
'''


== Trivia Slideshow ==
'''''Available in 3D if upcoming movie is 3D and settings enabled'''''


== Special Videos ==
<small>''(note)''</small> At this point in the script, if multiple features have been queued and the skin uses home menu integration, multiple rating videos, audio format videos, features, and intermission videos will take the place of a single feature. A total of 5 features can be queued. This option can be even larger if you use one of the starting methods suggested in the Script Starting methods section.


== Movie Trailers ==
=== Directory Tree Overviews ===
==== Root Directory Structure ====
This is the suggested directory structure for all of your Cinema Experience content.


== Feature Presentations ==
[[File:Cinema Experience Root.png]]


== Home Automation ==
==== Audio Format Directory Structure ====
The only directories that need to be in a specific format are in the Audio Format directory. This is because the script uses the name of the Audio Format (DTS, Dolby Digital, etc.) to determine what video to play.


== Miscellaneous ==
[[File:Audio Format Directory Tree.png]]


= Integration =
==== Intro & Outro Directory Structure ====
Even though these directories don't need to be in a specific format, it's a good idea to use the standard shown below. If you're having trouble, switch to the standard and reconfigure Cinema Experience for the new directory structure.


== Script Starting Methods ==
[[File:Intros %26 Outros Directory Tree.png]]


There are a few different arguments available to change the starting the script.  This are mostly for starting from with-in a skin or from an outside source(remote). Each cause the script to behave differently.
==== Trivia Directory Structure ====
Even though these directories don't need to be in a specific format, it's a good idea to use the standard shown below. If you're having trouble, switch to the standard and reconfigure Cinema Experience for the new directory structure. The example below shows some popular slide sets copied into the appropriate directory.


<big>'''Using the built-in RunScript Method'''</big> ''<small>often used in skins and keymaps</small>''
[[File:Trivia_Directory_Tree.png]]
:RunScript(script.cinema.experience,argument)


<big>'''Using the JSON RPC Method'''</big>
=== Trivia Slideshow Explained ===
:{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "arguments" ] },  "id": 1}
The script can display a slideshow at the start of the experience.  The slides can be standard still slides or Q&A(with clues). The best method of storing the slides are to have them in separate folders, the script can search the folders recursively.


=== Available Arguments ===
==== Types of Slides ====
===== Stills =====
'''Stills''' are trivia slides that only have one part, or are not multiple part slides like the '''Question & Answer''' slides. These slides do not require the use of a ''slides.xml'' file.


XBMC Video Library Window ID
===== Q&A =====
'''Question & Answer''' slides have multiple parts (for example: Question, Clue, Answer). This type of slide does require the use of a ''slides.xml'' file to enable the script to determine how and when to display each Q&A slide.


XBMC Video Library Movie ID
====== XML File Explained ======
<big>'''A Breakdown of the XML File'''</big>
{| class="wikitable"
|-
| <slide rating="'''X'''" /> || This can be used to match the rating of the feature being played, or to set a limit on which slides are played based on value set in the Settings.
|-
| <question format="'''X'''" /> || Provides the format that identifies slides as an Question slide.
|-
| <clue format="'''X'''" /> || Provides the format that identifies slides as an Clue slide.
|-
| <answer format="'''X'''" /> || Provides the format that identifies slides as an Answer slide.
|}


==== Window ID ====
<syntaxhighlight lang="xml">
    <slides>
        <slide>
            <slide rating="R">
            <question format=".([0-9]{1,3})+_q.jpg" />
            <clue format=".([0-9]{1,3})+_c.jpg" />
            <answer format=".([0-9]{1,3})+_a.jpg" />
        </slide>
    </slides>
</syntaxhighlight>


This is primarily used to put the script into multiple feature mode, though it can be used for a single Movie. The user will need to queue the movies into a playlist(normal queuing methods are used, Q on a keyboard, 0 on a remote or from the context menu)
<big>'''A Breakdown of ".([0-9]{1,3})+_q.jpg"'''</big>


Possible window IDs to use:
{| class="wikitable"
::movietitles
|-
::moviegenres
| . || Provides identification of any leters (i.e. identifies the word "stills" in "stills20_q.jpg")
::movieyears
|-
::movieactors
| ([0-9]{1,3}) || Provides identification of any number from 0 - 999 (i.e. identifies the number "20" in "stills20_q.jpg").
::moviedirectors
|-
::moviestudios
| +_q || This allows the script to determine if it is a Question, Clue or Answer (i.e. "stills20_q.jpg" is a question, but "stills20_c.jpg" is a clue).
::moviesets
|}
::moviecountries
::recentlyaddedmovies


These match the general quick library links available from the homepage.
The "+_q" can be any letter or combination of letters as long as the pattern is kept. For example:


eg.  
{| class="wikitable"
:::RunScript(script.cinema.experience,movietitles)
|-
| Question || <question format=".([0-9]{1,3})+_q.jpg" /> || <question format=".([0-9]{1,3})+_a.jpg" />
|-
| Clue || <clue format=".([0-9]{1,3})+_c.jpg" /> || <clue format=".([0-9]{1,3})+_b.jpg" />
|-
| Answer || <answer format=".([0-9]{1,3})+_a.jpg" /> || <answer format=".([0-9]{1,3})+_c.jpg" />
|}


This will open up the library using Movie Titles, with the script waiting for the set number of features to be queue.
<big>'''Example XML Files'''</big>


==== Movie ID ====
This example of a ''slides.xml'' file is for a two part trivia question (Q&A) with words and ordering numbers (i.e. slidename1_q").
<syntaxhighlight lang="xml">
    <slides>
        <slide>
            <slide rating="R">
            <question format=".([0-9]{1,3})+_q.jpg" />
            <clue format="N/A" />
            <answer format=".([0-9]{1,3})+_a.jpg" />
        </slide>
    </slides>
</syntaxhighlight>


This is a new method introduced in version 3.0.1 of the script, to replace the former method of starting the script from a skin.  The former method(no arguments sent to the script) caused an unsightly jump in the Movie Library list.  This was due to the method XBMC uses to queue a video. With Frodo, skins now can extract the database ID for the Movie(using $INFO[ListItem.DBID] ) This method also allow a known database ID to be sent. Multiple database IDs can be sent at the same time, causing the script to go into Multiple Feature mode(fixed in version 3.0.4). The database IDs need to be separated by a semi-colon(;)
This example of a ''slides.xml'' file is for a two part trivia question (Q&A) without ordering numbers (i.e. slidename_q").
<syntaxhighlight lang="xml">
    <slides>
        <slide>
            <slide rating="R">
            <question format=".+_a.jpg" />
            <clue format="N/A" />
            <answer format=".+_b.jpg" />
        </slide>
    </slides>
</syntaxhighlight>


eg.
== Settings Explained ==
:::RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID])  <small>''skin method''</small>
=== Trivia Mode ===
Three(3) modes available: '''None''', '''Slide Show''' and '''Movie Quiz Script'''.


:::RunScript(script.cinema.experience,movieid=35) <small>''single movie database ID''</small>
==== None ====
:::{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35" ] },  "id": 1}
No Trivia pre-show


:::RunScript(script.cinema.experience,movieid=35;123;112) <small>''multiple movie database IDs''</small>
==== Trivia Slideshow ====
:::{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35;123;112" ] }, "id": 1}
; Slide Show specific settings:
:; Duration(in Minutes): Set the total length, in minutes, of the slide show
:; Slides Folder: The parent folder of the slides
:; Show Question Slide for(seconds): The time, in seconds, that the question slide is displayed on the screen
:; Show Clue Slide for(seconds): The time, in seconds, that the clue slide is displayed on the screen
:; Show Answer Slide for(seconds): The time, in seconds, that the answer slide is displayed on the screen
:; Show Still Slide for(seconds): The time, in seconds, that the still slide is display on the screen
:; Play Music during Slide Show: Enabling this settings the script will play music during the slide show
:::; Music Mode: Two modes available, Music File/Playlist or Music Folder
:::; Music File/Playlist: Select the music file or playlist that is played during the slide show.  Only standard playlist(''.m3u, .pls, .asf, .ram'') are allowed(no SmartPlaylist)
:::; Music Folder: Select the folder which to play music from during the slide show
:::; Adjust Volume during Slide Show: Enabling this setting allows the script to drop the volume level during slide show
::::; Music Volume Level: Set the volume level(0-100)
::::; Fade Volume at end of Slide Show: Enabling this setting allows the script to fade the volume down, then back up at the end of the slide show
::::; Fade time in seconds: Set the fade time in seconds
:; Select Only Unwatched slides: Enabling this setting tells the script only to use unviewed slides. The script will automatically reset the watched status during the slide show if slides run out before the end of the slide show
:; Reset Slide watched status: Manually reset the watched status of slides
:; Limit Slides by movie rating(requires slides.xml): Enabling this setting informs the script to limit the slides to a maximum MPAA rating of the movie. Other movie rating formats are roughly assessed and matched to MPAA Ratings
:::; Rating Limit for Trivia(requires slides.xml): If the previous setting is not enabled, adjusting this setting will fix the MPAA level of the slides used in slide show


== Skin Integration ==
==== Movie Quiz Script ====
Use the Movie Quiz Script in place of the Slide Show


Skin Developers can integrate the starting of the script. Often the chosen location for such integration is in the DialogVideoInfo.xml file. There are two methods, the old way and the new Movie ID way.
=== Common Settings to the two trivia modes ===
:; Intro Video: Enabling this setting will play Intro video(s) before Trivia
:::; Single Video: Select a video to play, this also can be a playlist file(''.m3u, .pls, .asf, .ram'')
:::; 1 Random Video: Select a folder to play a single video from, randomly selected
:::; 2 Random Videos: Select a folder to play a two(2) videos from, randomly selected
:::; 3 Random Videos: Select a folder to play a three(3) videos from, randomly selected
:::; 4 Random Videos: Select a folder to play a four(4) videos from, randomly selected
:::; 5 Random Videos: Select a folder to play a five(5) videos from, randomly selected
:; Outro Video: Enabling this setting will play Outro video(s) at the end of the trivia
:::; Single Video: Select a video to play, this also can be a playlist file(''.m3u, .pls, .asf, .ram'')
:::; 1 Random Video: Select a folder to play a single video from, randomly selected
:::; 2 Random Videos: Select a folder to play a two(2) videos from, randomly selected
:::; 3 Random Videos: Select a folder to play a three(3) videos from, randomly selected
:::; 4 Random Videos: Select a folder to play a four(4) videos from, randomly selected
:::; 5 Random Videos: Select a folder to play a five(5) videos from, randomly selected


<big>'''Old Method'''</big>''(still valid for the Dharma/Eden versions of the script)''
=== Special Videos ===
<source lang="xml">
=== Movie Trailers ===
<control type="button" id="49">
=== Feature Presentations ===
    <description>Home Theatre</description>
=== Home Automation ===
    <include>ButtonInfoDialogsCommonValues</include>
=== Miscellaneous ===
    <label>Cinema</label>
== Integration ==
    <onclick>Dialog.Close(MovieInformation)</onclick>
=== Home Automation Integration ===
    <onclick>XBMC.RunScript(script.cinema.experience)</onclick>
==== home_automation.py ====
    <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
When the script runs for the first time, the script will copy a folder named '''''ha_scripts''''' and it's contents to your '''''userdata\addon_data\script.cinema.experience''''' folder. Inside that folder is a file named ''home_automation.py'', which is a python script that Cinema Experience will trigger. Here is were the coding begins. It may seem intimidating, but it's actually fairly simple. Edit ''home_automation.py'' in a text or script editor. Beginning on line 53 of the file, you will notice commented parts of the code that say ''{{color|#6aa84f|# place code below this line}}'', example shown below in '''bold text'''.
</control>
</source>


<syntaxhighlight lang="python">
class Automate:
    def __init__( self ):
        pass
 
    def sab_pause(self, mode):
        """
            This function provides a method to pause and resume SabNZBd downloading, very useful on a limited network or low powered system
         
            Usage:
         
                apikey - Your SabNZBd API key goes here
                ip    - The IP of your SabNZBd Machine, if local, leave as is, if it does not work, put the actual address in
                port  - Normally 5000 but change it to match you SabNZBd program
             
                Pause:
             
                    self.sab_pause( "pause" )
             
                Resume:
             
                    self.sab_pause( "resume" )
        """
        apikey = ""
        ip = "127.0.0.1" # address
        port = "5000"
        url = "http://%s:%s/sabnzbd/" % ( ip, port )
        query = {}
        query[ "mode" ] = mode
        query["apikey"] = apikey
        response = urllib2.urlopen( urllib2.Request( url + "api?", urlencode( query ) ) )
        response_data = response.read()
   
    def activate_ha( self, trigger = None, prev_trigger = None, mode="normal" ):
        if ha_settings[ "ha_enable" ]:
            if ha_settings[ "ha_multi_trigger" ] and prev_trigger == trigger:
                pass
            elif mode != "thread":
                self.activate_on( trigger )
            else:
                thread = Thread( name='ha_trigger', target=self.activate_on, args=( trigger, ) )
                thread.start()
            prev_trigger = trigger
        return prev_trigger


<big>'''New Method'''</big>''(Frodo Version 3.0.1+)''
    def activate_on( self, trigger = None ):
<source lang="xml">
        """
<control type="button" id="49">
            Scripting to trigger almost anything(HA, other scripts, etc...) when videos start.
    <description>Home Theatre</description>
         
    <include>ButtonInfoDialogsCommonValues</include>
            Usage:
    <label>Cinema</label>
                activate_on( "Movie" )
    <onclick>Dialog.Close(MovieInformation)</onclick>
                will trigger code that is set under the Movie heading.
    <onclick>XBMC.RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID])</onclick>
             
    <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
        """
</control>
        if not trigger:
</source>
            utils.log( " - [ home_automation.py ] - No Trigger Sent, Returning", xbmc.LOGNOTICE )
            return
        utils.log( " - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, xbmc.LOGNOTICE )
        if trigger in triggers:
            utils.log( " - [ home_automation.py ] - Trigger %s" % trigger, xbmc.LOGNOTICE )
        # Script Start
        if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
            # place code below this line
            pass
        # Trivia Intro
        elif trigger == "Trivia Intro" and ha_settings[ "ha_trivia_intro" ]:
            # place code below this line
            pass
</syntaxhighlight>


== Trivia Slideshow ==
This line is where we will start. For those not familiar with python, lines beginning with '{{color|#6aa84f|#}}' are comment lines. To get the information to EventGhost, we need the script to send a broadcast. On XBMC Version Eden and Dharma, we used to use the xbmc.executehttpapi() function. Frodo and newer, HTTP API had been removed. Now the script includes it's own UDP Broadcaster. The home_automation.py script module already imports the '''utils''' module, all that is need it to used the '''utils.broadcastUDP()''' function.


The script can display a slideshow at the start of the experience.  The slides can be standard still slides or Q&A(with clues). The best method of storing the slides are to have them in separate folders, the script can search the folders recursively.
The broadcast we need to send from Cinema Experience is something that we can easily identify and distinguish in EventGhost. For this example we will use "CE_Automate". We will also use the html '''<nowiki><b></nowiki>''' tag to start the broadcast, and '''<nowiki></b></nowiki>''' to end the broadcast, as well as '''<nowiki><li></nowiki>''' to separate the trigger. For example:
=== Stills ===


=== Q & A ===
<syntaxhighlight lang="html">
<b>CE_Automate<li>script_start</b>
<b>CE_Automate<li>trivia_start</b>
</syntaxhighlight>


For the script to determine how and when to display the Q&A slides a file needs to accompany the slide's folder.  This file is called 'slides.xml'(not all lower case).
Now let's put it into the code, but first a little tip about the indentation. Python really likes indentation, in fact it will not work and throw a fit if the indentation is not correct. The script uses '''4 spaces per indentation''', these are also '''not tabs'''. The code we insert will need to line up with the other indented lines. For example:
Here are some examples of the slides.xml and the filenames.


slides.xml labels
<syntaxhighlight lang="python">
# Script Start
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
    # place code below this line
    utils.broadcastUDP( "<b>CE_Automate<li>script_start</b>" )
</syntaxhighlight>


<slide rating=> - allows the ability to specify a 'age' rating similar to movies, this can be used to match the rating of the movie being played or to set a limit on which slides are played based on value set in the Settings)
Now, when the script starts, it will broadcast: <code><nowiki><b>CE_Automate<li>script_start</b></nowiki></code>


<question format= /> - provides the format that matches slides as a question slide
==== EventGhost Setup ====
Now we need to turn our attention to EventGhost. Install the '''XBMC Event Receiver''' plugin [http://www.eventghost.net/forum/viewtopic.php?f=10&amp;t=2140&amp;start=30#p18203 found here] and setup with these settings(use the IP 127.0.0.1 if EventGhost is on the same machine as XBMC, otherwise use your XBMC IP address).


<clue format= /> - provides the format that matches slides as a clue slide
{| class="wikitable" width="35%"
|-
! Setting !! Value
|-
| Event-Prefix:
| '''XBMC-Event'''
|-
| XBMC Host IP:
| '''127.0.0.1'''
|-
| XBMC HTTP Port:
| '''8083'''
|-
| XBMC Broadcast IP:
| '''255.255.255.255'''
|-
| UDP Port:
| '''8278'''
|-
| Respond to Self Broadcast:
| '''checked'''
|-
| Payload Delimiter:
| '''<nowiki><b></b></nowiki>'''
|}


<answer format= /> - provides the format that matches slides as an answer slide
The triggers we need to look for are the messages that we have broadcast from Cinema Experience. The '''XBMC Event Receiver''' prefixes the broadcast with ''XBMC-Event.'', so the event we will be looking for messages like this: <code><nowiki>XBMC-Event.<b>CE_Automate<li>script_start</b></nowiki></code>


So now we can create a macro, and use <code><nowiki>XBMC-Event.<b>CE_Automate<li>script_start</b></nowiki></code> as the event, then add what you want EventGhost to do when this event occurs. If the script senses that the playback has stopped (by pressing stop, video crash, etc.) it will trigger the ''script_end'' trigger.


Filenaming
==== Script Triggers ====
Here are a list of the triggers that are available:


slideXXX_q.jpg  - Question Slide
{| class="wikitable" width="60%"
|-
! Event !! Trigger
|-
| Script Start
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>script_start</b></nowiki></code>
|-
| Script End
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>script_end</b></nowiki></code>
|-
| Trivia Intro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>trivia_intro</b></nowiki></code>
|-
| Trivia Start
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>trivia_start</b></nowiki></code>
|-
| Trivia Outro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>trivia_outro</b></nowiki></code>
|-
| Movie Theater Intro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>movie_theatre_intro</b></nowiki></code>
|-
| Coming Attraction Intro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>coming_attractions_intro</b></nowiki></code>
|-
| Trailer
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>trailer</b></nowiki></code>
|-
| Coming Attraction Outro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>coming_attractions_outro</b></nowiki></code>
|-
| Feature Presentation Intro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>feature_intro</b></nowiki></code>
|-
| Countdown Video
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>countdown_video</b></nowiki></code>
|-
| Audio Format Video
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>audio_video</b></nowiki></code>
|-
| Rating Video
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>mpaa_rating</b></nowiki></code>
|-
| FEATURE PRESENTATION
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>movie_start</b></nowiki></code>
|-
| Intermission
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>intermission</b></nowiki></code>
|-
| Feature Presentation Outro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>feature_outro</b></nowiki></code>
|-
| Movie Theater Outro
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>movie_theatre_outro</b></nowiki></code>
|-
| Paused
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>paused</b></nowiki></code>
|-
| Resumed
| <code><nowiki>XBMC-Event.<b>CE_Automate<li>resumed</b></nowiki></code>
|}


slideXXX_c.jpg  - Clue Slide
=== Skin Integration ===
Skin developers can now seamlessly integrate Cinema Experience! Often the chosen location for such integration is in the ''DialogVideoInfo.xml'' file. There are two methods, the old way and the new ''Movie ID'' way. Choose the method for your platform.


slideXXX_a.jpg  - Answer Slide
==== Old Method (Dharma/Eden) ====
<syntaxhighlight lang="xml">
    <control type="button" id="49">
        <description>Home Theatre</description>
        <include>ButtonInfoDialogsCommonValues</include>
        <label>Cinema</label>
        <onclick>Dialog.Close(MovieInformation)</onclick>
        <onclick>XBMC.RunScript(script.cinema.experience)</onclick>
        <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
    </control>
</syntaxhighlight>


(XXX) represents a number, up to 3 digits
==== New Method (Frodo v3.0.1+) ====
<source lang="xml">
<syntaxhighlight lang="xml">
<slides>
    <control type="button" id="49">
    <slide>
        <description>Home Theatre</description>
        <slide rating="R">
        <include>ButtonInfoDialogsCommonValues</include>
        <question format=".([0-9]{1,3})+_q.jpg" />
        <label>Cinema</label>
        <clue format=".([0-9]{1,3})+_c.jpg" />
        <onclick>Dialog.Close(MovieInformation)</onclick>
        <answer format=".([0-9]{1,3})+_a.jpg" />
        <onclick>XBMC.RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID])</onclick>
    </slide>
        <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
</slides>
    </control>
</source>
</syntaxhighlight>


Breakdown of ".([0-9]{1,3})+_q.jpg"
=== Script Starting Methods ===
There are a few different arguments available to change the starting the script. This are mostly for starting from with-in a skin or from an outside source(remote). Each cause the script to behave differently.


. <- provides matching of any alpha characters(letters) ie: matches "stills" in "stills20_q.jpg"
<big>'''Using the built-in RunScript Method'''</big> ''<small>often used in skins and keymaps</small>''
:RunScript(script.cinema.experience,argument)


([0-9]{1,3}) <- provides matching of any number from 0 - 999 ie: matches "20" in "stills20_q.jpg"
<big>'''Using the JSON RPC Method'''</big>
:{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "arguments" ] }, "id": 1}


+_q <- allows the script to determine if it is a question ie: "stills20_q.jpg" is a question, but "stills20_c" is not.
==== Available Arguments ====
===== Window ID =====
This is primarily used to put the script into multiple feature mode, though it can be used for a single Movie. The user will need to queue the movies into a playlist(normal queuing methods are used, Q on a keyboard, 0 on a remote or from the context menu)


^ this can be any letter or combination of letters as long as the pattern is kept. For example:
Possible window IDs to use:
::movietitles
::moviegenres
::movieyears
::movieactors
::moviedirectors
::moviestudios
::moviesets
::moviecountries
::recentlyaddedmovies


<question format=".([0-9]{1,3})+a.jpg" /> - the question
These match the general quick library links available from the homepage.


<clue format=".([0-9]{1,3})+b.jpg" /> - the clue
eg.
:::RunScript(script.cinema.experience,movietitles)


<answer format=".([0-9]{1,3})+c.jpg" /> - the answer
This will open up the library using Movie Titles, with the script waiting for the set number of features to be queue.


===== Movie ID =====
This is a new method introduced in version 3.0.1 of the script, to replace the former method of starting the script from a skin. The former method(no arguments sent to the script) caused an unsightly jump in the Movie Library list. This was due to the method XBMC uses to queue a video. With Frodo, skins now can extract the database ID for the Movie(using $INFO[ListItem.DBID] ) This method also allow a known database ID to be sent. Multiple database IDs can be sent at the same time, causing the script to go into Multiple Feature mode(fixed in version 3.0.4). The database IDs need to be separated by a semi-colon(;)


The next example of a slides.xml is for a two part trivia question(question and answer):
eg.
:::RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID]) <small>''skin method''</small>


<source lang="xml">
:::RunScript(script.cinema.experience,movieid=35) <small>''single movie database ID''</small>
<slides>
:::{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35" ] }, "id": 1}
    <slide>
        <slide rating="R">
        <question format=".([0-9]{1,3})+_q.jpg" />
        <clue format="N/A" />
        <answer format=".([0-9]{1,3})+_a.jpg" />
    </slide>
</slides>
</source>


:::RunScript(script.cinema.experience,movieid=35;123;112) <small>''multiple movie database IDs''</small>
:::{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35;123;112" ] }, "id": 1}


If your Q&A do not have any ordering numbers (ie slide1_q, the 1 is the ordering number) just use the following:
== FAQ ==
<source lang="xml">
<slides>
    <slide>
        <slide rating="R">
        <question format=".+_a.jpg" />
        <clue format="N/A" />
        <answer format=".+_b.jpg" />
    </slide>
</slides>
</source>


[[Category:Frodo add-on repository]]
[[Category:Add-ons with source tag]]
[[Category:All add-ons]]
[[Category:Program add-ons]]
[[Category:Gotham add-on repository]]
[[Category:Helix add-on repository]]
[[Category:Isengard add-on repository]]
[[Category:Jarvis add-on repository]]
[[Category:Krypton add-on repository]]
[[Category:Leia add-on repository]]

Latest revision as of 04:08, 17 October 2021

Cinema Experience
icon.png

See this add-on on the kodi.tv showcase

Author: Giftie

Type: Program
Repo:

Source: Source code
Summary: Re-create a full movie theater experience.
Home icon grey.png   ▶ Add-ons ▶ Cinema Experience
Attention talk.png Need help with this add-on? See here.

Play trailers, slideshows, intro videos, outro videos: To re-create a movie theater experience in the comfort of your home.

Installing

This add-on is installed from the Add-on browser located in Kodi as follows:

  1. Settings
  2. Add-ons
  3. Install from repository
  4. Program Add-ons
  5. Cinema Experience
  6. Install

History

This add-on has a lot of history. It started life in 2009 as the Home Theatre Experience script, written by an amazing and skilled Python programmer nuka1195. Through out its life it has brought many changes to XBMC. In December 2010, giftie took the reigns, and the script was modified to work with the new add-on engine in XBMC's Dharma. The name was changed, and the incarnation of Cinema Experience you know was born.

In the beginning, the script was only being maintained to function with XBMC. Then the script needed some functional repairs. Later, some major changes (and even some that brought about negative feedback). Now it's 2013, and XBMC Frodo is here. Cinema Experience is here to stay. Cinema Experience is currently maintained and improved by giftie. He's added numerous features to the script, and provides invaluable support via the Kodi forums.

What does it do?

The Cinema Experience script will add that WOW factor to your home theater, and give you a true Cinema Experience! Yes, you will still have to supply the popcorn and drinks. There's not much we can do about that. This script allows you to play trivia slides, movie trailers and other videos (intros and outros) that will help you get that Cinema Experience - just like at the local theater. Trivia slides can be any JPG or PNG image (many Movie Trivia, Stills, and Movie Fact packs already exist). The Feature Presentation Movie(s) must be in your Video Library. Cinema Experience can stream trailers, download them from Apple Movie Trailers, or play locally stored trailer(s) that are on your system or in your Movie Library.

What doesn't it do?

The Cinema Experience script will NOT work with any movies that are NOT local and scraped into your Movie Library. This means that any streaming content (let's use Netflix as an example, but this applies to any and all Video Add-ons that stream content to XBMC) either supported and in the official repository or not supported and in a third party repository will not work with the Cinema Experience script.

How do I get it?

At the moment, for XBMC Dharma and Eden this add-on is only available through installable ZIP files. The Frodo version has been added to the Official Official XBMC Repository, making it easier to get.

  • Dharma: Download
  • Eden: Download
  • Frodo: Available from the Official XBMC Repository

Reporting Bugs & Requesting Features

Cinema Experience is an evolving creature, getting better and more feature-rich with each release. That said, bugs happen. When they do, a bug report needs to be made. These are to be made on the Cinema Experience forum thread. A debug log is ALWAYS required, along with the steps needed to re-create the bug. I won't be able to help you if I can't understand what's happening.

Reporting Bugs: Method 1

Use the Debug Log Script.

Reporting Bugs: Method 2

Manually locate your Kodi.log file. Copy & paste your Kodi.log file to Kodi Paste (or a similar site).

Note: If you feel that you have private information in your log file that you don't want the public be able to see, set up an account on pastebin.com and store it as a private paste.

Uploading Logs

  1. Put XBMC into Debug Mode.
  2. Restart XBMC.
  3. If you have add-ons that run automatically when XBMC starts, wait a few minutes for these scripts to run (ShareThe.TV, Weather.com Plus, etc.).
  4. Run Cinema Experience.
  5. Upload your FULL xbmc.log file to Kodi Paste (or a similar site).
  6. Create a new forum message in this thread. Includethe steps required to reproduce the bug and your pastebin.com URL.

Requesting Features

I accept feature requests in this thread. Be sure to be specific about what you'd like to see added.

Information & Setup

Supported Ratings Systems

Cinema Experience currently supports the MPAA, BBFC, FSK and DEJUS ratings systems. If you'd like a new rating system supported, post in this thread. You may need to provide a database file, or some screenshots of the table. I need to know each different rating in that column. What I need to see will depend on your database. If you are using the default database format (i.e. you haven't made any changes to XBMC) you can post the database file to Google Drive or Drop Box and then PM me a link to the file. If you are using MySQL, you will need to access it yourself (using a viewer of some sort) and send me some screenshots movieview table. Generally, column c12 contains the ratings.

The database you need depends on the OS you are using. This Wiki Page will help you find the proper file. The Video database is named MyVideosXX.db - with XX representing the database version. Use the one with the latest date.

Sequence Overview

Cinema Experience gives you the ability to enable or disable any introduction videos, or the trivia slideshow. You have the power to customize your cinema experience. The following is an example of the complete script flow:

  1. Trivia Intro Video(s)
  2. Trivia Slides with Optional Music Playlist
  3. Trivia Outro Video(s)
  4. Movie Theater Intro Video(s)
  5. Coming Attractions Intro Video(s)
  6. Trailer(s)
  7. Coming Attractions Outro Video(s)
  8. 3D Intro Video(s) - if upcoming Movie is in 3D format
  9. 3D Trailers( from folder as I haven't found a site that has them really available) - if upcoming Movie is in 3D format
  10. Countdown Video
  11. Feature Presentation Intro Video(s)
  12. Rating Video (MPAA, BBFC and FSK ratings are currently supported)
  13. Audio Format Video
  14. FEATURE PRESENTATION
  15. Intermission Video(s) (note)
  16. Rating Video
  17. Audio Format Video
  18. FEATURE PRESENTATION 2
  19. Intermission Video(s) (note)
  20. Rating Video
  21. Audio Format Video
  22. FEATURE PRESENTATION 3
  23. Intermission Video(s) (note)
  24. Rating Video
  25. Audio Format Video
  26. FEATURE PRESENTATION 4
  27. Intermission Video(s) (note)
  28. Rating Video
  29. Audio Format Video
  30. FEATURE PRESENTATION 5 (end note)
  31. Feature Presentation Outro Video(s)
  32. 3D Outro Video(s) - if upcoming Movie is in 3D format
  33. Movie Theater Outro Video(s)

Available in 3D if upcoming movie is 3D and settings enabled

(note) At this point in the script, if multiple features have been queued and the skin uses home menu integration, multiple rating videos, audio format videos, features, and intermission videos will take the place of a single feature. A total of 5 features can be queued. This option can be even larger if you use one of the starting methods suggested in the Script Starting methods section.

Directory Tree Overviews

Root Directory Structure

This is the suggested directory structure for all of your Cinema Experience content.

Cinema Experience Root.png

Audio Format Directory Structure

The only directories that need to be in a specific format are in the Audio Format directory. This is because the script uses the name of the Audio Format (DTS, Dolby Digital, etc.) to determine what video to play.

Audio Format Directory Tree.png

Intro & Outro Directory Structure

Even though these directories don't need to be in a specific format, it's a good idea to use the standard shown below. If you're having trouble, switch to the standard and reconfigure Cinema Experience for the new directory structure.

Intros & Outros Directory Tree.png

Trivia Directory Structure

Even though these directories don't need to be in a specific format, it's a good idea to use the standard shown below. If you're having trouble, switch to the standard and reconfigure Cinema Experience for the new directory structure. The example below shows some popular slide sets copied into the appropriate directory.

Trivia Directory Tree.png

Trivia Slideshow Explained

The script can display a slideshow at the start of the experience. The slides can be standard still slides or Q&A(with clues). The best method of storing the slides are to have them in separate folders, the script can search the folders recursively.

Types of Slides

Stills

Stills are trivia slides that only have one part, or are not multiple part slides like the Question & Answer slides. These slides do not require the use of a slides.xml file.

Q&A

Question & Answer slides have multiple parts (for example: Question, Clue, Answer). This type of slide does require the use of a slides.xml file to enable the script to determine how and when to display each Q&A slide.

XML File Explained

A Breakdown of the XML File

<slide rating="X" /> This can be used to match the rating of the feature being played, or to set a limit on which slides are played based on value set in the Settings.
<question format="X" /> Provides the format that identifies slides as an Question slide.
<clue format="X" /> Provides the format that identifies slides as an Clue slide.
<answer format="X" /> Provides the format that identifies slides as an Answer slide.
     <slides>
         <slide>
             <slide rating="R">
             <question format=".([0-9]{1,3})+_q.jpg" />
             <clue format=".([0-9]{1,3})+_c.jpg" />
             <answer format=".([0-9]{1,3})+_a.jpg" />
         </slide>
     </slides>

A Breakdown of ".([0-9]{1,3})+_q.jpg"

. Provides identification of any leters (i.e. identifies the word "stills" in "stills20_q.jpg")
([0-9]{1,3}) Provides identification of any number from 0 - 999 (i.e. identifies the number "20" in "stills20_q.jpg").
+_q This allows the script to determine if it is a Question, Clue or Answer (i.e. "stills20_q.jpg" is a question, but "stills20_c.jpg" is a clue).

The "+_q" can be any letter or combination of letters as long as the pattern is kept. For example:

Question <question format=".([0-9]{1,3})+_q.jpg" /> <question format=".([0-9]{1,3})+_a.jpg" />
Clue <clue format=".([0-9]{1,3})+_c.jpg" /> <clue format=".([0-9]{1,3})+_b.jpg" />
Answer <answer format=".([0-9]{1,3})+_a.jpg" /> <answer format=".([0-9]{1,3})+_c.jpg" />

Example XML Files

This example of a slides.xml file is for a two part trivia question (Q&A) with words and ordering numbers (i.e. slidename1_q").

     <slides>
         <slide>
             <slide rating="R">
             <question format=".([0-9]{1,3})+_q.jpg" />
             <clue format="N/A" />
             <answer format=".([0-9]{1,3})+_a.jpg" />
         </slide>
     </slides>

This example of a slides.xml file is for a two part trivia question (Q&A) without ordering numbers (i.e. slidename_q").

     <slides>
         <slide>
             <slide rating="R">
             <question format=".+_a.jpg" />
             <clue format="N/A" />
             <answer format=".+_b.jpg" />
         </slide>
     </slides>

Settings Explained

Trivia Mode

Three(3) modes available: None, Slide Show and Movie Quiz Script.

None

No Trivia pre-show

Trivia Slideshow

Slide Show specific settings
Duration(in Minutes)
Set the total length, in minutes, of the slide show
Slides Folder
The parent folder of the slides
Show Question Slide for(seconds)
The time, in seconds, that the question slide is displayed on the screen
Show Clue Slide for(seconds)
The time, in seconds, that the clue slide is displayed on the screen
Show Answer Slide for(seconds)
The time, in seconds, that the answer slide is displayed on the screen
Show Still Slide for(seconds)
The time, in seconds, that the still slide is display on the screen
Play Music during Slide Show
Enabling this settings the script will play music during the slide show
Music Mode
Two modes available, Music File/Playlist or Music Folder
Music File/Playlist
Select the music file or playlist that is played during the slide show. Only standard playlist(.m3u, .pls, .asf, .ram) are allowed(no SmartPlaylist)
Music Folder
Select the folder which to play music from during the slide show
Adjust Volume during Slide Show
Enabling this setting allows the script to drop the volume level during slide show
Music Volume Level
Set the volume level(0-100)
Fade Volume at end of Slide Show
Enabling this setting allows the script to fade the volume down, then back up at the end of the slide show
Fade time in seconds
Set the fade time in seconds
Select Only Unwatched slides
Enabling this setting tells the script only to use unviewed slides. The script will automatically reset the watched status during the slide show if slides run out before the end of the slide show
Reset Slide watched status
Manually reset the watched status of slides
Limit Slides by movie rating(requires slides.xml)
Enabling this setting informs the script to limit the slides to a maximum MPAA rating of the movie. Other movie rating formats are roughly assessed and matched to MPAA Ratings
Rating Limit for Trivia(requires slides.xml)
If the previous setting is not enabled, adjusting this setting will fix the MPAA level of the slides used in slide show

Movie Quiz Script

Use the Movie Quiz Script in place of the Slide Show

Common Settings to the two trivia modes

Intro Video
Enabling this setting will play Intro video(s) before Trivia
Single Video
Select a video to play, this also can be a playlist file(.m3u, .pls, .asf, .ram)
1 Random Video
Select a folder to play a single video from, randomly selected
2 Random Videos
Select a folder to play a two(2) videos from, randomly selected
3 Random Videos
Select a folder to play a three(3) videos from, randomly selected
4 Random Videos
Select a folder to play a four(4) videos from, randomly selected
5 Random Videos
Select a folder to play a five(5) videos from, randomly selected
Outro Video
Enabling this setting will play Outro video(s) at the end of the trivia
Single Video
Select a video to play, this also can be a playlist file(.m3u, .pls, .asf, .ram)
1 Random Video
Select a folder to play a single video from, randomly selected
2 Random Videos
Select a folder to play a two(2) videos from, randomly selected
3 Random Videos
Select a folder to play a three(3) videos from, randomly selected
4 Random Videos
Select a folder to play a four(4) videos from, randomly selected
5 Random Videos
Select a folder to play a five(5) videos from, randomly selected

Special Videos

Movie Trailers

Feature Presentations

Home Automation

Miscellaneous

Integration

Home Automation Integration

home_automation.py

When the script runs for the first time, the script will copy a folder named ha_scripts and it's contents to your userdata\addon_data\script.cinema.experience folder. Inside that folder is a file named home_automation.py, which is a python script that Cinema Experience will trigger. Here is were the coding begins. It may seem intimidating, but it's actually fairly simple. Edit home_automation.py in a text or script editor. Beginning on line 53 of the file, you will notice commented parts of the code that say # place code below this line, example shown below in bold text.

class Automate:
    def __init__( self ):
        pass
   
    def sab_pause(self, mode):
        """
            This function provides a method to pause and resume SabNZBd downloading, very useful on a limited network or low powered system
           
            Usage:
           
                apikey - Your SabNZBd API key goes here
                ip     - The IP of your SabNZBd Machine, if local, leave as is, if it does not work, put the actual address in
                port   - Normally 5000 but change it to match you SabNZBd program
               
                Pause:
               
                    self.sab_pause( "pause" )
               
                Resume:
               
                    self.sab_pause( "resume" )
        """
        apikey = ""
        ip = "127.0.0.1" # address
        port = "5000"
        url = "http://%s:%s/sabnzbd/" % ( ip, port )
        query = {}
        query[ "mode" ] = mode
        query["apikey"] = apikey
        response = urllib2.urlopen( urllib2.Request( url + "api?", urlencode( query ) ) )
        response_data = response.read()
     
    def activate_ha( self, trigger = None, prev_trigger = None, mode="normal" ):
        if ha_settings[ "ha_enable" ]:
            if ha_settings[ "ha_multi_trigger" ] and prev_trigger == trigger:
                pass
            elif mode != "thread":
                self.activate_on( trigger )
            else:
                thread = Thread( name='ha_trigger', target=self.activate_on, args=( trigger, ) )
                thread.start()
            prev_trigger = trigger
        return prev_trigger

    def activate_on( self, trigger = None ):
        """
            Scripting to trigger almost anything(HA, other scripts, etc...) when videos start. 
           
            Usage:
                activate_on( "Movie" )
                will trigger code that is set under the Movie heading.
               
        """
        if not trigger:
            utils.log( " - [ home_automation.py ] - No Trigger Sent, Returning", xbmc.LOGNOTICE )
            return
        utils.log( " - [ home_automation.py ] - activate_on( %s ) Triggered" % trigger, xbmc.LOGNOTICE )
        if trigger in triggers:
            utils.log( " - [ home_automation.py ] - Trigger %s" % trigger, xbmc.LOGNOTICE )
        # Script Start
        if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
            # place code below this line
            pass
        # Trivia Intro
        elif trigger == "Trivia Intro" and ha_settings[ "ha_trivia_intro" ]:
            # place code below this line
            pass

This line is where we will start. For those not familiar with python, lines beginning with '#' are comment lines. To get the information to EventGhost, we need the script to send a broadcast. On XBMC Version Eden and Dharma, we used to use the xbmc.executehttpapi() function. Frodo and newer, HTTP API had been removed. Now the script includes it's own UDP Broadcaster. The home_automation.py script module already imports the utils module, all that is need it to used the utils.broadcastUDP() function.

The broadcast we need to send from Cinema Experience is something that we can easily identify and distinguish in EventGhost. For this example we will use "CE_Automate". We will also use the html <b> tag to start the broadcast, and </b> to end the broadcast, as well as <li> to separate the trigger. For example:

<b>CE_Automate<li>script_start</b>
<b>CE_Automate<li>trivia_start</b>

Now let's put it into the code, but first a little tip about the indentation. Python really likes indentation, in fact it will not work and throw a fit if the indentation is not correct. The script uses 4 spaces per indentation, these are also not tabs. The code we insert will need to line up with the other indented lines. For example:

# Script Start
if trigger == "Script Start" and ha_settings[ "ha_script_start" ]:
    # place code below this line
    utils.broadcastUDP( "<b>CE_Automate<li>script_start</b>" )

Now, when the script starts, it will broadcast: <b>CE_Automate<li>script_start</b>

EventGhost Setup

Now we need to turn our attention to EventGhost. Install the XBMC Event Receiver plugin found here and setup with these settings(use the IP 127.0.0.1 if EventGhost is on the same machine as XBMC, otherwise use your XBMC IP address).

Setting Value
Event-Prefix: XBMC-Event
XBMC Host IP: 127.0.0.1
XBMC HTTP Port: 8083
XBMC Broadcast IP: 255.255.255.255
UDP Port: 8278
Respond to Self Broadcast: checked
Payload Delimiter: <b></b>

The triggers we need to look for are the messages that we have broadcast from Cinema Experience. The XBMC Event Receiver prefixes the broadcast with XBMC-Event., so the event we will be looking for messages like this: XBMC-Event.<b>CE_Automate<li>script_start</b>

So now we can create a macro, and use XBMC-Event.<b>CE_Automate<li>script_start</b> as the event, then add what you want EventGhost to do when this event occurs. If the script senses that the playback has stopped (by pressing stop, video crash, etc.) it will trigger the script_end trigger.

Script Triggers

Here are a list of the triggers that are available:

Event Trigger
Script Start XBMC-Event.<b>CE_Automate<li>script_start</b>
Script End XBMC-Event.<b>CE_Automate<li>script_end</b>
Trivia Intro XBMC-Event.<b>CE_Automate<li>trivia_intro</b>
Trivia Start XBMC-Event.<b>CE_Automate<li>trivia_start</b>
Trivia Outro XBMC-Event.<b>CE_Automate<li>trivia_outro</b>
Movie Theater Intro XBMC-Event.<b>CE_Automate<li>movie_theatre_intro</b>
Coming Attraction Intro XBMC-Event.<b>CE_Automate<li>coming_attractions_intro</b>
Trailer XBMC-Event.<b>CE_Automate<li>trailer</b>
Coming Attraction Outro XBMC-Event.<b>CE_Automate<li>coming_attractions_outro</b>
Feature Presentation Intro XBMC-Event.<b>CE_Automate<li>feature_intro</b>
Countdown Video XBMC-Event.<b>CE_Automate<li>countdown_video</b>
Audio Format Video XBMC-Event.<b>CE_Automate<li>audio_video</b>
Rating Video XBMC-Event.<b>CE_Automate<li>mpaa_rating</b>
FEATURE PRESENTATION XBMC-Event.<b>CE_Automate<li>movie_start</b>
Intermission XBMC-Event.<b>CE_Automate<li>intermission</b>
Feature Presentation Outro XBMC-Event.<b>CE_Automate<li>feature_outro</b>
Movie Theater Outro XBMC-Event.<b>CE_Automate<li>movie_theatre_outro</b>
Paused XBMC-Event.<b>CE_Automate<li>paused</b>
Resumed XBMC-Event.<b>CE_Automate<li>resumed</b>

Skin Integration

Skin developers can now seamlessly integrate Cinema Experience! Often the chosen location for such integration is in the DialogVideoInfo.xml file. There are two methods, the old way and the new Movie ID way. Choose the method for your platform.

Old Method (Dharma/Eden)

     <control type="button" id="49">
         <description>Home Theatre</description>
         <include>ButtonInfoDialogsCommonValues</include>
         <label>Cinema</label>
         <onclick>Dialog.Close(MovieInformation)</onclick>
         <onclick>XBMC.RunScript(script.cinema.experience)</onclick>
         <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
     </control>

New Method (Frodo v3.0.1+)

     <control type="button" id="49">
         <description>Home Theatre</description>
         <include>ButtonInfoDialogsCommonValues</include>
         <label>Cinema</label>
         <onclick>Dialog.Close(MovieInformation)</onclick>
         <onclick>XBMC.RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID])</onclick>
         <visible>system.hasaddon(script.cinema.experience) + Container.Content(movies)</visible>
     </control>

Script Starting Methods

There are a few different arguments available to change the starting the script. This are mostly for starting from with-in a skin or from an outside source(remote). Each cause the script to behave differently.

Using the built-in RunScript Method often used in skins and keymaps

RunScript(script.cinema.experience,argument)

Using the JSON RPC Method

{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "arguments" ] }, "id": 1}

Available Arguments

Window ID

This is primarily used to put the script into multiple feature mode, though it can be used for a single Movie. The user will need to queue the movies into a playlist(normal queuing methods are used, Q on a keyboard, 0 on a remote or from the context menu)

Possible window IDs to use:

movietitles
moviegenres
movieyears
movieactors
moviedirectors
moviestudios
moviesets
moviecountries
recentlyaddedmovies

These match the general quick library links available from the homepage.

eg.

RunScript(script.cinema.experience,movietitles)

This will open up the library using Movie Titles, with the script waiting for the set number of features to be queue.

Movie ID

This is a new method introduced in version 3.0.1 of the script, to replace the former method of starting the script from a skin. The former method(no arguments sent to the script) caused an unsightly jump in the Movie Library list. This was due to the method XBMC uses to queue a video. With Frodo, skins now can extract the database ID for the Movie(using $INFO[ListItem.DBID] ) This method also allow a known database ID to be sent. Multiple database IDs can be sent at the same time, causing the script to go into Multiple Feature mode(fixed in version 3.0.4). The database IDs need to be separated by a semi-colon(;)

eg.

RunScript(script.cinema.experience,movieid=$INFO[ListItem.DBID]) skin method
RunScript(script.cinema.experience,movieid=35) single movie database ID
{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35" ] }, "id": 1}
RunScript(script.cinema.experience,movieid=35;123;112) multiple movie database IDs
{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=35;123;112" ] }, "id": 1}

FAQ