group: incorrect `height`
The height
of groups is being incorrectly set, and isn't being updated when the maximum layer priority of the sub group changes.
>>> timeline = GES.Timeline.new_audio_video()
>>> layer0 = timeline.append_layer()
>>> layer1 = timeline.append_layer()
>>> layer2 = timeline.append_layer()
>>> asset = GES.Asset.request(GES.TestClip, None)
>>> clip0 = layer0.add_asset(asset, 0, 0, 10, GES.TrackType.AUDIO)
>>> sub_group = GES.Group.new()
>>> sub_group.add(clip0)
True
>>> sub_group.get_layer_priority() # fine
0
>>> sub_group.height # fine
1
>>> group = GES.Group.new()
>>> group.add(sub_group)
True
>>> group.get_layer_priority() # fine
0
>>> group.height # wrong, should be 1 since we only span one layer
2
>>> clip2 = layer2.add_asset(asset, 0, 0, 10, GES.TrackType.AUDIO)
>>> sub_group.add(clip2)
True
>>> sub_group.height # correct
3
>>> group.height # wrong, the height should be 3, because we span 3 layers
2
The first problem comes from _update_our_values
, where the maximum layer of the sub-group is calculated using priority + height
, rather than priority + height - 1
. The second is because the sub-group does not notify its parent group that its maximum layer priority has increased.