[pitivi] videomixing: Use new gnloperation signal to inform videomixer of zorder.



commit 2b5908416e9b65c5a00aa36966c79763732e6ca5
Author: Edward Hervey <bilboed bilboed com>
Date:   Sun Aug 23 19:57:20 2009 +0200

    videomixing: Use new gnloperation signal to inform videomixer of zorder.
    
    Doesn't seem to work 100% reliably though. Requires gnonlin git.

 pitivi/elements/mixer.py |    8 ++++++++
 pitivi/timeline/track.py |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/elements/mixer.py b/pitivi/elements/mixer.py
index 7035ae1..65079e3 100644
--- a/pitivi/elements/mixer.py
+++ b/pitivi/elements/mixer.py
@@ -141,6 +141,14 @@ class SmartVideomixerBin(gst.Bin):
         self.inputs = {} # key : pad_name,
                          # value : (sinkpad, ffmpegcolorspace, capsfilter, videomixerpad)
 
+    def update_priority(self, pad, priority):
+        self.debug("pad:%r, priority:%d" % ( pad, priority))
+        if priority > 10000:
+            priority = 10000
+        a,b,c,sinkpad = self.inputs[pad.get_name()]
+        sinkpad.props.zorder = 10000 - priority
+        self.debug("done")
+
     def do_request_new_pad(self, template, name=None):
         self.debug("template:%r, name:%r" % (template, name))
         if name == None:
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index aaf5a49..c4b0203 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -659,9 +659,14 @@ class Track(Signallable):
             gnl.add(m)
             gnl.props.expandable = True
             gnl.props.priority = 0
+            gnl.connect("input-priority-changed",
+                        self._videoInputPriorityChangedCb, m)
             return gnl
         return None
 
+    def _videoInputPriorityChangedCb(self, operation, pad, priority, mixer):
+        mixer.update_priority(pad, priority)
+
     def _getStart(self):
         return self.composition.props.start
 



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