WpCore
The core is the central object around which everything operates. It is
essential to create a WpCore before using any other WirePlumber API.
The core object has the following responsibilities:
- it initializes the PipeWire library
- it creates a
pw_context
and allows connecting to the PipeWire server,
creating a local pw_core
- it glues the PipeWire library's event loop system with GMainLoop
- it maintains a list of registered objects, which other classes use
to keep objects loaded permanently into memory
- it watches the PipeWire registry and keeps track of remote and local
objects that appear in the registry, making them accessible through
the WpObjectManager API.
wp_core_connect
gboolean
wp_core_connect (WpCore * self)
Connects this core to the PipeWire server. When connection succeeds,
the connected signal is emitted
Returns
–
TRUE if the core is effectively connected or FALSE if
connection failed
Wp.Core.connect
def Wp.Core.connect (self):
Connects this core to the PipeWire server. When connection succeeds,
the connected signal is emitted
True if the core is effectively connected or False if
connection failed
Wp.Core.prototype.connect
function Wp.Core.prototype.connect(): {
}
Connects this core to the PipeWire server. When connection succeeds,
the connected signal is emitted
true if the core is effectively connected or false if
connection failed
wp_core_disconnect
wp_core_disconnect (WpCore * self)
Disconnects this core from the PipeWire server. This also effectively
destroys all WpProxy objects that were created through the registry,
destroys the pw_core
and finally emits the disconnected signal.
Wp.Core.disconnect
def Wp.Core.disconnect (self):
Disconnects this core from the PipeWire server. This also effectively
destroys all Wp.Proxy objects that were created through the registry,
destroys the pw_core
and finally emits the disconnected signal.
Wp.Core.prototype.disconnect
function Wp.Core.prototype.disconnect(): {
}
Disconnects this core from the PipeWire server. This also effectively
destroys all Wp.Proxy objects that were created through the registry,
destroys the pw_core
and finally emits the disconnected signal.
wp_core_idle_add
wp_core_idle_add (WpCore * self,
GSource ** source,
GSourceFunc function,
gpointer data,
GDestroyNotify destroy)
Adds an idle callback to be called in the same GMainContext as the
one used by this core. This is essentially the same as g_idle_add_full,
but it adds the created GSource on the GMainContext used by this core
instead of the default context.
Parameters:
source
(
[out]
[optional]
)
–
the source
function
(
[scope notified]
)
–
the function to call
a function to destroy data
Wp.Core.idle_add
def Wp.Core.idle_add (self, function, *data):
Adds an idle callback to be called in the same GLib.MainContext as the
one used by this core. This is essentially the same as GLib.idle_add_full,
but it adds the created GLib.Source on the GLib.MainContext used by this core
instead of the default context.
Wp.Core.prototype.idle_add
function Wp.Core.prototype.idle_add(function: GLib.SourceFunc, data: Object): {
}
Adds an idle callback to be called in the same GLib.MainContext as the
one used by this core. This is essentially the same as GLib.prototype.idle_add_full,
but it adds the created GLib.Source on the GLib.MainContext used by this core
instead of the default context.
wp_core_idle_add_closure
wp_core_idle_add_closure (WpCore * self,
GSource ** source,
GClosure * closure)
Adds an idle callback to be called in the same GMainContext as the
one used by this core.
This is the same as wp_core_idle_add, but it allows you to specify
a GClosure instead of a C callback.
Parameters:
source
(
[out]
[optional]
)
–
the source
closure
–
the closure to invoke
Wp.Core.idle_add_closure
def Wp.Core.idle_add_closure (self, closure):
Adds an idle callback to be called in the same GLib.MainContext as the
one used by this core.
This is the same as Wp.Core.idle_add, but it allows you to specify
a GObject.Closure instead of a C callback.
Wp.Core.prototype.idle_add_closure
function Wp.Core.prototype.idle_add_closure(closure: GObject.Closure): {
}
Adds an idle callback to be called in the same GLib.MainContext as the
one used by this core.
This is the same as Wp.Core.prototype.idle_add, but it allows you to specify
a GObject.Closure instead of a C callback.
wp_core_install_object_manager
wp_core_install_object_manager (WpCore * self,
WpObjectManager * om)
Installs the object manager on this core, activating its internal management
engine. This will immediately emit signals about objects added on om
if objects that the om is interested in were in existence already.
Wp.Core.install_object_manager
def Wp.Core.install_object_manager (self, om):
Installs the object manager on this core, activating its internal management
engine. This will immediately emit signals about objects added on om
if objects that the om is interested in were in existence already.
Wp.Core.prototype.install_object_manager
function Wp.Core.prototype.install_object_manager(om: Wp.ObjectManager): {
}
Installs the object manager on this core, activating its internal management
engine. This will immediately emit signals about objects added on om
if objects that the om is interested in were in existence already.
wp_core_sync
gboolean
wp_core_sync (WpCore * self,
GCancellable * cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
Asks the PipeWire server to call the callback via an event.
Since methods are handled in-order and events are delivered
in-order, this can be used as a barrier to ensure all previous
methods and the resulting events have been handled.
In both success and error cases, callback is always called. Use
wp_core_sync_finish from within the callback to determine whether
the operation completed successfully or if an error occurred.
Parameters:
cancellable
(
[nullable]
)
–
a GCancellable to cancel the operation
callback
(
[scope async]
)
–
a function to call when the operation is done
user_data
(
[closure]
)
–
data to pass to callback
Returns
–
TRUE if the sync operation was started, FALSE if an error
occurred before returning from this function
Wp.Core.sync
def Wp.Core.sync (self, cancellable, callback, *user_data):
Asks the PipeWire server to call the callback via an event.
Since methods are handled in-order and events are delivered
in-order, this can be used as a barrier to ensure all previous
methods and the resulting events have been handled.
In both success and error cases, callback is always called. Use
Wp.Core.sync_finish from within the callback to determine whether
the operation completed successfully or if an error occurred.
Parameters:
a function to call when the operation is done
True if the sync operation was started, False if an error
occurred before returning from this function
Wp.Core.prototype.sync
function Wp.Core.prototype.sync(cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
}
Asks the PipeWire server to call the callback via an event.
Since methods are handled in-order and events are delivered
in-order, this can be used as a barrier to ensure all previous
methods and the resulting events have been handled.
In both success and error cases, callback is always called. Use
Wp.Core.prototype.sync_finish from within the callback to determine whether
the operation completed successfully or if an error occurred.
Parameters:
a function to call when the operation is done
true if the sync operation was started, false if an error
occurred before returning from this function
wp_core_sync_finish
gboolean
wp_core_sync_finish (WpCore * self,
GAsyncResult * res,
GError ** error)
This function is meant to be called from within the callback of
wp_core_sync in order to determine the success or failure of the operation.
Parameters:
error
(
[out]
[optional]
)
–
the error that occurred, if any
Returns
–
TRUE if the operation succeeded, FALSE otherwise
Wp.Core.sync_finish
@raises(GLib.GError)
def Wp.Core.sync_finish (self, res):
This function is meant to be called from within the callback of
Wp.Core.sync in order to determine the success or failure of the operation.
True if the operation succeeded, False otherwise
Wp.Core.prototype.sync_finish
function Wp.Core.prototype.sync_finish(res: Gio.AsyncResult): {
}
This function is meant to be called from within the callback of
Wp.Core.prototype.sync in order to determine the success or failure of the operation.
true if the operation succeeded, false otherwise
wp_core_timeout_add
wp_core_timeout_add (WpCore * self,
GSource ** source,
guint timeout_ms,
GSourceFunc function,
gpointer data,
GDestroyNotify destroy)
Adds a timeout callback to be called at regular intervals in the same
GMainContext as the one used by this core. The function is called repeatedly
until it returns FALSE, at which point the timeout is automatically destroyed
and the function will not be called again. The first call to the function
will be at the end of the first interval. This is essentially the same as
g_timeout_add_full, but it adds the created GSource on the GMainContext
used by this core instead of the default context.
Parameters:
source
(
[out]
[optional]
)
–
the source
timeout_ms
–
the timeout in milliseconds
function
(
[scope notified]
)
–
the function to call
a function to destroy data
Wp.Core.timeout_add
def Wp.Core.timeout_add (self, timeout_ms, function, *data):
Adds a timeout callback to be called at regular intervals in the same
GLib.MainContext as the one used by this core. The function is called repeatedly
until it returns FALSE, at which point the timeout is automatically destroyed
and the function will not be called again. The first call to the function
will be at the end of the first interval. This is essentially the same as
GLib.timeout_add_full, but it adds the created GLib.Source on the GLib.MainContext
used by this core instead of the default context.
Parameters:
the timeout in milliseconds
Wp.Core.prototype.timeout_add
function Wp.Core.prototype.timeout_add(timeout_ms: Number, function: GLib.SourceFunc, data: Object): {
}
Adds a timeout callback to be called at regular intervals in the same
GLib.MainContext as the one used by this core. The function is called repeatedly
until it returns FALSE, at which point the timeout is automatically destroyed
and the function will not be called again. The first call to the function
will be at the end of the first interval. This is essentially the same as
GLib.prototype.timeout_add_full, but it adds the created GLib.Source on the GLib.MainContext
used by this core instead of the default context.
Parameters:
the timeout in milliseconds
wp_core_timeout_add_closure
wp_core_timeout_add_closure (WpCore * self,
GSource ** source,
guint timeout_ms,
GClosure * closure)
Adds a timeout callback to be called at regular intervals in the same
GMainContext as the one used by this core.
This is the same as wp_core_timeout_add, but it allows you to specify
a GClosure instead of a C callback.
Parameters:
source
(
[out]
[optional]
)
–
the source
timeout_ms
–
the timeout in milliseconds
closure
–
the closure to invoke
Wp.Core.timeout_add_closure
def Wp.Core.timeout_add_closure (self, timeout_ms, closure):
Adds a timeout callback to be called at regular intervals in the same
GLib.MainContext as the one used by this core.
This is the same as Wp.Core.timeout_add, but it allows you to specify
a GObject.Closure instead of a C callback.
Parameters:
the timeout in milliseconds
Wp.Core.prototype.timeout_add_closure
function Wp.Core.prototype.timeout_add_closure(timeout_ms: Number, closure: GObject.Closure): {
}
Adds a timeout callback to be called at regular intervals in the same
GLib.MainContext as the one used by this core.
This is the same as Wp.Core.prototype.timeout_add, but it allows you to specify
a GObject.Closure instead of a C callback.
Parameters:
the timeout in milliseconds
connected
connected_callback (WpCore * self,
gpointer user_data)
Emitted when the core is successfully connected to the PipeWire server
Parameters:
user_data
–
No description available
Flags:
Run Last
connected
def connected_callback (self, *user_data):
Emitted when the core is successfully connected to the PipeWire server
Flags:
Run Last
connected
function connected_callback(self: Wp.Core, user_data: Object): {
}
Emitted when the core is successfully connected to the PipeWire server
Flags:
Run Last
disconnected
disconnected_callback (WpCore * self,
gpointer user_data)
Emitted when the core is disconnected from the PipeWire server
Parameters:
user_data
–
No description available
Flags:
Run Last
disconnected
def disconnected_callback (self, *user_data):
Emitted when the core is disconnected from the PipeWire server
Flags:
Run Last
disconnected
function disconnected_callback(self: Wp.Core, user_data: Object): {
}
Emitted when the core is disconnected from the PipeWire server
Flags:
Run Last
properties
“properties” WpProperties *
Flags :
Read
/
Write
/
Construct Only
properties
“self.props.properties” Wp.Properties
Flags :
Read
/
Write
/
Construct Only
properties
“properties” Wp.Properties
Flags :
Read
/
Write
/
Construct Only