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.

WpCore

GObject
    ╰──WpCore

Class structure

WpCoreClass

Fields
parent_class (GObjectClass) –
No description available

Wp.CoreClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

Wp.CoreClass

Attributes
parent_class (GObject.ObjectClass) –
No description available

WpCore

GObject
    ╰──WpCore

WpCore

GObject
    ╰──WpCore

Constructors

wp_core_new

WpCore *
wp_core_new (GMainContext * context,
             WpProperties * properties)

Parameters:

context ( [transfer: none] [nullable] ) –

the GMainContext to use for events

properties ( [transfer: full] [nullable] ) –

additional properties, which are passed to pw_context_new and pw_context_connect

Returns ( [transfer: full] ) –

a new WpCore


Wp.Core.new

def Wp.Core.new (context, properties):
    #python wrapper for 'wp_core_new'

Parameters:

context ( GLib.MainContext ) –

the GLib.MainContext to use for events

properties ( Wp.Properties ) –

additional properties, which are passed to pw_context_new and pw_context_connect

Returns ( Wp.Core ) –

a new Wp.Core


Wp.Core.prototype.new

function Wp.Core.prototype.new(context: GLib.MainContext, properties: Wp.Properties): {
    // javascript wrapper for 'wp_core_new'
}

Parameters:

context ( GLib.MainContext ) –

the GLib.MainContext to use for events

properties ( Wp.Properties ) –

additional properties, which are passed to pw_context_new and pw_context_connect

Returns ( Wp.Core ) –

a new Wp.Core


Methods

wp_core_connect

gboolean
wp_core_connect (WpCore * self)

Connects this core to the PipeWire server. When connection succeeds, the connected signal is emitted

Parameters:

self

the core

Returns

TRUE if the core is effectively connected or FALSE if connection failed


Wp.Core.connect

def Wp.Core.connect (self):
    #python wrapper for 'wp_core_connect'

Connects this core to the PipeWire server. When connection succeeds, the connected signal is emitted

Parameters:

self ( Wp.Core ) –

the core

Returns ( bool ) –

True if the core is effectively connected or False if connection failed


Wp.Core.prototype.connect

function Wp.Core.prototype.connect(): {
    // javascript wrapper for 'wp_core_connect'
}

Connects this core to the PipeWire server. When connection succeeds, the connected signal is emitted

Parameters:

self ( Wp.Core ) –

the core

Returns ( Number ) –

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.

Parameters:

self

the core


Wp.Core.disconnect

def Wp.Core.disconnect (self):
    #python wrapper for 'wp_core_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.

Parameters:

self ( Wp.Core ) –

the core


Wp.Core.prototype.disconnect

function Wp.Core.prototype.disconnect(): {
    // javascript wrapper for 'wp_core_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.

Parameters:

self ( Wp.Core ) –

the core


wp_core_get_context

GMainContext *
wp_core_get_context (WpCore * self)

Parameters:

self

the core

Returns ( [transfer: none] [nullable] ) –

the GMainContext that is in use by this core for events


Wp.Core.get_context

def Wp.Core.get_context (self):
    #python wrapper for 'wp_core_get_context'

Parameters:

self ( Wp.Core ) –

the core

Returns ( GLib.MainContext ) –

the GLib.MainContext that is in use by this core for events


Wp.Core.prototype.get_context

function Wp.Core.prototype.get_context(): {
    // javascript wrapper for 'wp_core_get_context'
}

Parameters:

self ( Wp.Core ) –

the core

Returns ( GLib.MainContext ) –

the GLib.MainContext that is in use by this core for events


wp_core_get_pw_context

pw_context*
wp_core_get_pw_context (WpCore * self)

Parameters:

self

the core

Returns ( [transfer: none] ) –

the internal pw_context object


Wp.Core.get_pw_context

def Wp.Core.get_pw_context (self):
    #python wrapper for 'wp_core_get_pw_context'

Parameters:

self ( Wp.Core ) –

the core

Returns ( object ) –

the internal pw_context object


Wp.Core.prototype.get_pw_context

function Wp.Core.prototype.get_pw_context(): {
    // javascript wrapper for 'wp_core_get_pw_context'
}

Parameters:

self ( Wp.Core ) –

the core

Returns ( Object ) –

the internal pw_context object


wp_core_get_pw_core

pw_core*
wp_core_get_pw_core (WpCore * self)

Parameters:

self

the core

Returns ( [transfer: none] [nullable] ) –

the internal pw_core object, or NULL if the core is not connected to PipeWire


Wp.Core.get_pw_core

def Wp.Core.get_pw_core (self):
    #python wrapper for 'wp_core_get_pw_core'

Parameters:

self ( Wp.Core ) –

the core

Returns ( object ) –

the internal pw_core object, or None if the core is not connected to PipeWire


Wp.Core.prototype.get_pw_core

function Wp.Core.prototype.get_pw_core(): {
    // javascript wrapper for 'wp_core_get_pw_core'
}

Parameters:

self ( Wp.Core ) –

the core

Returns ( Object ) –

the internal pw_core object, or null if the core is not connected to PipeWire


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:

self

the core

source ( [out] [optional] ) –

the source

function ( [scope notified] ) –

the function to call

data ( [closure] ) –

data to pass to function

destroy ( [nullable] ) –

a function to destroy data


Wp.Core.idle_add

def Wp.Core.idle_add (self, function, *data):
    #python wrapper for 'wp_core_idle_add'

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.

Parameters:

self ( Wp.Core ) –

the core

function ( GLib.SourceFunc ) –

the function to call

data ( variadic ) –

data to pass to function


Wp.Core.prototype.idle_add

function Wp.Core.prototype.idle_add(function: GLib.SourceFunc, data: Object): {
    // javascript wrapper for 'wp_core_idle_add'
}

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.

Parameters:

self ( Wp.Core ) –

the core

function ( GLib.SourceFunc ) –

the function to call

data ( Object ) –

data to pass to function


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:

self

the core

source ( [out] [optional] ) –

the source

closure

the closure to invoke


Wp.Core.idle_add_closure

def Wp.Core.idle_add_closure (self, closure):
    #python wrapper for 'wp_core_idle_add_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.

Parameters:

self ( Wp.Core ) –

the core

closure ( GObject.Closure ) –

the closure to invoke


Wp.Core.prototype.idle_add_closure

function Wp.Core.prototype.idle_add_closure(closure: GObject.Closure): {
    // javascript wrapper for 'wp_core_idle_add_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.

Parameters:

self ( Wp.Core ) –

the core

closure ( GObject.Closure ) –

the closure to invoke


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.

Parameters:

self

the core

om ( [transfer: none] ) –

a WpObjectManager


Wp.Core.install_object_manager

def Wp.Core.install_object_manager (self, om):
    #python wrapper for 'wp_core_install_object_manager'

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.

Parameters:

self ( Wp.Core ) –

the core


Wp.Core.prototype.install_object_manager

function Wp.Core.prototype.install_object_manager(om: Wp.ObjectManager): {
    // javascript wrapper for 'wp_core_install_object_manager'
}

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.

Parameters:

self ( Wp.Core ) –

the core


wp_core_is_connected

gboolean
wp_core_is_connected (WpCore * self)

Parameters:

self

the core

Returns

TRUE if the core is connected to PipeWire, FALSE otherwise


Wp.Core.is_connected

def Wp.Core.is_connected (self):
    #python wrapper for 'wp_core_is_connected'

Parameters:

self ( Wp.Core ) –

the core

Returns ( bool ) –

True if the core is connected to PipeWire, False otherwise


Wp.Core.prototype.is_connected

function Wp.Core.prototype.is_connected(): {
    // javascript wrapper for 'wp_core_is_connected'
}

Parameters:

self ( Wp.Core ) –

the core

Returns ( Number ) –

true if the core is connected to PipeWire, false otherwise


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:

self

the core

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):
    #python wrapper for 'wp_core_sync'

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:

self ( Wp.Core ) –

the core

cancellable ( Gio.Cancellable ) –

a Gio.Cancellable to cancel the operation

callback ( Gio.AsyncReadyCallback ) –

a function to call when the operation is done

user_data ( variadic ) –

data to pass to callback

Returns ( bool ) –

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): {
    // javascript wrapper for 'wp_core_sync'
}

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:

self ( Wp.Core ) –

the core

cancellable ( Gio.Cancellable ) –

a Gio.Cancellable to cancel the operation

callback ( Gio.AsyncReadyCallback ) –

a function to call when the operation is done

user_data ( Object ) –

data to pass to callback

Returns ( Number ) –

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:

self

the core

res

