Clapper.Queue

g Clapper.Queue Clapper.Queue GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gio.ListModel->Clapper.Queue Gst.Object->Clapper.Queue

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

add_item (item)

clear ()

find_item (item)

get_current_index ()

get_current_item ()

get_gapless ()

get_instant ()

get_progression_mode ()

insert_item (item, index)

item_is_current (item)

remove_index (index)

remove_item (item)

reposition_item (item, index)

select_index (index)

select_item (item)

select_next_item ()

select_previous_item ()

set_gapless (gapless)

set_instant (instant)

set_progression_mode (mode)

steal_index (index)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7), Gio.ListModel (3)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

current-index

int

r/w/en

current-item

Clapper.MediaItem

r/en

gapless

bool

r/w/en

instant

bool

r/w/en

n-items

int

r/en

progression-mode

Clapper.QueueProgressionMode

r/w/en

Signals

Inherited:

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

Fields

Inherited:

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

Class Details

class Clapper.Queue(**kwargs)
Bases:

Gst.Object, Gio.ListModel

Abstract:

No

Structure:

Clapper.QueueClass

A queue of media to be played.

add_item(item)
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem

Add another Clapper.MediaItem to the end of queue.

If item is already in queue, this function will do nothing, so it is safe to call multiple times if unsure.

clear()

Removes all media items from the queue.

If queue is empty, this function will do nothing, so it is safe to call multiple times if unsure.

find_item(item)
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem to search for

Returns:

True if item is one of the elements of queue.

index:

return location for the index of the element, if found

Return type:

(bool, index: int)

Get the index of Clapper.MediaItem within Clapper.Queue.

get_current_index()
Returns:

Current item index or [const`Clapper`.QUEUE_INVALID_POSITION] when nothing is selected.

Return type:

int

Get index of the currently selected Clapper.MediaItem.

get_current_item()
Returns:

The current Clapper.MediaItem.

Return type:

Clapper.MediaItem or None

Get the currently selected Clapper.MediaItem.

get_gapless()
Returns:

True if enabled, False otherwise.

Return type:

bool

Get if Clapper.Queue is set to use gapless progression.

get_instant()
Returns:

True if enabled, False otherwise.

Return type:

bool

Get if Clapper.Queue is set to use instant media item changes.

get_progression_mode()
Returns:

a currently set Clapper.QueueProgressionMode.

Return type:

Clapper.QueueProgressionMode

Get the Clapper.QueueProgressionMode of the Clapper.Queue.

insert_item(item, index)
Parameters:

Insert another Clapper.MediaItem at index position to the queue.

If item is already in queue, this function will do nothing, so it is safe to call multiple times if unsure.

item_is_current(item)
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem to check

Returns:

True if item is a current media item, False otherwise.

Return type:

bool

Checks if given Clapper.MediaItem is currently selected.

remove_index(index)
Parameters:

index (int) – an item index

Removes Clapper.MediaItem at index from the queue.

remove_item(item)
Parameters:

item (Clapper.MediaItem) – a Clapper.MediaItem

Removes Clapper.MediaItem from the queue.

If item either was never in the queue or was removed from it earlier, this function will do nothing, so it is safe to call multiple times if unsure.

reposition_item(item, index)
Parameters:

Change position of one Clapper.MediaItem within the queue.

Note that the index is the new position you expect item to be after whole reposition operation is finished.

If item is not in the queue, this function will do nothing.

select_index(index)
Parameters:

index (int) – an item index or [const`Clapper`.QUEUE_INVALID_POSITION] to unselect

Returns:

True if item at index could be selected/unselected, False if index was out of queue range.

Return type:

bool

Selects Clapper.MediaItem at index from self as current one or unselects currently selected index when index is [const`Clapper`.QUEUE_INVALID_POSITION].

select_item(item)
Parameters:

item (Clapper.MediaItem or None) – a Clapper.MediaItem or None to unselect

Returns:

True if item could be selected/unselected, False if it was not in the queue.

Return type:

bool

Selects Clapper.MediaItem from self as current one or unselects currently selected item when item is None.

select_next_item()
Returns:

True if there was another media item in queue, False otherwise.

Return type:

bool

Selects next Clapper.MediaItem from self for playback.

Note that this will try to select next item in the order of the queue, regardless of [enum`Clapper`.QueueProgressionMode] set.

select_previous_item()
Returns:

True if there was previous media item in queue, False otherwise.

Return type:

bool

Selects previous Clapper.MediaItem from self for playback.

Note that this will try to select previous item in the order of the queue, regardless of [enum`Clapper`.QueueProgressionMode] set.

set_gapless(gapless)
Parameters:

gapless (bool) – True to enable, False otherwise.

Set Clapper.Queue progression to be gapless.

Gapless playback will try to re-use as much as possible of underlying GStreamer elements when Clapper.Queue progresses, removing any potential gap in the data.

Enabling this option mostly makes sense when used together with [property`Clapper`.Queue:progression-mode] property set to [enum`Clapper`.QueueProgressionMode.CONSECUTIVE].

NOTE: This feature within GStreamer is rather new and might still cause playback issues. Disabled by default.

set_instant(instant)
Parameters:

instant (bool) – True to enable, False otherwise.

Set Clapper.Queue media item changes to be instant.

Instant will try to re-use as much as possible of underlying GStreamer elements when Clapper.MediaItem is selected, allowing media item change requests to be faster.

NOTE: This feature within GStreamer is rather new and might still cause playback issues. Disabled by default.

set_progression_mode(mode)
Parameters:

mode (Clapper.QueueProgressionMode) – a Clapper.QueueProgressionMode

Set the Clapper.QueueProgressionMode of the Clapper.Queue.

Changing the mode set will alter next item selection at the end of playback. For possible values and their descriptions, see Clapper.QueueProgressionMode documentation.

steal_index(index)
Parameters:

index (int) – an item index

Returns:

The removed Clapper.MediaItem at index.

Return type:

Clapper.MediaItem or None

Removes Clapper.MediaItem at index from the queue.

Property Details

Clapper.Queue.props.current_index
Name:

current-index

Type:

int

Default Value:

4294967295

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Index of currently selected media item for playback.

Clapper.Queue.props.current_item
Name:

current-item

Type:

Clapper.MediaItem

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Currently selected media item for playback.

Clapper.Queue.props.gapless
Name:

gapless

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Use gapless progression.

Clapper.Queue.props.instant
Name:

instant

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Use instant media item changes.

Clapper.Queue.props.n_items
Name:

n-items

Type:

int

Default Value:

0

Flags:

READABLE, EXPLICIT_NOTIFY

Number of media items in the queue.

Clapper.Queue.props.progression_mode
Name:

progression-mode

Type:

Clapper.QueueProgressionMode

Default Value:

Clapper.QueueProgressionMode.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Queue progression mode.