X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=main%2Fenigma.cpp;h=b9cdf3410761d3b5779adaf2f9a567be21cc3310;hp=1cdd867ba9e2b9a20250e36b762168300862f0f0;hb=74f5884fdc5a23465cf40c27b5c069ff7d882746;hpb=7211bd40026fb8b00be038a59abcbfa29569b3ed diff --git a/main/enigma.cpp b/main/enigma.cpp index 1cdd867..b9cdf34 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -122,6 +122,48 @@ public: int exit_code; +void quitMainloop(int exitCode) +{ + FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w"); + if (f) + { + fprintf(f, "%d", 0); + fclose(f); + } + else + { + int fd = open("/dev/dbox/fp0", O_WRONLY); + if (fd >= 0) + { + if (ioctl(fd, 10 /*FP_CLEAR_WAKEUP_TIMER*/) < 0) + eDebug("FP_CLEAR_WAKEUP_TIMER failed (%m)"); + close(fd); + } + else + eDebug("open /dev/dbox/fp0 for wakeup timer clear failed!(%m)"); + } + exit_code = exitCode; + eApp->quit(0); +} + +static void sigterm_handler(int num) +{ + quitMainloop(128 + num); +} + +void setSigTermHandler() +{ + struct sigaction act; + + act.sa_handler = sigterm_handler; + act.sa_flags = SA_RESTART; + + if (sigemptyset(&act.sa_mask) == -1) + perror("sigemptyset"); + if (sigaction(SIGTERM, &act, 0) == -1) + perror("SIGTERM"); +} + int main(int argc, char **argv) { #ifdef MEMLEAK_CHECK @@ -232,6 +274,8 @@ int main(int argc, char **argv) bsodCatchSignals(); + setSigTermHandler(); + setIoPrio(IOPRIO_CLASS_BE, 3); // python.execute("mytest", "__main__"); @@ -251,8 +295,9 @@ int main(int argc, char **argv) { gPainter p(my_lcd_dc); - p.resetClip(eRect(0, 0, 132, 64)); + p.resetClip(eRect(ePoint(0, 0), my_lcd_dc->size())); p.clear(); + p.flush(); } return exit_code; @@ -268,47 +313,9 @@ eApplication *getApplication() return eApp; } -void quitMainloop(int exitCode) -{ - FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w"); - if (f) - { - fprintf(f, "%d", 0); - fclose(f); - } - else - { - int fd = open("/dev/dbox/fp0", O_WRONLY); - if (fd >= 0) - { - if (ioctl(fd, 10 /*FP_CLEAR_WAKEUP_TIMER*/) < 0) - eDebug("FP_CLEAR_WAKEUP_TIMER failed (%m)"); - close(fd); - } - else - eDebug("open /dev/dbox/fp0 for wakeup timer clear failed!(%m)"); - } - exit_code = exitCode; - eApp->quit(0); -} - -static void sigterm_handler(int num) -{ - quitMainloop(128 + num); -} - void runMainloop() { - struct sigaction act; - - act.sa_handler = sigterm_handler; - act.sa_flags = SA_RESTART; - - if (sigemptyset(&act.sa_mask) == -1) - perror("sigemptyset"); - if (sigaction(SIGTERM, &act, 0) == -1) - perror("SIGTERM"); - + setSigTermHandler(); eApp->runLoop(); } @@ -326,3 +333,26 @@ void dump_malloc_stats(void) struct mallinfo mi = mallinfo(); eDebug("MALLOC: %d total", mi.uordblks); } + +#ifdef USE_LIBVUGLES2 +#include + +void setAnimation_current(int a) +{ + gles_set_animation_func(a); +} + +void setAnimation_speed(int speed) +{ + gles_set_animation_speed(speed); +} + +void setAnimation_current_listbox(int a) +{ + gles_set_animation_listbox_func(a); +} +#else +void setAnimation_current(int a) {} +void setAnimation_speed(int speed) {} +void setAnimation_current_listbox(int a) {} +#endif