shift-shell/components/mobileshell/qml/widgets/mediacontrols/MediaControlsSource.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
920 B
QML
Raw Normal View History

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
import QtQuick
2023-09-27 05:41:52 +00:00
import org.kde.plasma.private.mpris as Mpris
2023-09-27 05:41:52 +00:00
QtObject {
property var mpris2Model: Mpris.Mpris2Model {}
readonly property string multiplexSource: "@multiplex"
2023-09-27 05:41:52 +00:00
property var mprisSourcesModel: []
function startOperation(src, op) {
var service = serviceForSource(src)
var operation = service.operationDescription(op)
return service.startOperationCall(operation)
}
2023-09-27 05:41:52 +00:00
function setIndex(index) {
mpris2Model.currentIndex = index;
}
2023-09-27 05:41:52 +00:00
function goPrevious() {
mpris2Model.currentPlayer.Previous();
}
2023-09-27 05:41:52 +00:00
function goNext() {
mpris2Model.currentPlayer.Next();
}
2023-09-27 05:41:52 +00:00
function playPause() {
mpris2Model.currentPlayer.PlayPause();
}
}