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.ObjectManagerclass 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.GlobalProxyremote 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.GlobalProxyinstance that created them appears in theWp.ObjectManager(as soon as itsWp.ProxyFeatures.PROXY_FEATURE_BOUNDis enabled)local PipeWire objects that are being exported to PipeWire (
Wp.ImplMetadata,Wp.ImplNode, etc); these appear in theWp.ObjectManageras soon as they are exported (so, when theirWp.ProxyFeatures.PROXY_FEATURE_BOUNDis 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.CorewithWp.Core.install_object_manager(). Upon installing aWp.ObjectManageron aWp.Core, any pre-existing objects that match the interests of thisWp.ObjectManagerwill immediately become available to get throughWp.ObjectManager.new_iterator() and theWp.ObjectManagerobject-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.GTypethat 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.ObjectInterestfor 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:
Trueif the object manager is installed (i.e. theWp.ObjectManagerinstalled signal has been emitted),Falseotherwise- Return type:
Checks if an object manager is installed.
- lookup_full(interest)¶
- Parameters:
interest (
Wp.ObjectInterest) – the interest- Returns:
the first managed object that matches the lookup interest, or
Noneif 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.Iteratorthat 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.Iteratorthat 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.Proxydescendant 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