mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 18:22:46 +00:00
Rewire more of Sailfish frontend into new backend
This should encompass most simple things, besides some larger, trickier things, like the video streams and the now-broken userdata
This commit is contained in:
parent
df1e134821
commit
7b6c272aa9
47 changed files with 620 additions and 291 deletions
|
@ -21,7 +21,7 @@ import QtQuick 2.6
|
|||
import QtMultimedia 5.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
|
||||
import "../"
|
||||
|
||||
|
@ -30,7 +30,7 @@ import "../"
|
|||
* +---+--------------------------------------+
|
||||
* |\ /| +---+ |
|
||||
* | \ / | Media title | | |
|
||||
* | X | | ⏸︎| |
|
||||
* | X | | ⏸︎ | |
|
||||
* | / \ | Artist 1, artist 2 | | |
|
||||
* |/ \| +---+ |
|
||||
* +-----+------------------------------------+
|
||||
|
@ -40,13 +40,15 @@ PanelBackground {
|
|||
height: Theme.itemSizeLarge
|
||||
width: parent.width
|
||||
y: parent.height - height
|
||||
property PlaybackManager manager
|
||||
//FIXME: Once QTBUG-10822 is resolved, change to J.PlaybackManager
|
||||
property var manager
|
||||
property bool open
|
||||
property real visibleSize: height
|
||||
property bool isFullPage: false
|
||||
property bool showQueue: false
|
||||
|
||||
property bool _pageWasShowingNavigationIndicator
|
||||
readonly property bool mediaLoading: [MediaPlayer.Loading, MediaPlayer.Buffering].indexOf(manager.mediaStatus) >= 0
|
||||
|
||||
|
||||
transform: Translate {id: playbackBarTranslate; y: 0}
|
||||
|
@ -72,10 +74,11 @@ PanelBackground {
|
|||
}
|
||||
source: largeAlbumArt.source
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
opacity: 1
|
||||
|
||||
Image {
|
||||
id: largeAlbumArt
|
||||
source: Utils.itemImageUrl(ApiClient.baseUrl, manager.item, "Primary")
|
||||
source: Utils.itemImageUrl(apiClient.baseUrl, manager.item, "Primary")
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.fill: parent
|
||||
opacity: 0
|
||||
|
@ -119,11 +122,11 @@ PanelBackground {
|
|||
Label {
|
||||
id: artists
|
||||
text: {
|
||||
if (manager.item == null) return qsTr("Play some media!")
|
||||
console.log(manager.item.type)
|
||||
switch(manager.item.type) {
|
||||
//return manager.item.mediaType;
|
||||
if (manager.item === null) return qsTr("Play some media!")
|
||||
switch(manager.item.mediaType) {
|
||||
case "Audio":
|
||||
return manager.item.artists.join(", ")
|
||||
return manager.item.artists //.join(", ")
|
||||
}
|
||||
return qsTr("Not audio")
|
||||
}
|
||||
|
@ -157,6 +160,7 @@ PanelBackground {
|
|||
icon.source: "image://theme/icon-m-previous"
|
||||
enabled: false
|
||||
opacity: 0
|
||||
onClicked: manager.previous()
|
||||
}
|
||||
|
||||
IconButton {
|
||||
|
@ -182,6 +186,7 @@ PanelBackground {
|
|||
icon.source: "image://theme/icon-m-next"
|
||||
enabled: false
|
||||
opacity: 0
|
||||
onClicked: manager.next()
|
||||
}
|
||||
IconButton {
|
||||
id: queueButton
|
||||
|
@ -206,7 +211,7 @@ PanelBackground {
|
|||
minimumValue: 0
|
||||
value: manager.position
|
||||
maximumValue: manager.duration
|
||||
indeterminate: [MediaPlayer.Loading, MediaPlayer.Buffering].indexOf(manager.mediaStatus) >= 0
|
||||
indeterminate: mediaLoading
|
||||
}
|
||||
|
||||
Slider {
|
||||
|
@ -352,7 +357,7 @@ PanelBackground {
|
|||
},
|
||||
State {
|
||||
name: "hidden"
|
||||
when: (manager.playbackState === MediaPlayer.StoppedState || "__hidePlaybackBar" in pageStack.currentPage) && !isFullPage
|
||||
when: ((manager.playbackState === MediaPlayer.StoppedState && !mediaLoading) || "__hidePlaybackBar" in pageStack.currentPage) && !isFullPage
|
||||
PropertyChanges {
|
||||
target: playbackBarTranslate
|
||||
// + small padding since the ProgressBar otherwise would stick out
|
||||
|
|
|
@ -20,7 +20,7 @@ import QtQuick 2.6
|
|||
import QtMultimedia 5.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
|
||||
import "videoplayer"
|
||||
import "../"
|
||||
|
@ -31,7 +31,8 @@ import "../"
|
|||
|
||||
SilicaItem {
|
||||
id: playerRoot
|
||||
property JellyfinItem item
|
||||
//FIXME: Once QTBUG-10822 is resolved, change to J.Item
|
||||
property var item
|
||||
property string title: item.name
|
||||
property bool resume
|
||||
property int progress
|
||||
|
@ -39,7 +40,8 @@ SilicaItem {
|
|||
readonly property bool hudVisible: !hud.hidden || manager.error !== MediaPlayer.NoError
|
||||
property int audioTrack: 0
|
||||
property int subtitleTrack: 0
|
||||
property PlaybackManager manager;
|
||||
//FIXME: Once QTBUG-10822 is resolved, change to J.PlaybackManager
|
||||
property var manager;
|
||||
|
||||
// Blackground to prevent the ambience from leaking through
|
||||
Rectangle {
|
||||
|
@ -59,21 +61,6 @@ SilicaItem {
|
|||
manager: playerRoot.manager
|
||||
title: videoPlayer.title
|
||||
|
||||
Label {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.horizontalPageMargin
|
||||
text: item.jellyfinId + "\n" + appWindow.playbackManager.streamUrl + "\n"
|
||||
+ (manager.playMethod === PlaybackManager.DirectPlay ? "Direct Play" : "Transcoding") + "\n"
|
||||
+ manager.position + "\n"
|
||||
+ manager.mediaStatus + "\n"
|
||||
// + player.bufferProgress + "\n"
|
||||
// + player.metaData.videoCodec + "@" + player.metaData.videoFrameRate + "(" + player.metaData.videoBitRate + ")" + "\n"
|
||||
// + player.metaData.audioCodec + "(" + player.metaData.audioBitRate + ")" + "\n"
|
||||
// + player.errorString + "\n"
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
wrapMode: "WordWrap"
|
||||
visible: appWindow.showDebugInfo
|
||||
}
|
||||
}
|
||||
|
||||
VideoError {
|
||||
|
@ -81,11 +68,35 @@ SilicaItem {
|
|||
player: manager
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.horizontalPageMargin
|
||||
text: item.jellyfinId + "\n" + appWindow.playbackManager.streamUrl + "\n"
|
||||
+ (manager.playMethod === J.PlaybackManager.DirectPlay ? "Direct Play" : "Transcoding") + "\n"
|
||||
+ manager.position + "\n"
|
||||
+ manager.mediaStatus + "\n"
|
||||
// + player.bufferProgress + "\n"
|
||||
// + player.metaData.videoCodec + "@" + player.metaData.videoFrameRate + "(" + player.metaData.videoBitRate + ")" + "\n"
|
||||
// + player.metaData.audioCodec + "(" + player.metaData.audioBitRate + ")" + "\n"
|
||||
// + player.errorString + "\n"
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
wrapMode: "WordWrap"
|
||||
visible: appWindow.showDebugInfo
|
||||
|
||||
MouseArea {
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
enabled: parent.visible
|
||||
onClicked: Clipboard.text = appWindow.playbackManager.streamUrl
|
||||
}
|
||||
}
|
||||
|
||||
function start() {
|
||||
manager.audioIndex = audioTrack
|
||||
manager.subtitleIndex = subtitleTrack
|
||||
manager.resumePlayback = resume
|
||||
manager.playItem(item.jellyfinId)
|
||||
manager.playItem(item)
|
||||
}
|
||||
|
||||
function stop() {
|
||||
|
|
|
@ -20,11 +20,12 @@ import QtQuick 2.6
|
|||
import Sailfish.Silica 1.0
|
||||
import QtMultimedia 5.6
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
|
||||
Rectangle {
|
||||
id: videoError
|
||||
property PlaybackManager player
|
||||
//FIXME: Once QTBUG-10822 is resolved, change to J.PlaybackManager
|
||||
property var player
|
||||
color: pal.palette.overlayBackgroundColor
|
||||
opacity: player.error === MediaPlayer.NoError ? 0.0 : 1.0
|
||||
Behavior on opacity { FadeAnimator {} }
|
||||
|
|
|
@ -20,7 +20,7 @@ import QtQuick 2.6
|
|||
import QtMultimedia 5.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
|
||||
import "../../Utils.js" as Utils
|
||||
|
||||
|
@ -30,7 +30,8 @@ import "../../Utils.js" as Utils
|
|||
*/
|
||||
Item {
|
||||
id: videoHud
|
||||
property PlaybackManager manager
|
||||
//FIXME: Once QTBUG-10822 is resolved, change to J.PlaybackManager
|
||||
property var manager
|
||||
property string title
|
||||
property bool _manuallyActivated: false
|
||||
readonly property bool hidden: opacity == 0.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue