Spa Pod (Plain Old Data)

digraph inheritance { rankdir=LR; GBoxed -> WpSpaPod; GBoxed -> WpSpaPodBuilder; GBoxed -> WpSpaPodParser; }

struct WpSpaPod
struct WpSpaPodBuilder
struct WpSpaPodParser
WpSpaPod *wp_spa_pod_ref(WpSpaPod *self)

Increases the reference count of a spa pod object.

Parameters
  • self – a spa pod object

Returns

(transfer full): self with an additional reference count on it

void wp_spa_pod_unref(WpSpaPod *self)

Decreases the reference count on self and frees it when the ref count reaches zero.

Parameters
  • self – (transfer full): a spa pod object

WpSpaPod *wp_spa_pod_new_wrap(struct spa_pod *pod)

Constructs a new WpSpaPod that wraps the given spa_pod.

Parameters
  • pod – a spa_pod

Returns

a new WpSpaPod that references the data in pod. pod is not copied, so it needs to stay alive. The returned WpSpaPod can be modified by using the setter functions, in which case pod will be modified underneath.

WpSpaPod *wp_spa_pod_new_wrap_const(const struct spa_pod *pod)

Constructs a new immutable WpSpaPod that wraps the given spa_pod.

Parameters
  • pod – a constant spa_pod

Returns

a new WpSpaPod that references the data in pod. pod is not copied, so it needs to stay alive. The returned WpSpaPod cannot be modified, unless it’s copied first.

const struct spa_pod *wp_spa_pod_get_spa_pod(const WpSpaPod *self)

Converts a WpSpaPod pointer to a struct spa_pod one, for use with native pipewire & spa functions. The returned pointer is owned by WpSpaPod and may not be modified or freed.

Parameters
  • self – a spa pod object

Returns

a const pointer to the underlying spa_pod structure

WpSpaType wp_spa_pod_get_spa_type(WpSpaPod *self)

Gets the SPA type of the spa pod.

If the pod is an object or pointer, this will return the derived object/pointer type directly. If the pod is an object property or a control, this will return the type of the contained value.

Parameters
  • self – a spa pod

Returns

(transfer none): the type of the spa pod

WpSpaIdValue wp_spa_pod_get_choice_type(WpSpaPod *self)

If the pod is a Choice, this gets the choice type (Range, Step, Enum, …)

Parameters
  • self – a choice pod

Returns

the choice type of the choice pod

WpSpaPod *wp_spa_pod_copy(WpSpaPod *other)

Copies a spa pod object.

Parameters
  • other – a spa pod object

Returns

(transfer full): The newly copied spa pod

gboolean wp_spa_pod_is_unique_owner(WpSpaPod *self)

Checks if the pod is the unique owner of its data or not.

Parameters
  • self – a spa pod object

Returns

TRUE if the pod owns the data, FALSE otherwise.

WpSpaPod *wp_spa_pod_ensure_unique_owner(WpSpaPod *self)

If self is not uniquely owned already, then it is unrefed and a copy of it is returned instead. You should always consider self as unsafe to use after this call and you should use the returned object instead.

Parameters
  • self – (transfer full): a spa pod object

Returns

(transfer full): the uniquely owned spa pod object which may or may not be the same as self.

WpSpaPod *wp_spa_pod_new_none(void)

Creates a spa pod of type None.

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_boolean(gboolean value)

Creates a spa pod of type boolean.

Parameters
  • value – the boolean value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_id(guint32 value)

Creates a spa pod of type Id.

Parameters
  • value – the Id value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_int(gint32 value)

Creates a spa pod of type int.

Parameters
  • value – the int value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_long(gint64 value)

Creates a spa pod of type long.

Parameters
  • value – the long value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_float(float value)

Creates a spa pod of type float.

Parameters
  • value – the float value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_double(double value)

Creates a spa pod of type double.

Parameters
  • value – the double value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_string(const char *value)

Creates a spa pod of type string.

Parameters
  • value – the string value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_bytes(gconstpointer value, guint32 len)

Creates a spa pod of type bytes.

Parameters
  • value – the bytes value

  • len – the length of the bytes value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_pointer(const char *type_name, gconstpointer value)

