Audio WIP
This commit is contained in:
parent
5c7268aaee
commit
5e4530a403
2 changed files with 32 additions and 20 deletions
|
|
@ -1,30 +0,0 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// Ensure the volume is readonly from outside
|
||||
readonly property alias volume: root._volume
|
||||
property real _volume: 0
|
||||
|
||||
readonly property alias muted: root._muted
|
||||
property bool _muted: false
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.defaultAudioSink]
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Pipewire.defaultAudioSink?.audio ? Pipewire.defaultAudioSink?.audio : null
|
||||
|
||||
function onVolumeChanged() {
|
||||
root._volume = (Pipewire.defaultAudioSink?.audio.volume ?? 0)
|
||||
console.log("onVolumeChanged: " + volume)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue