Clapper.Queue¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Clapper.Queue(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A queue of media to be played.
- add_item(item)¶
- Parameters:
item (
Clapper.MediaItem) – aClapper.MediaItem
Add another
Clapper.MediaItemto 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) – aClapper.MediaItemto search for- Returns:
Trueif item is one of the elements of queue.- index:
return location for the index of the element, if found
- Return type:
Get the index of
Clapper.MediaItemwithinClapper.Queue.
- get_current_index()¶
- Returns:
Current item index or [const`Clapper`.QUEUE_INVALID_POSITION] when nothing is selected.
- Return type:
Get index of the currently selected
Clapper.MediaItem.
- get_current_item()¶
- Returns:
The current
Clapper.MediaItem.- Return type:
Get the currently selected
Clapper.MediaItem.
- get_gapless()¶
-
Get if
Clapper.Queueis set to use gapless progression.
- get_instant()¶
-
Get if
Clapper.Queueis set to use instant media item changes.
- get_progression_mode()¶
- Returns:
a currently set
Clapper.QueueProgressionMode.- Return type:
Get the
Clapper.QueueProgressionModeof theClapper.Queue.
- insert_item(item, index)¶
- Parameters:
item (
Clapper.MediaItem) – aClapper.MediaItemindex (
int) – the index to place item in queue, -1 to append
Insert another
Clapper.MediaItemat 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) – aClapper.MediaItemto check- Returns:
- Return type:
Checks if given
Clapper.MediaItemis currently selected.
- remove_index(index)¶
- Parameters:
index (
int) – an item index
Removes
Clapper.MediaItemat index from the queue.
- remove_item(item)¶
- Parameters:
item (
Clapper.MediaItem) – aClapper.MediaItem
Removes
Clapper.MediaItemfrom 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:
item (
Clapper.MediaItem) – aClapper.MediaItemindex (
int) – the index to place item in queue, -1 to place at the end
Change position of one
Clapper.MediaItemwithin 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:
Trueif item at index could be selected/unselected,Falseif index was out of queue range.- Return type:
Selects
Clapper.MediaItemat 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.MediaItemorNone) – aClapper.MediaItemorNoneto unselect- Returns:
Trueif item could be selected/unselected,Falseif it was not in the queue.- Return type:
Selects
Clapper.MediaItemfrom self as current one or unselects currently selected item when item isNone.
- select_next_item()¶
-
Selects next
Clapper.MediaItemfrom 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()¶
-
Selects previous
Clapper.MediaItemfrom 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)¶
-
Set
Clapper.Queueprogression to be gapless.Gapless playback will try to re-use as much as possible of underlying GStreamer elements when
Clapper.Queueprogresses, 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)¶
-
Set
Clapper.Queuemedia item changes to be instant.Instant will try to re-use as much as possible of underlying GStreamer elements when
Clapper.MediaItemis 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) – aClapper.QueueProgressionMode
Set the
Clapper.QueueProgressionModeof theClapper.Queue.Changing the mode set will alter next item selection at the end of playback. For possible values and their descriptions, see
Clapper.QueueProgressionModedocumentation.
- steal_index(index)¶
- Parameters:
index (
int) – an item index- Returns:
The removed
Clapper.MediaItemat index.- Return type:
Removes
Clapper.MediaItemat index from the queue.
Property Details¶
- Clapper.Queue.props.current_index¶
- Name:
current-index- Type:
- Default Value:
4294967295- Flags:
Index of currently selected media item for playback.
- Clapper.Queue.props.current_item¶
- Name:
current-item- Type:
- Default Value:
- Flags:
Currently selected media item for playback.
- Clapper.Queue.props.gapless¶
- Name:
gapless- Type:
- Default Value:
- Flags:
Use gapless progression.
- Clapper.Queue.props.instant¶
- Name:
instant- Type:
- Default Value:
- Flags:
Use instant media item changes.
- Clapper.Queue.props.n_items¶
- Name:
n-items- Type:
- Default Value:
0- Flags:
Number of media items in the queue.
- Clapper.Queue.props.progression_mode¶
- Name:
progression-mode- Type:
- Default Value:
- Flags:
Queue progression mode.