Wp.ObjectManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Class Details¶
- class Wp.ObjectManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Wp.ObjectManager
class provides a way to collect a set of objects and be notified when objects that fulfill a certain set of criteria are created or destroyed. There are 4 kinds of objects that can be managed by aWp.ObjectManager
:remote PipeWire global objects that are advertised on the registry; these are bound locally to subclasses of
Wp.GlobalProxy
remote PipeWire global objects that are created by calling a remote factory through the WirePlumber API; these are very similar to other global objects but it should be noted that the same
Wp.GlobalProxy
instance that created them appears in theWp.ObjectManager
(as soon as itsWp.ProxyFeatures.PROXY_FEATURE_BOUND
is enabled)local PipeWire objects that are being exported to PipeWire (
Wp.ImplMetadata
,Wp.ImplNode
, etc); these appear in theWp.ObjectManager
as soon as they are exported (so, when theirWp.ProxyFeatures.PROXY_FEATURE_BOUND
is enabled)WirePlumber-specific objects, such as plugins, factories and session items
To start an object manager, you first need to declare interest in a certain kind of object by calling wp_object_manager_add_interest() and then install it on the
Wp.Core
withWp.Core.install_object_manager
(). Upon installing aWp.ObjectManager
on aWp.Core
, any pre-existing objects that match the interests of thisWp.ObjectManager
will immediately become available to get throughWp.ObjectManager.new_iterator
() and theWp.ObjectManager
object-added signal will be emitted for all of them. However, note that if these objects need to be prepared (to activate some features on them), the emission of object-added will be delayed. To know when it is safe to access the initial set of objects, wait until the installed signal has been emitted. That signal is emitted asynchronously after all the initial objects have been prepared.- classmethod new()¶
- Returns:
the newly constructed object manager
- Return type:
Constructs a new object manager.
- add_interest_full(interest)¶
- Parameters:
interest (
Wp.ObjectInterest
) – the interest
Declares interest in a certain kind of object.
Interest consists of a
GObject.GType
that the object must be an ancestor of (GObject.type_is_a
() must match) and optionally, a set of additional constraints on certain properties of the object. Refer toWp.ObjectInterest
for more details.
- get_n_objects()¶
- Returns:
the number of objects managed by this
Wp.ObjectManager
- Return type:
Gets the number of objects managed by the object manager.
- is_installed()¶
- Returns:
True
if the object manager is installed (i.e. theWp.ObjectManager
installed signal has been emitted),False
otherwise- Return type:
Checks if an object manager is installed.
- lookup_full(interest)¶
- Parameters:
interest (
Wp.ObjectInterest
) – the interst- Returns:
the first managed object that matches the lookup interest, or
None
if no object matches- Return type:
Searches for an object that matches the specified interest and returns it, if found.
If more than one objects match, only the first one is returned. To find multiple objects that match certain criteria, wp_object_manager_new_filtered_iterator() is more suitable.
- new_filtered_iterator_full(interest)¶
- Parameters:
interest (
Wp.ObjectInterest
) – the interest- Returns:
a
Wp.Iterator
that iterates over all the matching objects of this object manager- Return type:
Iterates through all the objects managed by this object manager that match the specified interest.
- new_iterator()¶
- Returns:
a
Wp.Iterator
that iterates over all the managed objects of this object manager- Return type:
Iterates through all the objects managed by this object manager.
- request_object_features(object_type, wanted_features)¶
- Parameters:
object_type (
GObject.GType
) – theWp.Proxy
descendant typewanted_features (
int
) – the features to enable on this kind of object
Requests the object manager to automatically prepare the wanted_features on any managed object that is of the specified object_type.
These features will always be prepared before the object appears on the object manager.
Signal Details¶
- Wp.ObjectManager.signals.installed(object_manager)¶
- Signal Name:
installed
- Flags:
- Parameters:
object_manager (
Wp.ObjectManager
) – The object which received the signal
- Wp.ObjectManager.signals.object_added(object_manager, object)¶
- Signal Name:
object-added
- Flags:
- Parameters:
object_manager (
Wp.ObjectManager
) – The object which received the signalobject (
GObject.Object
) –
- Wp.ObjectManager.signals.object_removed(object_manager, object)¶
- Signal Name:
object-removed
- Flags:
- Parameters:
object_manager (
Wp.ObjectManager
) – The object which received the signalobject (
GObject.Object
) –
- Wp.ObjectManager.signals.objects_changed(object_manager)¶
- Signal Name:
objects-changed
- Flags:
- Parameters:
object_manager (
Wp.ObjectManager
) – The object which received the signal