1
struct Queue : QAbstractProxyModel {
4
#include "playlist/queue.h"
8
A model containing the list of songs that are enqueued on a playlist.
10
In Clementine each L{Playlist} has its own Queue object. The Queue keeps an
11
ordered list of items that are enqueued on that playlist. Whenever a song
12
finishes the top item is removed from the Queue and is played immediately.
13
When there are no items left on the Queue playback continues again in the normal
16
The L{Playlist} is a standard Qt item model where each row represents one item
17
in the playlist. The Queue is a Qt proxy model on top of the Playlist model,
18
which means that rows in the Queue can map directly onto rows in the Playlist.
19
Use C{mapToSource(index)} and C{mapFromSource(index)} to map rows in the Queue
20
to or from rows in the Playlist.
22
You can't create Queue objects directly. Instead you have to get a Queue from
25
>>> queue = clementine.playlists.current().queue()
30
static const char* kRowsMimetype;
32
bool is_empty() const;
35
Checks whether the queue is empty.
38
int PositionOf(const QModelIndex& source_index) const;
40
PositionOf(source_index) -> int
41
Finds the position in the Queue of a playlist item.
43
@param source_index: The index of an item in the underlying L{Playlist} model.
44
@type source_index: L{PyQt4.QtCore.QModelIndex}
45
@return: The position in the queue of the playlist item, or -1 if the playlist
46
item is invalid or is not in the queue.
49
bool ContainsSourceRow(int source_row) const;
51
ContainsSourceRow(source_row) -> bool
52
Checks whether a playlist row is in the queue.
54
@param source_row: The row number of an item in the underlying L{Playlist} model.
61
Returns the row number in the L{Playlist} of the next item in the queue, leaving
68
Like L{PeekNext()}, but removes the item from the Queue as well as returning it.
71
void ToggleTracks(const QModelIndexList& source_indexes);
73
ToggleTracks(source_indexes)
74
Adds or removes the Playlist indexes to/from the queue.
76
@param source_indexes: A list of indexes from the underlying L{Playlist} model.
77
@type source_indexes: list of L{PyQt4.QtCore.QModelIndex}es
83
Removes all the items from the Queue.
86
void Move(const QList<int>& proxy_rows, int pos);
89
Moves a list of queued items to a different position in the queue.
93
# Moves the second item to the front.
96
# Moves the first three items to the end.
97
queue.Move([0, 1, 2], queue.rowCount() - 1)
99
@param proxy_rows: A list of row numbers of items already in the queue.
100
@type proxy_rows: list of ints
101
@param pos: The new position in which to insert the items.
105
void MoveUp(int row);
108
Moves the queued item up one position in the Queue.
110
This is equivalent to::
112
queue.Move([row], row - 1)
115
void MoveDown(int row);
118
Moves the queued item down one position in the Queue.
120
This is equivalent to::
122
queue.Move([row], row + 2)