[pitivi] elements: Expose the alpha property on titles



commit 801d45de5fc750b596342e1db1dcaaa8a50d7fc7
Author: Thibault Saunier <tsaunier gnome org>
Date:   Tue Jan 26 12:59:36 2016 +0100

    elements: Expose the alpha property on titles
    
    Reviewed-by: Alex Băluț <alexandru balut gmail com>
    Differential Revision: https://phabricator.freedesktop.org/D707

 pitivi/timeline/elements.py |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 9d9c75f..64fff35 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -531,21 +531,6 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
         return None
 
 
-class TitleSource(TimelineElement):
-
-    __gtype_name__ = "PitiviTitleSource"
-
-    def __init__(self, element, timeline):
-        super(TitleSource, self).__init__(element, timeline)
-        self.get_style_context().add_class("VideoUriSource")
-
-    def _getBackground(self):
-        return VideoBackground()
-
-    def do_get_preferred_height(self):
-        return ui.LAYER_HEIGHT / 2, ui.LAYER_HEIGHT
-
-
 class VideoBackground(Gtk.Box):
 
     def __init__(self):
@@ -561,6 +546,16 @@ class VideoSource(TimelineElement):
         return VideoBackground()
 
 
+class TitleSource(VideoSource):
+
+    __gtype_name__ = "PitiviTitleSource"
+
+    def _getDefaultMixingProperty(self):
+        for spec in self._bElement.list_children_properties():
+            if spec.name == "alpha":
+                return spec
+
+
 class VideoUriSource(VideoSource):
 
     __gtype_name__ = "PitiviUriVideoSource"
@@ -1002,7 +997,7 @@ class TitleClip(SourceClip):
 
         if isinstance(child, GES.Source):
             if child.get_track_type() == GES.TrackType.VIDEO:
-                self._videoSource = VideoSource(child, self.timeline)
+                self._videoSource = TitleSource(child, self.timeline)
                 child.ui = self._videoSource
                 self._elements_container.pack_start(self._videoSource, True, False, 0)
                 self._videoSource.set_visible(True)


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