Creates a spa pod of type pointer.

Parameters
  • type_name – the name of the type of the pointer

  • value – the pointer value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_fd(gint64 value)

Creates a spa pod of type Fd.

Parameters
  • value – the Fd value

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_rectangle(guint32 width, guint32 height)

Creates a spa pod of type rectangle.

Parameters
  • width – the width value of the rectangle

  • height – the height value of the rectangle

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_fraction(guint32 num, guint32 denom)

Creates a spa pod of type fraction.

Parameters
  • num – the numerator value of the fraction

  • denom – the denominator value of the fraction

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_choice(const char *choice_type, ...)

Creates a spa pod of type choice.

Parameters
  • choice_type – the name of the choice type (“Range”, “Step”, …),

  • ... – a list of choice values, followed by NULL

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_choice_valist(const char *choice_type, va_list args)

This is the va_list version of wp_spa_pod_new_choice()

Parameters
  • choice_type – the name of the choice type (“Range”, “Step”, …)

  • args – the variable arguments passed to wp_spa_pod_new_choice()

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_object(const char *type_name, const char *id_name, ...)

Creates a spa pod of type object.

Parameters
  • type_name – the type name of the object type

  • id_name – the id name of the object,

  • ... – a list of object properties with their values, followed by NULL

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_object_valist(const char *type_name, const char *id_name, va_list args)

This is the va_list version of wp_spa_pod_new_object()

Parameters
  • type_name – the type name of the object type

  • id_name – the id name of the object

  • args – the variable arguments passed to wp_spa_pod_new_object()

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_sequence(guint unit, ...)

Creates a spa pod of type sequence.

Parameters
  • unit – the unit of the sequence

  • ... – a list of sequence controls with their values, followed by NULL

Returns

(transfer full): The new spa pod

WpSpaPod *wp_spa_pod_new_sequence_valist(guint unit, va_list args)

This is the va_list version of wp_spa_pod_new_sequence()

Parameters
Returns

(transfer full): The new spa pod

gboolean wp_spa_pod_is_none(WpSpaPod *self)

Checks wether the spa pod is of type none or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type none, FALSE otherwise

gboolean wp_spa_pod_is_boolean(WpSpaPod *self)

Checks wether the spa pod is of type boolean or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type boolean, FALSE otherwise

gboolean wp_spa_pod_is_id(WpSpaPod *self)

Checks wether the spa pod is of type Id or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type Id, FALSE otherwise

gboolean wp_spa_pod_is_int(WpSpaPod *self)

Checks wether the spa pod is of type int or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type int, FALSE otherwise

gboolean wp_spa_pod_is_long(WpSpaPod *self)

Checks wether the spa pod is of type long or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type long, FALSE otherwise

gboolean wp_spa_pod_is_float(WpSpaPod *self)

Checks wether the spa pod is of type float or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type float, FALSE otherwise

gboolean wp_spa_pod_is_double(WpSpaPod *self)

Checks wether the spa pod is of type double or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type double, FALSE otherwise

gboolean wp_spa_pod_is_string(WpSpaPod *self)

Checks wether the spa pod is of type string or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type string, FALSE otherwise

gboolean wp_spa_pod_is_bytes(WpSpaPod *self)

Checks wether the spa pod is of type bytes or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type bytes, FALSE otherwise

gboolean wp_spa_pod_is_pointer(WpSpaPod *self)

Checks wether the spa pod is of type pointer or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type pointer, FALSE otherwise

gboolean wp_spa_pod_is_fd(WpSpaPod *self)

Checks wether the spa pod is of type Fd or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type Fd, FALSE otherwise

gboolean wp_spa_pod_is_rectangle(WpSpaPod *self)

Checks wether the spa pod is of type rectangle or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type rectangle, FALSE otherwise

gboolean wp_spa_pod_is_fraction(WpSpaPod *self)

Checks wether the spa pod is of type fraction or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type fraction, FALSE otherwise

gboolean wp_spa_pod_is_array(WpSpaPod *self)

Checks wether the spa pod is of type array or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type array, FALSE otherwise

gboolean wp_spa_pod_is_choice(WpSpaPod *self)

