Gst::ChildProxy Class Reference
gstreamermm Interfaces

Interface for multi child elements. More...

`#include <gstreamermm/childproxy.h>`

Inheritance diagram for Gst::ChildProxy:
[legend]

## Public Member Functions

| ChildProxy (ChildProxy&& src) noexcept
ChildProxy& | operator= (ChildProxy&& src) noexcept
| ~ChildProxy () noexcept override
GstChildProxy* | gobj ()
| Provides access to the underlying C GObject. More...
const GstChildProxy* | gobj () const
| Provides access to the underlying C GObject. More...
guint | get_children_count () const
| Gets the number of child objects this parent contains. More...
Glib::RefPtr< Gst::Object > | get_child (const Glib::ustring& name)
| Looks up a child element by the given name. More...
Glib::RefPtr< const Gst::Object > | get_child (const Glib::ustring& name) const
| Looks up a child element by the given name. More...
Glib::RefPtr< Glib::Object > | get_child (guint index)
| Fetches a child by its number. More...
Glib::RefPtr< const Glib::Object > | get_child (guint index) const
| Fetches a child by its number. More...
bool | lookup (const Glib::ustring& name, Glib::RefPtr< Glib::Object >& target, GParamSpec*& pspec)
| Looks up which object and ParamSpec would be effected by the given name. More...
Glib::RefPtr< Gst::ChildProxy > | get_proxy_property (const Glib::ustring& name, Glib::ValueBase& value)
| Gets a single property using the Gst::ChildProxy mechanism. More...
Glib::RefPtr< const Gst::ChildProxy > | get_proxy_property (const Glib::ustring& name, Glib::ValueBase& value) const
| Gets a single property using the Gst::ChildProxy mechanism. More...
Glib::RefPtr< Gst::ChildProxy > | set_proxy_property (const Glib::ustring& name, const Glib::ValueBase& value)
| Sets a single property using the Gst::ChildProxy mechanism. More...
void | child_added (const Glib::RefPtr< Gst::Object >& child, const Glib::ustring& name)
| Emits the "child-added" signal. More...
void | child_removed (const Glib::RefPtr< Gst::Object >& child, const Glib::ustring& name)
| Emits the "child-removed" signal. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, const Glib::ustring&> | signal_child_added ()
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, const Glib::ustring&> | signal_child_removed ()
virtual Glib::RefPtr< Glib::Object > | get_child_by_name_vfunc (const Glib::ustring& name) const
| Virtual method to fetch the child by name. More...
virtual Glib::RefPtr< Glib::Object > | get_child_by_index_vfunc (guint index) const
| Virtual method to fetch the child by index. More...
virtual guint | get_children_count_vfunc () const
| Virtual method to get the children count. More...

## Static Public Member Functions

static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions

