+
+ def tunerTypeChanged(nimmgr, configElement):
+ fe_id = configElement.fe_id
+ print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value)
+ try:
+ oldvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
+ open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
+ except:
+ print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
+ frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend()
+ frontend.closeFrontend()
+ open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
+ frontend.reopenFrontend()
+ try:
+ open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(oldvalue)
+ except:
+ print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
+ nimmgr.enumerateNIMs()
+
+ empty_slots = 0
+ for slot in nimmgr.nim_slots:
+ x = slot.slot
+ nim = config.Nims[x]
+ addMultiType = False
+ try:
+ nim.multiType
+ except:
+ addMultiType = True
+ if slot.isMultiType() and addMultiType:
+ typeList = []
+ for id in slot.getMultiTypeList().keys():
+ type = slot.getMultiTypeList()[id]
+ typeList.append((id, type))
+ nim.multiType = ConfigSelection(typeList, "0")
+
+ nim.multiType.fe_id = x - empty_slots
+ nim.multiType.addNotifier(boundFunction(tunerTypeChanged, nimmgr))
+