Checks wether the spa pod is of type choice or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type choice, FALSE otherwise

gboolean wp_spa_pod_is_object(WpSpaPod *self)

Checks wether the spa pod is of type object or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type object, FALSE otherwise

gboolean wp_spa_pod_is_struct(WpSpaPod *self)

Checks wether the spa pod is of type struct or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type struct, FALSE otherwise

gboolean wp_spa_pod_is_sequence(WpSpaPod *self)

Checks wether the spa pod is of type sequence or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type sequence, FALSE otherwise

gboolean wp_spa_pod_is_property(WpSpaPod *self)

Checks wether the spa pod is of type property or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type property, FALSE otherwise

gboolean wp_spa_pod_is_control(WpSpaPod *self)

Checks wether the spa pod is of type control or not.

Parameters
  • self – the spa pod object

Returns

TRUE if it is of type control, FALSE otherwise

gboolean wp_spa_pod_get_boolean(WpSpaPod *self, gboolean *value)

Gets the boolean value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the boolean value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_id(WpSpaPod *self, guint32 *value)

Gets the Id value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the Id value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_int(WpSpaPod *self, gint32 *value)

Gets the int value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the int value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_long(WpSpaPod *self, gint64 *value)

Gets the long value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the long value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_float(WpSpaPod *self, float *value)

Gets the float value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the float value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_double(WpSpaPod *self, double *value)

Gets the double value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the double value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_string(WpSpaPod *self, const char **value)

Gets the string value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the string value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_bytes(WpSpaPod *self, gconstpointer *value, guint32 *len)

Gets the bytes value and its len of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the bytes value

  • len – (out): the length of the bytes value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_pointer(WpSpaPod *self, gconstpointer *value)

Gets the pointer value and its type name of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the pointer value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_fd(WpSpaPod *self, gint64 *value)

Gets the Fd value of a spa pod object.

Parameters
  • self – the spa pod object

  • value – (out): the Fd value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_rectangle(WpSpaPod *self, guint32 *width, guint32 *height)

Gets the rectangle’s width and height value of a spa pod object.

Parameters
  • self – the spa pod object

  • width – (out): the rectangle’s width value

  • height – (out): the rectangle’s height value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_fraction(WpSpaPod *self, guint32 *num, guint32 *denom)

Gets the fractions’s numerator and denominator value of a spa pod object.

Parameters
  • self – the spa pod object

  • num – (out): the fractions’s numerator value

  • denom – (out): the fractions’s denominator value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_set_boolean(WpSpaPod *self, gboolean value)

Sets a boolean value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the boolean value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_id(WpSpaPod *self, guint32 value)

Sets an Id value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the Id value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_int(WpSpaPod *self, gint32 value)

Sets an int value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the int value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_long(WpSpaPod *self, gint64 value)

Sets a long value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the long value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_float(WpSpaPod *self, float value)

Sets a float value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the float value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_double(WpSpaPod *self, double value)

Sets a double value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the double value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_pointer(WpSpaPod *self, const char *type_name, gconstpointer value)

Sets a pointer value with its type name in the spa pod object.

Parameters
  • self – the spa pod object

  • type_name – the name of the type of the pointer

  • value – the pointer value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_fd(WpSpaPod *self, gint64 value)

Sets a Fd value in the spa pod object.

Parameters
  • self – the spa pod object

  • value – the Fd value

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_rectangle(WpSpaPod *self, guint32 width, guint32 height)

Sets the width and height values of a rectangle in the spa pod object.

Parameters
  • self – the spa pod object

  • width – the width value of the rectangle

  • height – the height value of the rectangle

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_fraction(WpSpaPod *self, guint32 num, guint32 denom)

Sets the numerator and denominator values of a fraction in the spa pod object.

Parameters
  • self – the spa pod object

  • num – the numerator value of the farction

  • denom – the denominator value of the fraction

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_set_pod(WpSpaPod *self, WpSpaPod *pod)

Sets the value of a spa pod object in the current spa pod object. The spa pod objects must be of the same value.

Parameters
  • self – the spa pod object

  • pod – the pod with the value to be set

Returns

