2020-09-27 18:38:33 +00:00
|
|
|
/*
|
|
|
|
Sailfin: a Jellyfin client written using Qt
|
|
|
|
Copyright (C) 2020 Chris Josten
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
import QtQuick 2.6
|
|
|
|
import QtMultimedia 5.6
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
2020-09-25 15:14:44 +00:00
|
|
|
import nl.netsoj.chris.Jellyfin 1.0
|
|
|
|
|
|
|
|
import "../components"
|
|
|
|
|
2020-10-10 12:30:49 +00:00
|
|
|
PosterCover {
|
2021-08-22 23:53:20 +00:00
|
|
|
readonly property var player: appWindow.playbackManager
|
2020-09-25 12:46:39 +00:00
|
|
|
|
2020-10-01 22:13:05 +00:00
|
|
|
Shim {
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
bottom: parent.bottom
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
height: Theme.iconSizeLarge
|
|
|
|
}
|
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
CoverActionList {
|
2021-09-09 03:57:41 +00:00
|
|
|
enabled: player.hasNext
|
|
|
|
CoverAction {
|
|
|
|
iconSource: player.playbackState === MediaPlayer.PlayingState ? "image://theme/icon-cover-pause"
|
|
|
|
: "image://theme/icon-cover-play"
|
|
|
|
onTriggered: {
|
|
|
|
if (player.playbackState === MediaPlayer.PlayingState) {
|
|
|
|
player.pause()
|
|
|
|
} else {
|
|
|
|
player.play()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CoverAction {
|
|
|
|
iconSource: "image://theme/icon-cover-next-song"
|
|
|
|
onTriggered: player.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CoverActionList {
|
|
|
|
enabled: !player.hasNext
|
2020-09-25 12:46:39 +00:00
|
|
|
CoverAction {
|
|
|
|
iconSource: player.playbackState === MediaPlayer.PlayingState ? "image://theme/icon-cover-pause"
|
|
|
|
: "image://theme/icon-cover-play"
|
2020-09-25 15:14:44 +00:00
|
|
|
onTriggered: {
|
|
|
|
if (player.playbackState === MediaPlayer.PlayingState) {
|
|
|
|
player.pause()
|
|
|
|
} else {
|
|
|
|
player.play()
|
|
|
|
}
|
|
|
|
}
|
2020-09-25 12:46:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|