本文整理汇总了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()