diff --git a/autogen.sh b/autogen.sh index 8d063bf69..29edb6cb6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -13,5 +13,3 @@ libtoolize --force autoconf --force autoheader --force automake --add-missing --force-missing --foreign - -autoreconf -fi diff --git a/src/timerd/doku.html b/doc/timerd.html similarity index 100% rename from src/timerd/doku.html rename to doc/timerd.html diff --git a/src/Makefile.am b/src/Makefile.am index fd0998ddc..bb35cf78a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -81,7 +81,7 @@ neutrino_LDADD = \ gui/widget/libneutrino_gui_widget2.a \ driver/pictureviewer/libneutrino_pictureviewer.a \ $(MTDUTILSLIBS) \ - gui/movieinfo.o \ + driver/movieinfo.o \ gui/moviebrowser/mb.o \ gui/libneutrino_gui2.a \ gui/components/libneutrino_gui_components.a \ diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index d448fe801..adbef6c4b 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -33,6 +33,7 @@ libneutrino_driver_a_SOURCES = \ fontrenderer.cpp \ genpsi.cpp \ moviecut.cpp \ + movieinfo.cpp \ neutrinofonts.cpp \ radiotext.cpp \ radiotools.cpp \ diff --git a/src/driver/moviecut.h b/src/driver/moviecut.h index 4202238af..d4ea6810f 100644 --- a/src/driver/moviecut.h +++ b/src/driver/moviecut.h @@ -20,7 +20,7 @@ #ifndef __MOVIE_CUT__ #define __MOVIE_CUT__ -#include +#include #include class CFrameBuffer; diff --git a/src/gui/movieinfo.cpp b/src/driver/movieinfo.cpp similarity index 99% rename from src/gui/movieinfo.cpp rename to src/driver/movieinfo.cpp index 26f910e45..c90423b4e 100644 --- a/src/gui/movieinfo.cpp +++ b/src/driver/movieinfo.cpp @@ -34,8 +34,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/src/gui/movieinfo.h b/src/driver/movieinfo.h similarity index 100% rename from src/gui/movieinfo.h rename to src/driver/movieinfo.h diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 3f35a75ca..16fa1de89 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -272,10 +272,12 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) if (text.empty()) tmpText = "x"; _width = dynFont->getRenderWidth(tmpText); if ((_height > dy) || (_width > dx)) { - if (dynFlag) + if (dynFlag){ dynSize--; - else - printf("##### [%s] Specified size (dx=%d, dy=%d) too small, use minimal font size.\n", __FUNCTION__, dx, dy); + }else{ + if (debug) + printf("##### [%s] Specified size (dx=%d, dy=%d) too small, use minimal font size.\n", __FUNCTION__, dx, dy); + } break; } else if ((_height < dy) || (_width < dx)) { diff --git a/src/driver/record.h b/src/driver/record.h index e4481205a..e43a2b89e 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -30,7 +30,7 @@ #include #include -#include +#include #if HAVE_COOL_HARDWARE #include diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 587672fa5..00fd713b2 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -72,7 +72,6 @@ libneutrino_gui_a_SOURCES = \ mediaplayer.cpp \ mediaplayer_setup.cpp \ miscsettings_menu.cpp \ - movieinfo.cpp \ movieplayer.cpp \ network_service.cpp \ network_setup.cpp \ diff --git a/src/gui/epgview.h b/src/gui/epgview.h index f8473714d..f306cc33a 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -37,7 +37,7 @@ #include #include //NI -#include +#include #include "widget/menue.h" #include diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index 7f6c59bda..6b3b9a840 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -39,8 +39,6 @@ #include -#include - #include #include #include @@ -58,8 +56,6 @@ #include -extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ - #include extern CPictureViewer * g_PicViewer; diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 38b1d07bf..341918eb5 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 6dde745a2..8ed81ff41 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 589f49fe7..5eef2d02e 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -197,6 +197,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) val += 2; else val = 100; + (*value[selected]) = (uint8_t)val; paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true); setColor(); @@ -211,6 +212,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) val -= 2; else val = 0; + (*value[selected]) = (uint8_t)val; paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true); setColor(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9cfe0067b..64a68532a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -515,12 +515,14 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_wakeup_msg = configfile.getInt32( "hdd_wakeup_msg", 1); //NI g_settings.hdd_allow_set_recdir = configfile.getInt32( "hdd_allow_set_recdir", 1); //NI - g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); + g_settings.shutdown_real = false; + if (g_info.hw_caps->can_shutdown) + g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (can_deepstandby || cs_get_revision() == 1) + if (g_info.hw_caps->can_shutdown || cs_get_revision() == 1) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 000); //NI g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2564,7 +2566,7 @@ TIMER_STOP("################################## after all ####################### } RealRun(); - ExitRun(true, can_deepstandby); + ExitRun(g_info.hw_caps->can_shutdown); return 0; } @@ -3693,7 +3695,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } } - if (g_settings.shutdown_real && can_deepstandby) + if (g_settings.shutdown_real) g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); else g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0); @@ -3738,7 +3740,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if( msg == NeutrinoMessages::SHUTDOWN ) { if(!skipShutdownTimer) { - ExitRun(true, can_deepstandby); + ExitRun(g_info.hw_caps->can_shutdown); } else { skipShutdownTimer=false; @@ -3748,7 +3750,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if( msg == NeutrinoMessages::REBOOT ) { FILE *f = fopen("/tmp/.reboot", "w"); fclose(f); - ExitRun(true); + ExitRun(); } else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { if (mode != mode_scart && mode != mode_standby) { @@ -3911,141 +3913,150 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) extern time_t timer_minutes;//timermanager.cpp extern bool timer_is_rec;//timermanager.cpp -void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) +void CNeutrinoApp::ExitRun(int can_shutdown) { - printf("[neutrino] %s retcode: %d can_deep: %d\n", __func__, retcode, can_deepstandby); - bool do_shutdown = true; + printf("[neutrino] %s can_shutdown: %d\n", __func__, can_shutdown); + bool do_shutdown = true; CRecordManager::getInstance()->StopAutoRecord(); - if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive()) { + if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive()) + { do_shutdown = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, DEFAULT_TIMEOUT, true) == CMsgBox::mbrYes); } + if (!do_shutdown) + return; - if(do_shutdown) { - stop_lcd4l_support(); //NI lcd4l-support + stop_lcd4l_support(); //NI lcd4l-support - if(SDTreloadChannels){ - SDT_ReloadChannels(); - //SDTreloadChannels = false; - } + if(SDTreloadChannels) + SDT_ReloadChannels(); + dprintf(DEBUG_INFO, "exit\n"); + StopSubtitles(); + stopPlayBack(); - dprintf(DEBUG_INFO, "exit\n"); - StopSubtitles(); - stopPlayBack(); + frameBuffer->paintBackground(); + frameBuffer->showFrame("shutdown.jpg"); - frameBuffer->paintBackground(); - frameBuffer->showFrame("shutdown.jpg"); + delete cHddStat::getInstance(); + delete CRecordManager::getInstance(); - delete cHddStat::getInstance(); - delete CRecordManager::getInstance(); + CEpgScan::getInstance()->Stop(); + if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) + { + g_Sectionsd->setPauseScanning(true); + saveEpg(true);// true CVFD::MODE_SHUTDOWN + } - CEpgScan::getInstance()->Stop(); - if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { - g_Sectionsd->setPauseScanning(true); - saveEpg(true);// true CVFD::MODE_SHUTDOWN - } + /* on shutdown force load new fst */ + if (can_shutdown) + CheckFastScan(true, false); - /* on shutdown force load new fst */ - if (retcode) - CheckFastScan(true, false); + CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); - CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); - - stop_daemons(true /*retcode*/);//need here for timer_is_rec before saveSetup - g_settings.shutdown_timer_record_type = timer_is_rec; - saveSetup(NEUTRINO_SETTINGS_FILE); + stop_daemons(true /*can_shoutdown*/); //need here for timer_is_rec before saveSetup + g_settings.shutdown_timer_record_type = timer_is_rec; + saveSetup(NEUTRINO_SETTINGS_FILE); #if 0 - if(retcode) { + if (can_shutdown) + { #endif - puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); - if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) - perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); + puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); + if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) + perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); - //NI InfoIcons - if(g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_POPUP) - InfoIcons->saveIconstate(); + //NI InfoIcons + if(g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_POPUP) + InfoIcons->saveIconstate(); - printf("entering off state\n"); - printf("timer_minutes: %ld\n", timer_minutes); - mode = mode_off; - //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); + printf("entering off state\n"); + printf("timer_minutes: %ld\n", timer_minutes); + mode = mode_off; + //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); #if 0 + fp_standby_data_t standby; + time_t mtime = time(NULL); + struct tm *tmtime = localtime(&mtime); + time_t fp_timer = 0; + + if (timer_minutes) + { + fp_timer = timer_minutes - mtime/60; + if (fp_timer < 1) + fp_timer = 1; + } + printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout); + int leds = 0x40; + switch (g_settings.led_deep_mode) + { + case 0: + leds = 0x0; //off leds + break; + case 1: + leds = 0x60; //on led1 & 2 + break; + case 2: + leds = 0x20; //led1 on , 2 off + break; + case 3: + leds = 0x40; //led2 off, 2 on + break; + default: + break; + } + if (leds && g_settings.led_blink && fp_timer) + leds |= 0x80; + + standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; + standby.flags = leds; + standby.current_hour = tmtime->tm_hour; + standby.current_minute = tmtime->tm_min; + standby.timer_minutes_hi = fp_timer >> 8;; + standby.timer_minutes_lo = fp_timer & 0xFF; + + my_system("/etc/init.d/rcK"); + sync(); + CFSMounter::umount(); // unreachable NFS server + //NI my_system(2,"/bin/umount", "-a"); + //NI sleep(1); + + //NI + if (cs_get_revision() < 8) + CVFD::getInstance()->ShowText((char *) "power-off!"); + + stop_video(); + + int fd = open("/dev/display", O_RDONLY); + if (fd < 0) + { + perror("/dev/display"); + reboot(LINUX_REBOOT_CMD_RESTART); + } + else + { + if (ioctl(fd, IOC_FP_STANDBY, (fp_standby_data_t *) &standby)) { - fp_standby_data_t standby; - time_t mtime = time(NULL); - struct tm *tmtime = localtime(&mtime); - time_t fp_timer = 0; - - if(timer_minutes) { - fp_timer = timer_minutes - mtime/60; - if(fp_timer < 1) - fp_timer = 1; - } - printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout); - int leds = 0x40; - switch(g_settings.led_deep_mode){ - case 0: - leds = 0x0;//off leds - break; - case 1: - leds = 0x60;//on led1 & 2 - break; - case 2: - leds = 0x20;//led1 on , 2 off - break; - case 3: - leds = 0x40;//led2 off, 2 on - break; - default: - break; - } - if(leds && g_settings.led_blink && fp_timer) - leds |= 0x80; - - standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; - standby.flags = leds; - standby.current_hour = tmtime->tm_hour; - standby.current_minute = tmtime->tm_min; - standby.timer_minutes_hi = fp_timer >> 8;; - standby.timer_minutes_lo = fp_timer & 0xFF; - - my_system("/etc/init.d/rcK"); - sync(); - CFSMounter::umount(); // unreachable NFS server - //NI my_system(2,"/bin/umount", "-a"); - //NI sleep(1); - - //NI - if (cs_get_revision() < 8) - CVFD::getInstance()->ShowText((char *) "power-off!"); - - stop_video(); - - int fd = open("/dev/display", O_RDONLY); - if (fd < 0) { - perror("/dev/display"); - reboot(LINUX_REBOOT_CMD_RESTART); - } else { - - if (ioctl(fd, IOC_FP_STANDBY, (fp_standby_data_t *) &standby)) { - perror("IOC_FP_STANDBY"); - reboot(LINUX_REBOOT_CMD_RESTART); - } else { - while(true) sleep(1); - } - } + perror("IOC_FP_STANDBY"); + reboot(LINUX_REBOOT_CMD_RESTART); } - } else { + else + { + while (true) + sleep(1); + } + } + } + else + { #endif int leds = 0; int bright = 0; #if HAVE_COOL_HARDWARE - if (retcode) { + if (can_shutdown) { leds = 0x40; switch (g_settings.led_deep_mode){ case 0: @@ -4086,7 +4097,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) delete g_RCInput; g_RCInput = NULL; - //NI my_system("/etc/init.d/rcK"); //fan speed if (g_info.hw_caps->has_fan) { CFanControlNotifier::setSpeed(0); @@ -4096,22 +4106,17 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) delete SHTDCNT::getInstance(); stop_video(); - printf("[neutrino] This is the end. exiting with code %d\n", retcode); + printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown); Cleanup(); -#if HAVE_COOL_HARDWARE - FILE *f = fopen("/tmp/.shutdown", "w"); - fclose(f); -#endif #ifdef __sh__ /* the sh4 gcc seems to dislike someting about openthreads... */ - _exit(retcode); + _exit(can_shutdown); #else - exit(retcode); + exit(can_shutdown); #endif #if 0 - } -#endif } +#endif } void CNeutrinoApp::saveEpg(bool cvfd_mode) @@ -4507,13 +4512,13 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack); } else if(actionKey=="shutdown") { - ExitRun(true, 1); + ExitRun(1); } else if(actionKey=="reboot") { FILE *f = fopen("/tmp/.reboot", "w"); fclose(f); - ExitRun(true); + ExitRun(); unlink("/tmp/.reboot"); returnval = menu_return::RETURN_NONE; } diff --git a/src/neutrino.h b/src/neutrino.h index ece4741dd..504f8d8fa 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -122,7 +122,7 @@ private: void standbyMode( bool bOnOff, bool fromDeepStandby = false ); void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name); - //NI void ExitRun(const bool write_si = true, int retcode = 0); + //NI void ExitRun(int can_shutdown = 0); void RealRun(); void InitZapper(); void InitTimerdClient(); @@ -163,7 +163,7 @@ public: CUserMenu usermenu; - void ExitRun(const bool write_si = true, int retcode = 0); //NI cross-team settings + void ExitRun(int can_shutdown = 0); //NI cross-team settings void saveSetup(const char * fname); int loadSetup(const char * fname); void setScreenSettings(); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index f04e1a8e5..7dd9d0c81 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -131,8 +131,6 @@ void CNeutrinoApp::InitMenuMain() { dprintf(DEBUG_DEBUG, "init mainmenue\n"); - //NI unsigned int system_rev = cs_get_revision(); - // Dynamic renumbering personalize.setShortcut(); @@ -267,11 +265,11 @@ void CNeutrinoApp::InitMenuMain() personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_STANDBY]); //shutdown - if (g_info.hw_caps->can_shutdown) { + //NI if (g_info.hw_caps->can_shutdown) { mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby); mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]); - } + //NI } //NI blank screen mf = new CMenuForwarder(LOCALE_BLANK_SCREEN, true, NULL, this, "blank_screen", CRCInput::RC_pause); @@ -318,11 +316,11 @@ void CNeutrinoApp::InitMenuMain() personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]); //shutdown - if (g_info.hw_caps->can_shutdown) { + //NI if (g_info.hw_caps->can_shutdown) { mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_blue); mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN); personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]); - } + //NI } //NI blank screen mf = new CMenuForwarder(LOCALE_BLANK_SCREEN, true, NULL, this, "blank_screen", CRCInput::RC_pause); diff --git a/src/system/ytcache.h b/src/system/ytcache.h index 1e3fcba3a..45873d38e 100644 --- a/src/system/ytcache.h +++ b/src/system/ytcache.h @@ -30,7 +30,7 @@ #include #include -#include +#include class cYTCache {