[pitivi] Map controls to TimelineLayer



commit 58c9810109c5697fd7f6a22369c8a456cbe3d305
Author: Paul Lange <palango gmx de>
Date:   Thu May 10 15:24:50 2012 -0500

    Map controls to TimelineLayer

 pitivi/timeline/layercontrols.py |   14 ++++++++------
 pitivi/timeline/timeline.py      |    5 ++---
 2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/timeline/layercontrols.py b/pitivi/timeline/layercontrols.py
index f10b516..6d2995c 100644
--- a/pitivi/timeline/layercontrols.py
+++ b/pitivi/timeline/layercontrols.py
@@ -39,10 +39,12 @@ class BaseLayerControl(gtk.Table, Loggable):
 
     __gtype_name__ = 'LayerControl'
 
-    def __init__(self, layer_type):
+    def __init__(self, layer, layer_type):
         gtk.Table.__init__(self, rows=2, columns=2)
         Loggable.__init__(self)
 
+        self._layer = layer
+
         self.set_row_spacings(3)
         self.set_col_spacings(3)
 
@@ -99,8 +101,8 @@ class VideoLayerControl(BaseLayerControl):
 
     __gtype_name__ = 'VideoLayerControl'
 
-    def __init__(self):
-        BaseLayerControl.__init__(self, "video")
+    def __init__(self, layer):
+        BaseLayerControl.__init__(self, layer, "video")
 
         opacity = gtk.Label(_("Opacity:"))
 
@@ -122,15 +124,15 @@ class AudioLayerControl(BaseLayerControl):
 
     __gtype_name__ = 'AudioLayerControl'
 
-    def __init__(self):
-        BaseLayerControl.__init__(self, "audio")
+    def __init__(self, layer):
+        BaseLayerControl.__init__(self, layer, "audio")
 
         volume = gtk.Label(_("Vol:"))
         self.volume_button = gtk.VolumeButton()
 
         panning = gtk.Label(_("Pan:"))
         # Volume scale
-        panning_adjust = gtk.Adjustment(value=50, lower=-100, upper=100, step_incr=5, page_incr=10)
+        panning_adjust = gtk.Adjustment(value=0, lower=-100, upper=100, step_incr=5, page_incr=10)
         self.panning_scale = gtk.HScale(panning_adjust)
         self.panning_scale.set_value_pos(gtk.POS_LEFT)
         self.panning_scale.set_digits(0)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 3c52a72..26dea73 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -490,7 +490,6 @@ class TimelineControls(gtk.VBox, Loggable):
         self.debug("Setting timeline %s", timeline)
 
         # remove old layer controls
-        print self._track_controls
         for layer in self._track_controls.copy():
             self._layerRemovedCb(None, layer)
 
@@ -511,8 +510,8 @@ class TimelineControls(gtk.VBox, Loggable):
     timeline = property(getTimeline, setTimeline, None, "The timeline property")
 
     def _layerAddedCb(self, timeline, layer):
-        video_control = VideoLayerControl()
-        audio_control = AudioLayerControl()
+        video_control = VideoLayerControl(layer)
+        audio_control = AudioLayerControl(layer)
 
         map = {"audio": audio_control, "video": video_control}
         self._track_controls[layer] = map



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