Warning, /plasma/plasma-mobile/components/mobileshell/qml/widgets/mediacontrols/MediaControlsSource.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
0002 // SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
0003 // SPDX-License-Identifier: LGPL-2.0-or-later
0004 
0005 import QtQuick
0006 
0007 import org.kde.plasma.private.mpris as Mpris
0008 
0009 QtObject {
0010     property var mpris2Model: Mpris.Mpris2Model {}
0011 
0012     readonly property string multiplexSource: "@multiplex"
0013 
0014     property var mprisSourcesModel: []
0015 
0016     function startOperation(src, op) {
0017         var service = serviceForSource(src)
0018         var operation = service.operationDescription(op)
0019         return service.startOperationCall(operation)
0020     }
0021 
0022     function setIndex(index) {
0023         mpris2Model.currentIndex = index;
0024     }
0025     function goPrevious() {
0026         mpris2Model.currentPlayer.Previous();
0027     }
0028     function goNext() {
0029         mpris2Model.currentPlayer.Next();
0030     }
0031     function playPause() {
0032         mpris2Model.currentPlayer.PlayPause();
0033     }
0034 }