modifications for working edit mode
[enigma2.git] / lib / python / Components / RFmod.py
1 from config import *
2 from enigma import *
3
4 class RFmod:
5         def __init__(self):
6                 pass
7
8         def setFunction(self, value):
9                 eRFmod.getInstance().setFunction(value)
10         def setTestmode(self, value):
11                 eRFmod.getInstance().setTestmode(value)
12         def setSoundFunction(self, value):
13                 eRFmod.getInstance().setSoundFunction(value)
14         def setSoundCarrier(self, value):
15                 eRFmod.getInstance().setSoundCarrier(value)
16         def setChannel(self, value):
17                 eRFmod.getInstance().setChannel(value)
18         def setFinetune(self, value):
19                 eRFmod.getInstance().setFinetune(value)
20
21 def InitRFmod():
22
23         config.rfmod = ConfigSubsection();
24         config.rfmod.enable = configElement("config.rfmod.enable", configSelection, 1, ("Enable", "Disable") );
25         config.rfmod.test = configElement("config.rfmod.test", configSelection, 1, ("Enable", "Disable") );
26         config.rfmod.sound = configElement("config.rfmod.sound", configSelection, 0, ("Enable", "Disable") );
27         config.rfmod.soundcarrier = configElement("config.rfmod.soundcarrier", configSelection, 1, ("4.5 MHz", "5.5 MHz", "6.0 MHz", "6.5 MHz") );
28         config.rfmod.channel = configElement("config.rfmod.channel", configSelection, 6, ("30", "31", "32", "33", "34", "35", "36", "37", "38", "39") );
29         config.rfmod.finetune = configElement("config.rfmod.finetune", ConfigSlider, 5, "");
30
31         iRFmod = RFmod()
32
33         def setFunction(configElement):
34                 iRFmod.setFunction(configElement.value);
35         def setTestmode(configElement):
36                 iRFmod.setTestmode(configElement.value);
37         def setSoundFunction(configElement):
38                 iRFmod.setSoundFunction(configElement.value);
39         def setSoundCarrier(configElement):
40                 iRFmod.setSoundCarrier(configElement.value);
41         def setChannel(configElement):
42                 iRFmod.setChannel(configElement.value +  30);
43         def setFinetune(configElement):
44                 iRFmod.setFinetune(configElement.value - 5);
45
46         # this will call the "setup-val" initial
47         config.rfmod.enable.addNotifier(setFunction);
48         config.rfmod.test.addNotifier(setTestmode);
49         config.rfmod.sound.addNotifier(setSoundFunction);
50         config.rfmod.soundcarrier.addNotifier(setSoundCarrier);
51         config.rfmod.channel.addNotifier(setChannel);
52         config.rfmod.finetune.addNotifier(setFinetune);