container: setting `start` and `duration` of child not failing when it should
A source clip can end up with a child whose start
does not match the clip's start
. In a similar way, we can get a clip to completely overlap another clip in the same layer.
>>> timeline = GES.Timeline.new_audio_video()
>>> layer = timeline.append_layer()
>>> asset = GES.Asset.request(GES.TestClip, None)
>>> clip0 = layer.add_asset(asset, 0, 0, 10, GES.TrackType.VIDEO)
>>> clip1 = layer.add_asset(asset, 20, 0, 10, GES.TrackType.VIDEO)
>>> effect = GES.Effect.new("agingtv")
>>> clip0.add(effect)
True
>>> effect.set_start(20)
True
>>> effect.start
20
>>> clip0.start # not the same
0
>>> effect.set_duration (50)
True
>>> effect.duration
50
>>> clip0.duration # not the same
10
This is because when the track element has its start
set, it triggers set_start
on its parent, but in this case set_start
will fail. I'm not sure what happens in the duration
case.
A similar problem would occur if we set the start
of a non-source clip, like an overlay clip, that is part of a group, in a way that would break the timeline configuration if the whole group moved in the same way.
>>> timeline = GES.Timeline.new_audio_video()
>>> layer = timeline.append_layer()
>>> asset = GES.Asset.request(GES.TestClip, None)
>>> clip0 = layer.add_asset(asset, 0, 0, 10, GES.TrackType.AUDIO)
>>> clip1 = layer.add_asset(asset, 20, 0, 10, GES.TrackType.AUDIO)
>>> asset = GES.Asset.request(GES.TextOverlayClip, None)
>>> clip2 = layer.add_asset(asset, 20, 0, 10, GES.TrackType.AUDIO)
>>> group.add(clip0)
True
>>> group.add(clip2)
True
>>> clip2.set_start(40) # this should move the whole group forward by 20, which would move clip0 to 20
True
>>> clip2.start
40
>>> clip0.start # clip0 did not move with us
0
>>> group.start
0
>>> group.duration # as a result, we have an incorrect duration
30
We should really move the ges_timeline_move_object_simple
used in GESSource
's ->set_start
method, and place it in ges_timeline_element_set_start
, for all element types. This way, when setting the times, the method can fail if it knows that its toplevel can not move, before we set the property on the child. We should do a similar thing for duration
as well.