本文整理匯總了Python中pitivi.timeline.track.Track.updateTransitions方法的典型用法代碼示例。如果您正苦於以下問題:Python Track.updateTransitions方法的具體用法?Python Track.updateTransitions怎麽用?Python Track.updateTransitions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pitivi.timeline.track.Track
的用法示例。
在下文中一共展示了Track.updateTransitions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestAlpha
# 需要導入模塊: from pitivi.timeline.track import Track [as 別名]
# 或者: from pitivi.timeline.track.Track import updateTransitions [as 別名]
#.........這裏部分代碼省略.........
self.failUnlessAlphaIsSet()
# two alpha < 1.0 keyframes
set_one_keyframe(track_object2, 0.5)
self.failUnlessAlphaIsSet()
# one alpha < 1.0 keyframe
set_one_keyframe(track_object1, 1.0)
self.failUnlessAlphaIsSet()
# no alpha < 1.0 keyframes
set_one_keyframe(track_object2, 1.0)
self.failUnlessAlphaIsNotSet()
def testKeyframesOnSameObject(self):
for track_obj in self.track1.track_objects:
set_all_keyframes(track_obj, 1.0)
self.failUnlessAlphaIsNotSet()
track_object1 = self.track1.track_objects[0]
interpolator1 = track_object1.getInterpolator("alpha")
keyframe1 = interpolator1.newKeyframe(1 * gst.SECOND, 0.8)
self.failUnlessAlphaIsSet()
keyframe2 = interpolator1.newKeyframe(2 * gst.SECOND, 0.5)
self.failUnlessAlphaIsSet()
interpolator1.setKeyframeValue(keyframe1, 1.0)
self.failUnlessAlphaIsSet()
interpolator1.removeKeyframe(keyframe2)
self.failUnlessAlphaIsNotSet()
def testRemoveTrackObjects(self):
for track_obj in self.track1.track_objects:
set_all_keyframes(track_obj, 1.0)
self.failUnlessAlphaIsNotSet()
track_object1 = self.track1.track_objects[0]
track_object2 = self.track1.track_objects[1]
# set one keyframe below 1.0
set_one_keyframe(track_object1, 0.8)
self.failUnlessAlphaIsSet()
# track_object2 has no alpha < 1.0 keyframes, removing it shouldn't
# trigger an alpha change
self.track1.removeTrackObject(track_object2)
self.failUnlessAlphaIsSet()
# track_object1 does have an alpha < 1.0 keyframe, removing it should
# trigger an alpha change
self.track1.removeTrackObject(track_object1)
self.failUnlessAlphaIsNotSet()
def testRequestPads(self):
# requesting a new pad should never trigger an alpha change
template = gst.PadTemplate("sink_%u", gst.PAD_SINK, gst.PAD_REQUEST,
gst.Caps("video/x-raw-yuv;video/x-raw-rgb"))
for track_obj in self.track1.track_objects:
set_all_keyframes(track_obj, 1.0)
# when unset, should remain unset
self.failUnlessAlphaIsNotSet()
test_pad1 = self.svmbin.do_request_new_pad(template)
self.failUnlessAlphaIsNotSet()
obj = self.track1.track_objects[0]
set_one_keyframe(obj, 0.8)
# when set, should remain set
self.failUnlessAlphaIsSet()
test_pad2 = self.svmbin.do_request_new_pad(template)
self.failUnlessAlphaIsSet()
def testTransitions(self):
for track_obj in self.track1.track_objects:
set_all_keyframes(track_obj, 1.0)
self.failUnlessAlphaIsNotSet()
track_object1 = self.track1.track_objects[0]
track_object2 = self.track1.track_objects[1]
track_object1.start = 0
track_object2.start = 10 * gst.SECOND
old_priority = track_object2.priority
track_object2.priority = track_object1.priority
self.track1.updateTransitions()
self.failUnlessAlphaIsSet()
track_object2.priority = old_priority
self.track1.updateTransitions()
self.failUnlessAlphaIsNotSet()