X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FRFmod.py;h=a8f7c9f504ac8f771caa12d3ec14609ca5570d63;hp=ff87a729dbd58d39f105df944fd5e117df20f23e;hb=c437ed274b0155ecdeb7382d6ee46d67a53755b9;hpb=6eeefece35e4269e02fdb7abab4f79d8e7b8f98b diff --git a/lib/python/Components/RFmod.py b/lib/python/Components/RFmod.py index ff87a72..a8f7c9f 100644 --- a/lib/python/Components/RFmod.py +++ b/lib/python/Components/RFmod.py @@ -1,5 +1,6 @@ -from config import * -from enigma import * +from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider +from enigma import eRFmod +from Components.SystemInfo import SystemInfo # CHECK ME. RFMOD_CHANNEL_MIN = 21 @@ -10,11 +11,11 @@ class RFmod: pass def setFunction(self, value): - eRFmod.getInstance().setFunction(value) + eRFmod.getInstance().setFunction(not 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): @@ -23,34 +24,36 @@ class RFmod: 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(int(configElement.value)); - 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);