Clapper.Feature

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

Subclasses:

Clapper.Discoverer, Clapper.Mpris, Clapper.Server

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

Virtual Methods

Inherited:

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

do_item_updated (item)

do_mute_changed (mute)

do_played_item_changed (item)

do_position_changed (position)

do_prepare ()

do_property_changed (pspec)

do_queue_cleared ()

do_queue_item_added (item, index)

do_queue_item_removed (item, index)

do_queue_item_repositioned (before, after)

do_queue_progression_changed (mode)

do_speed_changed (speed)

do_state_changed (state)

do_unprepare ()

do_volume_changed (volume)

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

Gst.Object

r

Class Details

class Clapper.Feature(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

Clapper.FeatureClass

A base class for creating new features for the player.

Feature objects are meant for adding additional functionalities that are supposed to either act on playback/properties changes and/or change them themselves due to some external signal/event.

For reacting to playback changes subclass should override this class virtual functions logic, while for controlling playback implementation may call [method`Gst`.Object.get_parent] to acquire a weak reference on a parent [class`Clapper`.Player] object feature was added to.

do_item_updated(item) virtual
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem that was updated

An item in queue got updated. This might be (or not) currently played item. Implementations can get parent player object if they want to check that from its queue.

do_mute_changed(mute) virtual
Parameters:

mute (bool) – True if player is muted, False otherwise

Player mute state was changed.

do_played_item_changed(item) virtual
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem that is now playing

New media item started playing. All following events (such as position changes) will be related to this item from now on.

do_position_changed(position) virtual
Parameters:

position (float) – a decimal number with current position in seconds

Player position was changed.

do_prepare() virtual
Returns:

True on success, False otherwise.

Return type:

bool

Prepare feature for operation (optional).

This is different from init() as its called from features thread once feature is added to the player, so it can already access it parent using Gst.Object.get_parent(). If it fails, no other method will be called.

do_property_changed(pspec) virtual
Parameters:

pspec (GObject.ParamSpec) – a GObject.ParamSpec

A property of feature changed its value.

Useful for reconfiguring feature, since unlike “notify” signal this is always called from the thread that feature works on and only after feature was prepared.

do_queue_cleared() virtual

All items were removed from queue. Note that in such event queue_item_removed will NOT be called for each item for performance reasons. You probably want to implement this function if you also implemented item removal.

do_queue_item_added(item, index) virtual
Parameters:

An item was added to the queue.

do_queue_item_removed(item, index) virtual
Parameters:

An item was removed from queue.

do_queue_item_repositioned(before, after) virtual
Parameters:

An item changed position within queue.

do_queue_progression_changed(mode) virtual
Parameters:

mode (Clapper.QueueProgressionMode) – a Clapper.QueueProgressionMode

Progression mode of the queue was changed.

do_speed_changed(speed) virtual
Parameters:

speed (float) – the playback speed multiplier

Player speed was changed.

do_state_changed(state) virtual
Parameters:

state (Clapper.PlayerState) – a Clapper.PlayerState

Player state was changed.

do_unprepare() virtual
Returns:

True on success, False otherwise.

Return type:

bool

Revert the changes done in prepare (optional).

do_volume_changed(volume) virtual
Parameters:

volume (float) – the volume level

Player volume was changed.