fix volume input sinks to handle also mono streams

This commit is contained in:
2023-12-10 04:19:05 +01:00
parent 310d396407
commit dec5642e26
2 changed files with 6 additions and 2 deletions

View File

@@ -300,7 +300,11 @@ class Volume(Div):
volume_level = 0 volume_level = 0
if self.pa_state: # might be empty {} if it is not found if self.pa_state: # might be empty {} if it is not found
# pulseaudio 2^16 (65536) volume levels # pulseaudio 2^16 (65536) volume levels
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign if 'front-left' in self.pa_state['volume']:
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign
elif 'mono' in self.pa_state['volume']:
volume_level = float(self.pa_state['volume']['mono']['value_percent'][:-1]) # remove the % sign
# TODO: ? indicator if stream is stereo or mono ?
badge = QBadge( badge = QBadge(
text=badge_name, text=badge_name,

View File

@@ -6,7 +6,7 @@ After=network.target
[Service] [Service]
Environment=PYTHONUNBUFFERED=1 Environment=PYTHONUNBUFFERED=1
TimeoutStartSec=30 TimeoutStartSec=30
ExecStartPre=/bin/sh -c 'source /etc/profile' #ExecStartPre=/bin/sh -c 'source /etc/profile'
ExecStart=%h/.local/bin/controldeck -D ExecStart=%h/.local/bin/controldeck -D
Restart=on-failure Restart=on-failure
RestartSec=4 RestartSec=4