diff --git a/.gitignore b/.gitignore index c2890967b..4f8e80caf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ Makefile autom4te.cache *.in aclocal.m4 +compile config.* configure depcomp diff --git a/.svnignore b/.svnignore deleted file mode 100644 index e44c6013e..000000000 --- a/.svnignore +++ /dev/null @@ -1,12 +0,0 @@ -autom4te.cache -*.in -aclocal.m4 -config.* -configure -depcomp -install-sh -*.pc -libtool -ltmain.sh -missing -stamp.h1 diff --git a/acinclude.m4 b/acinclude.m4 index beead1c54..22f4c8214 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -21,11 +21,6 @@ if test "$DEBUG" = "yes"; then AC_DEFINE(DEBUG,1,[Enable debug messages]) fi -AC_ARG_ENABLE(tmsdk, - AS_HELP_STRING(--enable-tmsdk, compile inside sdk), - ,[enable_tmsdk=no]) -AM_CONDITIONAL(ENABLE_TMSDK,test "$enable_tmsdk" = "yes") - AC_MSG_CHECKING(target) if test "$TARGET" = "native"; then diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bfcc447e1..255e0687d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2199,6 +2199,7 @@ satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommitted satsetup.uni_settings Unicable Einstellungen satsetup.unicable Unicable +satsetup.unicable2 Unicable 2 (Jess) satsetup.usals_repeat USALS wiederholen satsetup.use_bat Benutze BAT satsetup.use_fta_flag nur FTA Kanäle diff --git a/data/locale/english.locale b/data/locale/english.locale index 511f64b94..9c446632b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2199,6 +2199,7 @@ satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommited input satsetup.uni_settings Unicable Settings satsetup.unicable Unicable +satsetup.unicable2 Unicable 2 (Jess) satsetup.usals_repeat USALS command repeat satsetup.use_bat Use BAT satsetup.use_fta_flag just free Channels diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 3ae068e32..46da1a908 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -682,6 +682,15 @@ flashupdate.selectimage Dostupné verzie / súbory flashupdate.settings Aktualizácia nastavení flashupdate.titlereadflash Načítavanie pamäte FLASH flashupdate.titlewriteflash Zapisovanie pamäte FLASH +flashupdate.type_addon Doplnok +flashupdate.type_beta Beta +flashupdate.type_internal Interná +flashupdate.type_locale Jazyk +flashupdate.type_release Release +flashupdate.type_settings Nastavenia +flashupdate.type_text Text +flashupdate.type_unknown Neznáma +flashupdate.type_update Aktualizácia flashupdate.update_with_settings_del_skipped Zložka [%s] nebola vymazaná. Zadanie je preskočené. flashupdate.update_with_settings_error Chyba FLASH pamäte!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. \nnedostatok miesta pre dokončenie operácie.\n \nOperácia prerušená! flashupdate.update_with_settings_processed IMAGE sa spracováva... 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/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index d460837c3..82f3ab83c 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,12 +1,16 @@ -noinst_LIBRARIES = libhwcaps.a - AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing -if BOXMODEL_CS_HD2 -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd2/libcoolstream -else -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd1/libcoolstream -endif +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/zapit/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/libeventserver \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libhwcaps.a libhwcaps_a_SOURCES = \ hardware_caps.cpp diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 216a6dcae..b4d4c0a46 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -11,6 +11,8 @@ #include #include "hardware_caps.h" +#include + static int initialized = 0; static hw_caps_t caps; @@ -18,7 +20,8 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); - caps.has_fan = (rev < 8); + int chip = cs_get_chip_type(); + caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -33,16 +36,23 @@ hw_caps_t *get_hwcaps(void) { caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); - /* list of boxnames from neutrinoyparser.cpp */ - strcpy(caps.boxarch, "Nevis"); switch (rev) { case 6: case 7: // Black Stallion Edition strcpy(caps.boxname, "HD1"); + strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; case 8: - strcpy(caps.boxname, "Neo"); + if (CFEManager::getInstance()->getFrontendCount() < 2) + { + strcpy(caps.boxname, "Neo"); + } + else + { + strcpy(caps.boxname, "Neo Twin"); + } + strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; case 9: @@ -51,16 +61,33 @@ hw_caps_t *get_hwcaps(void) { break; case 10: strcpy(caps.boxname, "Zee"); + strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; case 11: - strcpy(caps.boxname, "Trinity"); - strcpy(caps.boxarch, "Shiner"); + if (chip == CS_CHIP_SHINER) + { + strcpy(caps.boxname, "Trinity"); + strcpy(caps.boxarch, "Shiner"); + } + else + { + strcpy(caps.boxname, "Trinity V2"); + strcpy(caps.boxarch, "Kronos"); + } break; case 12: strcpy(caps.boxname, "Zee2"); strcpy(caps.boxarch, "Kronos"); break; + case 13: + strcpy(caps.boxname, "Link"); + strcpy(caps.boxarch, "Kronos"); + break; + case 14: + strcpy(caps.boxname, "Trinity Duo"); + strcpy(caps.boxarch, "Kronos"); + break; default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); @@ -69,4 +96,3 @@ hw_caps_t *get_hwcaps(void) { initialized = 1; return ∩︀ } - diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index f778e149b..1051c99c0 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -17,6 +17,13 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); +#define CS_CHIP_APOLLO 0x8490 +#define CS_CHIP_SHINER 0x8470 +#define CS_CHIP_KRONOS_S 0x7540 +#define CS_CHIP_KRONOS_C 0x7550 +#define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ + enum CS_LOG_MODULE { CS_LOG_CI = 0, CS_LOG_HDMI_CEC, @@ -71,6 +78,29 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); // Serial nr and revision accessors unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); +/* Dummy function for compatibility with hd2 */ +unsigned int cs_get_chip_type(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h index fe1b463da..120dcc5ac 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/cs_api.h @@ -26,6 +26,7 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); #define CS_CHIP_KRONOS_S 0x7540 #define CS_CHIP_KRONOS_C 0x7550 #define CS_CHIP_KRONOS_IP 0x7530 +#define CS_CHIP_NEVIS 0x0000 /* workaround for nonexistant nevis chiptype */ enum CS_LOG_MODULE { CS_LOG_CI = 0, @@ -49,6 +50,8 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +/* Preliminary function (for compatibility with older neutrino sources) */ +void cs_new_auto_videosystem(); // Memory helpers void *cs_malloc_uncached(size_t size); @@ -89,4 +92,25 @@ bool cs_box_has_ci(void); unsigned int cs_get_chip_id(void); unsigned int cs_get_chip_rev_id(void); +// library version functions +typedef struct cs_libversion_t +{ + int vMajor; + int vMinor; + int vPatch; + char vStr[16]; + char vGit[41]; + char vGitDescribe[64]; + time_t vGitTime; +} cs_libversion_struct_t; + +void cs_get_lib_version(cs_libversion_t *ver); + +/* return value: + ------------- + 1 Library version newer than given version + 0 library version equals given version + -1 Library version older than given version */ +int cs_compare_lib_versions(int Major, int Minor, int Patch); + #endif //__CS_API_H_ diff --git a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h index 6c1da4931..71f4e6db5 100644 --- a/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h +++ b/lib/hardware/coolstream/hd2/libcoolstream/video_cs.h @@ -152,6 +152,12 @@ typedef enum VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS } VIDEO_CONTROL; +typedef struct cs_vs_format_t +{ + char formatHD[16]; + char formatSD[16]; +} cs_vs_format_struct_t; + class cDemux; class cAudio; @@ -190,6 +196,7 @@ private: analog_mode_t analog_mode_scart; fp_icon mode_icon; cDemux *demux; + int current_video_system; // int SelectAutoFormat(); void ScalePic(); @@ -243,6 +250,11 @@ public: int64_t GetPTS(void); int Flush(void); + /* get video system infos */ + int GetVideoSystem(); + /* when system = -1 then use current video system */ + void GetVideoSystemFormatName(cs_vs_format_t* format, int system = -1); + /* set video_system */ int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); diff --git a/src/Makefile.am b/src/Makefile.am index 0adb0e148..7deb76623 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 \ @@ -145,14 +145,12 @@ if BOXTYPE_COOL neutrino_LDADD += \ $(top_builddir)/lib/hardware/coolstream/libhwcaps.a neutrino_LDADD += -lcoolstream-mt -lca-sc -if ENABLE_TMSDK -else + if BOXMODEL_CS_HD2 neutrino_LDADD += -lca-ci -llnxtmvssUsr -llnxUKAL -llnxplatUsr -llnxtmasUsr -llnxdvbciUsr -llnxpvrUsr -llnxcssUsr -llnxnotifyqUsr -ltmpvrDataManager-cst -ltmpvrIndexStorage -llnxscsUsr else neutrino_LDADD += -lnxp endif -endif if BOXMODEL_CS_HD2 neutrino_LDADD += -liconv diff --git a/src/compatibility.h b/src/compatibility.h new file mode 100644 index 000000000..aa03d1ef8 --- /dev/null +++ b/src/compatibility.h @@ -0,0 +1,34 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Copyright (C) 2017, Michael Liebmann 'micha-bbg' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __COMPATIBILITY_H__ +#define __COMPATIBILITY_H__ + + +#if !defined __UCLIBC__ || ((__UCLIBC_MAJOR__ >= 1) && (__UCLIBC_MINOR__ >= 0) && (__UCLIBC_SUBLEVEL__ >= 10)) +#define comp_malloc_stats(a) malloc_stats() +#else +#define comp_malloc_stats(a) malloc_stats(a) +#endif + + +#endif // __COMPATIBILITY_H__ 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/fb_generic.cpp b/src/driver/fb_generic.cpp index 37b66ca00..6d470ade6 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -275,8 +275,8 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; - // always reduce a possible detailline - return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; + // always reduce a possible detailsline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index b6dae5a3f..c3b9a6f4c 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -67,7 +67,6 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % #define WINDOW_SIZE_MIN_FORCED 80 // % -#define ConnectLineBox_Width 16 // px /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 20ff5a506..f3139410b 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -457,8 +457,8 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; - // always reduce a possible detailline - return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; + // always reduce a possible detailsline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 87d6375f0..74977914d 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -70,7 +70,6 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % #define WINDOW_SIZE_MIN_FORCED 80 // % -#define ConnectLineBox_Width 16 // px /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 51e2bebae..85af71262 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -358,6 +358,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const perror("[lcdd] set invert failed!"); } +#if 0 if (g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS) { if (ioctl(fd, LCD_IOCTL_BIAS, &bias) < 0) @@ -365,6 +366,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const perror("[lcdd] set bias failed!"); } } +#endif close(fd); } #endif 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 80b40377e..8c200a301 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -269,10 +269,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 b377a6625..7466514d4 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/driver/screenshot.cpp b/src/driver/screenshot.cpp index 016e5e28a..d889b9f8b 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -2,6 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2011 CoolStream International Ltd + Copyright (C) 2017 M. Liebmann (micha-bbg) parts based on AiO Screengrabber (C) Seddi seddi@ihad.tv @@ -62,6 +63,9 @@ CScreenShot::CScreenShot(const std::string fname, screenshot_format_t fmt) fd = NULL; xres = 0; yres = 0; + scs_thread = 0; + pthread_mutex_init(&thread_mutex, NULL); + pthread_mutex_init(&getData_mutex, NULL); get_video = g_settings.screenshot_video; get_osd = g_settings.screenshot_mode; scale_to_video = g_settings.screenshot_scale; @@ -69,15 +73,17 @@ CScreenShot::CScreenShot(const std::string fname, screenshot_format_t fmt) CScreenShot::~CScreenShot() { + pthread_mutex_destroy(&thread_mutex); + pthread_mutex_destroy(&getData_mutex); +// printf("[CScreenShot::%s:%d] thread: %p\n", __func__, __LINE__, this); } /* try to get video frame data in ARGB format, restore GXA state */ bool CScreenShot::GetData() { - static OpenThreads::Mutex mutex; bool res = false; + pthread_mutex_lock(&getData_mutex); - mutex.lock(); #ifdef BOXMODEL_CS_HD1 CFrameBuffer::getInstance()->setActive(false); #endif @@ -94,49 +100,85 @@ bool CScreenShot::GetData() //CFrameBuffer::getInstance()->add_gxa_sync_marker(); CFrameBuffer::getInstance()->setActive(true); #endif - mutex.unlock(); + pthread_mutex_unlock(&getData_mutex); if (!res) { - printf("CScreenShot::Start: GetScreenImage failed\n"); + printf("[CScreenShot::%s:%d] GetScreenImage failed\n", __func__, __LINE__); return false; } - printf("CScreenShot::GetData: data: %p %d x %d\n", pixel_data, xres, yres); + printf("[CScreenShot::%s:%d] data: %p %d x %d\n", __func__, __LINE__, pixel_data, xres, yres); return true; } +bool CScreenShot::startThread() +{ + if (!scs_thread) { + void *ptr = static_cast(this); + int res = pthread_create(&scs_thread, NULL, initThread, ptr); + if (res != 0) { + printf("[CScreenShot::%s:%d] ERROR! pthread_create\n", __func__, __LINE__); + return false; + } + pthread_detach(scs_thread); + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0); + } + return true; +} + +void* CScreenShot::initThread(void *arg) +{ + set_threadname("n:screenshot"); + CScreenShot *scs = static_cast(arg); + pthread_cleanup_push(cleanupThread, scs); +// printf("[CScreenShot::%s:%d] thread: %p\n", __func__, __LINE__, scs); + + scs->runThread(); + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0); + pthread_exit(0); + + pthread_cleanup_pop(0); + return 0; +} + +/* thread function to save data asynchroniosly. delete itself after saving */ +void CScreenShot::runThread() +{ + pthread_mutex_lock(&thread_mutex); + printf("[CScreenShot::%s:%d] save to %s format %d\n", __func__, __LINE__, filename.c_str(), format); + + bool ret = SaveFile(); + + printf("[CScreenShot::%s:%d] %s finished: %d\n", __func__, __LINE__, filename.c_str(), ret); + pthread_mutex_unlock(&thread_mutex); +} + +void CScreenShot::cleanupThread(void *arg) +{ + CScreenShot *scs = static_cast(arg); +// printf("[CScreenShot::%s:%d] thread: %p\n", __func__, __LINE__, scs); + delete scs; +} + /* start ::run in new thread to save file in selected format */ bool CScreenShot::Start() { - set_threadname("n:screenshot"); bool ret = false; - if(GetData()) - ret = (start() == 0); + if (GetData()) + ret = startThread(); else delete this; return ret; } -/* thread function to save data asynchroniosly. delete itself after saving */ -void CScreenShot::run() -{ - printf("CScreenShot::run save to %s format %d\n", filename.c_str(), format); - detach(); - setCancelModeDisable(); - setSchedulePriority(THREAD_PRIORITY_MIN); - bool ret = SaveFile(); - printf("CScreenShot::run: %s finished: %d\n", filename.c_str(), ret); - delete this; -} - /* save file in sync mode, return true if save ok, or false */ bool CScreenShot::StartSync() { bool ret = false; - printf("CScreenShot::StartSync save to %s format %d\n", filename.c_str(), format); - if(GetData()) + printf("[CScreenShot::%s:%d] save to %s format %d\n", __func__, __LINE__, filename.c_str(), format); + if (GetData()) ret = SaveFile(); - - printf("CScreenShot::StartSync: %s finished: %d\n", filename.c_str(), ret); + printf("[CScreenShot::%s:%d] %s finished: %d\n", __func__, __LINE__, filename.c_str(), ret); return ret; } @@ -226,7 +268,7 @@ bool CScreenShot::SavePng() free(row_pointers); fclose(fd); - TIMER_STOP(filename.c_str()); + TIMER_STOP(("[CScreenShot::SavePng] " + filename).c_str()); return true; } @@ -266,7 +308,7 @@ bool CScreenShot::SaveJpg() int xres2 = xres1+2; for (int x = 0; x < xres; x++) { int x2 = x*3; - memcpy(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); + memmove(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); SWAP(pixel_data[x2 + xres1], pixel_data[x2 + xres2]); } } @@ -307,7 +349,7 @@ bool CScreenShot::SaveJpg() jpeg_finish_compress(&cinfo); jpeg_destroy_compress(&cinfo); fclose(fd); - TIMER_STOP(filename.c_str()); + TIMER_STOP(("[CScreenShot::SaveJpg] " + filename).c_str()); return true; } @@ -340,7 +382,7 @@ bool CScreenShot::SaveBmp() fwrite(pixel_data+(y*xres*4),xres*4,1,fd); } fclose(fd); - TIMER_STOP(filename.c_str()); + TIMER_STOP(("[CScreenShot::SaveBmp] " + filename).c_str()); return true; } diff --git a/src/driver/screenshot.h b/src/driver/screenshot.h index a4f348a8b..fefaf7c78 100644 --- a/src/driver/screenshot.h +++ b/src/driver/screenshot.h @@ -2,6 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2011 CoolStream International Ltd + Copyright (C) 2017 M. Liebmann (micha-bbg) License: GPLv2 @@ -22,9 +23,9 @@ #ifndef __screenshot_h_ #define __screenshot_h_ -#include +#include -class CScreenShot : public OpenThreads::Thread +class CScreenShot { public: typedef enum { @@ -43,6 +44,9 @@ class CScreenShot : public OpenThreads::Thread bool get_video; bool scale_to_video; FILE *fd; + pthread_t scs_thread; + pthread_mutex_t thread_mutex; + pthread_mutex_t getData_mutex; bool GetData(); bool OpenFile(); @@ -51,7 +55,11 @@ class CScreenShot : public OpenThreads::Thread bool SavePng(); bool SaveJpg(); bool SaveBmp(); - void run(); + + bool startThread(); + static void* initThread(void *arg); + void runThread(); + static void cleanupThread(void *arg); public: CScreenShot(const std::string fname = "", screenshot_format_t fmt = CScreenShot::FORMAT_JPG); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index cd32f66be..bfeb8c0d3 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,6 +55,8 @@ #include "xmlutil.h" #include "debug.h" +#include + //#define ENABLE_SDT //FIXME //#define DEBUG_SDT_THREAD @@ -1067,11 +1069,7 @@ static void commandDumpStatusInformation(int /*connfd*/, char* /*data*/, const u // resourceUsage.ru_maxrss, resourceUsage.ru_ixrss, resourceUsage.ru_idrss, resourceUsage.ru_isrss, ); printf("%s\n", stati); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); return ; } @@ -1200,11 +1198,7 @@ static void FreeMemory() unlockEvents(); -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); xprintf("[sectionsd] free memory done\n"); //wakeupAll(); //FIXME should we re-start eit here ? } @@ -2096,11 +2090,7 @@ static void print_meminfo(void) if (!sections_debug) return; -#ifdef __UCLIBC__ - malloc_stats(NULL); -#else - malloc_stats(); -#endif + comp_malloc_stats(NULL); } //--------------------------------------------------------------------- diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 72ce2d978..13193de4f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -68,7 +68,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/audioplayer.cpp b/src/gui/audioplayer.cpp index 2fd1d1904..35a971e7f 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -271,8 +271,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height m_x = getScreenStartX( m_width ); - if (m_x < ConnectLineBox_Width) - m_x = ConnectLineBox_Width; + if (m_x < DETAILSLINE_WIDTH) + m_x = DETAILSLINE_WIDTH; m_y = getScreenStartY( m_height ); m_idletime=time(NULL); @@ -1468,8 +1468,8 @@ void CAudioPlayerGui::hide() // printf("hide(){\n"); if (m_visible) { - m_frameBuffer->paintBackgroundBoxRel(m_x - ConnectLineBox_Width, m_y + m_title_height, - m_width + ConnectLineBox_Width, m_height - m_title_height); + m_frameBuffer->paintBackgroundBoxRel(m_x - DETAILSLINE_WIDTH, m_y + m_title_height, + m_width + DETAILSLINE_WIDTH, m_height - m_title_height); clearItemID3DetailsLine(); m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); m_visible = false; @@ -1789,7 +1789,7 @@ void CAudioPlayerGui::clearItemID3DetailsLine () void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { - int xpos = m_x - ConnectLineBox_Width; + int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_y + m_title_height + m_theight + pos*m_fheight; int ypos2 = m_y + (m_height - m_info_height) + OFFSET_INTER; int ypos1a = ypos1 + (m_fheight / 2); @@ -1807,7 +1807,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { //details line if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); dline->paint(false); // paint id3 infobox diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 7905d6e1c..af7c10df8 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -139,7 +139,7 @@ class CAudioPlayerGui : public CMenuTarget int m_idletime; bool m_screensaver; bool m_inetmode; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; SMSKeyInput m_SMSKeyInput; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 9abeb7a1a..9fade03d4 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -231,7 +231,7 @@ void CBEChannelWidget::paintDetails(int index) void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + OFFSET_INTER; int ypos1a = ypos1 + (fheight/2); @@ -244,7 +244,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox @@ -318,8 +318,8 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* height = theight+footerHeight+listmaxshow*iheight; // recalc height x = getScreenStartX(width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; y = getScreenStartY(height + info_height); diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index 09394fc64..8ee180710 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -48,7 +48,7 @@ class CBEChannelWidget : public CMenuTarget, public CListHelpers private: CFrameBuffer *frameBuffer; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; CComponentsFooter footer; enum state_ diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index c60372450..c80a182b2 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -202,8 +202,8 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action height = theight+footerHeight+listmaxshow*iheight; // recalc height x = getScreenStartX(width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; y = getScreenStartY(height + info_height); bouquetChannels = mode == CZapitClient::MODE_TV ? &(bouquet->tvChannels) : &(bouquet->radioChannels); @@ -288,7 +288,7 @@ void CBEChannelSelectWidget::paintDetails(int index) void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + OFFSET_INTER; int ypos1a = ypos1 + (fheight/2); @@ -301,7 +301,7 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 91ed9fdb3..519b16397 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -49,7 +49,7 @@ class CBEChannelSelectWidget : public CListBox enum{SORT_ALPHA,SORT_FREQ,SORT_SAT,SORT_CH_NUMBER, SORT_END}; CZapitClient::channelsMode mode; bool isChannelInBouquet( int index); - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; CComponentsFooter footer; uint getItemCount(); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 4519cd1b7..04c4740bf 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -485,7 +485,7 @@ void CChannelList::calcSize() pig_on_win = ( (g_settings.channellist_additional == 2) /* with miniTV */ && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width - full_width = pig_on_win ? (frameBuffer->getScreenWidth()-2*ConnectLineBox_Width) : frameBuffer->getScreenWidthRel(); + full_width = pig_on_win ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); if (g_settings.channellist_additional) width = full_width / 3 * 2; @@ -506,8 +506,8 @@ void CChannelList::calcSize() // calculate x position x = getScreenStartX(full_width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; // calculate header height const int pic_h = 39; @@ -1656,14 +1656,14 @@ void CChannelList::paintItem2DetailsLine (int pos) if (!g_settings.channellist_show_infobox) return; - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight + pos*fheight + (fheight/2); int ypos2 = y + height + OFFSET_INTER + (info_height/2); // paint Line if detail info (and not valid list pos) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); dline->paint(false); } } diff --git a/src/gui/channellist.h b/src/gui/channellist.h index aa9933030..f5addbe68 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -104,7 +104,7 @@ private: ZapitChannelList *chanlist; CBouquet *bouquet; CZapProtection* zapProtection; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; int full_width; int width; diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index cb86eb14a..81da16c5e 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -35,15 +35,15 @@ using namespace std; -//sub class CComponentsDetailLine from CComponents -CComponentsDetailLine::CComponentsDetailLine( const int& x_pos, const int& y_pos_top, +//sub class CComponentsDetailsLine from CComponents +CComponentsDetailsLine::CComponentsDetailsLine( const int& x_pos, const int& y_pos_top, const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_, fb_pixel_t color_line, fb_pixel_t color_shadow) { initVarDline(x_pos, y_pos_top, y_pos_down, h_mark_top_, h_mark_down_, color_line, color_shadow); } -void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top, +void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_top, const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_, fb_pixel_t color_line, fb_pixel_t color_shadow) { @@ -53,20 +53,20 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top col_shadow = color_shadow; col_body = color_line; - //CComponentsDetailLine + //CComponentsDetailsLine y_down = y_pos_down; h_mark_top = h_mark_top_; h_mark_down = h_mark_down_; shadow_w = 1; - //CComponentsDetailLine + //CComponentsDetailsLine thickness = 4; /* MUST be an even value! */ cc_body_gradient_enable = false; } -CComponentsDetailLine::~CComponentsDetailLine() +CComponentsDetailsLine::~CComponentsDetailsLine() { } @@ -86,7 +86,7 @@ CComponentsDetailLine::~CComponentsDetailLine() //paint details line with current parameters -void CComponentsDetailLine::paint(bool do_save_bg) +void CComponentsDetailsLine::paint(bool do_save_bg) { hide(); if (hasChanges()) @@ -139,7 +139,7 @@ void CComponentsDetailLine::paint(bool do_save_bg) //synchronize colors for details line //This is usefull if the system colors are changed during runtime //so you can ensure correct applied system colors in relevant objects with unchanged instances. -void CComponentsDetailLine::syncSysColors() +void CComponentsDetailsLine::syncSysColors() { col_body = COL_FRAME_PLUS_0; col_shadow = COL_SHADOW_PLUS_0; diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index dfea467bd..be07ef57f 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -37,7 +37,7 @@ Not usable as CCItem! */ -class CComponentsDetailLine : public CComponents +class CComponentsDetailsLine : public CComponents { private: ///property: line thickness @@ -55,10 +55,10 @@ class CComponentsDetailLine : public CComponents fb_pixel_t color_line, fb_pixel_t color_shadow); public: - CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, + CComponentsDetailsLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN, fb_pixel_t color_line = COL_FRAME_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ~CComponentsDetailLine(); + ~CComponentsDetailsLine(); ///set colors void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 9ca52c03c..5c4d8448b 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -27,8 +27,9 @@ #include "cc_draw.h" #include "cc_timer.h" #include - +#include #include +extern CPictureViewer * g_PicViewer; CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { @@ -44,6 +45,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) col_frame = col_frame_old = COL_FRAME_PLUS_0; col_shadow_clean = 0; + cc_body_image = cc_body_image_old = string(); + fr_thickness = fr_thickness_old = 0; corner_type = corner_type_old = CORNER_ALL; @@ -176,6 +179,11 @@ inline bool CCDraw::applyColChanges() cc_body_gradient_direction_old = cc_body_gradient_direction; ret = true; } + if (cc_body_image != cc_body_image_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], col changes cc_body_image %s != cc_body_image_old %s...\033[0m\n", __func__, __LINE__, cc_body_image.c_str(), cc_body_image_old.c_str()); + cc_body_image_old = cc_body_image; + ret = true; + } return ret; } @@ -467,13 +475,13 @@ void CCDraw::enablePaintCache(bool enable) //paint framebuffer layers void CCDraw::paintFbItems(bool do_save_bg) { - //pick up signal if filled + //Pick up signal if filled and execute slots. OnBeforePaintLayers(); - //first modify background handling + //First we modify background handling. enableSaveBg(do_save_bg); - //save background before first paint, cc_save_bg must be true + //Save background before first paint, cc_save_bg must be true. if (firstPaint && cc_save_bg){ /* On first we must ensure that screen buffer is empty. * Here we clean possible screen buffers in bg layers, @@ -482,7 +490,7 @@ void CCDraw::paintFbItems(bool do_save_bg) clearSavedScreen(); /* On second step we check for - * usable item dimensions and exit here if found any problem + * usable item dimensions and exit here if found any problem. */ for(size_t i=0; i 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); @@ -550,10 +558,10 @@ void CCDraw::paintFbItems(bool do_save_bg) } if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { if (fbdata.enabled) { - /* here we paint the shadow around the body - * on 1st step we check for already cached screen buffer, if true - * then restore this instead to call the paint methode. - * This could be usally, if we use existant instances of "this" object + /* Here we paint the shadow around the body. + * On 1st step we check for already cached screen buffer, if true + * then restore this instead to call the paint methode. + * This could be usally, if we use an existant instances of "this" object */ if (cc_allow_paint){ if (fbdata.pixbuf){ @@ -562,7 +570,7 @@ void CCDraw::paintFbItems(bool do_save_bg) }else{ frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); } - //if is paint cache enabled + //If is paint cache enabled, catch screen into cache if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); fbdata.is_painted = true; @@ -572,63 +580,104 @@ void CCDraw::paintFbItems(bool do_save_bg) if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BOX){ if(cc_allow_paint) { - /* here we paint the main body of box - * on 1st step we check for already cached background buffer, if true - * then restore this instead to call the paint methodes and gradient creation - * paint cache can be enable/disable with enablePaintCache() + /* Here we paint the main body of box. + * On 1st step we check for already cached background buffer, if true + * then restore this instead to call the paint methodes and gradient creation. + * Paint cache can be enable/disable with enablePaintCache() */ if (fbdata.pixbuf){ + /* If is paint cache enabled and cache is filled, it's prefered to paint + * from cache. Cache is also filled if body background images are used + */ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint body from cache...\033[0m\n", __func__, __LINE__); frameBuffer->RestoreScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.pixbuf); }else{ - //ensure clean gradient data on disabled gradient + //Ensure clean gradient data on disabled gradient. if(cc_body_gradient_enable == CC_COLGRAD_OFF && fbdata.gradient_data){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], gradient mode is disabled but filled\033[0m\n", __func__, __LINE__); clearFbGradientData(); } - if (cc_body_gradient_enable != CC_COLGRAD_OFF){ - /* if color gradient enabled we create a gradient_data - * instance and add it to the fbdata object - * On disabled coloor gradient we do paint only a default box - */ - if (fbdata.gradient_data == NULL){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], crate new gradient data)...\033[0m\n", __func__, __LINE__); - fbdata.gradient_data = getGradientData(); + + /* If background image is defined, + * we try to render an image instead to render default box. + * Paint of background image is prefered, next steps will be ignored! + */ + if (!cc_body_image.empty()){ + if (g_PicViewer->DisplayImage(cc_body_image, fbdata.x, fbdata.y, fbdata.dx, fbdata.dy)){ + // catch screen and store into paint cache + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; + }else{ + if (fbdata.pixbuf){ + delete[] fbdata.pixbuf; + fbdata.pixbuf = NULL; + } + fbdata.is_painted = false; } - // if found empty gradient buffer, create it, otherwise paint from gradient cache - if (fbdata.gradient_data->boxBuf == NULL){ - if (!fbdata.pixbuf){ - // on enabled clean up, paint blank screen before create gradient box, this prevents possible ghost text with hw acceleration - if (cc_gradient_bg_cleanup) - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + // On failed image paint, write this into log and reset image name. + if (!fbdata.is_painted){ + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], WARNING: bg image %s defined, but paint failed,\nfallback to default rendering...\033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + cc_body_image = ""; + } + } - // create gradient buffer and paint gradient box - fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + /* If no background image is defined, we paint default box or box with gradient + * This is also possible if any background image is defined but image paint ist failed + */ + if (cc_body_image.empty()){ + if (cc_body_gradient_enable != CC_COLGRAD_OFF ){ + + /* If color gradient enabled we create a gradient_data + * instance and add it to the fbdata object + * On disabled color gradient or image paint was failed, we do paint only a default box + */ + if (fbdata.gradient_data == NULL){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], create new gradient data)...\033[0m\n", __func__, __LINE__); + fbdata.gradient_data = getGradientData(); } - /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. - * If we don't do this, gradient cache is used. - */ - if (cc_paint_cache || cc_gradient_bg_cleanup){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); - if (clearFbGradientData()) - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + if (fbdata.gradient_data->boxBuf == NULL){ + if (fbdata.pixbuf == NULL){ + /* Before we paint any gradient box with hw acceleration, we must cleanup first. + * FIXME: This is only a workaround for this framebuffer behavior on enabled hw acceleration. + * Without this, ugly ghost letters or ghost images inside gradient boxes are possible. + */ + if (cc_gradient_bg_cleanup) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + + // create gradient buffer and paint gradient box + fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + } + + /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. + * If we don't do this explicit, gradient cache is used. + */ + if (cc_paint_cache || cc_gradient_bg_cleanup){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + if (clearFbGradientData()) + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + } + }else{ + // If found gradient buffer, paint box from gradient cache. + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); } }else{ - //use gradient cache to repaint gradient box - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); + /* If is nothihng cached or no background image was defined or image paint was failed, + * render a default box. + */ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); + + //If is paint cache enabled, catch screen into cache. + if (cc_paint_cache) + fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } - }else{ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.color, fbdata.r, fbdata.rtype); - if (cc_paint_cache) - fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } v_fbdata[i].is_painted = true; @@ -653,7 +702,6 @@ void CCDraw::paintFbItems(bool do_save_bg) //reset is painted ignore flag to default value force_paint_bg = false; - //pick up signal if filled OnAfterPaintLayers(); } @@ -797,3 +845,21 @@ bool CCDraw::cancelBlink(bool keep_on_screen) return res; } + +bool CCDraw::setBodyBGImage(const std::string& image_path) +{ + if (cc_body_image == image_path) + return false; + + cc_body_image = image_path; + + if (clearPaintCache()) + dprintf(DEBUG_NORMAL, "\033[33m\[CCDraw]\t[%s - %d], new body background image defined: %s , \033[0m\n", __func__, __LINE__, cc_body_image.c_str()); + + return true; +} + +bool CCDraw::setBodyBGImageName(const std::string& image_name) +{ + return setBodyBGImage(frameBuffer->getIconPath(image_name)); +} diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 50be8a71d..26b8875d5 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2015, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -78,6 +78,8 @@ class CCDraw : public COSDFader, public CComponentsSignals fb_pixel_t col_frame, col_frame_old; ///internal property: color for shadow clean up fb_pixel_t col_shadow_clean; + ///property: background image, see also setBodyBGImage() + std::string cc_body_image, cc_body_image_old; ///property: frame thickness, see also setFrameThickness() int fr_thickness, fr_thickness_old; @@ -407,8 +409,32 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void killShadow(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); - virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; - virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; } + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); } + + /**Sets an image path for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_path Path to image. + * + * @see + * cc_body_image + * setBodyBGImageName() + */ + virtual bool setBodyBGImage(const std::string& image_path); + + /**Sets an image name for body background, returns true if new image was applied. + * + * @return bool + * + * @param[in] image_name Basename of image. + * + * @see + * cc_body_image + * setBodyBGImage() + */ + virtual bool setBodyBGImageName(const std::string& image_name); }; #endif diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f125231f6..017bc7feb 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2013-2014, Thilo Graf 'dbt' + Copyright (C) 2013-2017, Thilo Graf 'dbt' License: GPL @@ -102,7 +102,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const initParent(parent); } -void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) { /* clean up before init*/ if (chain) @@ -178,7 +178,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont vector v_btns; int h_btn = /*(ccf_enable_button_bg ? */chain->getHeight()-2*fr_thickness/*-OFFSET_INNER_SMALL*//* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ - string txt = content[i].text; + string txt = content[i].locale == NONEXISTANT_LOCALE ? content[i].text : g_Locale->getText(content[i].locale); string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; @@ -244,26 +244,10 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont } } -void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width) -{ - button_label_s buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = content[i].button; - buttons[i].text = content[i].locale != NONEXISTANT_LOCALE ? g_Locale->getText(content[i].locale) : ""; - buttons[i].directKey = content[i].directKey; - buttons[i].directKeyAlt = content[i].directKeyAlt; - buttons[i].btn_result = content[i].btn_result; - buttons[i].btn_alias = content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width) { //conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h - button_label_l buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i = 0; i< label_count; i++){ buttons[i].button = content[i].button; buttons[i].locale = content[i].locale; @@ -276,31 +260,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten setButtonLabels(buttons, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) +void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) { size_t label_count = v_content.size(); - button_label_l buttons[label_count]; - - for (size_t i= 0; i< label_count; i++){ - buttons[i].button = v_content[i].button; - buttons[i].locale = v_content[i].locale; - buttons[i].directKey = v_content[i].directKey; - buttons[i].directKeyAlt = v_content[i].directKeyAlt; - buttons[i].btn_result = v_content[i].btn_result; - buttons[i].btn_alias = v_content[i].btn_alias; - } - - setButtonLabels(buttons, label_count, chain_width, label_width); -} - -void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) -{ - size_t label_count = v_content.size(); - button_label_s buttons[label_count]; + button_label_cc buttons[label_count]; for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; buttons[i].text = v_content[i].text; + buttons[i].locale = v_content[i].locale; buttons[i].directKey = v_content[i].directKey; buttons[i].directKeyAlt = v_content[i].directKeyAlt; buttons[i].btn_result = v_content[i].btn_result; @@ -319,7 +287,7 @@ void CComponentsFooter::setButtonLabel( const char *button_icon, const int& alias_value, const neutrino_msg_t& directKeyAlt) { - button_label_s button[1]; + button_label_cc button[1]; button[0].button = button_icon; button[0].text = text; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 59a90e8f5..3cc572605 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + Copyright (C) 2012-2017, Thilo Graf 'dbt' License: GPL @@ -29,26 +29,6 @@ #include #include //for compatibility with 'button_label' type -//for 'button_label' type with string -typedef struct button_label_s -{ - const char * button; - std::string text; - neutrino_msg_t directKey; - neutrino_msg_t directKeyAlt; - int btn_result; - int btn_alias; -} button_label_s_struct; - -typedef struct button_label_l -{ - const char * button; - neutrino_locale_t locale; - neutrino_msg_t directKey; - neutrino_msg_t directKeyAlt; - int btn_result; - int btn_alias; -} button_label_l_struct; /*! CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer @@ -101,13 +81,9 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, count as size_t, chain_width as int, label width as int - void setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); - ///add button labels with locale label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); ///add button labels with string label type as content, parameter 1 as vector, chain_width as int, label width as int - void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); + void setButtonLabels(const std::vector &v_content, const int& chain_width, const int& label_width); ///enable/disable button frame in icon color, predefined for red, green, yellow and blue inline void enableButtonFrameColor(bool enable = true){btn_auto_frame_col = enable;} diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index c76520bb8..5f56ee181 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -175,6 +175,22 @@ typedef struct cc_string_ext_txt_t Font* font; } cc_string_ext_txt_struct_t; + +//for 'button_label' type with string +typedef struct button_label_cc +{ + const char * button; + std::string text; + neutrino_locale_t locale; + neutrino_msg_t directKey; + neutrino_msg_t directKeyAlt; + int btn_result; + int btn_alias; + std::string bg_image; + std::string hint; + button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){} +} button_label_cc_struct; + #define CC_WIDTH_MIN 16 #define CC_HEIGHT_MIN 16 diff --git a/src/gui/epgview.h b/src/gui/epgview.h index b66360d44..f776f5be7 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -36,7 +36,7 @@ #include #include -#include +#include #include "widget/menue.h" #include diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 494487614..2225797bc 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -139,27 +139,27 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) else { CComponentsFooter* footer = (*udata)->w->getFooterObject(); if (footer) { - vector buttons; + vector buttons; if (!btnRed.empty()) { - button_label_s btnSred; + button_label_cc btnSred; btnSred.button = NEUTRINO_ICON_BUTTON_RED; btnSred.text = btnRed; buttons.push_back(btnSred); } if (!btnGreen.empty()) { - button_label_s btnSgreen; + button_label_cc btnSgreen; btnSgreen.button = NEUTRINO_ICON_BUTTON_GREEN; btnSgreen.text = btnGreen; buttons.push_back(btnSgreen); } if (!btnYellow.empty()) { - button_label_s btnSyellow; + button_label_cc btnSyellow; btnSyellow.button = NEUTRINO_ICON_BUTTON_YELLOW; btnSyellow.text = btnYellow; buttons.push_back(btnSyellow); } if (!btnBlue.empty()) { - button_label_s btnSblue; + button_label_cc btnSblue; btnSblue.button = NEUTRINO_ICON_BUTTON_BLUE; btnSblue.text = btnBlue; buttons.push_back(btnSblue); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index a2f3bba9b..14a4384d8 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -333,7 +333,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) ms_general->addItem(mc); //fan speed - if (g_info.has_fan) + if (g_info.hw_caps->has_fan) { CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 11257e512..5ae6dc094 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1530,12 +1530,12 @@ void CMovieBrowser::refreshDetailsLine(int pos) int hheight = m_pcBrowser->getHeaderListHeight(); int theight = m_pcBrowser->getTitleHeight(); - int xpos = m_cBoxFrameBrowserList.iX - ConnectLineBox_Width; + int xpos = m_cBoxFrameBrowserList.iX - DETAILSLINE_WIDTH; int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + OFFSET_INNER_MID + pos*fheight + (fheight/2); int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); if (m_detailsLine == NULL) - m_detailsLine = new CComponentsDetailLine(); + m_detailsLine = new CComponentsDetailsLine(); m_detailsLine->setDimensionsAll(xpos, ypos1, ypos2, fheight/2, m_cBoxFrameInfo1.iHeight-2*RADIUS_LARGE); m_detailsLine->paint(true); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 3f29afdea..607528821 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include @@ -163,7 +163,7 @@ class CMovieBrowser : public CMenuTarget CBox m_cBoxFrameTitleRel; CComponentsHeader *m_header; - CComponentsDetailLine *m_detailsLine; + CComponentsDetailsLine *m_detailsLine; CComponentsChannelLogo *m_channelLogo; CComponentsPicture *m_movieCover; diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 5da4da4d2..1e15997d7 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/scan_setup.cpp b/src/gui/scan_setup.cpp index 7eca091ec..2107c9a9f 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -90,7 +90,7 @@ const CMenuOptionChooser::keyval SCANTS_ZAPIT_SCANTYPE[SCANTS_ZAPIT_SCANTYPE_COU { CServiceScan::SCAN_ALL , LOCALE_ZAPIT_SCANTYPE_ALL } }; -#define SATSETUP_DISEQC_OPTION_COUNT 6 +#define SATSETUP_DISEQC_OPTION_COUNT 7 const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_COUNT] = { { NO_DISEQC, LOCALE_SATSETUP_NODISEQC }, @@ -99,7 +99,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_ { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, - { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE } + { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE }, + { DISEQC_UNICABLE2, LOCALE_SATSETUP_UNICABLE2 } // { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } }; @@ -878,7 +879,8 @@ void CScanSetup::setDiseqcOptions(int number) mfe_config.diseqcType == DISEQC_1_0 ? LOCALE_SATSETUP_DISEQC10 : mfe_config.diseqcType == DISEQC_1_1 ? LOCALE_SATSETUP_DISEQC11 : mfe_config.diseqcType == DISEQC_ADVANCED ? LOCALE_SATSETUP_DISEQC_ADVANCED : - LOCALE_SATSETUP_UNICABLE); + mfe_config.diseqcType == DISEQC_UNICABLE ? LOCALE_SATSETUP_UNICABLE : + LOCALE_SATSETUP_UNICABLE2); if (mode == CFrontend::FE_MODE_LINK_TWIN && mfe_config.diseqcType != DISEQC_UNICABLE) { count++; @@ -1023,7 +1025,7 @@ int CScanSetup::showFrontendSetup(int number) fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); setupMenu->addItem(fsatSetup); - uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); + uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); setupMenu->addItem(uniSetup); CMenuWidget * rotorMenu = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS, width); @@ -1091,7 +1093,7 @@ int CScanSetup::showUnicableSetup() int unicable_scr = fe_config.uni_scr; int unicable_qrg = fe_config.uni_qrg; - CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7); + CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, dmode == DISEQC_UNICABLE ? 7 : 31); CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, &unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); @@ -1332,7 +1334,7 @@ int CScanSetup::showScanMenuSatFind() //init tempsat menu void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) { - bool unicable = (dmode == DISEQC_UNICABLE); + bool unicable = (dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2); temp_sat->addIntroItems(); CMenuOptionNumberChooser *diseqc = NULL; @@ -1357,7 +1359,7 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon } else { if (satconfig.diseqc < 0) satconfig.diseqc = 0; - unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1); + unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, dmode == DISEQC_UNICABLE ? 1 : 3); } CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int*) &satconfig.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); @@ -1833,7 +1835,7 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* fe->setDiseqcType((diseqc_t) dmode); fe->setTsidOnid(0); - uniSetup->setActive(dmode == DISEQC_UNICABLE); + uniSetup->setActive(dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2); bool enable = (dmode < DISEQC_ADVANCED) && (dmode != NO_DISEQC); ojDiseqcRepeats->setActive(enable && !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); @@ -1855,7 +1857,7 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* linkfe->setActive(CFrontend::linked(femode)); /* leave diseqc type enabled for TWIN in case user need different unicable setup */ dtype->setActive(femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); - uniSetup->setActive(dmode == DISEQC_UNICABLE && femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); + uniSetup->setActive(dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2 && femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); fsatSelect->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); fsatSetup->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index dfa79f6c9..2ace35ee8 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -146,8 +146,8 @@ void CUpnpBrowserGui::Init() footer.enableShadow(CC_SHADOW_ON, -1, true); m_x=getScreenStartX(m_width); - if (m_x < ConnectLineBox_Width) // shouldn't happen - m_x = ConnectLineBox_Width; + if (m_x < DETAILSLINE_WIDTH) // shouldn't happen + m_x = DETAILSLINE_WIDTH; m_y=getScreenStartY(m_height); // calc positions @@ -1235,14 +1235,14 @@ void CUpnpBrowserGui::paintItem2DetailsLine(int pos) if (pos < 0) return; - int xpos = m_x - ConnectLineBox_Width; + int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_item_y + pos*m_item_height; int ypos2 = infobox.getYPos() + infobox.getHeight() - infobox.getHeight()/2; int ypos1a = ypos1 + (m_item_height/2); if (!dline) - dline = new CComponentsDetailLine(); + dline = new CComponentsDetailsLine(); dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight() - RADIUS_LARGE*2); dline->paint(); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 105ec5fa1..123c9fe0e 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -97,7 +97,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers time_t m_time_played; bool m_playing_entry_is_shown; time_t timeout; - CComponentsDetailLine * dline; + CComponentsDetailsLine * dline; CComponentsFooter footer; CComponentsInfoBox topbox, infobox, timebox; CComponentsPicture *image; diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index f7b90b371..5eef2d02e 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -158,6 +158,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings ::TIMING_MENU]); + int val = (*value[selected]); switch ( msg ) { case CRCInput::RC_down: { @@ -190,12 +191,13 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_right: { - if ((*value[selected]) < 100) + if (val < 100) { - if ((*value[selected]) < 98) - (*value[selected]) += 2; + if (val < 98) + val += 2; else - (*value[selected]) = 100; + val = 100; + (*value[selected]) = (uint8_t)val; paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true); setColor(); @@ -204,12 +206,13 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_left: { - if ((*value[selected]) > 0) + if (val > 0) { - if ((*value[selected]) > 2) - (*value[selected]) -= 2; + if (val > 2) + val -= 2; else - (*value[selected]) = 0; + 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/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 5cde238ec..7b2178e5f 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1182,13 +1182,13 @@ void CMenuWidget::calcSize() if(total_pages > 1) sb_width=SCROLLBAR_WIDTH; - full_width = /*ConnectLineBox_Width+*/width+sb_width+OFFSET_SHADOW; + full_width = /*DETAILSLINE_WIDTH+*/width+sb_width+OFFSET_SHADOW; full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+OFFSET_INTER*/; - /* + ConnectLineBox_Width for the hintbox connection line + /* + DETAILSLINE_WIDTH for the hintbox connection line * + center_offset for symmetry * + 20 for setMenuPos calculates 10 pixels border left and right */ - int center_offset = (g_settings.menu_pos == MENU_POS_CENTER) ? ConnectLineBox_Width : 0; - int max_possible = (int)frameBuffer->getScreenWidth() - ConnectLineBox_Width - center_offset - 20; + int center_offset = (g_settings.menu_pos == MENU_POS_CENTER) ? DETAILSLINE_WIDTH : 0; + int max_possible = (int)frameBuffer->getScreenWidth() - DETAILSLINE_WIDTH - center_offset - 20; if (full_width > max_possible) { width = max_possible - sb_width - OFFSET_SHADOW; @@ -1268,13 +1268,13 @@ void CMenuWidget::setMenuPos(const int& menu_width) case MENU_POS_CENTER: x = offx + scr_x + ((scr_w - menu_width ) >> 1 ); y = offy + scr_y + ((scr_h - real_h) >> 1 ); - x += ConnectLineBox_Width; + x += DETAILSLINE_WIDTH; break; case MENU_POS_TOP_LEFT: y = offy + scr_y + 10; x = offx + scr_x + 10; - x += ConnectLineBox_Width; + x += DETAILSLINE_WIDTH; break; case MENU_POS_TOP_RIGHT: @@ -1285,7 +1285,7 @@ void CMenuWidget::setMenuPos(const int& menu_width) case MENU_POS_BOTTOM_LEFT: y = /*offy +*/ scr_y + scr_h - real_h - 10; x = offx + scr_x + 10; - x += ConnectLineBox_Width; + x += DETAILSLINE_WIDTH; break; case MENU_POS_BOTTOM_RIGHT: @@ -1385,14 +1385,14 @@ void CMenuWidget::saveScreen() saveScreen_x = x; background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->SaveScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->RestoreScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } } @@ -1449,7 +1449,7 @@ void CMenuWidget::paintHint(int pos) int iheight = item->getHeight(); int rad = RADIUS_LARGE; - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + OFFSET_INTER; int iwidth = width+sb_width; @@ -1462,7 +1462,7 @@ void CMenuWidget::paintHint(int pos) //init details line if (details_line == NULL) - details_line = new CComponentsDetailLine(); + details_line = new CComponentsDetailsLine(); details_line->setXPos(xpos); details_line->setYPos(ypos1a); diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bf784e3cb..de1d58744 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -494,7 +494,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals private: mn_widget_id_t widget_index; CMenuGlobal *mglobal; - CComponentsDetailLine *details_line; + CComponentsDetailsLine *details_line; CComponentsInfoBox *info_box; int hint_height; CComponentsHeader *header; diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index b89220a13..bcdd23e8a 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2016 Thilo Graf 'dbt' + Copyright (C) 2014-2017 Thilo Graf 'dbt' License: GPL @@ -117,8 +117,8 @@ void CMsgBox::initTimeOut() void CMsgBox::initButtons() { - button_label_s btn; - vector v_buttons; + button_label_cc btn; + vector v_buttons; //evaluate combinations if (mb_show_button & mbAll) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9671320fe..c74e9fee8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -137,6 +137,8 @@ #include #include +#include + #include #include #include @@ -477,7 +479,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); - 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); @@ -904,7 +908,10 @@ int CNeutrinoApp::loadSetup(const char * fname) // USERMENU -> in system/settings.h //------------------------------------------- - + for(unsigned int i=0; ican_shutdown; - g_info.has_fan = g_info.hw_caps->has_fan; g_Locale = new CLocaleManager; @@ -2166,10 +2172,6 @@ TIMER_START(); g_RCInput = new CRCInput(); - /* later on, we'll crash anyway, so tell about it. */ - if (! zapit_init) - DisplayErrorMessage("Zapit initialization failed. This is a fatal error, sorry."); - InitZapitClient(); g_Zapit->setStandby(false); @@ -2199,13 +2201,9 @@ TIMER_START(); cpuFreq = new cCpuFreqManager(); cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); -#if HAVE_COOL_HARDWARE - /* only SAT-hd1 before rev 8 has fan */ - g_info.has_fan = (cs_get_revision() < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); -#endif - dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); + //fan speed - if (g_info.has_fan) + if (g_info.hw_caps->has_fan) CFanControlNotifier::setSpeed(g_settings.fan_speed); dvbsub_init(); @@ -2233,6 +2231,10 @@ TIMER_START(); g_CamHandler = new CCAMMenuHandler(); g_CamHandler->init(); + /* later on, we'll crash anyway, so tell about it. */ + if (! zapit_init) + DisplayErrorMessage("Zapit initialization failed. This is a fatal error, sorry."); + #ifndef ASSUME_MDEV mkdir("/media/sda1", 0755); mkdir("/media/sdb1", 0755); @@ -2323,7 +2325,7 @@ TIMER_STOP("################################## after all ####################### } RealRun(); - ExitRun(true, can_deepstandby); + ExitRun(g_info.hw_caps->can_shutdown); return 0; } @@ -3429,7 +3431,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; @@ -3439,7 +3441,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) { @@ -3602,192 +3604,208 @@ 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; + /* can_shutdown is actually our exit code */ + printf("[neutrino] %s can_deep: %d\n", __func__, can_deepstandby); + 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) { - 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 - } - - /* on shutdown force load new fst */ - if (retcode) - CheckFastScan(true, false); - - 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); - -#if 0 - if(retcode) { -#endif - puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); - if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) - perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); - - 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 - my_system(2,"/bin/umount", "-a"); - sleep(1); - - 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); - } - } - } - } else { -#endif - int leds = 0; - int bright = 0; -#if HAVE_COOL_HARDWARE - if (retcode) { - 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 && timer_minutes) - leds |= 0x80; - } - if (cs_get_revision() != 10) - bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; -#endif - if (timer_minutes || leds) - { - FILE *f = fopen("/tmp/.timer", "w"); - if (f) - { - fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60); - fprintf(f, "%ld\n", timer_minutes * 60); - fprintf(f, "%d\n", leds); - fprintf(f, "%d\n", bright); - fclose(f); - } - else - perror("fopen /tmp/.timer"); - } - - delete g_RCInput; - g_RCInput = NULL; - //fan speed - if (g_info.has_fan) { - CFanControlNotifier::setSpeed(0); - } - //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); - delete CVFD::getInstance(); - delete SHTDCNT::getInstance(); - stop_video(); - - printf("[neutrino] This is the end. exiting with code %d\n", retcode); - Cleanup(); -#ifdef __sh__ - /* the sh4 gcc seems to dislike someting about openthreads... */ - _exit(retcode); -#else - exit(retcode); -#endif -#if 0 - } -#endif + 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); + + CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); + + stop_daemons(true /*can_shutdown*/); //need here for timer_is_rec before saveSetup + g_settings.shutdown_timer_record_type = timer_is_rec; + saveSetup(NEUTRINO_SETTINGS_FILE); + +#if 0 + 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"); + + 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 + my_system(2,"/bin/umount", "-a"); + sleep(1); + + 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); + } + } + } + else + { + delete g_RCInput; + my_system("/etc/init.d/rcK"); + //fan speed + if (g_info.hw_caps->has_fan) + CFanControlNotifier::setSpeed(0); + stop_video(); + Cleanup(); + //_exit(0); + exit(0); + } +#endif + int leds = 0; + int bright = 0; +#if HAVE_COOL_HARDWARE + if (can_shutdown) { + 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 && timer_minutes) + leds |= 0x80; + } + if (cs_get_revision() != 10) + bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; +#endif + if (timer_minutes || leds) + { + FILE *f = fopen("/tmp/.timer", "w"); + if (f) + { + fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60); + fprintf(f, "%ld\n", timer_minutes * 60); + fprintf(f, "%d\n", leds); + fprintf(f, "%d\n", bright); + fclose(f); + } + else + perror("fopen /tmp/.timer"); + } + + delete g_RCInput; + g_RCInput = NULL; + //fan speed + if (g_info.hw_caps->has_fan) + CFanControlNotifier::setSpeed(0); + //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); + delete CVFD::getInstance(); + delete SHTDCNT::getInstance(); + stop_video(); + + printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown); + Cleanup(); +#ifdef __sh__ + /* the sh4 gcc seems to dislike someting about openthreads... */ + _exit(can_shutdown); +#else + exit(can_shutdown); +#endif } void CNeutrinoApp::saveEpg(bool cvfd_mode) @@ -3996,7 +4014,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); //fan speed - if (g_info.has_fan) + if (g_info.hw_caps->has_fan) CFanControlNotifier::setSpeed(1); frameBuffer->setActive(false); @@ -4029,7 +4047,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } frameBuffer->setActive(true); //fan speed - if (g_info.has_fan) + if (g_info.hw_caps->has_fan) CFanControlNotifier::setSpeed(g_settings.fan_speed); puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); @@ -4168,13 +4186,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; } @@ -4846,6 +4864,10 @@ void CNeutrinoApp::Cleanup() delete g_Font[i]; g_Font[i] = NULL; } + for(unsigned int i=0; iParamList.empty()) - hh->Write("Neutrino HD\n"); + hh->Write(PACKAGE_NAME " " PACKAGE_VERSION "\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); else if (hh->ParamList["1"] == "version") // send version file hh->SendFile(TARGET_PREFIX "/.version"); - else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) + else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility) hh->Write("3"); else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version hh->printf("%s\n", HTTPD_VERSION); - else if (hh->ParamList["1"] == "hwinfo")// print hwinfo + else if (hh->ParamList["1"] == "hwinfo") // print hwinfo HWInfoCGI(hh); else hh->SendError(); @@ -808,14 +808,19 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { - std::string boxname = NeutrinoAPI->NeutrinoYParser->func_get_boxtype(hh, ""); - std::string boxmodel = NeutrinoAPI->NeutrinoYParser->func_get_boxmodel(hh, ""); - static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); - hh->printf("%s (%s)\nMAC:%s\n", boxname.c_str(), boxmodel.c_str(), eth_id.c_str()); + std::string boxvendor(g_info.hw_caps->boxvendor); + /* + I don't know the current legal situation. + So better let's change the vendor's name to CST. + */ + if (boxvendor.compare("Coolstream") == 0) + boxvendor = "CST"; + + hh->printf("%s %s (%s)\nMAC:%s\n", boxvendor.c_str(), g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str()); } //----------------------------------------------------------------------------- void CControlAPI::ShutdownCGI(CyhookHandler *hh) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 075d139e3..4b8f8ce7d 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -838,115 +838,26 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { -#if 0 - unsigned int system_rev = cs_get_revision(); - std::string boxname = "CST "; + std::string boxvendor(g_info.hw_caps->boxvendor); + /* + I don't know the current legal situation. + So better let's change the vendor's name to CST. -#if HAVE_TRIPLEDRAGON - boxname = "Armas "; -#endif + After change this, you'll have to align code in Y_Blocks.txt + */ + if (boxvendor.compare("Coolstream") == 0) + boxvendor = "CST"; - switch(system_rev) - { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; -#ifdef BOXMODEL_CS_HD1 - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - boxname += "Neo"; - if (CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; - break; - case 10: - boxname += "Zee"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxname += "Tank"; - break; - case 11: - boxname += "Trinity"; - if (cs_get_chip_type() != 33904 /*0x8470*/) - boxname += " V2"; - break; - case 12: - boxname += "Zee2"; - break; - case 13: - boxname += "Link"; - break; - case 14: - boxname += "Trinity Duo"; - break; -#endif - default: - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - break; - } -#else - std::string boxname = g_info.hw_caps->boxvendor; - if (boxname.compare("Coolstream") == 0) - boxname = "CST"; /* that's more or less an external API... */ - boxname += " " + std::string(g_info.hw_caps->boxname); - if (!strcmp(g_info.hw_caps->boxname, "Neo") && - CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; -#endif - return boxname; + std::string boxname(g_info.hw_caps->boxname); + + return boxvendor + " " + boxname; } //------------------------------------------------------------------------- // y-func : get boxmodel //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) { -#if 0 - unsigned int system_rev = cs_get_revision(); - std::string boxmodel = "Unknown"; - - switch(system_rev) - { -#ifdef BOXMODEL_CS_HD1 - case 6: - case 7: - case 8: - case 10: - boxmodel = "Nevis"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxmodel = "Apollo"; - break; - case 11: - if (cs_get_chip_type() == 33904 /*0x8470*/) - boxmodel = "Shiner"; - else - boxmodel = "Kronos"; - break; - case 12: - case 13: - case 14: - boxmodel = "Kronos"; - break; -#endif - default: - break; - } -#else - std::string boxmodel = std::string(g_info.hw_caps->boxarch); -#endif - return boxmodel; + return g_info.hw_caps->boxarch; } //------------------------------------------------------------------------- // y-func : get stream info diff --git a/src/system/locals.h b/src/system/locals.h index 8aa833059..ffa9f4f9b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2226,6 +2226,7 @@ typedef enum LOCALE_SATSETUP_UNCOMM_INPUT, LOCALE_SATSETUP_UNI_SETTINGS, LOCALE_SATSETUP_UNICABLE, + LOCALE_SATSETUP_UNICABLE2, LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_FTA_FLAG, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f1134b99e..41ca230ce 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2226,6 +2226,7 @@ const char * locale_real_names[] = "satsetup.uncomm_input", "satsetup.uni_settings", "satsetup.unicable", + "satsetup.unicable2", "satsetup.usals_repeat", "satsetup.use_bat", "satsetup.use_fta_flag", diff --git a/src/system/settings.h b/src/system/settings.h index 02daab6b8..bdcd3fc2a 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -923,10 +923,10 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN +#define DETAILSLINE_WIDTH 16 // TODO: scale2Res() ? + struct SglobalInfo { - unsigned char box_Type; - bool has_fan; hw_caps_t *hw_caps; }; 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 { diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index 1751450a2..aee92a37f 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -41,7 +41,8 @@ typedef enum { DISEQC_1_1, DISEQC_1_2, DISEQC_ADVANCED, - DISEQC_UNICABLE + DISEQC_UNICABLE, + DISEQC_UNICABLE2 #if 0 , DISEQC_2_0, DISEQC_2_1, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index ce8fbc389..987148734 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -167,6 +167,7 @@ class CFrontend void sendDiseqcReset(uint32_t ms = 40); void sendDiseqcSmatvRemoteTuningCommand(const uint32_t frequency); uint32_t sendEN50494TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank); + uint32_t sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank); void sendDiseqcZeroByteCommand(const uint8_t frm, const uint8_t addr, const uint8_t cmd, uint32_t ms = 15); void sendToneBurst(const fe_sec_mini_cmd_t burst, const uint32_t ms); int setFrontend(const FrontendParameters *feparams, bool nowait = false); diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index ad6db6b83..4d9c19205 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -381,7 +381,7 @@ void CFEManager::saveSettings(bool write) void CFEManager::copySettings(CFrontend * from, CFrontend * to) { INFO("Copy settings fe %d -> fe %d", from->fenumber, to->fenumber); - if (to->config.diseqcType != DISEQC_UNICABLE || to->getMode() == CFrontend::FE_MODE_LINK_LOOP) + if (to->config.diseqcType != DISEQC_UNICABLE || to->config.diseqcType != DISEQC_UNICABLE2 || to->getMode() == CFrontend::FE_MODE_LINK_LOOP) to->config.diseqcType = from->config.diseqcType; to->config.diseqcRepeats = from->config.diseqcRepeats; diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 58fd2d5ab..113f2e1e9 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1211,6 +1211,12 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p currentVoltage == SEC_VOLTAGE_18, !!config.uni_lnb); + if (config.diseqcType == DISEQC_UNICABLE2) + cmdseq.props[FREQUENCY].u.data = sendEN50607TuningCommand(feparams->frequency, + currentToneMode == SEC_TONE_ON, + currentVoltage == SEC_VOLTAGE_18, + config.uni_lnb); + cmdseq.num += nrOfProps; return true; @@ -1368,6 +1374,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) case DISEQC_UNICABLE: INFO("fe%d: DISEQC_UNICABLE", fenumber); break; + case DISEQC_UNICABLE2: + INFO("fe%d: DISEQC_UNICABLE2", fenumber); + break; #if 0 case DISEQC_2_0: INFO("DISEQC_2_0"); @@ -1384,7 +1393,7 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if (newDiseqcType == DISEQC_UNICABLE) { + if (newDiseqcType == DISEQC_UNICABLE || newDiseqcType == DISEQC_UNICABLE2) { secSetTone(SEC_TONE_OFF, 0); secSetVoltage(unicable_lowvolt, 0); } @@ -1495,7 +1504,7 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque config.uni_lnb = sit->second.diseqc; setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); - if (config.diseqcType == DISEQC_UNICABLE) + if (config.diseqcType == DISEQC_UNICABLE || config.diseqcType == DISEQC_UNICABLE2) return; if (config.diseqcType != DISEQC_ADVANCED) { @@ -1561,6 +1570,39 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int return ret; } +uint32_t CFrontend::sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank) +{ + uint32_t bpf = config.uni_qrg; + struct dvb_diseqc_master_cmd cmd = { {0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, 4 }; + + unsigned int t = frequency / 1000 - 100; + if (t < 0x800 && config.uni_scr >= 0 && config.uni_scr < 32) + { + uint32_t ret = bpf * 1000; + INFO("[unicable-JESS] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret); + if (!slave && info.type == FE_QPSK) + { + cmd.msg[1] = ((config.uni_scr & 0x1F) << 3) | /* user band adress ( 0 to 31) */ + /* max. possible tuning word = 0x7FF */ + ((t >> 8) & 0x07); /* highest 3 bits of t (MSB) */ + cmd.msg[2] = t & 0xFF; /* tuning word (LSB) */ + cmd.msg[3] = (0 << 4) | /* no uncommited switch */ + /* I really don't know if the combines of option and position bits are right here, + because I can'test it, assuming here 4 sat positions */ + ((bank & 0x03) << 2) | /* input 0/1/2/3 */ + (horizontal << 1) | /* horizontal == 0x02 */ + high_band; /* high_band == 0x01 */ + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18); + usleep(15 * 1000); /* en50494 says: >4ms and < 22 ms */ + sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); + } + return ret; + } + WARN("ooops. t > 2047? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); + return 0; +} + bool CFrontend::tuneChannel(CZapitChannel * /*channel*/, bool /*nvod*/) { transponder_list_t::iterator transponder = transponders.find(currentTransponder.getTransponderId()); @@ -1809,6 +1851,32 @@ void CFrontend::sendDiseqcStandby(uint32_t ms) if (config.diseqcType == DISEQC_UNICABLE) sendEN50494TuningCommand(0, 0, 0, 2); /* en50494 switches don't seem to be hurt by this */ + if (config.diseqcType > DISEQC_ADVANCED) + { + /* use ODU_Power_OFF command for unicable or jess here + to set the used UB frequency of the frontend to standby */ + struct dvb_diseqc_master_cmd cmd = {{0}, 6}; + printf("[fe%d] standby scr: %d\n", fenumber, config.uni_scr); + if (config.diseqcType == DISEQC_UNICABLE) + { + cmd.msg[0] = 0xe0; + cmd.msg[1] = 0x10; + cmd.msg[2] = 0x5a; + cmd.msg[3] = ((config.uni_scr & 0x07) << 5); + cmd.msg_len = 5; + } + if (config.diseqcType == DISEQC_UNICABLE2) + { + cmd.msg[0] = 0x70; + cmd.msg[1] = ((config.uni_scr & 0x1F) << 3); + cmd.msg_len = 4; + } + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18); + usleep(15 * 1000); + sendDiseqcCommand(&cmd, ms); + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); + return; + } // Send power off to 'all' equipment sendDiseqcZeroByteCommand(0xe0, 0x00, 0x02, ms); }