[pitivi] zoominterface.py: add method to compute pixel width at arbitrary zoom ratio



commit 851a491b6189a9e566f6d17340f0996ef1b9ac7e
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date:   Thu Sep 24 14:10:16 2009 -0700

    zoominterface.py: add method to compute pixel width at arbitrary zoom ratio

 pitivi/ui/zoominterface.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/zoominterface.py b/pitivi/ui/zoominterface.py
index 276160b..4456715 100644
--- a/pitivi/ui/zoominterface.py
+++ b/pitivi/ui/zoominterface.py
@@ -120,6 +120,14 @@ class Zoomable(object):
         return long(pixel * gst.SECOND / cls.zoomratio)
 
     @classmethod
+    def pixelToNsAt(cls, pixel, ratio):
+        """
+        Returns the pixel equivalent in nanoseconds according to the zoomratio
+        """
+        return long(pixel * gst.SECOND / ratio)
+
+
+    @classmethod
     def nsToPixel(cls, duration):
         """
         Returns the pixel equivalent of the given duration, according to the



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