/*SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>SPDX-License-Identifier: GPL-2.0-or-later*/import QtQuickimport QtQuick.Layoutsimport org.kde.plasma.components as PlasmaComponents3import org.kde.plasma.extras as PlasmaExtrasimport org.kde.kirigami as Kirigamiimport org.kde.plasma.private.mpris as MprisItem {visible: instantiator.count > 0implicitHeight: Kirigami.Units.gridUnit * 3implicitWidth: Kirigami.Units.gridUnit * 16Repeater {id: instantiatormodel: Mpris.MultiplexerModel { }RowLayout {id: controlsRowanchors.fill: parentspacing: 0enabled: model.canControlImage {id: albumArtLayout.preferredWidth: heightLayout.fillHeight: truevisible: status === Image.Loading || status === Image.Readyasynchronous: truefillMode: Image.PreserveAspectFitsource: model.artUrlsourceSize.height: height * Screen.devicePixelRatio}Item { // spacerimplicitWidth: Kirigami.Units.smallSpacingimplicitHeight: 1}ColumnLayout {Layout.fillWidth: truespacing: 0PlasmaComponents3.Label {Layout.fillWidth: trueelide: Text.ElideRightfont.pointSize: Kirigami.Theme.defaultFont.pointSize + 1maximumLineCount: 1text: model.track.length > 0? model.track: (model.playbackStatus > Mpris.PlaybackStatus.Stopped? i18ndc("plasma_shell_org.kde.plasma.desktop", "@info:status", "No title"): i18ndc("plasma_shell_org.kde.plasma.desktop", "@info:status", "No media playing"))textFormat: Text.PlainTextwrapMode: Text.NoWrap}PlasmaExtras.DescriptiveLabel {Layout.fillWidth: truewrapMode: Text.NoWrapelide: Text.ElideRight// if no artist is given, show player name insteadtext: model.artist || model.identitytextFormat: Text.PlainTextfont.pointSize: Kirigami.Theme.smallFont.pointSize + 1maximumLineCount: 1}}PlasmaComponents3.ToolButton {Layout.preferredHeight: Kirigami.Units.gridUnit * 2Layout.preferredWidth: Layout.preferredHeightvisible: model.canGoBack || model.canGoNextenabled: model.canGoPreviousfocusPolicy: Qt.TabFocusicon.name: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward"onClicked: {fadeoutTimer.running = falsemodel.container.Previous()}Accessible.name: i18ndc("plasma_shell_org.kde.plasma.desktop", "@action:button Accessible only", "Previous track")}PlasmaComponents3.ToolButton {Layout.fillHeight: trueLayout.preferredWidth: height // make this button biggerfocusPolicy: Qt.TabFocusicon.name: model.playbackStatus === Mpris.PlaybackStatus.Playing ? "media-playback-pause" : "media-playback-start"onClicked: {fadeoutTimer.running = falsemodel.container.PlayPause()}Accessible.name: i18ndc("plasma_shell_org.kde.plasma.desktop", "@action:button Accessible only", "Play or Pause media")}PlasmaComponents3.ToolButton {Layout.preferredHeight: Kirigami.Units.gridUnit * 2Layout.preferredWidth: Layout.preferredHeightvisible: model.canGoBack || model.canGoNextenabled: model.canGoNextfocusPolicy: Qt.TabFocusicon.name: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward"Accessible.name: i18ndc("plasma_shell_org.kde.plasma.desktop", "@action:button Accessible only", "Next track")onClicked: {fadeoutTimer.running = falsemodel.container.Next()}}}}}