[VideoEnhancement] add entry vertical_dejagging, smooth
[vuplus_dvbapp] / lib / python / Plugins / SystemPlugins / VideoEnhancement / VideoEnhancement.py
index b18f559..45e129c 100755 (executable)
@@ -1,4 +1,4 @@
-from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigNothing, NoSave
+from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigBoolean, ConfigNothing, NoSave
 from Tools.CList import CList
 from os import path as os_path
 # The "VideoEnhancement" is the interface to /proc/stb/vmpeg/0.
@@ -238,6 +238,60 @@ class VideoEnhancement:
                else:
                        config.pep.dynamic_contrast = NoSave(ConfigNothing())
 
+               try:
+                       x = config.av.scaler_sharpness.value
+               except KeyError:
+                       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.av.scaler_sharpness = ConfigSlider(default=13, limits=(0,26))
+                               config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
+                       else:
+                               config.av.scaler_sharpness = NoSave(ConfigNothing())
+
+               if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"):
+                       def setScaler_vertical_dejagging(configElement):
+                               myval = configElement.value and "enable" or "disable"
+                               try:
+                                       print "--> setting scaler_vertical_dejagging to: %s" % myval
+                                       open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging", "w").write(myval)
+                               except IOError:
+                                       print "couldn't write pep_scaler_vertical_dejagging."
+
+                               if not VideoEnhancement.firstRun:
+                                       self.setConfiguredValues()
+
+                       config.pep.scaler_vertical_dejagging = ConfigBoolean(default=False, descriptions = {False: "Disable", True: "Enable"} )
+                       config.pep.scaler_vertical_dejagging.addNotifier(setScaler_vertical_dejagging)
+               else:
+                       config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing())
+
+               if os_path.exists("/proc/stb/vmpeg/0/smooth"):
+                       def setSmooth(configElement):
+                               myval = configElement.value and "enable" or "disable"
+                               try:
+                                       print "--> setting smooth to: %s" % myval
+                                       open("/proc/stb/vmpeg/0/smooth", "w").write(myval)
+                               except IOError:
+                                       print "couldn't write smooth."
+
+                               if not VideoEnhancement.firstRun:
+                                       self.setConfiguredValues()
+
+                       config.pep.smooth = ConfigBoolean(default=False, descriptions = {False: "Disable", True: "Enable"} )
+                       config.pep.smooth.addNotifier(setSmooth)
+               else:
+                       config.pep.smooth = NoSave(ConfigNothing())
+
                if VideoEnhancement.firstRun:
                        self.setConfiguredValues()