X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/b8e9b51fb1a75b1805cf3108ffdc22aff9f75cf2..5acb8fc9d204c63e0da84142c570c5ca41424cae:/main/enigma.cpp diff --git a/main/enigma.cpp b/main/enigma.cpp index 4144742c..b6c57304 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -1,8 +1,10 @@ #undef WITH_SDL + #ifdef WITH_SDL #error #define SDLDC #endif + #include #include #include @@ -15,6 +17,7 @@ #include #include #include + #ifdef WITH_SDL #error #include @@ -112,7 +115,7 @@ class eMain: public eApplication, public Object ePtr m_dvbdb; ePtr m_locale_time_handler; ePtr m_scan; -// ePtr m_epgcache; + ePtr m_epgcache; public: eMain() @@ -123,7 +126,7 @@ public: m_dvbdb = new eDVBDB(); m_mgr = new eDVBResourceManager(); m_locale_time_handler = new eDVBLocalTimeHandler(); -// m_epgcache = new eEPGCache(); + m_epgcache = new eEPGCache(); m_mgr->setChannelList(m_dvbdb); // m_scan = new eComponentScan(); @@ -133,12 +136,16 @@ public: ~eMain() { + m_dvbdb->save(); m_scan = 0; } }; /************************************************/ +eLabel *lcd_label, *lcd_clock; + +int exit_code; int main(int argc, char **argv) { @@ -146,6 +153,10 @@ int main(int argc, char **argv) atexit(object_dump); #endif + // set pythonpath if unset + setenv("PYTHONPATH", LIBDIR "/enigma2/python", 0); + printf("PYTHONPATH: %s\n", getenv("PYTHONPATH")); + ePython python; eMain main; @@ -166,16 +177,16 @@ int main(int argc, char **argv) ePtr my_lcd_dc; gLCDDC::getInstance(my_lcd_dc); - fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100); + fontRenderClass::getInstance()->AddFont(FONTDIR "/md_khmurabi_10.ttf", "Regular", 100); eWidgetDesktop dsk(eSize(720, 576)); eWidgetDesktop dsk_lcd(eSize(132, 64)); - if (double_buffer) +/* if (double_buffer) { eDebug(" - double buffering found, enable buffered graphics mode."); dsk.setCompositionMode(eWidgetDesktop::cmBuffered); - } + } */ wdsk = &dsk; lcddsk = &dsk_lcd; @@ -184,10 +195,10 @@ int main(int argc, char **argv) dsk_lcd.setDC(my_lcd_dc); ePtr m_pm; - loadPNG(m_pm, "data/pal.png"); + loadPNG(m_pm, DATADIR "/enigma2/pal.png"); if (!m_pm) { - eFatal("hi ghost, please copy pal.png into your ./data, thanks!"); + eFatal("pal.png not found!"); } else dsk.setPalette(*m_pm); @@ -205,10 +216,21 @@ int main(int argc, char **argv) lcd_win->move(ePoint(0, 0)); lcd_win->resize(eSize(132, 64)); - eLabel *lcd_label = new eLabel(lcd_win); - lcd_label->move(ePoint(0, 0)); - lcd_label->resize(eSize(132, 64)); - lcd_label->setText("bla bla bla, this lcd\nSUCKS!"); + lcd_label = new eLabel(lcd_win); + lcd_label->move(ePoint(0, 4)); + lcd_label->resize(eSize(132, 42)); + ePtr font = new gFont("Regular", 19); + //ePtr font = new gFont("Regular", 16); + lcd_label->setFont(font); + + lcd_clock = new eLabel(lcd_win); + lcd_clock->move(ePoint(50, 46)); + lcd_clock->resize(eSize(132, 18)); + ePtr clkfont = new gFont("Regular", 16); + lcd_clock->setFont(clkfont); + + //lcd_label->setText("bla bla bla, this lcd\nSUCKS!"); + //lcd_clock->setText("88:88:88"); lcd_win->show(); @@ -220,7 +242,7 @@ int main(int argc, char **argv) // eApp->exec(); - return 0; + return exit_code; } eWidgetDesktop *getDesktop() @@ -230,10 +252,20 @@ eWidgetDesktop *getDesktop() void runMainloop() { - eApp->exec(); + exit_code = eApp->exec(); +} + +void quitMainloop(int exitCode) +{ + eApp->quit(exitCode); +} + +void setLCD(const char *string) +{ + lcd_label->setText(string); } -void quitMainloop() +void setLCDClock(const char *string) { - eApp->quit(0); + lcd_clock->setText(string); }