List app playback streams for per-app volume and drop device lists

Quickshell marks playback streams as sinks, so the mixer showed
recording streams instead of players. Right-clicking Sound now shows
only the app sliders; Microphone no longer extends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-17 21:40:57 +02:00
1 parent 11bdc4c751
commit 72a21c9363
7 files changed
+29 -77

No files matched your search

+5 -66
View File
@@ -6,86 +6,25 @@ import "../components"
import "../services"
import "../theme"
// Extension of the Output and Input tiles: device choice, and for output a
// volume slider per app stream (the players EasyEffects processes).
// Extension of the Sound tile: a volume slider per app playback stream (the
// players EasyEffects processes). The app icon mutes it.
ColumnLayout {
id: root
property bool input: false
readonly property var nodes: input ? AudioService.inputs : AudioService.outputs
readonly property var current: input ? AudioService.source : AudioService.sink
spacing: 2
Demand {
service: AudioService
counter: "streamConsumers"
active: !root.input
}
component Heading: Text {
color: Theme.textSecondary
font.pixelSize: 10
font.weight: Font.DemiBold
font.letterSpacing: 1.1
Layout.topMargin: 4
Layout.bottomMargin: 2
}
Heading {
text: root.input ? "INPUT DEVICE" : "OUTPUT DEVICE"
}
Repeater {
model: root.nodes
Rectangle {
id: device
required property var modelData
required property int index
readonly property bool selected: modelData === root.current
Layout.fillWidth: true
implicitHeight: 28
radius: 8
color: deviceArea.containsMouse ? Qt.alpha(Theme.text, 0.08) : Theme.transparent
RowLayout {
anchors.fill: parent
anchors.leftMargin: 6
anchors.rightMargin: 6
spacing: 8
Text {
text: device.selected ? "✓" : ""
color: Theme.accent
font.pixelSize: 12
Layout.preferredWidth: 12
}
Text {
text: device.modelData.description || device.modelData.name
color: device.selected ? Theme.text : Qt.alpha(Theme.text, 0.8)
font.pixelSize: 12
font.weight: device.selected ? Font.DemiBold : Font.Normal
elide: Text.ElideRight
Layout.fillWidth: true
}
}
MouseArea {
id: deviceArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: AudioService.select(root.input, device.index)
}
}
}
Heading {
visible: !root.input
text: "APPLICATIONS"
Layout.topMargin: 8
}
Text {
visible: !root.input && AudioService.streams.length === 0
visible: AudioService.streams.length === 0
text: "No apps are playing audio"
color: Theme.textSecondary
font.pixelSize: 11
Layout.leftMargin: 6
Layout.topMargin: 2
}
Repeater {
model: root.input ? [] : AudioService.streams
model: AudioService.streams
RowLayout {
id: stream
required property var modelData
+1 -4
View File
@@ -3,7 +3,7 @@ import QtQuick
import ".."
import "../../services"
// Microphone level. Right click (or spare rows) shows input devices.
// Microphone level.
CCSlider {
readonly property var node: AudioService.source
objectName: "inputTile"
@@ -20,7 +20,4 @@ CCSlider {
notice: AudioService.available ? "" : "PipeWire is unavailable"
onMoved: value => AudioService.volume(true, value)
onMuteClicked: AudioService.mute(true)
extension: AudioMixer {
input: true
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ import QtQuick
import ".."
import "../../services"
// Output volume. Right click (or spare rows) shows devices and per-app volume.
// Output volume. Right click (or spare rows) shows per-app volume.
CCSlider {
readonly property var node: AudioService.sink
objectName: "outputTile"
+3 -2
View File
@@ -10,8 +10,9 @@ Singleton {
readonly property var source: backend.defaultAudioSource
readonly property var outputs: backend.nodes.values.filter(n => n.audio && n.isSink && !n.isStream)
readonly property var inputs: backend.nodes.values.filter(n => n.audio && !n.isSink && !n.isStream)
// App playback streams, e.g. the players EasyEffects processes.
readonly property var streams: backend.nodes.values.filter(n => n.audio && n.isStream && !n.isSink)
// App playback streams, e.g. the players EasyEffects processes. Quickshell
// marks playback streams (Stream/Output/Audio) as sinks.
readonly property var streams: backend.nodes.values.filter(n => n.audio && n.isStream && n.isSink)
readonly property bool available: backend.ready
// Views listing streams hold a Demand on this, so their volumes are only
// tracked while shown.
+16 -2
View File
@@ -38,7 +38,7 @@ Item {
property var streamNode: QtObject {
property string name: "fixture-player"
property string description: ""
property bool isSink: false
property bool isSink: true
property bool isStream: true
property var properties: ({
"application.name": "Fixture player"
@@ -48,6 +48,19 @@ Item {
property bool muted: false
}
}
property var recordingNode: QtObject {
property string name: "fixture-recorder"
property string description: ""
property bool isSink: false
property bool isStream: true
property var properties: ({
"application.name": "Fixture recorder"
})
property QtObject audio: QtObject {
property real volume: 1
property bool muted: false
}
}
property QtObject audioBackend: QtObject {
property bool ready: true
property var defaultAudioSink: root.audioNode
@@ -55,7 +68,7 @@ Item {
property var preferredDefaultAudioSink: root.audioNode
property var preferredDefaultAudioSource: root.audioInput
property QtObject nodes: QtObject {
property var values: [root.audioNode, root.audioInput, root.streamNode]
property var values: [root.audioNode, root.audioInput, root.streamNode, root.recordingNode]
}
}
property QtObject wifi: QtObject {
@@ -271,6 +284,7 @@ Item {
cellWidth: ShellState.controlCenterWindow.cellWidth,
extras: ShellState.controlCenterWindow.extras,
streamVolume: root.streamNode.audio.volume,
streams: AudioService.streams.map(n => AudioService.streamName(n)),
streamMuted: root.streamNode.audio.muted,
caffeine: CaffeineService.active,
caffeineRunning: CaffeineService.running,