#include <fcntl.h>
#include <sys/ioctl.h>
-#include <string>
-
#include <lib/base/init.h>
#include <lib/base/init_num.h>
-#include <lib/base/econfig.h>
#include <lib/base/eerror.h>
+#include <lib/base/estring.h>
+
+#define MAX_SLOTS 4
-eDVBCI_UI *eDVBCI_UI::instance = 0;
+eDVBCI_UI *eDVBCI_UI::instance;
eDVBCI_UI::eDVBCI_UI()
+ :eMMI_UI(MAX_SLOTS)
{
- int i;
-
- for(i=0;i<MAX_SLOTS;i++)
- state[i] = 0; //no module
-
ASSERT(!instance);
instance = this;
- mmiScreenReady = 0;
-}
-
-eDVBCI_UI::~eDVBCI_UI()
-{
}
eDVBCI_UI *eDVBCI_UI::getInstance()
return instance;
}
-int eDVBCI_UI::getState(int slot)
-{
- return state[slot]; //exploit me ;)
-}
-
-void eDVBCI_UI::setState(int slot, int newState)
+void eDVBCI_UI::setInit(int slot)
{
- state[slot] = newState;
-}
-
-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;
+ eDVBCIInterfaces::getInstance()->initialize(slot);
}
void eDVBCI_UI::setReset(int slot)
int eDVBCI_UI::startMMI(int slot)
{
eDVBCIInterfaces::getInstance()->startMMI(slot);
+ return 0;
}
int eDVBCI_UI::stopMMI(int slot)
{
eDVBCIInterfaces::getInstance()->stopMMI(slot);
-}
-
-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);
+ return 0;
}
-int eDVBCI_UI::answerEnq(int slot, int answer, char *value)
-{
- eDVBCIInterfaces::getInstance()->answerEnq(slot, answer, value);
-}
-
-int eDVBCI_UI::availableMMI(int slot)
-{
- return mmiScreenReady;
-}
-
-int eDVBCI_UI::mmiScreenBegin(int slot, int listmenu)
+int eDVBCI_UI::answerEnq(int slot, char *value)
{
- printf("eDVBCI_UI::mmiScreenBegin\n");
-
- mmiScreenReady = 0;
-
- mmiScreen = PyList_New(1);
-
- PyObject *tuple = PyTuple_New(1);
- if(listmenu)
- PyTuple_SetItem(tuple, 0, PyString_FromString("LIST"));
- else
- PyTuple_SetItem(tuple, 0, PyString_FromString("MENU"));
- PyList_SetItem(mmiScreen, 0, tuple);
-
- mmiTuplePos = 1;
-
+ eDVBCIInterfaces::getInstance()->answerEnq(slot, value);
return 0;
}
-int eDVBCI_UI::mmiScreenAddText(int slot, int type, char *value)
+int eDVBCI_UI::cancelEnq(int slot)
{
- printf("eDVBCI_UI::mmiScreenAddText(%s)\n",value);
-
- PyObject *tuple = PyTuple_New(3);
-
- if(type == 0) //title
- PyTuple_SetItem(tuple, 0, PyString_FromString("TITLE"));
- else if(type == 1) //subtitle
- PyTuple_SetItem(tuple, 0, PyString_FromString("SUBTITLE"));
- else if(type == 2) //bottom
- PyTuple_SetItem(tuple, 0, PyString_FromString("BOTTOM"));
- else
- PyTuple_SetItem(tuple, 0, PyString_FromString("TEXT"));
-
- printf("addText %s with id %d\n", value, type);
-
- PyTuple_SetItem(tuple, 1, PyString_FromString(value));
-
- if(type > 2)
- PyTuple_SetItem(tuple, 2, PyInt_FromLong(type-2));
- else
- PyTuple_SetItem(tuple, 2, PyInt_FromLong(-1));
-
- PyList_Append(mmiScreen, tuple);
-
+ eDVBCIInterfaces::getInstance()->cancelEnq(slot);
return 0;
}
-int eDVBCI_UI::mmiScreenFinish(int slot)
+int eDVBCI_UI::getMMIState(int slot)
{
- printf("eDVBCI_UI::mmiScreenFinish\n");
-
- mmiScreenReady = 1;
-
- return 0;
+ return eDVBCIInterfaces::getInstance()->getMMIState(slot);
}
-PyObject *eDVBCI_UI::getMMIScreen(int slot)
+int eDVBCI_UI::setClockRate(int slot, int rate)
{
- if(mmiScreenReady != 1)
- return Py_None;
-
- mmiScreenReady = 0;
-
- return mmiScreen;
+ return eDVBCIInterfaces::getInstance()->setCIClockRate(slot, rate);
}
//FIXME: correct "run/startlevel"