[pitivi] Return correct relative height for video
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Return correct relative height for video
- Date: Sat, 21 Jul 2012 19:58:06 +0000 (UTC)
commit c7f752ff436978744df794e5c2b0839e86dea020
Author: Paul Lange <palango gmx de>
Date: Thu May 17 18:33:19 2012 -0500
Return correct relative height for video
pitivi/timeline/timeline.py | 10 ++++++++++
pitivi/timeline/track.py | 5 ++++-
2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index dbe4d54..801d4c7 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -564,6 +564,16 @@ class TimelineControls(gtk.VBox, Loggable):
return 0
+ # maybe do a list with values
+ def getHeightOfVideo(self):
+ y = 0
+ for child in self.get_children():
+ if isinstance(child, VideoLayerControl):
+ y += child.getHeight()
+ y += LAYER_SPACING
+
+ return y
+
class InfoStub(gtk.HBox, Loggable):
"""
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index 5bffe89..500ac75 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -578,10 +578,13 @@ class TrackObject(View, goocanvas.Group, Zoomable, Loggable):
layer = self.element.get_timeline_object().get_layer()
track_type = self.element.get_track().props.track_type
- # calculate correct y-position, highest priority on top
+ # get y position for layer
y = self.app.gui.timeline_ui._controls.getYOfLayer(track_type, layer)
#priority = self.element.get_timeline_object().get_layer().get_priority()
#y = (self.height + LAYER_SPACING) * priority
+ # get relative y for audio
+ if track_type == ges.TRACK_TYPE_AUDIO:
+ y -= self.app.gui.timeline_ui._controls.getHeightOfVideo()
print y
# Setting new position
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]