from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN
from Components.ConfigList import ConfigList
-from enigma import eTimer, eDVBCI_UI
+from Components.SystemInfo import SystemInfo
+
+from enigma import eTimer, eDVBCI_UI, eDVBCIInterfaces
MAX_NUM_CI = 4
+def setCIBitrate(configElement):
+ if configElement.value == "no":
+ eDVBCI_UI.getInstance().setClockRate(configElement.slotid, eDVBCI_UI.rateNormal)
+ else:
+ eDVBCI_UI.getInstance().setClockRate(configElement.slotid, eDVBCI_UI.rateHigh)
+
def InitCiConfig():
config.ci = ConfigSubList()
for slot in range(MAX_NUM_CI):
config.ci.append(ConfigSubsection())
config.ci[slot].canDescrambleMultipleServices = ConfigSelection(choices = [("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes"))], default = "auto")
+ if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
+ config.ci[slot].canHandleHighBitrates = ConfigSelection(choices = [("no", _("No")), ("yes", _("Yes"))], default = "no")
+ config.ci[slot].canHandleHighBitrates.slotid = slot
+ config.ci[slot].canHandleHighBitrates.addNotifier(setCIBitrate)
class MMIDialog(Screen):
def __init__(self, session, slotid, action, handler = eDVBCI_UI.getInstance(), wait_text = _("wait for ci...") ):
self.slotid = slotid
self.timer = eTimer()
- self.timer.timeout.get().append(self.keyCancel)
+ self.timer.callback.append(self.keyCancel)
#else the skins fails
self["title"] = Label("")
elif self.tag == "WAIT":
self.handler.stopMMI(self.slotid)
self.closeMmi()
- elif self.tag in [ "MENU", "LIST" ]:
+ elif self.tag in ( "MENU", "LIST" ):
print "cancel list"
self.handler.answerMenu(self.slotid, 0)
self.showWait()
self.ci = { }
self.dlgs = { }
eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
+ SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
+ try:
+ file = open("/proc/stb/tsmux/ci0_tsclk", "r")
+ file.close()
+ SystemInfo["CommonInterfaceSupportsHighBitrates"] = True
+ except:
+ SystemInfo["CommonInterfaceSupportsHighBitrates"] = False
def setSession(self, session):
self.session = session
def selectionChanged(self):
cur_idx = self["entries"].getCurrentIndex()
- self["text"].setText(_("Slot %d")%((cur_idx / 4)+1))
+ self["text"].setText(_("Slot %d")%((cur_idx / 5)+1))
def keyConfigEntry(self, key):
try:
self.list.append( (appname, ConfigNothing(), 2, slot) )
self.list.append(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices))
+ if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
+ self.list.append(getConfigListEntry(_("High bitrate support"), config.ci[slot].canHandleHighBitrates))
def updateState(self, slot):
state = eDVBCI_UI.getInstance().getState(slot)