From 6bd9700323d6f6f5bb5d7f97764d1091875cbdc1 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 1 Oct 2009 21:28:31 +0200 Subject: [PATCH] show scaler sharpness in av setup and in video enhancement plugin --- lib/python/Components/AVSwitch.py | 19 ++++++++++++++++++- .../VideoEnhancement/VideoEnhancement.py | 17 ----------------- .../SystemPlugins/VideoEnhancement/plugin.py | 8 ++++---- .../Plugins/SystemPlugins/Videomode/plugin.py | 5 ++++- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py index 8f4255b8..bc2a66a4 100644 --- a/lib/python/Components/AVSwitch.py +++ b/lib/python/Components/AVSwitch.py @@ -1,7 +1,8 @@ from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \ - ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigNumber + ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigNumber, ConfigNothing, NoSave from enigma import eAVSwitch, getDesktop from SystemInfo import SystemInfo +from os import path as os_path class AVSwitch: def setInput(self, input): @@ -166,3 +167,19 @@ def InitAVSwitch(): if can_osd_alpha: config.av.osd_alpha = ConfigSlider(default=255, limits=(0,255)) config.av.osd_alpha.addNotifier(setAlpha) + + if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"): + def setScaler_sharpness(config): + myval = int(config.value) + try: + print "--> setting scaler_sharpness to: %0.8X" % myval + open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) + open("/proc/stb/vmpeg/0/pep_apply", "w").write("1") + except IOError: + print "couldn't write pep_scaler_sharpness" + + config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0,26)) + config.av.scaler_sharpness.addNotifier(setScaler_sharpness) + else: + config.av.scaler_sharpness = NoSave(ConfigNothing()) + diff --git a/lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py b/lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py index 3fbef7c2..b18f5595 100755 --- a/lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py +++ b/lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py @@ -133,23 +133,6 @@ class VideoEnhancement: else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) - if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"): - def setScaler_sharpness(config): - myval = int(config.value) - try: - print "--> setting scaler_sharpness to: %0.8X" % myval - open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) - except IOError: - print "couldn't write pep_scaler_sharpness" - - if not VideoEnhancement.firstRun: - self.setConfiguredValues() - - config.pep.scaler_sharpness = ConfigSlider(default=13, limits=(0,26)) - config.pep.scaler_sharpness.addNotifier(setScaler_sharpness) - else: - config.pep.scaler_sharpness = NoSave(ConfigNothing()) - if os_path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: diff --git a/lib/python/Plugins/SystemPlugins/VideoEnhancement/plugin.py b/lib/python/Plugins/SystemPlugins/VideoEnhancement/plugin.py index e25ad38e..0276e04b 100755 --- a/lib/python/Plugins/SystemPlugins/VideoEnhancement/plugin.py +++ b/lib/python/Plugins/SystemPlugins/VideoEnhancement/plugin.py @@ -65,7 +65,7 @@ class VideoEnhancementSetup(Screen, ConfigListScreen): self.oldBlock_noise = config.pep.block_noise_reduction.value self.oldMosquito_noise = config.pep.mosquito_noise_reduction.value self.oldDigital_contour = config.pep.digital_contour_removal.value - self.oldScaler_sharpness = config.pep.scaler_sharpness.value + self.oldScaler_sharpness = config.av.scaler_sharpness.value self.oldSplit = config.pep.split.value self.oldSharpness = config.pep.sharpness.value self.oldAuto_flesh = config.pep.auto_flesh.value @@ -90,7 +90,7 @@ class VideoEnhancementSetup(Screen, ConfigListScreen): self.saturationEntry = addToConfigList(_("Saturation"), config.pep.saturation) self.hueEntry = addToConfigList(_("Hue"), config.pep.hue) self.brightnessEntry = addToConfigList(_("Brightness"), config.pep.brightness) - self.scaler_sharpnessEntry = addToConfigList(_("Scaler sharpness"), config.pep.scaler_sharpness) + self.scaler_sharpnessEntry = addToConfigList(_("Scaler sharpness"), config.av.scaler_sharpness) self.splitEntry = addToConfigList(_("Split preview mode"), config.pep.split, True) add_to_xtdlist = self.splitEntry is not None self.sharpnessEntry = addToConfigList(_("Sharpness"), config.pep.sharpness, add_to_xtdlist) @@ -194,7 +194,7 @@ class VideoEnhancementSetup(Screen, ConfigListScreen): if self.digital_contour_removalEntry is not None: config.pep.digital_contour_removal.setValue(self.oldDigital_contour) if self.scaler_sharpnessEntry is not None: - config.pep.scaler_sharpness.setValue(self.oldScaler_sharpness) + config.av.scaler_sharpness.setValue(self.oldScaler_sharpness) if self.splitEntry is not None: config.pep.split.setValue('off') if self.sharpnessEntry is not None: @@ -231,7 +231,7 @@ class VideoEnhancementSetup(Screen, ConfigListScreen): if self.digital_contour_removalEntry is not None: config.pep.digital_contour_removal.setValue(0) if self.scaler_sharpnessEntry is not None: - config.pep.scaler_sharpness.setValue(13) + config.av.scaler_sharpness.setValue(13) if self.splitEntry is not None: config.pep.split.setValue('off') if self.sharpnessEntry is not None: diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index 7a2127ac..1b820fb1 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -2,7 +2,7 @@ from Screens.Screen import Screen from Plugins.Plugin import PluginDescriptor from Components.SystemInfo import SystemInfo from Components.ConfigList import ConfigListScreen -from Components.config import getConfigListEntry, config, ConfigBoolean +from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider from VideoHardware import video_hw @@ -106,6 +106,9 @@ class VideoSetup(Screen, ConfigListScreen): if SystemInfo["CanChangeOsdAlpha"]: self.list.append(getConfigListEntry(_("OSD visibility"), config.av.osd_alpha)) + if not isinstance(config.av.scaler_sharpness, ConfigNothing): + self.list.append(getConfigListEntry(_("Scaler sharpness"), config.av.scaler_sharpness)) + self["config"].list = self.list self["config"].l.setList(self.list) -- 2.30.2