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
@@ -182,8 +182,8 @@ power profile, Now Playing, power actions and system metrics, with Notifications
|
|||||||
below. Each tile can be any size from 1×1 to 4×4 and adapts its layout to it.
|
below. Each tile can be any size from 1×1 to 4×4 and adapts its layout to it.
|
||||||
**Edit Controls** at the bottom of the panel lets you drag tiles to reorder them,
|
**Edit Controls** at the bottom of the panel lets you drag tiles to reorder them,
|
||||||
resize them from the corner handle, remove them with the badge and add others.
|
resize them from the corner handle, remove them with the badge and add others.
|
||||||
Right-click Sound to extend it with output devices and a volume slider per app
|
Right-click Sound to extend it with a volume slider per app (the players
|
||||||
(the players EasyEffects processes); right-click a toggle to open its settings.
|
EasyEffects processes); right-click a toggle to open its settings.
|
||||||
Logout, reboot and shutdown require explicit confirmation.
|
Logout, reboot and shutdown require explicit confirmation.
|
||||||
|
|
||||||
NetworkManager, BlueZ and PipeWire use native Quickshell models. Other controls reuse
|
NetworkManager, BlueZ and PipeWire use native Quickshell models. Other controls reuse
|
||||||
|
|||||||
@@ -6,86 +6,25 @@ import "../components"
|
|||||||
import "../services"
|
import "../services"
|
||||||
import "../theme"
|
import "../theme"
|
||||||
|
|
||||||
// Extension of the Output and Input tiles: device choice, and for output a
|
// Extension of the Sound tile: a volume slider per app playback stream (the
|
||||||
// volume slider per app stream (the players EasyEffects processes).
|
// players EasyEffects processes). The app icon mutes it.
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
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
|
spacing: 2
|
||||||
Demand {
|
Demand {
|
||||||
service: AudioService
|
service: AudioService
|
||||||
counter: "streamConsumers"
|
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 {
|
Text {
|
||||||
visible: !root.input && AudioService.streams.length === 0
|
visible: AudioService.streams.length === 0
|
||||||
text: "No apps are playing audio"
|
text: "No apps are playing audio"
|
||||||
color: Theme.textSecondary
|
color: Theme.textSecondary
|
||||||
font.pixelSize: 11
|
font.pixelSize: 11
|
||||||
Layout.leftMargin: 6
|
Layout.leftMargin: 6
|
||||||
|
Layout.topMargin: 2
|
||||||
}
|
}
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.input ? [] : AudioService.streams
|
model: AudioService.streams
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: stream
|
id: stream
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import QtQuick
|
|||||||
import ".."
|
import ".."
|
||||||
import "../../services"
|
import "../../services"
|
||||||
|
|
||||||
// Microphone level. Right click (or spare rows) shows input devices.
|
// Microphone level.
|
||||||
CCSlider {
|
CCSlider {
|
||||||
readonly property var node: AudioService.source
|
readonly property var node: AudioService.source
|
||||||
objectName: "inputTile"
|
objectName: "inputTile"
|
||||||
@@ -20,7 +20,4 @@ CCSlider {
|
|||||||
notice: AudioService.available ? "" : "PipeWire is unavailable"
|
notice: AudioService.available ? "" : "PipeWire is unavailable"
|
||||||
onMoved: value => AudioService.volume(true, value)
|
onMoved: value => AudioService.volume(true, value)
|
||||||
onMuteClicked: AudioService.mute(true)
|
onMuteClicked: AudioService.mute(true)
|
||||||
extension: AudioMixer {
|
|
||||||
input: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ import QtQuick
|
|||||||
import ".."
|
import ".."
|
||||||
import "../../services"
|
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 {
|
CCSlider {
|
||||||
readonly property var node: AudioService.sink
|
readonly property var node: AudioService.sink
|
||||||
objectName: "outputTile"
|
objectName: "outputTile"
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ Singleton {
|
|||||||
readonly property var source: backend.defaultAudioSource
|
readonly property var source: backend.defaultAudioSource
|
||||||
readonly property var outputs: backend.nodes.values.filter(n => n.audio && n.isSink && !n.isStream)
|
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)
|
readonly property var inputs: backend.nodes.values.filter(n => n.audio && !n.isSink && !n.isStream)
|
||||||
// App playback streams, e.g. the players EasyEffects processes.
|
// App playback streams, e.g. the players EasyEffects processes. Quickshell
|
||||||
readonly property var streams: backend.nodes.values.filter(n => n.audio && n.isStream && !n.isSink)
|
// 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
|
readonly property bool available: backend.ready
|
||||||
// Views listing streams hold a Demand on this, so their volumes are only
|
// Views listing streams hold a Demand on this, so their volumes are only
|
||||||
// tracked while shown.
|
// tracked while shown.
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Item {
|
|||||||
property var streamNode: QtObject {
|
property var streamNode: QtObject {
|
||||||
property string name: "fixture-player"
|
property string name: "fixture-player"
|
||||||
property string description: ""
|
property string description: ""
|
||||||
property bool isSink: false
|
property bool isSink: true
|
||||||
property bool isStream: true
|
property bool isStream: true
|
||||||
property var properties: ({
|
property var properties: ({
|
||||||
"application.name": "Fixture player"
|
"application.name": "Fixture player"
|
||||||
@@ -48,6 +48,19 @@ Item {
|
|||||||
property bool muted: false
|
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 QtObject audioBackend: QtObject {
|
||||||
property bool ready: true
|
property bool ready: true
|
||||||
property var defaultAudioSink: root.audioNode
|
property var defaultAudioSink: root.audioNode
|
||||||
@@ -55,7 +68,7 @@ Item {
|
|||||||
property var preferredDefaultAudioSink: root.audioNode
|
property var preferredDefaultAudioSink: root.audioNode
|
||||||
property var preferredDefaultAudioSource: root.audioInput
|
property var preferredDefaultAudioSource: root.audioInput
|
||||||
property QtObject nodes: QtObject {
|
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 {
|
property QtObject wifi: QtObject {
|
||||||
@@ -271,6 +284,7 @@ Item {
|
|||||||
cellWidth: ShellState.controlCenterWindow.cellWidth,
|
cellWidth: ShellState.controlCenterWindow.cellWidth,
|
||||||
extras: ShellState.controlCenterWindow.extras,
|
extras: ShellState.controlCenterWindow.extras,
|
||||||
streamVolume: root.streamNode.audio.volume,
|
streamVolume: root.streamNode.audio.volume,
|
||||||
|
streams: AudioService.streams.map(n => AudioService.streamName(n)),
|
||||||
streamMuted: root.streamNode.audio.muted,
|
streamMuted: root.streamNode.audio.muted,
|
||||||
caffeine: CaffeineService.active,
|
caffeine: CaffeineService.active,
|
||||||
caffeineRunning: CaffeineService.running,
|
caffeineRunning: CaffeineService.running,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ with tempfile.TemporaryDirectory(prefix='glassmxrph-controls-') as tmp:
|
|||||||
# Per-app volume: right click extends Sound with the app streams.
|
# Per-app volume: right click extends Sound with the app streams.
|
||||||
assert ipc('controlTest','rightClick','outputTile');wait(lambda:state()['extras'].get('output',0)>0,'Sound extends')
|
assert ipc('controlTest','rightClick','outputTile');wait(lambda:state()['extras'].get('output',0)>0,'Sound extends')
|
||||||
time.sleep(.4)
|
time.sleep(.4)
|
||||||
|
assert state()['streams']==['Fixture player'],'only playback streams are listed: '+str(state()['streams'])
|
||||||
t=next(i for i in state()['tiles'] if i['id']=='input');assert t['row']>0
|
t=next(i for i in state()['tiles'] if i['id']=='input');assert t['row']>0
|
||||||
assert ipc('controlTest','slider','appSlider-Fixture player');wait(lambda:state()['streamVolume']>.6,'app volume slider')
|
assert ipc('controlTest','slider','appSlider-Fixture player');wait(lambda:state()['streamVolume']>.6,'app volume slider')
|
||||||
assert ipc('controlTest','click','appMute-Fixture player');wait(lambda:state()['streamMuted'],'app mute')
|
assert ipc('controlTest','click','appMute-Fixture player');wait(lambda:state()['streamMuted'],'app mute')
|
||||||
|
|||||||
Reference in new issue
Block a user