Wp.SpaPod¶
Fields¶
None
Methods¶
Details¶
- class Wp.SpaPod¶
- classmethod new_boolean(value)¶
-
Creates a spa pod of type boolean.
- classmethod new_bytes(value, len)¶
- Parameters:
- Returns:
The new spa pod
- Return type:
Creates a spa pod of type bytes.
- classmethod new_double(value)¶
-
Creates a spa pod of type double.
- classmethod new_fd(value)¶
-
Creates a spa pod of type Fd.
- classmethod new_float(value)¶
-
Creates a spa pod of type float.
- classmethod new_fraction(num, denom)¶
- Parameters:
- Returns:
The new spa pod
- Return type:
Creates a spa pod of type fraction.
- classmethod new_id(value)¶
-
Creates a spa pod of type Id.
- classmethod new_int(value)¶
-
Creates a spa pod of type int.
- classmethod new_long(value)¶
-
Creates a spa pod of type long.
- classmethod new_none()¶
- Returns:
The new spa pod
- Return type:
Creates a spa pod of type None.
- classmethod new_pointer(type_name, value)¶
- Parameters:
- Returns:
The new spa pod
- Return type:
Creates a spa pod of type pointer.
- classmethod new_rectangle(width, height)¶
- Parameters:
- Returns:
The new spa pod
- Return type:
Creates a spa pod of type rectangle.
- classmethod new_string(value)¶
-
Creates a spa pod of type string.
- classmethod new_wrap(pod)¶
- Parameters:
- Returns:
a new
Wp.SpaPod
that references the data in pod. pod is not copied, so it needs to stay alive. The returnedWp.SpaPod
can be modified by using the setter functions, in which case pod will be modified underneath.- Return type:
Constructs a new
Wp.SpaPod
that wraps the given spa_pod.
- classmethod new_wrap_const(pod)¶
- Parameters:
- Returns:
a new
Wp.SpaPod
that references the data in pod. pod is not copied, so it needs to stay alive. The returnedWp.SpaPod
cannot be modified, unless it’s copied first.- Return type:
Constructs a new immutable
Wp.SpaPod
that wraps the given spa_pod.
- ensure_unique_owner()¶
- Returns:
the uniquely owned spa pod object which may or may not be the same as self.
- Return type:
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.
- equal(pod)¶
- Parameters:
pod (
Wp.SpaPod
) – the pod with the value to be compared with- Returns:
True
if both spa pod objects have the same values,False
othewrise.- Return type:
Checks whether two spa pod objects have the same value or not.
- fixate()¶
- Returns:
True
if the pod was an object and it went through the fixation procedure,False
otherwise- Return type:
Fixates choices in an object pod so that they only have one value.
- get_array_child()¶
- Returns:
the child of the spa pod array object
- Return type:
Gets the child of a spa pod array object.
- get_boolean()¶
-
Gets the boolean value of a spa pod object.
- get_bytes()¶
- Returns:
True
if the value was obtained,False
otherwise- value:
the bytes value
- len:
the length of the bytes value
- Return type:
Gets the bytes value and its len of a spa pod object.
- get_choice_child()¶
- Returns:
the child of the spa pod choice object
- Return type:
Gets the child of a spa pod choice object.
- get_choice_type()¶
- Returns:
the choice type of the choice pod
- Return type:
If the pod is a Choice, this gets the choice type (Range, Step, Enum, …)
- get_control()¶
- Returns:
True
if the value was obtained,False
otherwise- offset:
the offset of the control
- ctl_type:
the control type (Properties, Midi, …)
- value:
the spa pod value of the control
- Return type:
Gets the offset, type name and spa pod value of a spa pod control.
- get_double()¶
-
Gets the double value of a spa pod object.
- get_fd()¶
-
Gets the Fd value of a spa pod object.
- get_float()¶
-
Gets the float value of a spa pod object.
- get_fraction()¶
- Returns:
True
if the value was obtained,False
otherwise- num:
the fractions’s numerator value
- denom:
the fractions’s denominator value
- Return type:
Gets the fractions’s numerator and denominator value of a spa pod object.
- get_id()¶
-
Gets the Id value of a spa pod object.
- get_int()¶
-
Gets the int value of a spa pod object.
- get_long()¶
-
Gets the long value of a spa pod object.
- get_pointer()¶
-
Gets the pointer value and its type name of a spa pod object.
- get_property()¶
- Returns:
True
if the value was obtained,False
otherwise- key:
the name of the property
- value:
the spa pod value of the property
- Return type:
Gets the name, flags and spa pod value of a spa pod property.
- get_rectangle()¶
- Returns:
True
if the value was obtained,False
otherwise- width:
the rectangle’s width value
- height:
the rectangle’s height value
- Return type:
Gets the rectangle’s width and height value of a spa pod object.
- get_spa_pod()¶
-
Converts a
Wp.SpaPod
pointer to a struct spa_pod one, for use with native pipewire & spa functions. The returned pointer is owned byWp.SpaPod
and may not be modified or freed.
- get_spa_type()¶
- Returns:
the type of the spa pod
- Return type:
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.
- get_string()¶
-
Gets the string value of a spa pod object.
- is_array()¶
-
Checks wether the spa pod is of type array or not.
- is_boolean()¶
-
Checks wether the spa pod is of type boolean or not.
- is_bytes()¶
-
Checks wether the spa pod is of type bytes or not.
- is_choice()¶
-
Checks wether the spa pod is of type choice or not.
- is_control()¶
-
Checks wether the spa pod is of type control or not.
- is_double()¶
-
Checks wether the spa pod is of type double or not.
- is_fd()¶
-
Checks wether the spa pod is of type Fd or not.
- is_float()¶
-
Checks wether the spa pod is of type float or not.
- is_fraction()¶
-
Checks wether the spa pod is of type fraction or not.
- is_id()¶
-
Checks wether the spa pod is of type Id or not.
- is_int()¶
-
Checks wether the spa pod is of type int or not.
- is_long()¶
-
Checks wether the spa pod is of type long or not.
- is_none()¶
-
Checks wether the spa pod is of type none or not.
- is_object()¶
-
Checks wether the spa pod is of type object or not.
- is_pointer()¶
-
Checks wether the spa pod is of type pointer or not.
- is_property()¶
-
Checks wether the spa pod is of type property or not.
- is_rectangle()¶
-
Checks wether the spa pod is of type rectangle or not.
- is_sequence()¶
-
Checks wether the spa pod is of type sequence or not.
- is_string()¶
-
Checks wether the spa pod is of type string or not.
- is_struct()¶
-
Checks wether the spa pod is of type struct or not.
- is_unique_owner()¶
-
Checks if the pod is the unique owner of its data or not.
- new_iterator()¶
- Returns:
the new spa pod iterator
- Return type:
Creates a new iterator for a spa pod object.
- ref()¶
- Returns:
self with an additional reference count on it
- Return type:
Increases the reference count of a spa pod object.
- set_boolean(value)¶
- Parameters:
value (
bool
) – the boolean value- Returns:
- Return type:
Sets a boolean value in the spa pod object.
- set_double(value)¶
- Parameters:
value (
float
) – the double value- Returns:
- Return type:
Sets a double value in the spa pod object.
- set_fd(value)¶
- Parameters:
value (
int
) – the Fd value- Returns:
- Return type:
Sets a Fd value in the spa pod object.
- set_float(value)¶
- Parameters:
value (
float
) – the float value- Returns:
- Return type:
Sets a float value in the spa pod object.
- set_fraction(num, denom)¶
- Parameters:
- Returns:
- Return type:
Sets the numerator and denominator values of a fraction in the spa pod object.
- set_id(value)¶
- Parameters:
value (
int
) – the Id value- Returns:
- Return type:
Sets an Id value in the spa pod object.
- set_int(value)¶
- Parameters:
value (
int
) – the int value- Returns:
- Return type:
Sets an int value in the spa pod object.
- set_long(value)¶
- Parameters:
value (
int
) – the long value- Returns:
- Return type:
Sets a long value in the spa pod object.
- set_pod(pod)¶
- Parameters:
pod (
Wp.SpaPod
) – the pod with the value to be set- Returns:
- Return type:
Sets the value of a spa pod object in the current spa pod object. The spa pod objects must be of the same value.
- set_pointer(type_name, value)¶
- Parameters:
- Returns:
- Return type:
Sets a pointer value with its type name in the spa pod object.
- set_rectangle(width, height)¶
- Parameters:
- Returns:
- Return type:
Sets the width and height values of a rectangle in the spa pod object.
- unref()¶
Decreases the reference count on self and frees it when the ref count reaches zero.