[pitivi/ges: 14/287] Set auto transitions to true, and add a dummy background
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 14/287] Set auto transitions to true, and add a dummy background
- Date: Thu, 15 Mar 2012 16:27:00 +0000 (UTC)
commit 5d5c083d07fd8396b349fbb6f6a49b8c3339eb6d
Author: Mathieu Duponchelle <seeed laposte net>
Date: Sun Aug 28 19:32:59 2011 +0200
Set auto transitions to true, and add a dummy background
pitivi/project.py | 2 ++
pitivi/timeline/timeline.py | 25 ++++++++++++++++++++++---
2 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index 99e2dec..7726156 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -94,10 +94,12 @@ class Project(Signallable, Loggable):
self.timeline = ges.timeline_new_audio_video()
self.timeline.selected = []
self.layer = ges.TimelineLayer()
+ self.layer.set_property("auto-transition", True)
self.timeline.add_layer(self.layer)
self.back_layer = ges.TimelineLayer()
self.background = ges.TimelineTestSource()
self.back_layer.set_priority(99)
+ self.background.set_property("duration", 313960000000)
self.back_layer.add_object(self.background)
self.timeline.add_layer(self.back_layer)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index a8e8126..c42011f 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1087,6 +1087,7 @@ class MoveContext(EditingContext):
self.tracks = set([])
all_objects = set(other)
all_objects.add(focus)
+ self.layersList = []
for obj in all_objects:
if isinstance(obj, TrackObject):
timeline_object = obj.timeline_object
@@ -1264,11 +1265,29 @@ class MoveContext(EditingContext):
position + self.default_span)
priority = max(self.min_priority, priority)
- self.focus.get_layer().set_property ("priority", priority)
- #self.focus.set_property("start", long(position))
+ obj = self.focus
+ if isinstance (self.focus, ges.TrackFileSource):
+ obj = self.focus.get_timeline_object()
+ if obj.get_layer().get_property("priority") != priority:
+ origin_layer = obj.get_layer()
+ moved = False
+ for layer in self.timeline.get_layers():
+ if layer.get_property("priority") == priority:
+ obj.move_to_layer(layer)
+ moved = True
+ if not moved:
+ layer = ges.TimelineLayer()
+ layer.set_property("auto-transition", True)
+ self.timeline.add_layer(layer)
+ layer.set_property("priority", priority)
+ obj.move_to_layer(layer)
+ self.layersList.append(layer)
+ if position < 0:
+ position = 0
+ self.focus.set_property("start", long(position))
for obj, (s_offset, p_offset) in self.offsets.iteritems():
- obj.set_property("start", position + s_offset)
+ obj.set_property("start", long(position + s_offset))
#obj.get_layer().set_property ("priority", priority + p_offset)
return position, priority
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]