[pitivi: 4/28] factories/{base.py, file.py}: move definition of alpha and volume props to SourceFactory



commit d9a7cead56349473e108d739378b948c8a27c3b4
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Wed Jan 27 14:04:52 2010 -0800

    factories/{base.py,file.py}: move definition of alpha and volume props to
    SourceFactory

 pitivi/factories/base.py |   10 ++++++++++
 pitivi/factories/file.py |   13 -------------
 2 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/pitivi/factories/base.py b/pitivi/factories/base.py
index 572cad7..b1f766f 100644
--- a/pitivi/factories/base.py
+++ b/pitivi/factories/base.py
@@ -220,6 +220,16 @@ class SourceFactory(ObjectFactory):
         self.max_bins = -1
         self.current_bins = 0
 
+    def getInterpolatedProperties(self, stream):
+        self.debug("stream:%r", stream)
+        props = ObjectFactory.getInterpolatedProperties(self, stream)
+        if isinstance(stream, AudioStream):
+            props.update({"volume" : (0.0, 2.0), formatPercent})
+        elif isinstance(stream, VideoStream):
+            props.update({"alpha" : (0.0, 1.0), formatPercent})
+        self.debug("returning %r", props)
+        return props
+
     def makeBin(self, output_stream=None):
         """
         Create a bin that outputs the stream described by C{output_stream}.
diff --git a/pitivi/factories/file.py b/pitivi/factories/file.py
index 25ae842..16b6b90 100644
--- a/pitivi/factories/file.py
+++ b/pitivi/factories/file.py
@@ -28,7 +28,6 @@ from pitivi.factories.base import RandomAccessSourceFactory, \
         SinkFactory
 from pitivi.elements.imagefreeze import ImageFreeze
 from pitivi.stream import MultimediaStream, AudioStream, VideoStream
-from pitivi.utils import formatPercent
 
 class FileSourceFactory(RandomAccessSourceFactory):
     """
@@ -43,18 +42,6 @@ class FileSourceFactory(RandomAccessSourceFactory):
         # FIXME: backward compatibility
         self.filename = uri
 
-    def getInterpolatedProperties(self, stream):
-        self.debug("stream:%r", stream)
-        # FIXME: dummy implementation
-        props = RandomAccessSourceFactory.getInterpolatedProperties(self, 
-            stream)
-        if isinstance(stream, AudioStream):
-            props.update({"volume" : (0.0, 2.0, formatPercent)})
-        elif isinstance(stream, VideoStream):
-            props.update({"alpha" : (0.0, 1.0, formatPercent)})
-        self.debug("returning %r", props)
-        return props
-
 class PictureFileSourceFactory(FileSourceFactory):
     """
     Factory for image sources.



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