2023-09-27 05:41:52 +00:00
|
|
|
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
|
|
|
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-05-13 15:15:52 +00:00
|
|
|
import QtQuick
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-09-27 05:41:52 +00:00
|
|
|
import org.kde.plasma.private.mpris as Mpris
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-09-27 05:41:52 +00:00
|
|
|
QtObject {
|
|
|
|
|
property var mpris2Model: Mpris.Mpris2Model {}
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2022-04-09 01:48:42 +00:00
|
|
|
readonly property string multiplexSource: "@multiplex"
|
2023-09-27 05:41:52 +00:00
|
|
|
|
2022-04-09 01:48:42 +00:00
|
|
|
property var mprisSourcesModel: []
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2022-04-09 01:48:42 +00:00
|
|
|
function startOperation(src, op) {
|
|
|
|
|
var service = serviceForSource(src)
|
|
|
|
|
var operation = service.operationDescription(op)
|
|
|
|
|
return service.startOperationCall(operation)
|
|
|
|
|
}
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-09-27 05:41:52 +00:00
|
|
|
function setIndex(index) {
|
|
|
|
|
mpris2Model.currentIndex = index;
|
2022-04-09 01:48:42 +00:00
|
|
|
}
|
2023-09-27 05:41:52 +00:00
|
|
|
function goPrevious() {
|
|
|
|
|
mpris2Model.currentPlayer.Previous();
|
2022-04-09 01:48:42 +00:00
|
|
|
}
|
2023-09-27 05:41:52 +00:00
|
|
|
function goNext() {
|
|
|
|
|
mpris2Model.currentPlayer.Next();
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|
2023-09-27 05:41:52 +00:00
|
|
|
function playPause() {
|
|
|
|
|
mpris2Model.currentPlayer.PlayPause();
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|
|
|
|
|
}
|