[pitivi] effects: Use creators, and let GES add TrackElements to tracks



commit 61de7d79486567fddf2151379e6d38a9dc0941a2
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Thu Mar 14 17:46:31 2013 -0300

    effects: Use creators, and let GES add TrackElements to tracks

 pitivi/clipproperties.py    |    8 ++------
 pitivi/timeline/timeline.py |    3 +--
 pitivi/timeline/track.py    |    1 -
 3 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 850a1cf..a51f606 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -338,9 +338,8 @@ class EffectProperties(Gtk.Expander, Loggable):
                         media_type == VIDEO_EFFECT:
                     #Actually add the effect
                     self.app.action_log.begin("add effect")
-                    effect = GES.Effect(bin_description=bin_desc)
+                    effect = GES.Effect.new(bin_description=bin_desc)
                     clip.add(effect)
-                    track.add_element(effect)
                     self.updateAll()
                     self.app.action_log.commit()
                     self.app.current.pipeline.flushSeek()
@@ -594,12 +593,9 @@ class TransformationProperties(Gtk.Expander):
     def _findOrCreateEffect(self, name):
         effect = self._findEffect(name)
         if not effect:
-            effect = GES.Effect(bin_description=name)
+            effect = GES.Effect.new(bin_description=name)
             self._selected_clip.add(effect)
             tracks = self.app.projectManager.current.timeline.get_tracks()
-            for track in tracks:
-                if track.get_caps().to_string() == "video/x-raw":
-                    track.add_element(effect)
             effect = self._findEffect(name)
             # disable the effect on default
             a = self.effect.get_gnlobject()
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index e10abbb..8110731 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1260,9 +1260,8 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
                             media_type == VIDEO_EFFECT:
                         #Actually add the effect
                         self.app.action_log.begin("add effect")
-                        effect = GES.Effect(bin_description=bin_desc)
+                        effect = GES.Effect.new(bin_description=bin_desc)
                         clip.add(effect)
-                        track.add_element(effect)
                         self.app.gui.clipconfig.effect_expander.updateAll()
                         self.app.action_log.commit()
                         self._factories = None
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index b968e73..a0fc832 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -633,7 +633,6 @@ class TrackElement(View, GooCanvas.CanvasGroup, Zoomable, Loggable):
                         title.set_duration(self.element.duration)
                         # FIXME: Creating a text overlay everytime we select a video track object is madness
                         self.element.get_parent().add(title)
-                        self.element.get_track().add_element(title)
                     self.app.gui.title_editor.set_source(title)
                 self.app.gui.trans_list.deactivate()
                 self.app.gui.switchContextTab()


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