Exemplo n.º 1
0
 def _exit_trivia(self):
     import xbmcscript_player as script
     script.Main()
     # notify we are exiting
     self.exiting = True
     # cancel timers
     self._cancel_timers()
     # save watched slides
     self._save_watched_trivia_file()
     # set the volume back to original
     # show an end image
     self._show_intro_outro("outro")
Exemplo n.º 2
0
 def _exit_trivia(self):
     if self.slide_type not in (
             "answer", "still"
     ) and not self.image_count > len(self.slide_playlist) - 1:
         self.image_count += 1
         self._cancel_timers()
         self._show_slide(exiting=True)
     import xbmcscript_player as script
     script.Main()
     # notify we are exiting
     self.exiting = True
     # cancel timers
     self._cancel_timers()
     # save watched slides
     self._save_watched_trivia_file()
     # set the volume back to original
     # show an end image
     self._show_intro_outro("outro")
Exemplo n.º 3
0
    def _play_trivia(self, mpaa, genre, plist, equivalent_mpaa):
        Launch_automation().launch_automation(
            triggers[0])  # Script Start - Or where it seems to be
        if trivia_settings["trivia_mode"] == 2:  # Start Movie Quiz Script
            log("Starting script.moviequiz", xbmc.LOGNOTICE)
            self.start_downloader(mpaa, genre, equivalent_mpaa)
            try:
                _MA_ = xbmcaddon.Addon("script.moviequiz")
                BASE_MOVIEQUIZ_PATH = xbmc.translatePath(
                    _MA_.getAddonInfo('path'))
                sys.path.append(BASE_MOVIEQUIZ_PATH)
                try:
                    import quizlib.question as question
                    log("Loaded question module", xbmc.LOGNOTICE)
                except ImportError:
                    traceback.print_exc()
                    log("Failed to Load question module", xbmc.LOGNOTICE)
                except:
                    traceback.print_exc()
                try:
                    import quizlib.mq_ce_play as moviequiz
                    log("Loaded mq_ce_play module", xbmc.LOGNOTICE)
                except ImportError:
                    traceback.print_exc()
                    log("Failed to Load mq_ce_play module", xbmc.LOGNOTICE)
                except:
                    traceback.print_exc()

    #            pDialog.close()
                self.trivia_intro()
                if playlist.size() > 0:
                    self._wait_until_end()
                xbmc.sleep(500)  # wait .5 seconds
                xbmc.Player().stop()
                path = _MA_.getAddonInfo('path')
                question_type = 1
                mode = (True, False)[trivia_settings["trivia_moviequiz_mode"]]
                mpaa = (
                    trivia_settings["trivia_rating"],
                    equivalent_mpaa,
                )[trivia_settings["trivia_limit_query"]]
                question_limit = trivia_settings["trivia_moviequiz_qlimit"]
                completion = moviequiz.runCinemaExperience(
                    question_type, mode, mpaa, genre, question_limit)
                if completion:
                    log("Completed script.moviequiz", xbmc.LOGNOTICE)
                else:
                    log("Failed in script.moviequiz", xbmc.LOGNOTICE)
            except:
                traceback.print_exc()
                log("Failed to start script.moviequiz", xbmc.LOGNOTICE)
            _rebuild_playlist(plist)
            import xbmcscript_player as script
            script.Main()
            xbmc.executebuiltin("XBMC.ActivateWindow(fullscreenvideo)")
            #xbmc.sleep(500) # wait .5 seconds
            #xbmc.Player().play( playlist )
        elif trivia_settings["trivia_folder"] and trivia_settings[
                "trivia_mode"] == 1:  # Start Slide Show
            self.start_downloader(mpaa, genre, equivalent_mpaa)
            if not trivia_settings["trivia_music"] == 0:
                build_music_playlist()
            # set the proper mpaa rating user preference
            mpaa = (
                trivia_settings["trivia_rating"],
                equivalent_mpaa,
            )[trivia_settings["trivia_limit_query"]]
            log("Slide MPAA Rating: %s" % equivalent_mpaa, xbmc.LOGNOTICE)
            # import trivia module and execute the gui
            slide_playlist = _fetch_slides(equivalent_mpaa)
            self.trivia_intro()
            if playlist.size() > 0:
                Launch_automation().launch_automation(
                    triggers[1])  # Trivia Intro
                xbmc.sleep(500)  # wait .5 seconds
                self._wait_until_end()
            #xbmc.sleep(500) # wait .5 seconds
            xbmc.Player().stop()
            __builtin__.plist = plist
            __builtin__.slide_playlist = slide_playlist
            __builtin__.movie_mpaa = mpaa
            __builtin__.movie_genre = genre
            from xbmcscript_trivia import Trivia
            log("Starting Trivia script", xbmc.LOGNOTICE)
            Launch_automation().launch_automation(triggers[2])  # Trivia Start
            ui = Trivia("script-CExperience-trivia.xml",
                        __addon__.getAddonInfo('path'), "Default", "720p")
            ui.doModal()
            del ui
            # we need to activate the video window
            #xbmc.sleep(5) # wait .005 seconds
            xbmc.executebuiltin("XBMC.ActivateWindow(fullscreenvideo)")
            #xbmc.Player().play( playlist )
        elif trivia_settings["trivia_mode"] == 0:  # No Trivia
            # no trivia slide show so play the video
            self.start_downloader(mpaa, genre, equivalent_mpaa)
            _rebuild_playlist(plist)
            # play the video playlist
            import xbmcscript_player as script
            script.Main()
            xbmc.executebuiltin("XBMC.ActivateWindow(fullscreenvideo)")
            xbmc.sleep(500)  # wait .5 seconds