← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugs into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugs into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #657860 in OpenLP: "At the end of a video, the last frame stays on screen."
  https://bugs.launchpad.net/openlp/+bug/657860
  Bug #693150 in OpenLP: "Custom Slide Display footer option"
  https://bugs.launchpad.net/openlp/+bug/693150
  Bug #693202 in OpenLP: "delete theme"
  https://bugs.launchpad.net/openlp/+bug/693202
  Bug #712252 in OpenLP: "Service song already in database detection logic broken"
  https://bugs.launchpad.net/openlp/+bug/712252

For more details, see:
https://code.launchpad.net/~trb143/openlp/bugs/+merge/53204

Blank video at the end when it is finished.
Additional comments.
Hook for later development work.
-- 
https://code.launchpad.net/~trb143/openlp/bugs/+merge/53204
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bugs into lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-03-09 18:14:50 +0000
+++ openlp/core/ui/maindisplay.py	2011-03-14 08:51:00 +0000
@@ -67,6 +67,7 @@
         self.isLive = live
         self.alertTab = None
         self.hideMode = None
+        self.videoHide = False
         self.override = {}
         mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
         self.setWindowIcon(mainIcon)
@@ -90,7 +91,7 @@
         """
         Set up and build the output screen
         """
-        log.debug(u'Start setup for monitor %s (live = %s)' % 
+        log.debug(u'Start setup for monitor %s (live = %s)' %
             (self.screens.monitor_number, self.isLive))
         self.usePhonon = QtCore.QSettings().value(
             u'media/use phonon', QtCore.QVariant(True)).toBool()
@@ -110,6 +111,12 @@
         QtCore.QObject.connect(self.mediaObject,
             QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
             self.videoStart)
+        QtCore.QObject.connect(self.mediaObject,
+            QtCore.SIGNAL(u'finished()'),
+            self.videoFinished)
+        QtCore.QObject.connect(self.mediaObject,
+            QtCore.SIGNAL(u'tick(qint64)'),
+            self.videoTick)
         log.debug(u'Setup webView for monitor %s' % self.screens.monitor_number)
         self.webView = QtWebKit.QWebView(self)
         self.webView.setGeometry(0, 0,
@@ -262,6 +269,7 @@
             self.displayImage(self.serviceItem.bg_image_bytes)
         else:
             self.displayImage(None)
+        # clear the cache
         self.override = {}
         # Update the preview frame.
         if self.isLive:
@@ -349,6 +357,9 @@
             self.mediaObject.stop()
             self.mediaObject.clearQueue()
             self.mediaObject.setCurrentSource(Phonon.MediaSource(videoPath))
+            # Need the timer to trigger
+            if self.serviceItem.start_time != 0:
+                self.mediaObject.setTickInterval(200)
             self.mediaObject.play()
             self.webView.setVisible(False)
             self.videoWidget.setVisible(True)
@@ -365,6 +376,23 @@
         if newState == Phonon.PlayingState:
             self.mediaObject.seek(self.serviceItem.start_time * 1000)
 
+    def videoFinished(self):
+        """
+        Blank the Video when it has finished so the final frame is not left
+        hanging
+        """
+        self.videoStop()
+        self.hideDisplay(HideMode.Blank)
+        self.phononActive = False
+        self.videoHide = True
+
+    def videoTick(self, tick):
+        """
+        Triggered on video tick every 200 milli seconds
+        Will be used to manage Stop time later
+        """
+        pass
+
     def isWebLoaded(self):
         """
         Called by webView event to show display is fully loaded
@@ -422,10 +450,12 @@
             if u'video' in self.override:
                 Receiver.send_message(u'video_background_replaced')
                 self.override = {}
+            # We have a different theme.
             elif self.override[u'theme'] != serviceItem.themedata.theme_name:
                 Receiver.send_message(u'live_theme_changed')
                 self.override = {}
             else:
+                # replace the background
                 background = self.imageManager. \
                     get_image_bytes(self.override[u'image'])
         if self.serviceItem.themedata.background_filename:
@@ -441,6 +471,10 @@
         # if was hidden keep it hidden
         if self.hideMode and self.isLive:
             self.hideDisplay(self.hideMode)
+        # display hidden for video end we have a new item so must be shown
+        if self.videoHide and self.isLive:
+            self.videoHide = False
+            self.showDisplay()
         self.__hideMouse()
 
     def footer(self, text):


Follow ups