Clapper.EnhancerProxy¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/en |
|||
r/en |
|||
r/en |
|||
r/en |
|||
r/w/en |
|||
r/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Clapper.EnhancerProxy(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
- Returns:
whether list named with key existed and contained value.
- Return type:
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 returnTrue.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()¶
-
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:
Get extra data from enhancer plugin info file specified by key.
Extra data in the plugin info file is prefixed with
X-. For exampleX-Schemes=https.New in version 0.10.
- get_friendly_name()¶
- Returns:
name of the proxied enhancer.
- Return type:
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:
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:
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.Settingsinstance for an enhancer.- Return type:
Gio.SettingsorNone
Get
Gio.Settingsof 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:
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.GTypeinterfaces.- Return type:
[
GObject.GType] orNone
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.ParamSpecobjects.- Return type:
[
GObject.ParamSpec] orNone
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()¶
-
Get version string from enhancer plugin info file.
New in version 0.10.
- set_locally(table)¶
- Parameters:
table ({
str:GObject.Value}) – aGLib.HashTablewith 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 interfaceGObject.GType- Returns:
whether target implements given interface.
- Return type:
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:
- Default Value:
- Flags:
Description from enhancer plugin info file.
New in version 0.10.
- Clapper.EnhancerProxy.props.friendly_name¶
- Name:
friendly-name- Type:
- Default Value:
- Flags:
Name from enhancer plugin info file.
New in version 0.10.
- Clapper.EnhancerProxy.props.module_dir¶
- Name:
module-dir- Type:
- Default Value:
- Flags:
Module directory.
New in version 0.10.
- Clapper.EnhancerProxy.props.module_name¶
- Name:
module-name- Type:
- Default Value:
- Flags:
Module name from enhancer plugin info file.
New in version 0.10.
- Clapper.EnhancerProxy.props.target_creation_allowed¶
- Name:
target-creation-allowed- Type:
- Default Value:
- Flags:
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 onLOCALproxy 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:
- Default Value:
- Flags:
Version from enhancer plugin info file.
New in version 0.10.