Very basic playlist support
This commit is contained in:
parent
63518483a3
commit
77b24d58cb
6 changed files with 149 additions and 0 deletions
|
@ -57,6 +57,15 @@ Item {
|
|||
player.playbackEpisode(id);
|
||||
}
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
player.enqueueEpisode(id, function () {
|
||||
if (!player.isPlaying) {
|
||||
player.jumpToQueueIndex(0);
|
||||
}
|
||||
pgst.loadPage('PlayerPage.qml');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
IconMenuItem {
|
||||
|
|
|
@ -47,6 +47,20 @@ SlidePage {
|
|||
py.call('main.mark_episodes_as_old', [page.podcast_id]);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Enqueue episodes in player',
|
||||
callback: function () {
|
||||
var startPlayback = Util.atMostOnce(function () {
|
||||
if (!player.isPlaying) {
|
||||
player.jumpToQueueIndex(0);
|
||||
}
|
||||
});
|
||||
|
||||
episodeList.model.forEachEpisode(function (episode) {
|
||||
player.enqueueEpisode(episode.id, startPlayback);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Podcast details',
|
||||
callback: function () {
|
||||
|
|
|
@ -190,6 +190,67 @@ SlidePage {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: 'Play queue'
|
||||
visible: playQueueRepeater.count > 0
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: playQueueRepeater
|
||||
model: player.queue
|
||||
|
||||
property var queueConnections: Connections {
|
||||
target: player
|
||||
|
||||
onQueueUpdated: {
|
||||
playQueueRepeater.model = player.queue;
|
||||
}
|
||||
}
|
||||
|
||||
ButtonArea {
|
||||
height: Constants.layout.item.height * pgst.scalef
|
||||
width: parent.width
|
||||
transparent: true
|
||||
|
||||
PLabel {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: Constants.layout.padding * pgst.scalef
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
text: modelData.title
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
player.jumpToQueueIndex(index);
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
pgst.showSelection([
|
||||
{
|
||||
label: 'Shownotes',
|
||||
callback: function () {
|
||||
pgst.loadPage('EpisodeDetail.qml', {
|
||||
episode_id: modelData.episode_id,
|
||||
title: modelData.title
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Remove from queue',
|
||||
callback: function () {
|
||||
player.removeQueueIndex(index);
|
||||
},
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue