Device
Added in version 1.4.
Superclasses: Object
, InitiallyUnowned
, Object
- Constructors:
Device(**properties)
Methods
- class Device
- create_element(name: str | None = None) Element | None
Creates the element with all of the required parameters set to use this device.
Added in version 1.4.
- Parameters:
name – name of new element, or
None
to automatically create a unique name.
- get_device_class() str
Gets the “class” of a device. This is a “/” separated list of classes that represent this device. They are a subset of the classes of the
DeviceProvider
that produced this device.Added in version 1.4.
- has_classes(classes: str) bool
Check if
device
matches all of the given classesAdded in version 1.4.
- Parameters:
classes – a “/”-separated list of device classes to match, only match if all classes are matched
- has_classesv(classes: Sequence[str]) bool
Check if
factory
matches all of the given classesAdded in version 1.4.
- Parameters:
classes – a
None
terminated array of classes to match, only match if all classes are matched
- reconfigure_element(element: Element) bool
Tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using
create_element()
.Note: This should only be implemented for elements can change their device in the PLAYING state.
Added in version 1.4.
- Parameters:
element – a
Element
Properties
Signals
Virtual Methods
- class Device
- do_create_element(name: str | None = None) Element | None
Creates the element with all of the required parameters set to use this device.
Added in version 1.4.
- Parameters:
name – name of new element, or
None
to automatically create a unique name.
- do_reconfigure_element(element: Element) bool
Tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using
create_element()
.Note: This should only be implemented for elements can change their device in the PLAYING state.
Added in version 1.4.
- Parameters:
element – a
Element