added lcd controls
[enigma2.git] / lib / python / Components / SetupDevices.py
1 import os
2
3 from config import config                               #global config instance
4
5 from config import configElement
6 from config import ConfigSubsection
7 from config import ConfigSlider
8 from config import configBoolean
9
10 #temp. class for exhibition
11
12 class LCD:
13         def __init__(self):
14                 pass
15
16         def setBright(self, value):
17                 os.system("lcddimm " + str(value * 10))
18
19         def setContrast(self, value):
20                 os.system("lcdcontrast " + str(value * 6))
21
22 def InitSetupDevices():
23         config.timezone = ConfigSubsection();
24         config.timezone.val = configElement("", configBoolean, 1, ("GMT", "GMT+1", "GMT+2", "GMT+3", "GMT+4", "GMT+5", "GMT+6", "GMT+7", "GMT+8", "GMT+9") );
25
26         config.rc = ConfigSubsection();
27         config.rc.map = configElement("", configBoolean, 0, ("Default", "Classic") );
28
29 #       config.av = ConfigSubsection();
30 #       config.av.colorformat = configElement("", configBoolean, 1, ("CVBS", "RGB", "S-Video") );
31 #       config.av.aspectratio = configElement("", configBoolean, 0, ("4:3 Letterbox", "4:3 PanScan", "16:9", "16:9 always") );
32 #       config.av.tvsystem = configElement("", configBoolean, 0, ("PAL", "PAL + PAL60", "Multi", "NTSC") );
33 #       config.av.wss = configElement("", configBoolean, 0, ("Enable", "Disable") );
34 #       config.av.defaultac3 = configElement("", configBoolean, 1, ("Enable", "Disable") );
35 #       config.av.vcrswitch = configElement("", configBoolean, 0, ("Enable", "Disable") );
36
37         config.rfmod = ConfigSubsection();
38         config.rfmod.enable = configElement("", configBoolean, 1, ("Enable", "Disable") );
39         config.rfmod.test = configElement("", configBoolean, 1, ("Enable", "Disable") );
40         config.rfmod.sound = configElement("", configBoolean, 0, ("Enable", "Disable") );
41         config.rfmod.soundcarrier = configElement("", configBoolean, 1, ("4.5 MHz", "5.5 MHz", "6.0 MHz", "6.5 MHz") );
42         config.rfmod.channel = configElement("", configBoolean, 6, ("30", "31", "32", "33", "34", "35", "36", "37", "38", "39") );
43         config.rfmod.finetune = configElement("", ConfigSlider, 5, "");
44
45         config.keyboard = ConfigSubsection();
46         config.keyboard.keymap = configElement("", configBoolean, 1, ("English", "German") );
47
48         config.osd = ConfigSubsection();
49         config.osd.alpha = configElement("", ConfigSlider, 0, "");
50         config.osd.bright = configElement("", ConfigSlider, 5, "");
51         config.osd.contrast = configElement("", ConfigSlider, 5, "");
52         config.osd.language = configElement("", configBoolean, 0, ("English", "English US") );
53
54         config.lcd = ConfigSubsection();
55         config.lcd.bright = configElement("", ConfigSlider, 7, "");
56         config.lcd.contrast = configElement("", ConfigSlider, 2, "");
57         config.lcd.standby = configElement("", ConfigSlider, 1, "");
58         config.lcd.invert = configElement("", configBoolean, 1, ("Enable", "Disable") );
59
60         ilcd = LCD()
61
62         def setLCDbright(configElement):
63                 ilcd.setBright(configElement.value);
64
65         def setLCDcontrast(configElement):
66                 ilcd.setContrast(configElement.value);
67
68         config.lcd.bright.addNotifier(setLCDbright);
69         config.lcd.contrast.addNotifier(setLCDcontrast);
70
71         config.parental = ConfigSubsection();
72         config.parental.lock = configElement("", configBoolean, 1, ("Enable", "Disable") );
73         config.parental.setuplock = configElement("", configBoolean, 1, ("Enable", "Disable") );
74
75         config.expert = ConfigSubsection();
76         config.expert.splitsize = configElement("", configBoolean, 1, ("0.5Gbyte", "1.0 GByte", "1.5 GByte", "2.0 GByte") );
77         config.expert.satpos = configElement("", configBoolean, 1, ("Enable", "Disable") );
78         config.expert.fastzap = configElement("", configBoolean, 0, ("Enable", "Disable") );
79         config.expert.skipconfirm = configElement("", configBoolean, 1, ("Enable", "Disable") );
80         config.expert.hideerrors = configElement("", configBoolean, 1, ("Enable", "Disable") );
81         config.expert.autoinfo = configElement("", configBoolean, 1, ("Enable", "Disable") );
82
83         config.sat = ConfigSubsection();
84         config.sat.satA = configElement("", configBoolean, 1, ("Disabled" ,"Astra 19.2", "Hotbird 13.0") );
85         config.sat.satB = configElement("", configBoolean, 0, ("Disabled" ,"Astra 19.2", "Hotbird 13.0") );
86         config.sat.diseqcA = configElement("", configBoolean, 3, ("no DiSEqC", "DiSEqC 1.0", "DiSEqC 1.1", "DiSEqC 1.2") );
87         config.sat.diseqcB = configElement("", configBoolean, 0, ("no DiSEqC", "DiSEqC 1.0", "DiSEqC 1.1", "DiSEqC 1.2") );
88         config.sat.posA = configElement("", configBoolean, 0, ("DiSEqC A", "DiSEqC B", "DiSEqC C", "DiSEqC D") );
89         config.sat.posB = configElement("", configBoolean, 1, ("DiSEqC A", "DiSEqC B", "DiSEqC C", "DiSEqC D") );
90
91         #config.blasel = ConfigSubsection();
92         #config.blasel.val = configElement("", configBoolean, 0, ("bunt", "s/w", "gruen") );
93         #config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 3);
94
95         #this instance anywhere else needed?    
96         #iDevices = inputDevices();     
97         
98         #def inputDevicesRepeatChanged(configElement):
99         #       iDevices.setRepeat(configElement.value);
100
101         #def inputDevicesDelayChanged(configElement):
102         #       iDevices.setDelay(configElement.value);
103
104         # this will call the "setup-val" initial
105         #config.inputDevices.repeat.addNotifier(inputDevicesRepeatChanged);
106         #config.inputDevices.delay.addNotifier(inputDevicesDelayChanged);