summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorATDMA <atdma2600@gmail.com>2026-01-19 00:04:17 -0500
committerGitHub <noreply@github.com>2026-01-19 16:04:17 +1100
commita17fe72be5acdd049f005c3809332192bf649af2 (patch)
tree1824c844cdddf4d4230905c56f95fee6f12e19dc /services
parentpopouts/kblayout: revamp to be actually functional (#971) (diff)
downloadcaelestia-shell-a17fe72be5acdd049f005c3809332192bf649af2.tar.gz
caelestia-shell-a17fe72be5acdd049f005c3809332192bf649af2.tar.bz2
caelestia-shell-a17fe72be5acdd049f005c3809332192bf649af2.zip
controlcenter: add per-application audio controls (#1098)
* feat: per-application audio controls in controlcenter and popout * removed: per-application volume control removed from audio popout
Diffstat (limited to 'services')
-rw-r--r--services/Audio.qml36
1 files changed, 34 insertions, 2 deletions
diff --git a/services/Audio.qml b/services/Audio.qml
index 71ccb86..20d9cc8 100644
--- a/services/Audio.qml
+++ b/services/Audio.qml
@@ -19,15 +19,20 @@ Singleton {
acc.sinks.push(node);
else if (node.audio)
acc.sources.push(node);
+ } else if (node.isStream && node.audio) {
+ // Application streams (output streams)
+ acc.streams.push(node);
}
return acc;
}, {
sources: [],
- sinks: []
+ sinks: [],
+ streams: []
})
readonly property list<PwNode> sinks: nodes.sinks
readonly property list<PwNode> sources: nodes.sources
+ readonly property list<PwNode> streams: nodes.streams
readonly property PwNode sink: Pipewire.defaultAudioSink
readonly property PwNode source: Pipewire.defaultAudioSource
@@ -79,6 +84,33 @@ Singleton {
Pipewire.preferredDefaultAudioSource = newSource;
}
+ function setStreamVolume(stream: PwNode, newVolume: real): void {
+ if (stream?.ready && stream?.audio) {
+ stream.audio.muted = false;
+ stream.audio.volume = Math.max(0, Math.min(Config.services.maxVolume, newVolume));
+ }
+ }
+
+ function setStreamMuted(stream: PwNode, muted: bool): void {
+ if (stream?.ready && stream?.audio) {
+ stream.audio.muted = muted;
+ }
+ }
+
+ function getStreamVolume(stream: PwNode): real {
+ return stream?.audio?.volume ?? 0;
+ }
+
+ function getStreamMuted(stream: PwNode): bool {
+ return !!stream?.audio?.muted;
+ }
+
+ function getStreamName(stream: PwNode): string {
+ if (!stream) return qsTr("Unknown");
+ // Try application name first, then description, then name
+ return stream.applicationName || stream.description || stream.name || qsTr("Unknown Application");
+ }
+
onSinkChanged: {
if (!sink?.ready)
return;
@@ -109,7 +141,7 @@ Singleton {
}
PwObjectTracker {
- objects: [...root.sinks, ...root.sources]
+ objects: [...root.sinks, ...root.sources, ...root.streams]
}
CavaProvider {