Clapper.Feature¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clapper.Feature(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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
) – aClapper.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¶
-
Player mute state was changed.
- do_played_item_changed(item) virtual¶
- Parameters:
item (
Clapper.MediaItem
) – aClapper.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¶
-
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
) – aGObject.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:
item (
Clapper.MediaItem
) – aClapper.MediaItem
that was addedindex (
int
) – position at which item was placed in queue
An item was added to the queue.
- do_queue_item_removed(item, index) virtual¶
- Parameters:
item (
Clapper.MediaItem
) – aClapper.MediaItem
that was removedindex (
int
) – position from which item was removed in queue
An item was removed from queue.
- do_queue_item_repositioned(before, after) virtual¶
- Parameters:
before (
int
) – position from whichClapper.MediaItem
was removedafter (
int
) – position at whichClapper.MediaItem
was inserted after removal
An item changed position within queue.
- do_queue_progression_changed(mode) virtual¶
- Parameters:
mode (
Clapper.QueueProgressionMode
) – aClapper.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
) – aClapper.PlayerState
Player state was changed.
- do_unprepare() virtual¶
-
Revert the changes done in prepare (optional).