:right-sidebar: True ChildProxy =================================================================== .. currentmodule:: gi.repository.Gst .. class:: ChildProxy(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Gst.Bin`, :class:`~gi.repository.Gst.Pipeline` This interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple :obj:`~gi.repository.Gst.Pad` or some kind of voice objects. Another use case are container elements like :obj:`~gi.repository.Gst.Bin`\. The element implementing the interface acts as a parent for those child objects. By implementing this interface the child properties can be accessed from the parent element by using :func:`~gi.repository.Gst.ChildProxy.get` and :func:`~gi.repository.Gst.ChildProxy.set`. Property names are written as ``child-name::property-name``\. The whole naming scheme is recursive. Thus ``child1::child2::property`` is valid too, if ``child1`` and ``child2`` implement the :obj:`~gi.repository.Gst.ChildProxy` interface. Methods ------- .. rst-class:: interim-class .. class:: ChildProxy :no-index: .. method:: child_added(child: ~gi.repository.GObject.Object, name: str) -> None Emits the :obj:`~gi.repository.Gst.ChildProxy`\::child-added signal. :param child: the newly added child :param name: the name of the new child .. method:: child_removed(child: ~gi.repository.GObject.Object, name: str) -> None Emits the :obj:`~gi.repository.Gst.ChildProxy`\::child-removed signal. :param child: the removed child :param name: the name of the old child .. method:: get_child_by_index(index: int) -> ~gi.repository.GObject.Object | None Fetches a child by its number. :param index: the child's position in the child list .. method:: get_child_by_name(name: str) -> ~gi.repository.GObject.Object | None Looks up a child element by the given name. This virtual method has a default implementation that uses :obj:`~gi.repository.Gst.Object` together with :func:`~gi.repository.Gst.Object.get_name`. If the interface is to be used with :obj:`~gi.repository.GObject.Object`\, this methods needs to be overridden. :param name: the child's name .. method:: get_child_by_name_recurse(name: str) -> ~gi.repository.GObject.Object | None Looks up a child element by the given full-path name. Similar to :func:`~gi.repository.Gst.ChildProxy.get_child_by_name`, this method searches and returns a child given a name. The difference is that this method allows a hierarchical path in the form of child1::child2::child3. In the later example this method would return a reference to child3, if found. The name should be made of element names only and should not contain any property names. .. versionadded:: 1.22 :param name: the full-path child's name .. method:: get_children_count() -> int Gets the number of child objects this parent contains. .. method:: get_property(name: str) -> ~gi.repository.GObject.Value Gets a single property using the GstChildProxy mechanism. You are responsible for freeing it by calling :func:`~gi.repository.GObject.Value.unset` :param name: name of the property .. method:: lookup(name: str) -> ~typing.Tuple[bool, ~gi.repository.GObject.Object, ~gi.overrides.GObject.ParamSpec] Looks up which object and :obj:`~gi.repository.GObject.ParamSpec` would be effected by the given ``name``\. :param name: name of the property to look up .. method:: set_property(name: str, value: ~gi.repository.GObject.Value) -> None Sets a single property using the GstChildProxy mechanism. :param name: name of the property to set :param value: new :obj:`~gi.repository.GObject.Value` for the property Signals ------- .. rst-class:: interim-class .. class:: ChildProxy.signals :no-index: .. method:: child_added(object: ~gi.repository.GObject.Object, name: str) -> None The type of the None singleton. :param object: the :obj:`~gi.repository.GObject.Object` that was added :param name: the name of the new child .. method:: child_removed(object: ~gi.repository.GObject.Object, name: str) -> None The type of the None singleton. :param object: the :obj:`~gi.repository.GObject.Object` that was removed :param name: the name of the old child Virtual Methods --------------- .. rst-class:: interim-class .. class:: ChildProxy :no-index: .. method:: do_child_added(child: ~gi.repository.GObject.Object, name: str) -> None Emits the :obj:`~gi.repository.Gst.ChildProxy`\::child-added signal. :param child: the newly added child :param name: the name of the new child .. method:: do_child_removed(child: ~gi.repository.GObject.Object, name: str) -> None Emits the :obj:`~gi.repository.Gst.ChildProxy`\::child-removed signal. :param child: the removed child :param name: the name of the old child .. method:: do_get_child_by_index(index: int) -> ~gi.repository.GObject.Object | None Fetches a child by its number. :param index: the child's position in the child list .. method:: do_get_child_by_name(name: str) -> ~gi.repository.GObject.Object | None Looks up a child element by the given name. This virtual method has a default implementation that uses :obj:`~gi.repository.Gst.Object` together with :func:`~gi.repository.Gst.Object.get_name`. If the interface is to be used with :obj:`~gi.repository.GObject.Object`\, this methods needs to be overridden. :param name: the child's name .. method:: do_get_children_count() -> int Gets the number of child objects this parent contains.