Wp.SpaPod

Fields

None

Methods

class

new_boolean (value)

class

new_bytes (value, len)

class

new_double (value)

class

new_fd (value)

class

new_float (value)

class

new_fraction (num, denom)

class

new_id (value)

class

new_int (value)

class

new_long (value)

class

new_none ()

class

new_pointer (type_name, value)

class

new_rectangle (width, height)

class

new_string (value)

class

new_wrap (pod)

class

new_wrap_const (pod)

copy ()

ensure_unique_owner ()

equal (pod)

filter (filter)

fixate ()

get_array_child ()

get_boolean ()

get_bytes ()

get_choice_child ()

get_choice_type ()

get_control ()

get_double ()

get_fd ()

get_float ()

get_fraction ()

get_id ()

get_int ()

get_long ()

get_pointer ()

get_property ()

get_rectangle ()

get_spa_pod ()

get_spa_type ()

get_string ()

is_array ()

is_boolean ()

is_bytes ()

is_choice ()

is_control ()

is_double ()

is_fd ()

is_float ()

is_fraction ()

is_id ()

is_int ()

is_long ()

is_none ()

is_object ()

is_pointer ()

is_property ()

is_rectangle ()

is_sequence ()

is_string ()

is_struct ()

is_unique_owner ()

new_iterator ()

ref ()

set_boolean (value)

set_double (value)

set_fd (value)

set_float (value)

set_fraction (num, denom)

set_id (value)

set_int (value)

set_long (value)

set_pod (pod)

set_pointer (type_name, value)

set_rectangle (width, height)

unref ()

Details

class Wp.SpaPod
classmethod new_boolean(value)
Parameters:

value (bool) – the boolean value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type boolean.

classmethod new_bytes(value, len)
Parameters:
  • value (object or None) – the bytes value

  • len (int) – the length of the bytes value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type bytes.

classmethod new_double(value)
Parameters:

value (float) – the double value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type double.

classmethod new_fd(value)
Parameters:

value (int) – the Fd value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type Fd.

classmethod new_float(value)
Parameters:

value (float) – the float value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type float.

classmethod new_fraction(num, denom)
Parameters:
  • num (int) – the numerator value of the fraction

  • denom (int) – the denominator value of the fraction

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type fraction.

classmethod new_id(value)
Parameters:

value (int) – the Id value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type Id.

classmethod new_int(value)
Parameters:

value (int) – the int value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type int.

classmethod new_long(value)
Parameters:

value (int) – the long value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type long.

classmethod new_none()
Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type None.

classmethod new_pointer(type_name, value)
Parameters:
  • type_name (str) – the name of the type of the pointer

  • value (object or None) – the pointer value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type pointer.

classmethod new_rectangle(width, height)
Parameters:
  • width (int) – the width value of the rectangle

  • height (int) – the height value of the rectangle

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type rectangle.

classmethod new_string(value)
Parameters:

value (str) – the string value

Returns:

The new spa pod

Return type:

Wp.SpaPod

Creates a spa pod of type string.

classmethod new_wrap(pod)
Parameters:

pod (object or None) – a spa_pod

Returns:

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

Return type:

Wp.SpaPod

Constructs a new Wp.SpaPod that wraps the given spa_pod.

classmethod new_wrap_const(pod)
Parameters:

pod (object or None) – a constant spa_pod

Returns:

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

Return type:

Wp.SpaPod

Constructs a new immutable Wp.SpaPod that wraps the given spa_pod.

copy()
Returns:

The newly copied spa pod

Return type:

Wp.SpaPod

Copies a spa pod object.

ensure_unique_owner()
Returns:

the uniquely owned spa pod object which may or may not be the same as self.

Return type:

Wp.SpaPod

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:

bool

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

filter(filter)
Parameters:

filter (Wp.SpaPod) –

Return type:

Wp.SpaPod

fixate()
Returns:

True if the pod was an object and it went through the fixation procedure, False otherwise

Return type:

bool

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:

Wp.SpaPod

Gets the child of a spa pod array object.

get_boolean()
Returns:

True if the value was obtained, False otherwise

value:

the boolean value

Return type:

(bool, value: bool)

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:

(bool, value: object, len: int)

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:

Wp.SpaPod

Gets the child of a spa pod choice object.

get_choice_type()
Returns:

the choice type of the choice pod

Return type:

object

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:

(bool, offset: int, ctl_type: str, value: Wp.SpaPod)

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

get_double()
Returns:

True if the value was obtained, False otherwise

value:

the double value

Return type:

(bool, value: float)

Gets the double value of a spa pod object.

get_fd()
Returns:

True if the value was obtained, False otherwise

value:

the Fd value

Return type:

(bool, value: int)

