timeline-element: use default ->list_children_properties

Stop overwriting the ->list_children_properties virtual method in
subclasses because the timeline element class handles everything itself
anyway.
Note that containers already automatically add the children properties of
their child elements in ges_container_add.
This commit is contained in:
Henry Wilkes 2020-02-21 09:23:34 +00:00 committed by Thibault Saunier
parent b76e7db461
commit bbff08f078
3 changed files with 10 additions and 28 deletions

View file

@ -271,20 +271,6 @@ _ges_container_remove_child_properties (GESContainer * container,
g_free (child_props);
}
static GParamSpec **
_list_children_properties (GESTimelineElement * self, guint * n_properties)
{
GList *tmp;
for (tmp = GES_CONTAINER_CHILDREN (self); tmp; tmp = tmp->next)
_ges_container_add_child_properties (GES_CONTAINER (self), tmp->data);
return
GES_TIMELINE_ELEMENT_CLASS
(ges_container_parent_class)->list_children_properties (self,
n_properties);
}
static gboolean
_lookup_child (GESTimelineElement * self, const gchar * prop_name,
GObject ** child, GParamSpec ** pspec)
@ -496,7 +482,6 @@ ges_container_class_init (GESContainerClass * klass)
element_class->set_start = _set_start;
element_class->set_duration = _set_duration;
element_class->set_inpoint = _set_inpoint;
element_class->list_children_properties = _list_children_properties;
element_class->lookup_child = _lookup_child;
element_class->get_track_types = _get_track_types;
element_class->paste = _paste;

View file

@ -202,6 +202,16 @@ struct _GESTimelineElement
* g_object_set_property().
* @get_layer_priority: Get the #GESLayer:priority of the layer that this
* element is part of.
* @list_children_properties: List the children properties that have been
* registered for the element. The default implementation is able to fetch
* all of these, so should be sufficient. If you overwrite this, you
* should still call the default implementation to get the full list, and
* then edit its content.
* @lookup_child: Find @child, and its registered child property @pspec,
* corresponding to the child property specified by @prop_name. The
* default implementation will search for the first child that matches. If
* you overwrite this, you will likely still want to call the default
* vmethod, which has access to the registered parameter specifications.
*
* The #GESTimelineElement base class. Subclasses should override at least
* @set_start @set_inpoint @set_duration @ripple @ripple_end @roll_start

View file

@ -101,9 +101,6 @@ static gboolean _set_duration (GESTimelineElement * element,
static gboolean _set_priority (GESTimelineElement * element, guint32 priority);
GESTrackType _get_track_types (GESTimelineElement * object);
static GParamSpec **default_list_children_properties (GESTrackElement * object,
guint * n_properties);
static void
_update_control_bindings (GESTimelineElement * element, GstClockTime inpoint,
GstClockTime duration);
@ -348,7 +345,6 @@ ges_track_element_class_init (GESTrackElementClass * klass)
element_class->get_layer_priority = _get_layer_priority;
klass->create_gnl_object = ges_track_element_create_gnl_object_func;
klass->list_children_properties = default_list_children_properties;
klass->lookup_child = _lookup_child;
}
@ -1229,15 +1225,6 @@ ges_track_element_get_child_property (GESTrackElement * object,
property_name, value);
}
static GParamSpec **
default_list_children_properties (GESTrackElement * object,
guint * n_properties)
{
return
GES_TIMELINE_ELEMENT_GET_CLASS (object)->list_children_properties
(GES_TIMELINE_ELEMENT (object), n_properties);
}
void
ges_track_element_copy_properties (GESTimelineElement * element,
GESTimelineElement * elementcopy)