1 from config import config #global config instance
3 from config import configElement
4 from config import ConfigSubsection
5 from config import ConfigSlider
6 from config import configSelection
9 def __init__(self, slotid, nimtype, name):
11 self.nimType = nimtype
15 def getNimType(self, slotID):
16 #FIXME get it from /proc
18 return self.nimType["DVB-S"]
20 return self.nimType["empty/unknown"]
22 def getNimName(self, slotID):
23 #FIXME get it from /proc
26 def getNimSocketCount(self):
27 #FIXME get it from /proc
30 def getConfigPrefix(self, slotid):
31 return "config.Nim" + ("A","B","C","D")[slotid] + "."
35 self.nimType = { "empty/unknown": -1,
40 self.nimCount = self.getNimSocketCount()
44 while x < self.nimCount:
45 tType = self.getNimType(x)
46 tName = self.getNimName(x)
47 tNim = nimSlot(x, tType, tName)
48 self.nimslots.append(tNim)
51 InitNimManager(self) #init config stuff
55 for slot in self.nimslots:
56 nimText = "Socket " + ("A", "B", "C", "D")[slot.slotid] + ": "
57 if slot.nimType == -1:
58 nimText += "empty/unknown"
60 nimText += slot.name + " ("
61 nimText += ("DVB-S", "DVB-C", "DVB-T")[slot.nimType] + ")"
62 list.append((nimText, slot))
65 def InitNimManager(nimmgr):
66 config.Nims = [ConfigSubsection()] * nimmgr.nimCount
68 for slot in nimmgr.nimslots:
70 cname = nimmgr.getConfigPrefix(x)
72 if slot.nimType == nimmgr.nimType["DVB-S"]:
73 config.Nims[x].configMode = configElement(cname + "configMode",configSelection, 0, ("Simple", "Advanced"));
74 config.Nims[x].diseqcMode = configElement(cname + "diseqcMode",configSelection, 0, ("Single", "Toneburst A/B", "DiSEqC A/B"));
75 config.Nims[x].diseqcMode = configElement(cname + "toneburstA",configSelection, 0, ("Astra", "Hotbird"));
76 config.Nims[x].diseqcMode = configElement(cname + "toneburstB",configSelection, 0, ("Astra", "Hotbird"));
77 config.Nims[x].diseqcMode = configElement(cname + "diseqcA",configSelection, 0, ("Astra", "Hotbird"));
78 config.Nims[x].diseqcMode = configElement(cname + "diseqcB",configSelection, 0, ("Astra", "Hotbird"));
79 config.Nims[x].diseqcMode = configElement(cname + "diseqcC",configSelection, 0, ("Astra", "Hotbird"));
80 config.Nims[x].diseqcMode = configElement(cname + "diseqcD",configSelection, 0, ("Astra", "Hotbird"));
82 print "pls add support for this frontend type!"
86 #def inputDevicesRepeatChanged(configElement):
87 # iDevices.setRepeat(configElement.value);
89 #def inputDevicesDelayChanged(configElement):
90 # iDevices.setDelay(configElement.value);
92 # this will call the "setup-val" initial
93 #config.inputDevices.repeat.addNotifier(inputDevicesRepeatChanged);
94 #config.inputDevices.delay.addNotifier(inputDevicesDelayChanged);
96 nimmanager = NimManager()