[pitivi/ges: 75/287] ui: Fixup, do not used method that do no exist in GES
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 75/287] ui: Fixup, do not used method that do no exist in GES
- Date: Thu, 15 Mar 2012 16:32:08 +0000 (UTC)
commit 61edee05c92bbd8aefd0a3804bc4139b2e947b4d
Author: Thibault Saunier <thibault saunier collabora com>
Date: Tue Dec 6 19:57:31 2011 -0300
ui: Fixup, do not used method that do no exist in GES
track.get_previous_track_object
track.get_next_track_object
track.get_track_objects_at_position
Do not exist in GES
pitivi/ui/timeline.py | 28 +++++++++++++---------------
pitivi/ui/trackobject.py | 24 ++++++++++++++++++++++--
2 files changed, 35 insertions(+), 17 deletions(-)
---
diff --git a/pitivi/ui/timeline.py b/pitivi/ui/timeline.py
index ddd5e88..ed8f0f3 100644
--- a/pitivi/ui/timeline.py
+++ b/pitivi/ui/timeline.py
@@ -794,23 +794,21 @@ class Timeline(gtk.Table, Loggable, Zoomable):
self.timeline.enable_update(False)
tl_objs_dict = {}
for track in self.timeline.get_tracks():
- tck_objects = \
- track.get_track_objects_at_position(long(self._position))
- for tck_obj in tck_objects:
- if isinstance(tck_obj, ges.TrackAudioTestSource) or \
- isinstance(tck_obj, ges.TrackVideoTestSource):
- continue
- obj = tck_obj.get_timeline_object()
- if obj in tl_objs_dict.keys():
- tl_objs_dict[obj] = "both"
- elif tck_obj.get_track().get_caps().to_string() == "audio/x-raw-int; audio/x-raw-float":
- tl_objs_dict[obj] = "audio"
- else:
- tl_objs_dict[obj] = "video"
+ for tck_obj in track.get_objects():
+ start = tck_obj.props.start
+ end = start + tck_obj.props.duration
+ if start < self._position and end > self._position:
+ obj = tck_obj.get_timeline_object()
+ if obj in tl_objs_dict.keys():
+ tl_objs_dict[obj] = "both"
+ elif tck_obj.get_track().get_caps().to_string() == "audio/x-raw-int; audio/x-raw-float":
+ tl_objs_dict[obj] = "audio"
+ else:
+ tl_objs_dict[obj] = "video"
+
for src in tl_objs_dict:
src.split(self._position)
- self.timeline.enable_update(True)
- # work-around for 603149
+ self.timeline.enable_update(True)
def keyframe(self, action):
timeline_position = self._position
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 72bee54..17789b5 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -3,6 +3,7 @@ import gtk
import os.path
import pango
import cairo
+import ges
import pitivi.configure as configure
from gettext import gettext as _
@@ -87,6 +88,25 @@ def text_size(text):
return x2 - x1, y2 - y1
+def get_previous_track_source(track, tckobj):
+ tckobjs = track.get_objects()
+ i = tckobjs.index(tckobj) - 1
+ while (i > 0):
+ if(isinstance(tckobjs[i], ges.TrackSource)):
+ return tckobjs[i]
+ i -= 1
+
+
+def get_next_track_source(track, tckobj):
+ tckobjs = track.get_objects()
+ i = tckobjs.index(tckobj) + 1
+ while(i < len(tckobjs)):
+ if(isinstance(tckobjs[i], ges.TrackSource)):
+ return tckobjs[i]
+ i += 1
+ return None
+
+
class TimelineController(controller.Controller):
_cursor = ARROW
@@ -147,7 +167,7 @@ class TimelineController(controller.Controller):
self._view.get_canvas().regroupTracks()
return
- prev = track.get_previous_track_object(self._view.element)
+ prev = get_previous_track_source(track, self._view.element)
if prev != None:
prev_end = prev.get_start() + prev.get_duration()
@@ -160,7 +180,7 @@ class TimelineController(controller.Controller):
elif self._view.snapped_before:
self._view.snapped_before = False
- next = track.get_next_track_object(self._view.element)
+ next = get_next_track_source(track, self._view.element)
if next != None:
offset = Zoomable.nsToPixel(next.get_start())
dur_offset = Zoomable.nsToPixel(duration)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]