Warning, /multimedia/audiotube/src/qtmpris/example/qml/MprisControls.qml is written in an unsupported language. File is not indexed.
0001 //SPDX-FileCopyrightText: 2015 Jolla Ltd. <valerio.valerio@jolla.com> 0002 //SPDX-FileContributor: Andres Gomez 0003 // 0004 //SPDX-License-Identifier: LGPL-2.1-or-later 0005 0006 0007 import QtQuick 2.0 0008 import org.nemomobile.qtmpris 1.0 0009 0010 Item { 0011 id: controls 0012 0013 property MprisManager mprisManager 0014 property bool isPlaying: mprisManager.currentService && mprisManager.playbackStatus == Mpris.Playing 0015 0016 height: parent.height 0017 width: column.width 0018 0019 Column { 0020 id: column 0021 0022 Text { 0023 id: artistLabel 0024 0025 text: if (mprisManager.currentService) { 0026 var artistTag = Mpris.metadataToString(Mpris.Artist) 0027 0028 return (artistTag in mprisManager.metadata) ? mprisManager.metadata[artistTag].toString() : "" 0029 } 0030 width: parent.width 0031 elide: Text.ElideRight 0032 horizontalAlignment: Text.AlignHCenter 0033 } 0034 0035 Text { 0036 id: songLabel 0037 0038 text: if (mprisManager.currentService) { 0039 var titleTag = Mpris.metadataToString(Mpris.Title) 0040 0041 return (titleTag in mprisManager.metadata) ? mprisManager.metadata[titleTag].toString() : "" 0042 } 0043 width: parent.width 0044 elide: Text.ElideRight 0045 horizontalAlignment: Text.AlignHCenter 0046 } 0047 0048 Row { 0049 0050 MouseArea { 0051 0052 width: controls.parent.width * 0.25 0053 height: width 0054 0055 onClicked: if (mprisManager.canGoPrevious) mprisManager.previous() 0056 0057 Text { 0058 anchors.centerIn: parent 0059 text: "⏮" 0060 } 0061 } 0062 MouseArea { 0063 0064 width: controls.parent.width * 0.25 0065 height: width 0066 0067 onClicked: if ((controls.isPlaying && mprisManager.canPause) || (!controls.isPlaying && mprisManager.canPlay)) { 0068 mprisManager.playPause() 0069 } 0070 0071 Text { 0072 anchors.centerIn: parent 0073 text: controls.isPlaying ? "⏸" : "⏵" 0074 } 0075 } 0076 MouseArea { 0077 0078 width: controls.parent.width * 0.25 0079 height: width 0080 0081 onClicked: if (mprisManager.canGoPrevious) if (mprisManager.canGoNext) mprisManager.next() 0082 0083 Text { 0084 anchors.centerIn: parent 0085 text: "⏭" 0086 } 0087 } 0088 } 0089 } 0090 } 0091