From 6e2354bd79ad8bec69003a511d695823591190fc Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 18 Aug 2017 23:18:10 -0300 Subject: [PATCH] validate: Add an action type to ungroup containers --- ges/ges-validate.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/ges/ges-validate.c b/ges/ges-validate.c index 2d87dab..94b2e08 100644 --- a/ges/ges-validate.c +++ b/ges/ges-validate.c @@ -467,6 +467,35 @@ _container_remove_child (GstValidateScenario * scenario, } static gboolean +_ungroup (GstValidateScenario * scenario, GstValidateAction * action) +{ + GESContainer *container; + gboolean recursive = FALSE; + const gchar *container_name; + + gboolean res = TRUE; + + DECLARE_AND_GET_TIMELINE (scenario, action); + + container_name = + gst_structure_get_string (action->structure, "container-name"); + container = + GES_CONTAINER (ges_timeline_get_element (timeline, container_name)); + g_return_val_if_fail (GES_IS_CONTAINER (container), FALSE); + + gst_validate_printf (action, "Ungrouping children from container %s\n", + GES_TIMELINE_ELEMENT_NAME (container)); + + gst_structure_get_boolean (action->structure, "recursive", &recursive); + + g_list_free (ges_container_ungroup (container, recursive)); + + gst_object_unref (timeline); + + return res; +} + +static gboolean _set_control_source (GstValidateScenario * scenario, GstValidateAction * action) { GESTrackElement *element; @@ -985,6 +1014,23 @@ ges_validate_register_action_types (void) {NULL} }, "Remove a child from @container-name.", FALSE); + gst_validate_register_action_type ("ungroup-container", "ges", _ungroup, + (GstValidateActionParameter []) { + { + .name = "container-name", + .description = "The name of the GESContainer to ungroup children from", + .types = "string", + .mandatory = TRUE, + }, + { + .name = "recursive", + .description = "Wether to recurse ungrouping or not.", + .types = "boolean", + .mandatory = FALSE, + }, + {NULL} + }, "Ungroup children of @container-name.", FALSE); + gst_validate_register_action_type ("set-control-source", "ges", _set_control_source, (GstValidateActionParameter []) { { -- 2.7.4