Clapper.Feature
Description: Reference for Clapper.Feature

### Class

# ClapperFeature

#### Description [src]

    class Clapper.Feature : Gst.Object
    {
      /* No available fields */
    }

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 `gst_object_get_parent()` to acquire a weak reference on a parent `ClapperPlayer` object feature was added to.

#### Hierarchy

#### Ancestors

- GstObject
- GInitiallyUnowned
- GObject

#### Descendants

- ClapperDiscoverer
- ClapperMpris
- ClapperServer

#### Instance methods

##### Methods inherited from GstObject (25)

Please see GstObject for a full list of methods.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

##### Properties inherited from GstObject (2)

###### Gst.Object:name

No description available.

###### Gst.Object:parent

The parent of the object. Please note, that when changing the ‘parent’ property, we don’t emit `GObject::notify` and `GstObject::deep-notify` signals due to locking issues. In some cases one can use `GstBin::element-added` or `GstBin::element-removed` signals on the parent to achieve a similar effect.

#### Signals

##### Signals inherited from GstObject (1)

###### GstObject::deep-notify

The deep notify signal is used to be notified of property changes. It is typically attached to the toplevel bin to receive notifications from all the elements contained in that bin.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct ClapperFeatureClass {
      GstObjectClass parent_class;
      gboolean (* prepare) (
        ClapperFeature* feature
      );
      gboolean (* unprepare) (
        ClapperFeature* feature
      );
      void (* property_changed) (
        ClapperFeature* feature,
        GParamSpec* pspec
      );
      void (* state_changed) (
        ClapperFeature* feature,
        ClapperPlayerState state
      );
      void (* position_changed) (
        ClapperFeature* feature,
        gdouble position
      );
      void (* speed_changed) (
        ClapperFeature* feature,
        gdouble speed
      );
      void (* volume_changed) (
        ClapperFeature* feature,
        gdouble volume
      );
      void (* mute_changed) (
        ClapperFeature* feature,
        gboolean mute
      );
      void (* played_item_changed) (
        ClapperFeature* feature,
        ClapperMediaItem* item
      );
      void (* item_updated) (
        ClapperFeature* feature,
        ClapperMediaItem* item
      );
      void (* queue_item_added) (
        ClapperFeature* feature,
        ClapperMediaItem* item,
        guint index
      );
      void (* queue_item_removed) (
        ClapperFeature* feature,
        ClapperMediaItem* item,
        guint index
      );
      void (* queue_item_repositioned) (
        ClapperFeature* feature,
        guint before,
        guint after
      );
      void (* queue_cleared) (
        ClapperFeature* feature
      );
      void (* queue_progression_changed) (
        ClapperFeature* feature,
        ClapperQueueProgressionMode mode
      );

    }

No description available.

###### Class members

`parent_class: GstObjectClass`

  The object class structure.

`prepare: gboolean (* prepare) ( ClapperFeature* feature )`

  Prepare feature for operation (optional).

`unprepare: gboolean (* unprepare) ( ClapperFeature* feature )`

  Revert the changes done in `prepare` (optional).

`property_changed: void (* property_changed) ( ClapperFeature* feature, GParamSpec* pspec )`

  A property of `feature` changed its value.

`state_changed: void (* state_changed) ( ClapperFeature* feature, ClapperPlayerState state )`

  Player state was changed.

`position_changed: void (* position_changed) ( ClapperFeature* feature, gdouble position )`

  Player position was changed.

`speed_changed: void (* speed_changed) ( ClapperFeature* feature, gdouble speed )`

  Player speed was changed.

`volume_changed: void (* volume_changed) ( ClapperFeature* feature, gdouble volume )`

  Player volume was changed.

`mute_changed: void (* mute_changed) ( ClapperFeature* feature, gboolean mute )`

  Player mute state was changed.

`played_item_changed: void (* played_item_changed) ( ClapperFeature* feature, ClapperMediaItem* item )`

  Currently playing media item got changed.

`item_updated: void (* item_updated) ( ClapperFeature* feature, ClapperMediaItem* item )`

  An item in queue got updated.

`queue_item_added: void (* queue_item_added) ( ClapperFeature* feature, ClapperMediaItem* item, guint index )`

  An item was added to the queue.

`queue_item_removed: void (* queue_item_removed) ( ClapperFeature* feature, ClapperMediaItem* item, guint index )`

  An item was removed from queue.

`queue_item_repositioned: void (* queue_item_repositioned) ( ClapperFeature* feature, guint before, guint after )`

  No description available.

`queue_cleared: void (* queue_cleared) ( ClapperFeature* feature )`

  All items were removed from queue.

`queue_progression_changed: void (* queue_progression_changed) ( ClapperFeature* feature, ClapperQueueProgressionMode mode )`

  Progression mode of the queue was changed.

#### Virtual methods

###### Clapper.FeatureClass.item_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.

###### Clapper.FeatureClass.mute_changed

Player mute state was changed.

###### Clapper.FeatureClass.played_item_changed

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

###### Clapper.FeatureClass.position_changed

Player position was changed.

###### Clapper.FeatureClass.prepare

Prepare feature for operation (optional).

###### Clapper.FeatureClass.property_changed

A property of `feature` changed its value.

###### Clapper.FeatureClass.queue_cleared

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.

###### Clapper.FeatureClass.queue_item_added

An item was added to the queue.

###### Clapper.FeatureClass.queue_item_removed

An item was removed from queue.

###### Clapper.FeatureClass.queue_item_repositioned

An item changed position within queue.

###### Clapper.FeatureClass.queue_progression_changed

Progression mode of the queue was changed.

###### Clapper.FeatureClass.speed_changed

Player speed was changed.

###### Clapper.FeatureClass.state_changed

Player state was changed.

###### Clapper.FeatureClass.unprepare

Revert the changes done in `prepare` (optional).

###### Clapper.FeatureClass.volume_changed

Player volume was changed.