aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-07-19 18:19:48 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-07-19 18:19:48 +0000
commit0d8132d3512dbf77d817aa8fb6684384155b642e (patch)
tree638671e91da1631c59c8b26e8813d506c5c77bdc /lib
parente794d772380ab8b74a2459a07d2f61b49e3a1cf0 (diff)
downloadenigma2-0d8132d3512dbf77d817aa8fb6684384155b642e.tar.gz
enigma2-0d8132d3512dbf77d817aa8fb6684384155b642e.zip
add ability to choose "Multiple service support (auto/no/yes)" in Ci Setup
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb_ci/dvbci.cpp29
-rw-r--r--lib/python/Screens/Ci.py39
2 files changed, 52 insertions, 16 deletions
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