1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-05 05:12:05 -04:00

audio: add per-device max volume limit setting

This commit is contained in:
bbedward
2026-02-09 09:26:34 -05:00
parent fce120fa31
commit 1ed44ee6f3
10 changed files with 197 additions and 63 deletions

View File

@@ -140,8 +140,9 @@ BasePill {
volumeAccumulator = 0;
}
const maxVol = AudioService.sinkMaxVolume;
const currentVolume = AudioService.sink.audio.volume * 100;
const newVolume = delta > 0 ? Math.min(100, currentVolume + step) : Math.max(0, currentVolume - step);
const newVolume = delta > 0 ? Math.min(maxVol, currentVolume + step) : Math.max(0, currentVolume - step);
AudioService.sink.audio.muted = false;
AudioService.sink.audio.volume = newVolume / 100;
AudioService.playVolumeChangeSoundIfEnabled();