X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb_ci%2Fdvbci_ui.cpp;h=1ff0c3266f2d0f503674e85a6d368ac2d4a0060e;hp=306bcd13763578987eb629cabd49ff453de5fb66;hb=d9b91542e07a2296b69141433d863fe8028b148e;hpb=663df8b68d461fe8137367977afa7fefc63f1838 diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index 306bcd1..1ff0c32 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -22,7 +22,7 @@ eDVBCI_UI::eDVBCI_UI() slotdata[i].mmiScreen=NULL; slotdata[i].mmiScreenReady=0; slotdata[i].mmiTuplePos=0; - slotdata[i].state=0; + slotdata[i].state=-1; } } @@ -43,18 +43,17 @@ eDVBCI_UI *eDVBCI_UI::getInstance() int eDVBCI_UI::getState(int slot) { if (slot < MAX_SLOTS) - { - if (eDVBCIInterfaces::getInstance()->getSlotState(slot) == eDVBCISlot::stateInvalid) - eDVBCIInterfaces::getInstance()->reset(slot); return slotdata[slot].state; - } return 0; } void eDVBCI_UI::setState(int slot, int newState) { if (slot < MAX_SLOTS) + { slotdata[slot].state = newState; + /*emit*/ ciStateChanged(slot); + } } std::string eDVBCI_UI::getAppName(int slot) @@ -117,6 +116,28 @@ int eDVBCI_UI::availableMMI(int slot) return false; } +int eDVBCI_UI::mmiScreenClose(int slot, int timeout) +{ + if (slot >= MAX_SLOTS) + return 0; + + slot_ui_data &data = slotdata[slot]; + + data.mmiScreenReady = 0; + + if (data.mmiScreen) + Py_DECREF(data.mmiScreen); + data.mmiScreen = PyList_New(1); + + PyObject *tuple = PyTuple_New(2); + PyTuple_SET_ITEM(tuple, 0, PyString_FromString("CLOSE")); + PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong(timeout)); + PyList_SET_ITEM(data.mmiScreen, 0, tuple); + data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; +} + int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) { if (slot >= MAX_SLOTS) @@ -144,6 +165,8 @@ int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; } @@ -152,7 +175,7 @@ int eDVBCI_UI::mmiScreenBegin(int slot, int listmenu) if (slot >= MAX_SLOTS) return 0; - printf("eDVBCI_UI::mmiScreenBegin\n"); + eDebug("eDVBCI_UI::mmiScreenBegin"); slot_ui_data &data = slotdata[slot]; @@ -215,13 +238,18 @@ int eDVBCI_UI::mmiScreenFinish(int slot) { if (slot < MAX_SLOTS) { - printf("eDVBCI_UI::mmiScreenFinish\n"); + eDebug("eDVBCI_UI::mmiScreenFinish"); slotdata[slot].mmiScreenReady = 1; - /*emit*/ mmiAvail(slot); + /*emit*/ ciStateChanged(slot); } return 0; } +void eDVBCI_UI::mmiSessionDestroyed(int slot) +{ + /*emit*/ ciStateChanged(slot); +} + int eDVBCI_UI::getMMIState(int slot) { return eDVBCIInterfaces::getInstance()->getMMIState(slot);