Gets the Fd value of a spa pod object.

get_float()
Returns:

True if the value was obtained, False otherwise

value:

the float value

Return type:

(bool, value: 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:

(bool, num: int, denom: int)

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

get_id()
Returns:

True if the value was obtained, False otherwise

value:

the Id value

Return type:

(bool, value: int)

Gets the Id value of a spa pod object.

get_int()
Returns:

True if the value was obtained, False otherwise

value:

the int value

Return type:

(bool, value: int)

Gets the int value of a spa pod object.

get_long()
Returns:

True if the value was obtained, False otherwise

value:

the long value

Return type:

(bool, value: int)

Gets the long value of a spa pod object.

get_pointer()
Returns:

True if the value was obtained, False otherwise

value:

the pointer value

Return type:

(bool, value: object)

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:

(bool, key: str, value: Wp.SpaPod)

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:

(bool, width: int, height: int)

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

get_spa_pod()
Returns:

a const pointer to the underlying spa_pod structure

Return type:

object or None

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

get_spa_type()
Returns:

the type of the spa pod

Return type:

Wp.SpaType

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()
Returns:

True if the value was obtained, False otherwise

value:

the string value

Return type:

(bool, value: str)

Gets the string value of a spa pod object.

is_array()
Returns:

True if it is of type array, False otherwise

Return type:

bool

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

is_boolean()
Returns:

True if it is of type boolean, False otherwise

Return type:

bool

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

is_bytes()
Returns:

True if it is of type bytes, False otherwise

Return type:

bool

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

is_choice()
Returns:

True if it is of type choice, False otherwise

Return type:

bool

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

is_control()
Returns:

True if it is of type control, False otherwise

Return type:

bool

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

is_double()
Returns:

True if it is of type double, False otherwise

Return type:

bool

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

is_fd()
Returns:

True if it is of type Fd, False otherwise

Return type:

bool

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

is_float()
Returns:

True if it is of type float, False otherwise

Return type:

bool

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

is_fraction()
Returns:

True if it is of type fraction, False otherwise

Return type:

bool

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

is_id()
Returns:

True if it is of type Id, False otherwise

Return type:

bool

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

is_int()
Returns:

True if it is of type int, False otherwise

Return type:

bool

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

is_long()
Returns:

True if it is of type long, False otherwise

Return type:

bool

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

is_none()
Returns:

True if it is of type none, False otherwise

Return type:

bool

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

is_object()
Returns:

True if it is of type object, False otherwise

Return type:

bool

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

is_pointer()
Returns:

True if it is of type pointer, False otherwise

Return type:

bool

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

is_property()
Returns:

True if it is of type property, False otherwise

Return type:

bool

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

is_rectangle()
Returns:

True if it is of type rectangle, False otherwise

Return type:

bool

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

is_sequence()
Returns:

True if it is of type sequence, False otherwise

Return type:

bool

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

is_string()
Returns:

True if it is of type string, False otherwise

Return type:

bool

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

is_struct()
Returns:

True if it is of type struct, False otherwise

Return type:

bool

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

is_unique_owner()
Returns:

True if the pod owns the data, False otherwise.

Return type:

bool

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

new_iterator()
Returns:

the new spa pod iterator

Return type:

Wp.Iterator

Creates a new iterator for a spa pod object.

ref()
Returns:

self with an additional reference count on it

Return type:

Wp.SpaPod

Increases the reference count of a spa pod object.

set_boolean(value)
Parameters:

value (bool) – the boolean value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets a boolean value in the spa pod object.

set_double(value)
Parameters:

value (float) – the double value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets a double value in the spa pod object.

set_fd(value)
Parameters:

value (int) – the Fd value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets a Fd value in the spa pod object.

set_float(value)
Parameters:

value (float) – the float value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets a float value in the spa pod object.

set_fraction(num, denom)
Parameters:
  • num (int) – the numerator value of the farction

  • denom (int) – the denominator value of the fraction

Returns:

True if the value could be set, False othewrise.

Return type:

bool

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

set_id(value)
Parameters:

value (int) – the Id value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets an Id value in the spa pod object.

set_int(value)
Parameters:

value (int) – the int value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

Sets an int value in the spa pod object.

set_long(value)
Parameters:

value (int) – the long value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

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:

True if the value could be set, False othewrise.

Return type:

bool

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:
  • type_name (str) – the name of the type of the pointer

  • value (object or None) – the pointer value

Returns:

True if the value could be set, False othewrise.

Return type:

bool

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

set_rectangle(width, height)
Parameters:
  • width (int) – the width value of the rectangle

  • height (int) – the height value of the rectangle

Returns:

True if the value could be set, False othewrise.

Return type:

bool

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.