[pitivi] Clean Timeline.addEffectFactory



commit fdac51d33dc3055bbae26aa95c9bc41a86ec7a3b
Author: Thibault Saunier <tsaunier gnome org>
Date:   Fri Jul 30 13:59:34 2010 +0200

    Clean Timeline.addEffectFactory

 pitivi/effects.py           |    2 --
 pitivi/timeline/timeline.py |    8 ++++----
 tests/test_timeline.py      |    4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 8c949bc..a0ba954 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -51,8 +51,6 @@ from pitivi.undo import UndoableAction
 
 (VIDEO_EFFECT, AUDIO_EFFECT)  = range(2)
 
-#AspectratioCrop is Blacklisted because of this bug:
-#https://bugzilla.gnome.org/show_bug.cgi?id=624882
 BLACKLISTED_EFFECTS = ["colorconvert", "coglogoinsert", "festival", "aspectratiocrop"]
 
 
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 98b7c44..68f5b11 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1687,7 +1687,7 @@ class Timeline(Signallable, Loggable):
         self.addTimelineObject(timeline_object)
         return timeline_object
 
-    def addEffectFactoryOnObject(self, factory, time=0, priority=0, timeline_objects=None):
+    def addEffectFactoryOnObject(self, factory, timeline_objects):
         """
         Add effectTraks corresponding to the effect from the factory to the corresponding
         L{TimelineObject}s on the timeline
@@ -1720,13 +1720,13 @@ class Timeline(Signallable, Loggable):
         if track is None:
           raise TimelineError()
 
+        if not timeline_objects:
+          raise TimelineError("There is no timeline object to add effect to")
+
         listTimelineObjectTrackObject = []
         track_object = TrackEffect(factory, input_stream)
         track_object.makeBin()
 
-        if not timeline_objects:
-            timeline_objects = self.getObjsToAddEffectTo(time, priority)
-
         for obj in timeline_objects:
             copy_track_obj = track_object.copy()
             track.addTrackObject(copy_track_obj)
diff --git a/tests/test_timeline.py b/tests/test_timeline.py
index ceb76d1..7ff78d2 100644
--- a/tests/test_timeline.py
+++ b/tests/test_timeline.py
@@ -1139,7 +1139,7 @@ class TestTimelineAddFactory(TestCase):
         self.timeline.addSourceFactory(self.source_factory)
         self.effect_factory.addInputStream(self.video_stream1)
         self.effect_factory.addOutputStream(self.video_stream2)
-        self.timeline.addEffectFactoryOnObject(self.effect_factory, 0, 0)
+        self.timeline.addEffectFactoryOnObject(self.effect_factory, self.timeline.timeline_objects)
         self.failUnlessEqual(len(self.audio_track1.track_objects), 0)
         self.failUnlessEqual(len(self.audio_track2.track_objects), 0)
         self.failUnlessEqual(len(self.video_track1.track_objects), 2)
@@ -1150,7 +1150,7 @@ class TestTimelineAddFactory(TestCase):
         self.timeline.addSourceFactory(self.source_factory)
         self.effect_factory.addInputStream(self.audio_stream1)
         self.effect_factory.addOutputStream(self.audio_stream2)
-        self.timeline.addEffectFactoryOnObject(self.effect_factory, 0, 0)
+        self.timeline.addEffectFactoryOnObject(self.effect_factory, self.timeline.timeline_objects)
         self.failUnlessEqual(len(self.audio_track1.track_objects), 2)
         self.failUnlessEqual(len(self.audio_track2.track_objects), 0)
         self.failUnlessEqual(len(self.video_track1.track_objects), 0)



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