store lamedb ob enigma2 shutdown
[enigma2.git] / main / enigma.cpp
index f81a3c2..e669b19 100644 (file)
@@ -1,8 +1,10 @@
 #undef WITH_SDL
+
 #ifdef WITH_SDL
 #error
 #define SDLDC
 #endif
+
 #include <stdio.h>
 #include <libsig_comp.h>
 #include <lib/base/ebase.h>
@@ -14,6 +16,8 @@
 
 #include <lib/gdi/grc.h>
 #include <lib/gdi/gfbdc.h>
+#include <lib/gdi/glcddc.h>
+
 #ifdef WITH_SDL
 #error
 #include <lib/gdi/sdl.h>
@@ -69,7 +73,7 @@ void dumpRegion(const gRegion &region)
 
 }
 
-eWidgetDesktop *wdsk;
+eWidgetDesktop *wdsk, *lcddsk;
 
 // typedef struct _object PyObject;
 
@@ -132,12 +136,14 @@ public:
        
        ~eMain()
        {
+               m_dvbdb->save();
                m_scan = 0;
        }
 };
 
 /************************************************/
 
+eLabel *lcd_label, *lcd_clock;
 
 int main(int argc, char **argv)
 {
@@ -162,9 +168,13 @@ int main(int argc, char **argv)
        double_buffer = my_dc->haveDoubleBuffering();
 #endif
 
+       ePtr<gLCDDC> my_lcd_dc;
+       gLCDDC::getInstance(my_lcd_dc);
+
        fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
 
        eWidgetDesktop dsk(eSize(720, 576));
+       eWidgetDesktop dsk_lcd(eSize(132, 64));
        
        if (double_buffer)
        {
@@ -173,8 +183,10 @@ int main(int argc, char **argv)
        }
        
        wdsk = &dsk;
+       lcddsk = &dsk_lcd;
 
        dsk.setDC(my_dc);
+       dsk_lcd.setDC(my_lcd_dc);
 
        ePtr<gPixmap> m_pm;
        loadPNG(m_pm, "data/pal.png");
@@ -189,6 +201,31 @@ int main(int argc, char **argv)
 
                /* redrawing is done in an idle-timer, so we have to set the context */
        dsk.setRedrawTask(main);
+       dsk_lcd.setRedrawTask(main);
+
+       eWindow *lcd_win = new eWindow(&dsk_lcd);
+       
+       lcd_win->setFlag(eWindow::wfNoBorder);
+       
+       lcd_win->move(ePoint(0, 0));
+       lcd_win->resize(eSize(132, 64));
+       
+       lcd_label = new eLabel(lcd_win);
+       lcd_label->move(ePoint(0, 10));
+       lcd_label->resize(eSize(132, 36));
+       ePtr<gFont> font = new gFont("Arial", 16);
+       lcd_label->setFont(font);
+
+       lcd_clock = new eLabel(lcd_win);
+       lcd_clock->move(ePoint(50, 46));
+       lcd_clock->resize(eSize(132, 20));
+       //ePtr<gFont> clkfont = new gFont("Arial", 18);
+       lcd_clock->setFont(font);
+
+       //lcd_label->setText("bla bla bla, this lcd\nSUCKS!");
+       //lcd_clock->setText("88:88:88");
+
+       lcd_win->show();
        
        eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
        
@@ -215,3 +252,13 @@ void quitMainloop()
 {
        eApp->quit(0);
 }
+
+void setLCD(const char *string)
+{
+       lcd_label->setText(string);
+}
+
+void setLCDClock(const char *string)
+{
+       lcd_clock->setText(string);
+}