refs bug #429
[enigma2.git] / lib / python / Components / RFmod.py
index 0ab4a8158272e2d4329d97774e206eaac5710c72..a8f7c9f504ac8f771caa12d3ec14609ca5570d63 100644 (file)
@@ -1,5 +1,6 @@
 from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider
 from enigma import eRFmod
 from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider
 from enigma import eRFmod
+from Components.SystemInfo import SystemInfo
 
 # CHECK ME.
 RFMOD_CHANNEL_MIN = 21
 
 # CHECK ME.
 RFMOD_CHANNEL_MIN = 21
@@ -14,7 +15,7 @@ class RFmod:
        def setTestmode(self, value):
                eRFmod.getInstance().setTestmode(value)
        def setSoundFunction(self, value):
        def setTestmode(self, value):
                eRFmod.getInstance().setTestmode(value)
        def setSoundFunction(self, value):
-               eRFmod.getInstance().setSoundFunction(value)
+               eRFmod.getInstance().setSoundFunction(not value)
        def setSoundCarrier(self, value):
                eRFmod.getInstance().setSoundCarrier(value)
        def setChannel(self, value):
        def setSoundCarrier(self, value):
                eRFmod.getInstance().setSoundCarrier(value)
        def setChannel(self, value):
@@ -23,34 +24,36 @@ class RFmod:
                eRFmod.getInstance().setFinetune(value)
 
 def InitRFmod():
                eRFmod.getInstance().setFinetune(value)
 
 def InitRFmod():
-
-       config.rfmod = ConfigSubsection()
-       config.rfmod.enable = ConfigOnOff(default=False)
-       config.rfmod.test = ConfigOnOff(default=False)
-       config.rfmod.sound = ConfigOnOff(default=True)
-       config.rfmod.soundcarrier = ConfigSelection(choices=[("4500","4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz")], default="5500")
-       config.rfmod.channel = ConfigSelection(default = "36", choices = ["%d" % x for x in range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)])
-       config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10))
-
-       iRFmod = RFmod()
-
-       def setFunction(configElement):
-               iRFmod.setFunction(configElement.value);
-       def setTestmode(configElement):
-               iRFmod.setTestmode(configElement.value);
-       def setSoundFunction(configElement):
-               iRFmod.setSoundFunction(configElement.value);
-       def setSoundCarrier(configElement):
-               iRFmod.setSoundCarrier(configElement.index);
-       def setChannel(configElement):
-               iRFmod.setChannel(int(configElement.value));
-       def setFinetune(configElement):
-               iRFmod.setFinetune(configElement.value - 5);
-
-       # this will call the "setup-val" initial
-       config.rfmod.enable.addNotifier(setFunction);
-       config.rfmod.test.addNotifier(setTestmode);
-       config.rfmod.sound.addNotifier(setSoundFunction);
-       config.rfmod.soundcarrier.addNotifier(setSoundCarrier);
-       config.rfmod.channel.addNotifier(setChannel);
-       config.rfmod.finetune.addNotifier(setFinetune);
+       detected = eRFmod.getInstance().detected()
+       SystemInfo["RfModulator"] = detected
+       if detected:
+               config.rfmod = ConfigSubsection()
+               config.rfmod.enable = ConfigOnOff(default=False)
+               config.rfmod.test = ConfigOnOff(default=False)
+               config.rfmod.sound = ConfigOnOff(default=True)
+               config.rfmod.soundcarrier = ConfigSelection(choices=[("4500","4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz")], default="5500")
+               config.rfmod.channel = ConfigSelection(default = "36", choices = ["%d" % x for x in range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)])
+               config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10))
+
+               iRFmod = RFmod()
+
+               def setFunction(configElement):
+                       iRFmod.setFunction(configElement.value);
+               def setTestmode(configElement):
+                       iRFmod.setTestmode(configElement.value);
+               def setSoundFunction(configElement):
+                       iRFmod.setSoundFunction(configElement.value);
+               def setSoundCarrier(configElement):
+                       iRFmod.setSoundCarrier(configElement.index);
+               def setChannel(configElement):
+                       iRFmod.setChannel(int(configElement.value));
+               def setFinetune(configElement):
+                       iRFmod.setFinetune(configElement.value - 5);
+
+               # this will call the "setup-val" initial
+               config.rfmod.enable.addNotifier(setFunction);
+               config.rfmod.test.addNotifier(setTestmode);
+               config.rfmod.sound.addNotifier(setSoundFunction);
+               config.rfmod.soundcarrier.addNotifier(setSoundCarrier);
+               config.rfmod.channel.addNotifier(setChannel);
+               config.rfmod.finetune.addNotifier(setFinetune);