Wp.Object

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

Subclasses:

Wp.Core, Wp.Plugin, Wp.Proxy, Wp.SessionItem, Wp.Settings

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

abort_activation (msg)

activate (features, cancellable, callback, *user_data)

activate_closure (features, cancellable, closure)

activate_finish (res)

deactivate (features)

get_active_features ()

get_core ()

get_id ()

get_supported_features ()

test_active_features (features)

test_supported_features (features)

update_features (activated, deactivated)

Virtual Methods

Inherited:

GObject.Object (7)

do_activate_execute_step (transition, step, missing)

do_activate_get_next_step (transition, step, missing)

do_deactivate (features)

do_get_supported_features ()

Properties

Name

Type

Flags

Short Description

active-features

int

r

The active WpObjectFeatures on this proxy

core

Wp.Core

r/w/co

The Wp.Core

id

int

r

The object unique id

supported-features

int

r

The supported WpObjectFeatures on this proxy

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Wp.Object(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Wp.ObjectClass

Base class for objects that have activatable features.

abort_activation(msg)
Parameters:

msg (str) – the message used in the transition error

Aborts the current object activation by returning a transition error if any transitions are pending.

This is usually used to stop any pending activation if an error happened.

New in version 0.4.6.

activate(features, cancellable, callback, *user_data)
Parameters:

Callback version of Wp.Object.activate_closure()

activate_closure(features, cancellable, closure)
Parameters:
  • features (int) – the features to enable

  • cancellable (Gio.Cancellable or None) – a cancellable for the async operation

  • closure (GObject.Closure) – the closure to use when activation is completed

Activates the requested features and invokes closure when this is done. features may contain unsupported or already active features. The operation will filter them and activate only ones that are supported and inactive.

If multiple calls to this method is done, the operations will be executed one after the other to ensure features only get activated once. closure may be invoked in sync while this method is being called, if there are no features to activate.

activate_finish(res)
Parameters:

res (Gio.AsyncResult) – the async operation result

Raises:

GLib.Error

Returns:

True if the requested features were activated, False if there was an error

Return type:

bool

Finishes the async operation that was started with Wp.Object.activate()

deactivate(features)
Parameters:

features (int) – the features to deactivate

Deactivates the given features, leaving the object in the state it was before they were enabled.

This is seldom needed to call manually, but it can be used to save resources if some features are no longer needed.

get_active_features()
Returns:

A bitset containing the active features of this object

Return type:

int

Gets the active features of this object.

get_core()
Returns:

the core associated with this object

Return type:

Wp.Core

Gets the core associated with this object.

get_id()
Return type:

int

Gets the unique wireplumber Id of this object.

get_supported_features()
Returns:

A bitset containing the supported features of this object; note that supported features may change at runtime

Return type:

int

Gets the supported features of this object.

test_active_features(features)
Parameters:

features (int) – the features to check

Returns:

True if all the given features are active on this object

Return type:

bool

Checks if the given features are active on this object.

New in version 0.5.0.

test_supported_features(features)
Parameters:

features (int) – the features to check

Returns:

True if all the given features are supported on this object

Return type:

bool

Checks if the given features are supported on this object.

New in version 0.5.0.

update_features(activated, deactivated)
Parameters:
  • activated (int) – the features that were activated, or 0

  • deactivated (int) – the features that were deactivated, or 0

Allows subclasses to update the currently active features.

activated should contain new features and deactivated should contain features that were just deactivated. Calling this method also advances the activation transitions. Private method to be called by subclasses only.

do_activate_execute_step(transition, step, missing) virtual
Parameters:
do_activate_get_next_step(transition, step, missing) virtual
Parameters:
Return type:

int

do_deactivate(features) virtual
Parameters:

features (int) – the features to deactivate

Deactivates the given features, leaving the object in the state it was before they were enabled.

This is seldom needed to call manually, but it can be used to save resources if some features are no longer needed.

do_get_supported_features() virtual
Returns:

A bitset containing the supported features of this object; note that supported features may change at runtime

Return type:

int

Gets the supported features of this object.

Property Details

Wp.Object.props.active_features
Name:

active-features

Type:

int

Default Value:

0

Flags:

READABLE

The active WpObjectFeatures on this proxy

Wp.Object.props.core
Name:

core

Type:

Wp.Core

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Wp.Core

Wp.Object.props.id
Name:

id

Type:

int

Default Value:

0

Flags:

READABLE

The object unique id

Wp.Object.props.supported_features
Name:

supported-features

Type:

int

Default Value:

0

Flags:

READABLE

The supported WpObjectFeatures on this proxy