mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
WIP: Add playlists/queues and add support for Sailfish back
This commit is contained in:
parent
fbc154fb56
commit
86672be051
89 changed files with 1637 additions and 849 deletions
|
@ -2,6 +2,8 @@ import QtQuick 2.12
|
|||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
import QtMultimedia 5.12
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
|
||||
import "components"
|
||||
|
@ -18,6 +20,7 @@ ApplicationWindow {
|
|||
|
||||
J.PlaybackManager {
|
||||
id: playbackManager
|
||||
apiClient: ApiClient
|
||||
}
|
||||
|
||||
background: Background {
|
||||
|
@ -49,16 +52,45 @@ ApplicationWindow {
|
|||
ApiClient.restoreSavedSession()
|
||||
}
|
||||
|
||||
footer: Column {
|
||||
footer: Item {
|
||||
id: footer
|
||||
Text {
|
||||
text: qsTr("Now playing")
|
||||
color: "white"
|
||||
height: Math.max(details.height, playButtons.height)
|
||||
Column {
|
||||
id: details
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Text {
|
||||
text: qsTr("Now playing")
|
||||
color: "white"
|
||||
}
|
||||
Text {
|
||||
text: "%1\n%2".arg(playbackManager.item.name ? playbackManager.item.name : "Nothing").arg(playbackManager.streamUrl)
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: playbackManager.item.name ? playbackManager.item.name : "Nothing"
|
||||
color: "white"
|
||||
Row {
|
||||
id: playButtons
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
}
|
||||
Button {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Previous"
|
||||
onClicked: playbackManager.previous();
|
||||
}
|
||||
Button {
|
||||
readonly property bool _playing: manager.playbackState === MediaPlayer.PlayingState;
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: _playing ? "Pause" : "Play"
|
||||
onClicked: _playing ? playbackManager.pause() : playbackManager.play()
|
||||
}
|
||||
Button {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Next"
|
||||
onClicked: playbackManager.next();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
color: "darkblue"
|
||||
|
|
|
@ -38,22 +38,24 @@ Page {
|
|||
height: parent.height / 3
|
||||
source: ApiClient.baseUrl + "/Items/" + itemId + "/Images/Primary?tag=" + jellyfinItem.tag
|
||||
}
|
||||
J.ItemModel {
|
||||
id: tracks
|
||||
loader: J.UserItemsLoader {
|
||||
apiClient: ApiClient
|
||||
parentId: detailPage.itemId
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
width: parent.width
|
||||
height: parent.height / 3 * 2
|
||||
anchors.bottom: parent.bottom
|
||||
model: J.ItemModel {
|
||||
loader: J.UserItemsLoader {
|
||||
apiClient: ApiClient
|
||||
parentId: detailPage.itemId
|
||||
}
|
||||
}
|
||||
delegate: ItemDelegate{
|
||||
model: tracks
|
||||
delegate: ItemDelegate {
|
||||
icon.source: ApiClient.baseUrl + "/Items/" + model.jellyfinId + "/Images/Primary?tag=" + model.tag
|
||||
text: model.name
|
||||
width: parent.width
|
||||
onClicked: playbackManager.playItem(model.jellyfinId)
|
||||
width: ListView.view.width
|
||||
onClicked: playbackManager.playItemInList(tracks, model.index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[Controls]
|
||||
Style=SailfinStyle
|
||||
FallbackStyle=Universal
|
||||
FallbackStyle=Material
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue