Wp.SessionItem

g GObject.Object GObject.Object Wp.Object Wp.Object GObject.Object->Wp.Object Wp.SessionItem Wp.SessionItem Wp.Object->Wp.SessionItem

Subclasses:

None

Methods

Inherited:

Wp.Object (12), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

handle_proxy_destroyed (proxy, item)

class

make (core, factory_name)

configure (props)

get_associated_proxy (proxy_type)

get_associated_proxy_id (proxy_type)

get_properties ()

get_property (key)

is_configured ()

register ()

remove ()

reset ()

set_properties (props)

Virtual Methods

Inherited:

Wp.Object (4), GObject.Object (7)

do_configure (props)

do_disable_active ()

do_disable_exported ()

do_enable_active (transition)

do_enable_exported (transition)

do_get_associated_proxy (proxy_type)

do_reset ()

Properties

Inherited:

Wp.Object (4)

Name

Type

Flags

Short Description

properties

Wp.Properties

r

The session item properties

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Wp.Object

r

Class Details

class Wp.SessionItem(**kwargs)
Bases:

Wp.Object

Abstract:

Yes

Structure:

Wp.SessionItemClass

Session items are high level objects that wrap underlying PipeWire objects and manage them. For example, a session item may be managing a node, taking responsibility for configuring the PortConfig and Format parameters of the node. Or another may be managing links between two nodes. All the implementations are provided by modules and instantiated via the Wp.SiFactory class.

classmethod handle_proxy_destroyed(proxy, item)
Parameters:
  • proxy (Wp.Proxy) – the proxy that was destroyed by the server

  • item (Wp.SessionItem) – the associated session item

Helper callback for sub-classes that deffers and unexports the session item.

Only meant to be used when the pipewire proxy destroyed signal is triggered.

classmethod make(core, factory_name)
Parameters:
  • core (Wp.Core) – the Wp.Core

  • factory_name (str) – the name of the factory to be used for constructing the object

Returns:

the new session item

Return type:

Wp.SessionItem or None

Finds the factory associated with the given name from the core and uses it to construct a new Wp.SessionItem.

configure(props)
Parameters:

props (Wp.Properties) – the properties used to configure the item

Returns:

True on success, False if the item could not be configured

Return type:

bool

Configures the session item with a set of properties.

get_associated_proxy(proxy_type)
Parameters:

proxy_type (GObject.GType) – a Wp.Proxy subclass GObject.GType

Returns:

the associated proxy of the specified proxy_type, or None if there is no association to such a proxy

Return type:

Wp.Proxy or None

An associated proxy is a Wp.Proxy subclass instance that is somehow related to this item.

get_associated_proxy_id(proxy_type)
Parameters:

proxy_type (GObject.GType) – a Wp.Proxy subclass GObject.GType

Returns:

the bound id of the associated proxy of the specified proxy_type, or SPA_ID_INVALID if there is no association to such a proxy

Return type:

int

Gets the bound id of a proxy associated with the session item.

get_properties()
Returns:

the item’s properties.

Return type:

Wp.Properties

Gets the properties of a session item.

get_property(key)
Parameters:

key (str) – the property key

Returns:

the item property value for the given key.

Return type:

str

Looks up a named session item property value for a given key.

is_configured()
Returns:

True if the item is configured, False otherwise

Return type:

bool

Checks if the session item is configured.

register()

Registers the session item to its associated core.

remove()

Removes the session item from its associated core.

reset()

Resets the session item.

This essentially removes the configuration and deactivates all active features.

set_properties(props)
Parameters:

props (Wp.Properties) – the new properties to set

Sets the item’s properties.

This should only be done by sub-classes after the configuration has been done.

do_configure(props) virtual
Parameters:

props (Wp.Properties) – the properties used to configure the item

Returns:

True on success, False if the item could not be configured

Return type:

bool

Configures the session item with a set of properties.

do_disable_active() virtual
do_disable_exported() virtual
do_enable_active(transition) virtual
Parameters:

transition (Wp.Transition) –

do_enable_exported(transition) virtual
Parameters:

transition (Wp.Transition) –

do_get_associated_proxy(proxy_type) virtual
Parameters:

proxy_type (GObject.GType) –

Return type:

object or None

do_reset() virtual

Resets the session item.

This essentially removes the configuration and deactivates all active features.

Property Details

Wp.SessionItem.props.properties
Name:

properties

Type:

Wp.Properties

Default Value:

None

Flags:

READABLE

The session item properties