X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c8e724bf4828077d60b2d969fc210c0c5b722506..891da2ac4faa83f3af25d5deaa2176e424e5fba3:/lib/dvb_ci/dvbci_ui.cpp diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index d36ea6ec..b1bfdc25 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -5,30 +5,20 @@ #include #include -#include - #include #include -#include #include +#include + +#define MAX_SLOTS 4 -eDVBCI_UI *eDVBCI_UI::instance = 0; +eDVBCI_UI *eDVBCI_UI::instance; eDVBCI_UI::eDVBCI_UI() - :mmiScreen(NULL) - ,mmiTuplePos(0) - ,mmiScreenReady(0) + :eMMI_UI(MAX_SLOTS) { ASSERT(!instance); instance = this; - for(int i=0;ienableTS(slot, 1); -} - -std::string eDVBCI_UI::getAppName(int slot) -{ - return appName; -} - -void eDVBCI_UI::setAppName(int slot, const char *name) -{ - //printf("set name to -%c-\n", name); - appName = name; -} - void eDVBCI_UI::setInit(int slot) { - eDVBCIInterfaces::getInstance()->sendCAPMT(slot); + eDVBCIInterfaces::getInstance()->initialize(slot); } void eDVBCI_UI::setReset(int slot) @@ -82,12 +48,6 @@ int eDVBCI_UI::stopMMI(int slot) return 0; } -int eDVBCI_UI::initialize(int slot) -{ - eDVBCIInterfaces::getInstance()->initialize(slot); - return 0; -} - int eDVBCI_UI::answerMenu(int slot, int answer) { eDVBCIInterfaces::getInstance()->answerText(slot, answer); @@ -106,113 +66,14 @@ int eDVBCI_UI::cancelEnq(int slot) return 0; } -int eDVBCI_UI::availableMMI(int slot) -{ - return mmiScreenReady; -} - -int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) -{ - mmiScreenReady = 0; - - if(mmiScreen) - Py_DECREF(mmiScreen); - mmiScreen = PyList_New(2); - - PyObject *tuple = PyTuple_New(1); - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("ENQ")); - PyList_SET_ITEM(mmiScreen, 0, tuple); - - tuple = PyTuple_New(4); - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("PIN")); - PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(answerLen)); - PyTuple_SET_ITEM(tuple, 2, PyString_FromString(text)); - PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong(blind)); - - PyList_SET_ITEM(mmiScreen, 1, tuple); - - mmiScreenReady = 1; - - return 0; -} - -int eDVBCI_UI::mmiScreenBegin(int slot, int listmenu) -{ - printf("eDVBCI_UI::mmiScreenBegin\n"); - - mmiScreenReady = 0; - - if(mmiScreen) - Py_DECREF(mmiScreen); - mmiScreen = PyList_New(1); - - PyObject *tuple = PyTuple_New(1); - if(listmenu == 0) //menu - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("MENU")); - else //list - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("LIST")); - - PyList_SET_ITEM(mmiScreen, 0, tuple); - - mmiTuplePos = 1; - - return 0; -} - -int eDVBCI_UI::mmiScreenAddText(int slot, int type, char *value) -{ - eDebug("eDVBCI_UI::mmiScreenAddText(%s)",value); - - PyObject *tuple = PyTuple_New(3); - - if(type == 0) //title - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("TITLE")); - else if(type == 1) //subtitle - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("SUBTITLE")); - else if(type == 2) //bottom - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("BOTTOM")); - else - PyTuple_SET_ITEM(tuple, 0, PyString_FromString("TEXT")); - - eDebug("addText %s with id %d", value, type); - - PyTuple_SET_ITEM(tuple, 1, PyString_FromString(value)); - - if(type > 2) - PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong(type-2)); - else - PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong(-1)); - - PyList_Append(mmiScreen, tuple); - Py_DECREF(tuple); - - return 0; -} - -int eDVBCI_UI::mmiScreenFinish(int slot) -{ - printf("eDVBCI_UI::mmiScreenFinish\n"); - - mmiScreenReady = 1; - - return 0; -} - int eDVBCI_UI::getMMIState(int slot) { return eDVBCIInterfaces::getInstance()->getMMIState(slot); } -PyObject *eDVBCI_UI::getMMIScreen(int slot) +int eDVBCI_UI::setClockRate(int slot, int rate) { - if(mmiScreenReady) - { - mmiScreenReady = 0; - Py_INCREF(mmiScreen); - return mmiScreen; - } - Py_INCREF(Py_None); - return Py_None; + return eDVBCIInterfaces::getInstance()->setCIClockRate(slot, rate); } //FIXME: correct "run/startlevel"