[pitivi] Remove all references to addEffectFactory and use AddEffectFactoryOnObject instead



commit e8138259cb2d22709cd0691a75d5114c37c8c964
Author: Thibault Saunier <tsaunier gnome org>
Date:   Sun Jul 18 22:31:11 2010 -0400

    Remove all references to addEffectFactory and use AddEffectFactoryOnObject instead

 pitivi/timeline/timeline.py |   38 --------------------------------------
 tests/test_timeline.py      |    4 ++--
 2 files changed, 2 insertions(+), 40 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 45c7936..ec4e5d5 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1687,44 +1687,6 @@ class Timeline(Signallable, Loggable):
         self.addTimelineObject(timeline_object)
         return timeline_object
 
-    def addEffectFactory(self, factory, start=0):
-        """
-        Creates a TimelineObject for the given EffectFactory and adds it to the timeline.
-
-        @param factory: The EffectFactory to add.
-        @type factory: L{EffectFactory}
-        @ivar start: The position of the effect on a timeline (nanoseconds)
-        @type start: L{long}
-        @raises TimelineError: if the factory doesn't have input or output streams
-        """
-        self.debug("factory:%r", factory)
-
-        output_stream = factory.getOutputStreams()
-        if not output_stream:
-            raise TimelineError()
-        output_stream = output_stream[0]
-
-        input_stream = factory.getInputStreams()
-        if not input_stream:
-            raise TimelineError()
-        input_stream = input_stream[0]
-
-        track = self.getEffectTrack(factory)
-        if track is None:
-          raise TimelineError()
-
-        timeline_object = TimelineObject(factory)
-        track_object = TrackEffect(factory, input_stream)
-        track.addTrackObject(track_object)
-        timeline_object.addTrackObject(track_object)
-
-        self.addTimelineObject(timeline_object)
-
-        timeline_object.start = start
-        timeline_object.setDuration(track.duration - start)
-
-        return timeline_object
-
     def addEffectFactoryOnObject(self, factory, time, priority):
         """
         Add effectTraks corresponding to the effect from the factory to the corresponding
diff --git a/tests/test_timeline.py b/tests/test_timeline.py
index 0ba1bd7..ceb76d1 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.addEffectFactory(self.effect_factory)
+        self.timeline.addEffectFactoryOnObject(self.effect_factory, 0, 0)
         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.addEffectFactory(self.effect_factory)
+        self.timeline.addEffectFactoryOnObject(self.effect_factory, 0, 0)
         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]