WpObjectManager

The WpObjectManager 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 a WpObjectManager:

  • remote PipeWire global objects that are advertised on the registry; these are bound locally to subclasses of WpProxy
  • 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 WpProxy instance that created them appears in the WpObjectManager (as soon as its WP_PROXY_FEATURE_BOUND is enabled)
  • local PipeWire objects that are being exported to PipeWire (#WpImplNode, WpImplEndpoint [private], etc); these appear in the WpObjectManager as soon as they are exported (so, when their WP_PROXY_FEATURE_BOUND is enabled)
  • WirePlumber-specific objects, such as WirePlumber factories

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 WpCore with wp_core_install_object_manager.

Upon installing a WpObjectManager on a WpCore, any pre-existing objects that match the interests of this WpObjectManager will immediately become available to get through wp_object_manager_iterate and the object-added signal will be emitted for all of them.

WpObjectManager

GObject
    ╰──WpObjectManager

Class structure

WpObjectManagerClass

Fields
parent_class (GObjectClass) –
No description available

Wp.ObjectManagerClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

Wp.ObjectManagerClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

WpObjectManager

GObject
    ╰──WpObjectManager

WpObjectManager

GObject
    ╰──WpObjectManager

Constructors

wp_object_manager_new

WpObjectManager *
wp_object_manager_new ()

Constructs a new object manager.

Returns ( [transfer: full] ) –

the newly constructed object manager


Wp.ObjectManager.new

def Wp.ObjectManager.new ():
    #python wrapper for 'wp_object_manager_new'

Constructs a new object manager.

Returns ( Wp.ObjectManager ) –

the newly constructed object manager


Wp.ObjectManager.prototype.new

function Wp.ObjectManager.prototype.new(): {
    // javascript wrapper for 'wp_object_manager_new'
}

Constructs a new object manager.

Returns ( Wp.ObjectManager ) –

the newly constructed object manager


Methods

wp_object_manager_add_interest

wp_object_manager_add_interest (WpObjectManager * self,
                                GType gtype,
                                ... ...)

Equivalent to:

 WpObjectInterest *i = wp_object_interest_new (gtype, ...);
 wp_object_manager_add_interest_full (self, i);

The constraints specified in the variable arguments must follow the rules documented in wp_object_interest_new.

Parameters:

self

the object manager

gtype

the GType of the objects that we are declaring interest in

...

a list of constraints, terminated by NULL


wp_object_manager_add_interest_full

wp_object_manager_add_interest_full (WpObjectManager * self,
                                     WpObjectInterest * interest)

Declares interest in a certain kind of object. Interest consists of a GType that the object must be an ancestor of (g_type_is_a must match) and optionally, a set of additional constraints on certain properties of the object. Refer to WpObjectInterest for more details.

Parameters:

self

the object manager

interest ( [transfer: full] ) –

the interest


Wp.ObjectManager.add_interest_full

def Wp.ObjectManager.add_interest_full (self, interest):
    #python wrapper for 'wp_object_manager_add_interest_full'

Declares interest in a certain kind of object. Interest consists of a GObject.Type that the object must be an ancestor of (g_type_is_a must match) and optionally, a set of additional constraints on certain properties of the object. Refer to Wp.ObjectInterest for more details.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interest


Wp.ObjectManager.prototype.add_interest_full

function Wp.ObjectManager.prototype.add_interest_full(interest: Wp.ObjectInterest): {
    // javascript wrapper for 'wp_object_manager_add_interest_full'
}

Declares interest in a certain kind of object. Interest consists of a GObject.Type that the object must be an ancestor of (g_type_is_a must match) and optionally, a set of additional constraints on certain properties of the object. Refer to Wp.ObjectInterest for more details.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interest


wp_object_manager_get_n_objects

guint
wp_object_manager_get_n_objects (WpObjectManager * self)

Parameters:

self

the object manager

Returns

the number of objects managed by this WpObjectManager


Wp.ObjectManager.get_n_objects

def Wp.ObjectManager.get_n_objects (self):
    #python wrapper for 'wp_object_manager_get_n_objects'

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( int ) –

the number of objects managed by this Wp.ObjectManager


Wp.ObjectManager.prototype.get_n_objects

function Wp.ObjectManager.prototype.get_n_objects(): {
    // javascript wrapper for 'wp_object_manager_get_n_objects'
}

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( Number ) –

the number of objects managed by this Wp.ObjectManager


wp_object_manager_is_installed

gboolean
wp_object_manager_is_installed (WpObjectManager * self)

Parameters:

self

the object manager

Returns

TRUE if the object manager is installed (the WpObjectManager::installed has been emitted), FALSE otherwise


Wp.ObjectManager.is_installed

def Wp.ObjectManager.is_installed (self):
    #python wrapper for 'wp_object_manager_is_installed'

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( bool ) –

True if the object manager is installed (the WpObjectManager::installed has been emitted), False otherwise


Wp.ObjectManager.prototype.is_installed

function Wp.ObjectManager.prototype.is_installed(): {
    // javascript wrapper for 'wp_object_manager_is_installed'
}

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( Number ) –

true if the object manager is installed (the WpObjectManager::installed has been emitted), false otherwise


wp_object_manager_iterate

WpIterator *
wp_object_manager_iterate (WpObjectManager * self)

Parameters:

self

the object manager

Returns ( [transfer: full] ) –

a WpIterator that iterates over all the managed objects of this object manager


Wp.ObjectManager.iterate

def Wp.ObjectManager.iterate (self):
    #python wrapper for 'wp_object_manager_iterate'

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( Wp.Iterator ) –

a Wp.Iterator that iterates over all the managed objects of this object manager


Wp.ObjectManager.prototype.iterate

function Wp.ObjectManager.prototype.iterate(): {
    // javascript wrapper for 'wp_object_manager_iterate'
}

Parameters:

self ( Wp.ObjectManager ) –

the object manager

Returns ( Wp.Iterator ) –

a Wp.Iterator that iterates over all the managed objects of this object manager


wp_object_manager_iterate_filtered

WpIterator *
wp_object_manager_iterate_filtered (WpObjectManager * self,
                                    GType gtype,
                                    ... ...)

Equivalent to:

 WpObjectInterest *i = wp_object_interest_new (gtype, ...);
 return wp_object_manager_iterate_filtered_full (self, i);

The constraints specified in the variable arguments must follow the rules documented in wp_object_interest_new.

Parameters:

self

the object manager

gtype

the GType of the objects to iterate through

...

a list of constraints, terminated by NULL

Returns ( [transfer: full] ) –

a WpIterator that iterates over all the matching objects of this object manager


wp_object_manager_iterate_filtered_full

WpIterator *
wp_object_manager_iterate_filtered_full (WpObjectManager * self,
                                         WpObjectInterest * interest)

Iterates through all the objects managed by this object manager that match the specified interest.

Parameters:

self

the object manager

interest ( [transfer: full] ) –

the interest

Returns ( [transfer: full] ) –

a WpIterator that iterates over all the matching objects of this object manager


Wp.ObjectManager.iterate_filtered_full

def Wp.ObjectManager.iterate_filtered_full (self, interest):
    #python wrapper for 'wp_object_manager_iterate_filtered_full'

Iterates through all the objects managed by this object manager that match the specified interest.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interest

Returns ( Wp.Iterator ) –

a Wp.Iterator that iterates over all the matching objects of this object manager


Wp.ObjectManager.prototype.iterate_filtered_full

function Wp.ObjectManager.prototype.iterate_filtered_full(interest: Wp.ObjectInterest): {
    // javascript wrapper for 'wp_object_manager_iterate_filtered_full'
}

Iterates through all the objects managed by this object manager that match the specified interest.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interest

Returns ( Wp.Iterator ) –

a Wp.Iterator that iterates over all the matching objects of this object manager


wp_object_manager_lookup

gpointer
wp_object_manager_lookup (WpObjectManager * self,
                          GType gtype,
                          ... ...)

Equivalent to:

 WpObjectInterest *i = wp_object_interest_new (gtype, ...);
 return wp_object_manager_lookup_full (self, i);

The constraints specified in the variable arguments must follow the rules documented in wp_object_interest_new.

Parameters:

self

the object manager

gtype

the GType of the object to lookup

...

a list of constraints, terminated by NULL

Returns ( [type GObject] [transfer: full] [nullable] ) –

the first managed object that matches the lookup interest, or NULL if no object matches


wp_object_manager_lookup_full

gpointer
wp_object_manager_lookup_full (WpObjectManager * self,
                               WpObjectInterest * interest)

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_iterate_filtered is more suitable.

Parameters:

self

the object manager

interest ( [transfer: full] ) –

the interst

Returns ( [type GObject] [transfer: full] [nullable] ) –

the first managed object that matches the lookup interest, or NULL if no object matches


Wp.ObjectManager.lookup_full

def Wp.ObjectManager.lookup_full (self, interest):
    #python wrapper for 'wp_object_manager_lookup_full'

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_iterate_filtered (not introspectable) is more suitable.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interst

Returns ( GObject.Object ) –

the first managed object that matches the lookup interest, or None if no object matches


Wp.ObjectManager.prototype.lookup_full

function Wp.ObjectManager.prototype.lookup_full(interest: Wp.ObjectInterest): {
    // javascript wrapper for 'wp_object_manager_lookup_full'
}

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_iterate_filtered (not introspectable) is more suitable.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

interest ( Wp.ObjectInterest ) –

the interst

Returns ( GObject.Object ) –

the first managed object that matches the lookup interest, or null if no object matches


wp_object_manager_request_proxy_features

wp_object_manager_request_proxy_features (WpObjectManager * self,
                                          GType proxy_type,
                                          WpProxyFeatures wanted_features)

Requests the object manager to automatically prepare the wanted_features on any managed object that is of the specified proxy_type. These features will always be prepared before the object appears on the object manager.

Parameters:

self

the object manager

proxy_type

the WpProxy descendant type

wanted_features

the features to enable on this kind of proxy


Wp.ObjectManager.request_proxy_features

def Wp.ObjectManager.request_proxy_features (self, proxy_type, wanted_features):
    #python wrapper for 'wp_object_manager_request_proxy_features'

Requests the object manager to automatically prepare the wanted_features on any managed object that is of the specified proxy_type. These features will always be prepared before the object appears on the object manager.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

proxy_type ( GObject.Type ) –

the Wp.Proxy descendant type

wanted_features ( Wp.ProxyFeatures ) –

the features to enable on this kind of proxy


Wp.ObjectManager.prototype.request_proxy_features

function Wp.ObjectManager.prototype.request_proxy_features(proxy_type: GObject.Type, wanted_features: Wp.ProxyFeatures): {
    // javascript wrapper for 'wp_object_manager_request_proxy_features'
}

Requests the object manager to automatically prepare the wanted_features on any managed object that is of the specified proxy_type. These features will always be prepared before the object appears on the object manager.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

proxy_type ( GObject.Type ) –

the Wp.Proxy descendant type

wanted_features ( Wp.ProxyFeatures ) –

the features to enable on this kind of proxy


Signals

installed

installed_callback (WpObjectManager * self,
                    gpointer user_data)

This is emitted once after the object manager is installed with wp_core_install_object_manager. If there are objects that need to be prepared asynchronously internally, emission of this signal is delayed until all objects are ready.

Parameters:

self

the object manager

user_data
No description available

Flags: Run First


installed

def installed_callback (self, *user_data):
    #python callback for the 'installed' signal

This is emitted once after the object manager is installed with Wp.Core.install_object_manager. If there are objects that need to be prepared asynchronously internally, emission of this signal is delayed until all objects are ready.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

user_data ( variadic ) –
No description available

Flags: Run First


installed

function installed_callback(self: Wp.ObjectManager, user_data: Object): {
    // javascript callback for the 'installed' signal
}

This is emitted once after the object manager is installed with Wp.Core.prototype.install_object_manager. If there are objects that need to be prepared asynchronously internally, emission of this signal is delayed until all objects are ready.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

user_data ( Object ) –
No description available

Flags: Run First


object-added

object_added_callback (WpObjectManager * self,
                       GObject * object,
                       gpointer user_data)

Emitted when an object that matches the interests of this object manager is made available.

Parameters:

self

the object manager

object ( [transfer: none] ) –

the managed object that was just added

user_data
No description available

Flags: Run First


object-added

def object_added_callback (self, object, *user_data):
    #python callback for the 'object-added' signal

Emitted when an object that matches the interests of this object manager is made available.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

object ( GObject.Object ) –

the managed object that was just added

user_data ( variadic ) –
No description available

Flags: Run First


object-added

function object_added_callback(self: Wp.ObjectManager, object: GObject.Object, user_data: Object): {
    // javascript callback for the 'object-added' signal
}

Emitted when an object that matches the interests of this object manager is made available.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

object ( GObject.Object ) –

the managed object that was just added

user_data ( Object ) –
No description available

Flags: Run First


object-removed

object_removed_callback (WpObjectManager * self,
                         GObject * object,
                         gpointer user_data)

Emitted when an object that was previously added on this object manager is now being removed (and most likely destroyed). At the time that this signal is emitted, the object is still alive.

Parameters:

self

the object manager

object ( [transfer: none] ) –

the managed object that is being removed

user_data
No description available

Flags: Run First


object-removed

def object_removed_callback (self, object, *user_data):
    #python callback for the 'object-removed' signal

Emitted when an object that was previously added on this object manager is now being removed (and most likely destroyed). At the time that this signal is emitted, the object is still alive.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

object ( GObject.Object ) –

the managed object that is being removed

user_data ( variadic ) –
No description available

Flags: Run First


object-removed

function object_removed_callback(self: Wp.ObjectManager, object: GObject.Object, user_data: Object): {
    // javascript callback for the 'object-removed' signal
}

Emitted when an object that was previously added on this object manager is now being removed (and most likely destroyed). At the time that this signal is emitted, the object is still alive.

Parameters:

self ( Wp.ObjectManager ) –

the object manager

object ( GObject.Object ) –

the managed object that is being removed

user_data ( Object ) –
No description available

Flags: Run First


objects-changed

objects_changed_callback (WpObjectManager * self,
                          gpointer user_data)

Emitted when one or more objects have been recently added or removed from this object manager. This signal is useful to get notified only once when multiple changes happen in a short timespan. The receiving callback may retrieve the updated list of objects by calling wp_object_manager_iterate

Parameters:

self

the object manager

user_data
No description available

Flags: Run First


objects-changed

def objects_changed_callback (self, *user_data):
    #python callback for the 'objects-changed' signal

Emitted when one or more objects have been recently added or removed from this object manager. This signal is useful to get notified only once when multiple changes happen in a short timespan. The receiving callback may retrieve the updated list of objects by calling Wp.ObjectManager.iterate

Parameters:

self ( Wp.ObjectManager ) –

the object manager

user_data ( variadic ) –
No description available

Flags: Run First


objects-changed

function objects_changed_callback(self: Wp.ObjectManager, user_data: Object): {
    // javascript callback for the 'objects-changed' signal
}

Emitted when one or more objects have been recently added or removed from this object manager. This signal is useful to get notified only once when multiple changes happen in a short timespan. The receiving callback may retrieve the updated list of objects by calling Wp.ObjectManager.prototype.iterate

Parameters:

self ( Wp.ObjectManager ) –

the object manager

user_data ( Object ) –
No description available

Flags: Run First


Properties

core

“core” WpCore *

Flags : Read


core

“self.props.core” Wp.Core

Flags : Read


core

“core” Wp.Core

Flags : Read


Constants

WP_TYPE_OBJECT_MANAGER

#define WP_TYPE_OBJECT_MANAGER (wp_object_manager_get_type ())

The WpObjectManager GType


The results of the search are