diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-07-19 18:19:48 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-07-19 18:19:48 +0000 |
| commit | 0d8132d3512dbf77d817aa8fb6684384155b642e (patch) | |
| tree | 638671e91da1631c59c8b26e8813d506c5c77bdc | |
| parent | e794d772380ab8b74a2459a07d2f61b49e3a1cf0 (diff) | |
| download | enigma2-0d8132d3512dbf77d817aa8fb6684384155b642e.tar.gz enigma2-0d8132d3512dbf77d817aa8fb6684384155b642e.zip | |
add ability to choose "Multiple service support (auto/no/yes)" in Ci Setup
| -rw-r--r-- | data/keymap.xml | 5 | ||||
| -rw-r--r-- | data/skin_default.xml | 4 | ||||
| -rw-r--r-- | lib/dvb_ci/dvbci.cpp | 29 | ||||
| -rw-r--r-- | lib/python/Screens/Ci.py | 39 | ||||
| -rw-r--r-- | mytest.py | 3 | ||||
| -rw-r--r-- | po/de.po | 4 | ||||
| -rw-r--r-- | po/enigma2.pot | 4 |
7 files changed, 70 insertions, 18 deletions
diff --git a/data/keymap.xml b/data/keymap.xml index 38397151..bf5e4244 100644 --- a/data/keymap.xml +++ b/data/keymap.xml @@ -383,6 +383,11 @@ <key id="KEY_ENTER" mapto="showMenu" flags="m" /> </map> + <map context="CiSelectionActions"> + <key id="KEY_LEFT" mapto="left" flags="mr" /> + <key id="KEY_RIGHT" mapto="right" flags="mr" /> + </map> + <map context="PiPSetupActions"> <key id="KEY_UP" mapto="up" flags="mr" /> <key id="KEY_DOWN" mapto="down" flags="mr" /> diff --git a/data/skin_default.xml b/data/skin_default.xml index 9bb9e860..041fb5cc 100644 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -92,8 +92,8 @@ <screen name="CiWait" position="180,263" size="360,50" title="Common Interface"> <widget name="message" position="20,10" size="320,25" font="Regular;23" /> </screen> - <screen name="CiSelection" position="180,238" size="360,100" title="Common Interface"> - <widget name="entries" position="10,10" size="340,75" /> + <screen name="CiSelection" position="140,226" size="440,125" title="Common Interface"> + <widget name="entries" position="10,10" size="420,100" /> </screen> <screen name="CiMmi" position="135,153" size="450,270"> <widget name="title" position="10,10" size="430,25" font="Regular;23" /> diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 9c4e0ac2..f6462620 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -6,6 +6,7 @@ #include <lib/base/ebase.h> #include <lib/base/eerror.h> +#include <lib/base/nconfig.h> // access to python config #include <lib/dvb/pmt.h> #include <lib/dvb_ci/dvbci.h> #include <lib/dvb_ci/dvbci_session.h> @@ -217,6 +218,24 @@ void eDVBCIInterfaces::ciRemoved(eDVBCISlot *slot) } } +static bool canDescrambleMultipleServices(int slotid) +{ + char configStr[255]; + snprintf(configStr, 255, "config.ci%d.canDescrambleMultipleServices", slotid); + std::string str; + ePythonConfigQuery::getConfigValue(configStr, str); + eDebug("str is %s", str.empty()?"empty" : str.c_str()); + if ( str == "auto" ) + { + std::string appname = eDVBCI_UI::getInstance()->getAppName(slotid); + if (appname.find("AlphaCrypt") != std::string::npos) + return true; + } + else if (str == "yes") + return true; + return false; +} + void eDVBCIInterfaces::recheckPMTHandlers() { // eDebug("recheckPMTHAndlers()"); @@ -278,7 +297,6 @@ void eDVBCIInterfaces::recheckPMTHandlers() { if ( tmp->cislot ) { - bool canHandleMultipleServices=false; eServiceReferenceDVB ref2; tmp->pmthandler->getServiceReference(ref2); eDVBChannelID s1, s2; @@ -286,15 +304,8 @@ void eDVBCIInterfaces::recheckPMTHandlers() { ref.getChannelID(s1); ref2.getChannelID(s2); - // FIXME .. build a "ci can handle multiple services" config entry - // Yes / No / Auto - if ( eDVBCI_UI::getInstance()->getAppName(ci_it->getSlotID()) == "AlphaCrypt" ) - { - canHandleMultipleServices = true; - eDebug("Alphacrypt can handle multiple services"); - } } - if (ref == ref2 || (s1 == s2 && canHandleMultipleServices) ) + if (ref == ref2 || (s1 == s2 && canDescrambleMultipleServices(ci_it->getSlotID()))) { it->cislot = tmp->cislot; ++it->cislot->use_count; diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py index b3653d21..b516ec70 100644 --- a/lib/python/Screens/Ci.py +++ b/lib/python/Screens/Ci.py @@ -15,6 +15,13 @@ from enigma import eTimer, eDVBCI_UI, eListboxPythonStringContent, eListboxPytho TYPE_MENU = 0 TYPE_CONFIG = 1 +MAX_NUM_CI = 4 + +def InitCiConfig(): + config.ci = [ ] + for slot in range(MAX_NUM_CI): + config.ci.append(ConfigSubsection()) + config.ci[slot].canDescrambleMultipleServices = configElement("config.ci%d.canDescrambleMultipleServices"%(slot), configSelection, 0, (("auto", _("Auto")), ("no", _("No")), ("yes", _("Yes")))) class CiMmi(Screen): def __init__(self, session, slotid, action): @@ -264,26 +271,42 @@ class CiSelection(Screen): def __init__(self, session): Screen.__init__(self, session) - self["actions"] = ActionMap(["OkCancelActions"], + self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"], { + "left": self.keyLeft, + "right": self.keyLeft, "ok": self.okbuttonClick, "cancel": self.cancel - }) + },-1) self.dlg = None self.state = { } self.list = [ ] - for slot in range(4): + for slot in range(MAX_NUM_CI): state = eDVBCI_UI.getInstance().getState(slot) - self.appendEntries(slot, state) # FIXME more than one CI - CiHandler.registerCIMessageHandler(slot, self.ciStateChanged) + if state != -1: + self.appendEntries(slot, state) + CiHandler.registerCIMessageHandler(slot, self.ciStateChanged) - menuList = MenuList(list) + menuList = ConfigList(list) menuList.list = self.list menuList.l.setList(self.list) self["entries"] = menuList + def keyConfigEntry(self, key): + try: + self["entries"].handleKey(key) + self["entries"].getCurrent()[1].save() + except: + pass + + def keyLeft(self): + self.keyConfigEntry(config.key["prevElement"]) + + def keyRight(self): + self.keyConfigEntry(config.key["nextElement"]) + def appendEntries(self, slot, state): self.state[slot] = state self.list.append( (_("Reset"), 0, slot) ) @@ -298,6 +321,8 @@ class CiSelection(Screen): appname = eDVBCI_UI.getInstance().getAppName(slot) self.list.append( (appname, 2, slot) ) + self.list.append(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices)) + def updateState(self, slot): state = eDVBCI_UI.getInstance().getState(slot) self.state[slot] = state @@ -337,7 +362,7 @@ class CiSelection(Screen): def okbuttonClick(self): cur = self["entries"].getCurrent() - if cur: + if cur and len(cur) > 2: action = cur[1] slot = cur[2] if action == 0: #reset @@ -484,6 +484,9 @@ Components.RFmod.InitRFmod() import Components.NimManager +import Screens.Ci +Screens.Ci.InitCiConfig() + # first, setup a screen try: runScreenTest() @@ -783,6 +783,10 @@ msgstr "Filmauswahl" msgid "Multi EPG" msgstr "Multi-EPG" +#: ../lib/python/Screens/Ci.py:324 +msgid "Multiple service support" +msgstr "Kann mehrere Sender entschlüsseln" + #: ../lib/python/Screens/ScanSetup.py:352 msgid "Multisat" msgstr "Multisat" diff --git a/po/enigma2.pot b/po/enigma2.pot index 5dd5a159..652e73d4 100644 --- a/po/enigma2.pot +++ b/po/enigma2.pot @@ -756,6 +756,10 @@ msgstr "" msgid "Multi EPG" msgstr "" +#: ../lib/python/Screens/Ci.py:324 +msgid "Multiple service support" +msgstr "" + #: ../lib/python/Screens/ScanSetup.py:352 msgid "Multisat" msgstr "" |
