[pitivi/ges: 11/287] GES : make it so the background source lasts till the start of the last track object



commit 774a83742dcbb9447b5143390b0febd700edda95
Author: Mathieu Duponchelle <seeed laposte net>
Date:   Wed Jul 20 09:12:32 2011 +0200

    GES : make it so the background source lasts till the start of the last track object

 pitivi/project.py        |    5 +++++
 pitivi/ui/trackobject.py |   12 ++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index 7dec97f..7c7f634 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -93,6 +93,11 @@ class Project(Signallable, Loggable):
         self.timeline = ges.timeline_new_audio_video()
         self.layer = ges.TimelineLayer()
         self.timeline.add_layer(self.layer)
+        self.back_layer = ges.TimelineLayer()
+        self.background = ges.TimelineTestSource()
+        self.back_layer.set_priority(99)
+        self.back_layer.add_object(self.background)
+        self.timeline.add_layer(self.back_layer)
 
         self.pipeline = ges.TimelinePipeline()
         self.pipeline._setUp = False
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 7d76da7..603bb61 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -425,6 +425,18 @@ class TrackObject(View, goocanvas.Group, Zoomable):
                 goocanvas.ITEM_INVISIBLE
 
     def _update(self):
+        objects = self.app.projectManager.current.timeline.get_layers()[0].get_objects()
+        lastStart = 0
+        for obj in objects:
+            for tr_obj in obj.get_track_objects():
+                if tr_obj.get_property("duration") > lastStart:
+                    lastStart = tr_obj.get_property("start")
+        print lastStart, "connard"
+
+        for layer in self.app.projectManager.current.timeline.get_layers():
+            if layer.get_priority() == 99:
+                layer.get_objects()[0].set_property("duration", lastStart)
+
         try:
             x = self.nsToPixel(self.element.get_start())
         except Exception, e:



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