1 from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider
2 from enigma import eRFmod
6 RFMOD_CHANNEL_MAX = 69 + 1
12 def setFunction(self, value):
13 eRFmod.getInstance().setFunction(not value)
14 def setTestmode(self, value):
15 eRFmod.getInstance().setTestmode(value)
16 def setSoundFunction(self, value):
17 eRFmod.getInstance().setSoundFunction(not value)
18 def setSoundCarrier(self, value):
19 eRFmod.getInstance().setSoundCarrier(value)
20 def setChannel(self, value):
21 eRFmod.getInstance().setChannel(value)
22 def setFinetune(self, value):
23 eRFmod.getInstance().setFinetune(value)
27 config.rfmod = ConfigSubsection()
28 config.rfmod.enable = ConfigOnOff(default=False)
29 config.rfmod.test = ConfigOnOff(default=False)
30 config.rfmod.sound = ConfigOnOff(default=True)
31 config.rfmod.soundcarrier = ConfigSelection(choices=[("4500","4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz")], default="5500")
32 config.rfmod.channel = ConfigSelection(default = "36", choices = ["%d" % x for x in range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)])
33 config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10))
37 def setFunction(configElement):
38 iRFmod.setFunction(configElement.value);
39 def setTestmode(configElement):
40 iRFmod.setTestmode(configElement.value);
41 def setSoundFunction(configElement):
42 iRFmod.setSoundFunction(configElement.value);
43 def setSoundCarrier(configElement):
44 iRFmod.setSoundCarrier(configElement.index);
45 def setChannel(configElement):
46 iRFmod.setChannel(int(configElement.value));
47 def setFinetune(configElement):
48 iRFmod.setFinetune(configElement.value - 5);
50 # this will call the "setup-val" initial
51 config.rfmod.enable.addNotifier(setFunction);
52 config.rfmod.test.addNotifier(setTestmode);
53 config.rfmod.sound.addNotifier(setSoundFunction);
54 config.rfmod.soundcarrier.addNotifier(setSoundCarrier);
55 config.rfmod.channel.addNotifier(setChannel);
56 config.rfmod.finetune.addNotifier(setFinetune);