![]() |
![]() |
![]() |
Buzztard Bt-Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libbtcore/core.h> BtChildProxy; GObject * bt_child_proxy_get_child_by_name (BtChildProxy *parent
,const gchar *name
); GObject * bt_child_proxy_get_child_by_index (BtChildProxy *parent
,guint index
); guint bt_child_proxy_get_children_count (BtChildProxy *parent
); gboolean bt_child_proxy_lookup (GObject *object
,const gchar *name
,GObject **target
,GParamSpec **pspec
); void bt_child_proxy_get_property (GObject *object
,const gchar *name
,GValue *value
); void bt_child_proxy_get_valist (GObject *object
,const gchar *first_property_name
,va_list var_args
); void bt_child_proxy_get (gpointer object
,const gchar *first_property_name
,...
); void bt_child_proxy_set_property (GObject *object
,const gchar *name
,const GValue *value
); void bt_child_proxy_set_valist (GObject *object
,const gchar *first_property_name
,va_list var_args
); void bt_child_proxy_set (gpointer object
,const gchar *first_property_name
,...
);
This interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple GstPad or some kind of voice objects. Another use case are container elements like GstBin. 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 bt_child_proxy_get()
and bt_child_proxy_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 BtChildProxy interface.
GObject * bt_child_proxy_get_child_by_name (BtChildProxy *parent
,const gchar *name
);
Looks up a child element by the given name.
|
the parent object to get the child from |
|
the childs name |
Returns : |
the child object or NULL if not found. Unref after usage.
MT safe.
|
GObject * bt_child_proxy_get_child_by_index (BtChildProxy *parent
,guint index
);
Fetches a child by its number.
|
the parent object to get the child from |
|
the childs position in the child list |
Returns : |
the child object or NULL if not found (index too high). Unref
after usage.
MT safe.
|
guint bt_child_proxy_get_children_count (BtChildProxy *parent
);
Gets the number of child objects this parent contains.
|
the parent object |
Returns : |
the number of child objects MT safe. |
gboolean bt_child_proxy_lookup (GObject *object
,const gchar *name
,GObject **target
,GParamSpec **pspec
);
Looks up which object and GParamSpec would be effected by the given name
.
|
object to lookup the property in |
|
name of the property to look up |
|
pointer to a GObject that takes the real object to set property on |
|
pointer to take the GParamSpec 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.
MT safe.
|
void bt_child_proxy_get_property (GObject *object
,const gchar *name
,GValue *value
);
Gets a single property using the BtChildProxy mechanism.
You are responsible for for freeing it by calling g_value_unset()
|
object to query |
|
name of the property |
|
a GValue that should take the result. |
void bt_child_proxy_get_valist (GObject *object
,const gchar *first_property_name
,va_list var_args
);
Gets properties of the parent object and its children.
|
the object to query |
|
name of the first property to get |
|
return location for the first property, followed optionally by more name/return location pairs, followed by NULL |
void bt_child_proxy_get (gpointer object
,const gchar *first_property_name
,...
);
Gets properties of the parent object and its children.
|
the parent object |
|
name of the first property to get |
|
return location for the first property, followed optionally by more name/return location pairs, followed by NULL |
void bt_child_proxy_set_property (GObject *object
,const gchar *name
,const GValue *value
);
Sets a single property using the BtChildProxy mechanism.
|
the parent object |
|
name of the property to set |
|
new GValue for the property |
void bt_child_proxy_set_valist (GObject *object
,const gchar *first_property_name
,va_list var_args
);
Sets properties of the parent object and its children.
|
the parent object |
|
name of the first property to set |
|
value for the first property, followed optionally by more name/value pairs, followed by NULL |
void bt_child_proxy_set (gpointer object
,const gchar *first_property_name
,...
);
Sets properties of the parent object and its children.
|
the parent object |
|
name of the first property to set |
|
value for the first property, followed optionally by more name/value pairs, followed by NULL |