static void
_child_removed (GESContainer * group, GESTimelineElement * child)
{
- GList *children;
+ GList *children, *tmp;
GstClockTime first_child_start;
gchar *signals_ids_key;
ChildSignalIds *sigids;
+ guint32 new_priority = G_MAXUINT32;
GESGroupPrivate *priv = GES_GROUP (group)->priv;
_ges_container_sort_children (group);
return;
}
+ for (tmp = children; tmp; tmp = tmp->next)
+ new_priority =
+ MIN (new_priority, ges_timeline_element_get_priority (tmp->data));
+
priv->setting_value = TRUE;
ELEMENT_SET_FLAG (group, GES_TIMELINE_ELEMENT_SET_SIMPLE);
+ if (_PRIORITY (group) != new_priority)
+ ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (group),
+ new_priority);
first_child_start = GES_TIMELINE_ELEMENT_START (children->data);
if (first_child_start > GES_TIMELINE_ELEMENT_START (group)) {
group->children_control_mode = GES_CHILDREN_IGNORE_NOTIFIES;
(GES.TestClip, 20, 10),
(GES.TestClip, 30, 10),
],
- ], groups=[group_clips])
\ No newline at end of file
+ ], groups=[group_clips])
+
+ def test_group_priority(self):
+ self.track_types = [GES.TrackType.AUDIO]
+ self.setUp()
+
+ clip0 = self.append_clip()
+ clip1 = self.append_clip(1)
+ clip1.props.start = 20
+
+ group = GES.Group.new()
+ group.add(clip0)
+ group.add(clip1)
+ self.assertEqual(group.get_layer_priority(), 0)
+ self.assertTimelineTopology([
+ [
+ (GES.TestClip, 0, 10),
+ ],
+ [
+ (GES.TestClip, 20, 10),
+ ]
+ ], groups=[(clip0, clip1)])
+ group.remove(clip0)
+ self.assertEqual(group.get_layer_priority(), 1)
+
+ clip1.edit(self.timeline.get_layers(), 2, GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, clip1.start)
+ self.assertTimelineTopology([
+ [
+ (GES.TestClip, 0, 10),
+ ],
+ [ ],
+ [
+ (GES.TestClip, 20, 10),
+ ]
+ ], groups=[(clip1,)])
+
+ self.assertEqual(group.get_layer_priority(), 2)
+ self.assertTrue(clip1.edit(self.timeline.get_layers(), 0, GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, clip1.start))
+
+ self.assertTimelineTopology([
+ [
+ (GES.TestClip, 0, 10),
+ (GES.TestClip, 20, 10),
+ ],
+ [ ],
+ [ ]
+ ], groups=[(clip1,)])