diff --git a/configure.ac b/configure.ac index 7bd90f0f8..c404dde1d 100644 --- a/configure.ac +++ b/configure.ac @@ -177,6 +177,11 @@ if test "$BOXTYPE" = "coolstream" || AC_DEFINE(SCREENSHOT, 1, [Define to 1 if the platform supports screenshots]) fi +AC_ARG_ENABLE(lcd4linux, + AS_HELP_STRING([--enable-lcd4linux], [enable LCD4Linux support @<:@default=no@:>@]), + AC_DEFINE(ENABLE_LCD4LINUX, 1, [enable LCD4Linux support])) +AM_CONDITIONAL(ENABLE_LCD4LINUX, test "$enable_lcd4linux" = "yes") + AC_ARG_ENABLE(graphlcd, AS_HELP_STRING([--enable-graphlcd], [enable GraphLCD support @<:@default=no@:>@]), AC_DEFINE(ENABLE_GRAPHLCD, 1, [enable GraphLCD support])) diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index 73af1543a..ab90c6a16 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -37,7 +37,6 @@ libneutrino_driver_a_SOURCES = \ file.cpp \ fontrenderer.cpp \ genpsi.cpp \ - lcd4l.cpp \ moviecut.cpp \ movieinfo.cpp \ neutrinofonts.cpp \ @@ -52,6 +51,11 @@ libneutrino_driver_a_SOURCES = \ streamts.cpp \ volume.cpp +if ENABLE_LCD4LINUX +libneutrino_driver_a_SOURCES += \ + lcd4l.cpp +endif + if BOXTYPE_CST libneutrino_driver_a_SOURCES += \ fb_accel_cs_hdx.cpp diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 549efa716..a372a41d2 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -563,7 +563,11 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C // add neccessary paths to v_path v_path.clear(); if (lcd4l_mode) + { +#ifdef ENABLE_LCD4LINUX v_path.push_back(g_settings.lcd4l_logodir); +#endif + } v_path.push_back(g_settings.logo_hdd_dir); if (g_settings.logo_hdd_dir != LOGODIR_VAR) v_path.push_back(LOGODIR_VAR); @@ -650,7 +654,11 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C { // process g_settings.lcd4l_logodir if (lcd4l_mode) + { +#ifdef ENABLE_LCD4LINUX v_path.push_back(g_settings.lcd4l_logodir + "/" + v_file[f] + fileType[i]); +#endif + } // process g_settings.logo_hdd_dir v_path.push_back(g_settings.logo_hdd_dir + "/" + v_file[f] + fileType[i]); // process LOGODIR_VAR diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index c7034bff0..ba40c50a9 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -67,7 +67,6 @@ libneutrino_gui_a_SOURCES = \ infoviewer.cpp \ infoviewer_bb.cpp \ keybind_setup.cpp \ - lcd4l_setup.cpp \ mediaplayer.cpp \ mediaplayer_setup.cpp \ miscsettings_menu.cpp \ @@ -118,6 +117,11 @@ libneutrino_gui_a_SOURCES = \ xmltv_setup.cpp \ zapit_setup.cpp +if ENABLE_LCD4LINUX +libneutrino_gui_a_SOURCES += \ + lcd4l_setup.cpp +endif + if ENABLE_GRAPHLCD libneutrino_gui_a_SOURCES += \ glcdsetup.cpp \ diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index ae9be9db7..039cf1c71 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -114,7 +114,7 @@ class CAudioPlayerGui : public CMenuTarget bool m_streamripper_available; bool m_streamripper_active; -#if ENABLE_GRAPHLCD +#ifdef ENABLE_GRAPHLCD struct tm *tm_struct; int glcd_position; std::string glcd_channel; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index a760d7e16..45da27d31 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -56,8 +56,10 @@ #include #include +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" extern CLCD4l *LCD4l; +#endif extern CBouquetManager *g_bouquetManager; @@ -595,7 +597,9 @@ int CBouquetList::show(bool bShowChannelList) #ifdef ENABLE_GRAPHLCD cGLCD::unlockChannel(); #endif +#ifdef ENABLE_LCD4LINUX LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif fader.StopFade(); @@ -658,8 +662,10 @@ void CBouquetList::paintItem(int pos) if(g_settings.glcd_enable) cGLCD::lockChannel(g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), lname, 0); #endif +#ifdef ENABLE_LCD4LINUX if(g_settings.lcd4l_support) LCD4l->CreateFile("/tmp/lcd/menu", lname, g_settings.lcd4l_convert); +#endif } else { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index cadd8e722..76b20b36a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -86,8 +86,10 @@ #include +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" extern CLCD4l *LCD4l; +#endif extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ @@ -971,7 +973,9 @@ int CChannelList::show() #ifdef ENABLE_GRAPHLCD cGLCD::unlockChannel(); #endif +#ifdef ENABLE_LCD4LINUX LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif if(!dont_hide){ if (new_zap_mode && (g_settings.channellist_new_zap_mode != new_zap_mode)) @@ -2256,8 +2260,10 @@ void CChannelList::updateVfd() if(g_settings.glcd_enable) cGLCD::lockChannel(g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), chan->getName().c_str(), 0); #endif +#ifdef ENABLE_LCD4LINUX if (g_settings.lcd4l_support) LCD4l->CreateFile("/tmp/lcd/menu", chan->getName().c_str(), g_settings.lcd4l_convert); +#endif } void CChannelList::paint() diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 0aacda456..1108f957a 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -71,8 +71,10 @@ #include +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" extern CLCD4l *LCD4l; +#endif extern CRemoteControl * g_RemoteControl; @@ -1649,10 +1651,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_settings.show_ecm = 1; } +#ifdef ENABLE_LCD4LINUX else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CHANNELLIST_SHOW_EVENTLOGO)) { LCD4l->ResetParseID(); } +#endif else if ((ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOCLOCK)) || (ARE_LOCALES_EQUAL(OptionName, LOCALE_CLOCK_SIZE_HEIGHT)) || (ARE_LOCALES_EQUAL(OptionName, LOCALE_CLOCK_SECONDS))) { diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index df952a8c5..ab4fdb7cd 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -76,7 +76,9 @@ #include #include #include +#ifdef ENABLE_LCD4LINUX #include +#endif #include #include #include //NI @@ -533,6 +535,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item->setHint(NEUTRINO_ICON_HINT_NETWORK, LOCALE_MENU_HINT_NETWORK); break; } +#ifdef ENABLE_LCD4LINUX case SNeutrinoSettings::ITEM_LCD4LINUX: { keyhelper.get(&key,&icon); @@ -540,6 +543,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SUPPORT); break; } +#endif case SNeutrinoSettings::ITEM_SWUPDATE: { keyhelper.get(&key,&icon); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index abbe32baf..f2ca42269 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -47,8 +47,10 @@ #include +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" extern CLCD4l *LCD4l; +#endif /* the following generic menu items are integrated into multiple menus at the same time */ CMenuSeparator CGenericMenuSeparator(0, NONEXISTANT_LOCALE, true); @@ -251,8 +253,10 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text if (g_settings.glcd_enable) cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), lcd_text, 0); #endif +#ifdef ENABLE_LCD4LINUX if (g_settings.lcd4l_support) LCD4l->CreateFile("/tmp/lcd/menu", lcd_text, g_settings.lcd4l_convert); +#endif } //left text @@ -1025,7 +1029,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) #ifdef ENABLE_GRAPHLCD cGLCD::unlockChannel(); #endif +#ifdef ENABLE_LCD4LINUX LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif //exec this item... CMenuItem* item = items[selected]; @@ -1044,8 +1050,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (g_settings.glcd_enable) cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), item->lcd_text, 0); #endif +#ifdef ENABLE_LCD4LINUX if (g_settings.lcd4l_support) LCD4l->CreateFile("/tmp/lcd/menu", item->lcd_text, g_settings.lcd4l_convert); +#endif switch ( rv ) { case menu_return::RETURN_EXIT_ALL: @@ -1134,7 +1142,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) #ifdef ENABLE_GRAPHLCD cGLCD::unlockChannel(); #endif +#ifdef ENABLE_LCD4LINUX LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif for (unsigned int count = 0; count < items.size(); count++) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 260f8d794..b61e3d2ff 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -167,10 +167,12 @@ CTimeOSD *FileTimeOSD; //NI InfoIcons #include "gui/infoicons.h" -CInfoIcons *InfoIcons; +CInfoIcons *InfoIcons; +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" -CLCD4l *LCD4l; +CLCD4l *LCD4l; +#endif int allow_flash = 1; Zapit_config zapitCfg; @@ -199,7 +201,9 @@ extern cAudio * audioDecoder; cPowerManager *powerManager; cCpuFreqManager * cpuFreq; +#ifdef ENABLE_LCD4LINUX void stop_lcd4l_support(void); +#endif void stop_daemons(bool stopall = true, bool for_flash = false); void stop_video(void); @@ -370,8 +374,7 @@ int CNeutrinoApp::loadSetup(const char * fname) CGLCDThemes::getInstance()->getTheme(configfile); #endif - //NI - g_settings.inetradio_autostart = configfile.getInt32("inetradio_autostart" , 0); +#ifdef ENABLE_LCD4LINUX g_settings.lcd4l_support = configfile.getInt32("lcd4l_support" , 0); g_settings.lcd4l_logodir = configfile.getString("lcd4l_logodir", "/media/sda1/logos"); g_settings.lcd4l_display_type = configfile.getInt32("lcd4l_display_type", 0); @@ -380,6 +383,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.lcd4l_brightness = configfile.getInt32("lcd4l_brightness", 7); g_settings.lcd4l_brightness_standby = configfile.getInt32("lcd4l_brightness_standby", 3); g_settings.lcd4l_convert = configfile.getInt32("lcd4l_convert", 1); +#endif + + g_settings.inetradio_autostart = configfile.getInt32("inetradio_autostart" , 0); g_settings.show_menu_hints_line = configfile.getBool("show_menu_hints_line", false); g_settings.mode_icons = configfile.getInt32( "mode_icons", 0); g_settings.mode_icons_background = configfile.getInt32( "mode_icons_background", 0); @@ -1387,9 +1393,11 @@ void CNeutrinoApp::upgradeSetup(const char * fname) } if (g_settings.version_pseudo < "20190106000000") { +#ifdef ENABLE_LCD4LINUX // move lcd4linux user skin from value 4 to value 100 if (g_settings.lcd4l_skin == 4) g_settings.lcd4l_skin = 100; +#endif } if (g_settings.version_pseudo < "20190115220100") { @@ -1445,8 +1453,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString( "glcd_theme_name", g_settings.glcd_theme_name ); #endif - //NI - configfile.setInt32("inetradio_autostart" , g_settings.inetradio_autostart); +#ifdef ENABLE_LCD4LINUX configfile.setInt32("lcd4l_support" , g_settings.lcd4l_support); configfile.setString("lcd4l_logodir" , g_settings.lcd4l_logodir); configfile.setInt32("lcd4l_display_type" , g_settings.lcd4l_display_type); @@ -1455,6 +1462,9 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("lcd4l_brightness", g_settings.lcd4l_brightness); configfile.setInt32("lcd4l_brightness_standby", g_settings.lcd4l_brightness_standby); configfile.setInt32("lcd4l_convert" , g_settings.lcd4l_convert); +#endif + + configfile.setInt32("inetradio_autostart" , g_settings.inetradio_autostart); configfile.setBool("show_menu_hints_line" , g_settings.show_menu_hints_line); configfile.setInt32("mode_icons", g_settings.mode_icons ); configfile.setInt32("mode_icons_background", g_settings.mode_icons_background); @@ -3032,9 +3042,11 @@ TIMER_START(); #endif SHTDCNT::getInstance()->init(); +#ifdef ENABLE_LCD4LINUX LCD4l = new CLCD4l(); if(g_settings.lcd4l_support) LCD4l->StartLCD4l(); +#endif CZapit::getInstance()->SetScanSDT(g_settings.enable_sdt); @@ -4490,7 +4502,9 @@ void CNeutrinoApp::ExitRun(int exit_code) printf("[neutrino] %s(int %d)\n", __func__, exit_code); printf("[neutrino] hw_caps->can_shutdown: %d\n", g_info.hw_caps->can_shutdown); +#ifdef ENABLE_LCD4LINUX stop_lcd4l_support(); +#endif //NI InfoIcons if(g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_POPUP) @@ -5209,7 +5223,9 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) CHint * hint = new CHint(LOCALE_SERVICEMENU_RESTART_HINT); hint->paint(); +#ifdef ENABLE_LCD4LINUX stop_lcd4l_support(); +#endif saveSetup(NEUTRINO_SETTINGS_FILE); @@ -5289,6 +5305,7 @@ void CNeutrinoApp::stopDaemonsForFlash() /************************************************************************************** * Main programm - no function here * **************************************************************************************/ +#ifdef ENABLE_LCD4LINUX void stop_lcd4l_support() { if(LCD4l) { @@ -5299,6 +5316,7 @@ void stop_lcd4l_support() } LCD4l = NULL; } +#endif void stop_daemons(bool stopall, bool for_flash) { @@ -5407,7 +5425,9 @@ void sighandler (int signum) switch (signum) { case SIGTERM: case SIGINT: +#ifdef ENABLE_LCD4LINUX stop_lcd4l_support(); +#endif delete cHddStat::getInstance(); delete CRecordManager::getInstance(); //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index 2f9f2c6f8..79427fe85 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -44,8 +44,10 @@ #include #include +#ifdef ENABLE_LCD4LINUX #include "driver/lcd4l.h" extern CLCD4l *LCD4l; +#endif CFlashTool::CFlashTool() { @@ -349,8 +351,10 @@ bool CFlashTool::getInfo() //NI void CFlashTool::stopDaemons() { +#ifdef ENABLE_LCD4LINUX if (g_settings.lcd4l_support) LCD4l->StopLCD4l(); +#endif CNeutrinoApp::getInstance()->stopDaemonsForFlash(); } diff --git a/src/system/settings.h b/src/system/settings.h index aad1c4e66..e87a006c2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -937,6 +937,7 @@ struct SNeutrinoSettings int glcd_selected_config; #endif +#ifdef ENABLE_LCD4LINUX // lcd4linux int lcd4l_support; std::string lcd4l_logodir; @@ -946,6 +947,7 @@ struct SNeutrinoSettings int lcd4l_skin; int lcd4l_skin_radio; int lcd4l_convert; +#endif // lcdd enum LCD_SETTINGS {