+#ifdef WITH_SDL
+#define SDLDC
+#endif
#include <stdio.h>
#include <libsig_comp.h>
#include <lib/base/ebase.h>
#include <lib/gdi/grc.h>
#include <lib/gdi/gfbdc.h>
+#ifdef WITH_SDL
+#include <lib/gdi/sdl.h>
+#endif
#include <lib/gdi/font.h>
#include <lib/gui/ewidget.h>
#include <lib/driver/rc.h>
+#include <lib/actions/action.h>
+
+#include <lib/gdi/epng.h>
+
#ifdef OBJECT_DEBUG
int object_total_remaining;
void keyEvent(const eRCKey &key)
{
- if (!key.flags)
- keyPressed(key.code);
+ ePtr<eActionMap> ptr;
+ eActionMap::getInstance(ptr);
+ ptr->keyPressed(0, key.code, key.flags);
+// if (!key.flags)
+// keyPressed(key.code);
}
/************************************************/
+#include <unistd.h>
+#include <lib/components/scan.h>
+#include <lib/dvb/idvb.h>
#include <lib/dvb/dvb.h>
#include <lib/dvb/db.h>
-#include <lib/dvb/isection.h>
-#include <lib/dvb/esection.h>
-#include <lib/dvb_si/pmt.h>
-#include <lib/dvb/scan.h>
-#include <unistd.h>
+#include <lib/dvb/dvbtime.h>
+#include <lib/dvb/epgcache.h>
class eMain: public eApplication, public Object
{
eInit init;
- ePtr<eDVBScan> m_scan;
-
ePtr<eDVBResourceManager> m_mgr;
- ePtr<iDVBChannel> m_channel;
ePtr<eDVBDB> m_dvbdb;
+ ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
+ ePtr<eComponentScan> m_scan;
+ ePtr<eEPGCache> m_epgcache;
- void scanEvent(int evt)
- {
- eDebug("scan event %d!", evt);
- if (evt == eDVBScan::evtFinish)
- {
- m_scan->insertInto(m_dvbdb);
- quit(0);
- }
- }
- ePtr<eConnection> m_scan_event_connection;
public:
eMain()
{
init.setRunlevel(eAutoInitNumbers::main);
-#if 0
+ /* TODO: put into init */
m_dvbdb = new eDVBDB();
m_mgr = new eDVBResourceManager();
-
- eDVBFrontendParametersSatellite fesat;
+ m_locale_time_handler = new eDVBLocalTimeHandler();
+ m_epgcache = new eEPGCache();
+ m_mgr->setChannelList(m_dvbdb);
- fesat.frequency = 11817000; // 12070000;
- fesat.symbol_rate = 27500000;
- fesat.polarisation = eDVBFrontendParametersSatellite::Polarisation::Vertical;
- fesat.fec = eDVBFrontendParametersSatellite::FEC::f3_4;
- fesat.inversion = eDVBFrontendParametersSatellite::Inversion::Off;
- fesat.orbital_position = 192;
-
- eDVBFrontendParameters *fe = new eDVBFrontendParameters();
-
- fe->setDVBS(fesat);
-
- if (m_mgr->allocateRawChannel(m_channel))
- eDebug("shit it failed!");
+// m_scan = new eComponentScan();
+// m_scan->start();
- eDebug("starting scan...");
-
- std::list<ePtr<iDVBFrontendParameters> > list;
-
- list.push_back(fe);
-
- m_scan = new eDVBScan(m_channel);
- m_scan->start(list);
- m_scan->connectEvent(slot(*this, &eMain::scanEvent), m_scan_event_connection);
-#endif
}
~eMain()
eMain main;
#if 1
+#ifdef SDLDC
+ ePtr<gSDLDC> my_dc;
+ gSDLDC::getInstance(my_dc);
+#else
ePtr<gFBDC> my_dc;
gFBDC::getInstance(my_dc);
+#endif
- gPainter p(my_dc);
-
- gRGB pal[256];
- pal[0] = 0;
- pal[1] = 0xff00ff;
- pal[2] = 0xffFFff;
- pal[3] = 0x00ff00;
-
- for (int a=0; a<0x10; ++a)
- pal[a | 0x10] = 0x111111 * a;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x20] = (0x111100 * a) | 0xFF;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x30] = (0x110011 * a) | 0xFF00;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x40] = (0x001111 * a) | 0xFF0000;
- p.setPalette(pal, 0, 256);
-
- fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
+ fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
eWidgetDesktop dsk(eSize(720, 576));
wdsk = &dsk;
- dsk.setBackgroundColor(gColor(0));
+
+
dsk.setDC(my_dc);
+
+ ePtr<gPixmap> m_pm;
+ loadPNG(m_pm, "data/pal.png");
+ if (!m_pm)
+ {
+ eFatal("hi ghost, please copy pal.png into your ./data, thanks!");
+ } else
+ dsk.setPalette(*m_pm);
+
+ dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
#endif
/* redrawing is done in an idle-timer, so we have to set the context */
eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
printf("executing main\n");
+
python.execute("mytest", "__main__");
// eApp->exec();
{
eApp->exec();
}
+
+void quitMainloop()
+{
+ eApp->quit(0);
+}