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.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
) – aClapper.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:
Get the index of
Clapper.MediaItem
withinClapper.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.Queue
is set to use gapless progression.
- get_instant()¶
-
Get if
Clapper.Queue
is set to use instant media item changes.
- get_progression_mode()¶
- Returns:
a currently set
Clapper.QueueProgressionMode
.- Return type:
Get the
Clapper.QueueProgressionMode
of theClapper.Queue
.
- insert_item(item, index)¶
- Parameters:
item (
Clapper.MediaItem
) – aClapper.MediaItem
index (
int
) – the index to place item in queue, -1 to append
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
) – aClapper.MediaItem
to check- Returns:
- Return type:
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
) – aClapper.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:
item (
Clapper.MediaItem
) – aClapper.MediaItem
index (
int
) – the index to place item in queue, -1 to place at the end
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:
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
orNone
) – aClapper.MediaItem
orNone
to unselect- Returns:
True
if item could be selected/unselected,False
if it was not in the queue.- Return type:
Selects
Clapper.MediaItem
from self as current one or unselects currently selected item when item isNone
.
- select_next_item()¶
-
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()¶
-
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)¶
-
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)¶
-
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
) – aClapper.QueueProgressionMode
Set the
Clapper.QueueProgressionMode
of theClapper.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:
Removes
Clapper.MediaItem
at 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.