TRUE if the value could be set, FALSE othewrise.

gboolean wp_spa_pod_equal(WpSpaPod *self, WpSpaPod *pod)

Checks whether two spa pod objects have the same value or not.

Parameters
  • self – the spa pod object

  • pod – the pod with the value to be compared with

Returns

TRUE if both spa pod objects have the same values, FALSE othewrise.

gboolean wp_spa_pod_get_object(WpSpaPod *self, const char **id_name, ...)

Gets the object properties values of a spa pod object.

Parameters
  • self – the spa pod object

  • id_name – (out): the id name of the object,

  • ... – (out): the list of the object properties values, followed by NULL

Returns

TRUE if the object properties values were obtained, FALSE otherwise

gboolean wp_spa_pod_get_object_valist(WpSpaPod *self, const char **id_name, va_list args)

This is the va_list version of wp_spa_pod_get_object()

Parameters
  • self – the spa pod object

  • id_name – (out): the id name of the object

  • args – (out): the variable arguments passed to wp_spa_pod_get_object()

Returns

TRUE if the object properties values were obtained, FALSE otherwise

gboolean wp_spa_pod_get_struct(WpSpaPod *self, ...)

Gets the struct’s values of a spa pod object.

Parameters
  • self – the spa pod object

  • ... – (out): the list of the struct values, followed by NULL

Returns

TRUE if the struct values were obtained, FALSE otherwise

gboolean wp_spa_pod_get_struct_valist(WpSpaPod *self, va_list args)

This is the va_list version of wp_spa_pod_get_struct()

Parameters
Returns

TRUE if the struct values were obtained, FALSE otherwise

gboolean wp_spa_pod_get_property(WpSpaPod *self, const char **key, WpSpaPod **value)

Gets the name, flags and spa pod value of a spa pod property.

Parameters
  • self – the spa pod object

  • key – (out) (optional): the name of the property

  • value – (out) (optional): the spa pod value of the property

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_get_control(WpSpaPod *self, guint32 *offset, const char **ctl_type, WpSpaPod **value)

Gets the offset, type name and spa pod value of a spa pod control.

Parameters
  • self – the spa pod object

  • offset – (out) (optional): the offset of the control

  • ctl_type – (out) (optional): the control type (Properties, Midi, …)

  • value – (out) (optional): the spa pod value of the control

Returns

TRUE if the value was obtained, FALSE otherwise

WpSpaPod *wp_spa_pod_get_choice_child(WpSpaPod *self)

Gets the child of a spa pod choice object.

Parameters
  • self – a spa pod choice object

Returns

(transfer full): the child of the spa pod choice object

WpSpaPod *wp_spa_pod_get_array_child(WpSpaPod *self)

Gets the child of a spa pod array object.

Parameters
  • self – a spa pod choice object

Returns

(transfer full): the child of the spa pod array object

WpSpaPodBuilder *wp_spa_pod_builder_ref(WpSpaPodBuilder *self)

Increases the reference count of a spa pod builder.

Parameters
  • self – a spa pod builder object

Returns

(transfer full): self with an additional reference count on it

void wp_spa_pod_builder_unref(WpSpaPodBuilder *self)

Decreases the reference count on self and frees it when the ref count reaches zero.

Parameters
  • self – (transfer full): a spa pod builder object

WpSpaPodBuilder *wp_spa_pod_builder_new_array(void)

Creates a spa pod builder of type array.

Returns

(transfer full): the new spa pod builder

WpSpaPodBuilder *wp_spa_pod_builder_new_choice(const char *choice_type)

Creates a spa pod builder of type choice.

Parameters
  • choice_type – the name of the choice type (“Range”, “Step”, …)

Returns

(transfer full): the new spa pod builder

WpSpaPodBuilder *wp_spa_pod_builder_new_object(const char *type_name, const char *id_name)

Creates a spa pod builder of type object.

Parameters
  • type_name – the type name of the object type

  • id_name – the Id name of the object

Returns

(transfer full): the new spa pod builder

WpSpaPodBuilder *wp_spa_pod_builder_new_struct(void)

Creates a spa pod builder of type struct.

Returns

(transfer full): the new spa pod builder

