group: incorrect layer priority after removing a child
When removing a child, the layer priority of the group is not updated.
>>> timeline = GES.Timeline.new_audio_video()
>>> layer0 = timeline.append_layer()
>>> layer1 = timeline.append_layer()
>>> asset = GES.Asset.request(GES.TestClip, None)
>>> clip0 = layer0.add_asset(asset, 0, 0, 10, GES.TrackType.AUDIO)
>>> clip1 = layer1.add_asset(asset, 20, 0, 10, GES.TrackType.AUDIO)
>>> group = GES.Group.new()
>>> group.add(clip0)
True
>>> group.add(clip1)
True
>>> group.get_layer_priority() # fine
0
>>> clip0.get_layer_priority()
0
>>> clip1.get_layer_priority()
1
>>> group.remove(clip0)
True
>>> group.get_layer_priority() # wrong, should be 1, matching clip1
0
>>> clip1.edit(timeline.get_layers(), 2, GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, clip1.start)
True
>>> group.get_layer_priority() # still wrong, should be 2, matching clip1
1
>>> clip1.get_layer_priority()
2
>>> clip1.edit(timeline.get_layers(), 0, GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, clip1.start)
False
The last operation fails because, even though clip1
is the only member of group, we can't move it to layer 0 because it would move make the layer priority of group
-1
!