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:
1 parent
11bdc4c751
commit
72a21c9363
7 files changed
+29
-77
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user