WpSpaPodBuilder *wp_spa_pod_builder_new_sequence(guint unit)

Creates a spa pod builder of type sequence.

Returns

(transfer full): the new spa pod builder

void wp_spa_pod_builder_add_none(WpSpaPodBuilder *self)

Adds a none value into the builder.

Parameters
  • self – the spa pod builder object

void wp_spa_pod_builder_add_boolean(WpSpaPodBuilder *self, gboolean value)

Adds a boolean value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the boolean value

void wp_spa_pod_builder_add_id(WpSpaPodBuilder *self, guint32 value)

Adds a Id value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the Id value

void wp_spa_pod_builder_add_int(WpSpaPodBuilder *self, gint32 value)

Adds a int value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the int value

void wp_spa_pod_builder_add_long(WpSpaPodBuilder *self, gint64 value)

Adds a long value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the long value

void wp_spa_pod_builder_add_float(WpSpaPodBuilder *self, float value)

Adds a float value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the float value

void wp_spa_pod_builder_add_double(WpSpaPodBuilder *self, double value)

Adds a double value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the double value

void wp_spa_pod_builder_add_string(WpSpaPodBuilder *self, const char *value)

Adds a string value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the string value

void wp_spa_pod_builder_add_bytes(WpSpaPodBuilder *self, gconstpointer value, guint32 len)

Adds a bytes value with its length into the builder.

Parameters
  • self – the spa pod builder object

  • value – the bytes value

  • len – the length of the bytes value

void wp_spa_pod_builder_add_pointer(WpSpaPodBuilder *self, const char *type_name, gconstpointer value)

Adds a pointer value with its type name into the builder.

Parameters
  • self – the spa pod builder object

  • type_name – the type name that the pointer points to

  • value – the pointer vaue

void wp_spa_pod_builder_add_fd(WpSpaPodBuilder *self, gint64 value)

Adds a Fd value into the builder.

Parameters
  • self – the spa pod builder object

  • value – the Fd value

void wp_spa_pod_builder_add_rectangle(WpSpaPodBuilder *self, guint32 width, guint32 height)

Adds the width and height values of a rectangle into the builder.

Parameters
  • self – the spa pod builder object

  • width – the width value of the rectangle

  • height – the height value of the rectangle

void wp_spa_pod_builder_add_fraction(WpSpaPodBuilder *self, guint32 num, guint32 denom)

Adds the numerator and denominator values of a fraction into the builder.

Parameters
  • self – the spa pod builder object

  • num – the numerator value of the fraction

  • denom – the denominator value of the fraction

void wp_spa_pod_builder_add_pod(WpSpaPodBuilder *self, WpSpaPod *pod)

Adds a pod value into the builder.

Parameters
  • self – the spa pod builder object

  • pod – the pod value

void wp_spa_pod_builder_add_property(WpSpaPodBuilder *self, const char *key)

Adds a property into the builder.

Parameters
  • self – the spa pod builder object

  • key – the name of the property

void wp_spa_pod_builder_add_property_id(WpSpaPodBuilder *self, guint32 id)

Adds a property into the builder.

Parameters
  • self – the spa pod builder object

  • id – the id of the property

void wp_spa_pod_builder_add_control(WpSpaPodBuilder *self, guint32 offset, const char *ctl_type)

Adds a control into the builder.

Parameters
  • self – the spa pod builder object

  • offset – the offset of the control

  • ctl_type – the type name of the control

void wp_spa_pod_builder_add(WpSpaPodBuilder *self, ...)

Adds a list of values into the builder.

Parameters
  • self – the spa pod builder object

  • ... – a list of additional values, followed by NULL

void wp_spa_pod_builder_add_valist(WpSpaPodBuilder *self, va_list args)

Adds a list of values into the builder.

Parameters
WpSpaPod *wp_spa_pod_builder_end(WpSpaPodBuilder *self)

Ends the builder process and returns the constructed spa pod object.

Parameters
  • self – the spa pod builder object

Returns

(transfer full): the constructed spa pod object

WpSpaPodParser *wp_spa_pod_parser_ref(WpSpaPodParser *self)

