mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
Add MPRIS support
Besides MPRIS support, this also adds support for hasPrevious() and hasNext() in several parts to determine whether the player/playlist/shuffler has a previous or next item.
This commit is contained in:
parent
757327ceac
commit
54235f298e
23 changed files with 2574 additions and 2 deletions
|
@ -16,13 +16,23 @@ ApplicationWindow {
|
|||
height: 600
|
||||
visible: true
|
||||
property int _oldDepth: 0
|
||||
property alias playbackManager: playbackManager
|
||||
property alias playbackManager: _playbackManager
|
||||
|
||||
J.PlaybackManager {
|
||||
id: playbackManager
|
||||
id: _playbackManager
|
||||
apiClient: ApiClient
|
||||
}
|
||||
|
||||
J.PlatformMediaControl {
|
||||
playbackManager: appWindow.playbackManager
|
||||
canQuit: true
|
||||
onQuitRequested: appWindow.close()
|
||||
desktopFile: "sailfin"
|
||||
playerName: "Sailfin"
|
||||
canRaise: true
|
||||
onRaiseRequested: appWindow.raise()
|
||||
}
|
||||
|
||||
background: Background {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
|
@ -77,6 +87,7 @@ ApplicationWindow {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Previous"
|
||||
onClicked: playbackManager.previous();
|
||||
enabled: playbackManager.hasPrevious
|
||||
}
|
||||
Button {
|
||||
readonly property bool _playing: playbackManager.playbackState === MediaPlayer.PlayingState;
|
||||
|
@ -88,6 +99,7 @@ ApplicationWindow {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Next"
|
||||
onClicked: playbackManager.next();
|
||||
enabled: playbackManager.hasNext
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue