store lamedb ob enigma2 shutdown
[enigma2.git] / main / enigma.cpp
index 4144742..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>
@@ -15,6 +17,7 @@
 #include <lib/gdi/grc.h>
 #include <lib/gdi/gfbdc.h>
 #include <lib/gdi/glcddc.h>
+
 #ifdef WITH_SDL
 #error
 #include <lib/gdi/sdl.h>
@@ -112,7 +115,7 @@ class eMain: public eApplication, public Object
        ePtr<eDVBDB> m_dvbdb;
        ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
        ePtr<eComponentScan> m_scan;
-//     ePtr<eEPGCache> m_epgcache;
+       ePtr<eEPGCache> 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,14 @@ public:
        
        ~eMain()
        {
+               m_dvbdb->save();
                m_scan = 0;
        }
 };
 
 /************************************************/
 
+eLabel *lcd_label, *lcd_clock;
 
 int main(int argc, char **argv)
 {
@@ -205,10 +210,20 @@ 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, 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();
        
@@ -237,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);
+}