[pitivi: 2/4] timeline/track: keyframe list is stored sorted in place.
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 2/4] timeline/track: keyframe list is stored sorted in place.
- Date: Mon, 6 Sep 2010 09:03:29 +0000 (UTC)
commit 25868d6796b198b36edf11eaf5169f435788f5ad
Author: Luis de Bethencourt <luis debethencourt com>
Date: Fri Sep 3 17:20:24 2010 +0200
timeline/track: keyframe list is stored sorted in place.
pitivi/timeline/track.py | 8 +++-----
pitivi/ui/timeline.py | 1 -
2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index 9ec185f..d56ba23 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -209,6 +209,7 @@ class Interpolator(Signallable, Loggable):
gst.TIME_ARGS(keyframe.time), keyframe.value, keyframe.mode)
self._keyframes.append(keyframe)
+ self._keyframes.sort()
self._controller.set(self._property.name, keyframe.time, keyframe.value)
@@ -254,17 +255,14 @@ class Interpolator(Signallable, Loggable):
self.emit("keyframe-moved", kf, old_value)
def getKeyframes(self):
- # TODO: This could be more efficient. We are re-sorting all the keyframes
- # every time we iterate over them. One thought would be to keep the
- # list sorted in-place as keyframes are added and moved.
yield self.start
- for kf in sorted(self._keyframes):
+ for kf in self._keyframes:
yield kf
yield self.end
def getInteriorKeyframes(self):
"""Same as above but does not include start, or end points"""
- for kf in sorted(self._keyframes):
+ for kf in self._keyframes:
yield kf
def getVisibleKeyframes(self):
diff --git a/pitivi/ui/timeline.py b/pitivi/ui/timeline.py
index 546eb01..2911d0c 100644
--- a/pitivi/ui/timeline.py
+++ b/pitivi/ui/timeline.py
@@ -601,7 +601,6 @@ class Timeline(gtk.Table, Loggable, Zoomable):
self.ungroup_action.set_sensitive(ungroup)
self.split_action.set_sensitive(split)
self.keyframe_action.set_sensitive(keyframe)
- print self.keyframe_action.get_sensitive()
## ToolBar callbacks
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]