Clapper.EnhancerProxy

g Clapper.EnhancerProxy Clapper.EnhancerProxy GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Object->Clapper.EnhancerProxy

Subclasses:

None

Methods

Inherited:

Gst.Object (29), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

extra_data_lists_value (key, value)

get_description ()

get_extra_data (key)

get_friendly_name ()

get_module_dir ()

get_module_name ()

get_settings ()

get_target_creation_allowed ()

get_target_interfaces ()

get_target_properties ()

get_version ()

set_locally (table)

set_target_creation_allowed (allowed)

target_has_interface (iface_type)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

description

str

r/en

friendly-name

str

r/en

module-dir

str

r/en

module-name

str

r/en

target-creation-allowed

bool

r/w/en

version

str

r/en

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Class Details

class Clapper.EnhancerProxy(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

Clapper.EnhancerProxyClass

An intermediary between player and enhancer plugin.

Applications can use this to inspect enhancer information, its properties and configure them.

Clapper player manages all enhancers internally, including creating when needed and destroying them later. Instead, it provides access to so called enhancer proxy objects which allow to browse available enhancer properties and store their config either globally or locally for each player instance.

Use [func`Clapper`.get_global_enhancer_proxies] or [property`Clapper`.Player:enhancer-proxies] property to access a [class`Clapper`.EnhancerProxyList] of available enhancer proxies. While both lists include the same amount of proxies, the difference is which properties can be configured in which list. Only the latter allows tweaking of local (per player instance) properties using [method`Clapper`.EnhancerProxy.set_locally] function.

New in version 0.10.

extra_data_lists_value(key, value)
Parameters:
  • key (str) – name of the data to lookup

  • value (str) – string to check for

Returns:

whether list named with key existed and contained value.

Return type:

bool

A convenience function to check whether self plugin file has an extra data field with key that among separated list of values includes value (works on single value lists too).

For example, when extra data in the plugin is X-Schemes=https;http, calling this function with “X-Schemes” as key and “http” as value will return True.

It is also safe to call this function when there is no such key in plugin info file. Use [method`Clapper`.EnhancerProxy.get_extra_data] if you need to know whether key exists.

New in version 0.10.

get_description()
Returns:

description of the proxied enhancer.

Return type:

str or None

Get description from enhancer plugin info file.

New in version 0.10.

get_extra_data(key)
Parameters:

key (str) – name of the data to lookup

Returns:

extra data value of the proxied enhancer.

Return type:

str or None

Get extra data from enhancer plugin info file specified by key.

Extra data in the plugin info file is prefixed with X-. For example X-Schemes=https.

New in version 0.10.

get_friendly_name()
Returns:

name of the proxied enhancer.

Return type:

str

Get a name from enhancer plugin info file. Can be used for showing in UI and such.

Name field in plugin info file is mandatory, so this function never returns None.

New in version 0.10.

get_module_dir()
Returns:

installation directory of the proxied enhancer.

Return type:

str

Get a path to the directory from which enhancer is loaded.

New in version 0.10.

get_module_name()
Returns:

name of the proxied enhancer.

Return type:

str

Get name of the module from enhancer plugin info file. This value is used to uniquely identify a particular plugin.

Module name in plugin info file is mandatory, so this function never returns None.

New in version 0.10.

get_settings()
Returns:

A new Gio.Settings instance for an enhancer.

Return type:

Gio.Settings or None

Get Gio.Settings of an enhancer.

Implementations can use this together with [method`Clapper`.EnhancerProxy.get_target_properties] in order to allow user to configure global enhancer properties.

Settings include only keys from properties with [flags`Clapper`.EnhancerParamFlags.GLOBAL] flag and are meant ONLY for user to set. To configure application local enhancer properties, use [method`Clapper`.EnhancerProxy.set_locally] instead.

This function returns a new instance of Gio.Settings, so settings can be accessed from different threads if needed.

New in version 0.10.

get_target_creation_allowed()
Returns:

whether target creation is allowed.

Return type:

bool

Get whether it is allowed to create instances of enhancer that this proxy targets.

New in version 0.10.

get_target_interfaces()
Returns:

an array of GObject.GType interfaces.

Return type:

[GObject.GType] or None

Get an array of interfaces that target enhancer implements.

The returned array includes only Clapper specific interfaces for writing enhancers. Applications should not care about any other interface types that given enhancer is using internally.

New in version 0.10.

get_target_properties()
Returns:

an array of GObject.ParamSpec objects.

Return type:

[GObject.ParamSpec] or None

Get an array of properties in target enhancer.

Implementations can use this in order to find out what properties, type of their values (including valid ranges) are allowed to set for a given enhancer.

Use [flags`Clapper`.EnhancerParamFlags] against flags of given [class`GObject`.ParamSpec] to find out whether they are local, global or neither of them (internal).

The returned array includes only Clapper enhancer specific properties (global and local). Applications can not access any other properties that given enhancer is using internally.

New in version 0.10.

get_version()
Returns:

version string of the proxied enhancer.

Return type:

str or None

Get version string from enhancer plugin info file.

New in version 0.10.

set_locally(table)
Parameters:

table ({str: GObject.Value}) – a GLib.HashTable with property names and values

Same as [method`Clapper`.EnhancerProxy.set_locally], but to configure uses [struct`GLib`.HashTable] with string keys and [struct`GObject`.Value] as their values.

New in version 0.10.

set_target_creation_allowed(allowed)
Parameters:

allowed (bool) – whether allowed

Set whether to allow instances of proxy target to be created.

See [property`Clapper`.EnhancerProxy:target-creation-allowed] for detailed descripton what this does.

New in version 0.10.

target_has_interface(iface_type)
Parameters:

iface_type (GObject.GType) – an interface GObject.GType

Returns:

whether target implements given interface.

Return type:

bool

A convenience function to check if target enhancer implements given interface.

This works only with Clapper specific interfaces as iface_type for writing enhancers. Applications should not care about any other interface types that given enhancer is using internally.

New in version 0.10.

Property Details

Clapper.EnhancerProxy.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Description from enhancer plugin info file.

New in version 0.10.

Clapper.EnhancerProxy.props.friendly_name
Name:

friendly-name

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Name from enhancer plugin info file.

New in version 0.10.

Clapper.EnhancerProxy.props.module_dir
Name:

module-dir

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Module directory.

New in version 0.10.

Clapper.EnhancerProxy.props.module_name
Name:

module-name

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Module name from enhancer plugin info file.

New in version 0.10.

Clapper.EnhancerProxy.props.target_creation_allowed
Name:

target-creation-allowed

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to allow instances of proxy target to be created.

This effectively means whether the given enhancer can be used.

By default all enhancers that work on-demand ([iface`Clapper`.Extractable], [iface`Clapper`.Playlistable]) are allowed while enhancers implementing [iface`Clapper`.Reactable] are not.

Value of this property from a GLOBAL [class`Clapper`.EnhancerProxyList] will carry over to all newly created [class`Clapper`.Player] objects, while altering this on LOCAL proxy list will only influence given player instance that list belongs to.

Changing this property will not remove already created enhancer instances, thus it is usually best practice to allow/disallow creation of given enhancer plugin right after [class`Clapper`.Player] is created (before it or its queue are used).

New in version 0.10.

Clapper.EnhancerProxy.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Version from enhancer plugin info file.

New in version 0.10.