| ChildProxy ()
| You should derive from this class to use it. More...
virtual void | on_child_added (const Glib::RefPtr< Gst::Object >& object, const Glib::ustring& name)
| This is a default handler for the signal signal_child_added(). More...
virtual void | on_child_removed (const Glib::RefPtr< Gst::Object >& object, const Glib::ustring& name)
| This is a default handler for the signal signal_child_removed(). More...

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::ChildProxy > | wrap (GstChildProxy* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

Interface for multi child elements.

This interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple Gst::Pad or some kind of voice objects. Another use case are container elements like 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 get_proxy_property() and set_proxy_property().

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 Gst::ChildProxy interface.

Last reviewed on 2016-05-16 (1.8.0)

## Constructor & Destructor Documentation

## ChildProxy() [1/2]

Gst::ChildProxy::ChildProxy | ( |  | ) |

protected

You should derive from this class to use it.

## ChildProxy() [2/2]

Gst::ChildProxy::ChildProxy | ( | ChildProxy&& | src | ) |

noexcept

## ~ChildProxy()

Gst::ChildProxy::~ChildProxy | ( |  | ) |

override noexcept

## Member Function Documentation

## add_interface()

static void Gst::ChildProxy::add_interface | ( | GType | gtype_implementer | ) |

static

## child_added()

void Gst::ChildProxy::child_added | ( | const Glib::RefPtr< Gst::Object >& | child,
|  | const Glib::ustring & | name
| ) |  |

Emits the "child-added" signal.

Parameters

  child | The newly added child.
  name | The name of the new child.

## child_removed()

void Gst::ChildProxy::child_removed | ( | const Glib::RefPtr< Gst::Object >& | child,
|  | const Glib::ustring & | name
| ) |  |

Emits the "child-removed" signal.

Parameters

  child | The removed child.
  name | The name of the old child.

## get_child() [1/4]

Glib::RefPtr<Gst::Object> Gst::ChildProxy::get_child | ( | const Glib::ustring & | name | ) |

Looks up a child element by the given name.

This virtual method has a default implementation that uses Gst::Object together with Gst::Object::get_name(). If the interface is to be used with Objects, this methods needs to be overridden.

Parameters

  name | The child's name.

Returns
  The child object or `nullptr` if not found. Unref after usage.

MT safe.

## get_child() [2/4]

Glib::RefPtr<const Gst::Object> Gst::ChildProxy::get_child | ( | const Glib::ustring & | name | ) | const

Looks up a child element by the given name.

This virtual method has a default implementation that uses Gst::Object together with Gst::Object::get_name(). If the interface is to be used with Objects, this methods needs to be overridden.

Parameters

  name | The child's name.

Returns
  The child object or `nullptr` if not found. Unref after usage.

MT safe.

## get_child() [3/4]

Glib::RefPtr<Glib::Object> Gst::ChildProxy::get_child | ( | guint | index | ) |

Fetches a child by its number.

Parameters

  index | The child's position in the child list.

Returns
  The child object or `nullptr` if not found (index too high). Unref after usage.

MT safe.

## get_child() [4/4]

Glib::RefPtr<const Glib::Object> Gst::ChildProxy::get_child | ( | guint | index | ) | const

Fetches a child by its number.

Parameters

  index | The child's position in the child list.

Returns
  The child object or `nullptr` if not found (index too high). Unref after usage.

MT safe.

## get_child_by_index_vfunc()

virtual Glib::RefPtr<Glib::Object> Gst::ChildProxy::get_child_by_index_vfunc | ( | guint | index | ) | const

virtual

Virtual method to fetch the child by index.

## get_child_by_name_vfunc()

virtual Glib::RefPtr<Glib::Object> Gst::ChildProxy::get_child_by_name_vfunc | ( | const Glib::ustring & | name | ) | const

virtual

Virtual method to fetch the child by name.

## get_children_count()

guint Gst::ChildProxy::get_children_count | ( |  | ) | const

Gets the number of child objects this parent contains.

Returns
  The number of child objects

MT safe.

## get_children_count_vfunc()

virtual guint Gst::ChildProxy::get_children_count_vfunc | ( |  | ) | const

virtual

Virtual method to get the children count.

## get_proxy_property() [1/2]

Glib::RefPtr<Gst::ChildProxy> Gst::ChildProxy::get_proxy_property | ( | const Glib::ustring & | name,
|  | Glib::ValueBase & | value
| ) |  |

Gets a single property using the Gst::ChildProxy mechanism.

Parameters

  name | The property to get.
  value | An empty Glib::ValueBase in which to store the property.

Returns
  This Gst::ChildProxy so more properties can be retrieved if needed.

## get_proxy_property() [2/2]

Glib::RefPtr<const Gst::ChildProxy> Gst::ChildProxy::get_proxy_property | ( | const Glib::ustring & | name,
|  | Glib::ValueBase & | value
| ) |  | const

Gets a single property using the Gst::ChildProxy mechanism.

Parameters

  name | The property to get.
  value | An empty Glib::ValueBase in which to store the property.

Returns
  This Gst::ChildProxy so more properties can be retrieved if needed.

## get_type()

static GType Gst::ChildProxy::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

## gobj() [1/2]

GstChildProxy* Gst::ChildProxy::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

## gobj() [2/2]

const GstChildProxy* Gst::ChildProxy::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

## lookup()

bool Gst::ChildProxy::lookup | ( | const Glib::ustring & | name,
|  | Glib::RefPtr< Glib::Object > & | target,
|  | GParamSpec *& | pspec
| ) |  |

Looks up which object and ParamSpec would be effected by the given name.

MT safe.

Parameters

  name | Name of the property to look up.
  target | Pointer to a Object that takes the real object to set property on.
  pspec | Pointer to take the ParamSpec describing the property.

Returns
  `true` if target and pspec could be found. `false` otherwise. In that case the values for pspec and target are not modified. Unref target after usage. For plain GObjects target is the same as object.

## on_child_added()

virtual void Gst::ChildProxy::on_child_added | ( | const Glib::RefPtr< Gst::Object >& | object,
|  | const Glib::ustring & | name
| ) |  |

protected virtual

This is a default handler for the signal signal_child_added().

## on_child_removed()

virtual void Gst::ChildProxy::on_child_removed | ( | const Glib::RefPtr< Gst::Object >& | object,
|  | const Glib::ustring & | name
| ) |  |

protected virtual

This is a default handler for the signal signal_child_removed().

## operator=()

ChildProxy& Gst::ChildProxy::operator= | ( | ChildProxy&& | src | ) |

noexcept

## set_proxy_property()

Glib::RefPtr<Gst::ChildProxy> Gst::ChildProxy::set_proxy_property | ( | const Glib::ustring & | name,
|  | const Glib::ValueBase & | value
| ) |  |

Sets a single property using the Gst::ChildProxy mechanism.

Parameters

  name | The property to get.
  value | The Glib::ValueBase to set the property to (non-empty).

Returns
  This Gst::ChildProxy so more properties can be set.

## signal_child_added()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::Object>&,const Glib::ustring& > Gst::ChildProxy::signal_child_added | ( |  | ) |

Slot Prototype:
  `void on_my_child_added(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name)`

Will be emitted after the object was added to the child_proxy.

Parameters

  object | The Object that was added.
  name | The name of the new child.

## signal_child_removed()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::Object>&,const Glib::ustring& > Gst::ChildProxy::signal_child_removed | ( |  | ) |

Slot Prototype:
  `void on_my_child_removed(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name)`

Will be emitted after the object was removed from the child_proxy.

Parameters

  object | The Object that was removed.
  name | The name of the old child.

## Friends And Related Function Documentation

## wrap()

Glib::RefPtr< Gst::ChildProxy > wrap | ( | GstChildProxy * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.