177
195
audioPlayer.source = ''
181
visible: playQueue.length > 0
184
top: mediaPlayerMain.bottom
188
height: playQueueButton.height + Config.smallSpacing
192
anchors.horizontalCenter: parent.horizontalCenter
193
text: _('Play queue') + ' (' + playQueue.length + ')'
194
onClicked: playQueueDialog.showQueue();
197
MultiSelectionDialog {
200
function showQueue() {
201
selectedIndexes = [];
203
for (var index in playQueue) {
204
var episode = playQueue[index];
205
model.append({'name': episode.qtitle, 'position': index});
212
* FIXME: If things have been removed from the play queue while
213
* the dialog was open, we have to subtract the values in
214
* selectedIndexes by the amount of played episodes to get the
215
* right episodes to delete. This is not yet done here.
216
* We can know from the nextInQueue() function (hint, hint)
219
for (var queueIndex in playQueue) {
220
var episode = playQueue[queueIndex];
221
var shouldRemove = false;
223
for (var index in selectedIndexes) {
224
var pos = model.get(selectedIndexes[index]).position;
225
if (queueIndex === pos) {
232
controller.releaseEpisode(episode);
233
/* Implicit removal by absence of newQueue.push() */
235
newQueue.push(episode);
238
playQueue = newQueue;
241
titleText: _('Play queue')
242
acceptButtonText: _('Remove')
198
MultiSelectionDialog {
201
function showQueue() {
202
selectedIndexes = [];
204
for (var index in playQueue) {
205
var episode = playQueue[index];
206
model.append({'name': episode.qtitle, 'position': index});
213
* FIXME: If things have been removed from the play queue while
214
* the dialog was open, we have to subtract the values in
215
* selectedIndexes by the amount of played episodes to get the
216
* right episodes to delete. This is not yet done here.
217
* We can know from the nextInQueue() function (hint, hint)
220
for (var queueIndex in playQueue) {
221
var episode = playQueue[queueIndex];
222
var shouldRemove = false;
224
for (var index in selectedIndexes) {
225
var pos = model.get(selectedIndexes[index]).position;
226
if (queueIndex === pos) {
233
controller.releaseEpisode(episode);
234
/* Implicit removal by absence of newQueue.push() */
236
newQueue.push(episode);
239
playQueue = newQueue;
242
titleText: _('Play queue')
243
acceptButtonText: _('Remove')
248
248
id: mediaPlayerMain
249
249
anchors.fill: mediaPlayer
250
color: Config.mediaPlayerColorBg
253
253
spacing: Config.smallSpacing