a GAsyncResult

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):
    #python wrapper for 'wp_core_sync_finish'

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:

self ( Wp.Core ) –

the core

Returns ( bool ) –

True if the operation succeeded, False otherwise


Wp.Core.prototype.sync_finish

function Wp.Core.prototype.sync_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'wp_core_sync_finish'
}

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.

Parameters:

self ( Wp.Core ) –

the core

Returns ( Number ) –

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:

self

the core

source ( [out] [optional] ) –

the source

timeout_ms

the timeout in milliseconds

function ( [scope notified] ) –

the function to call

data ( [closure] ) –

data to pass to function

destroy ( [nullable] ) –

a function to destroy data


Wp.Core.timeout_add

def Wp.Core.timeout_add (self, timeout_ms, function, *data):
    #python wrapper for 'wp_core_timeout_add'

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:

self ( Wp.Core ) –

the core

timeout_ms ( int ) –

the timeout in milliseconds

function ( GLib.SourceFunc ) –

the function to call

data ( variadic ) –

data to pass to function


Wp.Core.prototype.timeout_add

function Wp.Core.prototype.timeout_add(timeout_ms: Number, function: GLib.SourceFunc, data: Object): {
    // javascript wrapper for 'wp_core_timeout_add'
}

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:

self ( Wp.Core ) –

the core

timeout_ms ( Number ) –

the timeout in milliseconds

function ( GLib.SourceFunc ) –

the function to call

data ( Object ) –

data to pass to function


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:

self

the core

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):
    #python wrapper for 'wp_core_timeout_add_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:

self ( Wp.Core ) –

the core

timeout_ms ( int ) –

the timeout in milliseconds

closure ( GObject.Closure ) –

the closure to invoke


Wp.Core.prototype.timeout_add_closure

function Wp.Core.prototype.timeout_add_closure(timeout_ms: Number, closure: GObject.Closure): {
    // javascript wrapper for 'wp_core_timeout_add_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:

self ( Wp.Core ) –

the core

timeout_ms ( Number ) –

the timeout in milliseconds

closure ( GObject.Closure ) –

the closure to invoke


Signals

connected

connected_callback (WpCore * self,
                    gpointer user_data)

Emitted when the core is successfully connected to the PipeWire server

Parameters:

self

the core

user_data
No description available

Flags: Run Last


connected

def connected_callback (self, *user_data):
    #python callback for the 'connected' signal

Emitted when the core is successfully connected to the PipeWire server

Parameters:

self ( Wp.Core ) –

the core

user_data ( variadic ) –
No description available

Flags: Run Last


connected

function connected_callback(self: Wp.Core, user_data: Object): {
    // javascript callback for the 'connected' signal
}

Emitted when the core is successfully connected to the PipeWire server

Parameters:

self ( Wp.Core ) –

the core

user_data ( Object ) –
No description available

Flags: Run Last


disconnected

disconnected_callback (WpCore * self,
                       gpointer user_data)

Emitted when the core is disconnected from the PipeWire server

Parameters:

self

the core

user_data
No description available

Flags: Run Last


disconnected

def disconnected_callback (self, *user_data):
    #python callback for the 'disconnected' signal

Emitted when the core is disconnected from the PipeWire server

Parameters:

self ( Wp.Core ) –

the core

user_data ( variadic ) –
No description available

Flags: Run Last


disconnected

function disconnected_callback(self: Wp.Core, user_data: Object): {
    // javascript callback for the 'disconnected' signal
}

Emitted when the core is disconnected from the PipeWire server

Parameters:

self ( Wp.Core ) –

the core

user_data ( Object ) –
No description available

Flags: Run Last


Properties

context

“context” GMainContext *

Flags : Read / Write / Construct Only


context

“self.props.context” GLib.MainContext

Flags : Read / Write / Construct Only


context

“context” GLib.MainContext

Flags : Read / Write / Construct Only


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


pw-context

“pw-context” gpointer

Flags : Read


pw_context

“self.props.pw_context” object

Flags : Read


pw-context

“pw-context” Object

Flags : Read


pw-core

“pw-core” gpointer

Flags : Read


pw_core

“self.props.pw_core” object

Flags : Read


pw-core

“pw-core” Object

Flags : Read


Constants

WP_TYPE_CORE

#define WP_TYPE_CORE (wp_core_get_type ())

The WpCore GType


The results of the search are