SystemPlugins/VideoEnhancement: - add support for dm500hd
[enigma2.git] / lib / python / Plugins / SystemPlugins / VideoEnhancement / VideoEnhancement.py
index a9e8d57..7db0255 100755 (executable)
@@ -1,5 +1,5 @@
 from enigma import eTimer
-from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection,ConfigYesNo
+from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigYesNo, NoSave
 from Tools.CList import CList
 from Tools.HardwareInfo import HardwareInfo
 import os
@@ -18,6 +18,8 @@ class VideoEnhancement:
                hw_type = HardwareInfo().get_device_name()
                config.pep = ConfigSubsection()
 
+               config.pep.configsteps = NoSave(ConfigSelection(choices=[1, 5, 10, 25], default = 1))
+
                def setContrast(config):
                        myval = int(config.value*256)
                        try:
@@ -74,7 +76,49 @@ class VideoEnhancement:
                config.pep.brightness = ConfigSlider(default=128, limits=(0,256))
                config.pep.brightness.addNotifier(setBrightness)
 
-               if hw_type == 'dm8000':
+               def setBlock_noise_reduction(config):
+                       myval = int(config.value)
+                       try:
+                               print "--> setting block_noise_reduction to: %0.8X" % myval
+                               open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w").write("%0.8X" % myval)
+                       except IOError:
+                               print "couldn't write pep_block_noise_reduction."
+
+                       if VideoEnhancement.firstRun is False:
+                               self.setConfiguredValues()
+
+               config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0,5))
+               config.pep.block_noise_reduction.addNotifier(setBlock_noise_reduction)
+
+               def setMosquito_noise_reduction(config):
+                       myval = int(config.value)
+                       try:
+                               print "--> setting mosquito_noise_reduction to: %0.8X" % myval
+                               open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w").write("%0.8X" % myval)
+                       except IOError:
+                               print "couldn't write pep_mosquito_noise_reduction."
+
+                       if VideoEnhancement.firstRun is False:
+                               self.setConfiguredValues()
+
+               config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0,5))
+               config.pep.mosquito_noise_reduction.addNotifier(setMosquito_noise_reduction)
+
+               def setDigital_contour_removal(config):
+                       myval = int(config.value)
+                       try:
+                               print "--> setting digital_contour_removal to: %0.8X" % myval
+                               open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w").write("%0.8X" % myval)
+                       except IOError:
+                               print "couldn't write pep_digital_contour_removal."
+
+                       if VideoEnhancement.firstRun is False:
+                               self.setConfiguredValues()
+
+               config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0,5))
+               config.pep.digital_contour_removal.addNotifier(setDigital_contour_removal)
+
+               if hw_type in ( 'dm8000', 'dm500hd' ):
                        def setSplitMode(config):
                                try:
                                        print "--> setting splitmode to:",str(config.value)
@@ -148,48 +192,6 @@ class VideoEnhancement:
                        config.pep.blue_boost = ConfigSlider(default=0, limits=(0,4))
                        config.pep.blue_boost.addNotifier(setBlueboost)
 
-                       def setBlock_noise_reduction(config):
-                               myval = int(config.value)
-                               try:
-                                       print "--> setting block_noise_reduction to: %0.8X" % myval
-                                       open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w").write("%0.8X" % myval)
-                               except IOError:
-                                       print "couldn't write pep_block_noise_reduction."
-
-                               if VideoEnhancement.firstRun is False:
-                                       self.setConfiguredValues()
-
-                       config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0,5))
-                       config.pep.block_noise_reduction.addNotifier(setBlock_noise_reduction)
-
-                       def setMosquito_noise_reduction(config):
-                               myval = int(config.value)
-                               try:
-                                       print "--> setting mosquito_noise_reduction to: %0.8X" % myval
-                                       open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w").write("%0.8X" % myval)
-                               except IOError:
-                                       print "couldn't write pep_mosquito_noise_reduction."
-
-                               if VideoEnhancement.firstRun is False:
-                                       self.setConfiguredValues()
-
-                       config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0,5))
-                       config.pep.mosquito_noise_reduction.addNotifier(setMosquito_noise_reduction)
-
-                       def setDigital_contour_removal(config):
-                               myval = int(config.value)
-                               try:
-                                       print "--> setting digital_contour_removal to: %0.8X" % myval
-                                       open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w").write("%0.8X" % myval)
-                               except IOError:
-                                       print "couldn't write pep_digital_contour_removal."
-
-                               if VideoEnhancement.firstRun is False:
-                                       self.setConfiguredValues()
-
-                       config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0,5))
-                       config.pep.digital_contour_removal.addNotifier(setDigital_contour_removal)
-
                        def setDynamic_contrast(config):
                                myval = int(config.value)
                                try:
@@ -217,7 +219,7 @@ class VideoEnhancement:
 
 if config.usage.setup_level.index >= 2: # expert+
        hw_type = HardwareInfo().get_device_name()
-       if hw_type == 'dm8000' or hw_type == 'dm800':
+       if hw_type in ( 'dm8000', 'dm800', 'dm500hd' ):
                video_enhancement = VideoEnhancement()
                if video_enhancement.firstRun == True:
                        video_enhancement.setConfiguredValues()