Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VolumeControl.py[ Code adjustments to address feedback #3415

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions lib/python/Components/VolumeControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,16 @@ def keyVolumeLong(self):
def keyVolumeStop(self):
self.dvbVolumeControl.setVolumeSteps(config.volumeControl.pressStep.value)

def keyVolumeMute(self): # This will toggle the current mute status. Mute will not be activated if the volume is at 0.
volume = self.dvbVolumeControl.getVolume()
isMuted = self.dvbVolumeControl.isMuted()
if volume or (volume == 0 and isMuted):
self.dvbVolumeControl.volumeToggleMute()
if self.dvbVolumeControl.isMuted():
self.muteDialog.show()
self.volumeDialog.hide()
else:
self.muteDialog.hide()
self.volumeDialog.setValue(volume)
self.volumeDialog.show()
self.hideTimer.start(config.volumeControl.hideTimer.value * 1000, True)
def keyVolumeMute(self): # This will toggle the current mute status.
self.dvbVolumeControl.volumeToggleMute()
if self.dvbVolumeControl.isMuted():
self.muteDialog.show()
self.volumeDialog.hide()
else:
self.muteDialog.hide()
self.volumeDialog.setValue(self.dvbVolumeControl.getVolume())
self.volumeDialog.show()
self.hideTimer.start(config.volumeControl.hideTimer.value * 1000, True)

def keyVolumeMuteLong(self): # Long press MUTE will keep the mute icon on-screen without a timeout.
if self.dvbVolumeControl.isMuted():
Expand All @@ -89,7 +86,10 @@ def updateVolume(self):
if self.dvbVolumeControl.isMuted():
self.keyVolumeMute() # Unmute.
else:
self.volumeDialog.setValue(self.dvbVolumeControl.getVolume())
volume = self.dvbVolumeControl.getVolume()
if volume == 0: # Some receivers do not suppress the volume at a volume level of 0!
self.dvbVolumeControl.volumeMute()
self.volumeDialog.setValue(volume)
self.volumeDialog.show()
self.hideTimer.start(config.volumeControl.hideTimer.value * 1000, True)

Expand Down
Loading