diff --git a/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml b/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml --- a/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml +++ b/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml @@ -118,6 +118,8 @@ // jump to percentage, ie. 0 = beginnign, 1 = 10% of total length etc seekSlider.value = seekSlider.to * (event.key - Qt.Key_0) / 10 seekSlider.moved(); + } else if (event.key === Qt.Key_W) { + root.action_walk_through() } else { event.accepted = false } diff --git a/applets/mediacontroller/contents/ui/main.qml b/applets/mediacontroller/contents/ui/main.qml --- a/applets/mediacontroller/contents/ui/main.qml +++ b/applets/mediacontroller/contents/ui/main.qml @@ -248,6 +248,23 @@ serviceOp(mpris2Source.current, "Stop"); } + function action_walk_through() { + if (mpris2Source.sources.length < 3) { + return + } + + // Find the index of the current source + for (var i = 0, length = mpris2Source.sources.length; i < length; ++i) { + if (mpris2Source.sources[i] === mpris2Source.current) { + while (mpris2Source.sources[(i + 1) % mpris2Source.sources.length] === mpris2Source.multiplexSource) { + ++i // Find the next source that isn't multiplexSource + } + mpris2Source.current = mpris2Source.sources[(i + 1) % mpris2Source.sources.length] + break + } + } + } + function serviceOp(src, op) { var service = mpris2Source.serviceForSource(src); var operation = service.operationDescription(op);