Allow adjust-value = 0 for individual channel-setting
authorDr.Best <dr_best@users.schwerkraft.elitedvb.net>
Fri, 6 Aug 2010 09:18:06 +0000 (09:18 +0000)
committerDr.Best <dr_best@users.schwerkraft.elitedvb.net>
Fri, 6 Aug 2010 09:18:06 +0000 (09:18 +0000)
automaticvolumeadjustment/src/AutomaticVolumeAdjustment.py
automaticvolumeadjustment/src/AutomaticVolumeAdjustmentConfig.py

index fc197f4..7066d1c 100644 (file)
@@ -101,7 +101,7 @@ class AutomaticVolumeAdjustment(Screen):
                                        if vol >= 100 - ajvol: # check if delta + vol < 100
                                                ajvol = 100 - vol # correct delta value
                                        self.lastAdjustedValue = ajvol # save delta value
-                                       if (ajvol !=0 or self.defaultValue == 0) and (vol+ajvol != currentvol): # only adjust volume when delta != 0 and current vol != new volume
+                                       if (vol + ajvol != currentvol): # only when current vol != new volume
                                                if ajvol == 0:
                                                        ajvol = vol+self.lastAdjustedValue - currentvol # correction for debug -print only
                                                self.volctrl.setVolume(vol+self.lastAdjustedValue, vol+self.lastAdjustedValue)
@@ -182,4 +182,5 @@ def AVA_setVolume(self, direction):
                                self.volumeDialog.show()
                                self.hideVolTimer.start(3000, True)
        if ok:
-               baseVolumeControl_setVolume(self, direction)
\ No newline at end of file
+               baseVolumeControl_setVolume(self, direction)
+
index 51e4ec3..1b7be5a 100644 (file)
@@ -60,7 +60,7 @@ class AutomaticVolumeAdjustmentConfig():
                i = len(self.config.Entries) - 1
                self.config.Entries[i].servicereference = ConfigText(default = "")
                self.config.Entries[i].name = NoSave(ConfigDirectory(default = _("Press OK to select a service")))
-               self.config.Entries[i].adjustvalue = ConfigInteger(default=25, limits=(5,50))
+               self.config.Entries[i].adjustvalue = ConfigInteger(default=25, limits=(0,50))
                return self.config.Entries[i]
        
        def remove(self, configItem):