[pitivi] pipeline: Update viewer overlays on ASYNC_DONE.



commit 8d9b07874fb284388163587f349049b8e56fecd8
Author: Lubosz Sarnecki <lubosz sarnecki collabora co uk>
Date:   Wed Mar 30 21:05:03 2016 +0200

    pipeline: Update viewer overlays on ASYNC_DONE.
    
    Differential Revision: https://phabricator.freedesktop.org/D843

 pitivi/timeline/timeline.py |    9 +++++----
 pitivi/utils/pipeline.py    |    2 ++
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 2dea32f..d29745a 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -427,7 +427,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         if pipeline.playing() and x - self.hadj.get_value() > layout_width - 100:
             self.scrollToPlayhead(Gtk.Align.START)
         if not pipeline.playing():
-            self.update_visible_overlays(position)
+            self.update_visible_overlays()
 
     # snapping indicator
     def _snapCb(self, unused_timeline, unused_obj1, unused_obj2, position):
@@ -606,8 +606,9 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
                     continue
         return sources
 
-    def update_visible_overlays(self, position):
-        self.app.gui.viewer.target.overlay_stack.set_current_sources(self.get_sources_at_position(position))
+    def update_visible_overlays(self):
+        sources = self.get_sources_at_position(self.__last_position)
+        self.app.gui.viewer.target.overlay_stack.set_current_sources(sources)
 
     def __buttonPressEventCb(self, unused_widget, event):
         self.debug("PRESSED %s", event)
@@ -666,7 +667,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
             self._seek(event)
 
         self._snapEndedCb()
-        self.update_visible_overlays(self.__last_position)
+        self.update_visible_overlays()
 
         return False
 
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index f73212e..44e29e9 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -632,6 +632,8 @@ class Pipeline(GES.Pipeline, SimplePipeline):
     def _busMessageCb(self, bus, message):
         if message.type == Gst.MessageType.ASYNC_DONE:
             self.commiting = False
+            self.app.gui.timeline_ui.timeline.update_visible_overlays()
+
         if message.type == Gst.MessageType.ASYNC_DONE and\
                 self._commit_wanted:
             self.debug("Commiting now that ASYNC is DONE")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]