Increases the reference count of a spa pod parser.

Parameters
  • self – a spa pod sparser object

Returns

(transfer full): self with an additional reference count on it

void wp_spa_pod_parser_unref(WpSpaPodParser *self)

Decreases the reference count on self and frees it when the ref count reaches zero.

Parameters
  • self – (transfer full): a spa pod parser object

WpSpaPodParser *wp_spa_pod_parser_new_object(WpSpaPod *pod, const char **id_name)

Creates an object spa pod parser. The pod object must be valid for the entire life-cycle of the returned parser.

Parameters
  • pod – the object spa pod to parse

  • id_name – the Id name of the object

Returns

(transfer full): The new spa pod parser

WpSpaPodParser *wp_spa_pod_parser_new_struct(WpSpaPod *pod)

Creates an struct spa pod parser. The pod object must be valid for the entire life-cycle of the returned parser.

Parameters
  • pod – the struct spa pod to parse

Returns

(transfer full): The new spa pod parser

gboolean wp_spa_pod_parser_get_boolean(WpSpaPodParser *self, gboolean *value)

Gets the boolean value from a spa pod parser.

Parameters
  • self – the spa pod parser object

  • value – (out): the boolean value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_id(WpSpaPodParser *self, guint32 *value)

Gets the Id value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the Id value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_int(WpSpaPodParser *self, gint32 *value)

Gets the int value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the int value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_long(WpSpaPodParser *self, gint64 *value)

Gets the long value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the long value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_float(WpSpaPodParser *self, float *value)

Gets the float value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the float value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_double(WpSpaPodParser *self, double *value)

Gets the double value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the double value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_string(WpSpaPodParser *self, const char **value)

Gets the string value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the string value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_bytes(WpSpaPodParser *self, gconstpointer *value, guint32 *len)

Gets the bytes value and its length from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the bytes value

  • len – (out): the length of the bytes value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_pointer(WpSpaPodParser *self, gconstpointer *value)

Gets the pointer value and its type name from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the pointer value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_fd(WpSpaPodParser *self, gint64 *value)

Gets the Fd value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • value – (out): the Fd value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_rectangle(WpSpaPodParser *self, guint32 *width, guint32 *height)

Gets the rectangle’s width and height value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • width – (out): the rectangle’s width value

  • height – (out): the rectangle’s height value

Returns

TRUE if the value was obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_fraction(WpSpaPodParser *self, guint32 *num, guint32 *denom)

Gets the fractions’s numerator and denominator value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • num – (out): the fractions’s numerator value

  • denom – (out): the fractions’s denominator value

Returns

TRUE if the value was obtained, FALSE otherwise

WpSpaPod *wp_spa_pod_parser_get_pod(WpSpaPodParser *self)

Gets the spa pod value from a spa pod parser object.

Parameters
  • self – the spa pod parser object

Returns

(transfer full): The spa pod value or NULL if it could not be obtained

gboolean wp_spa_pod_parser_get(WpSpaPodParser *self, ...)

Gets a list of values from a spa pod parser object.

Parameters
  • self – the spa pod parser object

  • ... – (out): a list of values to get, followed by NULL

Returns

TRUE if the values were obtained, FALSE otherwise

gboolean wp_spa_pod_parser_get_valist(WpSpaPodParser *self, va_list args)

This is the va_list version of wp_spa_pod_parser_get()

Parameters
Returns

TRUE if the values were obtained, FALSE otherwise

void wp_spa_pod_parser_end(WpSpaPodParser *self)

Ends the parser process.

Parameters
  • self – the spa pod parser object

WpIterator *wp_spa_pod_new_iterator(WpSpaPod *pod)

Creates a new iterator for a spa pod object.

Parameters
  • pod – a spa pod object

Returns

(transfer full): the new spa pod iterator

WP_TYPE_SPA_POD (wp_spa_pod_get_type ())

The WpSpaPod GType.

WP_TYPE_SPA_POD_BUILDER (wp_spa_pod_builder_get_type ())

The WpSpaPodBuilder GType.

WP_TYPE_SPA_POD_PARSER (wp_spa_pod_parser_get_type ())

The WpSpaPodParser GType.