mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
Discover remote sessions
Adds a way of discovering remote sessions and in Jellyfin the UI.
This commit is contained in:
parent
b1bd15f2c1
commit
b257fe60aa
20 changed files with 1051 additions and 80 deletions
|
@ -26,7 +26,7 @@ set(sailfin_QML_SOURCES
|
|||
qml/components/videoplayer/VideoError.qml
|
||||
qml/components/videoplayer/VideoHud.qml
|
||||
qml/components/IconListItem.qml
|
||||
qml/components/ItemChildrenShowcase.qml
|
||||
qml/components/ItemChildrenShowcase.qml
|
||||
qml/components/JItem.qml
|
||||
qml/components/LibraryItemDelegate.qml
|
||||
qml/components/MoreSection.qml
|
||||
|
@ -39,14 +39,15 @@ set(sailfin_QML_SOURCES
|
|||
qml/components/UserGridDelegate.qml
|
||||
qml/components/VideoPlayer.qml
|
||||
qml/components/VideoTrackSelector.qml
|
||||
qml/cover/CollectionPage.qml
|
||||
qml/cover/CollectionPage.qml
|
||||
qml/cover/PosterCover.qml
|
||||
qml/cover/NowPlayingCover.qml
|
||||
qml/cover/NowPlayingCover.qml
|
||||
qml/pages/LegalPage.qml
|
||||
qml/pages/MainPage.qml
|
||||
qml/pages/AboutPage.qml
|
||||
qml/harbour-sailfin.qml
|
||||
qml/pages/ConnectingPage.qml
|
||||
qml/harbour-sailfin.qml
|
||||
qml/pages/ConnectingPage.qml
|
||||
qml/pages/ControllableDevicesPage.qml
|
||||
qml/pages/SettingsPage.qml
|
||||
qml/pages/VideoPage.qml
|
||||
qml/pages/itemdetails/BaseDetailPage.qml
|
||||
|
@ -54,8 +55,8 @@ set(sailfin_QML_SOURCES
|
|||
qml/pages/itemdetails/EpisodePage.qml
|
||||
qml/pages/itemdetails/FilmPage.qml
|
||||
qml/pages/itemdetails/MusicAlbumPage.qml
|
||||
qml/pages/itemdetails/MusicArtistPage.qml
|
||||
qml/pages/itemdetails/MusicLibraryPage.qml
|
||||
qml/pages/itemdetails/MusicArtistPage.qml
|
||||
qml/pages/itemdetails/MusicLibraryPage.qml
|
||||
qml/pages/itemdetails/PhotoPage.qml
|
||||
qml/pages/itemdetails/SeasonPage.qml
|
||||
qml/pages/itemdetails/SeriesPage.qml
|
||||
|
|
|
@ -267,7 +267,16 @@ PanelBackground {
|
|||
states: [
|
||||
State {
|
||||
name: ""
|
||||
when: manager.playbackState !== J.PlayerState.Stopped && !isFullPage && !("__hidePlaybackBar" in pageStack.currentPage)
|
||||
// Show the bar whenever:
|
||||
// 1. Either one of the following is true:
|
||||
// a. The playbackmanager is playing media
|
||||
// b. The playbackmanager is controlling a remote session
|
||||
// AND
|
||||
// 2. The playback bar isn't in the full page state
|
||||
// AND
|
||||
// 3. The topmost page on the pagestack hasn't requested to hide the page
|
||||
when: (manager.playbackState !== J.PlayerState.Stopped || !manager.controllingSessionLocal)
|
||||
&& !isFullPage && !("__hidePlaybackBar" in pageStack.currentPage)
|
||||
},
|
||||
State {
|
||||
name: "large"
|
||||
|
|
|
@ -50,6 +50,7 @@ ApplicationWindow {
|
|||
ApiClient {
|
||||
id: _apiClient
|
||||
objectName: "Test"
|
||||
appName: "Sailfin"
|
||||
supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayMessage]
|
||||
}
|
||||
|
||||
|
|
63
sailfish/qml/pages/ControllableDevicesPage.qml
Normal file
63
sailfish/qml/pages/ControllableDevicesPage.qml
Normal file
|
@ -0,0 +1,63 @@
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0 as J
|
||||
import ".."
|
||||
|
||||
Page {
|
||||
id: pageRoot
|
||||
SilicaListView {
|
||||
id: listView
|
||||
anchors.fill: parent
|
||||
contentHeight: Theme.itemSizeLarge
|
||||
|
||||
header: PageHeader {
|
||||
//: Page title: page for remote controlling other Jellyfin apps
|
||||
title: qsTr("Remote control")
|
||||
}
|
||||
model: J.RemoteDeviceList {
|
||||
id: deviceList
|
||||
apiClient: appWindow.apiClient
|
||||
scanning: pageRoot.status == PageStatus.Active
|
||||
}
|
||||
|
||||
delegate: ListItem {
|
||||
property bool isConnected: model.jellyfinId === appWindow.playbackManager.controllingSessionId
|
||||
onClicked: deviceList.activateSession(appWindow.playbackManager, model.index)
|
||||
contentHeight: Theme.itemSizeMedium
|
||||
HighlightImage {
|
||||
id: deviceIcon
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: Theme.horizontalPageMargin
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
height: parent.contentHeight - 2 * Theme.paddingMedium
|
||||
width: height
|
||||
source: "image://theme/icon-m-computer"
|
||||
highlighted: parent.down || isConnected
|
||||
}
|
||||
Column {
|
||||
anchors {
|
||||
left: deviceIcon.right
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: Theme.paddingLarge
|
||||
rightMargin: Theme.horizontalPageMargin
|
||||
}
|
||||
Label {
|
||||
id: deviceName
|
||||
//: List of devices item title in the form of <app name> — <device name>
|
||||
text: qsTr("%1 — %2").arg(model.name).arg(model.deviceName)
|
||||
color: isConnected || highlighted ? Theme.highlightColor : Theme.primaryColor
|
||||
}
|
||||
Label {
|
||||
id: deviceUser
|
||||
text: model.userName
|
||||
color: isConnected || highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -45,6 +45,11 @@ Page {
|
|||
text: qsTr("Settings")
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
|
||||
}
|
||||
MenuItem {
|
||||
//: Pulley menu item: shows controllable device page
|
||||
text: qsTr("Remote control")
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("ControllableDevicesPage.qml"))
|
||||
}
|
||||
MenuItem {
|
||||
//: Pulley menu item: reload items on page
|
||||
text: qsTr("Reload")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue