[pitivi] track.py: add getVisibleKeyframes(), updateMedia{Start, Stop} interpolator methods
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] track.py: add getVisibleKeyframes(), updateMedia{Start, Stop} interpolator methods
- Date: Fri, 22 Jan 2010 18:03:51 +0000 (UTC)
commit f2a58274df3ebe48fa9bb55c5d00fe7764205560
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Fri Dec 18 12:55:38 2009 -0800
track.py: add getVisibleKeyframes(), updateMedia{Start,Stop} interpolator methods
pitivi/timeline/track.py | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index c4b0203..d1e3310 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -23,7 +23,7 @@ import gst
from pitivi.signalinterface import Signallable
from pitivi.utils import get_controllable_properties, getPreviousObject, \
- getNextObject, start_insort_right
+ getNextObject, start_insort_right, between
from pitivi.log.loggable import Loggable
from pitivi.stream import VideoStream, AudioStream
from pitivi.factories.test import VideoTestSourceFactory, \
@@ -256,6 +256,24 @@ class Interpolator(Signallable, Loggable):
for kf in sorted(self._keyframes):
yield kf
+ def getVisibleKeyframes(self):
+ """Return start, end and any keyframes included in between"""
+ yield self.start
+ start_time = self.start.time
+ end_time = self.end.time
+ for kf in sorted(self._keyframes):
+ if between(start_time, kf.time, end_time):
+ yield kf
+ yield self.end
+
+ def updateMediaStart(self, start):
+ self._keyframeTimeValueChanged(self.start, start, self.start.value)
+ self.start.setObjectTime(start)
+
+ def updateMediaStop(self, stop):
+ self._keyframeTimeValueChanged(self.end, stop, self.end.value)
+ self.end.setObjectTime(stop)
+
keyframes = property(getKeyframes)
class TrackObject(Signallable, Loggable):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]