mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
Incorporate some system sounds
This commit is contained in:
@@ -3,9 +3,11 @@ pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
import qs.Common
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
@@ -25,6 +27,32 @@ Singleton {
|
||||
onTriggered: root.suppressOSD = false
|
||||
}
|
||||
|
||||
MediaPlayer {
|
||||
id: volumeChangeSound
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.oga")
|
||||
audioOutput: AudioOutput {
|
||||
volume: 1.0
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: volumeSoundDebounce
|
||||
interval: 50
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
if (SettingsData.soundsEnabled && SettingsData.soundVolumeChanged && !root.suppressOSD) {
|
||||
volumeChangeSound.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.sink?.audio
|
||||
function onVolumeChanged() {
|
||||
volumeSoundDebounce.restart()
|
||||
}
|
||||
}
|
||||
|
||||
function displayName(node) {
|
||||
if (!node) {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user