From d6c50635de6485042b617e928b93f101a82f1bca Mon Sep 17 00:00:00 2001 From: "[CST] Micha" Date: Tue, 31 Jul 2012 06:56:03 +0000 Subject: [PATCH 001/690] added CST laboratory cable headend as cable provider Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/28528a22764fde40e9a574f51a483f4360462b02 Author: [CST] Micha Date: 2012-07-31 (Tue, 31 Jul 2012) --- data/cables.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/cables.xml b/data/cables.xml index 3ef2d5188..05d8e39a2 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -1337,4 +1337,20 @@ + + + + + + + + + + + + + + + + From 9e2492ab2a4c348e844526de92780a0e48692e4f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 24 Jan 2016 21:28:37 +0100 Subject: [PATCH 002/690] plugins: fix movieplayer-plugin Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bbd88cd0510202534f69ee28cca633c7fc15be27 Author: vanhofen Date: 2016-01-24 (Sun, 24 Jan 2016) Origin message was: ------------------ - plugins: fix movieplayer-plugin --- src/gui/plugins.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 99466f548..7aebc77f9 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -350,11 +350,11 @@ PluginParam * CPlugins::makeParam(const char * const id, const int value, Plugin } #endif -void CPlugins::startPlugin_by_name(const std::string & filename) +void CPlugins::startPlugin_by_name(const std::string & name) { for (int i = 0; i < (int) plugin_list.size(); i++) { - if (!filename.compare(g_PluginList->getFileName(i))) + if (name.compare(g_PluginList->getName(i)) == 0) { startPlugin(i); return; From 88794c88736e9bdfcae6ea8ce4e21321255bc692 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 24 Jan 2016 21:29:31 +0100 Subject: [PATCH 003/690] plugins: startPlugin works with filename; just for clarity Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/55f0ab75af840be3e0459e9f63cd50cfad3df6e9 Author: vanhofen Date: 2016-01-24 (Sun, 24 Jan 2016) Origin message was: ------------------ - plugins: startPlugin works with filename; just for clarity --- src/gui/plugins.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 7aebc77f9..fd86c8e99 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -362,13 +362,13 @@ void CPlugins::startPlugin_by_name(const std::string & name) } } -void CPlugins::startPlugin(const char * const name) +void CPlugins::startPlugin(const char * const filename) { - int pluginnr = find_plugin(name); + int pluginnr = find_plugin(filename); if (pluginnr > -1) startPlugin(pluginnr); else - printf("[CPlugins] could not find %s\n", name); + printf("[CPlugins] could not find %s\n", filename); } From d886545b9fe9bca3fd1a2a528501a678a95eb951 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 08:04:35 +0100 Subject: [PATCH 004/690] vfd: allow to disable rc-lock message on vfd Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b56f4ed1492f8e33436069325db89a051596d72b Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) Origin message was: ------------------ - vfd: allow to disable rc-lock message on vfd --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/driver/vfd.cpp | 2 +- src/gui/vfd_setup.cpp | 4 ++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 2 ++ 8 files changed, 17 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index b1c7d40fd..debd59fac 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -859,6 +859,7 @@ lcdmenu.dim_brightness nach Dimm-Timeout lcdmenu.dim_time Dimm-Timeout lcdmenu.head VFD/LED Einstellungen lcdmenu.lcdcontroler Helligkeit +lcdmenu.notify_rclock Benachrichtigung bei FB-Sperre lcdmenu.scroll Laufschrift lcdmenu.statusline Statuszeile lcdmenu.statusline.both Lautstärke/Fortschritt @@ -1399,6 +1400,7 @@ menu.hint_vfd_brightnessstandby Definiert die Helligkeit im Standby-Modus menu.hint_vfd_defaults Zurücksetzen der Helligkeitswerte auf die Standardeinstellungen menu.hint_vfd_dimtime Geben Sie einen Wert in Sekunden ein, nachdem sich das Display automatisch auf den gewünschten Wert dimmt menu.hint_vfd_infoline Wählen Sie, was in der Infozeile angezeigt werden soll +menu.hint_vfd_notify_rclock Zeigt eine Meldung im Display, wenn bei gesperrter Fernbedienung eine Taste gedrückt wird menu.hint_vfd_scroll Laufschrift im Display ein- oder ausschalten menu.hint_vfd_statusline Wählen Sie, was in der Statuszeile angezeigt werden soll menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse und mehr diff --git a/data/locale/english.locale b/data/locale/english.locale index 68e9acdf9..96593f610 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -859,6 +859,7 @@ lcdmenu.dim_brightness Brightness after dim timeout lcdmenu.dim_time Dim timeout lcdmenu.head VFD/LED Settings lcdmenu.lcdcontroler Brightness +lcdmenu.notify_rclock Notify when RC is locked lcdmenu.scroll Enable text scroll lcdmenu.statusline status line lcdmenu.statusline.both volume / playtime @@ -1399,6 +1400,7 @@ menu.hint_vfd_brightnessstandby Brightness in soft-standby mode menu.hint_vfd_defaults Restore default brightness values menu.hint_vfd_dimtime Auto-dim time, in seconds menu.hint_vfd_infoline Choose what to display in main VFD line +menu.hint_vfd_notify_rclock Displays a notification when a key is pressed while remote control is locked menu.hint_vfd_scroll Enable or disable text scrolling on VFD menu.hint_vfd_statusline Choose what to display in short\nVFD status line menu.hint_video Video output, resolution, format\nAspect ratio, fast mode switch options diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index 0490201ae..7af3a18f0 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -406,7 +406,7 @@ void CVFD::showTime(bool force) void CVFD::showRCLock(int duration) { - if (!has_lcd) + if (!has_lcd || !g_settings.lcd_notify_rclock) { sleep(duration); return; diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index b5148232a..b4e3a053f 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -155,6 +155,10 @@ int CVfdSetup::showSetup() oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); vfds->addItem(oj); + + oj = new CMenuOptionChooser(LOCALE_LCDMENU_NOTIFY_RCLOCK, &g_settings.lcd_notify_rclock, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); + oj->setHint("", LOCALE_MENU_HINT_VFD_NOTIFY_RCLOCK); + vfds->addItem(oj); } int res = vfds->exec(NULL, ""); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1dd14710d..0671723b3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -434,6 +434,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.backlight_standby = configfile.getInt32( "backlight_standby", 0); g_settings.backlight_deepstandby = configfile.getInt32( "backlight_deepstandby", 0); g_settings.lcd_scroll = configfile.getInt32( "lcd_scroll", 1); + g_settings.lcd_notify_rclock = configfile.getInt32("lcd_notify_rclock", 1); g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120); @@ -984,6 +985,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "backlight_standby", g_settings.backlight_standby); configfile.setInt32( "backlight_deepstandby", g_settings.backlight_deepstandby); configfile.setInt32( "lcd_scroll", g_settings.lcd_scroll); + configfile.setInt32( "lcd_notify_rclock", g_settings.lcd_notify_rclock); //misc configfile.setInt32( "power_standby", g_settings.power_standby); diff --git a/src/system/locals.h b/src/system/locals.h index 5fe1c56e8..0bde8d6b9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -886,6 +886,7 @@ typedef enum LOCALE_LCDMENU_DIM_TIME, LOCALE_LCDMENU_HEAD, LOCALE_LCDMENU_LCDCONTROLER, + LOCALE_LCDMENU_NOTIFY_RCLOCK, LOCALE_LCDMENU_SCROLL, LOCALE_LCDMENU_STATUSLINE, LOCALE_LCDMENU_STATUSLINE_BOTH, @@ -1426,6 +1427,7 @@ typedef enum LOCALE_MENU_HINT_VFD_DEFAULTS, LOCALE_MENU_HINT_VFD_DIMTIME, LOCALE_MENU_HINT_VFD_INFOLINE, + LOCALE_MENU_HINT_VFD_NOTIFY_RCLOCK, LOCALE_MENU_HINT_VFD_SCROLL, LOCALE_MENU_HINT_VFD_STATUSLINE, LOCALE_MENU_HINT_VIDEO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 33ac965be..bc5c07f62 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -886,6 +886,7 @@ const char * locale_real_names[] = "lcdmenu.dim_time", "lcdmenu.head", "lcdmenu.lcdcontroler", + "lcdmenu.notify_rclock", "lcdmenu.scroll", "lcdmenu.statusline", "lcdmenu.statusline.both", @@ -1426,6 +1427,7 @@ const char * locale_real_names[] = "menu.hint_vfd_defaults", "menu.hint_vfd_dimtime", "menu.hint_vfd_infoline", + "menu.hint_vfd_notify_rclock", "menu.hint_vfd_scroll", "menu.hint_vfd_statusline", "menu.hint_video", diff --git a/src/system/settings.h b/src/system/settings.h index df64721d2..728ae275b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -684,6 +684,8 @@ struct SNeutrinoSettings int backlight_standby; int backlight_deepstandby; int lcd_scroll; + int lcd_notify_rclock; + //#define FILESYSTEM_ENCODING_TO_UTF8(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define FILESYSTEM_ENCODING_TO_UTF8(a) (isUTF8(a) ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define UTF8_TO_FILESYSTEM_ENCODING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::UTF8_to_Latin1(a).c_str()) From 4587a18d9153286269d0d11881e46c2a24f614ad Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Jan 2016 13:17:56 +0100 Subject: [PATCH 005/690] infoviewer: change show_Data() semantics slightly the "calledFromEvent" parameter was only used to force display of "no EPG available". It was set to true when calling from an "zap complete" or "epg event received" event, which is good, but also when calling from the display update timer, which is "strange". Now setting this parameter to false forces the update of the current event (if available) which is done from display update timer. This fixes the update of the remaining time display with constantly displayed infobar (radio mode). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9a6f9ea7869974ff3f58eb4ce819a70049af7f44 Author: Stefan Seyfried Date: 2016-01-23 (Sat, 23 Jan 2016) --- src/gui/infoviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6ebcd0298..ac27fe96c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1352,7 +1352,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) snprintf(runningRest, sizeof(runningRest), "%d / %d %s", (curr_pos + 30000) / 60000, (duration - curr_pos + 30000) / 60000, unit_short_minute); display_Info(NULL, NULL, false, CMoviePlayerGui::getInstance().file_prozent, NULL, runningRest); } else if (!IS_WEBTV(current_channel_id)) { - show_Data( true ); + show_Data(false); } } showLcdPercentOver (); @@ -1812,7 +1812,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { - if (info_CurrentNext.current_uniqueKey != last_curr_id) + if (!calledFromEvent || info_CurrentNext.current_uniqueKey != last_curr_id) { last_curr_id = info_CurrentNext.current_uniqueKey; curr_time = runningStart; From e07988e7bd3ecbc17d9ba26d0365037fdadc9d44 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 12:00:47 +0100 Subject: [PATCH 006/690] infoviewer: show plugin name, when movieplayer-plugin is selected Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0b74f601db3d79e0cd6cf853a30a78cdbbe0823e Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) Origin message was: ------------------ - infoviewer: show plugin name, when movieplayer-plugin is selected --- src/gui/infoviewer_bb.cpp | 8 ++++---- src/gui/keybind_setup.cpp | 7 +++++-- src/gui/keybind_setup.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index f91408b3b..4f906866f 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -222,7 +222,7 @@ void CInfoViewerBB::getBBButtonInfo() frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active); + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -237,7 +237,7 @@ void CInfoViewerBB::getBBButtonInfo() frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active); + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -252,7 +252,7 @@ void CInfoViewerBB::getBBButtonInfo() frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active); + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -267,7 +267,7 @@ void CInfoViewerBB::getBBButtonInfo() frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active); + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 59b8f18a6..dd6db5654 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -569,7 +569,7 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d return false; } -const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bool &active) +const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bool &active, bool return_title) { active = false; for (unsigned int i = MPKEY_REWIND; i <= MPKEY_PLUGIN; i++) @@ -577,7 +577,10 @@ const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bo if ((uint32_t)*key_settings[i].keyvalue_p == (unsigned int)key) { active = true; - return g_Locale->getText(key_settings[i].keydescription); + if (!return_title && (key_settings[i].keydescription == LOCALE_MPKEY_PLUGIN)) + return g_settings.movieplayer_plugin.c_str(); + else + return g_Locale->getText(key_settings[i].keydescription); } } return ""; diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index a43067ead..894b45bc1 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -112,7 +112,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver ~CKeybindSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); bool changeNotify(const neutrino_locale_t OptionName, void * data); - static const char *getMoviePlayerButtonName(const neutrino_msg_t key, bool &active); + static const char *getMoviePlayerButtonName(const neutrino_msg_t key, bool &active, bool return_title = false); }; #endif From 9d4ed047dd3e4b5df9f8d0e865dff668f07cd379 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 13:03:51 +0100 Subject: [PATCH 007/690] Revert "- infoviewer_bb: use getMoviePlayerButtonName in mode_webtv too" This reverts commit a6ac956894c1eab383e48accde28e91fb715cf9e because mode_webtv == (something like) live tv. So the movieplayer button names shouldn't be displayed. Conflicts: src/gui/infoviewer_bb.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2786c1386722ba7201edbc134c563dba322c6a48 Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) --- src/gui/infoviewer_bb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 4f906866f..f681ff58c 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -221,7 +221,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -236,7 +236,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -251,7 +251,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -266,7 +266,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; From 2fa4974acbd8da0c9885d7b5ee5ffcd4ad4c5457 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 13:28:25 +0100 Subject: [PATCH 008/690] infoviewer: supplement to 9d4ed047dd3e4b5df9f8d0e865dff668f07cd379 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/766276df9fb5f1f892ec04213cbf2b9569d3943f Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) Origin message was: ------------------ - infoviewer: supplement to 9d4ed047dd3e4b5df9f8d0e865dff668f07cd379 --- src/gui/infoviewer_bb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index f681ff58c..6b98c16f4 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -280,7 +280,7 @@ void CInfoViewerBB::getBBButtonInfo() break; } //label audio control button in movieplayer/upnp mode - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) + if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { if (!CMoviePlayerGui::getInstance().timeshift) { From 5748c6f9636258649b0261d59a06e97c4ed35a6d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 25 Jan 2016 18:13:11 +0300 Subject: [PATCH 009/690] gui/movieplayer.cpp: pass subtitles charset to playback instance Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/85c437fac3f2a8bf2e73ba06e8958d0aedbd81bb Author: [CST] Focus Date: 2016-01-25 (Mon, 25 Jan 2016) --- lib/libcoolstream/playback_cs.h | 2 +- lib/libcoolstream2/playback_cs.h | 2 +- src/gui/movieplayer.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index 399ef152a..8be1ba391 100644 --- a/lib/libcoolstream/playback_cs.h +++ b/lib/libcoolstream/playback_cs.h @@ -66,7 +66,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/lib/libcoolstream2/playback_cs.h b/lib/libcoolstream2/playback_cs.h index e89fc576c..8480ed0aa 100644 --- a/lib/libcoolstream2/playback_cs.h +++ b/lib/libcoolstream2/playback_cs.h @@ -67,7 +67,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index a438bc3d2..8eb848940 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1858,7 +1858,7 @@ void CMoviePlayerGui::selectSubtitle() if (!numsubs) playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage); - CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, true, NULL, CRCInput::RC_red, NULL, true); + CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, currentspid == -1, NULL, CRCInput::RC_red, NULL, true); sc->addOption("UTF-8"); sc->addOption("UCS-2"); sc->addOption("CP1250"); @@ -1886,7 +1886,7 @@ void CMoviePlayerGui::selectSubtitle() APIDSelector.addItem(item); } sprintf(cnt, "%d", count); - APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); + APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, currentspid != -1, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); APIDSelector.exec(NULL, ""); delete selector; @@ -1895,12 +1895,12 @@ void CMoviePlayerGui::selectSubtitle() currentspid = spids[select]; /* external subtitles pid is 0x1FFF */ ext_subs = (currentspid == 0x1FFF); - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } else if (select > 0) { ext_subs = false; currentspid = -1; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } } @@ -2127,7 +2127,7 @@ void CMoviePlayerGui::selectAutoLang() for (unsigned count = 0; count < numsubs; count++) { if (spids[count] == 0x1FFF) { currentspid = spids[count]; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); } } } From 4d114992c8a9c083e42669c4069558cd1f2dc851 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 22:40:58 +0100 Subject: [PATCH 010/690] neutrino: allow to change to mode_ts before playback starts Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f1f9a1041cbee31c5c7edbfe26da445048a4c73b Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) Origin message was: ------------------ - neutrino: allow to change to mode_ts before playback starts --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0671723b3..d3cf456ff 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3263,7 +3263,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) lastMode=mode; mode=mode_pic; } - if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { + if((data & mode_mask)== mode_ts) { if(mode == mode_radio) frameBuffer->stopFrame(); lastMode=mode; From e8d717f763e11123b4cdfac18a81e8c0cc52dfd7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 22:43:27 +0100 Subject: [PATCH 011/690] neutrino/upnpbrowser: add and use new mode_upnp; ... ... switch to correct mode before start playing audio/video/pic Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c2a3a9853c222dbebee7fed1abf16de2c3354ed Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) Origin message was: ------------------ - neutrino/upnpbrowser: add and use new mode_upnp; ... ... switch to correct mode before start playing audio/video/pic --- src/gui/upnpbrowser.cpp | 16 ++++++++++++++-- src/neutrino.h | 1 + src/neutrinoMessages.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index dd18cee43..32912b418 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -92,8 +92,8 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ CNeutrinoApp::getInstance()->stopPlayBack(true); m_frameBuffer->showFrame("mp3.jpg"); - // tell neutrino we're in audio mode - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio); + // tell neutrino we're in upnp mode + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_upnp); // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); @@ -1230,12 +1230,18 @@ printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); void CUpnpBrowserGui::playAudio(std::string name, int type) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio); + CAudiofile mp3(name, (CFile::FileType) type); CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } void CUpnpBrowserGui::showPicture(std::string name) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_pic); + g_PicViewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); g_PicViewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); @@ -1246,14 +1252,20 @@ void CUpnpBrowserGui::showPicture(std::string name) g_PicViewer->ShowImage(name, false); g_PicViewer->Cleanup(); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } void CUpnpBrowserGui::playVideo(std::string name, std::string url) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) CAudioPlayer::getInstance()->stop(); m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } diff --git a/src/neutrino.h b/src/neutrino.h index f2c1fc5c2..7dbbc84d0 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -151,6 +151,7 @@ public: mode_ts = 7, mode_off = 8, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 }; diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 65519c02f..4049ead7e 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -177,6 +177,7 @@ struct NeutrinoMessages { mode_pic = 6, mode_ts = 7, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 }; From 5449a843bfc3d2106721d7953e254eca6adbc741 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Jan 2016 22:45:18 +0100 Subject: [PATCH 012/690] Revert "- infoviewer_bb: use getMoviePlayerButtonName in mode_audio too;" This reverts ugly commit 709277bb24ce639fc23a28f78c51837125aac82a Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61e457c0a6f40e5ffde0f2a1ea79e4804e35ca48 Author: vanhofen Date: 2016-01-25 (Mon, 25 Jan 2016) --- src/gui/infoviewer_bb.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 6b98c16f4..2d1fef675 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -221,7 +221,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -236,7 +236,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -251,7 +251,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -266,7 +266,7 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) { + if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; @@ -279,8 +279,8 @@ void CInfoViewerBB::getBBButtonInfo() default: break; } - //label audio control button in movieplayer/upnp mode - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_audio) + //label audio control button in movieplayer mode + if (mode == NeutrinoMessages::mode_ts) { if (!CMoviePlayerGui::getInstance().timeshift) { From c4459dfedbe03559d5008f6c1055d7753dbfac1a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 26 Jan 2016 00:57:08 +0100 Subject: [PATCH 013/690] infoviewer: fix audio description in mode_webtv Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/32c28038a36021febff59c520a0ed6de484fe687 Author: vanhofen Date: 2016-01-26 (Tue, 26 Jan 2016) Origin message was: ------------------ - infoviewer: fix audio description in mode_webtv --- src/gui/infoviewer_bb.cpp | 11 +++-------- src/gui/user_menue.cpp | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 2d1fef675..e95d645cc 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -280,15 +280,10 @@ void CInfoViewerBB::getBBButtonInfo() break; } //label audio control button in movieplayer mode - if (mode == NeutrinoMessages::mode_ts) + if (mode == NeutrinoMessages::mode_ts && !CMoviePlayerGui::getInstance().timeshift) { - if (!CMoviePlayerGui::getInstance().timeshift) - { - if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) - { - text = CMoviePlayerGui::getInstance(mode == NeutrinoMessages::mode_webtv).CurrentAudioName(); - } - } + if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) + text = CMoviePlayerGui::getInstance(false).CurrentAudioName(); // use instance_mp } bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(text) + w + 10; bbButtonInfo[i].cx = w + 5; diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f156051d6..661c5e5d1 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -487,6 +487,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu neutrino_locale_t loc = NONEXISTANT_LOCALE; const char *text = NULL; + int mode = CNeutrinoApp::getInstance()->getMode(); std::vector items = ::split(g_settings.usermenu[button]->items, ','); for (std::vector::iterator it = items.begin(); it != items.end(); ++it) { @@ -537,7 +538,9 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu continue; case SNeutrinoSettings::ITEM_AUDIO_SELECT: if(loc == NONEXISTANT_LOCALE && !text) { - if (!g_RemoteControl->current_PIDs.APIDs.empty()) + if (mode == NeutrinoMessages::mode_webtv) + text = CMoviePlayerGui::getInstance(true).CurrentAudioName().c_str(); // use instance_bg + else if (!g_RemoteControl->current_PIDs.APIDs.empty()) text = g_RemoteControl->current_PIDs.APIDs[ g_RemoteControl->current_PIDs.PIDs.selected_apid].desc; } else From b49195d6fc9ce69246006dcb1f89f10c33918732 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:15 +0100 Subject: [PATCH 014/690] framebuffer: use hardware accel for blitBox2FB() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1bd0f814bc5056f1744d30850628a7877c6e3c6b Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/driver/framebuffer.cpp | 57 +++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 66d4b8a21..f9178625c 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -545,11 +545,13 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign } stride = _fix.line_length; - printf("FB: %dx%dx%d line length %d. %s nevis GXA accelerator.\n", xRes, yRes, bpp, stride, -#ifdef USE_NEVIS_GXA - "Using" + printf("FB: %dx%dx%d line length %d. %s accelerator.\n", xRes, yRes, bpp, stride, +#if defined(USE_NEVIS_GXA) + "Using nevis GXA" +#elif defined(FB_HW_ACCELERATION) + "Using fb hw graphics" #else - "Not using" + "Not using graphics" #endif ); @@ -1917,6 +1919,7 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 ioctl(fd, FBIO_IMAGE_BLT, &image); } #endif + //printf("\033[34m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION (image) x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); return; } @@ -1972,16 +1975,51 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff) { - checkFbArea(xoff, yoff, width, height, true); + uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; + uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; + checkFbArea(xoff, yoff, xc, yc, true); + +#if defined(FB_HW_ACCELERATION) + if (!(width%4)) { + fb_image image; + image.dx = xoff; + image.dy = yoff; + image.width = xc; + image.height = yc; + image.cmap.len = 0; + image.depth = 32; + image.data = (const char*)boxBuf; + ioctl(fd, FBIO_IMAGE_BLT, &image); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + checkFbArea(xoff, yoff, xc, yc, false); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#elif defined(USE_NEVIS_GXA) + void* uKva = cs_phys_addr((void*)boxBuf); + if(uKva != NULL) { + OpenThreads::ScopedLock m_lock(mutex); + u32 cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3); + _write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width); + _write_gxa(gxa_base, GXA_BMP1_ADDR_REG, (unsigned int) uKva); + _write_gxa(gxa_base, cmd, GXA_POINT(xoff, yoff)); + _write_gxa(gxa_base, cmd, GXA_POINT(xc, yc)); + _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + checkFbArea(xoff, yoff, xc, yc, false); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#endif uint32_t swidth = stride / sizeof(fb_pixel_t); fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * yoff); fb_pixel_t* data = (fb_pixel_t*)boxBuf; uint32_t line = 0; - while (line < height) { - fb_pixel_t *pixpos = &data[line * width]; - for (uint32_t pos = xoff; pos < xoff + width; pos++) { + while (line < yc) { + fb_pixel_t *pixpos = &data[line * xc]; + for (uint32_t pos = xoff; pos < xoff + xc; pos++) { //don't paint backgroundcolor (*pixpos = 0x00000000) if (*pixpos) *(fbp + pos) = *pixpos; @@ -1990,8 +2028,7 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t fbp += swidth; line++; } - - checkFbArea(xoff, yoff, width, height, false); + checkFbArea(xoff, yoff, xc, yc, false); } void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, int x_pan, int y_pan, int x_offs, int y_offs, bool clearfb, int transp) From 3f8b67f627a609617eaed7767f40c6f08054a7c6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:25 +0100 Subject: [PATCH 015/690] helpers.cpp: Add function SetWith4FB_HW_ACC() align for hw blit on apollo/kronos hw Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c23f339d3a9762244b6768ebcac7c64a8ba782a Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) Origin message was: ------------------ helpers.cpp: Add function SetWith4FB_HW_ACC() align for hw blit on apollo/kronos hw --- src/system/helpers.cpp | 20 ++++++++++++++++++++ src/system/helpers.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index bae705934..de76cb728 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -854,6 +854,26 @@ bool split_config_string(const std::string &str, std::mapgetScreenWidth(true); + if ((_x + ret) >= xRes) + ret = xRes-_x-1; + if (ret%4 == 0) + return ret; + + int add = (max) ? 3 : 0; + ret = ((ret + add) / 4) * 4; + if ((_x + ret) >= xRes) + ret -= 4; + + return ret; +} + std::vector split(const std::string &s, char delim) { std::vector vec; diff --git a/src/system/helpers.h b/src/system/helpers.h index 205a4f30a..b6da33508 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -95,6 +95,8 @@ class CFileHelpers static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());}; }; +uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); + std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); From b4a84c445eecf9b412134ef8f23e591d90ac2f08 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:29 +0100 Subject: [PATCH 016/690] CFrameBuffer::paintBoxRel2Buf(): Align buffer at 4 byte boundary... ...for hw blit on apollo/kronos hardware Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/95f11ce7af381773ab28f14ae4c04ce1ee815785 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/driver/framebuffer.cpp | 59 +++++++++++++++++++++++----------- src/driver/framebuffer.h | 4 ++- src/gui/components/cc_draw.cpp | 2 +- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index f9178625c..62341d355 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -671,7 +672,7 @@ void CFrameBuffer::paintHLineRelInternal2Buf(const int& x, const int& dx, const *(dest++) = col; } -fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) +fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) { if (!getActive()) return buf; @@ -682,13 +683,13 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p fb_pixel_t* pixBuf = buf; if (pixBuf == NULL) { - pixBuf = (fb_pixel_t*) cs_malloc_uncached(dx*dy*sizeof(fb_pixel_t)); + pixBuf = (fb_pixel_t*) cs_malloc_uncached(w_align*dy*sizeof(fb_pixel_t)); if (pixBuf == NULL) { dprintf(DEBUG_NORMAL, "[%s #%d] Error cs_malloc_uncached\n", __func__, __LINE__); return NULL; } } - memset((void*)pixBuf, '\0', dx*dy*sizeof(fb_pixel_t)); + memset((void*)pixBuf, '\0', w_align*dy*sizeof(fb_pixel_t)); if (type && radius) { setCornerFlags(type); @@ -709,16 +710,16 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p line++; continue; } - paintHLineRelInternal2Buf(ofl, dx-ofl-ofr, line, dx, col, pixBuf); + paintHLineRelInternal2Buf(ofl+offs_align, dx-ofl-ofr, line, w_align, col, pixBuf); line++; } } else { fb_pixel_t *bp = pixBuf; int line = 0; while (line < dy) { - for (int pos = 0; pos < dx; pos++) + for (int pos = offs_align; pos < dx+offs_align; pos++) *(bp + pos) = col; - bp += dx; + bp += w_align; line++; } } @@ -729,42 +730,64 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { -#define MASK 0xFFFFFFFF + fb_pixel_t MASK = 0xFFFFFFFF; + int _dx = dx; + int w_align; + int offs_align; - fb_pixel_t* boxBuf = paintBoxRel2Buf(dx, dy, MASK, NULL, radius, type); - if (!boxBuf) - return NULL; +#ifdef BOXMODEL_APOLLO + if (_dx%4 != 0) { + w_align = GetWidth4FB_HW_ACC(x, _dx, true); + if (w_align < _dx) + _dx = w_align; + offs_align = w_align - _dx; + if ((x - offs_align) < 0) + offs_align = 0; + } + else { + w_align = _dx; + offs_align = 0; + } +#else + w_align = _dx; + offs_align = 0; +#endif + fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; + gradientData->x = x - offs_align; + gradientData->dx = w_align; if (gradientData->direction == gradientVertical) { // vertical - for (int pos = 0; pos < dx; pos++) { + for (int pos = offs_align; pos < _dx+offs_align; pos++) { for(int count = 0; count < dy; count++) { if (*(bp + pos) == MASK) *(bp + pos) = (fb_pixel_t)(*(gra + count)); - bp += dx; + bp += w_align; } bp = boxBuf; } } else { // horizontal for (int line = 0; line < dy; line++) { - for (int pos = 0; pos < dx; pos++) { - if (*(bp + pos) == MASK) - *(bp + pos) = (fb_pixel_t)(*(gra + pos)); + int gra_pos = 0; + for (int pos = 0; pos < w_align; pos++) { + if ((*(bp + pos) == MASK) && (pos >= offs_align) && (gra_pos < _dx)) { + *(bp + pos) = (fb_pixel_t)(*(gra + gra_pos)); + gra_pos++; + } } - bp += dx; + bp += w_align; } } if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) return boxBuf; -// blit2FB(boxBuf, dx, dy, x, y); - blitBox2FB(boxBuf, dx, dy, x, y); + blitBox2FB(boxBuf, w_align, dy, x-offs_align, y); if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) return boxBuf; diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 79c70450f..6ee46df62 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -46,6 +46,8 @@ typedef struct gradientData_t fb_pixel_t* boxBuf; bool direction; int mode; + int x; + int dx; } gradientData_struct_t; #define CORNER_NONE 0x0 @@ -206,7 +208,7 @@ class CFrameBuffer : public sigc::trackable }; void paintPixel(int x, int y, const fb_pixel_t col); - fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); + fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); fb_pixel_t* paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, gradientData_t *gradientData, int radius = 0, int type = CORNER_ALL); void paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0b2a4456e..41b2c1802 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -598,7 +598,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); }else{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.dx, fbdata.dy, fbdata.x, fbdata.y); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); } }else{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); From 1db2e302416456c3209ead4d5b4553d0f1d3e4ed Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:32 +0100 Subject: [PATCH 017/690] CComponentsPicture: Align pictures at 4 byte boundary... ...for hw blit on apollo/kronos hardware Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/346b28556f579763a241255124d69f73a8111235 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_item_picture.cpp | 5 +++++ src/gui/moviebrowser.cpp | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c5ede3520..b6e0d1b82 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -33,6 +33,7 @@ #include "cc_item_picture.h" #include #include +#include extern CPictureViewer * g_PicViewer; @@ -196,6 +197,10 @@ void CComponentsPicture::initCCItem() if (keep_dx_aspect){ float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); +#ifdef BOXMODEL_APOLLO + if (do_scale && (width > 10 || height > 10)) + width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; +#endif } if (keep_dy_aspect){ float w_ratio = float(width)*100/(float)dx; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 29b4667bc..5b38a3af5 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1347,10 +1347,6 @@ void CMovieBrowser::refreshMovieInfo(void) if (logo_ok) { flogo_w = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); flogo_h = m_cBoxFrameInfo.iHeight; -#ifdef BOXMODEL_APOLLO - /* align for hw blit */ - flogo_w = ((flogo_w + 3) / 4) * 4; -#endif } static int logo_w = 0; From 32e2150f7578a876ee45ba70dbe16fb7178cad78 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:35 +0100 Subject: [PATCH 018/690] CCDraw: Add function for cleanup gradient background Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf0f63467d280d8b753086e2228a48de1c50f618 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_draw.cpp | 6 ++++-- src/gui/components/cc_draw.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 41b2c1802..1140fbcd5 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,6 +71,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; + gradientBgCleanUp = false; + v_fbdata.clear(); } @@ -591,6 +593,8 @@ void CCDraw::paintFbItems(bool do_save_bg) } // if found empty gradient buffer, create it, otherwise paint from cache + if (gradientBgCleanUp) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); if (fbdata.gradient_data->boxBuf == NULL){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); @@ -616,8 +620,6 @@ void CCDraw::paintFbItems(bool do_save_bg) OnAfterPaintLayers(); } - - void CCDraw::hide() { //restore saved screen background of item if available diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 152a6359b..f1d3d4092 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -142,6 +142,8 @@ class CCDraw : public COSDFader, public CComponentsSignals ///sub: get gradient data evaluted with current parameters gradientData_t* getGradientData(); + bool gradientBgCleanUp; + ///rendering of framebuffer elements at once, ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), ///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide() @@ -315,6 +317,9 @@ class CCDraw : public COSDFader, public CComponentsSignals ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + + virtual void enableGradientBgCleanUp(bool enable = true) { gradientBgCleanUp = enable; }; + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; }; #endif From c1d88da12d82dc0c17f4cc26c419574918b09066 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 26 Jan 2016 06:16:39 +0100 Subject: [PATCH 019/690] CCDraw: use ccdraw namespace Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/063ccbb6226b4a15c9f212daaea3ddb6b7531a64 Author: Thilo Graf Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_draw.cpp | 4 ++-- src/gui/components/cc_draw.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 1140fbcd5..8a9903510 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,7 +71,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; - gradientBgCleanUp = false; + cc_gradient_bg_cleanup = false; v_fbdata.clear(); } @@ -593,7 +593,7 @@ void CCDraw::paintFbItems(bool do_save_bg) } // if found empty gradient buffer, create it, otherwise paint from cache - if (gradientBgCleanUp) + if (cc_gradient_bg_cleanup) frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); if (fbdata.gradient_data->boxBuf == NULL){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index f1d3d4092..d1381c591 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -142,7 +142,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///sub: get gradient data evaluted with current parameters gradientData_t* getGradientData(); - bool gradientBgCleanUp; + bool cc_gradient_bg_cleanup; ///rendering of framebuffer elements at once, ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), @@ -318,7 +318,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); - virtual void enableGradientBgCleanUp(bool enable = true) { gradientBgCleanUp = enable; }; + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; }; From ffa73a3241b563456dfb54c55ed1ead4b90b45e9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:42 +0100 Subject: [PATCH 020/690] CMenuWidget: Enable cleanup gradient background for menu hints... ... and for menu headers when save screen is enabled Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ef9246d89214e6831adb65557d605589f61c864a Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/widget/menue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c27be79e9..16e4c5818 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1240,6 +1240,7 @@ void CMenuWidget::paint() header->setColorShadow(COL_MENUCONTENTDARK_PLUS_0); header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); + header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow @@ -1477,6 +1478,7 @@ void CMenuWidget::paintHint(int pos) info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color + info_box->enableGradientBgCleanUp(); //paint result if (details_line) From c0c76986583c66d36ae8aa88fb3f420442619d9a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 26 Jan 2016 14:11:33 +0100 Subject: [PATCH 021/690] jsoncpp.cpp: re-apply gcc version compil fix Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a72274efbbb8e9d4eb8704ff68505acb96f9b36 Author: Jacek Jendrzej Date: 2016-01-26 (Tue, 26 Jan 2016) --- lib/jsoncpp/jsoncpp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/jsoncpp/jsoncpp.cpp b/lib/jsoncpp/jsoncpp.cpp index be5a16b3b..5c2825a2e 100644 --- a/lib/jsoncpp/jsoncpp.cpp +++ b/lib/jsoncpp/jsoncpp.cpp @@ -219,7 +219,11 @@ static int stackDepth_g = 0; // see readValue() namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr CharReaderPtr; +#else typedef std::auto_ptr CharReaderPtr; +#endif // Implementation of class Features // //////////////////////////////// @@ -3761,7 +3765,11 @@ Value& Path::make(Value& root) const { namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr StreamWriterPtr; +#else typedef std::auto_ptr StreamWriterPtr; +#endif static bool containsControlCharacter(const char* str) { while (*str) { From 11d20c5d6c7191a5bfd738f9ba9f89d457921f8d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:08:59 +0100 Subject: [PATCH 022/690] CCDraw: add member to remove shadow only Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f521e32981f516a51d9934216bbb6765a5496b1b Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/components/cc_draw.cpp | 32 +++++++++++++++++++++------- src/gui/components/cc_draw.h | 39 +++++++++++++++++++++++++++++++--- src/gui/components/cc_types.h | 12 +++++------ 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 8a9903510..b744caaff 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -536,16 +536,19 @@ void CCDraw::paintFbItems(bool do_save_bg) */ if (cc_enable_frame){ if (fbtype == CC_FBDATA_TYPE_FRAME) { - if (fbdata.frame_thickness > 0 && cc_allow_paint) + if (fbdata.frame_thickness > 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); + v_fbdata[i].is_painted = true; + } } } if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BACKGROUND){ frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy); + v_fbdata[i].is_painted = true; } } - if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && (!is_painted || shadow_force)) { + if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force)) { if (fbdata.enabled) { /* here we paint the shadow around the body * on 1st step we check for already cached screen buffer, if true @@ -562,6 +565,7 @@ void CCDraw::paintFbItems(bool do_save_bg) //if is paint cache enabled if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; } } } @@ -611,7 +615,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } - is_painted = true; + is_painted = v_fbdata[i].is_painted = true; } } } @@ -629,6 +633,7 @@ void CCDraw::hide() //restore screen from backround layer frameBuffer->waitForIdle("CCDraw::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); + v_fbdata[i].is_painted = false; } } } @@ -637,9 +642,10 @@ void CCDraw::hide() } //erase or paint over rendered objects -void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) +void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/) { for(size_t i =0; i< v_fbdata.size() ;i++){ + if (fblayer_type == CC_FBDATA_TYPES || v_fbdata[i].fbdata_type & fblayer_type){ #if 0 if (bg_color != COL_BACKGROUND_PLUS_0) #endif @@ -662,15 +668,23 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) bg_color, r, corner_type); - + v_fbdata[i].is_painted = false; #if 0 else frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); #endif + } } - firstPaint = true; - is_painted = false; + if (fblayer_type == CC_FBDATA_TYPE_BOX){ + firstPaint = true; + is_painted = false; + } +} + +void CCDraw::killShadow(const fb_pixel_t& bg_color, const int& corner_radius) +{ + kill(bg_color, corner_radius, CC_FBDATA_TYPE_SHADOW_BOX); } bool CCDraw::doPaintBg(bool do_paint) @@ -685,8 +699,10 @@ bool CCDraw::doPaintBg(bool do_paint) void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) { - if (shadow != mode) + if (shadow != mode){ + killShadow(); shadow = mode; + } if (shadow != CC_SHADOW_OFF) if (shadow_width != -1) setShadowWidth(shadow_width); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index d1381c591..50036fd8b 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -314,9 +314,42 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void hide(); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + * @todo + * Shadow paint must be reworked, because dimensions of shadow containes not the real defined size. Parts of item are killed too. + * + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); + + /**Erase shadow around rendered item. + * This is similar with the kill() member, but shadow will be handled only. + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * + * @see + * kill() + */ + 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); }; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index cb135fe6a..549bf2c30 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -90,13 +90,13 @@ typedef struct cc_fbdata_t //fb data object layer types typedef enum { - CC_FBDATA_TYPE_BGSCREEN, - CC_FBDATA_TYPE_BOX, - CC_FBDATA_TYPE_SHADOW_BOX, - CC_FBDATA_TYPE_FRAME, - CC_FBDATA_TYPE_BACKGROUND, + CC_FBDATA_TYPE_BGSCREEN = 1, + CC_FBDATA_TYPE_BOX = 2, + CC_FBDATA_TYPE_SHADOW_BOX = 4, + CC_FBDATA_TYPE_FRAME = 8, + CC_FBDATA_TYPE_BACKGROUND = 16, - CC_FBDATA_TYPES + CC_FBDATA_TYPES = 32 }FBDATA_TYPES; //fb color gradient types From 45bab5a66daa6d656e0d56e0c39434dd0e79bd97 Mon Sep 17 00:00:00 2001 From: defans Date: Sun, 24 Jan 2016 16:13:55 +0100 Subject: [PATCH 023/690] CInfoViewer: reset zapmode if not in default mode Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/12c3a15c10081362861916a63edfcc4e0aa38289 Author: defans Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/infoviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ac27fe96c..3a179b140 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -665,6 +665,9 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { + if(!calledFromNumZap && zap_mode != IV_MODE_DEFAULT) + resetSwitchMode(); + std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); t_channel_id new_channel_id = channel->getChannelID(); From 674e1f34c50657db0513d07ba9b2338c45a36f83 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:16:49 +0100 Subject: [PATCH 024/690] CComponentsItem: reset paint mode after cleanup Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/107c3234b2ff2094996d5d0baf35a8b2d95ff23f Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/components/cc_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 4f9b242c4..0f8b32963 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -65,8 +65,10 @@ void CComponentsItem::initParent(CComponentsForm* parent) // If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this! void CComponentsItem::paintInit(bool do_save_bg) { - if (hasChanges()) + if (hasChanges()){ clearFbData(); + is_painted = false; //force repaint if required + } if (v_fbdata.empty()){ int th = fr_thickness; From f71b4084e9cb31a147d2c4568424be0fc6af7665 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:17:48 +0100 Subject: [PATCH 025/690] CInfoViewer: remove shadow offset from init, items works with its own values Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/da0b86709852a911f99dd71d7a470cfe2ac359be Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/infoviewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 3a179b140..2840846bb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -429,7 +429,7 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { - int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); @@ -1984,9 +1984,11 @@ void CInfoViewer::killTitle() { is_visible = false; infoViewerBB->is_visible = false; +#if 0 //unused int bottom = BoxEndY + SHADOW_OFFSET + infoViewerBB->bottom_bar_offset; if (showButtonBar) bottom += infoViewerBB->InfoHeightY_Info; +#endif if (infoViewerBB->getFooter()) infoViewerBB->getFooter()->kill(); if (infoViewerBB->getCABar()) From 2e73c3be8c7f88d9d6ba63a75305306c0b8cf8a8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 23 Jan 2016 18:32:18 +0100 Subject: [PATCH 026/690] CInfoViewer: unified vars for body position Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b23e3c15c3703bb8ccfd377270c2b37a37129726 Author: Thilo Graf Date: 2016-01-23 (Sat, 23 Jan 2016) --- src/gui/infoviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 2840846bb..4e79c8c30 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -430,14 +430,15 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int y_body = ChanNameY + header_height; if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if (body == NULL) - body = new CComponentsShapeSquare(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); else - body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); From 4e4167008d22c42757e8e9f7747ce44d3c42ea07 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 23 Jan 2016 22:34:08 +0100 Subject: [PATCH 027/690] CInfoViewer: try to fix shadow and background behavior in vzap mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4cded5afb65af521699d0507046caa22a143825a Author: Thilo Graf Date: 2016-01-23 (Sat, 23 Jan 2016) --- src/gui/infoviewer.cpp | 49 +++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 4e79c8c30..bb8b5d28d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -435,10 +435,21 @@ void CInfoViewer::paintBody() if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - if (body == NULL) + if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); - else + }else{ + if(txt_cur_event && txt_next_event){ + if (h_body != body->getHeight() || y_body != body->getYPos()){ + txt_cur_start->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event_rest->getCTextBoxObject()->clearScreenBuffer(); + txt_next_start->getCTextBoxObject()->clearScreenBuffer(); + txt_next_event->getCTextBoxObject()->clearScreenBuffer(); + txt_next_in->getCTextBoxObject()->clearScreenBuffer(); + } + } body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); + } //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); @@ -1636,27 +1647,33 @@ void CInfoViewer::display_Info(const char *current, const char *next, bool colored_event_C = (g_settings.theme.colored_events_infobar == 1); bool colored_event_N = (g_settings.theme.colored_events_infobar == 2); + bool restore = false; + if (txt_cur_event){ + if (txt_cur_event_rest && txt_cur_event_rest->isPainted() && txt_cur_event && txt_cur_event->isPainted()) + restore = true; + } + //current event if (current && update_current){ if (txt_cur_event == NULL) txt_cur_event = new CComponentsTextTransp(NULL, xStart, CurrInfoY - height, currTimeX - xStart - 5, height); else txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height); + txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - - if (txt_cur_event_rest && txt_cur_event_rest->isPainted()) - txt_cur_event_rest->hide(); - if (txt_cur_event && txt_cur_event->isPainted()) + if (restore) txt_cur_event->hide(); - txt_cur_event->paint(CC_SAVE_SCREEN_YES); + if (runningStart){ if (txt_cur_start == NULL) txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height); else txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height); txt_cur_start->setText(runningStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_cur_start->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_cur_event->hide(); + txt_cur_start->paint(CC_SAVE_SCREEN_YES); } if (runningRest){ @@ -1665,6 +1682,8 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height); txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); + if (restore) + txt_cur_event_rest->hide(); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); } } @@ -1677,7 +1696,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height); txt_next_event->setText(next, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_event->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_event->hide(); + txt_next_event->paint(CC_SAVE_SCREEN_YES); if (nextStart){ if (txt_next_start == NULL) @@ -1685,7 +1706,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height); txt_next_start->setText(nextStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_start->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_start->hide(); + txt_next_start->paint(CC_SAVE_SCREEN_YES); } if (nextDuration){ @@ -1694,7 +1717,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height); txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_in->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_in->hide(); + txt_next_in->paint(CC_SAVE_SCREEN_YES); } } @@ -2011,11 +2036,11 @@ void CInfoViewer::killTitle() clock->kill(); #endif body->kill(); +#if 0 //not really required to kill epg infos, body does this if (txt_cur_event) txt_cur_event->kill(); if (txt_cur_event_rest) txt_cur_event_rest->kill(); -#if 0 //not really required to kill epg infos, body does this if (txt_cur_start) txt_cur_start->kill(); if (txt_next_start) From 5c87e0646a31575aff1ec70308dabe99e354c47f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 25 Jan 2016 15:53:26 +0100 Subject: [PATCH 028/690] CMenuWidget: try to fix possible overlength of details line Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a338357fcca6a9a4e7b788976786a6f84abe58d Author: Jacek Jendrzej Date: 2016-01-25 (Mon, 25 Jan 2016) --- src/gui/widget/menue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 16e4c5818..40c4141c9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -812,6 +812,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (titem->isSelectable()) { items[selected]->paint( false ); selected= i; + if (selected > page_start[current_page + 1] || selected < page_start[current_page]) { + /* different page */ + paintItems(); + } paintHint(selected); pos = selected; if (titem->directKeyOK) From 3d0eca59b699b2b355b8b1d79b5f97e1bba01f50 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 13:29:00 +0100 Subject: [PATCH 029/690] Fix ghost text in infoviewer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8dd426d7140d6daa1d06457f852bf7074dfe8993 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/infoviewer.cpp | 2 ++ src/gui/infoviewer_bb.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index bb8b5d28d..e4f1ca1d8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -422,6 +422,7 @@ void CInfoViewer::paintHead() header->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); header->enableColBodyGradient(g_settings.theme.infobar_gradient_top, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_top_direction); clock->setColorBody(header->getColorBody()); + header->enableGradientBgCleanUp(); header->paint(CC_SAVE_SCREEN_NO); header_height = header->getHeight(); @@ -457,6 +458,7 @@ void CInfoViewer::paintBody() body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); + body->enableGradientBgCleanUp(); body->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index e95d645cc..16dccc572 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -496,6 +496,7 @@ void CInfoViewerBB::paintFoot(int w) foot->setColorBody(COL_INFOBAR_BUTTONS_BACKGROUND); foot->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_bottom_direction); foot->setCorner(RADIUS_LARGE, CORNER_BOTTOM); + foot->enableGradientBgCleanUp(); foot->paint(CC_SAVE_SCREEN_NO); } From 97693201cb4ec9506e076de29da9d8291acf4e40 Mon Sep 17 00:00:00 2001 From: defans Date: Wed, 27 Jan 2016 00:13:17 +0100 Subject: [PATCH 030/690] infoviewer: simplify body height calculation Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fcd8352daf026fe27f2968e7e5b03641d707ae6a Author: defans Date: 2016-01-27 (Wed, 27 Jan 2016) Origin message was: ------------------ - infoviewer: simplify body height calculation --- src/gui/infoviewer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e4f1ca1d8..26bd0dd1c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -430,11 +430,11 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { - int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - int y_body = ChanNameY + header_height; + int h_body = InfoHeightY - header_height - SHADOW_OFFSET; + if (!zap_mode) + h_body += infoViewerBB->bottom_bar_offset; - if(zap_mode) - h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int y_body = ChanNameY + header_height; if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); From 581164437616dd3cd37f5b01d7489180cd6d25d2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 27 Jan 2016 10:04:19 +0100 Subject: [PATCH 031/690] Fix osd error on nevis Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87e6f328dd429fd09b13bb236951cab1758c350d Author: Michael Liebmann Date: 2016-01-27 (Wed, 27 Jan 2016) --- src/driver/framebuffer.cpp | 1 + src/gui/infoviewer_bb.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 62341d355..dba43f397 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -2030,6 +2030,7 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t _write_gxa(gxa_base, cmd, GXA_POINT(xc, yc)); _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + add_gxa_sync_marker(); checkFbArea(xoff, yoff, xc, yc, false); return; } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 16dccc572..3673ca78e 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -407,6 +407,8 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) frameBuffer->SaveScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); paintFoot(); if (pixbuf != NULL) { + if (g_settings.theme.infobar_gradient_bottom) + frameBuffer->waitForIdle("CInfoViewerBB::showBBButtons"); frameBuffer->RestoreScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); delete [] pixbuf; } From 953724caa2d70854be7616a8437ed7badd53cfbf Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 27 Jan 2016 14:59:07 +0100 Subject: [PATCH 032/690] Fix ghost text in channellist & epg view Complement to commit 3d0eca5 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d85bb1d09b4d1437b2883ab20e4bc8bbbf6d933d Author: Michael Liebmann Date: 2016-01-27 (Wed, 27 Jan 2016) Origin message was: ------------------ Fix ghost text in channellist & epg view Complement to commit 3d0eca5 --- src/gui/channellist.cpp | 1 + src/gui/epgplus.cpp | 1 + src/gui/epgview.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 17655dc91..b61ee8883 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2066,6 +2066,7 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); + header->enableGradientBgCleanUp(); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bf91e3088..b6ba031e5 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -127,6 +127,7 @@ void EpgPlus::Header::paint(const char * Name) std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); + header.enableGradientBgCleanUp(); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 97deca924..dd901dc87 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -646,6 +646,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } + header->enableGradientBgCleanUp(); std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); From cd6a46b7e0905c744aa43b5617074ebb0a34a671 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 28 Jan 2016 01:47:45 +0100 Subject: [PATCH 033/690] CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86278623a6e9c5a99b5720c5a5c5189fa55989d9 Author: Michael Liebmann Date: 2016-01-28 (Thu, 28 Jan 2016) Origin message was: ------------------ CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL --- src/driver/framebuffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index dba43f397..d5a6a6ad3 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -730,6 +730,9 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { + if (!getActive()) + return NULL; + fb_pixel_t MASK = 0xFFFFFFFF; int _dx = dx; int w_align; @@ -754,6 +757,8 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #endif fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); + if (boxBuf == NULL) + return NULL; fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; From 1099d0f0f234c93e734bfd73feea72fcd9069ce0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 28 Jan 2016 09:42:51 +0100 Subject: [PATCH 034/690] neutrino: fix lastMode when switching to mode_upnp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/93413dad3e54bbb6b785fbc23db6a383f80e7b55 Author: vanhofen Date: 2016-01-28 (Thu, 28 Jan 2016) Origin message was: ------------------ - neutrino: fix lastMode when switching to mode_upnp --- src/neutrino.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d3cf456ff..9e3308fa9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3255,6 +3255,10 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if(mode != mode_standby) standbyMode( true ); } + if((data & mode_mask)== mode_upnp) { + lastMode=mode; + mode=mode_upnp; + } if((data & mode_mask)== mode_audio) { lastMode=mode; mode=mode_audio; From d9f2427b3c7e3ccc9643c46695b3aff5880aa49a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 28 Jan 2016 09:50:52 +0100 Subject: [PATCH 035/690] neutrino: initialize lastMode; just for safety Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bb11139eb4247c0d96e0529ddc43652d4fdce850 Author: vanhofen Date: 2016-01-28 (Thu, 28 Jan 2016) Origin message was: ------------------ - neutrino: initialize lastMode; just for safety --- src/neutrino.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9e3308fa9..16c069594 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -224,6 +224,7 @@ CNeutrinoApp::CNeutrinoApp() SetupFrameBuffer(); mode = mode_unknown; + lastMode = mode_unknown; channelList = NULL; TVchannelList = NULL; RADIOchannelList = NULL; @@ -1748,6 +1749,7 @@ void CNeutrinoApp::InitZapper() int tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; lastChannelMode = tvmode ? g_settings.channel_mode : g_settings.channel_mode_radio; mode = tvmode ? mode_tv : mode_radio; + lastMode = mode; SDTreloadChannels = false; channelsInit(); From a61acf48fa6a0a893635a10ee9f08f475ea7eedf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 29 Jan 2016 11:35:37 +0100 Subject: [PATCH 036/690] yWeb: fix typo in german language file Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf2056af329df7d75c4e7972d85329331e2f881d Author: vanhofen Date: 2016-01-29 (Fri, 29 Jan 2016) Origin message was: ------------------ - yWeb: fix typo in german language file --- src/nhttpd/web/languages/Deutsch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 8f5cf6c27..716ff9a4d 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -74,7 +74,7 @@ main.info=Info main.info_desc=Information über das yWeb, Version main.live_tv_desc=LiveTV main.live_tv_popup_desc=LiveTV Popup -main.remote_full_desc=Fernbedinung & OSD Vollbild +main.remote_full_desc=Fernbedienung & OSD Vollbild main.stream_to_vlc_client_desc=Live TV direkt im VLC Client main.version=Version @@ -85,7 +85,7 @@ bc.menue.control_desc=Box Funktionen (Neustart, Aufnahmemodus, ...) bc.menue.control=Steuerung bc.menue.messages_desc=Nachricht an die Box senden bc.menue.messages=Nachrichten -bc.menue.remote_desc=Fernbedinung +bc.menue.remote_desc=Fernbedienung bc.menue.remote=Fernbedienung bc.menue.lcd_screenshot_desc=LCD Screenshot erstellen bc.menue.lcd_screenshot=LCD Screenshot From 0d5a318aacca6caad2e57c7db92cec2bdf075535 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 29 Jan 2016 12:27:02 +0100 Subject: [PATCH 037/690] yparser: remove useless halfhearted script-check Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/799fe4b78a8b83f20dfd3ff86413ecc142944027 Author: vanhofen Date: 2016-01-29 (Fri, 29 Jan 2016) Origin message was: ------------------ - yparser: remove useless halfhearted script-check --- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index fb42c643d..b75231fc7 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -528,10 +528,14 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { } else yresult = "ycgi-type unknown"; } else if (!hh->ParamList[ycmd].empty()) { +#if 0 if ((hh->ParamList[ycmd]).find("script") == std::string::npos) yresult = hh->ParamList[ycmd]; else yresult = ""; +#else + yresult = hh->ParamList[ycmd]; +#endif } return yresult; From f7997cb6dc0b746eb0078c2335aa8cd048cac5a9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 29 Jan 2016 14:40:59 +0300 Subject: [PATCH 038/690] gui/dboxinfo.cpp: try to fix missing s/n digits, fix x position Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c79689116528687cd31cccd0877fe862b4ba30b8 Author: [CST] Focus Date: 2016-01-29 (Fri, 29 Jan 2016) --- src/gui/dboxinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index becaa68aa..5de8a1250 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -324,7 +324,6 @@ void CDBoxInfoWidget::paint() nameWidth += diff; } height = h_max(height, 0); - x = getScreenStartX(width); y = getScreenStartY(height); // fprintf(stderr, "CDBoxInfoWidget::CDBoxInfoWidget() x = %d, y = %d, width = %d height = %d\n", x, y, width, height); @@ -358,7 +357,8 @@ void CDBoxInfoWidget::paint() sprintf(ss, "%016llx", cs_get_serial()); title += ", S/N "; title += ss; - width = max(width, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(title, true)); + width = max(width, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(title, true) + 50); + x = getScreenStartX(width); CComponentsHeader header(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL); header.paint(CC_SAVE_SCREEN_NO); From 22567ef3fc36fa09cb8b791aa0823215c9c74610 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jan 2016 14:49:24 +0100 Subject: [PATCH 039/690] use fstream in copyfile function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b320878b93d5399c915271405dc15fbef89ecfc2 Author: Jacek Jendrzej Date: 2016-01-29 (Fri, 29 Jan 2016) --- src/zapit/include/zapit/getservices.h | 2 +- src/zapit/src/getservices.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 2aa4616c2..780b525c0 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -107,7 +107,7 @@ class CServiceManager ~CServiceManager(); static CServiceManager * getInstance(); - static void CopyFile(char * from, char * to); + static void CopyFile(const char * from, const char * to); bool InitSatPosition(t_satellite_position position, const char * name = NULL, bool force = false, delivery_system_t delsys = DVB_S, uint16_t nid = 0); bool LoadServices(bool only_current); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 3918082a9..0c7052283 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //#define SAVE_DEBUG @@ -968,13 +969,18 @@ do_current: return true; } -void CServiceManager::CopyFile(char * from, char * to) +void CServiceManager::CopyFile(const char * from, const char * to) { - char cmd[256] = "cp -f "; - strcat(cmd, from); - strcat(cmd, " "); - strcat(cmd, to); - system(cmd); + std::ifstream in(from, std::ios::in | std::ios::binary); + if(in.good()){ + std::ofstream out(to, std::ios::out | std::ios::binary); + if(out.good()){ + out << in.rdbuf(); + out.close(); + } + in.close(); + remove(from); + } sync(); } From eab76812a3c3e5a00e0499d0d76a65dc7ffc46a9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 14 Jan 2016 20:26:35 +0100 Subject: [PATCH 040/690] CInfoViewer: use gradient settings for infobar text box too Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2207019bfd81ea5598d118167de72cce8ad2c7b2 Author: Thilo Graf Date: 2016-01-14 (Thu, 14 Jan 2016) --- src/gui/infoviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 26bd0dd1c..ae4e3792d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1998,6 +1998,7 @@ void CInfoViewer::showInfoFile() infobar_txt->setTextColor(COL_INFOBAR_TEXT); infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); infobar_txt->doPaintTextBoxBg(false); + infobar_txt->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : header->getColorBody(), g_settings.theme.infobar_gradient_top_direction); //paint info, don't save background, if already painted, global hide is also done by killTitle() bool save_bg = !infobar_txt->isPainted(); From a8154e53d6316e02ccf9758cf272b0d7a6b65198 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 28 Jan 2016 21:02:52 +0100 Subject: [PATCH 041/690] CComponentsItem: add missing parameter to kill() member Was not passed to parent methode. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/65de6dee9f4b448db4c428412973d34889bf1106 Author: Thilo Graf Date: 2016-01-28 (Thu, 28 Jan 2016) --- src/gui/components/cc_item.cpp | 8 ++++---- src/gui/components/cc_item.h | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 0f8b32963..2f36f262c 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -127,15 +127,15 @@ void CComponentsItem::paintInit(bool do_save_bg) } //erase or paint over rendered objects -void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) +void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const int& fblayer_type) { if(cc_parent == NULL){ - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); }else{ if(ignore_parent) - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); else - CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); + CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius(), fblayer_type); } } diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index a3a713429..30fbf0442 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -79,10 +79,26 @@ class CComponentsItem : public CComponents ///set or unset focus of item, stand alone items without parent have always set focus to true, inside of a parent form object, always the last added item has focus virtual void setFocus(bool focus); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) - ///NOTE: Items with parent binding use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] ignore_parent optional, default = false, defines the behavior inside a form, if item is embedded current background color is used instead blank screen + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = CC_FBDATA_TYPES); ///get the current item type, see attribute cc_item_type above virtual int getItemType(); From 9e138f678ea3749e948043ef5ab557e71ac2d048 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 28 Jan 2016 21:12:46 +0100 Subject: [PATCH 042/690] CCDraw: try to fix is_painted property after used kill() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be1f555e3724c322eef7dca5b3e593312811578c Author: Thilo Graf Date: 2016-01-28 (Thu, 28 Jan 2016) --- src/gui/components/cc_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index b744caaff..2e6d85fdd 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -676,7 +676,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in } } - if (fblayer_type == CC_FBDATA_TYPE_BOX){ + if (fblayer_type == CC_FBDATA_TYPES){ firstPaint = true; is_painted = false; } From ec4980f2a000321ca6bad32ae551936d40a527aa Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 29 Jan 2016 10:13:52 +0100 Subject: [PATCH 043/690] CCDraw: Set cc_gradient_bg_cleanup to true Except menu headers: Disable cleanup when save screen is disabled Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c72fe94bce069ddda0655d5365ae221ecb79717 Author: Michael Liebmann Date: 2016-01-29 (Fri, 29 Jan 2016) Origin message was: ------------------ CCDraw: Set cc_gradient_bg_cleanup to true Except menu headers: Disable cleanup when save screen is disabled --- src/gui/channellist.cpp | 1 - src/gui/components/cc_draw.cpp | 2 +- src/gui/epgplus.cpp | 1 - src/gui/epgview.cpp | 1 - src/gui/infoviewer.cpp | 2 -- src/gui/infoviewer_bb.cpp | 1 - src/gui/widget/menue.cpp | 1 - 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index b61ee8883..17655dc91 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2066,7 +2066,6 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); - header->enableGradientBgCleanUp(); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 2e6d85fdd..c81b0c6eb 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,7 +71,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; - cc_gradient_bg_cleanup = false; + cc_gradient_bg_cleanup = true; v_fbdata.clear(); } diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b6ba031e5..bf91e3088 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -127,7 +127,6 @@ void EpgPlus::Header::paint(const char * Name) std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); - header.enableGradientBgCleanUp(); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index dd901dc87..97deca924 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -646,7 +646,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } - header->enableGradientBgCleanUp(); std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ae4e3792d..db49ed63f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -422,7 +422,6 @@ void CInfoViewer::paintHead() header->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); header->enableColBodyGradient(g_settings.theme.infobar_gradient_top, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_top_direction); clock->setColorBody(header->getColorBody()); - header->enableGradientBgCleanUp(); header->paint(CC_SAVE_SCREEN_NO); header_height = header->getHeight(); @@ -458,7 +457,6 @@ void CInfoViewer::paintBody() body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); - body->enableGradientBgCleanUp(); body->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 3673ca78e..37bddb429 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -498,7 +498,6 @@ void CInfoViewerBB::paintFoot(int w) foot->setColorBody(COL_INFOBAR_BUTTONS_BACKGROUND); foot->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_bottom_direction); foot->setCorner(RADIUS_LARGE, CORNER_BOTTOM); - foot->enableGradientBgCleanUp(); foot->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 40c4141c9..8a021fc9a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1482,7 +1482,6 @@ void CMenuWidget::paintHint(int pos) info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color - info_box->enableGradientBgCleanUp(); //paint result if (details_line) From 5a0737fe4bb523505dae79b9936e87a08d194ba0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 29 Jan 2016 15:15:48 +0100 Subject: [PATCH 044/690] CInfoViewer::show_Data: Avoid overwriting button text Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/73ec7e9671c1938a970904b8a7abf375572d6310 Author: Michael Liebmann Date: 2016-01-29 (Fri, 29 Jan 2016) --- src/gui/infoviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index db49ed63f..b43ef64be 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1813,7 +1813,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) frameBuffer->paintBackgroundBoxRel (BoxEndX - 108, posy, 112, height2); } #endif - infoViewerBB->showBBButtons(); + infoViewerBB->showBBButtons(calledFromEvent); } if ((info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast) || From 8d3bdd773d30bfb1fecbd0584dabb75f888256d2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jan 2016 16:00:42 +0100 Subject: [PATCH 045/690] suplement to use fstream in copyfile function fix Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d3a1159d9fd6d143aecc7b70e1a56cd6c40ff4a2 Author: Jacek Jendrzej Date: 2016-01-29 (Fri, 29 Jan 2016) --- src/zapit/src/getservices.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 0c7052283..f09709b80 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -979,7 +979,6 @@ void CServiceManager::CopyFile(const char * from, const char * to) out.close(); } in.close(); - remove(from); } sync(); } From f34f40ab0b8cb2aebb596e8221429070ccae80a4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 30 Jan 2016 17:39:23 +0100 Subject: [PATCH 046/690] CInfoViewer: reduce flicker effects for infobar text Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/162938b3a3c5258cc299e22b8bc53ce523c7893f Author: Thilo Graf Date: 2016-01-30 (Sat, 30 Jan 2016) --- src/gui/infoviewer.cpp | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index b43ef64be..008b0466d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1945,8 +1945,8 @@ void CInfoViewer::killInfobarText() if (infobar_txt->isPainted()) infobar_txt->kill(); delete infobar_txt; + infobar_txt = NULL; } - infobar_txt = NULL; } @@ -1975,12 +1975,22 @@ void CInfoViewer::showInfoFile() const int height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 2; //create info object - if (infobar_txt == NULL) + if (infobar_txt == NULL){ infobar_txt = new CComponentsInfoBox(); + //set some properties for info object + infobar_txt->setCorner(RADIUS_SMALL); + infobar_txt->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET/2); + infobar_txt->setTextColor(COL_INFOBAR_TEXT); + infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); + infobar_txt->doPaintTextBoxBg(false); + infobar_txt->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : header->getColorBody(), g_settings.theme.infobar_gradient_top_direction); + } //get text from file and set it to info object, exit and delete object if failed - bool new_text = infobar_txt->setTextFromFile(infobar_file, CTextBox::CENTER, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]); - if (!new_text){ + string old_txt = infobar_txt->getText(); + string new_txt = infobar_txt->getTextFromFile(infobar_file); + bool has_text = infobar_txt->setText(new_txt, CTextBox::CENTER, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]); + if (new_txt.empty()){ killInfobarText(); return; } @@ -1989,20 +1999,14 @@ void CInfoViewer::showInfoFile() if (infobar_txt->getWidth() != width) infobar_txt->kill(); - //set some properties for info object + //consider possible size change infobar_txt->setDimensionsAll(xStart, yStart, width, height); - infobar_txt->setCorner(RADIUS_SMALL); - infobar_txt->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET/2); - infobar_txt->setTextColor(COL_INFOBAR_TEXT); - infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); - infobar_txt->doPaintTextBoxBg(false); - infobar_txt->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : header->getColorBody(), g_settings.theme.infobar_gradient_top_direction); - - //paint info, don't save background, if already painted, global hide is also done by killTitle() - bool save_bg = !infobar_txt->isPainted(); - if (new_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)) - infobar_txt->paint(save_bg); + //paint info if not painted or text has changed + if (has_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)){ + if ((old_txt != new_txt) || !infobar_txt->isPainted()) + infobar_txt->paint(CC_SAVE_SCREEN_NO); + } } void CInfoViewer::killTitle() @@ -2024,9 +2028,12 @@ void CInfoViewer::killTitle() rec->kill(); //printf("killTitle(%d, %d, %d, %d)\n", BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET-BoxStartX, bottom-BoxStartY); //frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET, bottom); - if (infobar_txt) - infobar_txt->kill(); - numbox->kill(); + if (zap_mode != IV_MODE_VIRTUAL_ZAP){ + if (infobar_txt) + infobar_txt->kill(); + numbox->kill(); + } + #if 0 //not really required to kill sigbox, numbox does this if (sigbox) sigbox->kill(); @@ -2058,7 +2065,6 @@ void CInfoViewer::killTitle() g_Radiotext->S_RtOsd = g_Radiotext->haveRadiotext() ? 1 : 0; killRadiotext(); } - killInfobarText(); } showButtonBar = false; InfoClock->getInstance()->enableInfoClock(); From 320f29e3c4129e82d7358bbade8ab182cc55ae05 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 30 Jan 2016 22:25:21 +0100 Subject: [PATCH 047/690] Fix freeze neutrino at mute icon and gradient header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/edb54071630418ef1fda3547ff20fbb8230f19ee Author: Michael Liebmann Date: 2016-01-30 (Sat, 30 Jan 2016) --- src/driver/framebuffer.cpp | 20 ++++++++++++-------- src/gui/components/cc_draw.cpp | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index d5a6a6ad3..b6fbc4d59 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -733,6 +733,8 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co if (!getActive()) return NULL; + checkFbArea(x, y, dx, dy, true); + fb_pixel_t MASK = 0xFFFFFFFF; int _dx = dx; int w_align; @@ -757,8 +759,10 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #endif fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); - if (boxBuf == NULL) + if (boxBuf == NULL) { + checkFbArea(x, y, dx, dy, false); return NULL; + } fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; @@ -789,16 +793,21 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co } } - if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) + if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) { + checkFbArea(x, y, dx, dy, false); return boxBuf; + } blitBox2FB(boxBuf, w_align, dy, x-offs_align, y); - if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) + if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) { + checkFbArea(x, y, dx, dy, false); return boxBuf; + } cs_free_uncached(boxBuf); + checkFbArea(x, y, dx, dy, false); return NULL; } @@ -2006,8 +2015,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; - checkFbArea(xoff, yoff, xc, yc, true); - #if defined(FB_HW_ACCELERATION) if (!(width%4)) { fb_image image; @@ -2020,7 +2027,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t image.data = (const char*)boxBuf; ioctl(fd, FBIO_IMAGE_BLT, &image); //printf("\033[33m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); - checkFbArea(xoff, yoff, xc, yc, false); return; } printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); @@ -2036,7 +2042,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); add_gxa_sync_marker(); - checkFbArea(xoff, yoff, xc, yc, false); return; } printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); @@ -2057,7 +2062,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t fbp += swidth; line++; } - checkFbArea(xoff, yoff, xc, yc, false); } void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, int x_pan, int y_pan, int x_offs, int y_offs, bool clearfb, int transp) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index c81b0c6eb..309fd2419 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -606,7 +606,9 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); }else{ 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{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); From 422f8c16d97c4fbabc06691d60dc58409b361660 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 1 Feb 2016 16:42:28 +0300 Subject: [PATCH 048/690] src/gui/movieplayer.cpp: fix play loop, if play stopped using end bookmark in multi-file mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a73ba4a6535905630c608db608234b7e1bf32d0 Author: [CST] Focus Date: 2016-02-01 (Mon, 01 Feb 2016) --- src/gui/movieplayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 8eb848940..3b88cd4d1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -954,6 +954,9 @@ void CMoviePlayerGui::PlayFileLoop(void) eof = 0; } handleMovieBrowser(0, position); + if (playstate == CMoviePlayerGui::STOPPED) + at_eof = true; + FileTime.update(position, duration); } showSubtitle(0); From a39b19ffbcf97c24b04fd10583057840054038b5 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 1 Feb 2016 16:47:21 +0300 Subject: [PATCH 049/690] gui/infoviewer.cpp: fix crash if one of objects missed, forward all keys to movieplayer in file play mode, excluding only screenshot, OK, home Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1ec5af21f7647e5204dcb582a89dd4e1e3fc5e7d Author: [CST] Focus Date: 2016-02-01 (Mon, 01 Feb 2016) --- src/gui/infoviewer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 008b0466d..4fadfbbd5 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -437,8 +437,9 @@ void CInfoViewer::paintBody() if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); - }else{ - if(txt_cur_event && txt_next_event){ + } else { + if (txt_cur_event && txt_cur_start && txt_cur_event_rest && + txt_next_event && txt_next_start && txt_next_in) { if (h_body != body->getHeight() || y_body != body->getYPos()){ txt_cur_start->getCTextBoxObject()->clearScreenBuffer(); txt_cur_event->getCTextBoxObject()->clearScreenBuffer(); @@ -964,10 +965,6 @@ void CInfoViewer::loop(bool show_dot) infoViewerBB->showIcon_16_9(); //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); - } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - setSwitchMode(IV_MODE_VIRTUAL_ZAP); - res = messages_return::cancel_all; - hideIt = true; } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && (CMoviePlayerGui::getInstance().timeshift) && (CRecordManager::getInstance()->GetRecordCount() == 1)) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); @@ -1008,7 +1005,7 @@ void CInfoViewer::loop(bool show_dot) /* this debug message will only hit in movieplayer mode, where console is * spammed to death anyway... */ - printf("%s:%d msg:%08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); + printf("%s:%d msg->MP: %08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); if (msg < CRCInput::RC_Events) /* RC / Keyboard event */ { g_RCInput->postMsg (msg, data); @@ -1017,6 +1014,10 @@ void CInfoViewer::loop(bool show_dot) else res = CNeutrinoApp::getInstance()->handleMsg(msg, data); + } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { + setSwitchMode(IV_MODE_VIRTUAL_ZAP); + res = messages_return::cancel_all; + hideIt = true; } #if 0 else if (CMoviePlayerGui::getInstance().start_timeshift && (msg == NeutrinoMessages::EVT_TIMER)) { From d37dec99dcd61759b352acb088a92c4926166b84 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 1 Feb 2016 16:53:17 +0100 Subject: [PATCH 050/690] moviebrowser: allow to show detailed infos about bookmarks Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/48261501a7c895ec519133913877f78b95bbfbad Author: vanhofen Date: 2016-02-01 (Mon, 01 Feb 2016) Origin message was: ------------------ - moviebrowser: allow to show detailed infos about bookmarks --- data/locale/deutsch.locale | 2 +- src/gui/moviebrowser.cpp | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index debd59fac..dddb197b9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1700,7 +1700,7 @@ moviebrowser.serie_auto_create Serien automatisch zuordnen moviebrowser.serie_head Serie moviebrowser.serie_name Name ändern moviebrowser.short_audio Audio -moviebrowser.short_book Markierung +moviebrowser.short_book Mark. moviebrowser.short_channel Kanal moviebrowser.short_country Land moviebrowser.short_filename Name diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 5b38a3af5..d33ed4305 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -179,7 +179,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_INFO2 25 #define MB_ROW_WIDTH_PARENTAL_LOCKAGE 4 #define MB_ROW_WIDTH_CHANNEL 15 -#define MB_ROW_WIDTH_BOOKMARK 4 +#define MB_ROW_WIDTH_BOOKMARK 6 #define MB_ROW_WIDTH_QUALITY 10 #define MB_ROW_WIDTH_PREVPLAYDATE 12 #define MB_ROW_WIDTH_RECORDDATE 12 @@ -3280,6 +3280,9 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite int i=0; int counter=0; + std::string b; + bool s, e, u; + switch(item) { case MB_INFO_FILENAME: // = 0, @@ -3321,13 +3324,41 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = movie_info.epgChannel; break; case MB_INFO_BOOKMARK: // = 10, + b = ""; + + s = false; + if (movie_info.bookmarks.start != 0) + { + s = true; + b += "S"; + } + + e = false; + if (movie_info.bookmarks.end != 0) + { + e = true; + if (s) + b += ","; + b += "E"; + } + // we just return the number of bookmarks for (i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { if (movie_info.bookmarks.user[i].pos != 0) counter++; } - *item_string = to_string(counter);; + u = (counter > 0); + if (u) + { + if (s || e) + b += ","; + b += "U["; + b += to_string(counter); + b += "]"; + } + + *item_string = b; break; case MB_INFO_QUALITY: // = 11, snprintf(str_tmp, sizeof(str_tmp),"%d",movie_info.quality); From f2ea1468a8bee4a2e288f43a5f53a0b89d04927e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 1 Feb 2016 21:24:54 +0100 Subject: [PATCH 051/690] infoviewer: move VZAP-code to right place Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/32d3c2e467cf404cbae982e5ec32dde44272bcab Author: vanhofen Date: 2016-02-01 (Mon, 01 Feb 2016) Origin message was: ------------------ - infoviewer: move VZAP-code to right place --- src/gui/infoviewer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 4fadfbbd5..091c50cf1 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -986,6 +986,10 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; + } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { + setSwitchMode(IV_MODE_VIRTUAL_ZAP); + res = messages_return::cancel_all; + hideIt = true; } else if (msg == NeutrinoMessages::EVT_TIMESET) { /* handle timeset event in upper layer, ignore here */ res = neutrino->handleMsg (msg, data); @@ -1013,11 +1017,6 @@ void CInfoViewer::loop(bool show_dot) } else res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - - } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - setSwitchMode(IV_MODE_VIRTUAL_ZAP); - res = messages_return::cancel_all; - hideIt = true; } #if 0 else if (CMoviePlayerGui::getInstance().start_timeshift && (msg == NeutrinoMessages::EVT_TIMER)) { From 874ebd10ede0197323d665791b916709e8eb7adc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Feb 2016 16:27:07 +0100 Subject: [PATCH 052/690] movieplayer: add virtual zap mode for moviebrowser playlists This commit fixes virtual zap for timeshift mode too. TODO: virtual zap for fileplayer playlists Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb2967ca8bc27be2428801c3153a822d5406bfec Author: vanhofen Date: 2016-02-03 (Wed, 03 Feb 2016) Origin message was: ------------------ - movieplayer: add virtual zap mode for moviebrowser playlists This commit fixes virtual zap for timeshift mode too. TODO: virtual zap for fileplayer playlists --- data/locale/deutsch.locale | 4 +- data/locale/english.locale | 4 +- src/gui/infoviewer.cpp | 31 ++++++-- src/gui/movieplayer.cpp | 143 ++++++++++++++++++++++++++++++------- src/gui/movieplayer.h | 7 +- 5 files changed, 153 insertions(+), 36 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index dddb197b9..109271a93 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -809,7 +809,7 @@ keybindingmenu.head Tasten-Belegungen bearbeiten keybindingmenu.lastchannel Letzter Kanal keybindingmenu.longkeypress_duration Langer Tastendruck keybindingmenu.misc Sonstige -keybindingmenu.mode_left_right_key_tv Funktion li/re Tasten im TV-Modus +keybindingmenu.mode_left_right_key_tv Funktion der li/re-Tasten keybindingmenu.mode_left_right_key_tv_infobar Infobar einblenden keybindingmenu.mode_left_right_key_tv_volume Lautstärkeregelung keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap @@ -1107,7 +1107,7 @@ menu.hint_key_quickzap Konfigurieren Sie die Tastenbelegung für die Schnellumsc menu.hint_key_record Konfigurieren Sie die Taste für den Aufnahmestart menu.hint_key_repeatblock Die Verzögerung nach einem Tastendruck bis die Box reagieren soll menu.hint_key_repeatblockgeneric Die Verzögerung zwischen den Tastewiederholungen bis die Box reagieren soll -menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio-Modus +menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio- und Movieplayer-Modus menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu diff --git a/data/locale/english.locale b/data/locale/english.locale index 96593f610..025a06954 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -809,7 +809,7 @@ keybindingmenu.head Edit Keybindings keybindingmenu.lastchannel Quick Zap keybindingmenu.longkeypress_duration Long key-press keybindingmenu.misc Misc -keybindingmenu.mode_left_right_key_tv Left/Right Key Behavior in TV-Mode +keybindingmenu.mode_left_right_key_tv Left/Right key behaviour keybindingmenu.mode_left_right_key_tv_infobar Show Infobar keybindingmenu.mode_left_right_key_tv_volume Volume Control keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap @@ -1107,7 +1107,7 @@ menu.hint_key_quickzap Configure keybingdings for quick\nchannel switch menu.hint_key_record Assign button to start a recording menu.hint_key_repeatblock Delay after button press and before\nfirst key repeat menu.hint_key_repeatblockgeneric Delay between key repeats\nwhile button pressed -menu.hint_key_right Select 'right' function in live TV/Radio mode +menu.hint_key_right Select function for 'left' and 'right' keys in live TV/Radio mode and movieplayer mode menu.hint_key_save Save keybindings to file menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot menu.hint_key_sort Assign button to change channel list sort order diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 091c50cf1..63937040e 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -940,18 +940,41 @@ void CInfoViewer::loop(bool show_dot) } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; - } - else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { if(fader.FadeDone()) res = messages_return::cancel_info; } else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { + if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && (msg == CRCInput::RC_ok)) + { + if (fileplay) + { + // in movieplayer mode process vzap keys in movieplayer.cpp + //printf("%s:%d: imitate VZAP; RC_ok\n", __func__, __LINE__); + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + } if(fader.StartFadeOut()) timeoutEnd = CRCInput::calcTimeoutEnd (1); else res = messages_return::cancel_info; + } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { + if (fileplay) + { + // in movieplayer mode process vzap keys in movieplayer.cpp + //printf("%s:%d: imitate VZAP; RC_left/right\n", __func__, __LINE__); + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else + setSwitchMode(IV_MODE_VIRTUAL_ZAP); + res = messages_return::cancel_all; + hideIt = true; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == sec_timer_id)) { showSNR (); if (timeset) @@ -986,10 +1009,6 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; - } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - setSwitchMode(IV_MODE_VIRTUAL_ZAP); - res = messages_return::cancel_all; - hideIt = true; } else if (msg == NeutrinoMessages::EVT_TIMESET) { /* handle timeset event in upper layer, ignore here */ res = neutrino->handleMsg (msg, data); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3b88cd4d1..d271feab5 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,7 @@ extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CInfoClock *InfoClock; +extern CVolume* g_volume; #define TIMESHIFT_SECONDS 3 #define ISO_MOUNT_POINT "/media/iso" @@ -189,6 +191,8 @@ void CMoviePlayerGui::Init(void) info_1 = ""; info_2 = ""; filelist_it = filelist.end(); + vzap_it = filelist_it; + fromInfoviewer = false; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; isLuaPlay = false; haveLuaInfoFunc = false; @@ -901,6 +905,55 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute) return res; } +void CMoviePlayerGui::quickZap(neutrino_msg_t msg) +{ + if ((msg == CRCInput::RC_right) || msg == (neutrino_msg_t) g_settings.key_quickzap_up) + { + //printf("CMoviePlayerGui::%s: CRCInput::RC_right or g_settings.key_quickzap_up\n", __func__); + if (isLuaPlay) + { + playstate = CMoviePlayerGui::STOPPED; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; + ClearQueue(); + } + else if (!filelist.empty()) + { + if (filelist_it < (filelist.end() - 1)) + { + playstate = CMoviePlayerGui::STOPPED; + ++filelist_it; + } + else if (repeat_mode == REPEAT_ALL) + { + playstate = CMoviePlayerGui::STOPPED; + ++filelist_it; + if (filelist_it == filelist.end()) + { + filelist_it = filelist.begin(); + } + } + } + } + else if ((msg == CRCInput::RC_left) || msg == (neutrino_msg_t) g_settings.key_quickzap_down) + { + //printf("CMoviePlayerGui::%s: CRCInput::RC_left or g_settings.key_quickzap_down\n", __func__); + if (isLuaPlay) + { + playstate = CMoviePlayerGui::STOPPED; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; + ClearQueue(); + } + else if (filelist.size() > 1) + { + if (filelist_it != filelist.begin()) + { + playstate = CMoviePlayerGui::STOPPED; + --filelist_it; + } + } + } +} + void CMoviePlayerGui::PlayFileLoop(void) { bool first_start = true; @@ -993,29 +1046,36 @@ void CMoviePlayerGui::PlayFileLoop(void) playstate = CMoviePlayerGui::STOPPED; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; ClearQueue(); - } else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_right)) { - playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; - ClearQueue(); - } else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_left)) { - playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; - ClearQueue(); - } else if ((!filelist.empty() && msg == (neutrino_msg_t) CRCInput::RC_right)) { - if (filelist_it < (filelist.end() - 1)) { - ++filelist_it; - playstate = CMoviePlayerGui::STOPPED; - } else if (repeat_mode == REPEAT_ALL) { - ++filelist_it; - if (filelist_it == filelist.end()) - filelist_it = filelist.begin(); - playstate = CMoviePlayerGui::STOPPED; - } - } else if (filelist.size() > 1 && msg == (neutrino_msg_t) CRCInput::RC_left) { - if (filelist_it != filelist.begin()) { - playstate = CMoviePlayerGui::STOPPED; - --filelist_it; + } else if (msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + bool reset_vzap_it = true; + switch (g_settings.mode_left_right_key_tv) + { + case SNeutrinoSettings::INFOBAR: + callInfoViewer(); + break; + case SNeutrinoSettings::VZAP: + if (fromInfoviewer) + { + set_vzap_it(msg == CRCInput::RC_right); + reset_vzap_it = false; + fromInfoviewer = false; + } + callInfoViewer(reset_vzap_it); + break; + case SNeutrinoSettings::VOLUME: + g_volume->setVolume(msg); + break; + default: /* SNeutrinoSettings::ZAP */ + quickZap(msg); + break; } + } else if (msg == (neutrino_msg_t) g_settings.key_quickzap_up || msg == (neutrino_msg_t) g_settings.key_quickzap_down) { + quickZap(msg); + } else if (fromInfoviewer && msg == CRCInput::RC_ok && !filelist.empty()) { + printf("CMoviePlayerGui::%s: start playlist movie #%d\n", __func__, vzap_it - filelist.begin()); + fromInfoviewer = false; + playstate = CMoviePlayerGui::STOPPED; + filelist_it = vzap_it; } else if (timeshift == TSHIFT_MODE_OFF && !isWebTV /* && !isYT */ && (msg == (neutrino_msg_t) g_settings.mpkey_next_repeat_mode)) { repeat_mode = (repeat_mode_enum)((int)repeat_mode + 1); if (repeat_mode > (int) REPEAT_ALL) @@ -1282,15 +1342,48 @@ void CMoviePlayerGui::PlayFileEnd(bool restore) } } -void CMoviePlayerGui::callInfoViewer() +void CMoviePlayerGui::set_vzap_it(bool up) { + //printf("CMoviePlayerGui::%s: vzap_it: %d count %s\n", __func__, vzap_it - filelist.begin(), up ? "up" : "down"); + if (up) + { + if (vzap_it < (filelist.end() - 1)) + ++vzap_it; + } + else + { + if (vzap_it > filelist.begin()) + --vzap_it; + } + //printf("CMoviePlayerGui::%s: vzap_it: %d\n", __func__, vzap_it - filelist.begin()); +} + +void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) +{ + if (init_vzap_it) + { + //printf("CMoviePlayerGui::%s: init_vzap_it\n", __func__); + vzap_it = filelist_it; + } + if (timeshift != TSHIFT_MODE_OFF) { g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel()); return; } - if (isMovieBrowser && p_movie_info) { - g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgEpgId >>16, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1, + if (isMovieBrowser && p_movie_info) + { + MI_MOVIE_INFO *mi; + mi = p_movie_info; + if (!filelist.empty() && g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) + { + if (vzap_it <= filelist.end()) { + unsigned idx = vzap_it - filelist.begin(); + //printf("CMoviePlayerGui::%s: idx: %d\n", __func__, idx); + mi = milist[idx]; + } + } + g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode); return; } diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index aa558cc24..53621ab9d 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -153,6 +153,9 @@ class CMoviePlayerGui : public CMenuTarget CFileFilter tsfilefilter; CFileList filelist; CFileList::iterator filelist_it; + CFileList::iterator vzap_it; + void set_vzap_it(bool up); + bool fromInfoviewer; std::string Path_local; int menu_ret; bool autoshot_done; @@ -177,8 +180,9 @@ class CMoviePlayerGui : public CMenuTarget void PlayFileEnd(bool restore = true); void cutNeutrino(); + void quickZap(neutrino_msg_t msg); void showHelpTS(void); - void callInfoViewer(); + void callInfoViewer(bool init_vzap_it = true); void fillPids(); bool getAudioName(int pid, std::string &apidtitle); void getCurrentAudioName( bool file_player, std::string &audioname); @@ -236,6 +240,7 @@ class CMoviePlayerGui : public CMenuTarget size_t GetReadCount(); std::string GetFile() { return pretty_name; } void restoreNeutrino(); + void setFromInfoviewer(bool f) { fromInfoviewer = f; }; void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; }; bool getBlockedFromPlugin() { return blockedFromPlugin; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; From e9e0aefec356b1011ef6e5c109446b4443ced4b4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 2 Feb 2016 12:30:48 +0300 Subject: [PATCH 053/690] libdvbsub/dvbsub.cpp: fix pid reporting on resume Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ec81142c4664ac9244ecf4b02b063d0b960b878 Author: [CST] Focus Date: 2016-02-02 (Tue, 02 Feb 2016) --- lib/libdvbsub/dvbsub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index 968316d42..ff37178cd 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -115,7 +115,7 @@ printf("[dvb-sub] ***************************************** start, stopped %d pi pthread_mutex_lock(&readerMutex); pthread_cond_broadcast(&readerCond); pthread_mutex_unlock(&readerMutex); - printf("[dvb-sub] started with pid 0x%x\n", pid); + printf("[dvb-sub] started with pid 0x%x\n", dvbsub_pid); } return 1; From ab9adca5153881cd34d48f9daf34e50efa678090 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 2 Feb 2016 12:36:08 +0300 Subject: [PATCH 054/690] zapit/src/zapit.cpp: when zapping to webtv, make sure dvb subtitles stopped and channel pids saved Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff5e14e46e18dd5aac30c0d5d1d7dd9437fb9db7 Author: [CST] Focus Date: 2016-02-02 (Tue, 02 Feb 2016) --- src/zapit/src/zapit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 13c6a3d55..cfb3e448b 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -505,8 +505,14 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay } INFO("[zapit] zap to %s (%" PRIx64 " tp %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); + if (!firstzap && current_channel) + SaveChannelPids(current_channel); + + /* firstzap right now does nothing but control saving the audio channel */ + firstzap = false; if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { + dvbsub_stop(); if (!IS_WEBTV(live_channel_id)) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY); @@ -540,12 +546,6 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay return false; } sig_delay = 2; - if (!firstzap && current_channel) - SaveChannelPids(current_channel); - - /* firstzap right now does nothing but control saving the audio channel */ - firstzap = false; - pmt_stop_update_filter(&pmt_update_fd); /* stop playback on the old frontend... */ From 73c3d7e831ab43ae3c0a2c1d25c8a60f3a9cca78 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 2 Feb 2016 16:57:19 +0300 Subject: [PATCH 055/690] neutrino.cpp: fix webtv subtitles crash when subtitle arrive while other gui on the screen (re-post deleted msg) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b047fe0261684f9eea48522900f60e4bdca418d3 Author: [CST] Focus Date: 2016-02-02 (Tue, 02 Feb 2016) --- src/neutrino.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 16c069594..d75cf2263 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2712,7 +2712,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } if (mode == mode_webtv && msg == NeutrinoMessages::EVT_SUBT_MESSAGE) { - CMoviePlayerGui::getInstance().showSubtitle(data); + CMoviePlayerGui::getInstance(true).showSubtitle(data); + return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); From 80b9d4064a3a57431d2de13247a9a7612c3e50e3 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 3 Feb 2016 14:22:01 +0300 Subject: [PATCH 056/690] gui/movieplayer.cpp: add subtitles auto-select for webtv Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee98002fd3c67bd0fa0030855a5f4a3bac3c58d2 Author: [CST] Focus Date: 2016-02-03 (Wed, 03 Feb 2016) --- src/gui/movieplayer.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d271feab5..7a870c511 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2218,8 +2218,10 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) void CMoviePlayerGui::selectAutoLang() { - if (ext_subs) { + if (!numsubs) playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage); + + if (ext_subs) { for (unsigned count = 0; count < numsubs; count++) { if (spids[count] == 0x1FFF) { currentspid = spids[count]; @@ -2258,6 +2260,34 @@ void CMoviePlayerGui::selectAutoLang() getCurrentAudioName(is_file_player, currentaudioname); } } + if (isWebTV && g_settings.auto_subs && numsubs > 0) { + for(int i = 0; i < 3; i++) { + if(g_settings.pref_subs[i].empty() || g_settings.pref_subs[i] == "none") + continue; + + std::string temp(g_settings.pref_subs[i]); + std::string slang; + for (int j = 0 ; j < numsubs; j++) { + if (!sub_supported[j]) + continue; + slang = slanguage[j].substr(0, 3); + std::map::const_iterator it; + for(it = iso639.begin(); it != iso639.end(); ++it) { + if(temp == it->second && slang == it->first) { + currentspid = spids[j]; + break; + } + } + if (currentspid > 0) + break; + } + if (currentspid > 0) { + playback->SelectSubtitles(currentspid, g_settings.subs_charset); + printf("[movieplayer] spid changed to %d %s (%s)\n", currentspid, temp.c_str(), slang.c_str()); + break; + } + } + } } void CMoviePlayerGui::parsePlaylist(CFile *file) From 86e7a6fcce37b45da2e9dfb7290c06ac3f36cfe9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 3 Feb 2016 18:37:45 +0300 Subject: [PATCH 057/690] gui/movieplayer.cpp: hack for dvb subtitles in TS file player mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c39affafe93160eceb5b210d80e56ec7be83da4 Author: [CST] Focus Date: 2016-02-03 (Wed, 03 Feb 2016) --- src/gui/movieplayer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 7a870c511..e04df9f91 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2081,18 +2081,25 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) int xres = 0, yres = 0, framerate; videoDecoder->getPictureInfo(xres, yres, framerate); - double xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) xres; - double yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) yres; + double xc, yc; + if (sub->num_rects && (sub->rects[0]->x + sub->rects[0]->w) <= 720 && + sub->rects[0]->y + sub->rects[0]->h <= 576) { + xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) 720; + yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) 576; + } else { + xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) xres; + yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) yres; + } clearSubtitle(); for (unsigned i = 0; i < sub->num_rects; i++) { uint32_t * colors = (uint32_t *) sub->rects[i]->pict.data[1]; - int nw = (double) sub->rects[i]->w * xc; - int nh = (double) sub->rects[i]->h * yc; int xoff = (double) sub->rects[i]->x * xc; int yoff = (double) sub->rects[i]->y * yc; + int nw = GetWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc); + int nh = (double) sub->rects[i]->h * yc; printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, sub->rects[i]->x, sub->rects[i]->y, sub->rects[i]->w, sub->rects[i]->h, From 3429ecfa2f092d906f09ceb573c601a8f06875e4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 4 Feb 2016 00:14:57 +0100 Subject: [PATCH 058/690] infoviewer: show movieplayers infoviewer in vzap mode if needed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/944dab5a8ccf2ffd75884d6331af28daa0f4fb3e Author: vanhofen Date: 2016-02-04 (Thu, 04 Feb 2016) Origin message was: ------------------ - infoviewer: show movieplayers infoviewer in vzap mode if needed --- src/gui/infoviewer.cpp | 6 ++++-- src/gui/infoviewer.h | 2 +- src/gui/movieplayer.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 63937040e..c79d4500c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -529,7 +529,7 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channel_Id, const std::string &Channel, const std::string &g_file_epg, const std::string &g_file_epg1, const int duration, const int curr_pos, - const int repeat_mode) + const int repeat_mode, const int _zap_mode) { if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT || @@ -544,6 +544,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe last_curr_id = last_next_id = 0; showButtonBar = true; fileplay = true; + zap_mode = _zap_mode; reset_allScala(); if (!gotTime) gotTime = timeset; @@ -573,7 +574,8 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe showRecordIcon (show_dot); show_dot = !show_dot; - infoViewerBB->paintshowButtonBar(); + if (!zap_mode) + infoViewerBB->paintshowButtonBar(); int ChannelLogoMode = 0; if (g_settings.infobar_show_channellogo > 1) diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 6fe7044a9..e32ca4b94 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -166,7 +166,7 @@ class CInfoViewer void showMovieTitle(const int playState, const t_channel_id &channel_id, const std::string &title, const std::string &g_file_epg, const std::string &g_file_epg1, - const int duration, const int curr_pos, const int repeat_mode); + const int duration, const int curr_pos, const int repeat_mode, const int _zap_mode = IV_MODE_DEFAULT); void start(); void showEpgInfo(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e04df9f91..ec70c08c7 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1384,7 +1384,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) } } g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, - duration, position, repeat_mode); + duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 2d0f53f15fafe2d0ac5caadfdd5ba7bb1912769c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 5 Feb 2016 00:43:44 +0100 Subject: [PATCH 059/690] moviebrowser: avoid useless RC_left/right keys in youtube mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d46b287d1cd3448b56ced298c2f0ac46e03472cf Author: vanhofen Date: 2016-02-05 (Fri, 05 Feb 2016) Origin message was: ------------------ - moviebrowser: avoid useless RC_left/right keys in youtube mode --- src/gui/moviebrowser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index d33ed4305..aa3434d78 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1800,11 +1800,13 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_left) { - onSetGUIWindowPrev(); + if (show_mode != MB_SHOW_YT) + onSetGUIWindowPrev(); } else if (msg == CRCInput::RC_right) { - onSetGUIWindowNext(); + if (show_mode != MB_SHOW_YT) + onSetGUIWindowNext(); } else if (msg == CRCInput::RC_green) { From cf7117d813e00f5cd432526c63b4dee3fc05e20e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 5 Feb 2016 15:54:17 +0100 Subject: [PATCH 060/690] moviebrowser: use FOOT_FONT definition to calc button dimensions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ecb5fa22013d118ca81753a2e8bc1efb72638306 Author: vanhofen Date: 2016-02-05 (Fri, 05 Feb 2016) Origin message was: ------------------ - moviebrowser: use FOOT_FONT definition to calc button dimensions --- src/gui/moviebrowser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index aa3434d78..272e880c5 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1735,16 +1735,16 @@ int CMovieBrowser::refreshFoot(bool show) //TRACE("[mb]->refreshButtonLine\n"); int offset = (m_settings.gui != MB_GUI_LAST_PLAY && m_settings.gui != MB_GUI_LAST_RECORD) ? 0 : 2; neutrino_locale_t ok_loc = (m_settings.gui == MB_GUI_FILTER && m_windowFocus == MB_FOCUS_FILTER) ? LOCALE_BOOKMARKMANAGER_SELECT : LOCALE_MOVIEBROWSER_FOOT_PLAY; - int ok_loc_len = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), true), - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY), true)); + int ok_loc_len = std::max(FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), true), + FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY), true)); std::string filter_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FILTER); filter_text += m_settings.filter.optionString; std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); sort_text += g_Locale->getText(m_localizedItemName[m_settings.sorting.item]); - int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT), true); + int sort_text_len = FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT), true); int len = 0; for (int i = 0; m_localizedItemName[i] != NONEXISTANT_LOCALE; i++) - len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(m_localizedItemName[i]), true)); + len = std::max(len, FOOT_FONT->getRenderWidth(g_Locale->getText(m_localizedItemName[i]), true)); sort_text_len += len; button_label_ext footerButtons[] = { From 9f386f68feae1de6409798f08b2fe6d2242eb244 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 5 Feb 2016 18:57:36 +0300 Subject: [PATCH 061/690] driver/streamts.cpp: add webtv channels streaming for compatible streams Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c13eb939fe91609a64722ac551c803e66c9b7299 Author: [CST] Focus Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/driver/streamts.cpp | 201 +++++++++++++++++++++++++++++++++++++--- src/driver/streamts.h | 44 +++++++-- 2 files changed, 224 insertions(+), 21 deletions(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 798f47dcc..df6a9a7a8 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,6 +56,7 @@ #include #include #include +#include /* experimental mode: * stream not possible, if record running @@ -111,7 +112,7 @@ bool CStreamInstance::Stop() return (OpenThreads::Thread::join() == 0); } -bool CStreamInstance::Send(ssize_t r) +bool CStreamInstance::Send(ssize_t r, unsigned char * _buf) { //OpenThreads::ScopedLock m_lock(mutex); stream_fds_t cfds; @@ -123,7 +124,7 @@ bool CStreamInstance::Send(ssize_t r) flags = MSG_DONTWAIT; for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) { int i = 10; - unsigned char *b = buf; + unsigned char *b = _buf ? _buf : buf; ssize_t count = r; do { int ret = send(*it, b, count, flags); @@ -160,17 +161,20 @@ void CStreamInstance::RemoveClient(int clientfd) printf("CStreamInstance::RemoveClient: %d (count %d)\n", clientfd, fds.size()); } +bool CStreamInstance::Open() +{ + CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); + if (!tmpchan) + return false; + + dmx = new cDemux(tmpchan->getRecordDemux());//FIXME + return dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); +} + void CStreamInstance::run() { printf("CStreamInstance::run: %llx\n", channel_id); - CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); - if (!tmpchan) - return; - - dmx = new cDemux(tmpchan->getRecordDemux());//FIXME - dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); - /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); printf("CStreamInstance::run: add pid %x\n", *it); @@ -414,7 +418,7 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro printf("CStreamManager::Parse: channel_id %llx [%s]\n", chid, channel->getName().c_str()); if (IS_WEBTV(chid)) - return false; + return true; frontend = FindFrontend(channel); if (!frontend) { @@ -497,13 +501,18 @@ bool CStreamManager::AddClient(int connfd) if (it != streams.end()) { it->second->AddClient(connfd); } else { - CStreamInstance * stream = new CStreamInstance(connfd, channel_id, pids); - stream->frontend = frontend; + CStreamInstance * stream; + if (IS_WEBTV(channel_id)) { + stream = new CStreamStream(connfd, channel_id, pids); + } else { + stream = new CStreamInstance(connfd, channel_id, pids); + stream->frontend = frontend; + } int sendsize = 10*IN_SIZE; unsigned int m = sizeof(sendsize); setsockopt(connfd, SOL_SOCKET, SO_SNDBUF, (void *)&sendsize, m); - if (stream->Start()) + if (stream->Open() && stream->Start()) streams.insert(streammap_pair_t(channel_id, stream)); else delete stream; @@ -693,3 +702,169 @@ _error: close (listenfd); return false; } + +CStreamStream::CStreamStream(int clientfd, t_channel_id chid, stream_pids_t &_pids) + : CStreamInstance(clientfd, chid, _pids) +{ + ifcx = NULL; + ofcx = NULL; + avio_ctx = NULL; + stopped = true; + interrupt = false; +} + +CStreamStream::~CStreamStream() +{ + Stop(); + Close(); +} + +int CStreamStream::write_packet(void *opaque, uint8_t *buffer, int buf_size) +{ + CStreamStream * st = (CStreamStream *) opaque; + st->Send(buf_size, buffer); + return buf_size; +} + +int CStreamStream::Interrupt(void * data) +{ + CStreamStream * sr = (CStreamStream*) data; + if (sr->interrupt) + return 1; + return 0; +} + +void CStreamStream::Close() +{ + if (ifcx) + avformat_close_input(&ifcx); + + if (ofcx) + avformat_free_context(ofcx); + + if (buf) + av_freep(&buf); + + if (avio_ctx) + av_free(avio_ctx); + + ifcx = NULL; + ofcx = NULL; + avio_ctx = NULL; +} + +bool CStreamStream::Open() +{ + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + if (!channel) + return false; + + std::string url = channel->getUrl(); + + if (url.empty()) + return false; + + printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); + + AVDictionary *options = NULL; + if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { + printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); + return false; + } + + if (avformat_find_stream_info(ifcx, NULL) < 0) { + printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); + return false; + } + if (!strstr(ifcx->iformat->name, "applehttp") && !strstr(ifcx->iformat->name, "mpegts")) { + printf("%s: not supported format [%s]!\n", __FUNCTION__, ifcx->iformat->name); + return false; + } + + AVIOInterruptCB int_cb = { Interrupt, this }; + ifcx->interrupt_callback = int_cb; + + snprintf(ifcx->filename, sizeof(ifcx->filename), "%s", channel->getUrl().c_str()); + av_dump_format(ifcx, 0, ifcx->filename, 0); + + buf = (unsigned char *) av_malloc(IN_SIZE); + if (buf == NULL) { + perror("CStreamStream::Open: buf"); + return false; + } + avio_ctx = avio_alloc_context(buf, IN_SIZE, 1, this, NULL, &write_packet, NULL); + if (!avio_ctx) { + printf("%s: avio_alloc_context failed\n", __FUNCTION__); + return false; + } + + if (avformat_alloc_output_context2(&ofcx, NULL, "mpegts", NULL) < 0) { + printf("%s: avformat_alloc_output_context2 failed\n", __FUNCTION__); + return false; + } + ofcx->pb = avio_ctx; + + av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); + int stid = 0x200; + for (unsigned i = 0; i < ifcx->nb_streams; i++) { + AVCodecContext * iccx = ifcx->streams[i]->codec; + + AVStream *ost = avformat_new_stream(ofcx, iccx->codec); + avcodec_copy_context(ost->codec, iccx); + av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); + ost->time_base = iccx->time_base; + ost->id = stid++; + } + av_log_set_level(AV_LOG_VERBOSE); + av_dump_format(ofcx, 0, ofcx->filename, 1); + av_log_set_level(AV_LOG_WARNING); + + return true; +} + +bool CStreamStream::Start() +{ + if (!stopped) + return false; + + printf("%s: Starting...\n", __FUNCTION__); + stopped = false; + int ret = start(); + return (ret == 0); +} + +bool CStreamStream::Stop() +{ + if (stopped) + return false; + + printf("%s: Stopping...\n", __FUNCTION__); + interrupt = true; + stopped = true; + int ret = join(); + interrupt = false; + return (ret == 0); +} + +void CStreamStream::run() +{ + AVPacket pkt; + + printf("%s: Started.\n", __FUNCTION__); + if (avformat_write_header(ofcx, NULL) < 0) { + printf("%s: avformat_write_header failed\n", __FUNCTION__); + return; + } + + while (!stopped) { + av_init_packet(&pkt); + if (av_read_frame(ifcx, &pkt) < 0) + break; + av_write_frame(ofcx, &pkt); + av_free_packet(&pkt); + } + + av_read_pause(ifcx); + av_write_trailer(ofcx); + printf("%s: Stopped.\n", __FUNCTION__); +} diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 23f74c33d..6c6d7dd72 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -31,12 +31,16 @@ #include #include +extern "C" { +#include +} + typedef std::set stream_pids_t; typedef std::set stream_fds_t; class CStreamInstance : public OpenThreads::Thread { - private: + protected: bool running; cDemux * dmx; CFrontend * frontend; @@ -47,15 +51,16 @@ class CStreamInstance : public OpenThreads::Thread stream_pids_t pids; stream_fds_t fds; - bool Send(ssize_t r); - void Close(); - void run(); + virtual bool Send(ssize_t r, unsigned char * _buf = NULL); + virtual void Close(); + virtual void run(); friend class CStreamManager; public: CStreamInstance(int clientfd, t_channel_id chid, stream_pids_t &pids); - ~CStreamInstance(); - bool Start(); - bool Stop(); + virtual ~CStreamInstance(); + virtual bool Open(); + virtual bool Start(); + virtual bool Stop(); void AddClient(int clientfd); void RemoveClient(int clientfd); bool HasFd(int fd); @@ -63,6 +68,30 @@ class CStreamInstance : public OpenThreads::Thread t_channel_id GetChannelId() { return channel_id; } }; +class CStreamStream : public CStreamInstance +{ + private: + AVFormatContext *ifcx; + AVFormatContext *ofcx; + AVIOContext *avio_ctx; + + bool stopped; + bool interrupt; + void run(); + void Close(); + + public: + CStreamStream(int clientfd, t_channel_id chid, stream_pids_t &pids); + ~CStreamStream(); + + bool Open(); + bool Start(); + bool Stop(); + + static int Interrupt(void * data); + static int write_packet(void *opaque, uint8_t *buf, int buf_size); +}; + typedef std::pair streammap_pair_t; typedef std::map streammap_t; typedef streammap_t::iterator streammap_iterator_t; @@ -102,5 +131,4 @@ class CStreamManager : public OpenThreads::Thread int GetPort() { return port; } bool AddClient(int fd); }; - #endif From c4903faa45babf7b70875035397c16d801751565 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 5 Feb 2016 17:02:47 +0100 Subject: [PATCH 062/690] yWeb: add missing live.timer_edit.message to language files Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b0f0cee5dcfdafc8b6abbb5b58a1446b1fa5a04f Author: vanhofen Date: 2016-02-05 (Fri, 05 Feb 2016) Origin message was: ------------------ - yWeb: add missing live.timer_edit.message to language files --- src/nhttpd/web/languages/Deutsch | 1 + src/nhttpd/web/languages/English | 1 + 2 files changed, 2 insertions(+) diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 716ff9a4d..8cf9155f0 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -520,6 +520,7 @@ live.timer_edit.plugin=Plugin live.timer_edit.rec_dir=Aufnahmeverzeichnis live.timer_edit.description=Beschreibung live.timer_edit.type=Typ +live.timer_edit.message=Nachricht =========== LIVE Timer Sync live.timer-sync.get_timer=Timer holen. diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index f5fbe84f1..695fe4788 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -523,6 +523,7 @@ live.timer_edit.plugin=Plugin live.timer_edit.rec_dir=Recordind directory live.timer_edit.description=Description live.timer_edit.type=Type +live.timer_edit.message=Message =========== LIVE Timer Sync live.timer-sync.get_timer=Get timer. From 9a6f35757f0b43d188eaf314a2be92ce78e12a3a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 5 Feb 2016 19:26:39 +0300 Subject: [PATCH 063/690] driver/streamts.cpp: fix webtv stream open Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/97d7dc2e6b3b7170066d430434672e3f12a90f75 Author: [CST] Focus Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/driver/streamts.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index df6a9a7a8..118e980b0 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -764,6 +764,11 @@ bool CStreamStream::Open() if (url.empty()) return false; + //av_log_set_level(AV_LOG_VERBOSE); + av_register_all(); + avcodec_register_all(); + avformat_network_init(); + printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); AVDictionary *options = NULL; From 3ee5210e0f96808c4db30001fed6677d0445db54 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 6 Feb 2016 15:19:18 +0100 Subject: [PATCH 064/690] src/driver/record.cpp check avformat_write_header return Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e602c0c950995fbbe0700e9b50312503ea6c4be Author: Jacek Jendrzej Date: 2016-02-06 (Sat, 06 Feb 2016) --- src/driver/record.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7aedd725d..f30957262 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2128,7 +2128,10 @@ void CStreamRec::run() time_t tstart = time_monotonic(); time_started = tstart; start_time = time(0); - avformat_write_header(ofcx, NULL); + if (avformat_write_header(ofcx, NULL) < 0) { + printf("%s: avformat_write_header failed\n", __FUNCTION__); + return; + } double total = 0; while (!stopped) { From bf7275e0c70c249d05f00d17d68265ebaf349909 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Feb 2016 12:05:28 +0100 Subject: [PATCH 065/690] moviebrowser: add possibility to search for movies in SMS-style This feature has to be activated first. Menu -> Settings -> Key Setup -> Edit -> My recordings In moviebrowser press three times key "3" to select first movie title starting with a "F" or press two times "6" to select first movie title starting with a "N". The new item in keybind-setup is the first step to introduce user- assignable keys in moviebrowser. So finally the horrible hotkeys for the cutting functions can be removed and/or replaced. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a98143e4986282bcd0569b747c3c29505e62caf Author: vanhofen Date: 2016-02-09 (Tue, 09 Feb 2016) Origin message was: ------------------ - moviebrowser: add possibility to search for movies in SMS-style This feature has to be activated first. Menu -> Settings -> Key Setup -> Edit -> My recordings In moviebrowser press three times key "3" to select first movie title starting with a "F" or press two times "6" to select first movie title starting with a "N". The new item in keybind-setup is the first step to introduce user- assignable keys in moviebrowser. So finally the horrible hotkeys for the cutting functions can be removed and/or replaced. --- data/locale/deutsch.locale | 7 +++-- data/locale/english.locale | 7 +++-- src/gui/keybind_setup.cpp | 21 +++++++++++-- src/gui/keybind_setup.h | 1 + src/gui/moviebrowser.cpp | 64 ++++++++++++++++++++++++++++++++++++++ src/neutrino.cpp | 2 ++ src/neutrino_menue.h | 1 + src/system/locals.h | 5 ++- src/system/locals_intern.h | 5 ++- src/system/settings.h | 1 + 10 files changed, 106 insertions(+), 8 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 109271a93..a950a6ed2 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -464,7 +464,8 @@ extra.saveconfig Neutrino-HD Einstellungen: Sichern als extra.savekeys Speichere Tastenbelegung als extra.scrambled_message Verschlüsselung melden extra.show_mute_icon Mute-Icon bei Lautstärke 0 -extra.sms_channel SMS-Modus Kanal +extra.sms_channel SMS-Modus bei Kanalsuche +extra.sms_movie SMS-Modus bei Filmsuche extra.south Süden extra.start_tostandby Standby nach Boxstart extra.temp_timeshift Temporäres Timeshift @@ -1070,7 +1071,6 @@ menu.hint_key_binding In diesem Menü können Einstellungen für die Tasten der menu.hint_key_bouquetdown Weisen Sie eine Taste für das Zurückblättern in den Bouquets zu menu.hint_key_bouquetup Weisen Sie eine Taste für das Vorblättern in den Bouquets zu menu.hint_key_cancel Weisen Sie eine Taste für das Schließen der Menüs zu -menu.hint_key_channel_sms Wenn es aktiviert ist, können Sie die Nummern-Tasten in der Kanalliste nutzen, um im SMS-Style zu suchen menu.hint_key_channeldown Weisen Sie eine Taste für das Herunterschalten in der Kanalliste zu menu.hint_key_channellist Konfigurieren Sie die Tastenbelegung für die Kanalliste menu.hint_key_channelup Weisen Sie eine Taste für das Hochschalten in der Kanalliste zu @@ -1083,6 +1083,7 @@ menu.hint_key_list_end Weisen Sie eine Taste für den Wechsel zum Listenende zu menu.hint_key_list_start Weisen Sie eine Taste für den Wechsel zum Listenanfang zu menu.hint_key_load Laden Sie Ihre Tastenbelegungen aus einer Datei menu.hint_key_modechange Wählen Sie eine Taste für den Wechsel in den TV/Radio-Modus und für den Standby +menu.hint_key_moviebrowser Konfigurieren Sie die Tastenbelegung für den Moviebrowser menu.hint_key_movieplayer Konfigurieren Sie die Tastenbelegung für den Movieplayer menu.hint_key_mpaudio Weisen Sie eine Taste zu, um die Tonspuren in ihren Aufnahmen zu wechseln menu.hint_key_mpbookmark Weisen Sie eine Taste zu, um Merker in ihren Aufnahmen für den Neustart zu setzen @@ -1370,6 +1371,8 @@ menu.hint_shutdown_rcdelay Aktiviert den Deep-Standby, wenn die Power-Taste län menu.hint_shutdown_real Aktiviert den Standby-Modus. Ist diese Option deaktiviert, fährt die Box in den Deep-Standby menu.hint_sleeptimer Zeitschaltuhr auf Ihrer Box aktivieren\nDie Box fährt dann in den Standby-Modus menu.hint_sleeptimer_min Voreinstellung der Zeitschaltuhr auf Ihrer Box +menu.hint_sms_channel Wenn es aktiviert ist, können Sie die Nummern-Tasten in der Kanalliste nutzen, um im SMS-Style zu suchen +menu.hint_sms_movie Wenn es aktiviert ist, können Sie die Nummern-Tasten im Moviebrowser nutzen, um im SMS-Style zu suchen menu.hint_soft_restart Neustarten von Neutrino-HD, ohne die Box neu zu starten menu.hint_softupdate_check Im Internet nach verfügbaren Updates suchen, herunterladen und installieren menu.hint_softupdate_check_local Lokal nach verfügbaren Updates suchen und installieren diff --git a/data/locale/english.locale b/data/locale/english.locale index 025a06954..731836ed2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -464,7 +464,8 @@ extra.saveconfig Neutrino-HD Settings: Save as extra.savekeys Save keys as extra.scrambled_message Scrambled Message extra.show_mute_icon mute-icon at volume 0 -extra.sms_channel sms-mode channel +extra.sms_channel SMS-mode channel +extra.sms_movie SMS-mode movie extra.south South extra.start_tostandby Startup to standby extra.temp_timeshift Temporary timeshift @@ -1070,7 +1071,6 @@ menu.hint_key_binding Re-define keys used for common operations menu.hint_key_bouquetdown Assign button to switch channel list\nto previous bouquet menu.hint_key_bouquetup Assign button to switch channel list\nto next bouquet menu.hint_key_cancel Assign button to close GUI window -menu.hint_key_channel_sms If enabled, numeric buttons in channel list\nused to search channel in SMS style menu.hint_key_channeldown Assign button for fast switch to previous\nchannel in channel list menu.hint_key_channellist Configure keybingdings for channel list menu.hint_key_channelup Assign button for fast switch to next\nchannel in channel list @@ -1083,6 +1083,7 @@ menu.hint_key_list_end Assign button to go do list end menu.hint_key_list_start Assign button to go to list start menu.hint_key_load Load keybindings from file menu.hint_key_modechange Change TV/Radio mode and standby keys +menu.hint_key_moviebrowser Configure keybingdings for movie browser menu.hint_key_movieplayer Configure keybingdings for movie player menu.hint_key_mpaudio Assign button to show audio selection\nin record/file playback mode menu.hint_key_mpbookmark Assign button to create bookmark\nwhile playing record @@ -1370,6 +1371,8 @@ menu.hint_shutdown_rcdelay Enable deep-standby, if power button\npressed more th menu.hint_shutdown_real Enable soft-standby mode\nIf disabled, power button put box to deep-standby menu.hint_sleeptimer Set timer to put your box\nin sleep mode menu.hint_sleeptimer_min Default setting for sleeptimer +menu.hint_sms_channel If enabled, numeric buttons in channel list used to search channel in SMS style +menu.hint_sms_movie If enabled, numeric buttons in moviebrowser used to search movie in SMS style menu.hint_soft_restart Restart Neutrino-HD without reboot menu.hint_softupdate_check Check online update, download and flash firmware menu.hint_softupdate_check_local Select and flash firmware from local file diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index dd6db5654..e2198abb6 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -375,6 +375,13 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) mf->setHint("", LOCALE_MENU_HINT_KEY_MOVIEPLAYER); bindSettings->addItem(mf); + //moviebrowser + CMenuWidget* bindSettings_mbrowser = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEBROWSER); + showKeyBindMoviebrowserSetup(bindSettings_mbrowser); + mf = new CMenuDForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, bindSettings_mbrowser, NULL, CRCInput::RC_nokey); + mf->setHint("", LOCALE_MENU_HINT_KEY_MOVIEBROWSER); + bindSettings->addItem(mf); + //video bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_VIDEO)); for (int i = NKEY_NEXT43MODE; i <= NKEY_SWITCHFORMAT; i++) { @@ -440,7 +447,8 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_HELP].keydescription, true, keychooser[NKEY_HELP]->getKeyName(), keychooser[NKEY_HELP])); bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_RECORD].keydescription, true, keychooser[NKEY_RECORD]->getKeyName(), keychooser[NKEY_RECORD])); - // right key + bindSettings->addItem(new CMenuSeparator()); + // left/right keys mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV, &g_settings.mode_left_right_key_tv, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEY_RIGHT); bindSettings->addItem(mc); @@ -475,7 +483,7 @@ void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist } CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_CHANNEL, &g_settings.sms_channel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_KEY_CHANNEL_SMS); + mc->setHint("", LOCALE_MENU_HINT_SMS_CHANNEL); bindSettings_chlist->addItem(mc); } @@ -501,6 +509,15 @@ void CKeybindSetup::showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplaye } } +void CKeybindSetup::showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrowser) +{ + bindSettings_mbrowser->addIntroItems(LOCALE_MOVIEBROWSER_HEAD); + + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_MOVIE, &g_settings.sms_movie, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SMS_MOVIE); + bindSettings_mbrowser->addItem(mc); +} + void CKeybindSetup::showKeyBindSpecialSetup(CMenuWidget *bindSettings_special) { bindSettings_special->addIntroItems(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE); diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 894b45bc1..0ee68cf79 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -105,6 +105,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver void showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist); void showKeyBindQuickzapSetup(CMenuWidget *bindSettings_qzap); void showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplayer); + void showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrowser); void showKeyBindSpecialSetup(CMenuWidget *bindSettings_special); public: diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 272e880c5..35caad7f1 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -83,6 +83,7 @@ typedef struct dirent64 dirent_struct; #define TRACE printf #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list +#define MOVIE_SMSKEY_TIMEOUT 800 #define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 20 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = @@ -1790,6 +1791,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { //TRACE("[mb]->onButtonPressMainFrame: %d\n",msg); bool result = true; + neutrino_msg_data_t data; if (msg == CRCInput::RC_home) { @@ -1875,6 +1877,68 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } } + else if (g_settings.sms_movie && (msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)) + { + unsigned char smsKey = 0; + SMSKeyInput smsInput; + smsInput.setTimeout(MOVIE_SMSKEY_TIMEOUT); + + std::vector *current_list = NULL; + CListFrame *current_frame = NULL; + + if (m_windowFocus == MB_FOCUS_BROWSER) + { + current_list = &m_vHandleBrowserList; + current_frame = m_pcBrowser; + } + else if (m_windowFocus == MB_FOCUS_LAST_PLAY) + { + current_list = &m_vHandlePlayList; + current_frame = m_pcLastPlay; + } + else if (m_windowFocus == MB_FOCUS_LAST_RECORD) + { + current_list = &m_vHandleRecordList; + current_frame = m_pcLastRecord; + } + + if (current_list == NULL || current_frame == NULL) + return result; + + do { + smsKey = smsInput.handleMsg(msg); + printf("SMS new key: %c\n", smsKey); + g_RCInput->getMsg_ms(&msg, &data, MOVIE_SMSKEY_TIMEOUT-100); + } while ((msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)); + + int selected = current_frame->getSelectedLine(); + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_nokey) { + uint32_t i; + for (i = selected+1; i < (*current_list).size(); i++) { + + char firstCharOfTitle = (*current_list)[i]->epgTitle.c_str()[0]; + if (tolower(firstCharOfTitle) == smsKey) { + printf("SMS found selected=%d i=%d \"%s\"\n", selected, i, (*current_list)[i]->epgTitle.c_str()); + break; + } + } + if (i >= (*current_list).size()) { + for (i = 0; i < (*current_list).size(); i++) { + char firstCharOfTitle = (*current_list)[i]->epgTitle.c_str()[0]; + if (tolower(firstCharOfTitle) == smsKey) { + printf("SMS found selected=%d i=%d \"%s\"\n", selected, i, (*current_list)[i]->epgTitle.c_str()); + break; + } + } + } + if (i < (*current_list).size()) { + current_frame->setSelectedLine(i); + updateMovieSelection(); + } + + smsInput.resetOldKey(); + } + } // just here to stay backward compatible with these horrible key assignments else if (msg == CRCInput::RC_radio) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d75cf2263..d3466e572 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4208,6 +4208,7 @@ void CNeutrinoApp::loadKeys(const char * fname) g_settings.bouquetlist_mode = tconfig.getInt32( "bouquetlist_mode", 0 ); g_settings.sms_channel = tconfig.getInt32( "sms_channel", 0 ); + g_settings.sms_movie = tconfig.getInt32( "sms_movie", 0 ); g_settings.mode_left_right_key_tv = tconfig.getInt32( "mode_left_right_key_tv", SNeutrinoSettings::ZAP); g_settings.key_help = tconfig.getInt32( "key_help", CRCInput::RC_help ); @@ -4284,6 +4285,7 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode ); tconfig.setInt32( "sms_channel", g_settings.sms_channel ); + tconfig.setInt32( "sms_movie", g_settings.sms_movie ); tconfig.setInt32( "mode_left_right_key_tv", g_settings.mode_left_right_key_tv ); tconfig.setInt32( "key_help", g_settings.key_help ); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 1318d7402..735c88ee4 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -102,6 +102,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST, MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER, + MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEBROWSER, MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL, //picture viewer setup diff --git a/src/system/locals.h b/src/system/locals.h index 0bde8d6b9..72843b948 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -492,6 +492,7 @@ typedef enum LOCALE_EXTRA_SCRAMBLED_MESSAGE, LOCALE_EXTRA_SHOW_MUTE_ICON, LOCALE_EXTRA_SMS_CHANNEL, + LOCALE_EXTRA_SMS_MOVIE, LOCALE_EXTRA_SOUTH, LOCALE_EXTRA_START_TOSTANDBY, LOCALE_EXTRA_TEMP_TIMESHIFT, @@ -1097,7 +1098,6 @@ typedef enum LOCALE_MENU_HINT_KEY_BOUQUETDOWN, LOCALE_MENU_HINT_KEY_BOUQUETUP, LOCALE_MENU_HINT_KEY_CANCEL, - LOCALE_MENU_HINT_KEY_CHANNEL_SMS, LOCALE_MENU_HINT_KEY_CHANNELDOWN, LOCALE_MENU_HINT_KEY_CHANNELLIST, LOCALE_MENU_HINT_KEY_CHANNELUP, @@ -1110,6 +1110,7 @@ typedef enum LOCALE_MENU_HINT_KEY_LIST_START, LOCALE_MENU_HINT_KEY_LOAD, LOCALE_MENU_HINT_KEY_MODECHANGE, + LOCALE_MENU_HINT_KEY_MOVIEBROWSER, LOCALE_MENU_HINT_KEY_MOVIEPLAYER, LOCALE_MENU_HINT_KEY_MPAUDIO, LOCALE_MENU_HINT_KEY_MPBOOKMARK, @@ -1397,6 +1398,8 @@ typedef enum LOCALE_MENU_HINT_SHUTDOWN_REAL, LOCALE_MENU_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER_MIN, + LOCALE_MENU_HINT_SMS_CHANNEL, + LOCALE_MENU_HINT_SMS_MOVIE, LOCALE_MENU_HINT_SOFT_RESTART, LOCALE_MENU_HINT_SOFTUPDATE_CHECK, LOCALE_MENU_HINT_SOFTUPDATE_CHECK_LOCAL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bc5c07f62..897546fb2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -492,6 +492,7 @@ const char * locale_real_names[] = "extra.scrambled_message", "extra.show_mute_icon", "extra.sms_channel", + "extra.sms_movie", "extra.south", "extra.start_tostandby", "extra.temp_timeshift", @@ -1097,7 +1098,6 @@ const char * locale_real_names[] = "menu.hint_key_bouquetdown", "menu.hint_key_bouquetup", "menu.hint_key_cancel", - "menu.hint_key_channel_sms", "menu.hint_key_channeldown", "menu.hint_key_channellist", "menu.hint_key_channelup", @@ -1110,6 +1110,7 @@ const char * locale_real_names[] = "menu.hint_key_list_start", "menu.hint_key_load", "menu.hint_key_modechange", + "menu.hint_key_moviebrowser", "menu.hint_key_movieplayer", "menu.hint_key_mpaudio", "menu.hint_key_mpbookmark", @@ -1397,6 +1398,8 @@ const char * locale_real_names[] = "menu.hint_shutdown_real", "menu.hint_sleeptimer", "menu.hint_sleeptimer_min", + "menu.hint_sms_channel", + "menu.hint_sms_movie", "menu.hint_soft_restart", "menu.hint_softupdate_check", "menu.hint_softupdate_check_local", diff --git a/src/system/settings.h b/src/system/settings.h index 728ae275b..aaff551f2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -729,6 +729,7 @@ struct SNeutrinoSettings int hdd_statfs_mode; int zap_cycle; int sms_channel; + int sms_movie; std::string font_file; std::string ttx_font_file; From 425115a4e2399245f28615b77d3b1f50e43a7f75 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 9 Feb 2016 16:35:25 +0300 Subject: [PATCH 066/690] driver/moviecut.cpp: fix saving header after truncate, remove redundant CMovieInfo arg from api Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/00b97778a3947ecc24e03ad4cb0ed29810cc1531 Author: [CST] Focus Date: 2016-02-09 (Tue, 09 Feb 2016) --- src/driver/moviecut.cpp | 18 +++++++++++------- src/driver/moviecut.h | 6 +++--- src/gui/moviebrowser.cpp | 8 ++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/driver/moviecut.cpp b/src/driver/moviecut.cpp index 269e4e381..a4f8890cf 100644 --- a/src/driver/moviecut.cpp +++ b/src/driver/moviecut.cpp @@ -175,6 +175,9 @@ bool CMovieCut::truncateMovie(MI_MOVIE_INFO * minfo) minfo->length = minfo->bookmarks.end/60; minfo->bookmarks.end = 0; reset_atime(minfo->file.Name.c_str(), minfo->file.Time); + CMovieInfo cmovie; + cmovie.saveMovieInfo(*minfo); + WriteHeader(minfo->file.Name.c_str(), newsize/secsize*1000); return true; } @@ -238,8 +241,9 @@ int CMovieCut::read_psi(const char * spart, unsigned char * buf) return -1; } -void CMovieCut::save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize) +void CMovieCut::save_info(MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize) { + CMovieInfo cmovie; MI_MOVIE_INFO ninfo = *minfo; ninfo.file.Name = dpart; ninfo.file.Size = spos; @@ -253,7 +257,7 @@ void CMovieCut::save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpa ninfo.bookmarks.user[book_nr].length = 0; } } - cmovie->saveMovieInfo(ninfo); + cmovie.saveMovieInfo(ninfo); WriteHeader(ninfo.file.Name.c_str(), spos/secsize*1000); reset_atime(dpart, minfo->file.Time); } @@ -302,7 +306,7 @@ int CMovieCut::getInput() return retval; } -bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) +bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo) { struct mybook books[MI_MOVIE_BOOK_USER_MAX+2]; unsigned char psi[PSI_SIZE]; @@ -482,7 +486,7 @@ bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) tt1 = time(0); printf("CMovieCut::%s: total written %" PRId64 " tooks %ld secs end time %s", __func__, spos, tt1-tt, ctime(&tt1)); - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); retval = true; ret_err: if (srcfd >= 0) @@ -498,7 +502,7 @@ ret_err: return retval; } -bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefile) +bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, bool onefile) { struct mybook books[MI_MOVIE_BOOK_USER_MAX+2]; struct stat64 s; @@ -619,13 +623,13 @@ bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi if (!onefile) { close(dstfd); dstfd = -1; - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); time_t tt1 = time(0); printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } } /* for all books */ if (onefile) { - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); time_t tt1 = time(0); printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } diff --git a/src/driver/moviecut.h b/src/driver/moviecut.h index c996ebaab..f95aa58f4 100644 --- a/src/driver/moviecut.h +++ b/src/driver/moviecut.h @@ -41,7 +41,7 @@ class CMovieCut int find_gop(unsigned char *buf, int r); off64_t fake_read(int fd, unsigned char *buf, size_t size, off64_t fsize); int read_psi(const char * spart, unsigned char * buf); - void save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize); + void save_info(MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize); void findNewName(const char * fname, char * dpart,size_t dpart_len); static int compare_book(const void *x, const void *y); int getInput(); @@ -52,8 +52,8 @@ class CMovieCut CMovieCut(); ~CMovieCut(); bool truncateMovie(MI_MOVIE_INFO * minfo); - bool cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie); - bool copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefile); + bool cutMovie(MI_MOVIE_INFO * minfo); + bool copyMovie(MI_MOVIE_INFO * minfo, bool onefile); //int handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data); }; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 35caad7f1..cd2d2c384 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -899,7 +899,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) delete hintBox; framebuffer->paintBackground(); // clear screen CMovieCut mc; - bool res = mc.copyMovie(m_movieSelectionHandler, &m_movieInfo, onefile); + bool res = mc.copyMovie(m_movieSelectionHandler, onefile); //g_RCInput->clearRCMsg(); if (res == 0) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -924,7 +924,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) delete hintBox; framebuffer->paintBackground(); // clear screen CMovieCut mc; - bool res = mc.cutMovie(m_movieSelectionHandler, &m_movieInfo); + bool res = mc.cutMovie(m_movieSelectionHandler); //g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -955,11 +955,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else - { - //printf("New movie info: size %lld len %d\n", res, m_movieSelectionHandler->bookmarks.end/60); - m_movieInfo.saveMovieInfo(*m_movieSelectionHandler); m_doLoadMovies = true; - } m_doRefresh = true; } } From a22d2344b814157038b729f11e0e109ba9a2a23b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Feb 2016 15:53:56 +0100 Subject: [PATCH 067/690] moviebrowser: introduce user-assignable keys Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab82c36b9fdc155c9c0730bd3c725b8788583a42 Author: vanhofen Date: 2016-02-09 (Tue, 09 Feb 2016) Origin message was: ------------------ - moviebrowser: introduce user-assignable keys --- data/locale/deutsch.locale | 4 +++ data/locale/english.locale | 4 +++ src/gui/keybind_setup.cpp | 10 +++++++ src/gui/keybind_setup.h | 4 +++ src/gui/moviebrowser.cpp | 57 +++++++++++++++----------------------- src/neutrino.cpp | 9 ++++++ src/system/locals.h | 4 +++ src/system/locals_intern.h | 4 +++ src/system/settings.h | 5 ++++ 9 files changed, 67 insertions(+), 34 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a950a6ed2..cb17113f4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -927,6 +927,10 @@ mainsettings.savesettingsnow Einstellungen jetzt speichern mainsettings.savesettingsnow_hint Einstellungen werden jetzt gespeichert,\nbitte warten... mainsettings.timezone Zeitzone mainsettings.video Video +mbkey.copy_onefile Film kopieren +mbkey.copy_several Film kopieren und teilen +mbkey.cut Film schneiden +mbkey.truncate Film kürzen menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter diff --git a/data/locale/english.locale b/data/locale/english.locale index 731836ed2..c248089df 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -927,6 +927,10 @@ mainsettings.savesettingsnow Save settings now mainsettings.savesettingsnow_hint Saving settings,\nplease wait... mainsettings.timezone Timezone mainsettings.video Video +mbkey.copy_onefile Copy movie +mbkey.copy_several Copy and split movie +mbkey.cut Cut movie +mbkey.truncate Truncate movie menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index e2198abb6..67956c9e5 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -205,6 +205,10 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] = {LOCALE_EXTRA_KEY_PIC_MODE, &g_settings.key_pic_mode_active, LOCALE_MENU_HINT_KEY_PIC_MODE_ACTIVE }, {LOCALE_EXTRA_KEY_PIC_SIZE, &g_settings.key_pic_size_active, LOCALE_MENU_HINT_KEY_PIC_SIZE_ACTIVE }, {LOCALE_EXTRA_KEY_RECORD, &g_settings.key_record, LOCALE_MENU_HINT_KEY_RECORD }, + {LOCALE_MBKEY_COPY_ONEFILE, &g_settings.mbkey_copy_onefile, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_COPY_SEVERAL, &g_settings.mbkey_copy_several, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_CUT, &g_settings.mbkey_cut, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_TRUNCATE, &g_settings.mbkey_truncate, NONEXISTANT_LOCALE }, }; // used by driver/rcinput.cpp @@ -513,6 +517,12 @@ void CKeybindSetup::showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrow { bindSettings_mbrowser->addIntroItems(LOCALE_MOVIEBROWSER_HEAD); + for (int i = MBKEY_COPY_ONEFILE; i <= MBKEY_TRUNCATE; i++) { + CMenuForwarder * mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); + mf->setHint("", key_settings[i].hint); + bindSettings_mbrowser->addItem(mf); + } + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_MOVIE, &g_settings.sms_movie, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_SMS_MOVIE); bindSettings_mbrowser->addItem(mc); diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 0ee68cf79..fc6866b96 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -90,6 +90,10 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver NKEY_PIC_MODE, NKEY_PIC_SIZE, NKEY_RECORD, + MBKEY_COPY_ONEFILE, + MBKEY_COPY_SEVERAL, + MBKEY_CUT, + MBKEY_TRUNCATE, KEYBINDS_COUNT }; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index cd2d2c384..38da87f0b 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1789,7 +1789,29 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) bool result = true; neutrino_msg_data_t data; - if (msg == CRCInput::RC_home) + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_onefile + || msg == (neutrino_msg_t) g_settings.mbkey_copy_several + || msg == (neutrino_msg_t) g_settings.mbkey_cut + || msg == (neutrino_msg_t) g_settings.mbkey_truncate) + { + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_onefile) + exec(NULL, "copy_onefile"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_several) + exec(NULL, "copy_several"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_cut) + exec(NULL, "cut"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_truncate) + exec(NULL, "truncate"); + + if (m_doLoadMovies) + loadMovies(); + if (m_doRefresh) + refresh(); + } + else if (msg == CRCInput::RC_home) { if (m_settings.gui == MB_GUI_FILTER) onSetGUIWindow(MB_GUI_MOVIE_INFO); @@ -1935,39 +1957,6 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } - // just here to stay backward compatible with these horrible key assignments - else if (msg == CRCInput::RC_radio) - { - exec(NULL, "copy_onefile"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_text) - { - exec(NULL, "copy_several"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_audio) - { - exec(NULL, "cut"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_games) - { - exec(NULL, "truncate"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } else if (msg == CRCInput::RC_favorites) { if (m_movieSelectionHandler != NULL) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d3466e572..18f3465b9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4180,6 +4180,10 @@ void CNeutrinoApp::loadKeys(const char * fname) g_settings.key_bouquet_up = tconfig.getInt32( "key_bouquet_up", CRCInput::RC_right); g_settings.key_bouquet_down = tconfig.getInt32( "key_bouquet_down", CRCInput::RC_left); + g_settings.mbkey_copy_onefile = tconfig.getInt32( "mbkey.copy_onefile", CRCInput::RC_radio ); + g_settings.mbkey_copy_several = tconfig.getInt32( "mbkey.copy_several", CRCInput::RC_text ); + g_settings.mbkey_cut = tconfig.getInt32( "mbkey.cut", CRCInput::RC_audio ); + g_settings.mbkey_truncate = tconfig.getInt32( "mbkey.truncate", CRCInput::RC_games ); g_settings.mpkey_rewind = tconfig.getInt32( "mpkey.rewind", CRCInput::RC_rewind ); g_settings.mpkey_forward = tconfig.getInt32( "mpkey.forward", CRCInput::RC_forward ); @@ -4259,6 +4263,11 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "key_bouquet_up", g_settings.key_bouquet_up ); tconfig.setInt32( "key_bouquet_down", g_settings.key_bouquet_down ); + tconfig.setInt32( "mbkey.copy_onefile", g_settings.mbkey_copy_onefile ); + tconfig.setInt32( "mbkey.copy_several", g_settings.mbkey_copy_several ); + tconfig.setInt32( "mbkey.cut", g_settings.mbkey_cut ); + tconfig.setInt32( "mbkey.truncate", g_settings.mbkey_truncate ); + tconfig.setInt32( "mpkey.rewind", g_settings.mpkey_rewind ); tconfig.setInt32( "mpkey.forward", g_settings.mpkey_forward ); tconfig.setInt32( "mpkey.pause", g_settings.mpkey_pause ); diff --git a/src/system/locals.h b/src/system/locals.h index 72843b948..dcffb5ab5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -954,6 +954,10 @@ typedef enum LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT, LOCALE_MAINSETTINGS_TIMEZONE, LOCALE_MAINSETTINGS_VIDEO, + LOCALE_MBKEY_COPY_ONEFILE, + LOCALE_MBKEY_COPY_SEVERAL, + LOCALE_MBKEY_CUT, + LOCALE_MBKEY_TRUNCATE, LOCALE_MENU_BACK, LOCALE_MENU_CANCEL, LOCALE_MENU_HINT_A_PIC, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 897546fb2..e03de1e5b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -954,6 +954,10 @@ const char * locale_real_names[] = "mainsettings.savesettingsnow_hint", "mainsettings.timezone", "mainsettings.video", + "mbkey.copy_onefile", + "mbkey.copy_several", + "mbkey.cut", + "mbkey.truncate", "menu.back", "menu.cancel", "menu.hint_a_pic", diff --git a/src/system/settings.h b/src/system/settings.h index aaff551f2..5c2527336 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -491,6 +491,11 @@ struct SNeutrinoSettings int key_volumeup; int key_volumedown; + int mbkey_copy_onefile; + int mbkey_copy_several; + int mbkey_cut; + int mbkey_truncate; + int mpkey_rewind; int mpkey_forward; int mpkey_pause; From 3e9fac00453e6bd5a5e10cb7f658f41c547352aa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Feb 2016 22:32:53 +0100 Subject: [PATCH 068/690] yWeb: fix get_epg wait text Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/03b47a440c026fe1041a6f3635feb0f548d3e92a Author: vanhofen Date: 2016-02-09 (Tue, 09 Feb 2016) Origin message was: ------------------ - yWeb: fix get_epg wait text --- src/nhttpd/web/Y_EPG_Plus.yhtm | 2 +- src/nhttpd/web/Y_Live_EPG.yhtm | 2 +- src/nhttpd/web/Y_Version.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index b6cacff8a..b6888235c 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -11,7 +11,7 @@ function epg_imdb(){ -{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:epg.get_epg=}=}{=include-block:Y_Blocks.txt;snip_wait=}
{=var-set:help_url=Help-Live_Timer-EPG_Plus=}{=var-set:menu={=L:epg.epg_plus=}=}{=include-block:Y_Blocks.txt;work_menu=}
diff --git a/src/nhttpd/web/Y_Live_EPG.yhtm b/src/nhttpd/web/Y_Live_EPG.yhtm index 1c25ff5e2..975ea41e9 100644 --- a/src/nhttpd/web/Y_Live_EPG.yhtm +++ b/src/nhttpd/web/Y_Live_EPG.yhtm @@ -102,7 +102,7 @@ function _show_epg() -{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_show_wait=} +{=var-set:wait_text={=L:epg.get_epg=}=}{=include-block:Y_Blocks.txt;snip_show_wait=} diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 691238b8c..5a00a03fb 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.26 -date=21.01.2016 +version=2.9.0.27 +date=10.02.2016 type=Release info=Port CST From 7b6b3325a987b4c056cbd3f4401ba11abf4cfa0d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Feb 2016 22:50:44 +0100 Subject: [PATCH 069/690] yWeb: add day of week to EPG date Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d681a97bf025346add70fc851cd170ac8b2f621 Author: vanhofen Date: 2016-02-09 (Tue, 09 Feb 2016) Origin message was: ------------------ - yWeb: add day of week to EPG date --- src/nhttpd/web/Y_Live_EPG.yhtm | 14 ++++++++++++++ src/nhttpd/web/Y_Version.txt | 2 +- src/nhttpd/web/languages/Deutsch | 16 ++++++++++++++++ src/nhttpd/web/languages/English | 16 ++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/web/Y_Live_EPG.yhtm b/src/nhttpd/web/Y_Live_EPG.yhtm index 975ea41e9..8d0dc53f0 100644 --- a/src/nhttpd/web/Y_Live_EPG.yhtm +++ b/src/nhttpd/web/Y_Live_EPG.yhtm @@ -67,7 +67,17 @@ function _show_epg() epg_data = new Array(); epg_data_index=0; + var weekday = new Array(7); + weekday[0]= "{=L:date.su=}"; + weekday[1] = "{=L:date.mo=}"; + weekday[2] = "{=L:date.tu=}"; + weekday[3] = "{=L:date.we=}"; + weekday[4] = "{=L:date.th=}"; + weekday[5] = "{=L:date.fr=}"; + weekday[6] = "{=L:date.sa=}"; + var now = new Date(); + var __d = new Date(); var _starttime = Math.round(now/1000); var epg_xml = loadSyncURLxml("/control/epg?xml=true&channelid={=channel=}&details=true"); if(epg_xml){ @@ -85,6 +95,10 @@ function _show_epg() var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); + __d.setTime(_start*1000); + var _dow = weekday[__d.getDay()]; + _date = _dow + ", " + _date; + var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), "{=channel=}"); epg_data.push(epg_obj); diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 5a00a03fb..60f5d20a6 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.27 +version=2.9.0.28 date=10.02.2016 type=Release info=Port CST diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 8cf9155f0..9bd7ae720 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -59,6 +59,22 @@ automatic=automatisch show=zeigen hide=verstecken +# ========== Dates +date.su=So +date.sunday=Sonntag +date.mo=Mo +date.monday=Montag +date.tu=Di +date.tuesday=Dienstag +date.we=Mi +date.wednesday=Mittwoch +date.th=Do +date.thursday=Donnerstag +date.fr=Fr +date.friday=Freitag +date.sa=Sa +date.saturday=Samstag + # ==========Main Menue main.boxcontrol=Boxsteuerung main.boxcontrol_desc=Boxcontrol & Bouquets diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index 695fe4788..4438a6068 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -59,6 +59,22 @@ automatic=automatically show=show hide=hide +# ========== Dates +date.su=Su +date.sunday=Sunday +date.mo=Mo +date.monday=Monday +date.tu=Tu +date.tuesday=Tuesday +date.we=We +date.wednesday=Wednesday +date.th=Th +date.thursday=Thursday +date.fr=Fr +date.friday=Friday +date.sa=Sa +date.saturday=Saturday + #========= MAIN Menue main.live_tv_desc=LiveTV main.live_tv_popup_desc=LiveTV popup From 8c0b893ea587ea1ccf6e20d5981b9bf20fd06271 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Feb 2016 22:52:33 +0100 Subject: [PATCH 070/690] yWeb: avoid response from control/message in whole frame Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e60b8fac9002ccde69b0a6f664670a56b0a06b18 Author: vanhofen Date: 2016-02-09 (Tue, 09 Feb 2016) Origin message was: ------------------ - yWeb: avoid response from control/message in whole frame --- src/nhttpd/web/Y_Boxcontrol_Messages.yhtm | 32 ++++++++++++++++++----- src/nhttpd/web/Y_Version.txt | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm index 3b7b77225..3272c573c 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm @@ -1,26 +1,46 @@ {=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;head=} + + + +
{=var-set:help_url=Help-BoxControl-Message=}{=var-set:menu={=L:bc.menue.messages=}=}{=include-block:Y_Blocks.txt;work_menu=}
-
{=L:bc.msg.message_to_screen=}
- - + +
{=L:bc.msg.popup_to_screen=}
- - + +

- +
+ +
+
+ {=var-set:help_url=Help-BoxControl-Message=}{=var-set:menu={=L:answer=}=}{=include-block:Y_Blocks.txt;work_menu=}
+
+
diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 60f5d20a6..3843d2a42 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.28 +version=2.9.0.29 date=10.02.2016 type=Release info=Port CST From 236bc95d462eb6bb405850ebe95a7468f62e90b3 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 10 Feb 2016 21:15:27 +0100 Subject: [PATCH 071/690] add some more epg details to ControlAPI (getbouquet) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5de651e4dda5f67b2c66ab22d008a0ab4d207262 Author: TangoCash Date: 2016-02-10 (Wed, 10 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 093b9d1cf..7fc8e0349 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -898,6 +898,8 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); std::string timestr; + uint64_t epgid = 0; + CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CChannelEvent *event; @@ -910,19 +912,29 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); timestr = timeString(event->startTime); + firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); firstEPG += hh->outPair("startTime", timestr, true); firstEPG += hh->outPair("description", hh->outValue(event->description), true); - firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) + { + firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); + firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); + } + firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); - firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { timestr = timeString(currentNextInfo.next_zeit.startzeit); + secondEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.next_uniqueKey), true); secondEPG += hh->outPair("startTime", timestr, true); secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), false); secondEPG += hh->outPair("timeTotal", string_printf("%d", currentNextInfo.next_zeit.dauer / 60), true); - secondEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.next_uniqueKey), true); + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) + { + secondEPG += hh->outPair("info1", hh->outValue(epg.info1), true); + secondEPG += hh->outPair("info2", hh->outValue(epg.info2), true); + } } } From de6347e64fcbd44f8057108e7e84b7dc8cca8c18 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 15:04:11 +0100 Subject: [PATCH 072/690] movieplayer/browser: add user key to create/remove movie cover Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61a4b3bf9cfdb571b265e35a3541b568c7f0d117 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - movieplayer/browser: add user key to create/remove movie cover --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/keybind_setup.cpp | 3 ++- src/gui/keybind_setup.h | 1 + src/gui/moviebrowser.cpp | 22 +++++++++++----------- src/gui/movieplayer.cpp | 15 +++++++-------- src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 10 files changed, 32 insertions(+), 20 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cb17113f4..3f20b21cc 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -929,6 +929,7 @@ mainsettings.timezone Zeitzone mainsettings.video Video mbkey.copy_onefile Film kopieren mbkey.copy_several Film kopieren und teilen +mbkey.cover Filmcover erzeugen/löschen mbkey.cut Film schneiden mbkey.truncate Film kürzen menu.back Zurück @@ -1145,6 +1146,7 @@ menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelös menu.hint_make_webtvlist Bei aktiver Option wird ein Bouquet namens 'WebTV' erzeugt, in dem alle WebTV-Sender zusammengefasst sind menu.hint_manage_settings Sichern, Wiederherstellen und Auslieferungszustand wiederherstellen menu.hint_mb Ihre Aufnahmen +menu.hint_mbkey_cover Weisen Sie eine Taste zu, um Filmcover wärend der Wiedergabe zu erzeugen oder sie im Moviebrowser zu löschen menu.hint_media Abspielen von Musik, Internetradio und Filmen; Betrachten Sie Bilder menu.hint_menu_fonts Ändern Sie die Schriftgrößen im Menü menu.hint_menu_hints Zeigt Ihnen Hinweise zu den Menüpunkten an. Sie erreichen das auch jederzeit mit der Taste 'Hilfe' diff --git a/data/locale/english.locale b/data/locale/english.locale index c248089df..1d3a6b931 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -929,6 +929,7 @@ mainsettings.timezone Timezone mainsettings.video Video mbkey.copy_onefile Copy movie mbkey.copy_several Copy and split movie +mbkey.cover Create/remove movie cover mbkey.cut Cut movie mbkey.truncate Truncate movie menu.back Back @@ -1145,6 +1146,7 @@ menu.hint_make_removedlist Create list of recently removed channels menu.hint_make_webtvlist Auto-create WebTV channel list based on\nchannel type and name menu.hint_manage_settings Backup, restore, revert to defaults\nFactory box reset menu.hint_mb Your recordings +menu.hint_mbkey_cover Assign button to create movie cover while playback or delete it in moviebrowser menu.hint_media Play movies, audio files\nWatch pictures menu.hint_menu_fonts Change menu font sizes menu.hint_menu_hints Show this hints. Also you can switch\nit any time using 'help' button diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 67956c9e5..4c4d2513a 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -209,6 +209,7 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] = {LOCALE_MBKEY_COPY_SEVERAL, &g_settings.mbkey_copy_several, NONEXISTANT_LOCALE }, {LOCALE_MBKEY_CUT, &g_settings.mbkey_cut, NONEXISTANT_LOCALE }, {LOCALE_MBKEY_TRUNCATE, &g_settings.mbkey_truncate, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_COVER, &g_settings.mbkey_cover, LOCALE_MENU_HINT_MBKEY_COVER }, }; // used by driver/rcinput.cpp @@ -517,7 +518,7 @@ void CKeybindSetup::showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrow { bindSettings_mbrowser->addIntroItems(LOCALE_MOVIEBROWSER_HEAD); - for (int i = MBKEY_COPY_ONEFILE; i <= MBKEY_TRUNCATE; i++) { + for (int i = MBKEY_COPY_ONEFILE; i <= MBKEY_COVER; i++) { CMenuForwarder * mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); mf->setHint("", key_settings[i].hint); bindSettings_mbrowser->addItem(mf); diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index fc6866b96..46be84c82 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -94,6 +94,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver MBKEY_COPY_SEVERAL, MBKEY_CUT, MBKEY_TRUNCATE, + MBKEY_COVER, KEYBINDS_COUNT }; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 38da87f0b..3374a860a 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1811,6 +1811,17 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if (m_doRefresh) refresh(); } + else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) + { + if (m_movieSelectionHandler != NULL) { + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()) + unlink(fname.c_str()); + refresh(); + } + } + } else if (msg == CRCInput::RC_home) { if (m_settings.gui == MB_GUI_FILTER) @@ -1957,17 +1968,6 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } - else if (msg == CRCInput::RC_favorites) - { - if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } - } - } else { //TRACE("[mb]->onButtonPressMainFrame none\n"); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ec70c08c7..d919a0674 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1152,9 +1152,12 @@ void CMoviePlayerGui::PlayFileLoop(void) update_lcd = true; } else if (msg == (neutrino_msg_t) g_settings.mpkey_time) { FileTime.switchMode(position, duration); - } else if (/*!is_file_player &&*/ ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || - (msg == (neutrino_msg_t) g_settings.mpkey_forward))) { - + } else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { + makeScreenShot(false, true); + } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { + makeScreenShot(); + } else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || + (msg == (neutrino_msg_t) g_settings.mpkey_forward)) { int newspeed; if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) { newspeed = (speed >= 0) ? -1 : speed - 1; @@ -1247,8 +1250,6 @@ void CMoviePlayerGui::PlayFileLoop(void) #endif } else if (msg == NeutrinoMessages::SHOW_EPG) { handleMovieBrowser(NeutrinoMessages::SHOW_EPG, position); - } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { - makeScreenShot(); } else if (msg == NeutrinoMessages::EVT_SUBT_MESSAGE) { showSubtitle(data); } else if (msg == NeutrinoMessages::ANNOUNCE_RECORD || @@ -1270,9 +1271,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { if (playstate == CMoviePlayerGui::PLAY && (position >= 300000 || (duration < 300000 && (position > (duration /2))))) makeScreenShot(true); - } else if (msg == CRCInput::RC_favorites) { - makeScreenShot(false, true); - } else if (msg == CRCInput::RC_sat) { + } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { //FIXME do nothing ? } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 18f3465b9..9e08af202 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4184,6 +4184,7 @@ void CNeutrinoApp::loadKeys(const char * fname) g_settings.mbkey_copy_several = tconfig.getInt32( "mbkey.copy_several", CRCInput::RC_text ); g_settings.mbkey_cut = tconfig.getInt32( "mbkey.cut", CRCInput::RC_audio ); g_settings.mbkey_truncate = tconfig.getInt32( "mbkey.truncate", CRCInput::RC_games ); + g_settings.mbkey_cover = tconfig.getInt32( "mbkey.cover", CRCInput::RC_favorites ); g_settings.mpkey_rewind = tconfig.getInt32( "mpkey.rewind", CRCInput::RC_rewind ); g_settings.mpkey_forward = tconfig.getInt32( "mpkey.forward", CRCInput::RC_forward ); @@ -4267,6 +4268,7 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "mbkey.copy_several", g_settings.mbkey_copy_several ); tconfig.setInt32( "mbkey.cut", g_settings.mbkey_cut ); tconfig.setInt32( "mbkey.truncate", g_settings.mbkey_truncate ); + tconfig.setInt32( "mbkey.cover", g_settings.mbkey_cover ); tconfig.setInt32( "mpkey.rewind", g_settings.mpkey_rewind ); tconfig.setInt32( "mpkey.forward", g_settings.mpkey_forward ); diff --git a/src/system/locals.h b/src/system/locals.h index dcffb5ab5..864bc074f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -956,6 +956,7 @@ typedef enum LOCALE_MAINSETTINGS_VIDEO, LOCALE_MBKEY_COPY_ONEFILE, LOCALE_MBKEY_COPY_SEVERAL, + LOCALE_MBKEY_COVER, LOCALE_MBKEY_CUT, LOCALE_MBKEY_TRUNCATE, LOCALE_MENU_BACK, @@ -1172,6 +1173,7 @@ typedef enum LOCALE_MENU_HINT_MAKE_WEBTVLIST, LOCALE_MENU_HINT_MANAGE_SETTINGS, LOCALE_MENU_HINT_MB, + LOCALE_MENU_HINT_MBKEY_COVER, LOCALE_MENU_HINT_MEDIA, LOCALE_MENU_HINT_MENU_FONTS, LOCALE_MENU_HINT_MENU_HINTS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e03de1e5b..0ac541b47 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -956,6 +956,7 @@ const char * locale_real_names[] = "mainsettings.video", "mbkey.copy_onefile", "mbkey.copy_several", + "mbkey.cover", "mbkey.cut", "mbkey.truncate", "menu.back", @@ -1172,6 +1173,7 @@ const char * locale_real_names[] = "menu.hint_make_webtvlist", "menu.hint_manage_settings", "menu.hint_mb", + "menu.hint_mbkey_cover", "menu.hint_media", "menu.hint_menu_fonts", "menu.hint_menu_hints", diff --git a/src/system/settings.h b/src/system/settings.h index 5c2527336..80a15f3a9 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -495,6 +495,7 @@ struct SNeutrinoSettings int mbkey_copy_several; int mbkey_cut; int mbkey_truncate; + int mbkey_cover; int mpkey_rewind; int mpkey_forward; From f40227b1ae72d4f965cfb3db466970687ee15666 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 15:10:01 +0100 Subject: [PATCH 073/690] deutsch.locale: typo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3d4e938b249347e8f30e4b9b01171d9cf5dee0f Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - deutsch.locale: typo --- data/locale/deutsch.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3f20b21cc..f481f867c 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1146,7 +1146,7 @@ menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelös menu.hint_make_webtvlist Bei aktiver Option wird ein Bouquet namens 'WebTV' erzeugt, in dem alle WebTV-Sender zusammengefasst sind menu.hint_manage_settings Sichern, Wiederherstellen und Auslieferungszustand wiederherstellen menu.hint_mb Ihre Aufnahmen -menu.hint_mbkey_cover Weisen Sie eine Taste zu, um Filmcover wärend der Wiedergabe zu erzeugen oder sie im Moviebrowser zu löschen +menu.hint_mbkey_cover Weisen Sie eine Taste zu, um Filmcover während der Wiedergabe zu erzeugen oder sie im Moviebrowser zu löschen menu.hint_media Abspielen von Musik, Internetradio und Filmen; Betrachten Sie Bilder menu.hint_menu_fonts Ändern Sie die Schriftgrößen im Menü menu.hint_menu_hints Zeigt Ihnen Hinweise zu den Menüpunkten an. Sie erreichen das auch jederzeit mit der Taste 'Hilfe' From 4f0440cc43af4b3efdc66f74e6ccf050e89d8e58 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 18:23:45 +0100 Subject: [PATCH 074/690] controlapi: resort and fix getbouquet output; ... NOTE: last hh->outPair() call *must* have a false bool _next Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e39ce6289eb222bfc761515da3ab09ddf32eaf4 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - controlapi: resort and fix getbouquet output; ... NOTE: last hh->outPair() call *must* have a false bool _next --- src/nhttpd/tuxboxapi/controlapi.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 7fc8e0349..9b4ee52a5 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -913,28 +913,28 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann timestr = timeString(event->startTime); firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); - firstEPG += hh->outPair("startTime", timestr, true); firstEPG += hh->outPair("description", hh->outValue(event->description), true); - firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) { firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); } + firstEPG += hh->outPair("startTime", timestr, true); + firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { timestr = timeString(currentNextInfo.next_zeit.startzeit); secondEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.next_uniqueKey), true); - secondEPG += hh->outPair("startTime", timestr, true); - secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), false); - secondEPG += hh->outPair("timeTotal", string_printf("%d", currentNextInfo.next_zeit.dauer / 60), true); + secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), true); if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) { secondEPG += hh->outPair("info1", hh->outValue(epg.info1), true); secondEPG += hh->outPair("info2", hh->outValue(epg.info2), true); } + secondEPG += hh->outPair("startTime", timestr, true); + secondEPG += hh->outPair("timeTotal", string_printf("%d", currentNextInfo.next_zeit.dauer / 60), false); } } From 6a2b1a155bb72b4e9c2efb0c12ad262332bc335e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 18:46:27 +0100 Subject: [PATCH 075/690] =?UTF-8?q?controlapi:=20remove=20unused=20variabl?= =?UTF-8?q?e=20=E2=80=98epgid=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/58303bbc8c6b6977707948e081f053aaba58bbb9 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - controlapi: remove unused variable ‘epgid’ --- src/nhttpd/tuxboxapi/controlapi.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 9b4ee52a5..69cee2499 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -898,7 +898,6 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); std::string timestr; - uint64_t epgid = 0; CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; From c60f4d7e82977d052d3ec621a62b2341950ef323 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 19:29:06 +0100 Subject: [PATCH 076/690] yWeb: add new css class .pointer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/391a068aadafa5b7197cb7d665e8ef4cda0c19f7 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - yWeb: add new css class .pointer --- src/nhttpd/web/Y_Main.css | 3 +++ src/nhttpd/web/Y_Version.txt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 6c975bd3f..659312bb6 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -24,6 +24,9 @@ button,input,select,form,td { height: 0; overflow: hidden; } +.pointer { + cursor: pointer; +} /* buttons */ a img:hover { position:relative; diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 3843d2a42..8cab6a256 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.29 -date=10.02.2016 +version=2.9.0.30 +date=11.02.2016 type=Release info=Port CST From 39486495157812f4d035920ca2ecd214172cd060 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 19:30:53 +0100 Subject: [PATCH 077/690] yparser: add tooltip with EPG informations to channellist based apon "adding mouseover detailed EPG Info in WebIF" by TangoCash Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be0d1fa4b4700a299a0262450a40aaf499b56940 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - yparser: add tooltip with EPG informations to channellist based apon "adding mouseover detailed EPG Info in WebIF" by TangoCash --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index c38776db3..9204ce4e4 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -495,17 +495,35 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); timestr = timeString(event->startTime); + CShortEPGData epg; + std::string EPGInfoC = ""; + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) + { + EPGInfoC += epg.info1; + EPGInfoC += epg.info2; + } + yresult += string_printf("",classname); - yresult += string_printf("%s %s " + yresult += string_printf("%s %s " "(%ld {=L:from=} %d {=L:unit.short.minute=}, %d%%)" , timestr.c_str() + , EPGInfoC.c_str() , event->description.c_str() , (time(NULL) - event->startTime)/60 , event->duration / 60,prozent); if ((has_current_next) && (currentNextInfo.flags & CSectionsdClient::epgflags::has_next)) { + std::string EPGInfoN = ""; + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) + { + EPGInfoN += epg.info1; + EPGInfoN += epg.info2; + } timestr = timeString(currentNextInfo.next_zeit.startzeit); - yresult += string_printf("
%s %s", timestr.c_str(), currentNextInfo.next_name.c_str()); + yresult += string_printf("
%s %s" + , timestr.c_str() + , EPGInfoN.c_str() + , currentNextInfo.next_name.c_str()); } yresult += string_printf("\n"); From 4be683818b54419730eb61561eb5d613c5b10249 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 21:59:24 +0100 Subject: [PATCH 078/690] controlapi: allow to get moviebrowser.conf with config call Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/809a7dcb452ddc8e7ed5751d862ec996e3f6119c Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) Origin message was: ------------------ - controlapi: allow to get moviebrowser.conf with config call --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 ++ src/nhttpd/yconfig.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 69cee2499..b238efa63 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2956,6 +2956,8 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { // Para "config" describes the config type if (configFileName == "neutrino") config_filename = NEUTRINO_CONFIGFILE; + else if (configFileName == "moviebrowser") + config_filename = MOVIEBROWSER_CONFIGFILE; else if (configFileName == "nhttpd") config_filename = HTTPD_CONFIGFILE; else if (configFileName == "yweb") diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 0006e345d..5aa76f112 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -110,6 +110,7 @@ #define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" #define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR #define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" +#define MOVIEBROWSER_CONFIGFILE CONFIGDIR"/moviebrowser.conf" #define HOSTEDDOCUMENTROOT HOSTED_HTTPDDIR #define HOSTEDDOCUMENTURL "/hosted/" #define EXTRASDOCUMENTROOT HOSTED_HTTPDDIR"/extras" From 814cfe7cbf686accbc39c42b961baa08724d4a57 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 13 Feb 2016 11:44:06 +0100 Subject: [PATCH 079/690] nhttp: re-enable threading; lock NeutrinoAPI calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8abb547cca4d126fe49e98985d9ce635ee788d89 Author: [CST] Focus Date: 2016-02-13 (Sat, 13 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 +++++ src/nhttpd/tuxboxapi/neutrinoapi.cpp | 31 ++++++++++++++++++------ src/nhttpd/tuxboxapi/neutrinoapi.h | 2 ++ src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 6 +++-- src/nhttpd/yconfig.h | 2 +- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index b238efa63..2f2150406 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -902,7 +902,9 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CChannelEvent *event; + NeutrinoAPI->mutex.lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + NeutrinoAPI->mutex.unlock(); if (event) { int percentage = 100; @@ -966,7 +968,9 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * } else { CChannelEvent *event; + NeutrinoAPI->mutex.lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + NeutrinoAPI->mutex.unlock(); if (event && isEPGdetails) { result += string_printf("%u " @@ -1599,7 +1603,9 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; + NeutrinoAPI->mutex.lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + NeutrinoAPI->mutex.unlock(); if (event) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 8c9812a15..97f128c19 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -41,6 +41,7 @@ #include #include #include +#include extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; @@ -171,6 +172,7 @@ void CNeutrinoAPI::UpdateBouquets(void) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapTo(const char * const target) { + OpenThreads::ScopedLock lock(mutex); t_channel_id channel_id; sscanf(target, @@ -182,6 +184,7 @@ void CNeutrinoAPI::ZapTo(const char * const target) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) { + OpenThreads::ScopedLock lock(mutex); if (channel_id == Zapit->getCurrentServiceID()) { //printf("Kanal ist aktuell\n"); @@ -195,6 +198,7 @@ void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) void CNeutrinoAPI::ZapToSubService(const char * const target) { + OpenThreads::ScopedLock lock(mutex); t_channel_id channel_id; sscanf(target, @@ -207,6 +211,7 @@ void CNeutrinoAPI::ZapToSubService(const char * const target) //------------------------------------------------------------------------- t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_name) { + OpenThreads::ScopedLock lock(mutex); //FIXME depending on mode missing //int mode = Zapit->getMode(); t_channel_id channel_id = (t_channel_id)-1; @@ -264,6 +269,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { + OpenThreads::ScopedLock lock(mutex); eList.clear(); CEitManager::getInstance()->getChannelEvents(eList); CChannelEventList::iterator eventIterator; @@ -283,6 +289,7 @@ bool CNeutrinoAPI::GetChannelEvents(void) std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) { + OpenThreads::ScopedLock lock(mutex); return CServiceManager::getInstance()->GetServiceName(channel_id); } @@ -410,7 +417,8 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep) } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) { +std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) +{ int aspectRatio = videoDecoder->getAspectRatio(); if (aspectRatio >= 0 && aspectRatio <= 4) return videoformat_names[aspectRatio]; @@ -418,7 +426,9 @@ std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) { return "unknown"; } //------------------------------------------------------------------------- -int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) { +int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) +{ + OpenThreads::ScopedLock lock(mutex); int newRatioInt = -1; for(int i=0;i<(int)sizeof(videoformat_names);i++) if( videoformat_names[i] == newRatioString){ @@ -430,7 +440,8 @@ int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) { return newRatioInt; } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoResolutionAsString(void) { +std::string CNeutrinoAPI::getVideoResolutionAsString(void) +{ int xres, yres, framerate; videoDecoder->getPictureInfo(xres, yres, framerate); std::stringstream out; @@ -439,7 +450,8 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoFramerateAsString(void) { +std::string CNeutrinoAPI::getVideoFramerateAsString(void) +{ int xres, yres, framerate; std::string sframerate="unknown"; videoDecoder->getPictureInfo(xres, yres, framerate); @@ -453,7 +465,8 @@ std::string CNeutrinoAPI::getVideoFramerateAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getAudioInfoAsString(void) { +std::string CNeutrinoAPI::getAudioInfoAsString(void) +{ int type, layer, freq, mode, lbitrate; audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); std::stringstream out; @@ -465,11 +478,13 @@ std::string CNeutrinoAPI::getAudioInfoAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getCryptInfoAsString(void) { +std::string CNeutrinoAPI::getCryptInfoAsString(void) +{ std::stringstream out; std::string casys[11]= {"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; int caids[] = { 0x600, 0x1700, 0x0100, 0x0500, 0x1800, 0xB00, 0xD00, 0x900, 0x2600, 0x4a00, 0x0E00 }; + OpenThreads::ScopedLock lock(mutex); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); if(channel) { for (unsigned short i = 0; i < 11; i++) { @@ -485,7 +500,8 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) { +std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) +{ std::string channelIdAsString = string_printf( PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS , channelId & 0xFFFFFFFFFFFFULL); std::string channelName = GetServiceName(channelId); // replace(channelName, " ", "_"); @@ -505,4 +521,3 @@ std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channel else return ""; } - diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 4d504eae0..6312229a1 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -15,6 +15,7 @@ #include #include "neutrinoyparser.h" #include "controlapi.h" +#include //------------------------------------------------------------------------- // No Class Helpers @@ -24,6 +25,7 @@ bool _initialize_iso639_map(void); //------------------------------------------------------------------------- class CNeutrinoAPI { + OpenThreads::Mutex mutex; // Clientlibs CSectionsdClient *Sectionsd; CZapitClient *Zapit; diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 9204ce4e4..5137dad85 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -359,7 +359,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: { CZapitChannel * channel = channels[j]; CChannelEvent *event; + NeutrinoAPI->mutex.lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + NeutrinoAPI->mutex.unlock(); classname = (i++ & 1) ? 'a' : 'b'; if (channel->getChannelID() == current_channel) @@ -439,7 +441,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", channel->getChannelID(), channel->getChannelID() & 0xFFFFFFFFFFFFULL, - ((NeutrinoAPI->ChannelListEvents[channel->getChannelID()]) ? "\"Program" : "")); + (event ? "\"Program" : "")); if (channel->getChannelID() == current_channel) yresult += string_printf("\n  \"Streaminfo\""); @@ -489,7 +491,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } } - else if ((event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()])) + else if (event) { bool has_current_next = true; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 5aa76f112..b06d6e385 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -62,7 +62,7 @@ //#define Y_CONFIG_FEATURE_CHROOT y // Add Feature: Use Change Root for Security //#define Y_CONFIG_FEATURE_HTTPD_USER y // Add Feature: Set User for yhttpd-Process #define Y_CONFIG_BUILD_AS_DAEMON y // Build as a Daemon -//#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading +#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading //----------------------------------------------------------------------------- // Define/Undefine Features forced by CONFIG_SYSTEM_xxx // Dependencies From 0697d99445c4fec237566ba7c47d39b88552fb1b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 13 Feb 2016 10:22:18 +0100 Subject: [PATCH 080/690] yWeb: enable threading switch for coolstream hardware Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ef9317737be66f87312300af641d7987019c6ef0 Author: vanhofen Date: 2016-02-13 (Sat, 13 Feb 2016) Origin message was: ------------------ - yWeb: enable threading switch for coolstream hardware --- src/nhttpd/web/Y_Settings_nhttpd.yhtm | 2 -- src/nhttpd/web/Y_Version.txt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index 872695929..f78f667b6 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -75,7 +75,6 @@ function do_check_input_LogosURL()  {=L:set.nhttpd.active_after_boot=} - {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ {=L:set.nhttpd.threading=} @@ -83,7 +82,6 @@ function do_check_input_LogosURL() {=L:on=} - =} {=L:set.nhttpd.alternate_web_folder=} diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 8cab6a256..f5569b0e8 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.30 -date=11.02.2016 +version=2.9.0.31 +date=13.02.2016 type=Release info=Port CST From f9e9f480734d62ee087574b242bb6ca091ef3801 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Feb 2016 19:41:44 +0100 Subject: [PATCH 081/690] yWeb: smoother view/scroll in EPG Plus Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f56a1830e719d0a333543e095911e575ec8abb8b Author: vanhofen Date: 2016-02-14 (Sun, 14 Feb 2016) Origin message was: ------------------ - yWeb: smoother view/scroll in EPG Plus --- src/nhttpd/web/Y_EPG.js | 19 ++++++++++++------- src/nhttpd/web/Y_Main.css | 8 +++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js index ba6db44ca..7a7f15368 100644 --- a/src/nhttpd/web/Y_EPG.js +++ b/src/nhttpd/web/Y_EPG.js @@ -9,8 +9,8 @@ var g_number_of_cols=0; /*nr of cols*/ var g_width_all_items=0; /*width without bouquet*/ var c_width_px_per_min=3; /* px per minute */ var c_min_per_col=15;/*minutes per col*/ -var c_width_px_bouquet=103; /* width of bouquet*/ -var c_slider_width=20; +var c_width_px_bouquet=100; /* width of bouquet*/ +var c_slider_width=25; var epg_data; /* all EPG Data in 2-dim Array*/ var epg_data_index=0; var g_timer_eventids = new Array(); @@ -21,10 +21,10 @@ var g_selected=0; function epg_plus_calc_dimensions(){ var show_dim=$('epg_plus').getDimensions(); var usable_width_px = show_dim.width-c_slider_width; /*get display width*/ - var max_minutes_to_display = Math.round((usable_width_px-c_width_px_bouquet)/c_width_px_per_min); /* calc display minutes*/ + var max_minutes_to_display = Math.round((usable_width_px-c_width_px_bouquet-c_width_px_per_min)/c_width_px_per_min); /* calc display minutes*/ g_number_of_cols = Math.round(max_minutes_to_display/c_min_per_col); - g_width_px = g_number_of_cols * c_width_px_per_min * c_min_per_col + c_width_px_bouquet; - g_width_all_items=g_width_px-c_width_px_bouquet; + g_width_px = g_number_of_cols * c_width_px_per_min * c_min_per_col + c_width_px_bouquet + c_width_px_per_min; + g_width_all_items=g_width_px-c_width_px_bouquet-c_width_px_per_min; $('epg_plus').style.cssText = "width:"+g_width_px; } function epg_zapto(){ @@ -45,7 +45,7 @@ function build_epg_clear(){ function build_epg_setbox(_item, _starttime, _stoptime, _start, _stop){ var d_start = Math.max(_start, _starttime); var d_stop = Math.min(_stop, _stoptime); - var d_left = c_width_px_bouquet+ Math.round((d_start-_starttime) * c_width_px_per_min / 60); + var d_left = c_width_px_bouquet+c_width_px_per_min+ Math.round((d_start-_starttime) * c_width_px_per_min / 60); var d_width = Math.max(0,Math.round((d_stop-d_start) * c_width_px_per_min / 60)-3); d_width= Math.min(d_width,g_width_px-d_left); if(d_start<_stoptime) @@ -180,7 +180,11 @@ function build_epg_plus(_bouquet, _starttime) var __tdiv = obj_createAt(ep, "div", "ep_time_bar"); var __tname_div = obj_createAt(__tdiv, "div", "ep_time_bar_item"); __tname_div.innerHTML = "Uhrzeit"; + __tname_div.style.cssText = "width:"+c_width_px_bouquet+"px;"; build_epg_time_bar(__tdiv, _starttime, _stoptime); + __tdiv.style.cssText = "width:"+g_width_px; + var __ediv = obj_createAt(ep, "div", "epg_plus_container"); + __ediv.setAttribute("id", "epg_plus_container") g_i=0; window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); } @@ -193,10 +197,11 @@ function build_epg_plus_loop(_starttime, _stoptime) var __channel_id = getXMLNodeItemValue(_bouquet, "id"); var __short_channel_id = getXMLNodeItemValue(_bouquet, "short_id"); var __logo = getXMLNodeItemValue(_bouquet, "logo"); - var ep = $("epg_plus"); + var ep = $("epg_plus_container"); var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); var ch_name_with_logo= (g_logosURL!="")?"\""+__channel_name+"\"":__channel_name; + $(__bname_div).style.cssText = "width:"+c_width_px_bouquet+"px;"; $(__bname_div).update(""+ch_name_with_logo+""); build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime, __logo); window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 659312bb6..b392f10e3 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -648,6 +648,11 @@ tr { /* width:auto;*/ overflow:auto; } +#epg_plus_container { + overflow-y: scroll; + overflow-x: hidden; + max-height: 75vh; +} .ep_bouquet { margin: 0px; padding: 0px; @@ -658,8 +663,6 @@ tr { .ep_bouquet_name { background: #A1CCF2; border-right : #BBBBBB solid 1px; - width : 100px; -/* height: 1.3em;*/ overflow:hidden; padding-left: 1px; padding-right: 1px; @@ -724,7 +727,6 @@ tr { background-color : #DDDDDD; } .ep_time_bar { - width:100%; margin-bottom: 0px; position:relative; border-bottom : #BBBBBB solid 1px; From e6a854cdee9113e300f7d761f093ffeb5791eb18 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Feb 2016 19:45:37 +0100 Subject: [PATCH 082/690] yWeb: increase version Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/78f541aa845a3c2cebb2532c4178dc2327414002 Author: vanhofen Date: 2016-02-14 (Sun, 14 Feb 2016) Origin message was: ------------------ - yWeb: increase version --- src/nhttpd/web/Y_Version.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index f5569b0e8..94e4ffaf3 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.31 -date=13.02.2016 +version=2.9.0.32 +date=14.02.2016 type=Release info=Port CST From b3402292abf1fd0db02832472b4d19c854e8d169 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 15 Feb 2016 21:30:13 +0100 Subject: [PATCH 083/690] CFrameBuffer::getIconSize check if pic is icon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/90a3cecb062a4a1bc5b36aaff577a394f17231ec Author: Jacek Jendrzej Date: 2016-02-15 (Mon, 15 Feb 2016) --- src/driver/framebuffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index b6fbc4d59..4c77ed633 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1020,6 +1020,10 @@ void CFrameBuffer::getIconSize(const char * const filename, int* width, int *hei if(filename == NULL) return; + //check for full path, icon don't have full path, or ? + if (filename[0]== '/'){ + return; + } std::map::iterator it; From ecbbf4c29c0b1bd551d513d79dfda1c49ba8ea4c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Feb 2016 21:41:10 +0100 Subject: [PATCH 084/690] controlapi: rework epgsearch code * /control/epgsearch? or * /control/epgsearch?search=[&epginfo=false][&format=plain|xml|json] - add search-function to /control/epg * /control/epg?search= - mark /control/epgsearchxml as deprecated Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5997f42b7ea3b488e20fa51796077ff60c61f411 Author: vanhofen Date: 2016-02-15 (Mon, 15 Feb 2016) Origin message was: ------------------ - controlapi: rework epgsearch code * /control/epgsearch? or * /control/epgsearch?search=[&epginfo=false][&format=plain|xml|json] - add search-function to /control/epg * /control/epg?search= - mark /control/epgsearchxml as deprecated --- src/nhttpd/doc/nhttpd_controlapi.html | 54 +---- src/nhttpd/tuxboxapi/controlapi.cpp | 299 +++++++++++++++----------- src/nhttpd/tuxboxapi/controlapi.h | 1 + 3 files changed, 180 insertions(+), 174 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 4a215504f..d7ce3fba6 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -24,8 +24,8 @@ http://box_ip/control/epgsearch - EPG-Suche mit XML Ausgabe - http://box_ip/control/epgsearchxml + EPG-Suche mit XML Ausgabe + http://box_ip/control/epgsearchxml Die Box herunterfahren @@ -415,7 +415,7 @@ Beispiel:

Parameter: xml=true&channelid=<channel_id>|channelname=<channel_name> -[&details=true][&max=<max items>][&stoptime=<long:stop time>]
+[&details=true][&max=<max items>][&stoptime=<long:stop time>][&search=<keywords>]
Rückgabe:
Liefert zum angegebenen Sender (angegeben durch channel_id oder channel_name) das EPG als XML-Liste zurück.
@@ -509,13 +509,17 @@ USA 2005, mit Jerry Stiller, Kevin James, Leah Remini. 20 Min.
fsk:0
Soap/Melodram/Folklore
-Parameter: Suchbegriff;epginfo=false
+
+Parameter: Suchbegriffe
+oder
+Parameter: search=Suchbegriffe[&epginfo=false][&format=plain|xml|json]
Rückgabe:

Es werden alle Sendungen im EPG zurückgegeben, die den Suchbegriff
im Titel oder Beschreibungstext beinhalten.
Die Treffer lassen sich unter Angabe von epginfo=false auf Treffer im Titel beschränken.
Hier werden die Sendungsinhalte (info1 und info2) nicht mitgeliefert.
+Die Ausgabe erfolgt im angegebenen Format. Ist kein Format angegeben, wird reiner Text ausgegeben

Rückgabe-Format: Datum Startzeit Monat Wochentag Dauer in Minuten Sender Titel der Sendung

@@ -538,47 +542,9 @@ Nachrichten
-
EPG-Suche mit XML Ausgabe
-
Handler: http://box_ip/control/epgsearchxml
+
EPG-Suche mit XML Ausgabe Deprecated!
+
Handler: http://box_ip/control/epgsearchxml

-Parameter: keine
-Rückgabe:
-
-Es werden alle verfügbaren EPG-Daten aller Programme in einer XML zurückgegeben.
-
-Beispiel:
-
->>>http://box_ip/control/epgsearchxml
-<neutrino commandversion="1">
-<epgsearch>
-<channelname>Sparhandy TV</channelname>
-<epgtitle>Homeshopping mit SparhandyTV</epgtitle>
-<info1>SparhandyTV ist der neue Homeshopping-Kanal von Sparhandy und bietet Ihnen -attraktive und günstige Angebote rund um das Thema Mobilfunk.</info1>
-...
-
-Parameter: Suchbegriff;epginfo=false
-Rückgabe:
-
-Es werden alle Sendungen im EPG zurückgegeben, die den Suchbegriff
-im Titel oder Beschreibungstext beinhalten.
-Die Treffer lassen sich unter Angabe von epginfo=false auf Treffer im Titel beschränken.
-Hier werden die Sendungsinhalte (info1 und info2) nicht mitgeliefert.
-
-Rückgabe-Format: Datum Startzeit Monat Wochentag Dauer in Minuten Sender Titel der Sendung
-
-
-Beispiel:
-
->>>http://box_ip/control/epgsearchxml?Nachtmagazin&epginfo=false
-<neutrino commandversion="1">
-<epgsearch>
-<channelname>Das Erste HD</channelname>
-<epgtitle>Nachtmagazin</epgtitle>
-<fsk>0</fsk>
-<genre>Nachrichten</genre>
-
-
Die Box herunterfahren
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 2f2150406..6671dff1a 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1414,156 +1414,190 @@ extern const char * GetGenre(const unsigned char contentClassification); // UTF- void CControlAPI::EpgSearchXMLCGI(CyhookHandler *hh) { - EpgSearchCGI(hh, true); //xml_format = true + SendFoundEvents(hh, true); } +//------------------------------------------------------------------------- +/** Return EPG search data + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/epgsearch? + * or + * /control/epgsearch?search=[&epginfo=false][&format=plain|xml|json] + * @endcode + */ + +//------------------------------------------------------------------------- void CControlAPI::EpgSearchTXTCGI(CyhookHandler *hh) { - EpgSearchCGI(hh, false); //xml_format = false + SendFoundEvents(hh); } -void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_format ) +void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) { + if (hh->ParamList.empty()) + { + hh->SendError(); + return; + } + + std::string result; + std::string epgsearch = ""; t_channel_id channel_id; CChannelEventList evtlist; - if (!hh->ParamList.empty()) { - bool search_epginfo = true; - if (hh->ParamList["epginfo"] == "false") - search_epginfo = false; + bool search_epginfo = (hh->ParamList["epginfo"] != "false"); - const int m_search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; - std::string m_search_keyword = hh->ParamList["1"]; + std::string search_keyword = (hh->ParamList["search"].empty()) ? hh->ParamList["1"] : hh->ParamList["search"]; + const int search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; - if(xml_format){ - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - hh->WriteLn(""); - hh->WriteLn(""); - } - else{ - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default - } - - std::vector v; - int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio - for(int channel = 0; channel < channel_nr; channel++){ - channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->getChannelID(); - v.push_back(channel_id); - } - std::map ch_id_map; - std::vector::iterator it; - for (it = v.begin(); it != v.end(); ++it){ - ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; - } - CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann + if (xml_format) // to stay backward compatible :/ + hh->ParamList["format"] = "xml"; + TOutType outType = hh->outStart(); - if(!evtlist.empty()){ - std::map::iterator map_it; - CChannelEventList::iterator e; - for ( e=evtlist.begin(); e!=evtlist.end();++e){ - map_it = ch_id_map.find(e->channelID); - if (map_it != ch_id_map.end()){ - e->channelID = map_it->second;//map channelID48 to channelID - } - else{ - evtlist.erase(e--);// remove event for not found channels in channelList - } + /* TODO: maybe add following options as in tuxbox neutrino + hh->ParamList["epgitem"] + hh->ParamList["mode"] + hh->ParamList["channelid"] + hh->ParamList["channelname"] + hh->ParamList["bouquet"] + */ + + std::vector v; + int channel_nr = CNeutrinoApp::getInstance()->channelList->getSize(); //unique channelList TV or Radio + for (int channel = 0; channel < channel_nr; channel++) + { + channel_id = CNeutrinoApp::getInstance()->channelList->getChannelFromIndex(channel)->getChannelID(); + v.push_back(channel_id); + } + std::map ch_id_map; + std::vector::iterator it; + for (it = v.begin(); it != v.end(); ++it) + { + ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; + } + + CEitManager::getInstance()->getEventsServiceKey(0, evtlist, search_epg_item, search_keyword, true); + + if (!evtlist.empty()) + { + std::map::iterator map_it; + CChannelEventList::iterator e; + for (e = evtlist.begin(); e != evtlist.end(); ++e) + { + map_it = ch_id_map.find(e->channelID); + if (map_it != ch_id_map.end()) + { + e->channelID = map_it->second;//map channelID48 to channelID + } + else + { + evtlist.erase(e--);// remove event for not found channels in channelList } } - if(!evtlist.empty()){ - sort(evtlist.begin(),evtlist.end(),sortByDateTime); - } + } + if (!evtlist.empty()) + { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + } - time_t azeit=time(NULL); - CShortEPGData epg; - CEPGData longepg; - char tmpstr[256] ={0}; - std::string genere; - CChannelEventList::iterator eventIterator; - unsigned int u_azeit = ( azeit > -1)? azeit:0; - for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator){ - if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { - if( (eventIterator->startTime+eventIterator->duration) < u_azeit) - continue; - struct tm *tmStartZeit = localtime(&eventIterator->startTime); - if(xml_format){ - hh->printf("\t"); - hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()).c_str());; - hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.title.c_str()).c_str()); - if (search_epginfo) { - hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info1.c_str()).c_str()); - hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str()); - } - if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - hh->printf("\t\t%u\n", longepg.fsk); -#ifdef FULL_CONTENT_CLASSIFICATION - if (!longepg.contentClassification.empty()){ - genere = GetGenre(longepg.contentClassification[0]); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->printf("\t\t%s\n", genere.c_str()); - } -#else - if (longepg.contentClassification) { - genere = GetGenre(longepg.contentClassification); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->printf("\t\t%s\n", genere.c_str()); - } -#endif - } - strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); - hh->printf("\t\t%s\n", tmpstr); - strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); - hh->printf("\t\t\n", tmpstr); - hh->printf("\t\t%d\n", eventIterator->duration); - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",eventIterator->channelID); - hh->printf("\t\t\t%ld\n",eventIterator->eventID); - hh->printf("\t"); - }else{ - std::string datetimer_str ; - strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d %H:%M", tmStartZeit ); - datetimer_str = tmpstr; - datetimer_str += " "; - datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - datetimer_str += " "; - datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); - datetimer_str += tmpstr; - - hh->WriteLn(datetimer_str); - hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); - hh->WriteLn(epg.title); - if (search_epginfo) { - if(!epg.info1.empty()) - hh->WriteLn(epg.info1); - if(!epg.info2.empty()) - hh->WriteLn(epg.info2); - } - if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - hh->printf("fsk:%u\n", longepg.fsk); -#ifdef FULL_CONTENT_CLASSIFICATION - if (!longepg.contentClassification.empty()){ - genere = GetGenre(longepg.contentClassification[0]); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->WriteLn(genere); - } -#else - if (longepg.contentClassification) { - genere = GetGenre(longepg.contentClassification); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->WriteLn(genere); - } -#endif - } - hh->WriteLn("----------------------------------------------------------"); + time_t azeit=time(NULL); + CShortEPGData epg; + CEPGData longepg; + char tmpstr[256] ={0}; + std::string genre; + CChannelEventList::iterator eventIterator; + unsigned int u_azeit = ( azeit > -1)? azeit:0; + for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator) + { + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) + { + if( (eventIterator->startTime+eventIterator->duration) < u_azeit) + continue; + struct tm *tmStartZeit = localtime(&eventIterator->startTime); + result.clear(); + if (hh->outType == json || hh->outType == xml) + { + result += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); + result += hh->outPair("epgtitle", epg.title, true); + if (search_epginfo) { + result += hh->outPair("info1", hh->outValue(epg.info1), true); + result += hh->outPair("info2", hh->outValue(epg.info2), true); } + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) + { + result += hh->outPair("fsk", string_printf("%c", longepg.fsk), true); + genre = ""; +#ifdef FULL_CONTENT_CLASSIFICATION + if (!longepg.contentClassification.empty()) + genre = GetGenre(longepg.contentClassification[0]); +#else + if (longepg.contentClassification) + genre = GetGenre(longepg.contentClassification); +#endif + result += hh->outPair("genre", ZapitTools::UTF8_to_UTF8XML(genre.c_str()), true); + } + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); + result += hh->outPair("date", tmpstr, true); + strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); + result += hh->outPair("time", tmpstr, true); + result += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); + result += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); + result += hh->outPair("eventid", string_printf("%ld", eventIterator->eventID), false); + + epgsearch += hh->outCollection("epgsearch", result); + } + else // outType == plain + { + std::string datetimer_str ; + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d %H:%M", tmStartZeit ); + datetimer_str = tmpstr; + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); + datetimer_str += tmpstr; + + hh->WriteLn(datetimer_str); + hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); + hh->WriteLn(epg.title); + if (search_epginfo) { + if(!epg.info1.empty()) + hh->WriteLn(epg.info1); + if(!epg.info2.empty()) + hh->WriteLn(epg.info2); + } + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { + hh->printf("fsk:%u\n", longepg.fsk); +#ifdef FULL_CONTENT_CLASSIFICATION + if (!longepg.contentClassification.empty()){ + genre = GetGenre(longepg.contentClassification[0]); + genre = ZapitTools::UTF8_to_UTF8XML(genre.c_str()); + hh->WriteLn(genre); + } +#else + if (longepg.contentClassification) { + genre = GetGenre(longepg.contentClassification); + genre = ZapitTools::UTF8_to_UTF8XML(genre.c_str()); + hh->WriteLn(genre); + } +#endif + } + hh->WriteLn("----------------------------------------------------------"); } } - if(xml_format) - hh->printf(""); - }else - hh->SendError(); - + } + if (outType == json) { + hh->WriteLn(json_out_success(epgsearch)); + } + else if (outType == xml) { + epgsearch = hh->outCollection("neutrino", epgsearch); // to stay backward compatible :/ + hh->WriteLn(epgsearch); + } } //------------------------------------------------------------------------- @@ -1575,6 +1609,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_format ) * /control/epg * /control/epg? 64Bit, hex * /control/epg?id= + * /control/epg?search= * /control/epg?eventid= * /control/epg?ext * /control/epg?xml=true&channelid=|channelname=[&details=true][&max=][&stoptime=] @@ -1618,6 +1653,10 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } } } + else if (!hh->ParamList["search"].empty()) + { + SendFoundEvents(hh, (!hh->ParamList["xml"].empty() || hh->ParamList["format"] == "xml")); + } // query details for given eventid else if (!hh->ParamList["eventid"].empty()) { //special epg query diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 33287b6e0..23a95e61b 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -31,6 +31,7 @@ private: // send functions for ExecuteCGI (controld api) void SendEventList(CyhookHandler *hh,t_channel_id channel_id); + void SendFoundEvents(CyhookHandler *hh, bool xml_format = false); void SendcurrentVAPid(CyhookHandler *hh); void SendAllCurrentVAPid(CyhookHandler *hh); void SendStreamInfo(CyhookHandler *hh); From 93ca43e9b6f934d4792bed11f019bed6c9fbfa67 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 16 Feb 2016 14:15:28 +0800 Subject: [PATCH 085/690] src/gui/videosettings.cpp: fix analog video settings for all HD2 series boxes. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6313aa5eb7dd730fc23d3ac26368a55e33ab33f8 Author: [CST] Bas Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/videosettings.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index d2d3b1b37..144d6bfa1 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -128,8 +128,8 @@ const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_HD1_OPTIONS[VIDEOMENU_VID { ANALOG_MODE(CINCH,HD,YPRPB), LOCALE_VIDEOMENU_ANALOG_HD_YPRPB_CINCH } }; -#define VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT 6 -const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_TANK_OPTIONS[VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT] = +#define VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT 6 +const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_HD2_OPTIONS[VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT] = { { ANALOG_MODE(BOTH ,xD,AUTO ),LOCALE_VIDEOMENU_ANALOG_AUTO }, /* Encoder automatically adjusts based on content */ { ANALOG_MODE(BOTH ,xD,CVBS ),LOCALE_VIDEOMENU_ANALOG_CVBS }, /* CVBS on SCART (disables fastblank, un-used dacs) */ @@ -249,20 +249,17 @@ int CVideoSettings::showVideoSetup() } else if (system_rev > 0x06) { -#ifdef ANALOG_MODE - if (system_rev == 9 || system_rev == 11 || system_rev == 12) { // Tank, Trinity, Zee2 - vs_analg_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_ANALOG_MODE, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_TANK_OPTIONS, VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT, true, this); - vs_analg_ch->setHint("", LOCALE_MENU_HINT_VIDEO_ANALOG_MODE); - } else -#endif - { - if(system_rev != 10) { - vs_scart_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_SCART, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTION_COUNT, true, this); - vs_scart_ch->setHint("", LOCALE_MENU_HINT_VIDEO_SCART_MODE); - } - vs_chinch_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_CINCH, &g_settings.analog_mode2, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTION_COUNT, true, this); - vs_chinch_ch->setHint("", LOCALE_MENU_HINT_VIDEO_CINCH_MODE); +#if defined(BOXMODEL_APOLLO) && defined(ANALOG_MODE) + vs_analg_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_ANALOG_MODE, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD2_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT, true, this); + vs_analg_ch->setHint("", LOCALE_MENU_HINT_VIDEO_ANALOG_MODE); +#else + if(system_rev != 10) { + vs_scart_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_SCART, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTION_COUNT, true, this); + vs_scart_ch->setHint("", LOCALE_MENU_HINT_VIDEO_SCART_MODE); } + vs_chinch_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_CINCH, &g_settings.analog_mode2, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTION_COUNT, true, this); + vs_chinch_ch->setHint("", LOCALE_MENU_HINT_VIDEO_CINCH_MODE); +#endif } //4:3 mode From b7ebaf74b9a4b3899de1e185ec252791bd0c8eea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Feb 2016 18:38:29 +0100 Subject: [PATCH 086/690] Create README.md Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2930bc60fd7a931c973ca33ed5363a7075927788 Author: vanhofen Date: 2016-02-11 (Thu, 11 Feb 2016) --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..bc8176e3b --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Neutrino-HD ツ From a50e93a5322123b089d4963bb24d97be496504b7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 2 Feb 2016 11:44:13 +0100 Subject: [PATCH 087/690] CTextBox: fix missing init of old bg color Avoids possible usage of wrong color after init. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d1780486d8c32d14ecbe20457e302f2b043e26a Author: Thilo Graf Date: 2016-02-02 (Tue, 02 Feb 2016) --- src/gui/widget/textbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5f33a725e..0095155d0 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -97,7 +97,7 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, //TRACE(" CTextBox::m_cText: %d, m_nMode %d\t\r\n",m_cText.size(),m_nMode); - m_textBackgroundColor = textBackgroundColor; + m_textBackgroundColor = m_old_textBackgroundColor = textBackgroundColor; m_nFontTextHeight = getFontTextHeight(); //TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__); From 50ad3195a93062f734a0b38697a99e163ae66c16 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 Feb 2016 12:19:49 +0100 Subject: [PATCH 088/690] CComponentsPicture: add member to get current image name Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/65fe634e85d10022161e9de0005149396ac82ce8 Author: Thilo Graf Date: 2016-02-03 (Wed, 03 Feb 2016) --- src/gui/components/cc_item_picture.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index a1865bcef..5a790d056 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -136,6 +136,8 @@ class CComponentsPicture : public CComponentsItem virtual void setPicture(const std::string& picture_name); ///sets an image name (unscaled icons only), full image path or url to an image file virtual void setPicture(const char* picture_name); + ///returns current assigned image name + std::string getPictureName(){return pic_name;} ///handle image size virtual void getSize(int* width_image, int *height_image); From 47b4ea481cb862fd478acbbdbd61501c751cc2b1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 Feb 2016 21:20:21 +0100 Subject: [PATCH 089/690] CTextBox: don't paint full background if max text width smaller than bg width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/342de45cc3f7dc65863441e1506e47d89c60b0de Author: Thilo Graf Date: 2016-02-10 (Wed, 10 Feb 2016) --- src/gui/widget/textbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 0095155d0..0fc38b141 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_cFrameTextRel.iWidth; + int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,7 +602,8 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); - frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + //paint full background only on new text, otherwise paint required background + frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } } else{ From f48a2a49e9179526935e989bce27ffa0207827ea Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 Feb 2016 15:04:58 +0100 Subject: [PATCH 090/690] CTestMenu: disable unused vars prevents possible compiler warnings or builderrors with pedantic gcc settings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ff903f7a68f2a935bb3af25ddcd7e06a61e6c22 Author: Thilo Graf Date: 2016-02-07 (Sun, 07 Feb 2016) --- src/gui/test_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 4cce0bbe6..02e839237 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -107,7 +107,7 @@ CTestMenu::~CTestMenu() delete scrollbar; } -static int test_pos[4] = { 130, 192, 282, 360 }; +//static int test_pos[4] = { 130, 192, 282, 360 }; int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) { From 4e5d4c83de735400e47ca625b5842910a5fff04d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 Feb 2016 21:06:20 +0100 Subject: [PATCH 091/690] CProgressBar: ensure also repaint of progressbar if item is not painted Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33089b9bc0674fc8f3811258eed15beb7f33e2aa Author: Thilo Graf Date: 2016-02-10 (Wed, 10 Feb 2016) --- src/gui/components/cc_item_progressbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index f5234ac2d..5bf56adff 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -464,7 +464,7 @@ void CProgressBar::paintProgress(bool do_save_bg) bool pb_invert = (pb_type == PB_REDRIGHT) || ((pb_type == PB_TIMESCALE) && g_settings.progressbar_timescale_invert); if (cc_allow_paint){ - if (pb_active_width != pb_last_width) { + if (!is_painted || (pb_active_width != pb_last_width)) { CProgressBarCache *pbc = CProgressBarCache::pbcLookup(pb_height, pb_max_width, pb_active_col, pb_passive_col, *pb_design, pb_invert, *pb_gradient, pb_red, pb_yellow, pb_green); if (pbc) pbc->pbcPaint(pb_x, pb_y, pb_active_width, pb_passive_width); From d9c9e3c458c30d77634a98abe25671324564887f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 16 Feb 2016 09:34:53 +0100 Subject: [PATCH 092/690] COPKGManager: add define for feed setup, default disabled at the moment. Is still not matured. User or Imageproviders should do this manually. btw. : input window for paths or url's is limited and can't handle long names. Rework of input window is required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9a2b46b3bf9cfe1ba171a67f994a1f7ec095d05 Author: Thilo Graf Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/opkg_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 46c1ad00e..b3590f6fe 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -524,14 +524,14 @@ int COPKGManager::showMenu() fw = new CMenuForwarder(LOCALE_OPKG_INSTALL_LOCAL_PACKAGE, true, NULL, this, "local_package", CRCInput::RC_green); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_INSTALL_LOCAL_PACKAGE); menu->addItem(fw); - +#if ENABLE_OPKG_GUI_FEED_SETUP //feed setup CMenuWidget feeds_menu(LOCALE_OPKG_TITLE, NEUTRINO_ICON_UPDATE, w_max (100, 10)); showMenuConfigFeed(&feeds_menu); fw = new CMenuForwarder(LOCALE_OPKG_FEED_ADDRESSES, true, NULL, &feeds_menu, NULL, CRCInput::RC_www); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_FEED_ADDRESSES_EDIT); menu->addItem(fw); - +#endif menu->addItem(GenericMenuSeparatorLine); menu_offset = menu->getItemsCount(); From 7bcb7eb06c46186fb7c4a06ac939feb36ef3185e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 31 Jan 2016 20:08:40 +0100 Subject: [PATCH 093/690] CComponentsPicture: ensure cache cleanup on missing image while runtime Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e4ad83305a50daedc232dda622cb06eff6eef3b Author: Thilo Graf Date: 2016-01-31 (Sun, 31 Jan 2016) --- src/gui/components/cc_item_picture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index b6e0d1b82..eeb705f39 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -256,8 +256,10 @@ void CComponentsPicture::paintPicture() y_pic += fr_thickness; initCCItem(); - if (pic_name.empty()) + if (pic_name.empty()){ + clearCache(); return; + } if (cc_allow_paint){ dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); From e57763b9593cfb3b7adee8babfc12fc1d8c4f3a7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 Feb 2016 10:38:06 +0100 Subject: [PATCH 094/690] CComponentsPicture: add some debug messages to track caching Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/82e2a168f11aad8f0bdb50b88cdc219e488e181e Author: Thilo Graf Date: 2016-02-03 (Wed, 03 Feb 2016) --- src/gui/components/cc_item_picture.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index eeb705f39..43ecb2e64 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -99,6 +99,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, void CComponentsPicture::clearCache() { if (image_cache){ + dprintf(DEBUG_DEBUG, "\033[32m[CComponentsPicture] %s - %d: clean up image cache %s\033[0m\n", __func__, __LINE__, pic_name.c_str()); delete[] image_cache; image_cache = NULL; } @@ -140,7 +141,7 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) void CComponentsPicture::initCCItem() { if (pic_name.empty()){ - dprintf(DEBUG_INFO, "[CComponentsPicture] %s - %d : no image file assigned...\n", __func__, __LINE__); + dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s - %d : no image file assigned...\n", __func__, __LINE__); return; } @@ -262,7 +263,6 @@ void CComponentsPicture::paintPicture() } if (cc_allow_paint){ - dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); if (image_cache == NULL){ frameBuffer->SetTransparent(image_transparent); if (do_scale) @@ -270,9 +270,12 @@ void CComponentsPicture::paintPicture() else is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); frameBuffer->SetTransparentDefault(); - if (enable_cache) + if (enable_cache){ + dprintf(DEBUG_DEBUG, "\033[31m[CComponentsPicture] %s - %d: create cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); image_cache = getScreen(x_pic, y_pic, width, height); + } }else{ + dprintf(DEBUG_DEBUG, "\033[36m[CComponentsPicture] %s - %d: paint cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); frameBuffer->RestoreScreen(x_pic, y_pic, width, height, image_cache); } } From bcbd30325d4e725fb5a91c743fdf8f460415a135 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 Feb 2016 08:58:32 +0100 Subject: [PATCH 095/690] CComponentsPicture: try to rework init behavior inside object need_init var shoul help to avoid not required inits. Size of cached image are packed into own vars, should avoid possible overwriting with current dimensions. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/93777853f045197e339dd7ba1b214d7b1056c934 Author: Thilo Graf Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/gui/components/cc_item_picture.cpp | 45 +++++++++++++++++++------- src/gui/components/cc_item_picture.h | 10 ++++-- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 43ecb2e64..893301c43 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -72,10 +72,10 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, cc_item_type = CC_ITEMTYPE_PICTURE; //CComponents - x = x_pos; - y = y_pos; - width = dx = w; - height = dy = h; + x = x_old = x_pos; + y = y_old = y_pos; + width = dx = dxc = w; + height = dy = dyc = h; pic_name = pic_name_old = image_name; shadow = shadow_mode; shadow_w = SHADOW_OFFSET; @@ -91,7 +91,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, cc_paint_cache = false; //bg keep_dx_aspect = false; keep_dy_aspect = false; - + need_init = true; initCCItem(); initParent(parent); } @@ -109,6 +109,7 @@ void CComponentsPicture::setPicture(const std::string& picture_name) { if (pic_name == picture_name) return; + need_init = true; clearCache(); pic_name = picture_name; initCCItem(); @@ -124,7 +125,10 @@ void CComponentsPicture::setPicture(const char* picture_name) void CComponentsPicture::setWidth(const int& w, bool keep_aspect) { - CComponentsItem::setWidth(w), + CComponentsItem::setWidth(w); + if (w == width && keep_aspect == keep_dy_aspect) + return; + need_init = true; do_scale = true; keep_dy_aspect = keep_aspect; initCCItem(); @@ -132,7 +136,10 @@ void CComponentsPicture::setWidth(const int& w, bool keep_aspect) void CComponentsPicture::setHeight(const int& h, bool keep_aspect) { - CComponentsItem::setHeight(h), + CComponentsItem::setHeight(h); + if (h == height && keep_aspect == keep_dx_aspect) + return; + need_init = true; do_scale = true; keep_dx_aspect = keep_aspect; initCCItem(); @@ -140,10 +147,11 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) void CComponentsPicture::initCCItem() { - if (pic_name.empty()){ + if (pic_name.empty() || !need_init){ dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s - %d : no image file assigned...\n", __func__, __LINE__); return; } + need_init = false; //avoid new init if not required //check for path or name, set icon or image with full path, has no path, then use as icon and disble scale mode string::size_type pos = pic_name.find("/", 0); @@ -255,6 +263,7 @@ void CComponentsPicture::paintPicture() initPosition(&x_pic, &y_pic); x_pic += fr_thickness; y_pic += fr_thickness; + initCCItem(); if (pic_name.empty()){ @@ -272,11 +281,13 @@ void CComponentsPicture::paintPicture() frameBuffer->SetTransparentDefault(); if (enable_cache){ dprintf(DEBUG_DEBUG, "\033[31m[CComponentsPicture] %s - %d: create cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); - image_cache = getScreen(x_pic, y_pic, width, height); + dxc = width; + dyc = height; + image_cache = getScreen(x_pic, y_pic, dxc, dyc); } }else{ dprintf(DEBUG_DEBUG, "\033[36m[CComponentsPicture] %s - %d: paint cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); - frameBuffer->RestoreScreen(x_pic, y_pic, width, height, image_cache); + frameBuffer->RestoreScreen(x_pic, y_pic, dxc, dyc, image_cache); } } @@ -350,6 +361,9 @@ void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& } void CComponentsChannelLogo::setAltLogo(const std::string& picture_name) { + if (alt_pic_name == picture_name) + return; + need_init = true; alt_pic_name = picture_name; channel_id = 0; channel_name = ""; @@ -368,7 +382,16 @@ void CComponentsChannelLogo::setAltLogo(const char* picture_name) void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { - channel_id = channelId; + if (channel_id) + if (channel_id == channelId) + return; + channel_id = channelId; + + if (!channel_name.empty()) + if (channel_name == channelName) + return; + + need_init = true; channel_name = channelName; int dummy; diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 5a790d056..4708d1742 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -58,6 +58,9 @@ class CComponentsPicture : public CComponentsItem ///current original image dimensions int dx, dy; + ///cached image dimensions + int dxc, dyc; + ///property: name of image (without extensionn) full path to image (with extension), icon names to find in /widget/icons.h, icons will paint never scaled std::string pic_name, pic_name_old; @@ -75,6 +78,8 @@ class CComponentsPicture : public CComponentsItem ///sets internal option for keeping aspect, see also setHeight(), setWidth(), default value = false bool keep_dx_aspect; bool keep_dy_aspect; + ///helper: indicate for reinit + bool need_init; void init( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, @@ -151,9 +156,9 @@ class CComponentsPicture : public CComponentsItem ///set height of object and image, value >0 causes scale of image, parameter keep_aspect = true causes scaling of width with same aspect, , default = false virtual void setHeight(const int& h, bool keep_aspect = false); ///set width of object and image related to current screen size, see also CComponentsItem::setWidthP(), parameter as uint8_t - virtual void setWidthP(const uint8_t& w_percent){CComponentsItem::setWidthP(w_percent), do_scale = true; initCCItem();} + virtual void setWidthP(const uint8_t& w_percent){CComponentsItem::setWidthP(w_percent), do_scale = true; need_init = hasChanges(); initCCItem();} ///set height of object and image related to current screen size, see also CComponentsItem::setHeightP(), parameter as uint8_t - virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; initCCItem();} + virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; need_init = hasChanges(); initCCItem();} ///return paint mode of internal image, true=image was painted, please do not to confuse with isPainted()! isPainted() is related to item itself. virtual inline bool isPicPainted(){return is_image_painted;}; @@ -249,6 +254,7 @@ class CComponentsChannelLogo : public CComponentsPicture ///set channel id and/or channel name, NOTE: channel name is prefered void setChannel(const uint64_t& channelId, const std::string& channelName); + uint64_t getChannelID(){return channel_id;} ///set an alternate logo if no logo is available NOTE: value of has_logo will set to true void setAltLogo(const std::string& picture_name); From 486cc04a53c7c8f5104e7d4b8e19083816f4b657 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 Feb 2016 14:41:37 +0100 Subject: [PATCH 096/690] CComponentsPicture: add more comments an debug lines, remove useless init Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ed5b5b886544fd6c5018085349f39903522a4e5 Author: Thilo Graf Date: 2016-02-07 (Sun, 07 Feb 2016) --- src/gui/components/cc_item_picture.cpp | 53 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 893301c43..c0828fbcd 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -148,10 +148,11 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) void CComponentsPicture::initCCItem() { if (pic_name.empty() || !need_init){ - dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s - %d : no image file assigned...\n", __func__, __LINE__); + dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s - %d : no init required [file: %s] [need init: %d]...\n", __func__, __LINE__, pic_name.c_str(), need_init); return; } - need_init = false; //avoid new init if not required + //reset condition for new init + need_init = false; //check for path or name, set icon or image with full path, has no path, then use as icon and disble scale mode string::size_type pos = pic_name.find("/", 0); @@ -163,8 +164,13 @@ void CComponentsPicture::initCCItem() //use image/icon size as object dimension values frameBuffer->getIconSize(pic_name.c_str(), &width, &height); - /*if we have an image with full path => fallback to pv methode. + /* frameBuffer->getIconSize() normally evaluates only icon names, no paths. + * So it is possible that we have wrong dimension values. + * So we fall back to picture viewer methode. * That's always a cramp, why we don't have an unified solution in render classes? + * Anyway...this is only a workaround, otherwies it is possible, that dimension values are wrong or = 0 and + * this could lead to problems if external items are reliant on these values, + * and in worst case, no image would be painted! */ if (width == 0 || height == 0){ int dx_tmp, dy_tmp; @@ -174,35 +180,47 @@ void CComponentsPicture::initCCItem() if (height == 0) height = dy_tmp; } + /* leave init methode here if we in no scale mode + * otherwise goto next step! + */ return; } - else{ //initialized scaled size - //first get real image dimensions + else{ /* Here we are in scale mode + * first check current item dimensions (width/height) and for different values and + * check internal dimension values (dx/dy) and ensure that values are >0 + * real image size + */ if ((dx != width || dy != height) || (dx == 0 || dy == 0)) g_PicViewer->getSize(pic_name.c_str(), &dx, &dy); } - //ensure filled inital values + /* on next step check item dimensions (width/height) for 0 values + * and fill with current internal (dx/dy) dimension values. + * values <= 0 are not allowed + */ if (width == 0) width = dx; if (height == 0) height = dy; - //check dimensions, leave if dimensions are equal + /* on next step, check dimensions and + * leave if dimensions are equal + */ if (width == dx && height == dy) return; -#if 0 - //clean up possible cache on changed dimensions - clearCache(); -#endif - //temporarily vars + + + /* finally handle scale behavior + * This evaluates the parameters given + * by setters setWidth/setHeight + */ + //resize image and apply current assigned scale values int w_2scale = width; int h_2scale = height; - - //resize image and set current dimensions g_PicViewer->rescaleImageDimensions(&width, &height, w_2scale, h_2scale); - //handle aspect ratio + /* these steps are required to assign the current image dimensions to item dimensions + */ if (keep_dx_aspect){ float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); @@ -231,7 +249,6 @@ void CComponentsPicture::initPosition(int *x_position, int *y_position) void CComponentsPicture::getSize(int* width_image, int *height_image) { - initCCItem(); *width_image = width; *height_image = height; } @@ -281,8 +298,8 @@ void CComponentsPicture::paintPicture() frameBuffer->SetTransparentDefault(); if (enable_cache){ dprintf(DEBUG_DEBUG, "\033[31m[CComponentsPicture] %s - %d: create cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); - dxc = width; - dyc = height; + dxc = width-2*fr_thickness; + dyc = height-2*fr_thickness; image_cache = getScreen(x_pic, y_pic, dxc, dyc); } }else{ From b4d3bab5d075eb9e2ce53b0498ec64513f290269 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 Feb 2016 23:36:19 +0100 Subject: [PATCH 097/690] CComponentsPicture: use clearCache() in destructor for unified handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e646734f3c1491353b9f691f640254c7aa9f2ae Author: Thilo Graf Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/gui/components/cc_item_picture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 4708d1742..da8befa29 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -134,7 +134,7 @@ class CComponentsPicture : public CComponentsItem int transparent = CFrameBuffer::TM_NONE); virtual~CComponentsPicture() { - delete[]image_cache; + clearCache(); } ///sets an image name (unscaled icons only), full image path or url to an image file From 862b4cec54230e35f3891b9d6c6711da670a80d2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 8 Feb 2016 21:14:41 +0100 Subject: [PATCH 098/690] CComponentsPicture: move resize to end of methode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/96f9eaf287ce584a673d18a661eae7e10b7daab7 Author: Thilo Graf Date: 2016-02-08 (Mon, 08 Feb 2016) --- src/gui/components/cc_item_picture.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c0828fbcd..0dc7abb45 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -109,6 +109,8 @@ void CComponentsPicture::setPicture(const std::string& picture_name) { if (pic_name == picture_name) return; + width = dx = dxc = 0; + height = dy = dyc = 0; need_init = true; clearCache(); pic_name = picture_name; @@ -209,17 +211,10 @@ void CComponentsPicture::initCCItem() if (width == dx && height == dy) return; - /* finally handle scale behavior * This evaluates the parameters given * by setters setWidth/setHeight - */ - //resize image and apply current assigned scale values - int w_2scale = width; - int h_2scale = height; - g_PicViewer->rescaleImageDimensions(&width, &height, w_2scale, h_2scale); - - /* these steps are required to assign the current image dimensions to item dimensions + * these steps are required to assign the current image dimensions to item dimensions */ if (keep_dx_aspect){ float h_ratio = float(height)*100/(float)dy; @@ -233,6 +228,11 @@ void CComponentsPicture::initCCItem() float w_ratio = float(width)*100/(float)dx; height = int(w_ratio*(float)dy/100); } + + //resize image and apply current assigned scale values + int w_2scale = width; + int h_2scale = height; + g_PicViewer->rescaleImageDimensions(&width, &height, w_2scale, h_2scale); } void CComponentsPicture::initPosition(int *x_position, int *y_position) From f2890c0051f1cf77375b48175f823eb43ddb5c8d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 16 Feb 2016 10:22:05 +0100 Subject: [PATCH 099/690] CComponentsPicture: allow image cache only for scaled images Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8be980b621775f4c253073e86750dcf13b8858c8 Author: Thilo Graf Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/components/cc_item_picture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 0dc7abb45..91f59a9b5 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -296,7 +296,7 @@ void CComponentsPicture::paintPicture() else is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); frameBuffer->SetTransparentDefault(); - if (enable_cache){ + if (enable_cache && do_scale){ dprintf(DEBUG_DEBUG, "\033[31m[CComponentsPicture] %s - %d: create cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); dxc = width-2*fr_thickness; dyc = height-2*fr_thickness; From 118b991a0ec12ddf13a21a5447a6f7a4eec3b36c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 Feb 2016 09:05:37 +0100 Subject: [PATCH 100/690] CMovieBrowser: consider small cover images Should prevent oversized upscale of very small images. Maximal used size is the half height of epg box. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb0210801a09274b7452900ccc39ac4aea9c95c0 Author: Thilo Graf Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/gui/moviebrowser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 3374a860a..09a005215 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1395,6 +1395,10 @@ void CMovieBrowser::refreshMovieInfo(void) ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2; if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio 16/9 or 4/3 pic = new CComponentsPicture(lx+2, ly+1, fname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTSELECTED_PLUS_0); + if (pic->getHeight() < flogo_h/2){ + flogo_h = flogo_h/2; + pic->setYPos(m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2); + } pic->setHeight(flogo_h, true); /*flogo_w*/ pic->enableFrame(true, 2); pic->enableCache(); From f67714e6dfadd8776a9162b419a9d54a9b21a323 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 Feb 2016 22:59:17 +0100 Subject: [PATCH 101/690] CMovieBrowser: avoid multiple slot connections Do connect only to empty signal. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/649e85b5ed1fd36e9d62eb6efd3caa285f19dd53 Author: Thilo Graf Date: 2016-02-05 (Fri, 05 Feb 2016) --- src/gui/moviebrowser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 09a005215..5b87510e0 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1408,7 +1408,8 @@ void CMovieBrowser::refreshMovieInfo(void) flogo_w = pic->getWidth(); pic->setXPos(m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -12); if (!m_movieSelectionHandler->epgInfo2.empty()) - m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); + if (m_pcInfo->OnAfterScrollPage.empty()) + m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); }else{ delete pic; pic = NULL; From 03580477e088907298151288cf8386df47a2aac9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 Feb 2016 14:42:49 +0100 Subject: [PATCH 102/690] CMovieBrowser: use smaller size for cover and enable shadow and frame Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c80b4d2412fd5a22d9cf5a5dc495a5e48700e592 Author: Thilo Graf Date: 2016-02-07 (Sun, 07 Feb 2016) --- src/gui/moviebrowser.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 5b87510e0..d9577f7ec 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1343,7 +1343,7 @@ void CMovieBrowser::refreshMovieInfo(void) int flogo_w = 0, flogo_h = 0; if (logo_ok) { flogo_w = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); - flogo_h = m_cBoxFrameInfo.iHeight; + flogo_h = m_cBoxFrameInfo.iHeight*90/100; } static int logo_w = 0; @@ -1391,13 +1391,13 @@ void CMovieBrowser::refreshMovieInfo(void) } if (m_settings.gui != MB_GUI_FILTER && logo_ok) { - lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14; - ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2; - if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio 16/9 or 4/3 - pic = new CComponentsPicture(lx+2, ly+1, fname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTSELECTED_PLUS_0); + lx = m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w -14; + ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; + if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio HD 16/9 + pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); if (pic->getHeight() < flogo_h/2){ flogo_h = flogo_h/2; - pic->setYPos(m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2); + pic->setYPos(m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2); } pic->setHeight(flogo_h, true); /*flogo_w*/ pic->enableFrame(true, 2); @@ -1405,15 +1405,18 @@ void CMovieBrowser::refreshMovieInfo(void) pic->doPaintBg(false); }else pic->setPicture(fname); + flogo_w = pic->getWidth(); - pic->setXPos(m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -12); + pic->setXPos(m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -24); + if (!m_movieSelectionHandler->epgInfo2.empty()) if (m_pcInfo->OnAfterScrollPage.empty()) m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); }else{ - delete pic; - pic = NULL; + if (pic) + delete pic; pic = NULL; } + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, logo_ok ? m_cBoxFrameInfo.iWidth-flogo_w-20 : 0); if (pic) pic->paint(CC_SAVE_SCREEN_NO); From bc7a04e5047f953581b7a805ed7a488c603c58eb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 16 Feb 2016 10:31:13 +0100 Subject: [PATCH 103/690] CMovieBrowser: try to fix cover arangement Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/73ba44155a2ce2cc4b270ad47fe488d4b64f2494 Author: Thilo Graf Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/moviebrowser.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index d9577f7ec..e4a88e330 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1390,6 +1390,13 @@ void CMovieBrowser::refreshMovieInfo(void) newHeader = false; } + if (pic){ + if (pic->getPictureName() != fname || !logo_ok){ + delete pic; pic = NULL; + } + } + + int max_txt_width = 0; if (m_settings.gui != MB_GUI_FILTER && logo_ok) { lx = m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w -14; ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; @@ -1399,25 +1406,20 @@ void CMovieBrowser::refreshMovieInfo(void) flogo_h = flogo_h/2; pic->setYPos(m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2); } - pic->setHeight(flogo_h, true); /*flogo_w*/ + pic->setHeight(flogo_h, true); pic->enableFrame(true, 2); - pic->enableCache(); pic->doPaintBg(false); - }else - pic->setPicture(fname); - - flogo_w = pic->getWidth(); - pic->setXPos(m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -24); - + flogo_w = pic->getWidth(); + max_txt_width = m_cBoxFrameInfo.iWidth - flogo_w - 24; + pic->setXPos(m_cBoxFrameInfo.iX + max_txt_width); + } +#if 0 if (!m_movieSelectionHandler->epgInfo2.empty()) if (m_pcInfo->OnAfterScrollPage.empty()) m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); - }else{ - if (pic) - delete pic; pic = NULL; +#endif } - - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, logo_ok ? m_cBoxFrameInfo.iWidth-flogo_w-20 : 0); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, max_txt_width); if (pic) pic->paint(CC_SAVE_SCREEN_NO); } From ac7d8d670dba208d683ed5e16b5624425799ae64 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 16 Feb 2016 11:11:38 +0100 Subject: [PATCH 104/690] CInfoViewerBB: try to fix repaint of sys scales after channel switch Reset should force repaint and scales should be always visible after footer paint. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3dc56386f52616ccff091aef30afd6a95af08c23 Author: Thilo Graf Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/infoviewer_bb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 37bddb429..66a7fa335 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -703,6 +703,7 @@ void CInfoViewerBB::showSysfsHdd() void CInfoViewerBB::showBarSys(int percent) { if (is_visible){ + sysscale->reset(); sysscale->doPaintBg(false); sysscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6); sysscale->setValues(percent, 100); @@ -713,6 +714,7 @@ void CInfoViewerBB::showBarSys(int percent) void CInfoViewerBB::showBarHdd(int percent) { if (is_visible) { + hddscale->reset(); hddscale->doPaintBg(false); if (percent >= 0){ hddscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6); @@ -720,7 +722,6 @@ void CInfoViewerBB::showBarHdd(int percent) hddscale->paint(); }else { frameBuffer->paintBoxRel(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6, COL_INFOBAR_BUTTONS_BACKGROUND); - hddscale->reset(); } } } From dc832e6eea0c53b99529f86ff71a905251ae2212 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Feb 2016 12:59:43 +0100 Subject: [PATCH 105/690] pictureviewer.cpp fix possible memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/93f3007be1f7734359cc9ba803f97116a06d0fd3 Author: Jacek Jendrzej Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/driver/pictureviewer/pictureviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 17d07c89b..c13ce7251 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -446,6 +446,7 @@ void CPictureViewer::showBusy (int sx, int sy, int width, char r, char g, char b m_busy_buffer = (unsigned char *) malloc (width * width * cpp); if (m_busy_buffer == NULL) { dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: malloc\n", __func__, __LINE__); + cs_free_uncached (fb_buffer); return; } busy_buffer_wrk = m_busy_buffer; From 192e734f6be1b0ab23ffc5712803851dbc9a3f65 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Feb 2016 13:02:10 +0100 Subject: [PATCH 106/690] (performance) Prefer prefix ++/-- operators for non-primitive types Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7db16952f69b43d1c13628e7e7b5a72e3da25e46 Author: Jacek Jendrzej Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/driver/streamts.cpp | 4 ++-- src/gui/eventlist.cpp | 2 +- src/gui/filebrowser.cpp | 2 +- src/gui/moviebrowser.cpp | 2 +- src/gui/opkg_manager.cpp | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 118e980b0..c4c7f4326 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -308,7 +308,7 @@ CFrontend * CStreamManager::FindFrontend(CZapitChannel * channel) for (streammap_iterator_t it = streams.begin(); it != streams.end(); ++it) frontends.insert(it->second->frontend); - for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ft++) + for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ++ft) CFEManager::getInstance()->lockFrontend(*ft); frontend = CFEManager::getInstance()->allocateFE(channel, true); @@ -342,7 +342,7 @@ CFrontend * CStreamManager::FindFrontend(CZapitChannel * channel) } CFEManager::getInstance()->Lock(); - for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ft++) + for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ++ft) CFEManager::getInstance()->unlockFrontend(*ft); if (unlock) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7f6560d49..756941dff 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1144,7 +1144,7 @@ bool CEventList::findEvents(void) if(!m_search_keyword.empty()){ g_settings.epg_search_history.push_front(m_search_keyword); std::list::iterator it = g_settings.epg_search_history.begin(); - it++; + ++it; while (it != g_settings.epg_search_history.end()) { if (*it == m_search_keyword) it = g_settings.epg_search_history.erase(it); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index fa2485457..c3a4be147 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -322,7 +322,7 @@ void CFileBrowser::ChangeDir(const std::string & filename, int selection) readDir(newpath, &allfiles); // filter CFileList::iterator file = allfiles.begin(); - for(; file != allfiles.end() ; file++) + for(; file != allfiles.end() ; ++file) { if (Filter != NULL && !file->isDir() && use_filter) { diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index e4a88e330..b0a51b27d 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -3887,7 +3887,7 @@ bool CMovieBrowser::showYTMenu(bool calledExternally) m_settings.ytmode = newmode; m_settings.ytsearch_history.push_front(search); std::list::iterator it = m_settings.ytsearch_history.begin(); - it++; + ++it; while (it != m_settings.ytsearch_history.end()) { if (*it == search) it = m_settings.ytsearch_history.erase(it); diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index b3590f6fe..4afbe1df4 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -394,7 +394,7 @@ void COPKGManager::updateMenu() bool upgradesAvailable = false; getPkgData(OM_LIST_INSTALLED); getPkgData(OM_LIST_UPGRADEABLE); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; @@ -446,7 +446,7 @@ bool COPKGManager::checkUpdates(const std::string & package_name, bool show_prog if (show_progress) status.showStatus(75); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++){ + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it){ dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] Update check for...%s\n", __func__, __LINE__, it->second.name.c_str()); if (show_progress){ /* showing the names only makes things *much* slower... @@ -541,7 +541,7 @@ int COPKGManager::showMenu() menu->addKey(CRCInput::RC_yellow, this, "rc_yellow"); pkg_vec.clear(); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; @@ -629,14 +629,14 @@ void COPKGManager::getPkgData(const int pkg_content_id) if (list_installed_done) return; list_installed_done = true; - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) it->second.installed = false; break; case OM_LIST_UPGRADEABLE: if (list_upgradeable_done) return; list_upgradeable_done = true; - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) it->second.upgradable = false; break; } From 9c85004d31727e0066f44c3eacb5bad953977eab Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Feb 2016 16:15:28 +0100 Subject: [PATCH 107/690] cc_frm_scrollbar.cpp icon dont need full path Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/10c430d40e2b537882941c14f41f57724e4a87ba Author: Jacek Jendrzej Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/components/cc_frm_scrollbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 51cc88594..309f6be95 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -81,8 +81,8 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_segments_obj = NULL; string ftype = ".png"; - sb_up_icon = frameBuffer->getIconBasePath() + "/" + NEUTRINO_ICON_BUTTON_TOP + ftype; - sb_down_icon = frameBuffer->getIconBasePath() + "/" + NEUTRINO_ICON_BUTTON_DOWN + ftype; + sb_up_icon = NEUTRINO_ICON_BUTTON_TOP + ftype; + sb_down_icon = NEUTRINO_ICON_BUTTON_DOWN + ftype; sb_segments_count = count; sb_mark_id = 0; From 9c60c384e1c070d7b4a2c42a6e46e6590219d354 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 16 Feb 2016 18:54:02 +0300 Subject: [PATCH 108/690] nhttp: change mutex type to recursive Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ecb5e06128275b66c7532a4a5023a53b0b4b12a4 Author: [CST] Focus Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 12 ++++++------ src/nhttpd/tuxboxapi/neutrinoapi.cpp | 20 ++++++++++++-------- src/nhttpd/tuxboxapi/neutrinoapi.h | 4 +++- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 4 ++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 6671dff1a..8e0fd8941 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -902,9 +902,9 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CChannelEvent *event; - NeutrinoAPI->mutex.lock(); + NeutrinoAPI->Lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->mutex.unlock(); + NeutrinoAPI->Unlock(); if (event) { int percentage = 100; @@ -968,9 +968,9 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * } else { CChannelEvent *event; - NeutrinoAPI->mutex.lock(); + NeutrinoAPI->Lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->mutex.unlock(); + NeutrinoAPI->Unlock(); if (event && isEPGdetails) { result += string_printf("%u " @@ -1638,9 +1638,9 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - NeutrinoAPI->mutex.lock(); + NeutrinoAPI->Lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->mutex.unlock(); + NeutrinoAPI->Unlock(); if (event) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 97f128c19..22742c07f 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -136,6 +136,8 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + + pmutex = new OpenThreads::Mutex(OpenThreads::Mutex::MUTEX_RECURSIVE); } //------------------------------------------------------------------------- @@ -153,6 +155,8 @@ CNeutrinoAPI::~CNeutrinoAPI(void) delete Timerd; if (EventServer) delete EventServer; + + delete pmutex; } //------------------------------------------------------------------------- @@ -172,7 +176,7 @@ void CNeutrinoAPI::UpdateBouquets(void) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapTo(const char * const target) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); t_channel_id channel_id; sscanf(target, @@ -184,7 +188,7 @@ void CNeutrinoAPI::ZapTo(const char * const target) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); if (channel_id == Zapit->getCurrentServiceID()) { //printf("Kanal ist aktuell\n"); @@ -198,7 +202,7 @@ void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) void CNeutrinoAPI::ZapToSubService(const char * const target) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); t_channel_id channel_id; sscanf(target, @@ -211,7 +215,7 @@ void CNeutrinoAPI::ZapToSubService(const char * const target) //------------------------------------------------------------------------- t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_name) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); //FIXME depending on mode missing //int mode = Zapit->getMode(); t_channel_id channel_id = (t_channel_id)-1; @@ -269,7 +273,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); eList.clear(); CEitManager::getInstance()->getChannelEvents(eList); CChannelEventList::iterator eventIterator; @@ -289,7 +293,7 @@ bool CNeutrinoAPI::GetChannelEvents(void) std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); return CServiceManager::getInstance()->GetServiceName(channel_id); } @@ -428,7 +432,7 @@ std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) //------------------------------------------------------------------------- int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) { - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); int newRatioInt = -1; for(int i=0;i<(int)sizeof(videoformat_names);i++) if( videoformat_names[i] == newRatioString){ @@ -484,7 +488,7 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) std::string casys[11]= {"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; int caids[] = { 0x600, 0x1700, 0x0100, 0x0500, 0x1800, 0xB00, 0xD00, 0x900, 0x2600, 0x4a00, 0x0E00 }; - OpenThreads::ScopedLock lock(mutex); + OpenThreads::ScopedPointerLock lock(pmutex); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); if(channel) { for (unsigned short i = 0; i < 11; i++) { diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 6312229a1..5e0a90596 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -25,7 +25,7 @@ bool _initialize_iso639_map(void); //------------------------------------------------------------------------- class CNeutrinoAPI { - OpenThreads::Mutex mutex; + OpenThreads::Mutex *pmutex; // Clientlibs CSectionsdClient *Sectionsd; CZapitClient *Zapit; @@ -88,6 +88,8 @@ public: CChannelEventList eList; CNeutrinoYParser *NeutrinoYParser; CControlAPI *ControlAPI; + void Lock() { pmutex->lock(); } + void Unlock() { pmutex->unlock(); } friend class CNeutrinoYParser; // Backreference friend class CControlAPI; diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 5137dad85..1d0f4ae4e 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -359,9 +359,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: { CZapitChannel * channel = channels[j]; CChannelEvent *event; - NeutrinoAPI->mutex.lock(); + NeutrinoAPI->Lock(); event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->mutex.unlock(); + NeutrinoAPI->Unlock(); classname = (i++ & 1) ? 'a' : 'b'; if (channel->getChannelID() == current_channel) From ed0235a51bc8cddebcbc343fa13d8cf87b664f90 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 16 Feb 2016 18:55:49 +0300 Subject: [PATCH 109/690] neutrino.cpp: disable starting subtitles from event, for testing Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1132b7970ebb5099539644334202bf1b26390c12 Author: [CST] Focus Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9e08af202..89b9e1457 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2724,7 +2724,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (mode != mode_webtv) { scrambled_timer = g_RCInput->addTimer(10*1000*1000, true); SelectSubtitles(); - StartSubtitles(!g_InfoViewer->is_visible); + //StartSubtitles(!g_InfoViewer->is_visible); /* update scan settings for manual scan to current channel */ CScanSetup::getInstance()->updateManualSettings(); From 0d095fb176bb5f92cc5814350e4ceb2aa8558111 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Feb 2016 19:45:54 +0100 Subject: [PATCH 110/690] nhttpd: init var Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2bb2058abec8ecf6bba32ea00e8809f76c7317a1 Author: Jacek Jendrzej Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/nhttpd/yhttpd_core/yconnection.cpp | 1 + src/nhttpd/yhttpd_core/yhook.h | 2 +- src/nhttpd/yhttpd_core/yrequest.cpp | 1 + src/nhttpd/yhttpd_core/yresponse.cpp | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/yhttpd_core/yconnection.cpp b/src/nhttpd/yhttpd_core/yconnection.cpp index d45809bce..074c78584 100644 --- a/src/nhttpd/yhttpd_core/yconnection.cpp +++ b/src/nhttpd/yhttpd_core/yconnection.cpp @@ -52,6 +52,7 @@ CWebserverConnection::CWebserverConnection() { enlapsed_request = 0; enlapsed_response = 0; ConnectionNumber = ++GConnectionNumber; + Webserver = NULL; } //------------------------------------------------------------------------- CWebserverConnection::~CWebserverConnection(void) { diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index a9c23fe3c..f7074198b 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -145,7 +145,7 @@ public: CStringList HookVarList; // Variables in Hook-Handling passing to other Hooks THttp_Method Method; // HTTP Method (requested) // constructor & deconstructor - CyhookHandler(){ContentLength = 0; RangeStart = 0; RangeEnd = -1; cached = false; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;}; + CyhookHandler(){ContentLength = 0; RangeStart = 0; RangeEnd = -1; cached = false; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;LastModified=0;}; virtual ~CyhookHandler(){}; // hook slot handler diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 16a1932c0..85f25c99f 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -38,6 +38,7 @@ CWebserverRequest::CWebserverRequest(CWebserver *pWebserver) { Webserver = pWebserver; CWebserverRequest(); + Connection=NULL; } //============================================================================= diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index aeb4701ba..948a7f08e 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -34,6 +34,7 @@ CWebserverResponse::CWebserverResponse(CWebserver *pWebserver) { Webserver = pWebserver; CWebserverResponse(); + Connection=NULL; } //----------------------------------------------------------------------------- CWebserverResponse::CWebserverResponse() { From 56ea25c2f86f6c63021984bd01ebd6e9ecb4ea53 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Feb 2016 19:47:20 +0100 Subject: [PATCH 111/690] src/gui/eventlist.cpp use CComponentsChannelLogoScalable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5100b3d6ae32fac48610c7c3676fc4a0cd8794b1 Author: Jacek Jendrzej Date: 2016-02-16 (Tue, 16 Feb 2016) --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 756941dff..df70f65ed 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -866,7 +866,7 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s int side_width = ((full_width - mid_width) / 2) - (2 * x_off); //create an logo object - CComponentsChannelLogo* midLogo = new CComponentsChannelLogo(0, 0, _channelname, _channel_id, &header); + CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, &header); if (midLogo->hasLogo()) { //if logo object has found a logo and was ititialized, the hand it's size int w_logo = midLogo->getWidth(); From 5b4a3ece390bb9824802721f3f08f1de4fcf0e3e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Feb 2016 09:35:47 +0100 Subject: [PATCH 112/690] CMovieBrowser: fix arrangement of movieinfo text This should fix empty boxes in info window and text width in EPG-info text in. Current cover width was not considered. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d14bbf2bb50ba56da9437d021ebc5a3056f861db Author: Thilo Graf Date: 2016-02-17 (Wed, 17 Feb 2016) --- src/gui/moviebrowser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index b0a51b27d..ed791fa50 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1396,9 +1396,8 @@ void CMovieBrowser::refreshMovieInfo(void) } } - int max_txt_width = 0; if (m_settings.gui != MB_GUI_FILTER && logo_ok) { - lx = m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w -14; + lx = m_cBoxFrameInfo.iX + m_cBoxFrameBrowserList.iWidth - flogo_w -14; ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio HD 16/9 pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); @@ -1410,8 +1409,7 @@ void CMovieBrowser::refreshMovieInfo(void) pic->enableFrame(true, 2); pic->doPaintBg(false); flogo_w = pic->getWidth(); - max_txt_width = m_cBoxFrameInfo.iWidth - flogo_w - 24; - pic->setXPos(m_cBoxFrameInfo.iX + max_txt_width); + pic->setXPos(m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w - 24); } #if 0 if (!m_movieSelectionHandler->epgInfo2.empty()) @@ -1419,7 +1417,9 @@ void CMovieBrowser::refreshMovieInfo(void) m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); #endif } - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, max_txt_width); + if (pic) + flogo_w = pic->getWidth(); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - 24); if (pic) pic->paint(CC_SAVE_SCREEN_NO); } From f7c2d3588c322f7a3b6fabaea439ef35fcc592a7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Feb 2016 10:17:53 +0100 Subject: [PATCH 113/690] CInfoViewerBB: ensure reinit bboffset before paint ca bar and footer Value of bb offset was only initialized on bb init. If a user has changed ca bar settings (e.g. enable/disable frame around ca bar) while runtime, the current offset value could be wrong and infoviewer has display errors. To solve this restart of neutrino was required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f3df3a5a80edbd0544c34fc7a1317a950e53ade Author: Thilo Graf Date: 2016-02-17 (Wed, 17 Feb 2016) --- src/gui/infoviewer_bb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 66a7fa335..9a68fe310 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -144,6 +144,7 @@ bool CInfoViewerBB::checkBBIcon(const char * const icon, int *w, int *h) void CInfoViewerBB::getBBIconInfo() { bbIconMaxH = 0; + initBBOffset(); BBarY = g_InfoViewer->BoxEndY + bottom_bar_offset; BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) / 2; /* center in buttonbar */ bbIconMinX = g_InfoViewer->BoxEndX - 8; //should be 10px, but 2px will be reduced for each icon @@ -856,6 +857,7 @@ void CInfoViewerBB::showIcon_CA_Status(int notfirst) void CInfoViewerBB::paintCA_bar(int left, int right) { + initBBOffset(); int xcnt = (g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX - (g_settings.infobar_casystem_frame ? 24 : 0)) / 4; int ycnt = (bottom_bar_offset - (g_settings.infobar_casystem_frame ? 14 : 0)) / 4; int ca_width = g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX; From f4139dcf89b8224ace56bb8d5df664b68474aa01 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Feb 2016 10:46:59 +0100 Subject: [PATCH 114/690] CInfoViewer: try to fix possible display errors on epg text and rest time Use of hide() before paint and increase width of rest time box should help to avoid this issue. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f080dd21ab625b3edd5d8a87f1a8c2d08776e3bc Author: Thilo Graf Date: 2016-02-17 (Wed, 17 Feb 2016) --- src/gui/infoviewer.cpp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c79d4500c..b8581b1a4 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -224,18 +224,17 @@ void CInfoViewer::ResetPB() } if (timescale){ - if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) - timescale->kill(); - delete timescale; - timescale = NULL; + timescale->reset(); } } void CInfoViewer::changePB() { ResetPB(); - timescale = new CProgressBar(); - timescale->setType(CProgressBar::PB_TIMESCALE); + if (!timescale){ + timescale = new CProgressBar(); + timescale->setType(CProgressBar::PB_TIMESCALE); + } } void CInfoViewer::initClock() @@ -430,6 +429,7 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height - SHADOW_OFFSET; + infoViewerBB->initBBOffset(); if (!zap_mode) h_body += infoViewerBB->bottom_bar_offset; @@ -1653,14 +1653,17 @@ void CInfoViewer::display_Info(const char *current, const char *next, timescale->setValues(pb_p, pb_w); //printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h); + }else{ + if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) + timescale->kill(); } int currTimeW = 0; int nextTimeW = 0; if (runningRest) - currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)+10; + currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)*2; if (nextDuration) - nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)+10; + nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)*2; int currTimeX = BoxEndX - currTimeW - 10; int nextTimeX = BoxEndX - nextTimeW - 10; @@ -1668,12 +1671,6 @@ void CInfoViewer::display_Info(const char *current, const char *next, bool colored_event_C = (g_settings.theme.colored_events_infobar == 1); bool colored_event_N = (g_settings.theme.colored_events_infobar == 2); - bool restore = false; - if (txt_cur_event){ - if (txt_cur_event_rest && txt_cur_event_rest->isPainted() && txt_cur_event && txt_cur_event->isPainted()) - restore = true; - } - //current event if (current && update_current){ if (txt_cur_event == NULL) @@ -1682,7 +1679,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height); txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_cur_event->isPainted()) txt_cur_event->hide(); txt_cur_event->paint(CC_SAVE_SCREEN_YES); @@ -1692,7 +1689,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height); txt_cur_start->setText(runningStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_cur_event->isPainted()) txt_cur_event->hide(); txt_cur_start->paint(CC_SAVE_SCREEN_YES); } @@ -1703,7 +1700,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height); txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_cur_event_rest->isPainted()) txt_cur_event_rest->hide(); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); } @@ -1717,7 +1714,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height); txt_next_event->setText(next, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_next_event->isPainted()) txt_next_event->hide(); txt_next_event->paint(CC_SAVE_SCREEN_YES); @@ -1727,7 +1724,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height); txt_next_start->setText(nextStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_next_start->isPainted()) txt_next_start->hide(); txt_next_start->paint(CC_SAVE_SCREEN_YES); } @@ -1738,7 +1735,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height); txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - if (restore) + if (txt_next_in->isPainted()) txt_next_in->hide(); txt_next_in->paint(CC_SAVE_SCREEN_YES); } From 19636a8d59fdba1d6d2470609cc56ed408031af3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Feb 2016 11:35:44 +0100 Subject: [PATCH 115/690] CCDraw: remove unused var Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2baa32eb1252dd5f32c50f3cb8ac43c7e87473e6 Author: Thilo Graf Date: 2016-02-17 (Wed, 17 Feb 2016) --- src/gui/components/cc_draw.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 50036fd8b..9eb925937 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -131,8 +131,6 @@ class CCDraw : public COSDFader, public CComponentsSignals ///property: background gradient direction int cc_body_gradient_direction, cc_body_gradient_direction_old; - //TODO: move into layers - int old_gradient_color; ///property: background gradient 2nd color fb_pixel_t cc_body_gradient_2nd_col, cc_body_gradient_2nd_col_old; From 1af0174ac417368c1a6ad204c2637a1e0aa505e2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Feb 2016 11:42:29 +0100 Subject: [PATCH 116/690] CComponentsHeader: remove reassigned col_body vars Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8500648b7fb79160040901f6d29a4eac9199b26b Author: Thilo Graf Date: 2016-02-17 (Wed, 17 Feb 2016) --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 4a69827f7..cd9af8bfc 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -103,7 +103,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const col_frame = col_frame_old = color_frame; col_body = col_body_old = color_body; col_shadow = col_shadow_old = color_shadow; - col_body = col_body_old = COL_MENUHEAD_PLUS_0; + cc_body_gradient_enable = cc_body_gradient_enable_old = g_settings.theme.menu_Head_gradient; cc_body_gradient_direction = cc_body_gradient_direction_old = g_settings.theme.menu_Head_gradient_direction; cc_body_gradient_mode = CColorGradient::gradientLight2Dark; From 394955a0f2fc1d92686d895fff08f67958a014e3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 Feb 2016 12:24:57 +0100 Subject: [PATCH 117/690] controlapi: fix broken epgsearch json output; ... NOTE! xml output is changed to get same structure as in other functions like control/config or control/file old: --- ... new: --- ... Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be83e3569e0afd55173866c9101f2d5536f634dc Author: vanhofen Date: 2016-02-17 (Wed, 17 Feb 2016) Origin message was: ------------------ - controlapi: fix broken epgsearch json output; ... NOTE! xml output is changed to get same structure as in other functions like control/config or control/file old: --- ... new: --- ... --- src/nhttpd/tuxboxapi/controlapi.cpp | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 8e0fd8941..025d982e9 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1443,8 +1443,8 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) return; } - std::string result; - std::string epgsearch = ""; + std::string result =""; + std::string item = ""; t_channel_id channel_id; CChannelEventList evtlist; @@ -1512,24 +1512,25 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) unsigned int u_azeit = ( azeit > -1)? azeit:0; for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator) { + bool got_next = (eventIterator != (evtlist.end() - 1)); if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { if( (eventIterator->startTime+eventIterator->duration) < u_azeit) continue; struct tm *tmStartZeit = localtime(&eventIterator->startTime); - result.clear(); + item.clear(); if (hh->outType == json || hh->outType == xml) { - result += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); - result += hh->outPair("epgtitle", epg.title, true); + item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); + item += hh->outPair("epgtitle", epg.title, true); if (search_epginfo) { - result += hh->outPair("info1", hh->outValue(epg.info1), true); - result += hh->outPair("info2", hh->outValue(epg.info2), true); + item += hh->outPair("info1", hh->outValue(epg.info1), true); + item += hh->outPair("info2", hh->outValue(epg.info2), true); } if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - result += hh->outPair("fsk", string_printf("%c", longepg.fsk), true); + item += hh->outPair("fsk", string_printf("%c", longepg.fsk), true); genre = ""; #ifdef FULL_CONTENT_CLASSIFICATION if (!longepg.contentClassification.empty()) @@ -1538,17 +1539,17 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if (longepg.contentClassification) genre = GetGenre(longepg.contentClassification); #endif - result += hh->outPair("genre", ZapitTools::UTF8_to_UTF8XML(genre.c_str()), true); + item += hh->outPair("genre", ZapitTools::UTF8_to_UTF8XML(genre.c_str()), true); } strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); - result += hh->outPair("date", tmpstr, true); + item += hh->outPair("date", tmpstr, true); strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); - result += hh->outPair("time", tmpstr, true); - result += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); - result += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); - result += hh->outPair("eventid", string_printf("%ld", eventIterator->eventID), false); + item += hh->outPair("time", tmpstr, true); + item += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); + item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); + item += hh->outPair("eventid", string_printf("%ld", eventIterator->eventID), false); - epgsearch += hh->outCollection("epgsearch", result); + result += hh->outArrayItem("item", item, got_next); } else // outType == plain { @@ -1591,12 +1592,12 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) } } } + result = hh->outArray("epgsearch", result); if (outType == json) { - hh->WriteLn(json_out_success(epgsearch)); + hh->WriteLn(json_out_success(result)); } else if (outType == xml) { - epgsearch = hh->outCollection("neutrino", epgsearch); // to stay backward compatible :/ - hh->WriteLn(epgsearch); + hh->WriteLn(result); } } From a255064760ef24a1c1fa4e62d571c5fdc2c03556 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 Feb 2016 16:11:10 +0100 Subject: [PATCH 118/690] controlapi/epgsearch: extend epginfo switch Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/587dc1e179c47b7a977ccf7bdc56576105a37fff Author: vanhofen Date: 2016-02-17 (Wed, 17 Feb 2016) Origin message was: ------------------ - controlapi/epgsearch: extend epginfo switch --- src/nhttpd/doc/nhttpd_controlapi.html | 4 +++- src/nhttpd/tuxboxapi/controlapi.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index d7ce3fba6..864fa401f 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -512,13 +512,15 @@ Soap/Melodram/Folklore

Parameter: Suchbegriffe
oder
-Parameter: search=Suchbegriffe[&epginfo=false][&format=plain|xml|json]
+Parameter: search=Suchbegriffe[&epginfo=true|false|search][&format=plain|xml|json]
Rückgabe:

Es werden alle Sendungen im EPG zurückgegeben, die den Suchbegriff
im Titel oder Beschreibungstext beinhalten.
Die Treffer lassen sich unter Angabe von epginfo=false auf Treffer im Titel beschränken.
Hier werden die Sendungsinhalte (info1 und info2) nicht mitgeliefert.
+Mit der Angabe von epginfo=search werden die Sendungsinhalte (info1 und info2) zwar in die Suche
+einbezogen, aber nicht mitgeliefert.
Die Ausgabe erfolgt im angegebenen Format. Ist kein Format angegeben, wird reiner Text ausgegeben

Rückgabe-Format: Datum Startzeit Monat Wochentag Dauer in Minuten Sender Titel der Sendung
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 025d982e9..d06f13093 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1425,7 +1425,7 @@ void CControlAPI::EpgSearchXMLCGI(CyhookHandler *hh) * @code * /control/epgsearch? * or - * /control/epgsearch?search=[&epginfo=false][&format=plain|xml|json] + * /control/epgsearch?search=[&epginfo=true|false|search][&format=plain|xml|json] * @endcode */ @@ -1449,6 +1449,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) CChannelEventList evtlist; bool search_epginfo = (hh->ParamList["epginfo"] != "false"); + bool return_epginfo = (hh->ParamList["epginfo"] == "true"); std::string search_keyword = (hh->ParamList["search"].empty()) ? hh->ParamList["1"] : hh->ParamList["search"]; const int search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; @@ -1524,7 +1525,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) { item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); item += hh->outPair("epgtitle", epg.title, true); - if (search_epginfo) { + if (return_epginfo) { item += hh->outPair("info1", hh->outValue(epg.info1), true); item += hh->outPair("info2", hh->outValue(epg.info2), true); } @@ -1566,7 +1567,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) hh->WriteLn(datetimer_str); hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); hh->WriteLn(epg.title); - if (search_epginfo) { + if (return_epginfo) { if(!epg.info1.empty()) hh->WriteLn(epg.info1); if(!epg.info2.empty()) From 54af246f085e3b7bd005df461dca4fb0e150207b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 18 Feb 2016 10:42:59 +0100 Subject: [PATCH 119/690] CTextBox: remove statement for text change check Check of text change is not enough. Scrollboxes could have some problems. Dimension changes must be considered too and this is to much effort at the moment. Use of OnAfterScrollPage is much easier. this reverts: 47b4ea481cb862fd478acbbdbd61501c751cc2b1 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8afe4495e7f8d1c921e576427f2276349bb36260 Author: Thilo Graf Date: 2016-02-18 (Thu, 18 Feb 2016) --- src/gui/widget/textbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 0fc38b141..e2daec4bd 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; + int dx = m_cFrameTextRel.iWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,7 +602,6 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); - //paint full background only on new text, otherwise paint required background frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } } From edd307c9ab5baaae3d503df04a1fae7620d96b0d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 18 Feb 2016 10:45:16 +0100 Subject: [PATCH 120/690] CMovieBrowser: reactivate slot for cover paint during scrolling inside epg Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/70a29b85b262bbd051d34ef8664671a56f3a7844 Author: Thilo Graf Date: 2016-02-18 (Thu, 18 Feb 2016) --- src/gui/moviebrowser.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ed791fa50..66077c183 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1411,11 +1411,14 @@ void CMovieBrowser::refreshMovieInfo(void) flogo_w = pic->getWidth(); pic->setXPos(m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w - 24); } -#if 0 - if (!m_movieSelectionHandler->epgInfo2.empty()) - if (m_pcInfo->OnAfterScrollPage.empty()) + + if (!m_movieSelectionHandler->epgInfo2.empty()){ + if (m_pcInfo->OnAfterScrollPage.empty()){ + pic->enableCache(); m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); -#endif + } + } + } if (pic) flogo_w = pic->getWidth(); From ca1455f93aff5d982369e10f56f74a371eaa31c7 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 18 Feb 2016 14:09:56 +0300 Subject: [PATCH 121/690] eitd/edvbstring.cpp: try to fix 13E 11179 EIT encoding Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a87751015a50615e61675c86d4b967bba50146f2 Author: [CST] Focus Date: 2016-02-18 (Thu, 18 Feb 2016) --- src/eitd/edvbstring.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/eitd/edvbstring.cpp b/src/eitd/edvbstring.cpp index 003e067bf..0267cea1c 100644 --- a/src/eitd/edvbstring.cpp +++ b/src/eitd/edvbstring.cpp @@ -2039,7 +2039,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) //printf("table %d tsidonid %04x twochar %d : %20s\n", table, tsidonid, twochar, data); switch(data[0]) { - case 1 ... 12: + case 1 ... 11: newtable=data[i++]+4; // eDebug("(1..12)text encoded in ISO-8859-%d",table); break; @@ -2078,6 +2078,8 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) ++i; {} //eDebug("unsup. Big5 subset of ISO/IEC 10646-1 enc."); break; + case 0x15: // UTF-8 encoding of ISO/IEC 10646-1 + return std::string((char*)data+1, len-1); case 0x1F: { #ifdef ENABLE_FREESATEPG @@ -2088,8 +2090,8 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) ++i; break; case 0x0: - case 0xD ... 0xF: - case 0x15 ... 0x1E: + case 0xC ... 0xF: + case 0x16 ... 0x1E: {} //eDebug("reserved %d", data[0]); ++i; break; From ce7456bb253086852c5121bc7ece62967cc554b0 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 12 Feb 2016 22:19:43 +0100 Subject: [PATCH 122/690] controlapi: sort files alphabetical Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/21fbadaa8f0b7b73b44ae1c12644d90646ba9a00 Author: TangoCash Date: 2016-02-12 (Fri, 12 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 27 ++++++++++++++++----------- src/nhttpd/tuxboxapi/controlapi.h | 12 ++++++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index d06f13093..40dd505f7 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3079,13 +3079,14 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { * * @par nhttpd-usage * @code - * /control/file?action=list&path={path}[&format=|xml|json] + * /control/file?action=list&path={path}[&format=|xml|json][&sort=false] * @endcode * * @par example: * @code * /control/file?action=list&path=/ * /control/file?action=list&path=/&format=json + * /control/file?action=list&path=/&format=json&sort=false * @endcode * * @par output @@ -3137,10 +3138,9 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if ((dirp = opendir(path.c_str()))) { bool isFirstLine = true; struct dirent *entry; + std::vector filelist; while ((entry = readdir(dirp))) { - std::string item = ""; - item += hh->outPair("name", - hh->outValue(hh->outValue(entry->d_name)), true); + if ( !strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") ) continue; std::string ftype; if (entry->d_type == DT_DIR) ftype = "dir"; @@ -3148,17 +3148,23 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { ftype = "lnk"; else if (entry->d_type == 8) ftype = "file"; - - item += hh->outPair("type_str", ftype, true); - item += hh->outPair("type", - string_printf("%d", (int) entry->d_type), true); if (path[path.length() - 1] != '/') path += "/"; std::string fullname = path + entry->d_name; - item += hh->outPair("fullname", hh->outValue(fullname), true); + filelist.push_back(FileCGI_List{std::string(entry->d_name),ftype,entry->d_type,fullname}); + } + closedir(dirp); + if (hh->ParamList["sort"].empty()) + sort(filelist.begin(), filelist.end(),fsort); + for(std::vector::iterator f = filelist.begin(); f != filelist.end(); ++f) { + std::string item = ""; + item += hh->outPair("name", hh->outValue(f->name.c_str()), true); + item += hh->outPair("type_str", hh->outValue(f->type_str.c_str()), true); + item += hh->outPair("type", string_printf("%d", (int) f->type), true); + item += hh->outPair("fullname", hh->outValue(f->fullname.c_str()), true); struct stat statbuf; - if (stat(fullname.c_str(), &statbuf) != -1) { + if (stat(f->fullname.c_str(), &statbuf) != -1) { item += hh->outPair( "mode", @@ -3208,7 +3214,6 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { result += hh->outNext(); result += hh->outArrayItem("item", item, false); } - closedir(dirp); } result = hh->outArray("filelist", result); // write footer diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 23a95e61b..ccae2bebc 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -27,6 +27,18 @@ private: } TyCgiCall; const static TyCgiCall yCgiCallList[]; + struct FileCGI_List + { + std::string name; + std::string type_str; + unsigned char type; + std::string fullname; + bool operator () (FileCGI_List a,FileCGI_List b) + { + return (a.name < b.name); + } + } fsort; + int rc_send(int ev, unsigned int code, unsigned int value); // send functions for ExecuteCGI (controld api) From d18473b8d6689f269327340b772e534b0467523d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 18 Feb 2016 16:10:04 +0100 Subject: [PATCH 123/690] controlapi: whitespace cleanup FileCGI; fix compiler warning Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2c7f08c15c73cb7e9253205dc0bc2ca2eb7b1d9 Author: vanhofen Date: 2016-02-18 (Thu, 18 Feb 2016) Origin message was: ------------------ - controlapi: whitespace cleanup FileCGI; fix compiler warning --- src/nhttpd/tuxboxapi/controlapi.cpp | 81 +++++++++++++---------------- src/nhttpd/tuxboxapi/controlapi.h | 9 ++-- 2 files changed, 42 insertions(+), 48 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 40dd505f7..0cd1a88a6 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3136,11 +3136,11 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { - bool isFirstLine = true; struct dirent *entry; std::vector filelist; while ((entry = readdir(dirp))) { - if ( !strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") ) continue; + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) + continue; std::string ftype; if (entry->d_type == DT_DIR) ftype = "dir"; @@ -3151,75 +3151,68 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (path[path.length() - 1] != '/') path += "/"; std::string fullname = path + entry->d_name; - filelist.push_back(FileCGI_List{std::string(entry->d_name),ftype,entry->d_type,fullname}); + + FileCGI_List listitem; + listitem.name = std::string(entry->d_name); + listitem.type_str = ftype; + listitem.type = entry->d_type; + listitem.fullname = fullname; + + filelist.push_back(listitem); } closedir(dirp); - if (hh->ParamList["sort"].empty()) - sort(filelist.begin(), filelist.end(),fsort); - for(std::vector::iterator f = filelist.begin(); f != filelist.end(); ++f) { + + if (hh->ParamList["sort"] != "false") + sort(filelist.begin(), filelist.end(), fsort); + + for(std::vector::iterator f = filelist.begin(); f != filelist.end(); ++f) + { + bool got_next = (f != filelist.end()-1); + std::string item = ""; - item += hh->outPair("name", hh->outValue(f->name.c_str()), true); - item += hh->outPair("type_str", hh->outValue(f->type_str.c_str()), true); - item += hh->outPair("type", string_printf("%d", (int) f->type), true); - item += hh->outPair("fullname", hh->outValue(f->fullname.c_str()), true); + item += hh->outPair("name", hh->outValue(f->name.c_str()), true); + item += hh->outPair("type_str", hh->outValue(f->type_str.c_str()), true); + item += hh->outPair("type", string_printf("%d", (int) f->type), true); + item += hh->outPair("fullname", hh->outValue(f->fullname.c_str()), true); struct stat statbuf; if (stat(f->fullname.c_str(), &statbuf) != -1) { - item - += hh->outPair( - "mode", - string_printf("%xld", - (long) statbuf.st_mode), true); + item += hh->outPair("mode", string_printf("%xld", (long) statbuf.st_mode), true); /* Print out type, permissions, and number of links. */ //TODO: hh->printf("\t\t%10.10s\n", sperm (statbuf.st_mode)); - item += hh->outPair("nlink", - string_printf("%d", statbuf.st_nlink), true); + item += hh->outPair("nlink", string_printf("%d", statbuf.st_nlink), true); /* Print out owner's name if it is found using getpwuid(). */ struct passwd *pwd; - if ((pwd = getpwuid(statbuf.st_uid)) != NULL) { + if ((pwd = getpwuid(statbuf.st_uid)) != NULL) item += hh->outPair("user", pwd->pw_name, true); - } - else { - item += hh->outPair("user", - string_printf("%d", statbuf.st_uid), true); - } + else + item += hh->outPair("user", string_printf("%d", statbuf.st_uid), true); + /* Print out group name if it is found using getgrgid(). */ struct group *grp; if ((grp = getgrgid(statbuf.st_gid)) != NULL) item += hh->outPair("group", grp->gr_name, true); - else { - item += hh->outPair("group", - string_printf("%d", statbuf.st_gid), true); - } + else + item += hh->outPair("group", string_printf("%d", statbuf.st_gid), true); + /* Print size of file. */ - item += hh->outPair("size", - string_printf("%jd", (intmax_t) statbuf.st_size), - true); + item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), true); + struct tm *tm = localtime(&statbuf.st_mtime); char datestring[256] = {0}; /* Get localized date string. */ - strftime(datestring, sizeof(datestring), - nl_langinfo(D_T_FMT), tm); + strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), tm); item += hh->outPair("time", hh->outValue(datestring), true); - - item += hh->outPair("time_t", - string_printf("%ld", (long) statbuf.st_mtime), - false); + item += hh->outPair("time_t", string_printf("%ld", (long) statbuf.st_mtime), false); } - if(isFirstLine) - isFirstLine = false; - else - result += hh->outNext(); - result += hh->outArrayItem("item", item, false); + result += hh->outArrayItem("item", item, got_next); } } result = hh->outArray("filelist", result); - // write footer - if (outType == json) { + if (outType == json) hh->WriteLn(json_out_success(result)); - } else hh->WriteLn(result); } diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index ccae2bebc..0b0fe6f49 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -33,10 +33,11 @@ private: std::string type_str; unsigned char type; std::string fullname; - bool operator () (FileCGI_List a,FileCGI_List b) - { - return (a.name < b.name); - } + + bool operator() (FileCGI_List a, FileCGI_List b) + { + return (a.name < b.name); + } } fsort; int rc_send(int ev, unsigned int code, unsigned int value); From 20260c632c639922503c2ec360257c5b615f1b35 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 18 Feb 2016 21:38:10 +0100 Subject: [PATCH 124/690] infoviewer: fix display of small rec/ts box; rename most variables Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/219ce9c8ed5e3c4f186a78ecdacf1edda6f43c3d Author: vanhofen Date: 2016-02-18 (Thu, 18 Feb 2016) Origin message was: ------------------ - infoviewer: fix display of small rec/ts box; rename most variables --- src/gui/infoviewer.cpp | 93 ++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index b8581b1a4..69eb3f6ef 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -262,106 +262,119 @@ void CInfoViewer::initClock() void CInfoViewer::showRecordIcon (const bool show) { + /* FIXME if record or timeshift stopped while infobar visible, artifacts */ + CRecordManager * crm = CRecordManager::getInstance(); recordModeActive = crm->RecordingStatus(); - /* FIXME if record or timeshift stopped while infobar visible, artifacts */ if (recordModeActive) { - std::string Icon_Rec = NEUTRINO_ICON_REC_GRAY, Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT_GRAY; - t_channel_id cci = g_RemoteControl->current_channel_id; + std::string rec_icon = NEUTRINO_ICON_REC_GRAY; + std::string ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY; + t_channel_id cci = g_RemoteControl->current_channel_id; /* global record mode */ int rec_mode = crm->GetRecordMode(); /* channel record mode */ int ccrec_mode = crm->GetRecordMode(cci); /* set 'active' icons for current channel */ - if (ccrec_mode & CRecordManager::RECMODE_TSHIFT) - Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT; - if (ccrec_mode & CRecordManager::RECMODE_REC) - Icon_Rec = NEUTRINO_ICON_REC; + rec_icon = NEUTRINO_ICON_REC; - int records = crm->GetRecordCount(); - + if (ccrec_mode & CRecordManager::RECMODE_TSHIFT) + ts_icon = NEUTRINO_ICON_AUTO_SHIFT; - const int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET; - const int icon_space = 3, box_posY = 12; - int box_len = 0, rec_icon_posX = 0, ts_icon_posX = 0; + int records = crm->GetRecordCount(); - int rec_icon_w = 0, rec_icon_h = 0, ts_icon_w = 0, ts_icon_h = 0; - frameBuffer->getIconSize(Icon_Rec.c_str(), &rec_icon_w, &rec_icon_h); - frameBuffer->getIconSize(Icon_Ts.c_str(), &ts_icon_w, &ts_icon_h); + int txt_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + int txt_w = 0; + + int box_x = BoxStartX + ChanWidth + 2*SHADOW_OFFSET; + int box_y = BoxStartY + SHADOW_OFFSET; + int box_w = 0; + int box_h = txt_h; + + int icon_space = SHADOW_OFFSET/2; + + int rec_icon_x = 0, rec_icon_w = 0, rec_icon_h = 0; + int ts_icon_x = 0, ts_icon_w = 0, ts_icon_h = 0; + + frameBuffer->getIconSize(rec_icon.c_str(), &rec_icon_w, &rec_icon_h); + frameBuffer->getIconSize(ts_icon.c_str(), &ts_icon_w, &ts_icon_h); - int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight () * (g_settings.screen_yres / 100); - if (chanH < rec_icon_h) - chanH = rec_icon_h; - const int box_posX = ChanName_X + SHADOW_OFFSET; + int icon_h = std::max(rec_icon_h, ts_icon_h); + box_h = std::max(box_h, icon_h+icon_space*2); + int icon_y = box_y + (box_h - icon_h)/2; + int txt_y = box_y + (box_h + txt_h)/2; + char records_msg[8]; - snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); - int TextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg) - * (g_settings.screen_xres / 100); if (rec_mode == CRecordManager::RECMODE_REC) { - box_len = rec_icon_w + TextWidth + icon_space*5; - rec_icon_posX = box_posX + icon_space*2; + snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg); + + box_w = rec_icon_w + txt_w + icon_space*5; + rec_icon_x = box_x + icon_space*2; } else if (rec_mode == CRecordManager::RECMODE_TSHIFT) { - box_len = ts_icon_w + icon_space*4; - ts_icon_posX = box_posX + icon_space*2; + box_w = ts_icon_w + icon_space*4; + ts_icon_x = box_x + icon_space*2; } else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) { - box_len = ts_icon_w + rec_icon_w + TextWidth + icon_space*7; - ts_icon_posX = box_posX + icon_space*2; - rec_icon_posX = ts_icon_posX + ts_icon_w + icon_space*2; + //subtract ts records--; snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg); + + box_w = ts_icon_w + rec_icon_w + txt_w + icon_space*7; + ts_icon_x = box_x + icon_space*2; + rec_icon_x = ts_icon_x + ts_icon_w + icon_space*2; } if (show) { if (rec == NULL){ //TODO: full refactoring of this icon handler - rec = new CComponentsShapeSquare(box_posX, BoxStartY + box_posY , box_len, chanH, NULL, CC_SHADOW_ON, COL_RED, COL_INFOBAR_PLUS_0); + rec = new CComponentsShapeSquare(box_x, box_y , box_w, box_h, NULL, CC_SHADOW_ON, COL_RED, COL_INFOBAR_PLUS_0); rec->setFrameThickness(2); rec->setShadowWidth(SHADOW_OFFSET/2); rec->setCorner(RADIUS_MIN, CORNER_ALL); } - if (rec->getWidth() != box_len) - rec->setWidth(box_len); + if (rec->getWidth() != box_w) + rec->setWidth(box_w); if (!rec->isPainted()) rec->paint(CC_SAVE_SCREEN_NO); if (rec_mode != CRecordManager::RECMODE_TSHIFT) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rec_icon_x + rec_icon_w + icon_space, txt_y, txt_w, records_msg, COL_INFOBAR_TEXT); if (rec_mode == CRecordManager::RECMODE_REC) { - frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); + frameBuffer->paintIcon(rec_icon, rec_icon_x, icon_y); } else if (rec_mode == CRecordManager::RECMODE_TSHIFT) { - frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); + frameBuffer->paintIcon(ts_icon, ts_icon_x, icon_y); } else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) { - frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); - frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); + frameBuffer->paintIcon(rec_icon, rec_icon_x, icon_y); + frameBuffer->paintIcon(ts_icon, ts_icon_x, icon_y); } } else { if (rec_mode == CRecordManager::RECMODE_REC) - frameBuffer->paintBoxRel(rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, rec_icon_w, rec_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(rec_icon_x, icon_y, rec_icon_w, icon_h, COL_INFOBAR_PLUS_0); else if (rec_mode == CRecordManager::RECMODE_TSHIFT) - frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2, ts_icon_w, ts_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(ts_icon_x, icon_y, ts_icon_w, icon_h, COL_INFOBAR_PLUS_0); else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) - frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, ts_icon_w + rec_icon_w + icon_space*2, rec_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(ts_icon_x, icon_y, ts_icon_w + rec_icon_w + icon_space*2, icon_h, COL_INFOBAR_PLUS_0); } } } From 3942291a9e82a6e98bb019c730077760e343b5e3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 18 Feb 2016 23:44:15 +0100 Subject: [PATCH 125/690] nhttpd try to fix json unicode output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/201f8758c6ad02ec793080330889d91a1eee06ad Author: Jacek Jendrzej Date: 2016-02-18 (Thu, 18 Feb 2016) --- src/nhttpd/yhttpd_core/helper.cpp | 51 ++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index e8bc5a235..b09bb13e0 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -292,17 +292,58 @@ std::string json_out_error(std::string _error) { //----------------------------------------------------------------------------- // JSON: convert string to JSON-String //----------------------------------------------------------------------------- + std::string json_convert_string(std::string s) { std::stringstream ss; - for (size_t i = 0; i < s.length(); ++i) { - if (unsigned(s[i]) < '\x20' || s[i] == '\\' || s[i] == '"' || unsigned(s[i]) >= '\x80') { - ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex - << unsigned(s[i]); + for (size_t i = 0; i < s.length(); ) { + unsigned char ch = unsigned(s[i]); + if(ch == 0x0d){ + ss << "\\u000d"; + i++; + continue; + } + if(ch == 0x0a){ + ss << "\\u000a"; + i++; + continue; + } + + if(ch < '\x20' || ch == '\\' || ch == '"' || ch >= '\x80') { + unsigned long unicode = 0; + size_t todo = 0; + if (ch <= 0xBF) { + } + else if (ch <= 0xDF) { + unicode = ch & 0x1F; + todo = 1; + } + else if (ch <= 0xEF) { + unicode = ch & 0x0F; + todo = 2; + } + else if (ch <= 0xF7) { + unicode = ch & 0x07; + todo = 3; + } + for (size_t j = 0; j < todo; ++j){ + ++i; + unicode <<= 6; + unicode += unsigned(s[i]) & 0x3F; + } + if (unicode <= 0xFFFF) + { + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << unicode; + }else + { + unicode -= 0x10000; + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << ((unicode >> 10) + 0xD800); + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << ((unicode & 0x3FF) + 0xDC00); + } } else { ss << s[i]; } + ++i; } return ss.str(); } - From 2da8818e83d47b7c46d1e4affe2f433bc21dba0f Mon Sep 17 00:00:00 2001 From: Marc Szymkowiak Date: Thu, 18 Feb 2016 22:24:11 +0100 Subject: [PATCH 126/690] add getdir control Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f803d0a0c656c0b576c77864a4d8eb75d35f1e42 Author: Marc Szymkowiak Date: 2016-02-18 (Thu, 18 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 119 +++++++++++++++++++++++++++- src/nhttpd/tuxboxapi/controlapi.h | 2 + 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 0cd1a88a6..6339a0a89 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -220,7 +220,8 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= // settings {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling - {"file", &CControlAPI::FileCGI, "+xml"} + {"file", &CControlAPI::FileCGI, "+xml"}, + {"getdir", &CControlAPI::getDirCGI, "+xml"} }; @@ -3226,3 +3227,119 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { //TODO } } + +//----------------------------------------------------------------------------- +/** Get neutrino directories + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getdir?dir=allmoviedirs&[&subdirs=true][&format=|xml|json] + * @endcode + * +{"success": "true", "data":{"dirs": [{"dir": "/mnt/series/", +"used": "1" +} +,{"dir": "/mnt/movies/", +"used": "1" +} +,{"dir": "/mnt/movies/subdir" +} +{"dir": "/media/sda1/movie" +} +,] +}} + * @endcode + * + */ +//----------------------------------------------------------------------------- +void CControlAPI::getDirCGI(CyhookHandler *hh) { + std::string result = ""; + std::string item = ""; + bool isFirstLine = true; + + TOutType outType = hh->outStart(); + + //Shows all 7 directories stored in the moviebrowser.conf + if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { + CConfigFile *Config = new CConfigFile(','); + Config->loadConfig(MOVIEBROWSER_CONFIGFILE); + char index[21]; + std::string mb_dir_used; + std::string mb_dir; + + for(int i=0;i<8;i++) { + snprintf(index, sizeof(index), "%d", i); + mb_dir = "mb_dir_"; + mb_dir = mb_dir + index; + mb_dir = Config->getString(mb_dir, ""); + + if(!mb_dir.empty()) { + item += hh->outPair("dir", hh->outValue(mb_dir), false); + if(isFirstLine) { + isFirstLine = false; + } + else { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + item = ""; + if (hh->ParamList["subdirs"] == "true") { + result = getSubdirectories(hh, mb_dir, result); + } + } + } + } + + //Shows the neutrino recording dir + if (hh->ParamList["dir"] == "recordingdir" || hh->ParamList["dir"] == "allmoviedirs" ) { + item += hh->outPair("dir", hh->outValue(g_settings.network_nfs_recordingdir), false); + if(isFirstLine) { + isFirstLine = false; + } + else { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + if (hh->ParamList["subdirs"] == "true") { + result = getSubdirectories(hh, g_settings.network_nfs_recordingdir, result); + } + } + + + result = hh->outArray("dirs", result); + // write footer + if (outType == json) { + hh->WriteLn(json_out_success(result)); + } + else { + hh->WriteLn(result); + } +} + +//Helpfunction to get subdirs of a dir +std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) { + std::string item = ""; + std::string dirname; + DIR *dirp; + struct dirent *entry; + + if ((dirp = opendir(path.c_str()))) { + while ((entry = readdir(dirp))) { + if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { + if (path[path.length() - 1] != '/') { + path += "/"; + } + std::string fullname = path + entry->d_name; + item += hh->outPair("dir", hh->outValue(fullname), false); + result += hh->outNext(); + result += hh->outArrayItem("item", item, false); + item = ""; + result = getSubdirectories(hh, fullname, result); + } + } + closedir(dirp); + } + return result; +} diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 0b0fe6f49..a8a9c9d4e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -128,6 +128,8 @@ private: void ConfigCGI(CyhookHandler *hh); void FileCGI(CyhookHandler *hh); void SignalInfoCGI(CyhookHandler *hh); + void getDirCGI(CyhookHandler *hh); + std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result); protected: From 2664922851b51e67b0f6032ac3444745da5132f8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 19 Feb 2016 09:52:57 +0100 Subject: [PATCH 127/690] controlapi/epgsearch: fix fsk output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a262784d38b52e83fe788252077829b2c19a25e0 Author: vanhofen Date: 2016-02-19 (Fri, 19 Feb 2016) Origin message was: ------------------ - controlapi/epgsearch: fix fsk output --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 6339a0a89..8bcd30495 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1532,7 +1532,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) } if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - item += hh->outPair("fsk", string_printf("%c", longepg.fsk), true); + item += hh->outPair("fsk", string_printf("%u", longepg.fsk), true); genre = ""; #ifdef FULL_CONTENT_CLASSIFICATION if (!longepg.contentClassification.empty()) From c8ac0e8670493cd89f0476e3210e15faf0f0b0bc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 19 Feb 2016 10:14:37 +0100 Subject: [PATCH 128/690] controlapi/epgsearch: fix title output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4af175c923f425b3339adc7dc5747a47f8722dec Author: vanhofen Date: 2016-02-19 (Fri, 19 Feb 2016) Origin message was: ------------------ - controlapi/epgsearch: fix title output --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 8bcd30495..62df32c0d 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1525,7 +1525,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if (hh->outType == json || hh->outType == xml) { item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); - item += hh->outPair("epgtitle", epg.title, true); + item += hh->outPair("epgtitle", hh->outValue(epg.title), true); if (return_epginfo) { item += hh->outPair("info1", hh->outValue(epg.info1), true); item += hh->outPair("info2", hh->outValue(epg.info2), true); From caee20b1ad052f778972e5296302bd978a1f843c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 19 Feb 2016 15:15:46 +0100 Subject: [PATCH 129/690] nhttpd/yhttpd_core/helper.cpp: avoid buffer overload Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ebd9f8fdffffde4350295c17e65b9287050af08 Author: Jacek Jendrzej Date: 2016-02-19 (Fri, 19 Feb 2016) --- src/nhttpd/yhttpd_core/helper.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index b09bb13e0..1a4e98aff 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -76,10 +76,17 @@ std::string timeString(time_t time) { // Printf and return formatet String. Buffer-save! // max length up to bufferlen -> then snip //------------------------------------------------------------------------- -#define bufferlen 4*1024 std::string string_printf(const char *fmt, ...) { - char buffer[bufferlen]; va_list arglist; + va_start (arglist, fmt); + int len = vsnprintf (NULL, 0, fmt, arglist); + va_end (arglist); + const int bufferlen = 4*1024; + if(len >= bufferlen){ + printf("string_printf: error: buffer overflow : len %i line %i\n",len,__LINE__); + return "error"; + } + char buffer[bufferlen] = {0}; va_start(arglist, fmt); vsnprintf(buffer, bufferlen, fmt, arglist); va_end(arglist); From f3bba7968d0048c2a7dffa4a8479ec4b353cf26b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 09:07:50 +0100 Subject: [PATCH 130/690] yhook: move ctor/dtor to cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/07b39de268f41c675d8649f7964e500b6c4251e2 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - yhook: move ctor/dtor to cpp --- src/nhttpd/yhttpd_core/yhook.cpp | 22 ++++++++++++++++++++++ src/nhttpd/yhttpd_core/yhook.h | 6 +++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index b4aa79e0a..d7a46bf4b 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -13,6 +13,28 @@ #include "ylogging.h" #include "helper.h" +//============================================================================= +// Constructor & Ceconstructor +//============================================================================= +CyhookHandler::CyhookHandler() +{ + ContentLength = 0; + RangeStart = 0; + RangeEnd = -1; + cached = false; + keep_alive = 0; + _outIndent = 0; + status = HANDLED_NONE; + Method = M_UNKNOWN; + httpStatus = HTTP_NIL; + outType = plain; + LastModified=0; +} + +CyhookHandler::~CyhookHandler() +{ +} + //============================================================================= // Initialization of static variables //============================================================================= diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index f7074198b..d5556a043 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -123,6 +123,9 @@ class CyhookHandler protected: static THookList HookList; public: + CyhookHandler(); + ~CyhookHandler(); + // Output std::string yresult; // content for response output THandleStatus status; // status of Hook handling @@ -144,9 +147,6 @@ public: CStringList WebserverConfigList; // Reference (writable) to ConfigList CStringList HookVarList; // Variables in Hook-Handling passing to other Hooks THttp_Method Method; // HTTP Method (requested) - // constructor & deconstructor - CyhookHandler(){ContentLength = 0; RangeStart = 0; RangeEnd = -1; cached = false; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;LastModified=0;}; - virtual ~CyhookHandler(){}; // hook slot handler static void attach(Cyhook *yh) // attach a Hook-Class to HookHandler From a975781295434ee5acd2992c86607fbbd6f047f0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 12:06:58 +0100 Subject: [PATCH 131/690] yhook: introduce new format for plain output; key=value Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4c679613d67eb5f3082072144a9c39846ac4603f Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - yhook: introduce new format for plain output; key=value --- src/nhttpd/tuxboxapi/controlapi.cpp | 14 +++++++------- src/nhttpd/yhttpd_core/yhook.cpp | 12 ++++++++++-- src/nhttpd/yhttpd_core/yhook.h | 3 ++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 62df32c0d..7f219e5b0 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1058,7 +1058,7 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * */ //------------------------------------------------------------------------- void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); std::string result = ""; if (!(hh->ParamList.empty())) { @@ -1211,7 +1211,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { bool encode = false; std::string result = ""; - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); if (hh->ParamList["showhidden"] == "false") show_hidden = false; @@ -1357,7 +1357,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { } // ------ generate output ------ - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); std::string result = ""; NeutrinoAPI->eList.clear(); @@ -1457,7 +1457,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if (xml_format) // to stay backward compatible :/ hh->ParamList["format"] = "xml"; - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); /* TODO: maybe add following options as in tuxbox neutrino hh->ParamList["epgitem"] @@ -2996,7 +2996,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { std::string result = ""; std::string configFileName = hh->ParamList["config"]; - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); if (hh->ParamList["action"] == "submit") load = false; @@ -3133,7 +3133,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { @@ -3259,7 +3259,7 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) { std::string item = ""; bool isFirstLine = true; - TOutType outType = hh->outStart(); + TOutType outType = hh->outStart(true /*old mode*/); //Shows all 7 directories stored in the moviebrowser.conf if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index d7a46bf4b..c159416d5 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -28,6 +28,7 @@ CyhookHandler::CyhookHandler() Method = M_UNKNOWN; httpStatus = HTTP_NIL; outType = plain; + outSingle = false; LastModified=0; } @@ -405,7 +406,8 @@ TOutType CyhookHandler::checkOutput() { return outType; } //----------------------------------------------------------------------------- -TOutType CyhookHandler::outStart() { +TOutType CyhookHandler::outStart(bool single) { + outSingle = single; // for compatibility // get outType outType = plain; // plain if (ParamList["format"] == "json") @@ -440,7 +442,13 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool result += "\n"; break; default: - result = _content; + if (outSingle) + result = _content; + else + { + result = _key + "=" + _content; + result += "\n"; + } break; } return result; diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index d5556a043..781d8dc9f 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -139,6 +139,7 @@ public: std::string Sendfile; // Path & Name (local os style) of file to send bool keep_alive; bool cached; // cached by mod_cache + bool outSingle; // Input CStringList ParamList; // local copy of ParamList (Request) @@ -199,7 +200,7 @@ public: int _outIndent; TOutType outType; // Outputtpe = plain (default)|xml|json - TOutType outStart(); + TOutType outStart(bool single = false); TOutType checkOutput(); std::string outIndent(); std::string outPair(std::string _key, std::string _content, bool _next); From 68e6e3df9a20f627b7c0a40ec2c73b0ff8d4ac0e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 12:12:17 +0100 Subject: [PATCH 132/690] controlapi/config: switch to new plain output format Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b941eb950ed8ba9e9bc25dc32fda2dec2a626841 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi/config: switch to new plain output format --- src/nhttpd/tuxboxapi/controlapi.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 7f219e5b0..dbce4ff46 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2996,7 +2996,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { std::string result = ""; std::string configFileName = hh->ParamList["config"]; - TOutType outType = hh->outStart(true /*old mode*/); + TOutType outType = hh->outStart(); if (hh->ParamList["action"] == "submit") load = false; @@ -3022,13 +3022,9 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { replace(key, ".", "_dot_"); replace(key, "-", "_bind_"); if (!(hh->ParamList["config"] == "nhttpd" && it->first == "mod_auth.password")) { - if(outType == plain) - result += key + "=" + it->second + "\n"; - else { - if(it != start) - result += hh->outNext(); - result += hh->outPair(key, it->second, false); - } + if(it != start) + result += hh->outNext(); + result += hh->outPair(key, it->second, false); } } } From 4387f7fbf3fa30b9128548196c0c60a6f0ddf2d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 12:13:13 +0100 Subject: [PATCH 133/690] controlapi/file: switch to new plain output format Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b14383e0dfb8b1af8dd0eb397734f75e2e7dc37c Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi/file: switch to new plain output format --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index dbce4ff46..d3f292007 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3129,7 +3129,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - TOutType outType = hh->outStart(true /*old mode*/); + TOutType outType = hh->outStart(); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { From 300ad9b5ac7b56d53de50a03c3738d4fc1a537fa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 14:28:59 +0100 Subject: [PATCH 134/690] controlapi: add statfs output for a given path Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8375f9ffb68ba73ec121718db19b05a5a89ad2b2 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi: add statfs output for a given path --- src/nhttpd/doc/nhttpd_controlapi.html | 13 +++++ src/nhttpd/tuxboxapi/controlapi.cpp | 82 +++++++++++++++++++++++++++ src/nhttpd/tuxboxapi/controlapi.h | 1 + 3 files changed, 96 insertions(+) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 864fa401f..cb8208cc5 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -251,6 +251,11 @@ http://box_ip/control/config + + Dateisystemstatistiken + + http://box_ip/control/statfs + Streaming URL anfordern @@ -2130,6 +2135,14 @@ Beispiel:
...
  + +
Dateisystemstatistiken
+
Handler: http://box_ip/control/statfs
+
+Parameter: keine oder path=<path>; format=<plain|xml|json>

+
+ +
Streaming URL anfordern
Handler: http://box_ip/control/build_live_url
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index d3f292007..655023b1c 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -15,6 +15,7 @@ // system #include #include +#include // for statfs #include #include #include @@ -221,6 +222,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling {"file", &CControlAPI::FileCGI, "+xml"}, + {"statfs", &CControlAPI::StatfsCGI, "+xml"}, {"getdir", &CControlAPI::getDirCGI, "+xml"} @@ -3224,6 +3226,86 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { } } +//----------------------------------------------------------------------------- +/** Get a list of statfs output for a given path + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/statfs[?path={path}][&format=plain|xml|json] + * @endcode + * + * @par example: + * @code + * /control/statfs + * /control/statfs?path=/media/sda1/movies&format=json + * @endcode + * + * @par output + * @code + * {"success": "true", "data": + * { + * "statfs": [{ + * "path": "/media/sda1/movies", + * "f_type": "0x4d44", + * "f_bsize": "4096", + * "f_blocks": "488444", + * "f_bfree": "365874", + * "f_bavail": "365874", + * "f_files": "0", + * "f_ffree": "0", + * "f_fsid": "0x801, 0", + * "f_namelen": "1530", + * "f_frsize": "24" + * }] + * }} + * @endcode + */ +//----------------------------------------------------------------------------- +void CControlAPI::StatfsCGI(CyhookHandler *hh) { + std::string result = ""; + + if (hh->ParamList["path"].empty()) + hh->ParamList["path"] = "/"; + + TOutType outType = hh->outStart(); + + std::string path = hh->ParamList["path"]; + struct statfs s; + if (::statfs(path.c_str(), &s) == 0) + { + std::string item = ""; + item += hh->outPair("path", path.c_str(), true); + item += hh->outPair("f_type", string_printf("%#lx", (unsigned long) s.f_type), true); + item += hh->outPair("f_bsize", string_printf("%lu", (unsigned long) s.f_bsize), true); + item += hh->outPair("f_blocks", string_printf("%lu", (unsigned long) s.f_blocks), true); + item += hh->outPair("f_bfree", string_printf("%lu", (unsigned long) s.f_bfree), true); + item += hh->outPair("f_bavail", string_printf("%lu", (unsigned long) s.f_bavail), true); + item += hh->outPair("f_files", string_printf("%lu", (unsigned long) s.f_files), true); + item += hh->outPair("f_ffree", string_printf("%lu", (unsigned long) s.f_ffree), true); + item += hh->outPair("f_fsid", string_printf("%#x, %#x", (unsigned) s.f_fsid.__val[0], (unsigned) s.f_fsid.__val[1]), true); + item += hh->outPair("f_namelen", string_printf("%lu", (unsigned long) s.f_namelen), true); + item += hh->outPair("f_frsize", string_printf("%lu", (unsigned long) s.f_frsize), false); + + result = hh->outArrayItem("path", item, false); + result = hh->outArray("statfs", result); + + if (outType == json) + hh->WriteLn(json_out_success(result)); + else + hh->WriteLn(result); + } + else + { + if (outType == json) + hh->WriteLn(json_out_error("statfs failed")); + else + hh->SendError(); + } + +} + //----------------------------------------------------------------------------- /** Get neutrino directories * diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index a8a9c9d4e..1ba5dab7c 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -127,6 +127,7 @@ private: void logoCGI(CyhookHandler *hh); void ConfigCGI(CyhookHandler *hh); void FileCGI(CyhookHandler *hh); + void StatfsCGI(CyhookHandler *hh); void SignalInfoCGI(CyhookHandler *hh); void getDirCGI(CyhookHandler *hh); std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result); From 2de0f2bdb620176bf12b942aa7a9c4677e11bdc2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 15:32:54 +0100 Subject: [PATCH 135/690] neutrinoapi: localize some hardcoded stings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/25af9dea82b3234d9dec079bedda5a73da1206ae Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - neutrinoapi: localize some hardcoded stings --- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 54 ++++++++++++++-------------- src/nhttpd/web/languages/Deutsch | 1 + src/nhttpd/web/languages/English | 1 + 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 22742c07f..2c4f858d3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -334,33 +334,33 @@ std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) std::string result; switch (type) { case CTimerd::TIMER_SHUTDOWN: - result = "Shutdown"; + result = "{=L:timerlist.type.shutdown=}"; break; #if 0 case CTimerd::TIMER_NEXTPROGRAM: - result = "Next program"; + result = "{=L:timerlist.type.nextprogram=}"; break; #endif case CTimerd::TIMER_ZAPTO: - result = "Zap to"; + result = "{=L:timerlist.type.zapto=}"; break; case CTimerd::TIMER_STANDBY: - result = "Standby"; + result = "{=L:timerlist.type.standby=}"; break; case CTimerd::TIMER_RECORD: - result = "Record"; + result = "{=L:timerlist.type.record=}"; break; case CTimerd::TIMER_REMIND: - result = "Reminder"; + result = "{=L:timerlist.type.remind=}"; break; case CTimerd::TIMER_EXEC_PLUGIN: - result = "Execute plugin"; + result = "{=L:timerlist.type.execplugin=}"; break; case CTimerd::TIMER_SLEEPTIMER: - result = "Sleeptimer"; + result = "{=L:timerlist.type.sleeptimer=}"; break; default: - result = "Unknown"; + result = "{=L:timerlist.type.unknown=}"; break; } return result; @@ -373,49 +373,49 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep) std::string result; switch (rep) { case CTimerd::TIMERREPEAT_ONCE: - result = "once"; + result = "{=L:timerlist.repeat.once=}"; break; case CTimerd::TIMERREPEAT_DAILY: - result = "daily"; + result = "{=L:timerlist.repeat.daily=}"; break; case CTimerd::TIMERREPEAT_WEEKLY: - result = "weekly"; + result = "{=L:timerlist.repeat.weekly=}"; break; case CTimerd::TIMERREPEAT_BIWEEKLY: - result = "2-weekly"; + result = "{=L:timerlist.repeat.biweekly=}"; break; case CTimerd::TIMERREPEAT_FOURWEEKLY: - result = "4-weekly"; + result = "{=L:timerlist.repeat.fourweekly=}"; break; case CTimerd::TIMERREPEAT_MONTHLY: - result = "monthly"; + result = "{=L:timerlist.repeat.monthly=}"; break; case CTimerd::TIMERREPEAT_BYEVENTDESCRIPTION: - result = "event"; + result = "{=L:timerlist.repeat.byeventdescription=}"; break; case CTimerd::TIMERREPEAT_WEEKDAYS: - result = "weekdays"; + result = "{=L:timerlist.repeat.weekdays=}"; break; default: if (rep > CTimerd::TIMERREPEAT_WEEKDAYS) { if (rep & 0x0200) - result += "Mo "; + result += "{=L:date.mo=} "; if (rep & 0x0400) - result += "Tu "; + result += "{=L:date.tu=} "; if (rep & 0x0800) - result += "We "; + result += "{=L:date.we=} "; if (rep & 0x1000) - result += "Th "; + result += "{=L:date.th=} "; if (rep & 0x2000) - result += "Fr "; + result += "{=L:date.fr=} "; if (rep & 0x4000) - result += "Sa "; + result += "{=L:date.sa=} "; if (rep & 0x8000) - result += "Su "; + result += "{=L:date.su=} "; } else - result = "Unknown"; + result = "{=L:timerlist.type.unknown=}"; } return result; } @@ -427,7 +427,7 @@ std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) if (aspectRatio >= 0 && aspectRatio <= 4) return videoformat_names[aspectRatio]; else - return "unknown"; + return "{=L:unknown=}"; } //------------------------------------------------------------------------- int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) @@ -457,7 +457,7 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) std::string CNeutrinoAPI::getVideoFramerateAsString(void) { int xres, yres, framerate; - std::string sframerate="unknown"; + std::string sframerate = "{=L:unknown=}"; videoDecoder->getPictureInfo(xres, yres, framerate); switch(framerate){ case 2: diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 9bd7ae720..daf178033 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -58,6 +58,7 @@ restriced_by_management_ip=Zugriff verwehrt wg. ManagementIP automatic=automatisch show=zeigen hide=verstecken +unknown=Unbekannt # ========== Dates date.su=So diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index 4438a6068..96e5695ae 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -58,6 +58,7 @@ restriced_by_management_ip=restricted by ManagementIP automatic=automatically show=show hide=hide +unknown=Unknown # ========== Dates date.su=Su From bd6cd82ef8e6a220fe520ae8d87f7be7938580c4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 20:56:15 +0100 Subject: [PATCH 136/690] controlapi: rename EpgSearchTXTCGI -> EpgSearchCGI Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e765ab983be070b66f0f8138e8c2faca95903fa7 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi: rename EpgSearchTXTCGI -> EpgSearchCGI --- src/nhttpd/tuxboxapi/controlapi.cpp | 4 ++-- src/nhttpd/tuxboxapi/controlapi.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 655023b1c..3f86a22d0 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -167,7 +167,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, - {"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""}, + {"epgsearch", &CControlAPI::EpgSearchCGI, ""}, {"epg", &CControlAPI::EpgCGI, ""}, {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, @@ -1433,7 +1433,7 @@ void CControlAPI::EpgSearchXMLCGI(CyhookHandler *hh) */ //------------------------------------------------------------------------- -void CControlAPI::EpgSearchTXTCGI(CyhookHandler *hh) +void CControlAPI::EpgSearchCGI(CyhookHandler *hh) { SendFoundEvents(hh); } diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 1ba5dab7c..8b635dd9e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -55,8 +55,7 @@ private: void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); void EpgSearchXMLCGI(CyhookHandler *hh); - void EpgSearchTXTCGI(CyhookHandler *hh); - void EpgSearchCGI(CyhookHandler *hh, bool xml_format = false); + void EpgSearchCGI(CyhookHandler *hh); // subs friend class CNeutrinoWebserver; // for timer /fb/ compatibility void doModifyTimer(CyhookHandler *hh); From dede2bc1eb47ade9fed36fdbb48f81545059abd7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 23:06:46 +0100 Subject: [PATCH 137/690] yhook: send valide error/ok responses; allow error message Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/57cc01978b859b375e406fd3717a499388477b98 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - yhook: send valide error/ok responses; allow error message --- src/nhttpd/yhttpd_core/yhook.cpp | 41 ++++++++++++++++++++++++++++++++ src/nhttpd/yhttpd_core/yhook.h | 4 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index c159416d5..c9fd94a08 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -538,3 +538,44 @@ std::string CyhookHandler::outNext() { return ""; } +//----------------------------------------------------------------------------- +void CyhookHandler::SendOk() { + std::string result = ""; + switch (outType) { + case xml: + result = "true"; + break; + case json: + result = "{\"success\": \"true\"}"; + break; + default: + result = "ok"; + break; + } + Write(result); +} +//----------------------------------------------------------------------------- +void CyhookHandler::SendError(std::string error) { + std::string result = ""; + switch (outType) { + case xml: + if (error.empty()) + result = "false"; + else + result = "false" + error + ""; + break; + case json: + if (error.empty()) + result = "{\"success\": \"false\"}"; + else + result = "{\"success\": \"false\", \"error\":{\"text\": \"" + error + "\"}}"; + break; + default: + if (error.empty()) + result = "error"; + else + result = "error=" + error; + break; + } + Write(result); +} diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 781d8dc9f..03147a8da 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -192,8 +192,8 @@ public: void WriteLn(char const *text) {WriteLn(std::string(text));} void SendHTMLHeader(const std::string& Titel); void SendHTMLFooter(void); - void SendOk(void) {(ParamList["response"]=="json") ? Write("{\"success\": \"true\"}") : Write("ok");} - void SendError(void) {(ParamList["response"]=="json") ? Write("{\"success\": \"false\"}") : Write("error");} + void SendOk(void); + void SendError(std::string error = ""); void SendFile(const std::string& url) {NewURL = url; status = HANDLED_SENDFILE;} void SendRedirect(const std::string& url) {httpStatus=HTTP_MOVED_TEMPORARILY; NewURL = url; status = HANDLED_REDIRECTION;} void SendRewrite(const std::string& url) {NewURL = url; status = HANDLED_REWRITE;} From 9de5aff014f13826e604805ba95b3e4ca2eb0990 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 23:08:41 +0100 Subject: [PATCH 138/690] controlapi/config: simplify error handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e407ef5a98ea0e376d462ee0ee5fcf68d521d99a Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi/config: simplify error handling --- src/nhttpd/tuxboxapi/controlapi.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 3f86a22d0..3f73be8cf 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3045,9 +3045,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { } else { if(!configFileName.empty()) - error = string_printf("no config defined for: %s", (hh->ParamList["config"]).c_str()); - else - error = "no config given"; + error = string_printf("no config defined for %s", (hh->ParamList["config"]).c_str()); } // write footer @@ -3059,14 +3057,8 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { hh->WriteLn(hh->outCollection("config", result)); } } - else { - if (outType == json) { - hh->WriteLn(json_out_error(error)); - } - else { - hh->SendError(); - } - } + else + hh->SendError(error); delete Config; } From 94230c54d8dbe145d4865bff55880c678c377f7a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Feb 2016 23:10:17 +0100 Subject: [PATCH 139/690] controlapi/statfs: simplify error handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/09277564670b839ef5782d2e01cecbb81174b901 Author: vanhofen Date: 2016-02-20 (Sat, 20 Feb 2016) Origin message was: ------------------ - controlapi/statfs: simplify error handling --- src/nhttpd/tuxboxapi/controlapi.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 3f73be8cf..43a9dcbcf 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3289,13 +3289,7 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { hh->WriteLn(result); } else - { - if (outType == json) - hh->WriteLn(json_out_error("statfs failed")); - else - hh->SendError(); - } - + hh->SendError("statfs failed"); } //----------------------------------------------------------------------------- From 7bd69b0418433b4aa45e3e5c638b8a9a62068e25 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 00:16:15 +0100 Subject: [PATCH 140/690] yhook: add SendResult() function to simplify result output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b48c1d6551d9213d82aa6acca6db9a9a6da1f90f Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - yhook: add SendResult() function to simplify result output --- src/nhttpd/yhttpd_core/yhook.cpp | 16 ++++++++++++++++ src/nhttpd/yhttpd_core/yhook.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index c9fd94a08..649f309d3 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -579,3 +579,19 @@ void CyhookHandler::SendError(std::string error) { } Write(result); } +//----------------------------------------------------------------------------- +void CyhookHandler::SendResult(std::string _content) { + std::string result = ""; + switch (outType) { + case xml: + result = _content; + break; + case json: + result = json_out_success(_content); + break; + default: + result = _content; + break; + } + WriteLn(result); +} diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 03147a8da..66c4fb362 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -194,6 +194,7 @@ public: void SendHTMLFooter(void); void SendOk(void); void SendError(std::string error = ""); + void SendResult(std::string _content); void SendFile(const std::string& url) {NewURL = url; status = HANDLED_SENDFILE;} void SendRedirect(const std::string& url) {httpStatus=HTTP_MOVED_TEMPORARILY; NewURL = url; status = HANDLED_REDIRECTION;} void SendRewrite(const std::string& url) {NewURL = url; status = HANDLED_REWRITE;} From 14bb43cee5bfb1de305e4811e353145302b2c915 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 00:16:42 +0100 Subject: [PATCH 141/690] controlapi: simplify result output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c73ca39e7edf231aaced5a76a48d48052ab0be5 Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - controlapi: simplify result output --- src/nhttpd/tuxboxapi/controlapi.cpp | 90 +++++++++-------------------- 1 file changed, 26 insertions(+), 64 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 43a9dcbcf..3eb865cfd 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1127,22 +1127,12 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { } } result = hh->outArray("channels", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } } - else { - if (hh->ParamList["format"] == "json") { - hh->WriteLn(json_out_error("no parameter")); - } - else - hh->WriteLn("error"); - } + else + hh->SendError("no parameter"); } //------------------------------------------------------------------------- @@ -1258,13 +1248,8 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { } } result = hh->outArray("bouquets", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } //----------------------------------------------------------------------------- // details EPG Information for channelid @@ -1359,7 +1344,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { } // ------ generate output ------ - TOutType outType = hh->outStart(true /*old mode*/); + hh->outStart(true /*old mode*/); std::string result = ""; NeutrinoAPI->eList.clear(); @@ -1400,13 +1385,8 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { result = channelEPGformated(hh, 0, channel_id, max, stoptime); result = hh->outCollection("epglist", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } //------------------------------------------------------------------------------------------------- inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) @@ -1459,7 +1439,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if (xml_format) // to stay backward compatible :/ hh->ParamList["format"] = "xml"; - TOutType outType = hh->outStart(true /*old mode*/); + hh->outStart(true /*old mode*/); /* TODO: maybe add following options as in tuxbox neutrino hh->ParamList["epgitem"] @@ -1593,16 +1573,13 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) #endif } hh->WriteLn("----------------------------------------------------------"); + return; } } } result = hh->outArray("epgsearch", result); - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else if (outType == xml) { - hh->WriteLn(result); - } + + hh->SendResult(result); } //------------------------------------------------------------------------- @@ -2998,7 +2975,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { std::string result = ""; std::string configFileName = hh->ParamList["config"]; - TOutType outType = hh->outStart(); + hh->outStart(); if (hh->ParamList["action"] == "submit") load = false; @@ -3048,15 +3025,10 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { error = string_printf("no config defined for %s", (hh->ParamList["config"]).c_str()); } - // write footer - if (error.empty()) { - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(hh->outCollection("config", result)); - } - } + hh->WriteLn(hh->outCollection("config", result)); + + if (error.empty()) + hh->SendResult(result); else hh->SendError(error); @@ -3123,7 +3095,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - TOutType outType = hh->outStart(); + hh->outStart(); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { @@ -3202,10 +3174,8 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { } } result = hh->outArray("filelist", result); - if (outType == json) - hh->WriteLn(json_out_success(result)); - else - hh->WriteLn(result); + + hh->SendResult(result); } // create new folder else if (hh->ParamList["action"] == "new_folder") { @@ -3261,7 +3231,7 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { if (hh->ParamList["path"].empty()) hh->ParamList["path"] = "/"; - TOutType outType = hh->outStart(); + hh->outStart(); std::string path = hh->ParamList["path"]; struct statfs s; @@ -3283,10 +3253,7 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { result = hh->outArrayItem("path", item, false); result = hh->outArray("statfs", result); - if (outType == json) - hh->WriteLn(json_out_success(result)); - else - hh->WriteLn(result); + hh->SendResult(result); } else hh->SendError("statfs failed"); @@ -3323,7 +3290,7 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) { std::string item = ""; bool isFirstLine = true; - TOutType outType = hh->outStart(true /*old mode*/); + hh->outStart(true /*old mode*/); //Shows all 7 directories stored in the moviebrowser.conf if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { @@ -3373,13 +3340,8 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) { result = hh->outArray("dirs", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } //Helpfunction to get subdirs of a dir From ae476ce195287804becccd8888ff7e013a01ee74 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 01:29:17 +0100 Subject: [PATCH 142/690] yhook: remove unnecessary line feeds from plain output; ... align control/getbouquet Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/89e0ba1a419cc56c5b9cd4cb01b6902d96000fab Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - yhook: remove unnecessary line feeds from plain output; ... align control/getbouquet --- src/nhttpd/tuxboxapi/controlapi.cpp | 12 ++++++++---- src/nhttpd/yhttpd_core/yhook.cpp | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 3eb865cfd..e7e689a6a 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1203,7 +1203,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { bool encode = false; std::string result = ""; - TOutType outType = hh->outStart(true /*old mode*/); + TOutType outType = hh->outStart(); if (hh->ParamList["showhidden"] == "false") show_hidden = false; @@ -1241,9 +1241,13 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { bouquet = std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str()); if (encode) bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname - item = hh->outPair("number", string_printf("%u", i + 1), true); - if(outType == plain) item+= " "; - item += hh->outPair("name", bouquet, false); + if (outType == plain) + item = string_printf("%u", i + 1) + " " + bouquet + "\n"; + else + { + item = hh->outPair("number", string_printf("%u", i + 1), true); + item += hh->outPair("name", bouquet, false); + } result += hh->outArrayItem("bouquet", item, (i < size-1)); } } diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 649f309d3..da238ce81 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -427,31 +427,27 @@ TOutType CyhookHandler::outStart(bool single) { std::string CyhookHandler::outIndent() { return ""; } + //----------------------------------------------------------------------------- std::string CyhookHandler::outPair(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: result = outIndent() + "<" + _key + ">" + _content + ""; - result += "\n"; break; case json: result = outIndent() + "\"" + _key + "\": \"" + _content + "\""; if(_next) result += ","; - result += "\n"; break; default: if (outSingle) result = _content; else - { result = _key + "=" + _content; - result += "\n"; - } break; } - return result; + return result + "\n"; } //----------------------------------------------------------------------------- @@ -461,16 +457,18 @@ std::string CyhookHandler::outArray(std::string _key, std::string _content) { case xml: //TODO: xml check and DESC check result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; break; case json: //TODO: json check result = outIndent() + "\"" + _key + "\": [" + _content + "]"; + result += "\n"; break; default: result = _content; break; } - return result + "\n"; + return result; } //----------------------------------------------------------------------------- @@ -480,18 +478,20 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, case xml: //TODO: xml check and DESC check result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; break; case json: //TODO: json check result = outIndent() + "{" + _content + "}"; if(_next) result += ","; + result += "\n"; break; default: result = _content; break; } - return result + "\n"; + return result; } //----------------------------------------------------------------------------- std::string CyhookHandler::outCollection(std::string _key, std::string _content) { @@ -500,16 +500,18 @@ std::string CyhookHandler::outCollection(std::string _key, std::string _content) case xml: //TODO: xml check and DESC check result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; break; case json: //TODO: json check result = outIndent() + "\"" + _key + "\": {" + _content + "}"; + result += "\n"; break; default: result = _content; break; } - return result + "\n"; + return result; } //----------------------------------------------------------------------------- @@ -521,7 +523,6 @@ std::string CyhookHandler::outValue(std::string _content) { break; case json: result = json_convert_string(_content); -// result = _content; break; default: From 00774d8fde0fa1f83649482b7c51ed130ce632c7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 20:20:23 +0100 Subject: [PATCH 143/690] controlapi: reformat yCgiCallList Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca34eadcf1039ce042b3afddb48569758a4cdf3b Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - controlapi: reformat yCgiCallList --- src/nhttpd/tuxboxapi/controlapi.cpp | 118 ++++++++++++++-------------- 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index e7e689a6a..82edf5a7c 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -157,75 +157,73 @@ void CControlAPI::compatibility_Timer(CyhookHandler *hh) const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= { // channel & bouquet & epg & zapping handling - {"getservicesxml", &CControlAPI::GetServicesxmlCGI,""}, - {"getbouquetsxml", &CControlAPI::GetBouquetsxmlCGI,""}, - {"getubouquetsxml", &CControlAPI::GetUBouquetsxmlCGI,""}, - {"channellist", &CControlAPI::ChannellistCGI, "text/plain"}, - {"logolist", &CControlAPI::LogolistCGI, "text/plain"}, - {"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"}, - {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, - {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, - {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, - {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, - {"epgsearch", &CControlAPI::EpgSearchCGI, ""}, - {"epg", &CControlAPI::EpgCGI, ""}, - {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, - {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, - {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, - {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, + {"getservicesxml", &CControlAPI::GetServicesxmlCGI, ""}, + {"getbouquetsxml", &CControlAPI::GetBouquetsxmlCGI, ""}, + {"getubouquetsxml", &CControlAPI::GetUBouquetsxmlCGI, ""}, + {"channellist", &CControlAPI::ChannellistCGI, "text/plain"}, + {"logolist", &CControlAPI::LogolistCGI, "text/plain"}, + {"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"}, + {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, + {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, + {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, + {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, + {"epgsearch", &CControlAPI::EpgSearchCGI, ""}, + {"epg", &CControlAPI::EpgCGI, ""}, + {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, + {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, + {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, + {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system - {"standby", &CControlAPI::StandbyCGI, "text/plain"}, - {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, - {"reboot", &CControlAPI::RebootCGI, "text/plain"}, - {"getdate", &CControlAPI::GetDateCGI, "text/plain"}, - {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, - {"info", &CControlAPI::InfoCGI, "text/plain"}, - {"version", &CControlAPI::VersionCGI, ""}, - {"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""}, - {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, - {"reloadchannels", &CControlAPI::ReloadChannelsCGI, ""}, - {"screenshot", &CControlAPI::ScreenshotCGI, ""}, + {"standby", &CControlAPI::StandbyCGI, "text/plain"}, + {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, + {"reboot", &CControlAPI::RebootCGI, "text/plain"}, + {"getdate", &CControlAPI::GetDateCGI, "text/plain"}, + {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, + {"info", &CControlAPI::InfoCGI, "text/plain"}, + {"version", &CControlAPI::VersionCGI, ""}, + {"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""}, + {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, + {"reloadchannels", &CControlAPI::ReloadChannelsCGI, ""}, + {"screenshot", &CControlAPI::ScreenshotCGI, ""}, // boxcontrol - devices - {"volume", &CControlAPI::VolumeCGI, "text/plain"}, - {"lcd", &CControlAPI::LCDAction, "text/plain"}, - {"system", &CControlAPI::SystemCGI, "text/plain"}, - {"message", &CControlAPI::MessageCGI, "text/plain"}, - {"rc", &CControlAPI::RCCGI, "text/plain"}, - {"rcem", &CControlAPI::RCEmCGI, "text/plain"}, + {"volume", &CControlAPI::VolumeCGI, "text/plain"}, + {"lcd", &CControlAPI::LCDAction, "text/plain"}, + {"system", &CControlAPI::SystemCGI, "text/plain"}, + {"message", &CControlAPI::MessageCGI, "text/plain"}, + {"rc", &CControlAPI::RCCGI, "text/plain"}, + {"rcem", &CControlAPI::RCEmCGI, "text/plain"}, // Start skripts, plugins - {"startplugin", &CControlAPI::StartPluginCGI, "text/plain"}, - {"exec", &CControlAPI::ExecCGI, "+xml"}, - {"yweb", &CControlAPI::YWebCGI, "text/plain"}, + {"startplugin", &CControlAPI::StartPluginCGI, "text/plain"}, + {"exec", &CControlAPI::ExecCGI, "+xml"}, + {"yweb", &CControlAPI::YWebCGI, "text/plain"}, // video & Audio handling - {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, - {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, - {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, - {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, - {"scartmode", &CControlAPI::ScartModeCGI, "text/plain"}, - {"audio", &CControlAPI::AudioCGI, "text/plain"}, - {"crypt", &CControlAPI::CryptCGI, "text/plain"}, + {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, + {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, + {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, + {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, + {"scartmode", &CControlAPI::ScartModeCGI, "text/plain"}, + {"audio", &CControlAPI::AudioCGI, "text/plain"}, + {"crypt", &CControlAPI::CryptCGI, "text/plain"}, // timer - {"timer", &CControlAPI::TimerCGI, "text/plain"}, + {"timer", &CControlAPI::TimerCGI, "text/plain"}, // bouquet editing - {"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"}, - {"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"}, - {"movebouquet", &CControlAPI::moveBouquetCGI, "text/plain"}, - {"deletebouquet", &CControlAPI::deleteBouquetCGI, "text/plain"}, - {"addbouquet", &CControlAPI::addBouquetCGI, "text/plain"}, - {"renamebouquet", &CControlAPI::renameBouquetCGI, "text/plain"}, - {"changebouquet", &CControlAPI::changeBouquetCGI, "text/plain"}, - {"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"}, + {"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"}, + {"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"}, + {"movebouquet", &CControlAPI::moveBouquetCGI, "text/plain"}, + {"deletebouquet", &CControlAPI::deleteBouquetCGI, "text/plain"}, + {"addbouquet", &CControlAPI::addBouquetCGI, "text/plain"}, + {"renamebouquet", &CControlAPI::renameBouquetCGI, "text/plain"}, + {"changebouquet", &CControlAPI::changeBouquetCGI, "text/plain"}, + {"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"}, // utils - {"build_live_url", &CControlAPI::build_live_url, ""}, - {"get_logo", &CControlAPI::logoCGI, "text/plain"}, + {"build_live_url", &CControlAPI::build_live_url, ""}, + {"get_logo", &CControlAPI::logoCGI, "text/plain"}, // settings - {"config", &CControlAPI::ConfigCGI, "text/plain"}, + {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling - {"file", &CControlAPI::FileCGI, "+xml"}, - {"statfs", &CControlAPI::StatfsCGI, "+xml"}, - {"getdir", &CControlAPI::getDirCGI, "+xml"} - - + {"file", &CControlAPI::FileCGI, "+xml"}, + {"statfs", &CControlAPI::StatfsCGI, "+xml"}, + {"getdir", &CControlAPI::getDirCGI, "+xml"} }; //----------------------------------------------------------------------------- // Main Dispatcher From 290240f5a0bc9976f1ac5db48a125122073a8ffa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 21:41:24 +0100 Subject: [PATCH 144/690] yhook: rename unused checkOutput() -> getOutType() and use it Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3d78e7d65743e54855239dc75f14caf3c3059bb7 Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - yhook: rename unused checkOutput() -> getOutType() and use it --- src/nhttpd/yhttpd_core/yhook.cpp | 22 +++++++++------------- src/nhttpd/yhttpd_core/yhook.h | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index da238ce81..c8f437b7d 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -73,7 +73,7 @@ THandleStatus CyhookHandler::Hooks_SendResponse() { //----------------------------------------------------------------------------- THandleStatus CyhookHandler::Hooks_PrepareResponse() { log_level_printf(4, "PrepareResponse Hook-List Start\n"); - outType = checkOutput(); + outType = getOutType(); THandleStatus _status = HANDLED_NONE; THookList::iterator i = HookList.begin(); for (; i != HookList.end(); ++i) { @@ -392,28 +392,24 @@ void CyhookHandler::printf(const char *fmt, ...) { Write(outbuf); } //----------------------------------------------------------------------------- -TOutType CyhookHandler::checkOutput() { - // get outType - outType = plain; // plain +TOutType CyhookHandler::getOutType() { + TOutType _outType = plain; if(!(ParamList.empty())) { if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "json") || (ParamList.find("json") != ParamList.end() && !(ParamList["json"].empty())) ) - outType = json; + _outType = json; else if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "xml") || (ParamList.find("xml") != ParamList.end() && !(ParamList["xml"].empty())) ) - outType = xml; + _outType = xml; } - return outType; + return _outType; } //----------------------------------------------------------------------------- TOutType CyhookHandler::outStart(bool single) { - outSingle = single; // for compatibility + // for compatibility + outSingle = single; // get outType - outType = plain; // plain - if (ParamList["format"] == "json") - outType = json; - else if (ParamList["format"] == "xml" || !(ParamList["xml"].empty()) ) - outType = xml; + outType = getOutType(); // set response header if (outType == xml) SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 66c4fb362..986e016b8 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -202,7 +202,7 @@ public: int _outIndent; TOutType outType; // Outputtpe = plain (default)|xml|json TOutType outStart(bool single = false); - TOutType checkOutput(); + TOutType getOutType(); std::string outIndent(); std::string outPair(std::string _key, std::string _content, bool _next); std::string outArray(std::string _key, std::string _content); From f87f36b13b7163322972df95ff78f52aed1f4bbe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 21:41:25 +0100 Subject: [PATCH 145/690] controlapi: use getOutType() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b1b9afba8b692f5bc2a9f5fab3c1472abc50b43 Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - controlapi: use getOutType() function --- src/nhttpd/tuxboxapi/controlapi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 82edf5a7c..b7909d792 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -264,7 +264,7 @@ void CControlAPI::Execute(CyhookHandler *hh) else if(std::string(yCgiCallList[index].mime_type).empty()) // decide in function ; else if(std::string(yCgiCallList[index].mime_type) == "+xml") // Parameter xml? - if ((!hh->ParamList["xml"].empty()) ||(hh->ParamList["format"] == "xml")) + if (hh->getOutType() == xml) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); @@ -314,7 +314,7 @@ void CControlAPI::TimerCGI(CyhookHandler *hh) } } else { - if (hh->ParamList["format"] == "xml") + if (hh->getOutType() == xml) SendTimersXML(hh); else SendTimers(hh); @@ -400,9 +400,9 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) bool res = false; std::string script, result; // override standard header - if (hh->ParamList.size() > 1 && hh->ParamList["xml"].empty()) + if (hh->ParamList.size() > 1 && (hh->getOutType() != xml)) hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); - else if (hh->ParamList.size() > 1 && !hh->ParamList["xml"].empty()) + else if (hh->ParamList.size() > 1 && (hh->getOutType() == xml)) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); @@ -1608,7 +1608,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { bool param_empty = hh->ParamList.empty(); hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default // Detailed EPG list in XML or JSON - if (!hh->ParamList["xml"].empty() || !hh->ParamList["json"].empty() || !hh->ParamList["detaillist"].empty()) { + if (hh->getOutType() == xml || hh->getOutType() == json || !hh->ParamList["detaillist"].empty()) { epgDetailList(hh); } // Standard list normal or extended @@ -1639,7 +1639,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } else if (!hh->ParamList["search"].empty()) { - SendFoundEvents(hh, (!hh->ParamList["xml"].empty() || hh->ParamList["format"] == "xml")); + SendFoundEvents(hh, (hh->getOutType() == xml)); } // query details for given eventid else if (!hh->ParamList["eventid"].empty()) { From 5cc8f245d3a2659c96e4f3063ecb2dd1d06247db Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 21:41:25 +0100 Subject: [PATCH 146/690] upnpbrowser: more offset for text in browserlist Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9305daf8ac7e00e421ea21a8986bff5e9da860b Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - upnpbrowser: more offset for text in browserlist --- src/gui/upnpbrowser.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 32912b418..598ebe0af 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1019,11 +1019,17 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po char tmp_time[] = "00:00:00.0"; int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); - m_frameBuffer->paintIcon(fileicon, m_x + 5 , ypos + (m_fheight - 16) / 2); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, info, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 30, ypos + m_fheight, m_width - 50 - w, - name, color, m_fheight); + int icon_w = 0; + int icon_h = 0; + int icon_o = 0; + m_frameBuffer->getIconSize(fileicon.c_str(), &icon_w, &icon_h); + if (icon_w && icon_h) + { + icon_o = icon_w + 10; + m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_fheight - icon_h) / 2); + } + g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_fheight, w, info, color, m_fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 10 + icon_o, ypos + m_fheight, m_width - icon_o - 15 - 2*10 - w, name, color, m_fheight); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) From db95a61143140aaf770b5cbe1e520d4e5f44e748 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 21:41:25 +0100 Subject: [PATCH 147/690] controlapi/statfs: remove unneccessary array from xml/json Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5497621f4de659dfde5fe1859fca385e8ff9035c Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - controlapi/statfs: remove unneccessary array from xml/json --- src/nhttpd/tuxboxapi/controlapi.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index b7909d792..978e494ca 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3210,7 +3210,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { * @code * {"success": "true", "data": * { - * "statfs": [{ + * "statfs": { * "path": "/media/sda1/movies", * "f_type": "0x4d44", * "f_bsize": "4096", @@ -3222,7 +3222,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { * "f_fsid": "0x801, 0", * "f_namelen": "1530", * "f_frsize": "24" - * }] + * } * }} * @endcode */ @@ -3252,8 +3252,7 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { item += hh->outPair("f_namelen", string_printf("%lu", (unsigned long) s.f_namelen), true); item += hh->outPair("f_frsize", string_printf("%lu", (unsigned long) s.f_frsize), false); - result = hh->outArrayItem("path", item, false); - result = hh->outArray("statfs", result); + result = hh->outCollection("statfs", item); hh->SendResult(result); } From 9c7e163c676b25df993abb7100a11bb73c9d3ba8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 21 Feb 2016 21:41:26 +0100 Subject: [PATCH 148/690] controlapi/getmode: get right mode; allow json/xml output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/10252bd09c0e21c859071efab081a1957bdb2766 Author: vanhofen Date: 2016-02-21 (Sun, 21 Feb 2016) Origin message was: ------------------ - controlapi/getmode: get right mode; allow json/xml output --- src/nhttpd/tuxboxapi/controlapi.cpp | 36 ++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 978e494ca..b3c31b8b4 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -385,13 +385,37 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::GetModeCGI(CyhookHandler *hh) { - int mode = NeutrinoAPI->Zapit->getMode(); - if ( mode == CZapitClient::MODE_TV) - hh->WriteLn("tv"); - else if ( mode == CZapitClient::MODE_RADIO) - return hh->WriteLn("radio"); + hh->outStart(); + + std::string result = ""; + int mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_tv) + result = "tv"; + else if (mode == NeutrinoMessages::mode_radio) + result = "radio"; + else if (mode == NeutrinoMessages::mode_scart) + result = "scart"; + else if (mode == NeutrinoMessages::mode_standby) + result = "standby"; + else if (mode == NeutrinoMessages::mode_audio) + result = "audio"; + else if (mode == NeutrinoMessages::mode_pic) + result = "pic"; + else if (mode == NeutrinoMessages::mode_ts) + result = "ts"; + else if (mode == NeutrinoMessages::mode_webtv) + result = "webtv"; + else if (mode == NeutrinoMessages::mode_upnp) + result = "upnp"; else - return hh->WriteLn("unknown"); + result = "unknown"; + + if (hh->getOutType() != plain) + { + result = hh->outPair("mode", result, false); + result = hh->outCollection("getmode", result); + } + hh->SendResult(result); } //----------------------------------------------------------------------------- From dc1c789a0d45ffffeb61bcb79b79bfc18d7df723 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 14:15:02 +0100 Subject: [PATCH 149/690] controlapi/mod_yparse: avoid double code ... ... by moving functions to execute scripts to helpers.cpp|h Change outType from ExecCGI to text/plain because all arguments are passed to the script. So no format can be defined. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b5e2998d5436285f73ba6971fe9d67d116f3c49a Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - controlapi/mod_yparse: avoid double code ... ... by moving functions to execute scripts to helpers.cpp|h Change outType from ExecCGI to text/plain because all arguments are passed to the script. So no format can be defined. --- src/nhttpd/tuxboxapi/controlapi.cpp | 79 ++++---------------------- src/nhttpd/tuxboxapi/controlapi.h | 6 +- src/nhttpd/yhttpd_core/helper.cpp | 51 +++++++++++++++++ src/nhttpd/yhttpd_core/helper.h | 5 ++ src/nhttpd/yhttpd_mods/mod_yparser.cpp | 50 +--------------- src/nhttpd/yhttpd_mods/mod_yparser.h | 1 - 6 files changed, 70 insertions(+), 122 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index b3c31b8b4..df348214b 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -194,7 +194,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"rcem", &CControlAPI::RCEmCGI, "text/plain"}, // Start skripts, plugins {"startplugin", &CControlAPI::StartPluginCGI, "text/plain"}, - {"exec", &CControlAPI::ExecCGI, "+xml"}, + {"exec", &CControlAPI::ExecCGI, "text/plain"}, {"yweb", &CControlAPI::YWebCGI, "text/plain"}, // video & Audio handling {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, @@ -421,16 +421,8 @@ void CControlAPI::GetModeCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::ExecCGI(CyhookHandler *hh) { - bool res = false; std::string script, result; - // override standard header - if (hh->ParamList.size() > 1 && (hh->getOutType() != xml)) - hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); - else if (hh->ParamList.size() > 1 && (hh->getOutType() == xml)) - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - else - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - if ( !hh->ParamList.empty() ) + if (!hh->ParamList.empty() ) { script = hh->ParamList["1"]; unsigned int len = hh->ParamList.size(); @@ -440,16 +432,18 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) script += " "; script += hh->ParamList[itoa(y)]; } - result = YexecuteScript(hh, script); + result = yExecuteScript(script); } else - printf("[CControlAPI] no script given\n"); + { + log_level_printf(0, "[%s] no script given\n", __func__); + result = "error"; + } - res = (result != "error"); - if (res) - hh->Write(result); - else + if (result == "error") hh->SetError(HTTP_NOT_FOUND); + else + hh->WriteLn(result); } //----------------------------------------------------------------------------- @@ -2433,59 +2427,6 @@ void CControlAPI::YWeb_SendRadioStreamingPid(CyhookHandler *hh) } //----------------------------------------------------------------------------- -std::string CControlAPI::YexecuteScript(CyhookHandler *, std::string cmd) -{ - std::string script, para, result; - bool found = false; - - // split script and parameters - int pos; - if ((pos = cmd.find_first_of(" ")) > 0) - { - script = cmd.substr(0, pos); - para = cmd.substr(pos+1,cmd.length() - (pos+1)); // snip - } - else - script=cmd; - // get file - std::string fullfilename; - script += ".sh"; //add script extention - char cwd[255]={0}; - getcwd(cwd, 254); - - for (unsigned int i=0; iParamList["update"]="1"; diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 8b635dd9e..67c812b71 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -69,7 +69,6 @@ private: void YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no); void YWeb_SendRadioStreamingPid(CyhookHandler *hh); void compatibility_Timer(CyhookHandler *hh); - std::string YexecuteScript(CyhookHandler *hh, std::string cmd); // CGI functions for ExecuteCGI void TimerCGI(CyhookHandler *hh); @@ -133,14 +132,15 @@ private: protected: - static const unsigned int PLUGIN_DIR_COUNT = 9; - static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; CNeutrinoAPI *NeutrinoAPI; void init(CyhookHandler *hh); void Execute(CyhookHandler *hh); public: + static const unsigned int PLUGIN_DIR_COUNT = 9; + static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; + // constructor & deconstructor CControlAPI(CNeutrinoAPI *_NeutrinoAPI); diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 1a4e98aff..1dabc4db6 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -11,8 +11,11 @@ #include #include +#include + // yhttpd #include +#include #include "ytypes_globals.h" #include "helper.h" #include "ylogging.h" @@ -354,3 +357,51 @@ std::string json_convert_string(std::string s) { } return ss.str(); } + +std::string yExecuteScript(std::string cmd) { + std::string script, para, result; + bool found = false; + + //aprintf("%s: %s\n", __func__, cmd.c_str()); + + // split script and parameters + int pos; + if ((pos = cmd.find_first_of(" ")) > 0) { + script = cmd.substr(0, pos); + para = cmd.substr(pos + 1, cmd.length() - (pos + 1)); // snip + } else + script = cmd; + // get file + std::string fullfilename; + script += ".sh"; //add script extention + + char cwd[255]; + getcwd(cwd, 254); + for (unsigned int i = 0; i < CControlAPI::PLUGIN_DIR_COUNT && !found; i++) { + fullfilename = CControlAPI::PLUGIN_DIRS[i] + "/" + script; + FILE *test = fopen(fullfilename.c_str(), "r"); // use fopen: popen does not work + if (test != NULL) { + fclose(test); + chdir(CControlAPI::PLUGIN_DIRS[i].c_str()); + FILE *f = popen((fullfilename + " " + para).c_str(), "r"); //execute + if (f != NULL) { + found = true; + + char output[1024]; + while (fgets(output, 1024, f)) // get script output + result += output; + pclose(f); + } + } + } + chdir(cwd); + + if (!found) { + printf("%s: script %s not found in:\n", __func__, script.c_str()); + for (unsigned int i = 0; i < CControlAPI::PLUGIN_DIR_COUNT; i++) { + printf("\t%s\n", CControlAPI::PLUGIN_DIRS[i].c_str()); + } + result = "error"; + } + return result; +} diff --git a/src/nhttpd/yhttpd_core/helper.h b/src/nhttpd/yhttpd_core/helper.h index 22a917e8b..0984cf54c 100644 --- a/src/nhttpd/yhttpd_core/helper.h +++ b/src/nhttpd/yhttpd_core/helper.h @@ -49,4 +49,9 @@ std::string json_out_success(std::string _result); std::string json_out_error(std::string _error); std::string json_convert_string(std::string s); +//----------------------------------------------------------------------------- +// Script Helpers +//----------------------------------------------------------------------------- +std::string yExecuteScript(std::string cmd); + #endif /* __yhttpd_helper_h__ */ diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index b75231fc7..bcef54ea4 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -397,7 +397,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { yresult = ""; } } else if (ycmd_type == "script") - yresult = YexecuteScript(hh, ycmd_name); + yresult = yExecuteScript(ycmd_name); else if (ycmd_type == "if-empty") { std::string if_value, if_then, if_else; if (ySplitString(ycmd_name, "~", if_value, if_then)) { @@ -636,54 +636,6 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, return yresult; } -//------------------------------------------------------------------------- - -std::string CyParser::YexecuteScript(CyhookHandler *, std::string cmd) { - std::string script, para, result; - bool found = false; - - // split script and parameters - int pos; - if ((pos = cmd.find_first_of(" ")) > 0) { - script = cmd.substr(0, pos); - para = cmd.substr(pos + 1, cmd.length() - (pos + 1)); // snip - } else - script = cmd; - // get file - std::string fullfilename; - script += ".sh"; //add script extention - - char cwd[255]; - getcwd(cwd, 254); - for (unsigned int i = 0; i < PLUGIN_DIR_COUNT && !found; i++) { - fullfilename = PLUGIN_DIRS[i] + "/" + script; - FILE *test = fopen(fullfilename.c_str(), "r"); // use fopen: popen does not work - if (test != NULL) { - fclose(test); - chdir(PLUGIN_DIRS[i].c_str()); - FILE *f = popen((fullfilename + " " + para).c_str(), "r"); //execute - if (f != NULL) { - found = true; - - char output[1024]; - while (fgets(output, 1024, f)) // get script output - result += output; - pclose(f); - } - } - } - chdir(cwd); - - if (!found) { - printf(" script %s not found in\n", script.c_str()); - for (unsigned int i = 0; i < PLUGIN_DIR_COUNT; i++) { - printf("%s\n", PLUGIN_DIRS[i].c_str()); - } - result = "error"; - } - return result; -} - //============================================================================= // y-func : Dispatching // TODO: new functions for diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index ae5d49118..dc6209ec2 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -95,7 +95,6 @@ private: std::string YWeb_cgi_get_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string yaccess); void YWeb_cgi_set_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string varvalue, std::string yaccess); std::string YWeb_cgi_include_block(std::string filename, std::string blockname, std::string ydefault); - std::string YexecuteScript(CyhookHandler *hh, std::string cmd); // CGIs void cgi(CyhookHandler *hh); From 0c73944b0263f621e9df6d1307afaec7e68d1e1e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Feb 2016 18:03:27 +0300 Subject: [PATCH 150/690] nhttpd/tuxboxapi/neutrinoyparser.cpp: copy event to prevent crash in multi-threaded mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f771856ab8b9aa0d597f5deed780ba87971ce71 Author: [CST] Focus Date: 2016-02-22 (Mon, 22 Feb 2016) --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 1d0f4ae4e..203012bc0 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -358,9 +358,12 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: for(int j = 0; j < (int) channels.size(); j++) { CZapitChannel * channel = channels[j]; - CChannelEvent *event; + CChannelEvent event; + event.eventID = 0; NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + if (evt) + event = *evt; NeutrinoAPI->Unlock(); classname = (i++ & 1) ? 'a' : 'b'; @@ -399,9 +402,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } /* timer slider */ - if(event && event->duration > 0) + if(event.eventID && event.duration > 0) { - prozent = 100 * (time(NULL) - event->startTime) / event->duration; + prozent = 100 * (time(NULL) - event.startTime) / event.duration; yresult += string_printf(" - + - + - + @@ -72,7 +72,7 @@ function do_check_input_LogosURL() - @@ -85,18 +85,18 @@ function do_check_input_LogosURL() - + @@ -115,13 +115,13 @@ function do_check_input_LogosURL() - + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ - =} diff --git a/src/nhttpd/web/Y_Settings_personalize.yhtm b/src/nhttpd/web/Y_Settings_personalize.yhtm index 58fd92d01..5321cb6c0 100644 --- a/src/nhttpd/web/Y_Settings_personalize.yhtm +++ b/src/nhttpd/web/Y_Settings_personalize.yhtm @@ -15,44 +15,44 @@ function do_submit() } function do_init() { - obj_set_radio_value('p_tv', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_tvmode;1~open=}"); - obj_set_radio_value('p_radio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_radiomode;1~cache=}"); - obj_set_radio_value('p_scart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scartmode;1~cache=}"); - obj_set_radio_value('p_games', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_games;1~cache=}"); - obj_set_radio_value('p_audioplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;1~cache=}"); - obj_set_radio_value('p_inetradio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_inetradio;1~cache=}"); - obj_set_radio_value('p_movieplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;1~cache=}"); - obj_set_radio_value('p_picviewer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;1~cache=}"); - obj_set_radio_value('p_pinstatus', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pinstatus;0~cache=}"); - obj_set_radio_value('p_upnp', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;1~cache=}"); - obj_set_radio_value('p_sleeptimer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;1~cache=}"); - obj_set_radio_value('p_reboot', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reboot;1~cache=}"); - obj_set_radio_value('p_shutdown', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_shutdown;1~cache=}"); - obj_set_radio_value('p_settings', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_settings;0~cache=}"); - obj_set_radio_value('p_video', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_video;1~cache=}"); - obj_set_radio_value('p_audio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audio;1~cache=}"); - obj_set_radio_value('p_youth', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_youth;1~cache=}"); - obj_set_radio_value('p_network', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_network;1~cache=}"); - obj_set_radio_value('p_recording', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_recording;1~cache=}"); - obj_set_radio_value('p_language', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_language;1~cache=}"); - obj_set_radio_value('p_colors', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_colors;1~cache=}"); - obj_set_radio_value('p_lcd', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_lcd;1~cache=}"); - obj_set_radio_value('p_keybinding', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_keybinding;1~cache=}"); - obj_set_radio_value('p_mediaplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;1~cache=}"); - obj_set_radio_value('p_driver', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_driver;1~cache=}"); - obj_set_radio_value('p_misc', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_misc;1~cache=}"); - obj_set_radio_value('p_service', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_service;0~cache=}"); - obj_set_radio_value('p_bouqueteditor', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;1~cache=}"); - obj_set_radio_value('p_scants', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scants;1~cache=}"); - obj_set_radio_value('p_reload', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reload;1~cache=}"); - obj_set_radio_value('p_getplugins', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_getplugins;1~cache=}"); - obj_set_radio_value('p_restart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_restart;1~cache=}"); - obj_set_radio_value('p_epgrestart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;1~cache=}"); - obj_set_radio_value('p_chan_epg_stat', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;1~cache=}"); - obj_set_radio_value('p_imageinfo', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;1~cache=}"); - obj_set_radio_value('p_update', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_update;1~cache=}"); - obj_set_radio_value('p_bluebutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;1~cache=}"); - obj_set_radio_value('p_redbutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_redbutton;1~cache=}"); + obj_set_radio_value('p_tv', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_tvmode;1~open=}"); + obj_set_radio_value('p_radio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_radiomode;1~cache=}"); + obj_set_radio_value('p_scart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_scartmode;1~cache=}"); + obj_set_radio_value('p_games', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_games;1~cache=}"); + obj_set_radio_value('p_audioplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_audioplayer;1~cache=}"); + obj_set_radio_value('p_inetradio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_inetradio;1~cache=}"); + obj_set_radio_value('p_movieplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_movieplayer;1~cache=}"); + obj_set_radio_value('p_picviewer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_pictureviewer;1~cache=}"); + obj_set_radio_value('p_pinstatus', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_pinstatus;0~cache=}"); + obj_set_radio_value('p_upnp', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_upnpbrowser;1~cache=}"); + obj_set_radio_value('p_sleeptimer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_sleeptimer;1~cache=}"); + obj_set_radio_value('p_reboot', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_reboot;1~cache=}"); + obj_set_radio_value('p_shutdown', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_shutdown;1~cache=}"); + obj_set_radio_value('p_settings', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_settings;0~cache=}"); + obj_set_radio_value('p_video', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_video;1~cache=}"); + obj_set_radio_value('p_audio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_audio;1~cache=}"); + obj_set_radio_value('p_youth', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_youth;1~cache=}"); + obj_set_radio_value('p_network', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_network;1~cache=}"); + obj_set_radio_value('p_recording', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_recording;1~cache=}"); + obj_set_radio_value('p_language', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_language;1~cache=}"); + obj_set_radio_value('p_colors', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_colors;1~cache=}"); + obj_set_radio_value('p_lcd', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_lcd;1~cache=}"); + obj_set_radio_value('p_keybinding', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_keybinding;1~cache=}"); + obj_set_radio_value('p_mediaplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_mediaplayer;1~cache=}"); + obj_set_radio_value('p_driver', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_driver;1~cache=}"); + obj_set_radio_value('p_misc', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_misc;1~cache=}"); + obj_set_radio_value('p_service', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_service;0~cache=}"); + obj_set_radio_value('p_bouqueteditor', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_bouqueteditor;1~cache=}"); + obj_set_radio_value('p_scants', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_scants;1~cache=}"); + obj_set_radio_value('p_reload', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_reload;1~cache=}"); + obj_set_radio_value('p_getplugins', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_getplugins;1~cache=}"); + obj_set_radio_value('p_restart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_restart;1~cache=}"); + obj_set_radio_value('p_epgrestart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_epgrestart;1~cache=}"); + obj_set_radio_value('p_chan_epg_stat', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_chan_epg_stat;1~cache=}"); + obj_set_radio_value('p_imageinfo', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_imageinfo;1~cache=}"); + obj_set_radio_value('p_update', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_update;1~cache=}"); + obj_set_radio_value('p_bluebutton', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_bluebutton;1~cache=}"); + obj_set_radio_value('p_redbutton', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_redbutton;1~cache=}"); } //]]> @@ -75,7 +75,7 @@ function do_init() - + diff --git a/src/nhttpd/web/Y_Settings_video_audio.yhtm b/src/nhttpd/web/Y_Settings_video_audio.yhtm index 0f7a6ee9a..5d6c14f9a 100644 --- a/src/nhttpd/web/Y_Settings_video_audio.yhtm +++ b/src/nhttpd/web/Y_Settings_video_audio.yhtm @@ -8,32 +8,32 @@ function do_init() { var val = ""; //video - val = "{=ini-get:/var/tuxbox/config/controld.conf;videooutput;1~open=}"; + val = "{=ini-get:%(CONFIGDIR)/controld.conf;videooutput;1~open=}"; document.f.videooutput.selectedIndex = val; - obj_set_radio_value('vcroutput', "{=ini-get:/var/tuxbox/config/controld.conf;vcroutput;0~cache=}"); + obj_set_radio_value('vcroutput', "{=ini-get:%(CONFIGDIR)/controld.conf;vcroutput;0~cache=}"); document.f.h_vcroutput.value = obj_get_radio_value("vcroutput"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_Format;2~open=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;video_Format;2~open=}"; document.f.video_Format.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/controld.conf;video_backgroundFormat;2~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/controld.conf;video_backgroundFormat;2~cache=}"; var sel = 0; if(val=="2") sel=1; if(val=="3") sel=2; document.f.video_backgroundFormat.selectedIndex = sel; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_csync;0~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;video_csync;0~cache=}" document.f.video_csync.value = val; - obj_set_radio_value('vcr_AutoSwitch', "{=ini-get:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;true~cache=}"); + obj_set_radio_value('vcr_AutoSwitch', "{=ini-get:%(CONFIGDIR)/neutrino.conf;vcr_AutoSwitch;true~cache=}"); //audio - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_AnalogMode;0~cache=}"; document.f.audio_AnalogMode.selectedIndex = val; - obj_set_radio_value('audiochannel_up_down_enable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;false~cache=}"); - obj_set_radio_value('audio_left_right_selectable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;false~cache=}"); - obj_set_radio_value('audio_DolbyDigital', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;false~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_avs_Control;1~cache=}"; + obj_set_radio_value('audiochannel_up_down_enable', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audiochannel_up_down_enable;false~cache=}"); + obj_set_radio_value('audio_left_right_selectable', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_left_right_selectable;false~cache=}"); + obj_set_radio_value('audio_DolbyDigital', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_DolbyDigital;false~cache=}"); + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_avs_Control;1~cache=}"; document.f.audio_avs_Control.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_step;5~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_step;5~cache=}" document.f.audio_step.value = val; } function set_hidden_values() diff --git a/src/nhttpd/web/Y_Settings_wol.yhtm b/src/nhttpd/web/Y_Settings_wol.yhtm index 40d7c429f..83ce4d40a 100644 --- a/src/nhttpd/web/Y_Settings_wol.yhtm +++ b/src/nhttpd/web/Y_Settings_wol.yhtm @@ -4,9 +4,9 @@ @@ -75,40 +75,40 @@ select { - + - + - + - + - + - + - + - + - - diff --git a/src/nhttpd/web/Y_Settings_zapit.yhtm b/src/nhttpd/web/Y_Settings_zapit.yhtm index 40a7aae32..88dad89f3 100644 --- a/src/nhttpd/web/Y_Settings_zapit.yhtm +++ b/src/nhttpd/web/Y_Settings_zapit.yhtm @@ -43,10 +43,10 @@ function do_submit()
\n" "\t" "" @@ -441,7 +444,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", channel->getChannelID(), channel->getChannelID() & 0xFFFFFFFFFFFFULL, - (event ? "\"Program" : "")); + (event.eventID ? "\"Program" : "")); if (channel->getChannelID() == current_channel) yresult += string_printf("\n  \"Streaminfo\""); @@ -491,11 +494,11 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } } - else if (event) + else if (event.eventID) { bool has_current_next = true; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event->startTime); + timestr = timeString(event.startTime); CShortEPGData epg; std::string EPGInfoC = ""; @@ -510,9 +513,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: "(%ld {=L:from=} %d {=L:unit.short.minute=}, %d%%)" , timestr.c_str() , EPGInfoC.c_str() - , event->description.c_str() - , (time(NULL) - event->startTime)/60 - , event->duration / 60,prozent); + , event.description.c_str() + , (time(NULL) - event.startTime)/60 + , event.duration / 60,prozent); if ((has_current_next) && (currentNextInfo.flags & CSectionsdClient::epgflags::has_next)) { std::string EPGInfoN = ""; From e11a006f04c7e7d19ddd6dca3c3a589b43a416b8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 21:06:46 +0100 Subject: [PATCH 151/690] miscsettings_menu: allow to reset movieplayer plugin Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a4bd8cc5a80e1e55e3f7561cab918a6b9d9c7d1a Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - miscsettings_menu: allow to reset movieplayer plugin --- data/locale/deutsch.locale | 3 ++- data/locale/english.locale | 3 ++- src/gui/miscsettings_menu.cpp | 9 ++++----- src/neutrino.cpp | 2 +- src/system/locals.h | 3 ++- src/system/locals_intern.h | 3 ++- src/system/setting_helpers.cpp | 16 ++++++++++++---- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f481f867c..07b224a61 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1772,7 +1772,7 @@ movieplayer.bookmarkname Bookmark Name movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel -movieplayer.defplugin Start-Plugin +movieplayer.plugin Movieplayer-Plugin movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer movieplayer.starting Wiedergabe starten... @@ -1996,6 +1996,7 @@ ping.unreachable ist nicht erreichbar (unerreichbar) pinprotection.head PIN-Abfrage pinprotection.wrongcode Geben Sie den Code nocheinmal ein! plugins.hdd_dir Externes Plugin-Verz. +plugins.no_plugin Kein Plugin plugins.result Pluginausgabe plugintype.disabled Deaktiviert plugintype.game Spiel diff --git a/data/locale/english.locale b/data/locale/english.locale index 1d3a6b931..63ce34062 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1772,7 +1772,7 @@ movieplayer.bookmarkname Bookmarkname movieplayer.bookmarkname_hint1 Enter a name for your new bookmark movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters -movieplayer.defplugin Start-Plugin +movieplayer.plugin Movieplayer plugin movieplayer.fileplayback File play movieplayer.head Movieplayer movieplayer.starting Starting playback... @@ -1996,6 +1996,7 @@ ping.unreachable is unreachable pinprotection.head Enter PIN code pinprotection.wrongcode PIN-Code was wrong! Try again. plugins.hdd_dir Plugin HDD dir. +plugins.no_plugin No plugin plugins.result plugin output plugintype.disabled Disabled plugintype.game Game diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 55aca50fc..4f5d2bcc8 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -100,11 +100,11 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "movieplayer_plugin") { - CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); + CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_PLUGIN, NEUTRINO_ICON_FEATURES); MoviePluginSelector.addItem(GenericMenuSeparator); - + MoviePluginSelector.addItem(new CMenuForwarder(LOCALE_PLUGINS_NO_PLUGIN, true, NULL, new CMoviePluginChangeExec(), "---", CRCInput::RC_red)); + MoviePluginSelector.addItem(GenericMenuSeparatorLine); char id[5]; - int cnt = 0; int enabled_count = 0; for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) { @@ -112,8 +112,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { sprintf(id, "%d", count); enabled_count++; - MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count)), (cnt == 0)); - cnt++; + MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count))); } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 89b9e1457..7cf024d84 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -638,7 +638,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_startstop_msg = configfile.getBool("recording_startstop_msg" , true); // default plugin for movieplayer - g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "noplugin" ); + g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "---" ); g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/media/sda1/plugins" ); g_settings.plugins_disabled = configfile.getString( "plugins_disabled", "" ); diff --git a/src/system/locals.h b/src/system/locals.h index 864bc074f..ebb211634 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1799,7 +1799,7 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, - LOCALE_MOVIEPLAYER_DEFPLUGIN, + LOCALE_MOVIEPLAYER_PLUGIN, LOCALE_MOVIEPLAYER_FILEPLAYBACK, LOCALE_MOVIEPLAYER_HEAD, LOCALE_MOVIEPLAYER_STARTING, @@ -2023,6 +2023,7 @@ typedef enum LOCALE_PINPROTECTION_HEAD, LOCALE_PINPROTECTION_WRONGCODE, LOCALE_PLUGINS_HDD_DIR, + LOCALE_PLUGINS_NO_PLUGIN, LOCALE_PLUGINS_RESULT, LOCALE_PLUGINTYPE_DISABLED, LOCALE_PLUGINTYPE_GAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0ac541b47..ec84ab93f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1799,7 +1799,7 @@ const char * locale_real_names[] = "movieplayer.bookmarkname_hint1", "movieplayer.bookmarkname_hint2", "movieplayer.chapters", - "movieplayer.defplugin", + "movieplayer.plugin", "movieplayer.fileplayback", "movieplayer.head", "movieplayer.starting", @@ -2023,6 +2023,7 @@ const char * locale_real_names[] = "pinprotection.head", "pinprotection.wrongcode", "plugins.hdd_dir", + "plugins.no_plugin", "plugins.result", "plugintype.disabled", "plugintype.game", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 3c7c569b9..7c098a086 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -375,12 +375,20 @@ int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) { - int sel= atoi(actionKey.c_str()); - parent->hide(); - if (sel>=0) + if (parent) + parent->hide(); + + if (actionKey == "---") { - g_settings.movieplayer_plugin=g_PluginList->getName(sel); + g_settings.movieplayer_plugin = actionKey; } + else + { + int sel = atoi(actionKey.c_str()); + if (sel >= 0) + g_settings.movieplayer_plugin = g_PluginList->getName(sel); + } + return menu_return::RETURN_EXIT; } From 561fade8fe845194da8333a96a7292c6abdedb6e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 23:24:07 +0100 Subject: [PATCH 152/690] control/epgsearch: fix old plain text output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9ac2b32cd13abd86071c3c61a00260e4b9b28ba Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - control/epgsearch: fix old plain text output --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index df348214b..607fdafa1 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1452,7 +1452,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) CChannelEventList evtlist; bool search_epginfo = (hh->ParamList["epginfo"] != "false"); - bool return_epginfo = (hh->ParamList["epginfo"] == "true"); + bool return_epginfo = (hh->ParamList["epginfo"] == "true" || hh->ParamList["epginfo"].empty()); std::string search_keyword = (hh->ParamList["search"].empty()) ? hh->ParamList["1"] : hh->ParamList["search"]; const int search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; @@ -1593,10 +1593,12 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) #endif } hh->WriteLn("----------------------------------------------------------"); - return; } } } + if (hh->outType == plain) + return; + result = hh->outArray("epgsearch", result); hh->SendResult(result); From 4a4f6a43a1fd12e39292ea2ada53cd87ca076ca6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 23:27:31 +0100 Subject: [PATCH 153/690] yhook: rename var outSingle -> nonPair Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/246af91c7d13f04e4a320e71b31d0febd0cbdf6f Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - yhook: rename var outSingle -> nonPair --- src/nhttpd/yhttpd_core/yhook.cpp | 6 +++--- src/nhttpd/yhttpd_core/yhook.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index c8f437b7d..6e6d13c51 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -28,7 +28,7 @@ CyhookHandler::CyhookHandler() Method = M_UNKNOWN; httpStatus = HTTP_NIL; outType = plain; - outSingle = false; + nonPair = false; LastModified=0; } @@ -407,7 +407,7 @@ TOutType CyhookHandler::getOutType() { //----------------------------------------------------------------------------- TOutType CyhookHandler::outStart(bool single) { // for compatibility - outSingle = single; + nonPair = single; // get outType outType = getOutType(); // set response header @@ -437,7 +437,7 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool result += ","; break; default: - if (outSingle) + if (nonPair) result = _content; else result = _key + "=" + _content; diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 986e016b8..ca82f9572 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -139,7 +139,7 @@ public: std::string Sendfile; // Path & Name (local os style) of file to send bool keep_alive; bool cached; // cached by mod_cache - bool outSingle; + bool nonPair; // Input CStringList ParamList; // local copy of ParamList (Request) From f54ee2c170020fc002c5961693aef6d3f6687d93 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 23:51:37 +0100 Subject: [PATCH 154/690] yhook: new outSingle() function, that just adds a linefeed to content Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/922cc72abf22a0456b5a901172d2b03ff6e34a6e Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - yhook: new outSingle() function, that just adds a linefeed to content --- src/nhttpd/yhttpd_core/yhook.cpp | 5 +++++ src/nhttpd/yhttpd_core/yhook.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 6e6d13c51..15c2aef5e 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -424,6 +424,11 @@ std::string CyhookHandler::outIndent() { return ""; } +//----------------------------------------------------------------------------- +std::string CyhookHandler::outSingle(std::string _content) { + return _content + "\n"; +} + //----------------------------------------------------------------------------- std::string CyhookHandler::outPair(std::string _key, std::string _content, bool _next) { std::string result = ""; diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index ca82f9572..096deaef0 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -204,6 +204,7 @@ public: TOutType outStart(bool single = false); TOutType getOutType(); std::string outIndent(); + std::string outSingle(std::string _content); std::string outPair(std::string _key, std::string _content, bool _next); std::string outArray(std::string _key, std::string _content); std::string outArrayItem(std::string _key, std::string _content, bool _next); From 4089d668665e0193125a1bb00275e95254625655 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 23:53:37 +0100 Subject: [PATCH 155/690] control/epgsearch: use outSingle instead of direct WriteLn Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3fd3f2ba1fd023ea5048d5ee48fd5c94a5bd9f83 Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - control/epgsearch: use outSingle instead of direct WriteLn --- src/nhttpd/tuxboxapi/controlapi.cpp | 30 ++++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 607fdafa1..c42db69d2 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1567,38 +1567,32 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); datetimer_str += tmpstr; - hh->WriteLn(datetimer_str); - hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); - hh->WriteLn(epg.title); + result += hh->outSingle(datetimer_str); + result += hh->outSingle(NeutrinoAPI->GetServiceName(eventIterator->channelID)); + result += hh->outSingle(epg.title); if (return_epginfo) { if(!epg.info1.empty()) - hh->WriteLn(epg.info1); + result += hh->outSingle(epg.info1); if(!epg.info2.empty()) - hh->WriteLn(epg.info2); + result += hh->outSingle(epg.info2); } if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - hh->printf("fsk:%u\n", longepg.fsk); + result += hh->outSingle(string_printf("fsk:%u", longepg.fsk)); + genre = ""; #ifdef FULL_CONTENT_CLASSIFICATION - if (!longepg.contentClassification.empty()){ + if (!longepg.contentClassification.empty()) genre = GetGenre(longepg.contentClassification[0]); - genre = ZapitTools::UTF8_to_UTF8XML(genre.c_str()); - hh->WriteLn(genre); - } #else - if (longepg.contentClassification) { + if (longepg.contentClassification) genre = GetGenre(longepg.contentClassification); - genre = ZapitTools::UTF8_to_UTF8XML(genre.c_str()); - hh->WriteLn(genre); - } #endif + if(!genre.empty()) + result += hh->outSingle(ZapitTools::UTF8_to_UTF8XML(genre.c_str())); } - hh->WriteLn("----------------------------------------------------------"); + result += hh->outSingle("----------------------------------------------------------"); } } } - if (hh->outType == plain) - return; - result = hh->outArray("epgsearch", result); hh->SendResult(result); From 065dd50ce7d9ea80d18fecbc2857da1d05a71b9a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Feb 2016 14:24:19 +0100 Subject: [PATCH 156/690] yhook: allow multiple json objects Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e89d0433ad77497450f1213ef2aba86b7a365197 Author: vanhofen Date: 2016-02-23 (Tue, 23 Feb 2016) Origin message was: ------------------ - yhook: allow multiple json objects --- src/nhttpd/yhttpd_core/yhook.cpp | 4 +++- src/nhttpd/yhttpd_core/yhook.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 15c2aef5e..82158f89c 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -495,7 +495,7 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, return result; } //----------------------------------------------------------------------------- -std::string CyhookHandler::outCollection(std::string _key, std::string _content) { +std::string CyhookHandler::outCollection(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: @@ -506,6 +506,8 @@ std::string CyhookHandler::outCollection(std::string _key, std::string _content) case json: //TODO: json check result = outIndent() + "\"" + _key + "\": {" + _content + "}"; + if(_next) + result += ","; result += "\n"; break; default: diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 096deaef0..64016d325 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -208,7 +208,7 @@ public: std::string outPair(std::string _key, std::string _content, bool _next); std::string outArray(std::string _key, std::string _content); std::string outArrayItem(std::string _key, std::string _content, bool _next); - std::string outCollection(std::string _key,std::string _content); + std::string outCollection(std::string _key,std::string _content, bool _next = false); std::string outValue(std::string _content); std::string outNext(); friend class CyParser; From d608e92880e1aefaa34419765f02a0871f6026dd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Feb 2016 14:42:28 +0100 Subject: [PATCH 157/690] control/logolist: allow json/xml output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/43bab4b53467a8d942243746fdd2023c293860f3 Author: vanhofen Date: 2016-02-23 (Tue, 23 Feb 2016) Origin message was: ------------------ - control/logolist: allow json/xml output --- src/nhttpd/tuxboxapi/controlapi.cpp | 75 +++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index c42db69d2..951744e07 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -877,38 +877,85 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh) void CControlAPI::LogolistCGI(CyhookHandler *hh) { + hh->outStart(); + std::string result = ""; + bool isFirstLine = true; + + bool files = false; + unsigned int s = hh->ParamList.size(); + for (unsigned int i = 1; i <= s; i++) + { + files = (hh->ParamList[itoa(i)] == "files" && hh->ParamList["files"] != "false"); + if (files) + break; + } + int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { + std::string item = ""; + std::string id = ""; + std::string logo = ""; + std::vector v; CZapitChannel * channel = *cit; size_t pos = std::find(v.begin(), v.end(), channel->getChannelID()) - v.begin(); if (pos < v.size()) continue; v.push_back(channel->getChannelID()); - result += string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS";%s;" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS"", channel->getChannelID(), channel->getName().c_str(), (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); - if (hh->ParamList["1"].compare("files") == 0) + std::string logo_used = ""; + std::string logo_real = ""; + if (files) { - std::string logoFile = ""; - std::string logoLink = ""; - char link[PATH_MAX + 1] = {0}; - if (g_PicViewer->GetLogoName(channel->getChannelID(), NeutrinoAPI->GetServiceName(channel->getChannelID()), logoFile, NULL, NULL)) + char _real[PATH_MAX + 1] = {0}; + if (g_PicViewer->GetLogoName(channel->getChannelID(), NeutrinoAPI->GetServiceName(channel->getChannelID()), logo_used, NULL, NULL)) { - result += string_printf(";%s", logoFile.c_str()); - realpath(logoFile.c_str(), link); - logoLink = string(link); - if (strcmp(logoFile.c_str(), logoLink.c_str()) != 0) - result += string_printf(";%s", logoLink.c_str()); + realpath(logo_used.c_str(), _real); + logo_real = string(_real); + if (strcmp(logo_used.c_str(), logo_real.c_str()) == 0) + logo_real.clear(); } } - result += "\n"; + if (hh->outType == plain) + { + std::string outLine = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS";%s;" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS"", channel->getChannelID(), channel->getName().c_str(), (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); + if (files) + { + if (!logo_used.empty()) + outLine += string_printf(";%s", logo_used.c_str()); + if (!logo_real.empty()) + outLine += string_printf(";%s", logo_real.c_str()); + } + item = hh->outSingle(outLine); + } + else + { + item = hh->outPair("name", hh->outValue(channel->getName()), true); + + id = hh->outPair("short", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), true); + id += hh->outPair("long", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), false); + item += hh->outCollection("id", id, files); + + if (files) + { + logo = hh->outPair("used", logo_used, true); + logo += hh->outPair("real", logo_real, false); + item += hh->outCollection("logo", logo); + } + } + if (isFirstLine) + isFirstLine = false; + else + result += hh->outNext(); + result += hh->outArrayItem("channel", item, false); } - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - hh->WriteLn(result); + result = hh->outArray("logolist", result); + + hh->SendResult(result); } //----------------------------------------------------------------------------- // get actual and next event data for given channel From b1fa8daf5ec8bbc99b894e19f01ab56cb64c21bd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Feb 2016 14:56:52 +0100 Subject: [PATCH 158/690] yhook: rename outCollection() => outObject() to be more json Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/69615480f15056dbcd0b8af6d46cc5d1646a7bb0 Author: vanhofen Date: 2016-02-23 (Tue, 23 Feb 2016) Origin message was: ------------------ - yhook: rename outCollection() => outObject() to be more json --- src/nhttpd/tuxboxapi/controlapi.cpp | 18 +++++++++--------- src/nhttpd/yhttpd_core/yhook.cpp | 2 +- src/nhttpd/yhttpd_core/yhook.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 951744e07..fff1f19af 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -413,7 +413,7 @@ void CControlAPI::GetModeCGI(CyhookHandler *hh) if (hh->getOutType() != plain) { result = hh->outPair("mode", result, false); - result = hh->outCollection("getmode", result); + result = hh->outObject("getmode", result); } hh->SendResult(result); } @@ -938,13 +938,13 @@ void CControlAPI::LogolistCGI(CyhookHandler *hh) id = hh->outPair("short", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), true); id += hh->outPair("long", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), false); - item += hh->outCollection("id", id, files); + item += hh->outObject("id", id, files); if (files) { logo = hh->outPair("used", logo_used, true); logo += hh->outPair("real", logo_real, false); - item += hh->outCollection("logo", logo); + item += hh->outObject("logo", logo); } } if (isFirstLine) @@ -1007,11 +1007,11 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", (!firstEPG.empty())); if(!firstEPG.empty()) { - result += hh->outCollection("firstEPG", firstEPG); + result += hh->outObject("firstEPG", firstEPG); } if(!secondEPG.empty()) { result += hh->outNext(); - result += hh->outCollection("secondEPG", secondEPG); + result += hh->outObject("secondEPG", secondEPG); } return result; } @@ -1329,7 +1329,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false); if(hh->outType == json) - channelData = hh->outCollection("channelData", channelData); + channelData = hh->outObject("channelData", channelData); int i = 0; CChannelEventList::iterator eventIterator; bool isFirstLine = true; @@ -1451,7 +1451,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { // list one channel, no bouquetnr given result = channelEPGformated(hh, 0, channel_id, max, stoptime); - result = hh->outCollection("epglist", result); + result = hh->outObject("epglist", result); hh->SendResult(result); } @@ -3035,7 +3035,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { error = string_printf("no config defined for %s", (hh->ParamList["config"]).c_str()); } - hh->WriteLn(hh->outCollection("config", result)); + hh->WriteLn(hh->outObject("config", result)); if (error.empty()) hh->SendResult(result); @@ -3260,7 +3260,7 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { item += hh->outPair("f_namelen", string_printf("%lu", (unsigned long) s.f_namelen), true); item += hh->outPair("f_frsize", string_printf("%lu", (unsigned long) s.f_frsize), false); - result = hh->outCollection("statfs", item); + result = hh->outObject("statfs", item); hh->SendResult(result); } diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 82158f89c..2982e83a4 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -495,7 +495,7 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, return result; } //----------------------------------------------------------------------------- -std::string CyhookHandler::outCollection(std::string _key, std::string _content, bool _next) { +std::string CyhookHandler::outObject(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 64016d325..9f8e2e332 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -208,7 +208,7 @@ public: std::string outPair(std::string _key, std::string _content, bool _next); std::string outArray(std::string _key, std::string _content); std::string outArrayItem(std::string _key, std::string _content, bool _next); - std::string outCollection(std::string _key,std::string _content, bool _next = false); + std::string outObject(std::string _key,std::string _content, bool _next = false); std::string outValue(std::string _content); std::string outNext(); friend class CyParser; From 5286a99f234cbb7ce512953da28124d4f85448e4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 13:41:45 +0100 Subject: [PATCH 159/690] controlapi/logolist: use well-known tags for channelid's Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7fefac50817682a60c8ff3b5dea34edc3f6c77d Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi/logolist: use well-known tags for channelid's --- src/nhttpd/tuxboxapi/controlapi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index fff1f19af..68a839ef9 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -936,8 +936,8 @@ void CControlAPI::LogolistCGI(CyhookHandler *hh) { item = hh->outPair("name", hh->outValue(channel->getName()), true); - id = hh->outPair("short", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), true); - id += hh->outPair("long", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), false); + id = hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); + id += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), false); item += hh->outObject("id", id, files); if (files) From 5a00327ca28d3bb6db7ff64452cb355531506c23 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 13:43:35 +0100 Subject: [PATCH 160/690] controlapi: add /getchannelid function to get full id too Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3ceaae4efb3882d58315fe88201eac6466e883e9 Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi: add /getchannelid function to get full id too --- src/nhttpd/tuxboxapi/controlapi.cpp | 36 ++++++++++++++++++++--------- src/nhttpd/tuxboxapi/controlapi.h | 3 ++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 68a839ef9..413da2f63 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -171,7 +171,8 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"epg", &CControlAPI::EpgCGI, ""}, {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, - {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, + {"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"}, + {"getchannelid", &CControlAPI::GetChannelIDCGI, ""}, {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system {"standby", &CControlAPI::StandbyCGI, "text/plain"}, @@ -238,28 +239,29 @@ void CControlAPI::Execute(CyhookHandler *hh) for(unsigned int i = 0; i < filename.length(); i++) filename[i] = tolower(filename[i]); + func_req = filename; + // debugging informations if(CLogging::getInstance()->getDebug()) { - dprintf("Execute CGI : %s\n",filename.c_str()); - for(CStringList::iterator it = hh->ParamList.begin() ; - it != hh->ParamList.end() ; ++it) - dprintf(" Parameter %s : %s\n",it->first.c_str(), it->second.c_str()); + dprintf("Execute CGI : %s\n", func_req.c_str()); + for(CStringList::iterator it = hh->ParamList.begin(); it != hh->ParamList.end(); ++it) + dprintf(" Parameter %s : %s\n", it->first.c_str(), it->second.c_str()); } // get function index for(unsigned int i = 0; i < (sizeof(yCgiCallList)/sizeof(yCgiCallList[0])); i++) - if (filename == yCgiCallList[i].func_name) + if (func_req == yCgiCallList[i].func_name) { index = i; break; } + if(index == -1) // function not found { hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED); return; } - // send header else if(std::string(yCgiCallList[index].mime_type).empty()) // decide in function ; @@ -270,6 +272,7 @@ void CControlAPI::Execute(CyhookHandler *hh) hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); else hh->SetHeader(HTTP_OK, yCgiCallList[index].mime_type); + // response hh->status = HANDLED_READY; if (hh->Method == M_HEAD) // HEAD or function call @@ -610,13 +613,24 @@ void CControlAPI::GetUBouquetsxmlCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- // get actual channel_id -void CControlAPI::GetChannel_IDCGI(CyhookHandler *hh) +void CControlAPI::GetChannelIDCGI(CyhookHandler *hh) { - CZapitClient::CCurrentServiceInfo current_pids = NeutrinoAPI->Zapit->getCurrentServiceInfo(); - hh->printf("%x%04x%04x\n",current_pids.tsid, current_pids.onid, current_pids.sid); + t_channel_id channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if (func_req == "getonidsid") //what a terrible name! + { + hh->WriteLn(string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL)); + return; + } + + hh->outStart(); + std::string result = ""; + result = hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), false); + result = hh->outObject("id", result); + hh->SendResult(result); } -// get actual channel_id +//----------------------------------------------------------------------------- void CControlAPI::GetTPChannel_IDCGI(CyhookHandler *hh) { SendChannelList(hh, true); diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 67c812b71..ceb22ad63 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -19,6 +19,7 @@ class CControlAPI : public Cyhook private: // Dispatcher Array typedef void (CControlAPI::*TyFunc)(CyhookHandler *hh); + std::string func_req; typedef struct { const char *func_name; @@ -83,7 +84,7 @@ private: void GetServicesxmlCGI(CyhookHandler *hh); void GetBouquetsxmlCGI(CyhookHandler *hh); void GetUBouquetsxmlCGI(CyhookHandler *hh); - void GetChannel_IDCGI(CyhookHandler *hh); + void GetChannelIDCGI(CyhookHandler *hh); void GetTPChannel_IDCGI(CyhookHandler *hh); void MessageCGI(CyhookHandler *hh); void InfoCGI(CyhookHandler *hh); From af4c52f488922910431010030b08dde65de7e3ad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 13:48:01 +0100 Subject: [PATCH 161/690] controlapi: add /getchannel function to get infos about current channel. - controlapi: copy event to prevent crash in multi-threaded mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e855ceef8e5a3719be4252aa5c5ef4be561d72d5 Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi: add /getchannel function to get infos about current channel. - controlapi: copy event to prevent crash in multi-threaded mode --- src/nhttpd/tuxboxapi/controlapi.cpp | 128 +++++++++++++++++++--------- src/nhttpd/tuxboxapi/controlapi.h | 3 +- 2 files changed, 90 insertions(+), 41 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 413da2f63..da16d1116 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -163,6 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"channellist", &CControlAPI::ChannellistCGI, "text/plain"}, {"logolist", &CControlAPI::LogolistCGI, "text/plain"}, {"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"}, + {"getchannel", &CControlAPI::GetChannelCGI, ""}, {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, @@ -981,28 +982,33 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CChannelEvent *event; + CChannelEvent event; + event.eventID = 0; NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + if (evt) + event = *evt; NeutrinoAPI->Unlock(); - if (event) { + result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", false); + + if (event.eventID) { int percentage = 100; - if (event->duration > 0) - percentage = 100 * (time(NULL) - event->startTime) / event->duration; + if (event.duration > 0) + percentage = 100 * (time(NULL) - event.startTime) / event.duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event->startTime); + timestr = timeString(event.startTime); firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); - firstEPG += hh->outPair("description", hh->outValue(event->description), true); + firstEPG += hh->outPair("description", hh->outValue(event.description), true); if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) { firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); } firstEPG += hh->outPair("startTime", timestr, true); - firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); - firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); + firstEPG += hh->outPair("timeTotal", string_printf("%d", event.duration / 60), true); + firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event.startTime) / 60), true); firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { @@ -1019,8 +1025,8 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann } } - result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", (!firstEPG.empty())); if(!firstEPG.empty()) { + result += hh->outNext(); result += hh->outObject("firstEPG", firstEPG); } if(!secondEPG.empty()) { @@ -1032,38 +1038,49 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann //----------------------------------------------------------------------------- // produce data (collection) for given channel -std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int nr) { +std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr) { std::string result = ""; bool isEPGdetails = !(hh->ParamList["epg"].empty()); if (hh->outType == json || hh->outType == xml) { - result += hh->outPair("number", string_printf("%u", nr), true); + if (channelNr > -1) + result += hh->outPair("number", string_printf("%u", channelNr), true); result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true); result += hh->outPair("name", hh->outValue(channel->getName()), true); - result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), true); - result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), isEPGdetails); - if(isEPGdetails) + result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), false); + if (bouquetNr > -1) + { + result += hh->outNext(); + result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), false); + } + if (isEPGdetails) + { + result += hh->outNext(); result += _GetBouquetActualEPGItem(hh, channel); + } result = hh->outArrayItem("channel", result, false); } else { - CChannelEvent *event; + CChannelEvent event; + event.eventID = 0; NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + if (evt) + event = *evt; NeutrinoAPI->Unlock(); - if (event && isEPGdetails) { + if (event.eventID && isEPGdetails) { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s (%s)\n", - nr, + channelNr, channel->getChannelID(), - channel->getName().c_str(), event->description.c_str()); + channel->getName().c_str(), event.description.c_str()); } else { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", - nr, + channelNr, channel->getChannelID(), channel->getName().c_str()); } @@ -1212,6 +1229,31 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { hh->SendError("no parameter"); } +//------------------------------------------------------------------------- +// get actual channel info +void CControlAPI::GetChannelCGI(CyhookHandler *hh) +{ + hh->outStart(); + + t_channel_id channel_id = 0; + if (hh->ParamList["id"].empty()) + channel_id = CZapit::getInstance()->GetCurrentChannelID(); + else + sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); + + if (channel_id != 0) + { + NeutrinoAPI->GetChannelEvents(); + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + std::string result = _GetBouquetWriteItem(hh, channel, -1, -1); + result = hh->outArray("channel", result); + + hh->SendResult(result); + } + else + hh->SendError(); +} + //------------------------------------------------------------------------- /** Return all bouquets * @param hh CyhookHandler @@ -1339,10 +1381,12 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ std::string result = ""; std::string channelData = ""; CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), true); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); - channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); - channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false); - if(hh->outType == json) + channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); + if (bouquetnr > -1) + channelData += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), false); + if (hh->outType == json) channelData = hh->outObject("channelData", channelData); int i = 0; CChannelEventList::iterator eventIterator; @@ -1351,8 +1395,17 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ if ((max != -1 && i >= max) || (stoptime != -1 && eventIterator->startTime >= stoptime)) break; std::string prog = ""; - prog += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), true); - prog += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + if (hh->outType == plain) + prog += hh->outSingle(""); + + prog += hh->outPair("description", hh->outValue(eventIterator->description), true); + if (!(hh->ParamList["details"].empty())) { + CShortEPGData epg; + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { + prog += hh->outPair("info1", hh->outValue(epg.info1), true); + prog += hh->outPair("info2", hh->outValue(epg.info2), true); + } + } prog += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), true); prog += hh->outPair("eventid_hex", string_printf("%llx", eventIterator->eventID), true); prog += hh->outPair("start_sec", string_printf("%ld", eventIterator->startTime), true); @@ -1368,16 +1421,8 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ mtime = localtime(&_stoptime); strftime(zbuffer, 20, "%H:%M", mtime); prog += hh->outPair("stop_t", std::string(zbuffer), true); - prog += hh->outPair("duration_min", string_printf("%d", (int) (eventIterator->duration / 60)), true); + prog += hh->outPair("duration_min", string_printf("%d", (int) (eventIterator->duration / 60)), false); - if (!(hh->ParamList["details"].empty())) { - CShortEPGData epg; - if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { - prog += hh->outPair("info1", hh->outValue(epg.info1), true); - prog += hh->outPair("info2", hh->outValue(epg.info2), true); - } - } - prog += hh->outPair("description", hh->outValue(eventIterator->description), false); if(isFirstLine) isFirstLine = false; else @@ -1690,24 +1735,27 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (param_empty || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent *event = NULL; + CChannelEvent event; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; + event.eventID = 0; NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + if (evt) + event = *evt; NeutrinoAPI->Unlock(); - if (event) { + if (event.eventID) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str()); + " %llu %s\n", channel->getChannelID(), event.eventID, event.description.c_str()); } else { // ext output hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str()); + " %ld %u %llu %s\n", channel->getChannelID(), event.startTime, event.duration, event.eventID, event.description.c_str()); } } } diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index ceb22ad63..fb892b160 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -62,7 +62,7 @@ private: void doModifyTimer(CyhookHandler *hh); void doNewTimer(CyhookHandler *hh); void _SendTime(CyhookHandler *hh, struct tm *Time, int digits); - std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int nr); + std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr); std::string channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime); std::string _GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel); @@ -94,6 +94,7 @@ private: void ChannellistCGI(CyhookHandler *hh); void LogolistCGI(CyhookHandler *hh); void GetBouquetCGI(CyhookHandler *hh); + void GetChannelCGI(CyhookHandler *hh); void GetBouquetsCGI(CyhookHandler *hh); void EpgCGI(CyhookHandler *hh); void VersionCGI(CyhookHandler *hh); From 0a43f3f9a1692b76545371555f2aaeff5edca4f7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 13:52:23 +0100 Subject: [PATCH 162/690] controlapi: add epginfo=false switch to epg output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a94e620c925cad98c799ae10cd8220bc69cb43a Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi: add epginfo=false switch to epg output --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index da16d1116..7d520efd3 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -990,6 +990,8 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann event = *evt; NeutrinoAPI->Unlock(); + bool return_epginfo = (hh->ParamList["epginfo"] != "false"); + result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", false); if (event.eventID) { @@ -1001,7 +1003,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); firstEPG += hh->outPair("description", hh->outValue(event.description), true); - if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) + if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) { firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); @@ -1015,7 +1017,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann timestr = timeString(currentNextInfo.next_zeit.startzeit); secondEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.next_uniqueKey), true); secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), true); - if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) + if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) { secondEPG += hh->outPair("info1", hh->outValue(epg.info1), true); secondEPG += hh->outPair("info2", hh->outValue(epg.info2), true); From ce972b16b8d2e34802d25601ec025ebd61b3a978 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 14:38:25 +0100 Subject: [PATCH 163/690] controlapi: add small documentations for new stuff Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d209a90d77ef893c43dd893021304c89ceb977a Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi: add small documentations for new stuff --- src/nhttpd/tuxboxapi/controlapi.cpp | 63 ++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 7d520efd3..477acca91 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -612,6 +612,37 @@ void CControlAPI::GetUBouquetsxmlCGI(CyhookHandler *hh) hh->SendFile(CONFIGDIR "/zapit/ubouquets.xml"); } +//------------------------------------------------------------------------- +/** Display channel id's + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getonidsid + * /control/getchannelid[?format=plain|json|xml] + * @endcode + * + * @par output + * @code + * /control/getonidsid + * @endcode + * + * @code + * 3f300012b66 + * @endcode + * + * @par output (xml) + * @code + * /control/getchannelid?format=xml + * @endcode + * + * @code + * + * 361d03f300012b66 + * 3f300012b66 + * + * @endcode + */ //----------------------------------------------------------------------------- // get actual channel_id void CControlAPI::GetChannelIDCGI(CyhookHandler *hh) @@ -1097,7 +1128,7 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * Get bouquet list (all) oder filtered to a given bouquet number * Option epg=true for actual and next epg data for each channel * @code - * /control/getbouquet?[bouquet=][&mode=TV|RADIO][&epg=true] + * /control/getbouquet?[bouquet=][&mode=TV|RADIO][&epg=true[&epginfo=false]] * @endcode * Get the actual used bouquet number * @code @@ -1231,6 +1262,36 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { hh->SendError("no parameter"); } +//------------------------------------------------------------------------- +/** Show some infos about current or given (by full ID!) channel + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getchannel[?format=plain|xml|json][&id=][&epg=true[&epginfo=false]] + * @endcode + * + * @par output (json) + * @code + * /control/getchannel?format=json + * @endcode + * + * @code + * { + * "success": "true", + * "data": { + * "channel": [ + * { + * "id": "361d03f300012b66", + * "short_id": "3f300012b66", + * "name": "ZDFHD", + * "logo": "/share/tuxbox/neutrino/icons/logo/3f300012b66.png" + * } + * ] + * } + * } + * @endcode + */ //------------------------------------------------------------------------- // get actual channel info void CControlAPI::GetChannelCGI(CyhookHandler *hh) From ae72971cd43d30c5d1a528561f4b6c1215aad0f5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 19 Feb 2016 09:27:54 +0100 Subject: [PATCH 164/690] CInfoViewer: use binary operators for zap mode statements Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f75402e571c6b23c08bdcec381575628d2f70f15 Author: Thilo Graf Date: 2016-02-19 (Fri, 19 Feb 2016) --- src/gui/infoviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 69eb3f6ef..6e626c725 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -693,13 +693,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { - if(!calledFromNumZap && zap_mode != IV_MODE_DEFAULT) + if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); t_channel_id new_channel_id = channel->getChannelID(); int ChanNum = channel->number; + current_epg_id = channel->getEpgID(); if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || @@ -2059,7 +2060,7 @@ void CInfoViewer::killTitle() rec->kill(); //printf("killTitle(%d, %d, %d, %d)\n", BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET-BoxStartX, bottom-BoxStartY); //frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET, bottom); - if (zap_mode != IV_MODE_VIRTUAL_ZAP){ + if (!(zap_mode & IV_MODE_VIRTUAL_ZAP)){ if (infobar_txt) infobar_txt->kill(); numbox->kill(); From 4fa789eb4f0c4ec06c3486838f493e03d6ebdf0c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Feb 2016 14:12:06 +0100 Subject: [PATCH 165/690] CComponentsText: assign current initialized position values to old var Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5cfe504044bc82b056212c478332e6c16fa108d6 Author: Thilo Graf Date: 2016-02-21 (Sun, 21 Feb 2016) --- src/gui/components/cc_item_text.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index c554f1123..883dfea9f 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -178,6 +178,8 @@ void CComponentsText::initCCText() ct_textbox->setTextRenderModeFullBG(!paint_bg); dprintf(DEBUG_DEBUG, "[CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight); + x_old = iX = x + fr_thickness; + y_old = iY = y + fr_thickness; } void CComponentsText::clearCCText() From 41bef28025f6a6ac44a0c53a4cede72cddd398f7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 22 Feb 2016 17:12:09 +0100 Subject: [PATCH 166/690] CComponentsText: assign missing dim and pos values inside dimension- and position setters Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3b6e4bfcc0ca119884ccb47c92fe20b87e49353d Author: Thilo Graf Date: 2016-02-22 (Mon, 22 Feb 2016) --- src/gui/components/cc_item_text.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 883dfea9f..90a59d3f1 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -88,8 +88,8 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w iX = x = x_old = x_pos; //TODO: equalize inhertited member names iY = y = y_old = y_pos; - iWidth=width = w; - iHeight=height = h; + iWidth = width_old = width = w; + iHeight = height_old = height = h; /* we need a minimal borderwith of 1px because the edge-smoothing (or fontrenderer?) otherwise will paint single pixels outside the @@ -126,15 +126,18 @@ void CComponentsText::initCCText() //init CBox dimensions iWidth = width-2*fr_thickness; iHeight = height-2*fr_thickness; - iX = x + fr_thickness; - iY = y + fr_thickness; //using of real x/y values to paint textbox if this text object is bound in a parent form if (cc_parent){ int th_parent_fr = cc_parent->getFrameThickness(); iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); + }else{ + iX = x; + iY = y; } + iX += fr_thickness; + iY += fr_thickness; //init textbox if (ct_textbox == NULL) @@ -177,9 +180,7 @@ void CComponentsText::initCCText() //ensure clean font rendering on transparency background ct_textbox->setTextRenderModeFullBG(!paint_bg); - dprintf(DEBUG_DEBUG, "[CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight); - x_old = iX = x + fr_thickness; - y_old = iY = y + fr_thickness; +// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] init text: %s [x %d x_old %d, y %d y_old %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->x, x_old, this->y, y_old, this->iWidth, this->iHeight); } void CComponentsText::clearCCText() @@ -285,22 +286,26 @@ void CComponentsText::hide() void CComponentsText::setXPos(const int& xpos) { - iX = x = xpos; + CCDraw::setXPos(xpos); + iX = x; } void CComponentsText::setYPos(const int& ypos) { - iY = y = ypos; + CCDraw::setYPos(ypos); + iY = y; } void CComponentsText::setHeight(const int& h) { - iHeight = height = h; + CCDraw::setHeight(h); + iHeight = height; } void CComponentsText::setWidth(const int& w) { - iWidth = width = w; + CCDraw::setWidth(w); + iWidth = width; } //small helper to remove excessiv linbreaks From a5a9c64c2e224631c7fd0aa6d52ba3c6c78b8992 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 22 Feb 2016 20:27:05 +0100 Subject: [PATCH 167/690] CComponentsDetailLine: add version of setDimensionsAll() for dline Contains different parameters, required by dline Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/22371418d34a9f48cad211979335ed99409e17f9 Author: Thilo Graf Date: 2016-02-22 (Mon, 22 Feb 2016) --- src/gui/components/cc_detailsline.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index f9c314afd..d60d09c1d 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -61,15 +61,18 @@ class CComponentsDetailLine : public CComponents ~CComponentsDetailLine(); ///set colors - inline void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; + void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; ///set colors with system settings void syncSysColors(); ///set property: lowest y position - inline void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; + void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; ///set property: height of top marker - inline void setHMarkTop(const int& h_mark_top_){h_mark_top = h_mark_top_;}; + void setHMarkTop(const int& h_mark_top_){h_mark_top = h_mark_top_;}; ///property: height of bottom marker - inline void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; + void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; + ///set all positions and dimensions of details line at once + void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_) + {setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);} ///paint all to screen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From dabedd515dcf91a1ab9474a7dff560a0fea22ab4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 16:39:08 +0100 Subject: [PATCH 168/690] yhook: change json output (text -> msg) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e7ed3b2bc0a27bbc316ad56b7b4d88673cf7c7c6 Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - yhook: change json output (text -> msg) --- src/nhttpd/yhttpd_core/yhook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 2982e83a4..b34bce2f7 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -572,7 +572,7 @@ void CyhookHandler::SendError(std::string error) { if (error.empty()) result = "{\"success\": \"false\"}"; else - result = "{\"success\": \"false\", \"error\":{\"text\": \"" + error + "\"}}"; + result = "{\"success\": \"false\", \"error\":{\"msg\": \"" + error + "\"}}"; break; default: if (error.empty()) From 6731f49fd2dff1b10b1aa341a42ba3e8e815f314 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 16:40:28 +0100 Subject: [PATCH 169/690] controlapi/getchannel: fix possible crash when channel = NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/72cec30e97cfd226e46dff70419898dab012ee6e Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi/getchannel: fix possible crash when channel = NULL --- src/nhttpd/tuxboxapi/controlapi.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 477acca91..92dd1069a 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1298,6 +1298,8 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh) { hh->outStart(); + std::string result = ""; + t_channel_id channel_id = 0; if (hh->ParamList["id"].empty()) channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -1308,10 +1310,14 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh) { NeutrinoAPI->GetChannelEvents(); CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); - std::string result = _GetBouquetWriteItem(hh, channel, -1, -1); - result = hh->outArray("channel", result); - - hh->SendResult(result); + if (channel) + { + result = _GetBouquetWriteItem(hh, channel, -1, -1); + result = hh->outArray("channel", result); + hh->SendResult(result); + } + else + hh->SendError(hh->ParamList["id"] + " seems wrong"); } else hh->SendError(); From 76497b73ffc3284cae9b2b711301a0bc1f1bcb69 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 16:42:21 +0100 Subject: [PATCH 170/690] controlapi/epg: add fallback when no channel or bouquet is given This function needs a fix, because "bouquetnr=all" breakes json output. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/911f333a7f37a4d08e43ded4aad1bf651964e70f Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi/epg: add fallback when no channel or bouquet is given This function needs a fix, because "bouquetnr=all" breakes json output. --- src/nhttpd/tuxboxapi/controlapi.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 92dd1069a..c9a9ce714 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1527,6 +1527,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { else if (!(hh->ParamList["channelname"].empty())) { channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channelname"].c_str()); } + // or determine bouquetnr -> iterate the bouquet int bouquetnr = -1; bool all_bouquets = false; @@ -1538,6 +1539,13 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { bouquetnr--; } + // fallback + if ((channel_id == (t_channel_id) -1) && (bouquetnr == -1)) + { + channel_id = CZapit::getInstance()->GetCurrentChannelID(); + //all_bouquets = true; //better, but broken + } + // ------ generate output ------ hh->outStart(true /*old mode*/); std::string result = ""; From 64fdadc288da8b3856395414afacaea0884641a1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Feb 2016 16:44:28 +0100 Subject: [PATCH 171/690] controlapi/epgsearch: fix display of eventid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c6207d1cff97979485b07b04087c886bfdeaf90f Author: vanhofen Date: 2016-02-24 (Wed, 24 Feb 2016) Origin message was: ------------------ - controlapi/epgsearch: fix display of eventid --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index c9a9ce714..26396cc90 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1734,7 +1734,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) item += hh->outPair("time", tmpstr, true); item += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); - item += hh->outPair("eventid", string_printf("%ld", eventIterator->eventID), false); + item += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), false); result += hh->outArrayItem("item", item, got_next); } From 987757d215c766793e01ce9c93f6a1bfff5a9f3a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 24 Feb 2016 18:46:12 +0100 Subject: [PATCH 172/690] fix AddressSanitizer: strncpy-param-overlap: memory ranges Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d96f15fb6cb60260b8f914a120cdcce657f1dde8 Author: Jacek Jendrzej Date: 2016-02-24 (Wed, 24 Feb 2016) --- src/daemonc/remotecontrol.cpp | 34 +++++++++++++++--------- src/driver/record.cpp | 40 ++++++++++++++++++----------- src/nhttpd/tuxboxapi/controlapi.cpp | 5 ++-- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 34c3f8f49..b8e64a95b 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -507,24 +507,30 @@ void CRemoteControl::processAPIDnames() { has_unresolved_ctags= true; } - if ( strlen( current_PIDs.APIDs[count].desc ) == 3 ) + std::string tmp_desc = current_PIDs.APIDs[count].desc; + if ( tmp_desc.size() == 3 ) { // unaufgeloeste Sprache... - strcpy( current_PIDs.APIDs[count].desc, getISO639Description( current_PIDs.APIDs[count].desc ) ); + tmp_desc = getISO639Description( current_PIDs.APIDs[count].desc ); } if ( current_PIDs.APIDs[count].is_ac3 ) { if(!strstr(current_PIDs.APIDs[count].desc, " (AC3)")) - strncat(current_PIDs.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (AC3)"; has_ac3 = true; if(g_settings.audio_DolbyDigital && (ac3_found < 0)) ac3_found = count; } else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)")) - strncat(current_PIDs.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (AAC)"; else if (current_PIDs.APIDs[count].is_eac3 && !strstr(current_PIDs.APIDs[count].desc, " (EAC3)")) - strncat(current_PIDs.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (EAC3)"; + + if(!tmp_desc.empty()){ + strncpy(current_PIDs.APIDs[count].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); + } + } if ( has_unresolved_ctags ) @@ -545,13 +551,17 @@ void CRemoteControl::processAPIDnames() // workaround for buggy ZDF ctags / or buggy sectionsd/drivers , who knows... if(!tags[i].component.empty()) { - strncpy(current_PIDs.APIDs[j].desc, tags[i].component.c_str(), DESC_MAX_LEN-1); - if (current_PIDs.APIDs[j].is_ac3 && !strstr(current_PIDs.APIDs[j].desc, " (AC3)")) - strncat(current_PIDs.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); - else if (current_PIDs.APIDs[j].is_aac && !strstr(current_PIDs.APIDs[j].desc, " (AAC)")) - strncat(current_PIDs.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); - else if (current_PIDs.APIDs[j].is_eac3 && !strstr(current_PIDs.APIDs[j].desc, " (EAC3)")) - strncat(current_PIDs.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); + std::string tmp_desc2 = tags[i].component.c_str(); + if (current_PIDs.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)")) + tmp_desc2 += " (AC3)"; + else if (current_PIDs.APIDs[j].is_aac && tmp_desc2.find(" (AAC)")) + tmp_desc2 += " (AAC)"; + else if (current_PIDs.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)")) + tmp_desc2 += " (EAC3)"; + + if(!tmp_desc2.empty()){ + strncpy(current_PIDs.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1); + } } current_PIDs.APIDs[j].component_tag = -1; break; diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f30957262..fb4211c20 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -395,15 +395,20 @@ void CRecordInstance::ProcessAPIDnames() if (allpids.APIDs[count].component_tag != 0xFF) has_unresolved_ctags= true; - if ( strlen( allpids.APIDs[count].desc ) == 3 ) - strncpy( allpids.APIDs[count].desc, getISO639Description( allpids.APIDs[count].desc ),DESC_MAX_LEN -1 ); + std::string tmp_desc = allpids.APIDs[count].desc; + if ( strlen( allpids.APIDs[count].desc ) == 3 ){ + tmp_desc = getISO639Description( allpids.APIDs[count].desc ); + } - if ( allpids.APIDs[count].is_ac3 && !strstr(allpids.APIDs[count].desc, " (AC3)")) - strncat(allpids.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); - else if (allpids.APIDs[count].is_aac && !strstr(allpids.APIDs[count].desc, " (AAC)")) - strncat(allpids.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); - else if (allpids.APIDs[count].is_eac3 && !strstr(allpids.APIDs[count].desc, " (EAC3)")) - strncat(allpids.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); + if ( allpids.APIDs[count].is_ac3 && tmp_desc.find(" (AC3)")) + tmp_desc += " (AC3)"; + else if (allpids.APIDs[count].is_aac && tmp_desc.find(" (AAC)")) + tmp_desc += " (AAC)"; + else if (allpids.APIDs[count].is_eac3 && tmp_desc.find(" (EAC3)")) + tmp_desc += " (EAC3)"; + if(!tmp_desc.empty()){ + strncpy( allpids.APIDs[count].desc, tmp_desc.c_str(),DESC_MAX_LEN -1) ; + } } if(has_unresolved_ctags && (epgid != 0)) { @@ -413,13 +418,18 @@ void CRecordInstance::ProcessAPIDnames() for(unsigned int j=0; j< allpids.APIDs.size(); j++) { if(allpids.APIDs[j].component_tag == tags[i].componentTag) { if(!tags[i].component.empty()) { - strncpy(allpids.APIDs[j].desc, tags[i].component.c_str(), DESC_MAX_LEN -1); - if (allpids.APIDs[j].is_ac3 && !strstr(allpids.APIDs[j].desc, " (AC3)")) - strncat(allpids.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); - else if (allpids.APIDs[j].is_aac && !strstr(allpids.APIDs[j].desc, " (AAC)")) - strncat(allpids.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); - else if (allpids.APIDs[j].is_eac3 && !strstr(allpids.APIDs[j].desc, " (EAC3)")) - strncat(allpids.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); + std::string tmp_desc2; + tmp_desc2 = tags[i].component; + if (allpids.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)")) + tmp_desc2 += " (AC3)"; + else if (allpids.APIDs[j].is_aac && tmp_desc2.find(" (AAC)")) + tmp_desc2 += " (AAC)"; + else if (allpids.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)")) + tmp_desc2 += " (EAC3)"; + + if(!tmp_desc2.empty()){ + strncpy(allpids.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1); + } } allpids.APIDs[j].component_tag = -1; break; diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 26396cc90..863309357 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2216,11 +2216,12 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) } else { + std::string tmp_desc = pids.APIDs[j].desc; if(!(init_iso)) { - strncpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ),DESC_MAX_LEN ); + tmp_desc = _getISO639Description( pids.APIDs[j].desc ); } - hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].desc,pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].desc,pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); + hh->printf("%05u %s %s\n",pids.APIDs[j].pid,tmp_desc.c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": tmp_desc.c_str(),pids.APIDs[j].is_aac ? "(AAC)" : tmp_desc.c_str(),pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } eit_not_ok=false; break; From 2e8490229b1383145995cc02080a4643d6637c6e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 25 Feb 2016 15:34:43 +0100 Subject: [PATCH 173/690] yhook: allow multiple json arrays Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75a6848a797e136394e7282cc1f2c9960303c11a Author: vanhofen Date: 2016-02-25 (Thu, 25 Feb 2016) Origin message was: ------------------ - yhook: allow multiple json arrays --- src/nhttpd/yhttpd_core/yhook.cpp | 4 +++- src/nhttpd/yhttpd_core/yhook.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index b34bce2f7..e9b9425ac 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -452,7 +452,7 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool } //----------------------------------------------------------------------------- -std::string CyhookHandler::outArray(std::string _key, std::string _content) { +std::string CyhookHandler::outArray(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: @@ -463,6 +463,8 @@ std::string CyhookHandler::outArray(std::string _key, std::string _content) { case json: //TODO: json check result = outIndent() + "\"" + _key + "\": [" + _content + "]"; + if(_next) + result += ","; result += "\n"; break; default: diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 9f8e2e332..30bf18949 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -206,7 +206,7 @@ public: std::string outIndent(); std::string outSingle(std::string _content); std::string outPair(std::string _key, std::string _content, bool _next); - std::string outArray(std::string _key, std::string _content); + std::string outArray(std::string _key, std::string _content, bool _next = false); std::string outArrayItem(std::string _key, std::string _content, bool _next); std::string outObject(std::string _key,std::string _content, bool _next = false); std::string outValue(std::string _content); From 02abb619699286bba2ba38921a570633b0b2e5e5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 25 Feb 2016 15:35:27 +0100 Subject: [PATCH 174/690] controlapi/timer: allow json output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9615f547d55860184b0cc0474767e95ca4516cb2 Author: vanhofen Date: 2016-02-25 (Thu, 25 Feb 2016) Origin message was: ------------------ - controlapi/timer: allow json output --- src/nhttpd/tuxboxapi/controlapi.cpp | 214 ++++++++++++++-------------- src/nhttpd/tuxboxapi/controlapi.h | 4 +- 2 files changed, 107 insertions(+), 111 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 863309357..7df1260bb 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -291,6 +291,8 @@ void CControlAPI::Execute(CyhookHandler *hh) //============================================================================= void CControlAPI::TimerCGI(CyhookHandler *hh) { + hh->outStart(); + if (NeutrinoAPI->Timerd->isTimerdAvailable()) { if (!hh->ParamList.empty() && hh->ParamList["format"].empty()) @@ -318,8 +320,8 @@ void CControlAPI::TimerCGI(CyhookHandler *hh) } } else { - if (hh->getOutType() == xml) - SendTimersXML(hh); + if (hh->getOutType() == plain) + SendTimersPlain(hh); else SendTimers(hh); } @@ -2216,12 +2218,11 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) } else { - std::string tmp_desc = pids.APIDs[j].desc; if(!(init_iso)) { - tmp_desc = _getISO639Description( pids.APIDs[j].desc ); + strncpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ),DESC_MAX_LEN ); } - hh->printf("%05u %s %s\n",pids.APIDs[j].pid,tmp_desc.c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": tmp_desc.c_str(),pids.APIDs[j].is_aac ? "(AAC)" : tmp_desc.c_str(),pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); + hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].desc,pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].desc,pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } eit_not_ok=false; break; @@ -2253,7 +2254,7 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) hh->printf("%05u pcr\n",pids.PIDs.pcrpid); } //----------------------------------------------------------------------------- -void CControlAPI::SendTimers(CyhookHandler *hh) +void CControlAPI::SendTimersPlain(CyhookHandler *hh) { CTimerd::TimerList timerlist; // List of bouquets bool send_id = false; @@ -2322,25 +2323,29 @@ void CControlAPI::SendTimers(CyhookHandler *hh) } //----------------------------------------------------------------------------- -void CControlAPI::_SendTime(CyhookHandler *hh, struct tm *Time, int digits) { +std::string CControlAPI::_SendTime(CyhookHandler *hh, struct tm *Time, int digits) { char zTime[25] = {0}; char zDate[25] = {0}; strftime(zTime,20,"%H:%M",Time); strftime(zDate,20,"%d.%m.%Y",Time); - hh->printf("\t\t\t\t\t%s %s\n",zDate,zTime); - hh->printf("\t\t\t\t\t%s\n",zDate); - hh->printf("\t\t\t\t\t\n",zTime); - hh->printf("\t\t\t\t\t%d\n",digits); - hh->printf("\t\t\t\t\t%d\n",Time->tm_mday); - hh->printf("\t\t\t\t\t%d\n",Time->tm_mon+1); - hh->printf("\t\t\t\t\t%d\n",Time->tm_year+1900); - hh->printf("\t\t\t\t\t%d\n",Time->tm_hour); - hh->printf("\t\t\t\t\t%d\n",Time->tm_min); + std::string result = ""; + + result += hh->outPair("text", string_printf("%s %s", zDate, zTime), true); + result += hh->outPair("date", string_printf("%s", zDate), true); + result += hh->outPair("time", string_printf("%s", zTime), true); + result += hh->outPair("digits", string_printf("%d", digits), true); + result += hh->outPair("day", string_printf("%d", Time->tm_mday), true); + result += hh->outPair("month", string_printf("%d", Time->tm_mon+1), true); + result += hh->outPair("year", string_printf("%d", Time->tm_year+1900), true); + result += hh->outPair("hour", string_printf("%d", Time->tm_hour), true); + result += hh->outPair("min", string_printf("%d", Time->tm_min), false); + + return result; } //----------------------------------------------------------------------------- -// build xml for all timer data (needed for yWeb 3) +// build json/xml for all timer data (needed for yWeb 3) //----------------------------------------------------------------------------- -void CControlAPI::SendTimersXML(CyhookHandler *hh) +void CControlAPI::SendTimers(CyhookHandler *hh) { // Init local timer iterator CTimerd::TimerList timerlist; // List of timers @@ -2348,97 +2353,86 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) NeutrinoAPI->Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); // sort timer CTimerd::TimerList::iterator timer = timerlist.begin(); - -// std::string xml_response = ""; - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - hh->WriteLn(""); - hh->WriteLn("\n"); - - // general timer configuration - hh->WriteLn("\t\n"); + std::string result = ""; + std::string config = ""; + std::string timer_list = ""; // Look for Recording Safety Timers too int pre=0, post=0; NeutrinoAPI->Timerd->getRecordingSafety(pre,post); -// hh->printf("\t\t\t%d\n",(int)timer->recordingSafety); - hh->printf("\t\t\t%d\n",pre); - hh->printf("\t\t\t%d\n",post); - hh->WriteLn("\t\n"); + config += hh->outPair("pre_delay", string_printf("%d", pre), true); + config += hh->outPair("post_delay", string_printf("%d", post), false); - // start timer list - hh->WriteLn("\t\n"); + result += hh->outObject("config", config, true); - for(; timer != timerlist.end(); ++timer) + for(int i = 0; timer != timerlist.end(); ++timer) { - hh->WriteLn("\t\t\n"); - hh->printf("\t\t\t%s\n",(NeutrinoAPI->timerEventType2Str(timer->eventType)).c_str()); - hh->printf("\t\t\t%d\n",timer->eventID); - hh->printf("\t\t\t%d\n",(int)timer->eventState); - hh->printf("\t\t\t%d\n",(int)timer->eventType); + if (i > 0) + timer_list += hh->outNext(); + + std::string timer_item = ""; + + timer_item += hh->outPair("type", NeutrinoAPI->timerEventType2Str(timer->eventType), true); + timer_item += hh->outPair("id", string_printf("%d", timer->eventID), true); + timer_item += hh->outPair("state", string_printf("%d", (int)timer->eventState), true); + timer_item += hh->outPair("type_number", string_printf("%d", (int)timer->eventType), true); // alarmtime - hh->WriteLn("\t\t\t\n"); + std::string alarm = ""; struct tm *alarmTime = localtime(&(timer->alarmTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, alarmTime, (int)timer->alarmTime); - hh->WriteLn("\t\t\t\t\n"); + alarm += hh->outArrayItem("normal", _SendTime(hh, alarmTime, (int)timer->alarmTime), true); time_t real_alarmTimeT = timer->alarmTime - pre; struct tm *safetyAlarmTime = localtime(&real_alarmTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyAlarmTime, (int)real_alarmTimeT); - hh->WriteLn("\t\t\t\t\n"); + alarm += hh->outArrayItem("safety", _SendTime(hh, safetyAlarmTime, (int)real_alarmTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("alarm", alarm, true); // announcetime - hh->WriteLn("\t\t\t\n"); + std::string announce = ""; + struct tm *announceTime = localtime(&(timer->announceTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, announceTime, (int)timer->announceTime); - hh->WriteLn("\t\t\t\t\n"); + announce += hh->outArrayItem("normal", _SendTime(hh, announceTime, (int)timer->announceTime), true); time_t real_announceTimeT = timer->announceTime - pre; struct tm *safetyAnnounceTime = localtime(&real_announceTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyAnnounceTime, (int)real_announceTimeT); - hh->WriteLn("\t\t\t\t\n"); + announce += hh->outArrayItem("safety", _SendTime(hh, safetyAnnounceTime, (int)real_announceTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("announce", announce, true); // stoptime if(timer->stopTime > 0) { - hh->WriteLn("\t\t\t\n"); + std::string stop = ""; + struct tm *stopTime = localtime(&(timer->stopTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, stopTime, (int)timer->stopTime); - hh->WriteLn("\t\t\t\t\n"); + stop += hh->outArrayItem("normal", _SendTime(hh, stopTime, (int)timer->stopTime), true); time_t real_stopTimeT = timer->stopTime - post; struct tm *safetyStopTime = localtime(&real_stopTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyStopTime, (int)real_stopTimeT); - hh->WriteLn("\t\t\t\t\n"); + stop += hh->outArrayItem("safety", _SendTime(hh, safetyStopTime, (int)real_stopTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("stop", stop, true); } // repeat + std::string repeat = ""; + std::string zRep = NeutrinoAPI->timerEventRepeat2Str(timer->eventRepeat); std::string zRepCount; if (timer->eventRepeat == CTimerd::TIMERREPEAT_ONCE) zRepCount = "-"; else zRepCount = (timer->repeatCount == 0) ? "∞" : string_printf("%dx",timer->repeatCount); - hh->WriteLn("\t\t\t\n"); - hh->printf("\t\t\t\t%s\n",zRepCount.c_str()); - hh->printf("\t\t\t\t%d\n",(int)timer->eventRepeat); - hh->printf("\t\t\t\t%s\n",zRep.c_str()); std::string weekdays; NeutrinoAPI->Timerd->setWeekdaysToStr(timer->eventRepeat, weekdays); - hh->printf("\t\t\t\t%s\n", weekdays.c_str()); - hh->WriteLn("\t\t\t\n"); + + repeat += hh->outPair("count", zRepCount, true); + repeat += hh->outPair("number", string_printf("%d", (int)timer->eventRepeat), true); + repeat += hh->outPair("text", zRep, true); + repeat += hh->outPair("weekdays", weekdays, false); + + timer_item += hh->outObject("repeat", repeat, true); // channel infos std::string channel_name = NeutrinoAPI->GetServiceName(timer->channel_id); @@ -2458,72 +2452,69 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) { #if 0 case CTimerd::TIMER_NEXTPROGRAM : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, false); } break; #endif case CTimerd::TIMER_ZAPTO : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, false); } break; case CTimerd::TIMER_RECORD : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, true); // audio - if(timer->apids != TIMERD_APIDS_CONF) { - hh->WriteLn("\t\t\t\n"); - } - else { - hh->WriteLn("\t\t\t\n"); + std::string audio = ""; + std::string apids_conf = "true"; + std::string apids_std = "false"; + std::string apids_alt = "false"; + std::string apids_ac3 = "false"; + + if (timer->apids != TIMERD_APIDS_CONF) + { + apids_conf = "false"; + if (timer->apids & TIMERD_APIDS_STD) + apids_std = "true"; + if (timer->apids & TIMERD_APIDS_ALT) + apids_alt = "true"; + if (timer->apids & TIMERD_APIDS_AC3) + apids_ac3 = "true"; } - hh->printf("\t\t\t%s\n",timer->recordingDir); - hh->printf("\t\t\t%d\n",(int)timer->epgID); + audio += hh->outPair("apids_conf", apids_conf, true); + audio += hh->outPair("apids_std", apids_std, true); + audio += hh->outPair("apids_alt", apids_alt, true); + audio += hh->outPair("apids_ac3", apids_ac3, false); + timer_item += hh->outObject("audio", audio, true); + + timer_item += hh->outPair("recording_dir", timer->recordingDir, true); + timer_item += hh->outPair("epg_id", string_printf("%d", (int)timer->epgID), false); } break; case CTimerd::TIMER_STANDBY : { - hh->printf("\t\t\t%s\n",(timer->standby_on)? "on" : "off"); + timer_item += hh->outPair("status", (timer->standby_on) ? "on" : "off", false); } break; case CTimerd::TIMER_REMIND : { std::string _message; _message = std::string(timer->message).substr(0,20); - hh->printf("\t\t\t%s\n",_message.c_str()); + timer_item += hh->outPair("message", _message, false); } break; case CTimerd::TIMER_EXEC_PLUGIN : { - hh->printf("\t\t\t%s\n",timer->pluginName); + timer_item += hh->outPair("plugin", timer->pluginName, false); } break; @@ -2538,10 +2529,15 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) default: {} } - hh->WriteLn("\t\t\n"); + timer_list += hh->outArrayItem("timer", timer_item, false); + i++; } - hh->WriteLn("\t\n"); - hh->WriteLn("\n"); + result += hh->outArray("timer_list", timer_list); + if (hh->getOutType() == json) + result = hh->outArrayItem("timer", result, false); + result = hh->outArray("timer", result); + + hh->SendResult(result); } //----------------------------------------------------------------------------- diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index fb892b160..95bdef974 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -52,8 +52,8 @@ private: void SendBouquets(CyhookHandler *hh); void SendBouquet(CyhookHandler *hh,int BouquetNr); void SendChannelList(CyhookHandler *hh, bool currentTP = false); + void SendTimersPlain(CyhookHandler *hh); void SendTimers(CyhookHandler *hh); - void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); void EpgSearchXMLCGI(CyhookHandler *hh); void EpgSearchCGI(CyhookHandler *hh); @@ -61,7 +61,7 @@ private: friend class CNeutrinoWebserver; // for timer /fb/ compatibility void doModifyTimer(CyhookHandler *hh); void doNewTimer(CyhookHandler *hh); - void _SendTime(CyhookHandler *hh, struct tm *Time, int digits); + std::string _SendTime(CyhookHandler *hh, struct tm *Time, int digits); std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr); std::string channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime); std::string _GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel); From d6fde778d84152411b261f7e09a6af0eb28661ec Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Feb 2016 09:02:30 +0100 Subject: [PATCH 175/690] controlapi/timer: fix json output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/63333053f5ec0e289a9745bcaa44acd2bfa62f12 Author: vanhofen Date: 2016-02-26 (Fri, 26 Feb 2016) Origin message was: ------------------ - controlapi/timer: fix json output --- src/nhttpd/tuxboxapi/controlapi.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 7df1260bb..07522f396 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2432,7 +2432,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) repeat += hh->outPair("text", zRep, true); repeat += hh->outPair("weekdays", weekdays, false); - timer_item += hh->outObject("repeat", repeat, true); + timer_item += hh->outObject("repeat", repeat, false); // channel infos std::string channel_name = NeutrinoAPI->GetServiceName(timer->channel_id); @@ -2460,6 +2460,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) #endif case CTimerd::TIMER_ZAPTO : { + timer_item += hh->outNext(); timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); timer_item += hh->outPair("channel_name", channel_name, true); timer_item += hh->outPair("title", title, false); @@ -2467,6 +2468,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) break; case CTimerd::TIMER_RECORD : { + timer_item += hh->outNext(); timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); timer_item += hh->outPair("channel_name", channel_name, true); timer_item += hh->outPair("title", title, true); @@ -2502,6 +2504,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) break; case CTimerd::TIMER_STANDBY : { + timer_item += hh->outNext(); timer_item += hh->outPair("status", (timer->standby_on) ? "on" : "off", false); } break; @@ -2509,11 +2512,13 @@ void CControlAPI::SendTimers(CyhookHandler *hh) case CTimerd::TIMER_REMIND : { std::string _message; _message = std::string(timer->message).substr(0,20); + timer_item += hh->outNext(); timer_item += hh->outPair("message", _message, false); } break; case CTimerd::TIMER_EXEC_PLUGIN : { + timer_item += hh->outNext(); timer_item += hh->outPair("plugin", timer->pluginName, false); } break; From b90b5624f8a642178ef471cc7109b1e0090c7185 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 1 Jan 2016 15:43:05 +0100 Subject: [PATCH 176/690] add a method for migrating config file values e.g. commit c6905d2f changed the names of config file entries, which leads to unwanted changes in appearance. To avoid this in the future, add a migrateConfig() function in neutrino which fixes this commit and can be extended in the future if necessary. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/698839b44ad2bb87eba2640db724023520790e66 Author: Stefan Seyfried Date: 2016-01-01 (Fri, 01 Jan 2016) --- src/neutrino.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/neutrino.h | 2 ++ 2 files changed, 50 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7cf024d84..80ae99149 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -328,6 +328,8 @@ int CNeutrinoApp::loadSetup(const char * fname) !configfile.getInt32("screen_EndY_lcd", 0)) { printf("[neutrino] config file %s is broken, using defaults\n", fname); configfile.clear(); + } else { + migrateConfig(fname); } } parentallocked = !access(NEUTRINO_PARENTALLOCKED_FILE, R_OK); @@ -4616,3 +4618,49 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) return true; } + +/* + * commit 523b273a changed the names of config file entries: + * casystem_display => infobar_casystem_display + * casystem_dotmatrix => infobar_casystem_dotmatrix + * casystem_frame => infobar_casystem_frame + * convert these, so that users do not need to set up their system again +*/ +struct __key_rename { + const char *from; + const char *to; +}; + +static struct __key_rename key_rename[] = { + { "casystem_display", "infobar_casystem_display" }, + { "casystem_dotmatrix", "infobar_casystem_dotmatrix"}, + { "casystem_frame", "infobar_casystem_frame" }, + { NULL, NULL } +}; + +/* actually do the migration of the config entries */ +void CNeutrinoApp::migrateConfig(const char *fname) +{ + /* we need a second configfile to not create new entries and trigger the + * "new entry created" flag */ + CConfigFile migconf('\t', false); + migconf.loadConfig(fname); + /* here we do a simple rename of config file keys */ + int magic = -424242; /* obviously a value that does not appear in real cases */ + int tmp = magic; + int i; + for (i = 0; key_rename[i].from != NULL; i++) { + const char *from = key_rename[i].from; + const char *to = key_rename[i].to; + tmp = migconf.getInt32(from, magic); + if (tmp == magic) /* old key does not exist */ + continue; + /* only set new key to old value if the new key does not yet exist */ + if (configfile.getInt32(to, magic) == magic) + configfile.setInt32(to, tmp); + /* always remove old key*/ + configfile.deleteKey(from); + } + /* more complex migration, including converting values etc. could be done here */ +} + diff --git a/src/neutrino.h b/src/neutrino.h index 7dbbc84d0..d65f6760c 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -126,6 +126,8 @@ private: void InitZapitClient(); void InitSectiondClient(); + void migrateConfig(const char *fname); + //menues void InitMenu(); void InitMenuMain(); From e55632ee66ec48919273c499fe10e36b1d6ed67b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 24 Feb 2016 21:34:03 +0100 Subject: [PATCH 177/690] CComponentsWindow: fix default header color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/63533b6dbda670b4a18bbcdf3e1fde615fb7fb3f Author: Thilo Graf Date: 2016-02-24 (Wed, 24 Feb 2016) --- src/gui/components/cc_frm_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 56df2802b..01c3be3a6 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -152,7 +152,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_show_l_sideber = false; ccw_show_r_sideber = false; ccw_w_sidebar = 40; - ccw_col_head = COL_MENUCONTENT_PLUS_0; + ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; ccw_col_footer = COL_INFOBAR_SHADOW_PLUS_1; From db9858236c74f5c84b832d7bae411ec2375d4aea Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 26 Feb 2016 14:55:38 +0100 Subject: [PATCH 178/690] CComponentsText: add extended setColorAll() methode into text class Doeas the same like setColorAll() of CCDraw but additional for text color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e45ea4abfbf1e0d193c4dc4204edcdd496ffc21e Author: Thilo Graf Date: 2016-02-26 (Fri, 26 Feb 2016) --- src/gui/components/cc_item_text.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 5bf297212..48450de61 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -132,6 +132,13 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox virtual inline void setTextFont(Font* font_text){ct_font = font_text;}; ///set text color virtual void setTextColor(const fb_pixel_t& color_text); + ///set all basic framebuffer element colors at once + ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" + virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT) + { + CCDraw::setColorAll(color_frame, color_body, color_shadow); + setTextColor(color_text); + }; ///get text color virtual inline fb_pixel_t getTextColor(){return ct_col_text;}; ///set text alignment, also see textbox.h for possible alignment modes From c3dc08319944f8834cd7becbd0d10655b3e5b881 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 27 Feb 2016 00:00:48 +0100 Subject: [PATCH 179/690] controlapi/epg: resort order of items; last order brakes plugins Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dcec44b8d624d83140838e3287197c33738d7a03 Author: vanhofen Date: 2016-02-27 (Sat, 27 Feb 2016) Origin message was: ------------------ - controlapi/epg: resort order of items; last order brakes plugins --- src/nhttpd/tuxboxapi/controlapi.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 07522f396..f9ffc3eff 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1469,14 +1469,8 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ if (hh->outType == plain) prog += hh->outSingle(""); - prog += hh->outPair("description", hh->outValue(eventIterator->description), true); - if (!(hh->ParamList["details"].empty())) { - CShortEPGData epg; - if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { - prog += hh->outPair("info1", hh->outValue(epg.info1), true); - prog += hh->outPair("info2", hh->outValue(epg.info2), true); - } - } + prog += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), true); + prog += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); prog += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), true); prog += hh->outPair("eventid_hex", string_printf("%llx", eventIterator->eventID), true); prog += hh->outPair("start_sec", string_printf("%ld", eventIterator->startTime), true); @@ -1492,7 +1486,16 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ mtime = localtime(&_stoptime); strftime(zbuffer, 20, "%H:%M", mtime); prog += hh->outPair("stop_t", std::string(zbuffer), true); - prog += hh->outPair("duration_min", string_printf("%d", (int) (eventIterator->duration / 60)), false); + prog += hh->outPair("duration_min", string_printf("%d", (int) (eventIterator->duration / 60)), true); + + if (!(hh->ParamList["details"].empty())) { + CShortEPGData epg; + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { + prog += hh->outPair("info1", hh->outValue(epg.info1), true); + prog += hh->outPair("info2", hh->outValue(epg.info2), true); + } + } + prog += hh->outPair("description", hh->outValue(eventIterator->description), false); if(isFirstLine) isFirstLine = false; From d937358782a28fe9bc679eccd4f540ad7414ee84 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 Feb 2016 08:05:05 +0100 Subject: [PATCH 180/690] Infoclock: unify handling in some classes with singleton Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59d9b7068e90cb4c8b0ac1b0cf2a478239bc2db8 Author: Thilo Graf Date: 2016-02-29 (Mon, 29 Feb 2016) --- src/gui/infoviewer.cpp | 10 +++++----- src/gui/mediaplayer.cpp | 6 +++--- src/gui/movieplayer.cpp | 8 ++++---- src/gui/pictureviewer.cpp | 6 +++--- src/gui/user_menue.cpp | 5 ++--- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6e626c725..2b5148b81 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -79,7 +79,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + #define LEFT_OFFSET 5 @@ -249,7 +249,7 @@ void CInfoViewer::initClock() clock->setClockIntervall(1); } - InfoClock->getInstance()->disableInfoClock(); + CInfoClock::getInstance()->disableInfoClock(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); clock->doPaintBg(!gradient_top); clock->enableTboxSaveScreen(gradient_top); @@ -1213,7 +1213,7 @@ void CInfoViewer::killRadiotext() if (g_Radiotext->S_RtOsd) frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h); rt_x = rt_y = rt_h = rt_w = 0; - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); } void CInfoViewer::showRadiotext() @@ -1225,7 +1225,7 @@ void CInfoViewer::showRadiotext() infoViewerBB->showIcon_RadioText(g_Radiotext->haveRadiotext()); if (g_Radiotext->S_RtOsd) { - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); // dimensions of radiotext window int /*yoff = 8,*/ ii = 0; rt_dx = BoxEndX - BoxStartX; @@ -2099,7 +2099,7 @@ void CInfoViewer::killTitle() } } showButtonBar = false; - InfoClock->getInstance()->enableInfoClock(); + CInfoClock::getInstance()->enableInfoClock(); } #if 0 diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 3c55f267f..92b64df91 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -53,7 +53,7 @@ #include #include extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + CMediaPlayerMenu::CMediaPlayerMenu() { @@ -108,7 +108,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "movieplayer") { audiomute->enableMuteIcon(false); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); int mode = CNeutrinoApp::getInstance()->getMode(); if( mode == NeutrinoMessages::mode_radio ) CFrameBuffer::getInstance()->stopFrame(); @@ -116,7 +116,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) if( mode == NeutrinoMessages::mode_radio ) CFrameBuffer::getInstance()->showFrame("radiomode.jpg"); audiomute->enableMuteIcon(true); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); return res; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d919a0674..9dea03794 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -74,7 +74,7 @@ extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ -extern CInfoClock *InfoClock; + extern CVolume* g_volume; #define TIMESHIFT_SECONDS 3 @@ -459,7 +459,7 @@ void CMoviePlayerGui::ClearQueue() void CMoviePlayerGui::EnableClockAndMute(bool enable) { CAudioMute::getInstance()->enableMuteIcon(enable); - InfoClock->enableInfoClock(enable); + CInfoClock::getInstance()->enableInfoClock(enable); } void CMoviePlayerGui::makeFilename() @@ -1828,7 +1828,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) bool restore = FileTime.IsVisible(); if (restore) FileTime.kill(); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); if (isLuaPlay && haveLuaInfoFunc) { int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; @@ -1843,7 +1843,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) else if (p_movie_info) cMovieInfo.showMovieInfo(*p_movie_info); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); if (restore) { FileTime.setMode(m_mode); FileTime.update(position, duration); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 07c8d979e..02e56d892 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -76,7 +76,7 @@ #include #include extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + //------------------------------------------------------------------------ bool comparePictureByDate (const CPicture& a, const CPicture& b) @@ -258,7 +258,7 @@ int CPictureViewerGui::show() m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); CAudioMute::getInstance()->enableMuteIcon(false); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); while (loop) { @@ -644,7 +644,7 @@ int CPictureViewerGui::show() hide(); CAudioMute::getInstance()->enableMuteIcon(true); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); return(res); } diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 661c5e5d1..0b082ff10 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -459,8 +459,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } } - extern CInfoClock *InfoClock; - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); // show menu if there are more than 2 items only // otherwise, we start the item directly (must be the last one) if (menu_items > 1 ) @@ -468,7 +467,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) else if (last_menu_item) last_menu_item->exec( NULL ); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); CNeutrinoApp::getInstance()->StartSubtitles(); if (button < COL_BUTTONMAX) From 289f5b30e67174fee00f7d480520ca1e8df6061b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 Feb 2016 10:38:23 +0100 Subject: [PATCH 181/690] CComponentsButton: increase default height of buttons Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e0d1c85f98b2f8a85f3a69eea401791bbfca23a Author: Thilo Graf Date: 2016-02-29 (Mon, 29 Feb 2016) --- src/gui/components/cc_frm_button.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 403418664..4a9b4b68f 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -102,7 +102,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const shadow = shadow_mode; shadow_w = SHADOW_OFFSET; - cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient + cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); col_frame = color_frame; col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body; @@ -110,7 +110,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; - fr_thickness = 3; + fr_thickness = 3; //TODO: parts of the GUI still don't use framed buttons append_x_offset = 6; append_y_offset = 0; corner_rad = 0; @@ -160,7 +160,7 @@ void CComponentsButton::initIcon() if (h_icon > h_max) cc_btn_icon_obj->setHeight(h_max, true); - y_icon = height/2 - cc_btn_icon_obj->getHeight()/2; + y_icon = h_max/2 - cc_btn_icon_obj->getHeight()/2; cc_btn_icon_obj->setYPos(y_icon); cc_btn_icon_obj->doPaintBg(false); @@ -192,7 +192,7 @@ void CComponentsButton::initCaption() x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; - int h_cap = height*80/100/* - 2*fr_thickness*/; + int h_cap = height*85/100/* - 2*fr_thickness*/; /*NOTE: paint of centered text in y direction without y_offset From fb8f4cec67917c25102d6ae764d4e8635d0e7a11 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 1 Mar 2016 10:00:49 +0100 Subject: [PATCH 182/690] yhook: add helper function ParamList_exist() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c7ad87cff98c0186c0cddaead539f3da4eec021 Author: vanhofen Date: 2016-03-01 (Tue, 01 Mar 2016) Origin message was: ------------------ - yhook: add helper function ParamList_exist() --- src/nhttpd/yhttpd_core/yhook.cpp | 13 +++++++++++++ src/nhttpd/yhttpd_core/yhook.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index e9b9425ac..56537c057 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -366,6 +366,19 @@ std::string CyhookHandler::BuildHeader(bool cache) { return result; } +bool CyhookHandler::ParamList_exist(std::string keyword) +{ + bool exist = false; + unsigned int s = ParamList.size(); + for (unsigned int i = 1; i <= s; i++) + { + exist = (ParamList[itoa(i)] == keyword); + if (exist) + break; + } + return exist; +} + //============================================================================= // Output helpers //============================================================================= diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 30bf18949..0fefe46a8 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -199,6 +199,8 @@ public: void SendRedirect(const std::string& url) {httpStatus=HTTP_MOVED_TEMPORARILY; NewURL = url; status = HANDLED_REDIRECTION;} void SendRewrite(const std::string& url) {NewURL = url; status = HANDLED_REWRITE;} + bool ParamList_exist(std::string keyword); + int _outIndent; TOutType outType; // Outputtpe = plain (default)|xml|json TOutType outStart(bool single = false); From 8c7d6db80797511c799368cea09279745c863bc0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 1 Mar 2016 10:01:35 +0100 Subject: [PATCH 183/690] controlapi/getmode: allow to get channelsmode in all stb modes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a38042071d2d0c0276ccbda4d1c279376c58e6c Author: vanhofen Date: 2016-03-01 (Tue, 01 Mar 2016) Origin message was: ------------------ - controlapi/getmode: allow to get channelsmode in all stb modes --- src/nhttpd/doc/nhttpd_controlapi.html | 22 ++++++-- src/nhttpd/tuxboxapi/controlapi.cpp | 72 +++++++++++++++++---------- 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index cb8208cc5..5ddcc8e26 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -48,7 +48,7 @@ - + @@ -952,13 +952,14 @@ ok
-
Radio/TV Mode Abfrage
+
Neutrino Mode Abfrage
Handler: http://box_ip/control/getmode

-Parameter:
-Rückgabe: "tv", "radio", "unkown"
+Parameter: keine
+Rückgabe: "tv", "radio", "scart", "standby", "audio",
+"pic", "ts", "webtv", "upnp", "unknown"

-Es wird der aktuelle mode zurückgegeben tv / radio / unknown (shouldn't happen)
+Es wird der aktuelle Modus der Box zurückgegeben
Beispiel:

@@ -966,6 +967,17 @@ Beispiel:
tv

+Parameter: channelsmode
+Rückgabe: "tv", "radio", "unknown"
+
+Es wird der eingestellte Kanalmodus der Box zurückgegeben
+
+Beispiel:
+
+>>>http://box_ip/control/getmode?channelmode
+radio
+
+
Datum von der Box abfragen
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index f9ffc3eff..60cb7c53e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -392,36 +392,56 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) void CControlAPI::GetModeCGI(CyhookHandler *hh) { hh->outStart(); - std::string result = ""; - int mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_tv) - result = "tv"; - else if (mode == NeutrinoMessages::mode_radio) - result = "radio"; - else if (mode == NeutrinoMessages::mode_scart) - result = "scart"; - else if (mode == NeutrinoMessages::mode_standby) - result = "standby"; - else if (mode == NeutrinoMessages::mode_audio) - result = "audio"; - else if (mode == NeutrinoMessages::mode_pic) - result = "pic"; - else if (mode == NeutrinoMessages::mode_ts) - result = "ts"; - else if (mode == NeutrinoMessages::mode_webtv) - result = "webtv"; - else if (mode == NeutrinoMessages::mode_upnp) - result = "upnp"; - else - result = "unknown"; + std::string key = "mode"; - if (hh->getOutType() != plain) + if (hh->ParamList_exist("channelsmode") && hh->ParamList["channelsmode"] != "false") { - result = hh->outPair("mode", result, false); - result = hh->outObject("getmode", result); + key = "channelsmode"; + int mode = NeutrinoAPI->Zapit->getMode(); + if (mode == CZapitClient::MODE_TV) + result = "tv"; + else if (mode == CZapitClient::MODE_RADIO) + result = "radio"; + else + result = "unknown"; } - hh->SendResult(result); + else + { + int mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_tv) + result = "tv"; + else if (mode == NeutrinoMessages::mode_radio) + result = "radio"; + else if (mode == NeutrinoMessages::mode_scart) + result = "scart"; + else if (mode == NeutrinoMessages::mode_standby) + result = "standby"; + else if (mode == NeutrinoMessages::mode_audio) + result = "audio"; + else if (mode == NeutrinoMessages::mode_pic) + result = "pic"; + else if (mode == NeutrinoMessages::mode_ts) + result = "ts"; + else if (mode == NeutrinoMessages::mode_webtv) + result = "webtv"; + else if (mode == NeutrinoMessages::mode_upnp) + result = "upnp"; + else + result = "unknown"; + } + + if (!result.empty()) + { + if (hh->getOutType() != plain) + { + result = hh->outPair(key, result, false); + result = hh->outObject("getmode", result); + } + hh->SendResult(result); + } + else + hh->SendError(); } //----------------------------------------------------------------------------- From b4b22ccfcba2acb240d978d081731a880f0d9c30 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 1 Mar 2016 16:11:10 +0100 Subject: [PATCH 184/690] src/gui/movieplayer.cpp fix possible stack-buffer-overflow Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0857bf579a829a559859d13654af3e474d00fb09 Author: Jacek Jendrzej Date: 2016-03-01 (Tue, 01 Mar 2016) --- src/gui/movieplayer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 9dea03794..c8ce5df13 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2307,12 +2307,13 @@ void CMoviePlayerGui::parsePlaylist(CFile *file) while (infile.good()) { infile.getline(cLine, sizeof(cLine)); - if (cLine[strlen(cLine)-1]=='\r') - cLine[strlen(cLine)-1]=0; + size_t len = strlen(cLine); + if (len > 0 && cLine[len-1]=='\r') + cLine[len-1]=0; int dur; sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name); - if (strlen(cLine) > 0 && cLine[0]!='#') + if (len > 0 && cLine[0]!='#') { char *url = NULL; if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "https://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) { From 837722281439dba4c219a557e6dfcc5e36b8342e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 1 Mar 2016 16:50:33 +0100 Subject: [PATCH 185/690] src/gui/scan.cpp use_config.scanPIDs_in_tsScan_also (THX Janus) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f58a4732f92d76f1d2c29a6dfaaaf8f8fae2e85 Author: Jacek Jendrzej Date: 2016-03-01 (Tue, 01 Mar 2016) --- src/gui/scan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 91916906c..4fddbaa3f 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -213,7 +213,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) //printf("[neutrino] scan_mode %d TP_freq %s TP_rate %s TP_fec %d TP_pol %d\n", scansettings.scan_mode, scansettings.TP_freq, scansettings.TP_rate, scansettings.TP_fec, scansettings.TP_pol); if(manual) { - CZapit::getInstance()->scanPids(true); + CZapit::getInstance()->scanPids(scan_pids); if(scansettings.scan_nit_manual) scan_flags |= CServiceScan::SCAN_NIT; TP.scan_mode = scan_flags; From 2d762c1b23d9fe96eedb2e52677431925c390f21 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 2 Mar 2016 12:31:48 +0300 Subject: [PATCH 186/690] gui/pictureviewer.cpp: unblank video on quit in mode_ts Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/746c3e769a3f00a5497212e2562a22c6dd1b98d5 Author: [CST] Focus Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/pictureviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 02e56d892..fdb0873f1 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -232,6 +232,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) // Restore last mode CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); + if (m_LastMode == NeutrinoMessages::mode_ts) + videoDecoder->setBlank(false); // always exit all return menu_return::RETURN_REPAINT; From c4a07ea7111b164a273cde0173b732207fe7ade0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 2 Mar 2016 14:30:51 +0300 Subject: [PATCH 187/690] nhttpd/tuxboxapi/controlapi.cpp: add direct record start for current channel Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc11a76c0184dc603fce7825a082494339502bde Author: [CST] Focus Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/driver/rcinput.cpp | 10 ++++++++++ src/neutrino.cpp | 16 ++++++++++++---- src/nhttpd/tuxboxapi/controlapi.cpp | 10 ++++++++++ src/nhttpd/tuxboxapi/neutrinoapi.cpp | 2 ++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index c11368e01..1954fbdb0 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -873,6 +873,16 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::EVT_SET_VOLUME; *data = *(char*) p; break; + case NeutrinoMessages::RECORD_START : + *msg = NeutrinoMessages::RECORD_START; + *data = (unsigned long) p; + dont_delete_p = true; + break; + case NeutrinoMessages::RECORD_STOP : + *msg = NeutrinoMessages::RECORD_STOP; + *data = (unsigned long) p; + dont_delete_p = true; + break; default: printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID ); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 80ae99149..7ac6970c1 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3007,16 +3007,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } #endif //zap to rec channel in standby-mode + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + /* special case for nhttpd: start direct record, if no eventID */ + if (eventinfo->eventID == 0) { + int rec_mode = CRecordManager::getInstance()->GetRecordMode(live_channel_id); + /* start only if not recorded yet */ + if (rec_mode == CRecordManager::RECMODE_OFF || rec_mode == CRecordManager::RECMODE_TSHIFT) + CRecordManager::getInstance()->Record(live_channel_id); + delete[] (unsigned char*) data; + return messages_return::handled | messages_return::cancel_all; + } if(mode == mode_standby){ - CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) zapTo(eventinfo->channel_id); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { - CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data); + CRecordManager::getInstance()->Record(eventinfo); autoshift = CRecordManager::getInstance()->TimeshiftOnly(); } diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 60cb7c53e..43d769619 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -370,17 +370,27 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) } else if (hh->ParamList["record"] == "start") // start record mode { +#if 0 if(hh->ParamList["stopplayback"] == "true") NeutrinoAPI->Zapit->stopPlayBack(); NeutrinoAPI->Sectionsd->setPauseScanning(true); NeutrinoAPI->Zapit->setRecordMode(true); +#endif + CTimerd::RecordingInfo recinfo; + recinfo.eventID = 0; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RECORD_START, CEventServer::INITID_HTTPD, (void *)&recinfo, sizeof(CTimerd::RecordingInfo)); } else if (hh->ParamList["record"] == "stop") // stop record mode { +#if 0 NeutrinoAPI->Zapit->setRecordMode(false); NeutrinoAPI->Sectionsd->setPauseScanning(false); if (!NeutrinoAPI->Zapit->isPlayBackActive()) NeutrinoAPI->Zapit->startPlayBack(); +#endif + CTimerd::RecordingInfo recinfo; + recinfo.eventID = 0; // FIXME must present + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RECORD_STOP, CEventServer::INITID_HTTPD, (void *)&recinfo, sizeof(CTimerd::RecordingInfo)); } hh->SendOk(); } diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 2c4f858d3..52733e5b5 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -136,6 +136,8 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::RECORD_START, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::RECORD_STOP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); pmutex = new OpenThreads::Mutex(OpenThreads::Mutex::MUTEX_RECURSIVE); } From 065559402ca1ba92561fe9eba1456e96155ef76f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 2 Mar 2016 15:07:09 +0300 Subject: [PATCH 188/690] gui/mediaplayer.cpp: disable audio play while movieplayer playback active Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/55fe41a6266a7243c5e7343b913f3c6dd6ab0095 Author: [CST] Focus Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/mediaplayer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 92b64df91..993aab273 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -154,20 +154,20 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) #endif CMenuWidget *moviePlayer = NULL; + bool enabled = !CMoviePlayerGui::getInstance().Playing(); if (usage_mode != MODE_VIDEO) { //audio player neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio : g_settings.easymenu ? CRCInput::RC_green : CRCInput::RC_red; - fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, true, NULL, this, "audioplayer", audio_rc); + fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, enabled, NULL, this, "audioplayer", audio_rc); fw_audio->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); //internet player neutrino_msg_t inet_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_www : g_settings.easymenu ? CRCInput::RC_blue : CRCInput::RC_green; - fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc); + fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, enabled, NULL, this, "inetplayer", inet_rc); fw_inet->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); } - bool enabled = !CMoviePlayerGui::getInstance().Playing(); if (usage_mode == MODE_DEFAULT) { //movieplayer From 33bea60f60084cb1c115b76049ed59ef873c9a2f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 2 Mar 2016 13:41:09 +0100 Subject: [PATCH 189/690] src/nhttpd/yhttpd_core/helper.cpp revert unneeded sie check Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c2fbfd0bbab8f2745e027dc60e8579f2044b21a Author: Jacek Jendrzej Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/nhttpd/yhttpd_core/helper.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 1dabc4db6..ee457860f 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -81,14 +81,7 @@ std::string timeString(time_t time) { //------------------------------------------------------------------------- std::string string_printf(const char *fmt, ...) { va_list arglist; - va_start (arglist, fmt); - int len = vsnprintf (NULL, 0, fmt, arglist); - va_end (arglist); const int bufferlen = 4*1024; - if(len >= bufferlen){ - printf("string_printf: error: buffer overflow : len %i line %i\n",len,__LINE__); - return "error"; - } char buffer[bufferlen] = {0}; va_start(arglist, fmt); vsnprintf(buffer, bufferlen, fmt, arglist); From 600a746cd0a9317759358186e0fd4d111ad2aff4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:28:41 +0100 Subject: [PATCH 190/690] yWeb: enable record start button in boxcontrol Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/efcc0a33452cb58830b1df17ae67e276840757d7 Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - yWeb: enable record start button in boxcontrol --- src/nhttpd/web/Y_Tools_Boxcontrol.yhtm | 2 +- src/nhttpd/web/Y_Version.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index 200ad4064..c1723b6d5 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -50,8 +50,8 @@ function standby(_standby){ - + - + - + diff --git a/src/nhttpd/web/Y_Settings_buttons.yhtm b/src/nhttpd/web/Y_Settings_buttons.yhtm index 52c5bb55e..a9e0f8962 100644 --- a/src/nhttpd/web/Y_Settings_buttons.yhtm +++ b/src/nhttpd/web/Y_Settings_buttons.yhtm @@ -23,43 +23,43 @@ input[type="text"],select { function do_init() { var val = ""; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;0~open=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;bouquetlist_mode;0~open=}"; document.f.bouquetlist_mode.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_down;105~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_bouquet_down;105~cache=}"; document.f.key_bouquet_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_up;106~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_bouquet_up;106~cache=}"; document.f.key_bouquet_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;398~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_addrecord;398~cache=}"; document.f.key_channelList_addrecord.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;400~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_addremind;400~cache=}"; document.f.key_channelList_addremind.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;102~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_cancel;102~cache=}"; document.f.key_channelList_cancel.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;115~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_pagedown;115~cache=}"; document.f.key_channelList_pagedown.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;114~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_pageup;114~cache=}"; document.f.key_channelList_pageup.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_reload;141~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_reload;141~cache=}"; document.f.key_channelList_reload.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_search;399~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_search;399~cache=}"; document.f.key_channelList_search.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_sort;401~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_sort;401~cache=}"; document.f.key_channelList_sort.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_lastchannel;11~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_lastchannel;11~cache=}"; document.f.key_lastchannel.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_down;108~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_quickzap_down;108~cache=}"; document.f.key_quickzap_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_up;103~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_quickzap_up;103~cache=}"; document.f.key_quickzap_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_down;105~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_down;105~cache=}"; document.f.key_subchannel_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;11~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_toggle;11~cache=}"; document.f.key_subchannel_toggle.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_up;106~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_up;106~cache=}"; document.f.key_subchannel_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;-2~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_tvradio_mode;-2~cache=}"; document.f.key_tvradio_mode.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_zaphistory;102~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_zaphistory;102~cache=}"; document.f.key_zaphistory.value = itoKey(val); } function rcsim(_key) diff --git a/src/nhttpd/web/Y_Settings_lcd.yhtm b/src/nhttpd/web/Y_Settings_lcd.yhtm index 8d2ea3e3d..6a57e7a74 100644 --- a/src/nhttpd/web/Y_Settings_lcd.yhtm +++ b/src/nhttpd/web/Y_Settings_lcd.yhtm @@ -13,21 +13,21 @@ function do_init() { var val = ""; - obj_set_radio_value('lcd_power', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_power;1~open=}"); - obj_set_radio_value('lcd_inverse', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_inverse;0~cache=}"); + obj_set_radio_value('lcd_power', "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_power;1~open=}"); + obj_set_radio_value('lcd_inverse', "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_inverse;0~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_time;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_dim_time;0~cache=}"; document.f.lcd_dim_time.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_dim_brightness;0~cache=}"; document.f.lcd_dim_brightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_contrast;15~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_contrast;15~cache=}"; document.f.lcd_contrast.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_brightness;255~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_brightness;255~cache=}"; document.f.lcd_brightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;170~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_standbybrightness;170~cache=}"; document.f.lcd_standbybrightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_epgmode;1~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_epgmode;1~cache=}"; var sel = 0; if(val=="2") sel=1; if(val=="3") sel=2; @@ -36,7 +36,7 @@ function do_init() if(val=="15") sel=5; document.f.lcd_epgmode.selectedIndex = sel; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_show_volume;0~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_show_volume;0~cache=}" document.f.lcd_show_volume.value = val; } diff --git a/src/nhttpd/web/Y_Settings_mount.yhtm b/src/nhttpd/web/Y_Settings_mount.yhtm index 47046bfac..11b8917e6 100644 --- a/src/nhttpd/web/Y_Settings_mount.yhtm +++ b/src/nhttpd/web/Y_Settings_mount.yhtm @@ -4,10 +4,10 @@ // - + - + - + - + - + - + @@ -67,11 +67,11 @@ function do_submit() - + - +
http://box_ip/control/setmode
Radio/TV Mode AbfrageNeutrino Mode Abfrage http://box_ip/control/getmode
-{=comment:disable non-working rec on/off buttons~ +{=comment:disable non-working rec off button~ =} diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 94e4ffaf3..f50d6df12 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.32 -date=14.02.2016 +version=2.9.0.33 +date=03.03.2016 type=Release info=Port CST From f319890c126246f962f5893e75e299834b40fa24 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 3 Mar 2016 09:03:36 +0100 Subject: [PATCH 191/690] CZapitChannel: Add variable 'script' - using scripts for detecting the URL for live streams Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4e87282850e3697ca5c9689ec8d6fb4603b8fae Author: Michael Liebmann Date: 2016-03-03 (Thu, 03 Mar 2016) --- src/zapit/include/zapit/channel.h | 9 ++++++--- src/zapit/src/bouquets.cpp | 3 ++- src/zapit/src/channel.cpp | 12 +++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 25702d659..de156827a 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -120,6 +120,8 @@ class CZapitChannel private: /* channel name */ std::string name; + /* scripts for webtv livestreams */ + std::string script; /* TODO : Enable different unames in different bouquets ( generated bouquetID ? ) */ std::string uname; t_channel_id epg_id; @@ -205,15 +207,16 @@ class CZapitChannel freq_id_t freq; /* constructor, desctructor */ - CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq); - CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq); - CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0); + CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq, const std::string script_name=""); + CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name=""); + CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0, const char* script_name=NULL); ~CZapitChannel(void); /* get methods - read only variables */ t_service_id getServiceId(void) const { return service_id; } t_transport_stream_id getTransportStreamId(void) const { return transport_stream_id; } t_original_network_id getOriginalNetworkId(void) const { return original_network_id; } + std::string getScriptName(void) const { return script; } unsigned char getServiceType(bool real=false); bool isHD(); t_channel_id getChannelID(void) const { return channel_id; } diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index c338db34e..38b1d529b 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -826,6 +826,7 @@ void CBouquetManager::loadWebtv() const char *desc = xmlGetAttribute(l1, "description"); const char *genre = xmlGetAttribute(l1, "genre"); const char *epgid = xmlGetAttribute(l1, "epgid"); + const char *script = xmlGetAttribute(l1, "script"); t_channel_id epg_id = 0; if (epgid) epg_id = strtoull(epgid, NULL, 16); @@ -838,7 +839,7 @@ void CBouquetManager::loadWebtv() } if (title && url) { t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url); - CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id); + CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id, script); CServiceManager::getInstance()->AddChannel(channel); channel->flags = CZapitChannel::UPDATED; if (gbouquet) diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 45c98b476..2c5f28157 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -27,7 +27,7 @@ extern Zapit_config zapitCfg; -CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq) +CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name) { name = p_name; service_id = p_sid; @@ -38,11 +38,12 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_t freq = p_freq; channel_id = CREATE_CHANNEL_ID64; epg_id = channel_id; + script = script_name; Init(); //printf("NEW CHANNEL %s %x\n", name.c_str(), (int) this); } -CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq) +CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name) { name = p_name; channel_id = p_channel_id; @@ -53,11 +54,12 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_ satellitePosition = p_satellite_position; freq = p_freq; epg_id = channel_id; + script = script_name; Init(); } // For WebTV ... -CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid) +CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid, const char* script_name) { if (!p_name || !p_url) return; @@ -73,6 +75,10 @@ CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, cons satellitePosition = 0; freq = 0; epg_id = epgid; + if (script_name) + script = std::string(script_name); + else + script = ""; Init(); } From ed7b2f91e4e8bfd08c6f338c2087ffe48eea9085 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 3 Mar 2016 09:03:46 +0100 Subject: [PATCH 192/690] movieplayer: Use Lua scripts for selecting live stream urls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b4a2856e1cb21a742b2ecb984dfac52a97a27437 Author: Michael Liebmann Date: 2016-03-03 (Thu, 03 Mar 2016) --- data/locale/deutsch.locale | 4 + data/locale/english.locale | 4 + src/gui/Makefile.am | 1 + src/gui/infoviewer_bb.cpp | 28 ++++++ src/gui/movieplayer.cpp | 173 +++++++++++++++++++++++++++++++++-- src/gui/movieplayer.h | 15 ++- src/gui/user_menue.cpp | 16 +++- src/gui/user_menue_setup.cpp | 1 + src/gui/webtv_setup.cpp | 81 +++++++++++++++- src/gui/webtv_setup.h | 12 +++ src/neutrino.cpp | 13 ++- src/neutrino_menue.h | 3 +- src/system/locals.h | 4 + src/system/locals_intern.h | 4 + src/system/settings.h | 5 + 15 files changed, 351 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 07b224a61..bdb6f03fa 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -878,6 +878,10 @@ ledcontroler.off LED1 & LED2 aus ledcontroler.on.all LED1 & LED2 an ledcontroler.on.led1 LED1 an ledcontroler.on.led2 LED2 an +livestream.head Livestreams +livestream.read_data Lese Daten... +livestream.resolution Auflösung +livestream.scriptpath Script Verzeichnis lua.boolparam_deprecated1 Achtung! lua.boolparam_deprecated2 Die Verwendung von Zahl oder String lua.boolparam_deprecated3 für einen Boolean Parameter ist veraltet.\n Bitte nutzen Sie native Bool Werte zB: diff --git a/data/locale/english.locale b/data/locale/english.locale index 63ce34062..84cdea9a5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -878,6 +878,10 @@ ledcontroler.off Led1 & Led2 off ledcontroler.on.all Led1 & Led2 on ledcontroler.on.led1 Led1 on ledcontroler.on.led2 Led2 on +livestream.head Live streams +livestream.read_data Read data... +livestream.resolution Resolution +livestream.scriptpath Script path lua.boolparam_deprecated1 Caution! lua.boolparam_deprecated2 The use of number or string lua.boolparam_deprecated3 for a Boolean parameter is deprecated.\n Please use native bool values eg. diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 73c963593..509a67b5a 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -32,6 +32,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/lib/libupnpclient \ + -I$(top_srcdir)/lib/jsoncpp/include \ @SIGC_CFLAGS@ \ @CURL_CFLAGS@ \ @FREETYPE_CFLAGS@ \ diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 9a68fe310..4910008c6 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -222,6 +222,13 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); +#if 0 + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); + active = true; + break; + } +#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -237,6 +244,13 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); +#if 0 + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); + active = true; + break; + } +#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -252,6 +266,13 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); +#if 1 + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); + active = true; + break; + } +#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -267,6 +288,13 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); +#if 0 + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); + active = true; + break; + } +#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c8ce5df13..64dbe07e1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ #include #include #include +#include #include #include @@ -70,6 +72,7 @@ #include #include #include +#include #include extern cVideo * videoDecoder; @@ -199,6 +202,7 @@ void CMoviePlayerGui::Init(void) blockedFromPlugin = false; m_screensaver = false; m_idletime = time(NULL); + liveStreamList.clear(); } void CMoviePlayerGui::cutNeutrino() @@ -683,7 +687,131 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) pthread_exit(NULL); } -bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan) +bool CMoviePlayerGui::sortStreamList(livestream_info_t info1, livestream_info_t info2) +{ + return (info1.res1 < info2.res1); +} + +bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &file, std::vector &streamList) +{ + CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_LIVESTREAM_READ_DATA)); + box->paint(); + + std::string result_code = ""; + std::string result_string = ""; + + std::vector args; + args.push_back(file); + + CLuaInstance *lua = new CLuaInstance(); + lua->runScript(script.c_str(), &args, &result_code, &result_string); + delete lua; + + if ((result_code != "0") || result_string.empty()) { + if (box != NULL) { + box->hide(); + delete box; + } + return false; + } + + Json::Value root; + Json::Value data; + Json::Reader reader; + bool parsedSuccess = reader.parse(result_string, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + if (box != NULL) { + box->hide(); + delete box; + } + return false; + } + + livestream_info_t info; + for(size_t i = 0; i < root.size(); ++i) { + data = root[i]["url"]; info.url = data.asString(); + data = root[i]["name"]; info.name = data.asString(); + data = root[i]["band"]; info.bandwidth = atoi(data.asString().c_str()); + data = root[i]["res1"]; std::string tmp = data.asString(); info.res1 = atoi(tmp.c_str()); + data = root[i]["res2"]; info.resolution = tmp + "x" + data.asString(); + streamList.push_back(info); + } + + /* sort streamlist */ + std::sort(streamList.begin(), streamList.end(), sortStreamList); + + /* remove duplicate resolutions */ + livestream_info_t *_info; + int res_old = 0; + for (size_t i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (res_old == _info->res1) + streamList.erase(streamList.begin()+i); + res_old = _info->res1; + } + + if (box != NULL) { + box->hide(); + delete box; + } + + return true; +} + +bool CMoviePlayerGui::selectLivestream(std::vector &streamList, int res, livestream_info_t* info) +{ + livestream_info_t* _info; + int _res = res; + +#if 0 + printf("\n"); + for (size_t i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + printf("%d - _info->res1: %4d, _info->res: %9s, _info->bandwidth: %d\n", i, _info->res1, (_info->resolution).c_str(), _info->bandwidth); + } + printf("\n"); +#endif + + bool resIO = false; + while (1) { + size_t i; + for (i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (_info->res1 == _res) { + info->url = _info->url; + info->name = _info->name; + info->resolution = _info->resolution; + info->res1 = _info->res1; + info->bandwidth = _info->bandwidth; + return true; + } + } + /* Required resolution not found, decreasing resolution */ + for (i = streamList.size(); i > 0; --i) { + _info = &(streamList[i-1]); + if (_info->res1 < _res) { + _res = _info->res1; + resIO = true; + break; + } + } + /* Required resolution not found, increasing resolution */ + if (resIO == false) { + for (i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (_info->res1 > _res) { + _res = _info->res1; + break; + } + } + } + } + return false; +} + +bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script) { printf("%s: starting...\n", __func__); static CZapProtection *zp = NULL; @@ -715,6 +843,40 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st } } + static t_channel_id oldChan = 0; + std::string realUrl = file; + std::string _pretty_name = name; + std::string _epgTitle = name; + std::string _script = script; + livestream_info_t info; + if (!_script.empty()) { + if (_script.find("/") == std::string::npos) + _script = g_settings.livestreamScriptPath + "/" + _script; + + size_t pos = _script.find(".lua"); + if ((file_exists(_script.c_str())) && (pos != std::string::npos) && (_script.length()-pos == 4)) { + if ((oldChan != chan) || liveStreamList.empty()) { + liveStreamList.clear(); + if (!luaGetUrl(_script, file, liveStreamList)) + return false; + oldChan = chan; + } + + if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) + return false; + + realUrl = info.url; + if (!info.name.empty()) { + _pretty_name = info.name; + _epgTitle = info.name; + } + if (!info.resolution.empty()) + _epgTitle += (std::string)" (" + info.resolution + ")"; + } + else + return false; + } + OpenThreads::ScopedLock m_lock(mutex); instance_bg->Cleanup(); @@ -724,12 +886,11 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->isWebTV = true; instance_bg->is_file_player = true; instance_bg->isHTTP = true; + instance_bg->file_name = realUrl; + instance_bg->pretty_name = _pretty_name; - instance_bg->file_name = file; - instance_bg->pretty_name = name; - - instance_bg->movie_info.epgTitle = name; - instance_bg->movie_info.epgChannel = file; + instance_bg->movie_info.epgTitle = _epgTitle; + instance_bg->movie_info.epgChannel = realUrl; instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 53621ab9d..49ce48ba5 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -85,6 +85,15 @@ class CMoviePlayerGui : public CMenuTarget enum repeat_mode_enum { REPEAT_OFF = 0, REPEAT_TRACK = 1, REPEAT_ALL = 2 }; private: + typedef struct livestream_info_t + { + std::string url; + std::string name; + std::string resolution; + int res1; + int bandwidth; + } livestream_info_struct_t; + CFrameBuffer * frameBuffer; int m_LastMode; @@ -159,6 +168,7 @@ class CMoviePlayerGui : public CMenuTarget std::string Path_local; int menu_ret; bool autoshot_done; + std::vector liveStreamList; /* playback from bookmark */ static CBookmarkManager * bookmarkmanager; @@ -207,6 +217,9 @@ class CMoviePlayerGui : public CMenuTarget void EnableClockAndMute(bool enable); static void *ShowStartHint(void *arg); static void* bgPlayThread(void *arg); + static bool sortStreamList(livestream_info_t info1, livestream_info_t info2); + bool selectLivestream(std::vector &streamList, int res, livestream_info_t* info); + bool luaGetUrl(const std::string &script, const std::string &file, std::vector &streamList); CMoviePlayerGui(const CMoviePlayerGui&) {}; CMoviePlayerGui(); @@ -227,7 +240,7 @@ class CMoviePlayerGui : public CMenuTarget int timeshift; int file_prozent; void SetFile(std::string &name, std::string &file, std::string info1="", std::string info2="") { pretty_name = name; file_name = file; info_1 = info1; info_2 = info2; } - bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan); + bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script=""); void stopPlayBack(void); void setLastMode(int m) { m_LastMode = m; } void Pause(bool b = true); diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 0b082ff10..a129fc617 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -71,12 +71,14 @@ #include #include #include +#include #include #include #include #include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ @@ -178,7 +180,9 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) else menu->addItem(GenericMenuSeparator); - bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); std::string itemstr_last("1"); @@ -264,6 +268,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) { if (g_RemoteControl->subChannels.empty()) break; + if (_mode_webtv) + break; // NVOD/SubService- Kanal! CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME, NEUTRINO_ICON_VIDEO); if (!subchanselect.getNVODMenu(tmpNVODSelector)) { @@ -430,6 +436,13 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE); break; + case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: + if (!_mode_webtv) + break; + keyhelper.get(&key,&icon); + menu_item = new CMenuDForwarder(LOCALE_LIVESTREAM_RESOLUTION, true, NULL, new CWebTVResolution(), NULL, key, icon); + //menu_item->setHint(xx, yy); + break; case -1: // plugin { int number_of_plugins = g_PluginList->getNumberOfPlugins(); @@ -511,6 +524,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu continue; case SNeutrinoSettings::ITEM_NONE: case SNeutrinoSettings::ITEM_BAR: + case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: continue; case SNeutrinoSettings::ITEM_EPG_MISC: return_title = true; diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 249bcbc76..643e0a2db 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -111,6 +111,7 @@ static keyvals usermenu_items[] = { SNeutrinoSettings::ITEM_HDDMENU, LOCALE_HDD_SETTINGS, usermenu_show }, { SNeutrinoSettings::ITEM_NETSETTINGS, LOCALE_MAINSETTINGS_NETWORK, usermenu_show }, { SNeutrinoSettings::ITEM_SWUPDATE, LOCALE_SERVICEMENU_UPDATE, usermenu_show }, + { SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION,LOCALE_LIVESTREAM_RESOLUTION, usermenu_show }, { SNeutrinoSettings::ITEM_MAX, NONEXISTANT_LOCALE, usermenu_show } }; diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index e5cfe48f0..49a585560 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include #include #include "webtv_setup.h" @@ -41,6 +43,17 @@ CWebTVSetup::CWebTVSetup() changed = false; } +#define LIVESTREAM_RESOLUTION_OPTION_COUNT 6 +const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[LIVESTREAM_RESOLUTION_OPTION_COUNT] = +{ + { 1920, NONEXISTANT_LOCALE, "1920x1080" }, + { 1280, NONEXISTANT_LOCALE, "1280x720" }, + { 854, NONEXISTANT_LOCALE, "854x480" }, + { 640, NONEXISTANT_LOCALE, "640x360" }, + { 426, NONEXISTANT_LOCALE, "426x240" }, + { 128, NONEXISTANT_LOCALE, "128x72" } +}; + #define CWebTVSetupFooterButtonCount 2 static const struct button_label CWebTVSetupFooterButtons[CWebTVSetupFooterButtonCount] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_WEBTV_XML_DEL }, @@ -91,6 +104,11 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey) } return res; } + if (actionKey == "script_path") { + const char *action_str = "ScriptPath"; + chooserDir(g_settings.livestreamScriptPath, false, action_str); + return res; + } if(parent) parent->hide(); @@ -108,10 +126,26 @@ int CWebTVSetup::Show() m->addKey(CRCInput::RC_red, this, "d"); m->addKey(CRCInput::RC_green, this, "a"); - m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_WEBTV_XML); + m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_LIVESTREAM_HEAD); + + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + + CMenuForwarder *mf; + int shortcut = 1; + mf = new CMenuForwarder(LOCALE_LIVESTREAM_SCRIPTPATH, !_mode_webtv, g_settings.livestreamScriptPath, this, "script_path", CRCInput::convertDigitToKey(shortcut++)); + m->addItem(mf); +#if 0 + mf = new CMenuForwarder(LOCALE_LIVESTREAM_RESOLUTION, _mode_webtv, NULL, new CWebTVResolution(), NULL, CRCInput::convertDigitToKey(shortcut++)); + m->addItem(mf); +#endif + + m->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_WEBTV_XML)); + item_offset = m->getItemsCount(); for (std::list::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it) m->addItem(new CMenuForwarder(*it, true, NULL, this, "c")); + m->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount); //Why we need here an extra buttonbar? int res = m->exec(NULL, ""); @@ -131,4 +165,49 @@ int CWebTVSetup::Show() return res; } + +/* ## CWebTVResolution ############################################# */ + +CWebTVResolution::CWebTVResolution() +{ + width = 40; +} + +int CWebTVResolution::exec(CMenuTarget* parent, const std::string& /*actionKey*/) +{ + if (parent) + parent->hide(); + + return Show(); +} + +int CWebTVResolution::Show() +{ + m = new CMenuWidget(LOCALE_WEBTV_HEAD, NEUTRINO_ICON_MOVIEPLAYER, width, MN_WIDGET_ID_LIVESTREAM_RESOLUTION); + m->addIntroItems(LOCALE_LIVESTREAM_HEAD); + + CMenuOptionChooser *mc; + mc = new CMenuOptionChooser(LOCALE_LIVESTREAM_RESOLUTION, &g_settings.livestreamResolution, + LIVESTREAM_RESOLUTION_OPTIONS, LIVESTREAM_RESOLUTION_OPTION_COUNT, + true, NULL, CRCInput::RC_nokey, NULL, true); + m->addItem(mc); + + int oldRes = g_settings.livestreamResolution; + int res = m->exec(NULL, ""); + m->hide(); + delete m; + + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + if (oldRes != g_settings.livestreamResolution && _mode_webtv) { + CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); + if (cc && IS_WEBTV(cc->getChannelID())) { + CMoviePlayerGui::getInstance().stopPlayBack(); + CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName()); + } + } + + return res; +} + // vim:ts=4 diff --git a/src/gui/webtv_setup.h b/src/gui/webtv_setup.h index ed6d4ab96..0a39332bc 100644 --- a/src/gui/webtv_setup.h +++ b/src/gui/webtv_setup.h @@ -40,4 +40,16 @@ class CWebTVSetup : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); int Show(); }; + +class CWebTVResolution : public CMenuTarget +{ + private: + int width; + CMenuWidget *m; + public: + CWebTVResolution(); + int exec(CMenuTarget* parent, const std::string & actionKey); + int Show(); +}; + #endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7ac6970c1..20ab45c24 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -288,7 +288,7 @@ const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] = static SNeutrinoSettings::usermenu_t usermenu_default[] = { { CRCInput::RC_red, "2,3,4,13", "", "red" }, { CRCInput::RC_green, "6", "", "green" }, - { CRCInput::RC_yellow, "7", "", "yellow" }, + { CRCInput::RC_yellow, "7,31", "", "yellow" }, { CRCInput::RC_blue, "12,11,20,21,19,14,29,30,15", "", "blue" }, { CRCInput::RC_play, "9", "", "5" }, { CRCInput::RC_audio, "27", "", "6" }, @@ -906,6 +906,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infoClockBackground = configfile.getInt32("infoClockBackground", 0); g_settings.infoClockSeconds = configfile.getInt32("infoClockSeconds", 1); + g_settings.livestreamResolution = configfile.getInt32("livestreamResolution", 1920); + g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", PLUGINDIR_VAR "/webtv"); + if(erg) configfile.setModifiedFlag(true); return erg; @@ -1342,6 +1345,9 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("infoClockSeconds", g_settings.infoClockSeconds); configfile.setInt32("easymenu", g_settings.easymenu); + configfile.setInt32("livestreamResolution", g_settings.livestreamResolution); + configfile.setString("livestreamScriptPath", g_settings.livestreamScriptPath); + if(strcmp(fname, NEUTRINO_SETTINGS_FILE) || configfile.getModifiedFlag()) configfile.saveConfig(fname); } @@ -2704,7 +2710,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); if (cc && (chid == cc->getChannelID())) { CMoviePlayerGui::getInstance().stopPlayBack(); - if (CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID())) + if (CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName())) delete [] (unsigned char*) data; else g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data); @@ -3293,7 +3299,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); if (cc && IS_WEBTV(cc->getChannelID())) { CMoviePlayerGui::getInstance().stopPlayBack(); - CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID()); + if (!CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName())) + g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data); } } } diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 735c88ee4..bbc976c78 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -113,7 +113,8 @@ enum MN_WIDGET_ID //web tv setup MN_WIDGET_ID_WEBTVSETUP, - + MN_WIDGET_ID_LIVESTREAM_RESOLUTION, + //misc settings MN_WIDGET_ID_MISCSETUP, MN_WIDGET_ID_MISCSETUP_GENERAL, diff --git a/src/system/locals.h b/src/system/locals.h index ebb211634..7ed5c56ee 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -905,6 +905,10 @@ typedef enum LOCALE_LEDCONTROLER_ON_ALL, LOCALE_LEDCONTROLER_ON_LED1, LOCALE_LEDCONTROLER_ON_LED2, + LOCALE_LIVESTREAM_HEAD, + LOCALE_LIVESTREAM_READ_DATA, + LOCALE_LIVESTREAM_RESOLUTION, + LOCALE_LIVESTREAM_SCRIPTPATH, LOCALE_LUA_BOOLPARAM_DEPRECATED1, LOCALE_LUA_BOOLPARAM_DEPRECATED2, LOCALE_LUA_BOOLPARAM_DEPRECATED3, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ec84ab93f..d2fc1f5e2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -905,6 +905,10 @@ const char * locale_real_names[] = "ledcontroler.on.all", "ledcontroler.on.led1", "ledcontroler.on.led2", + "livestream.head", + "livestream.read_data", + "livestream.resolution", + "livestream.scriptpath", "lua.boolparam_deprecated1", "lua.boolparam_deprecated2", "lua.boolparam_deprecated3", diff --git a/src/system/settings.h b/src/system/settings.h index 80a15f3a9..446a69406 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -739,6 +739,9 @@ struct SNeutrinoSettings std::string font_file; std::string ttx_font_file; + int livestreamResolution; + std::string livestreamScriptPath; + // USERMENU typedef enum { @@ -783,6 +786,8 @@ struct SNeutrinoSettings ITEM_NETSETTINGS = 29, ITEM_SWUPDATE = 30, + ITEM_LIVESTREAM_RESOLUTION = 31, + ITEM_MAX // MUST be always the last in the list } USER_ITEM; typedef struct { From 0b5945180ca2a5f12a39e7d1b30b66a62b702686 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Mar 2016 09:03:49 +0100 Subject: [PATCH 193/690] Fix parse json data Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2775e475aee4efda6b0e1164e11b2c84331a5b9a Author: Jacek Jendrzej Date: 2016-03-03 (Thu, 03 Mar 2016) --- src/gui/movieplayer.cpp | 61 +++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 64dbe07e1..88de19dd9 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -716,7 +716,6 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi } Json::Value root; - Json::Value data; Json::Reader reader; bool parsedSuccess = reader.parse(result_string, root, false); if (!parsedSuccess) { @@ -730,15 +729,59 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi } livestream_info_t info; - for(size_t i = 0; i < root.size(); ++i) { - data = root[i]["url"]; info.url = data.asString(); - data = root[i]["name"]; info.name = data.asString(); - data = root[i]["band"]; info.bandwidth = atoi(data.asString().c_str()); - data = root[i]["res1"]; std::string tmp = data.asString(); info.res1 = atoi(tmp.c_str()); - data = root[i]["res2"]; info.resolution = tmp + "x" + data.asString(); - streamList.push_back(info); + std::string tmp; + bool haveurl = false; + if ( !root.isObject() ) { + for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { + info.url=""; info.name=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + tmp = "0"; + Json::Value object_it = *it; + for (Json::Value::iterator iti = object_it.begin(); iti != object_it.end(); iti++) { + std::string name = iti.name(); + if (name=="url") { + info.url = (*iti).asString(); + haveurl = true; + } else if (name=="name") { + info.name = (*iti).asString(); + } else if (name=="band") { + info.bandwidth = atoi((*iti).asString().c_str()); + } else if (name=="res1") { + tmp = (*iti).asString(); + info.res1 = atoi(tmp.c_str()); + } else if (name=="res2") { + info.resolution = tmp + "x" + (*iti).asString(); + } + } + if (haveurl) { + streamList.push_back(info); + } + haveurl = false; + } + } + if (root.isObject()) { + for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { + info.url=""; info.name=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + tmp = "0"; + std::string name = it.name(); + if (name=="url") { + info.url = (*it).asString(); + haveurl = true; + } else if (name=="name") { + info.name = (*it).asString(); + } else if (name=="band") { + info.bandwidth = atoi((*it).asString().c_str()); + } else if (name=="res1") { + tmp = (*it).asString(); + info.res1 = atoi(tmp.c_str()); + } else if (name=="res2") { + info.resolution = tmp + "x" + (*it).asString(); + } + } + if (haveurl) { + streamList.push_back(info); + } + haveurl = false; } - /* sort streamlist */ std::sort(streamList.begin(), streamList.end(), sortStreamList); From f175f117df6187fefca1f73ba937412f84a466b3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:03:52 +0100 Subject: [PATCH 194/690] webtv_setup: auto-determinate LIVESTREAM_RESOLUTION_OPTION_COUNT Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf749f6d473110a4f72bad97c49a97455dbc006c Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - webtv_setup: auto-determinate LIVESTREAM_RESOLUTION_OPTION_COUNT --- src/gui/webtv_setup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index 49a585560..cd8fa5bd8 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -43,8 +43,7 @@ CWebTVSetup::CWebTVSetup() changed = false; } -#define LIVESTREAM_RESOLUTION_OPTION_COUNT 6 -const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[LIVESTREAM_RESOLUTION_OPTION_COUNT] = +const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[] = { { 1920, NONEXISTANT_LOCALE, "1920x1080" }, { 1280, NONEXISTANT_LOCALE, "1280x720" }, @@ -53,6 +52,7 @@ const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[LIVESTREAM_RE { 426, NONEXISTANT_LOCALE, "426x240" }, { 128, NONEXISTANT_LOCALE, "128x72" } }; +#define LIVESTREAM_RESOLUTION_OPTION_COUNT (sizeof(LIVESTREAM_RESOLUTION_OPTIONS)/sizeof(CMenuOptionChooser::keyval_ext)) #define CWebTVSetupFooterButtonCount 2 static const struct button_label CWebTVSetupFooterButtons[CWebTVSetupFooterButtonCount] = { From b3e51013e8a38090827ce4aebc3221736239044b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:03:56 +0100 Subject: [PATCH 195/690] infoviewer_bb: show resolution in livestream mode on color button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/07b1f6f84980e723f1b7d91d83216f29f2894906 Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - infoviewer_bb: show resolution in livestream mode on color button --- src/gui/infoviewer_bb.cpp | 28 ---------------------------- src/gui/user_menue.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 4910008c6..9a68fe310 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -222,13 +222,6 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); -#if 0 - if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { - text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); - active = true; - break; - } -#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -244,13 +237,6 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); -#if 0 - if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { - text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); - active = true; - break; - } -#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -266,13 +252,6 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); -#if 1 - if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { - text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); - active = true; - break; - } -#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) @@ -288,13 +267,6 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); -#if 0 - if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { - text = g_Locale->getText(LOCALE_LIVESTREAM_RESOLUTION); - active = true; - break; - } -#endif if (mode == NeutrinoMessages::mode_ts) { text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index a129fc617..7cd5a19c8 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -525,6 +525,15 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu case SNeutrinoSettings::ITEM_NONE: case SNeutrinoSettings::ITEM_BAR: case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: + if(loc == NONEXISTANT_LOCALE && !text) { + /* TODO + get const char *valname from struct + keyval_ext LIVESTREAM_RESOLUTION_OPTIONS + */ + text = to_string(g_settings.livestreamResolution).c_str(); + } else + return_title = true; + active = true; continue; case SNeutrinoSettings::ITEM_EPG_MISC: return_title = true; From bf4739f7cfea58829901be9844bd8f27307bc7c3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:03:59 +0100 Subject: [PATCH 196/690] user_menu: get resolution value for livestreams Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a9bee721d1b5b11369d419c112ea0ccb0e02042 Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - user_menu: get resolution value for livestreams --- src/gui/user_menue.cpp | 33 ++++++++++++++++++++++++--------- src/gui/webtv_setup.cpp | 10 +++++++++- src/gui/webtv_setup.h | 1 + 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 7cd5a19c8..60e5f6b37 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -79,10 +79,12 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern cVideo * videoDecoder; #if !HAVE_SPARK_HARDWARE extern CCAMMenuHandler * g_CamHandler; #endif @@ -525,15 +527,28 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu case SNeutrinoSettings::ITEM_NONE: case SNeutrinoSettings::ITEM_BAR: case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: - if(loc == NONEXISTANT_LOCALE && !text) { - /* TODO - get const char *valname from struct - keyval_ext LIVESTREAM_RESOLUTION_OPTIONS - */ - text = to_string(g_settings.livestreamResolution).c_str(); - } else - return_title = true; - active = true; + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + if(loc == NONEXISTANT_LOCALE && !text) { + CWebTVResolution webtvres; + text = webtvres.getResolutionValue(); + if (!(videoDecoder->getBlank())) + { + int xres = 0, yres = 0, framerate; + videoDecoder->getPictureInfo(xres, yres, framerate); + if (xres && yres) + { + std::string res = to_string(xres) + "x" + to_string(yres); + if (res.compare(text)) + { + std::string tmp = (string)text + " (" + res + ")"; + text = tmp.c_str(); + } + } + } + } else + return_title = true; + active = true; + } continue; case SNeutrinoSettings::ITEM_EPG_MISC: return_title = true; diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index cd8fa5bd8..9e0edf26f 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -210,4 +210,12 @@ int CWebTVResolution::Show() return res; } -// vim:ts=4 +const char *CWebTVResolution::getResolutionValue() +{ + for (unsigned int i = 0; i < LIVESTREAM_RESOLUTION_OPTION_COUNT; ++i) + { + if (g_settings.livestreamResolution == LIVESTREAM_RESOLUTION_OPTIONS[i].key) + return LIVESTREAM_RESOLUTION_OPTIONS[i].valname; + } + return ""; +} diff --git a/src/gui/webtv_setup.h b/src/gui/webtv_setup.h index 0a39332bc..698719ee8 100644 --- a/src/gui/webtv_setup.h +++ b/src/gui/webtv_setup.h @@ -48,6 +48,7 @@ class CWebTVResolution : public CMenuTarget CMenuWidget *m; public: CWebTVResolution(); + const char *getResolutionValue(); int exec(CMenuTarget* parent, const std::string & actionKey); int Show(); }; From 4bb325c0da30b3b5e35ba72b32516bd4c6bd27c3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:04:02 +0100 Subject: [PATCH 197/690] locale: change default text for yellow button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5b00e979898ffb4dbc012b5818acf78dbefaabb Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - locale: change default text for yellow button --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bdb6f03fa..fc567f46f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2374,7 +2374,7 @@ usermenu.name Name usermenu.title_blue Erweiterungen usermenu.title_green Tonwahl usermenu.title_red EPG -usermenu.title_yellow Bildregie +usermenu.title_yellow Bildoptionen video_mode_ok Video-Einstellungen OK? videomenu.43mode 4:3 Anzeigeverhalten videomenu.analog_auto AUTO diff --git a/data/locale/english.locale b/data/locale/english.locale index 84cdea9a5..fe9592abf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2374,7 +2374,7 @@ usermenu.name Name usermenu.title_blue Features usermenu.title_green Audio usermenu.title_red Event-List -usermenu.title_yellow Subservices +usermenu.title_yellow Video video_mode_ok Is this video mode working ok ? videomenu.43mode 4:3 Content mode videomenu.analog_auto AUTO From e98005c96fe1532562a66706ec2372c56e67effc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:04:05 +0100 Subject: [PATCH 198/690] neutrino: add version_pseudo.h to allow changes ... by comparing old version_pseudo with new one Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/273dc68da5ebf2afcfb0f2b4ffbcade6b19d98d8 Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - neutrino: add version_pseudo.h to allow changes ... by comparing old version_pseudo with new one --- src/neutrino.cpp | 5 +++++ src/system/settings.h | 2 ++ version_pseudo.h | 1 + 3 files changed, 8 insertions(+) create mode 100644 version_pseudo.h diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 20ab45c24..028df3ea3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -47,6 +47,7 @@ #include "global.h" #include "neutrino.h" +#include "version_pseudo.h" #include @@ -909,6 +910,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.livestreamResolution = configfile.getInt32("livestreamResolution", 1920); g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", PLUGINDIR_VAR "/webtv"); + g_settings.version_pseudo = configfile.getString("version_pseudo", "19700101000000"); + if(erg) configfile.setModifiedFlag(true); return erg; @@ -1348,6 +1351,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("livestreamResolution", g_settings.livestreamResolution); configfile.setString("livestreamScriptPath", g_settings.livestreamScriptPath); + configfile.setString("version_pseudo", g_settings.version_pseudo); + if(strcmp(fname, NEUTRINO_SETTINGS_FILE) || configfile.getModifiedFlag()) configfile.saveConfig(fname); } diff --git a/src/system/settings.h b/src/system/settings.h index 446a69406..1dede46a9 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -137,6 +137,8 @@ struct SNeutrinoTheme struct SNeutrinoSettings { + std::string version_pseudo; + //video int video_Format; int video_Mode; diff --git a/version_pseudo.h b/version_pseudo.h new file mode 100644 index 000000000..3b2ae8143 --- /dev/null +++ b/version_pseudo.h @@ -0,0 +1 @@ +#define NEUTRINO_VERSION_PSEUDO "19700101000000" From 3333d7997e3e916c1253f13e7769cc7771e5cb9f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:04:08 +0100 Subject: [PATCH 199/690] neutrino: add upgradeSetup function ... ... to upgrade neutrino.conf to new defaults if needed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/66258704bfb33985f80a3475072744fb26ae68fd Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - neutrino: add upgradeSetup function ... ... to upgrade neutrino.conf to new defaults if needed --- src/neutrino.cpp | 21 +++++++++++++++++++++ src/neutrino.h | 1 + version_pseudo.h | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 028df3ea3..e5b85fb50 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -912,11 +912,32 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.version_pseudo = configfile.getString("version_pseudo", "19700101000000"); + if (g_settings.version_pseudo < NEUTRINO_VERSION_PSEUDO) + upgradeSetup(fname); + if(erg) configfile.setModifiedFlag(true); return erg; } +void CNeutrinoApp::upgradeSetup(const char * fname) +{ + if (g_settings.version_pseudo < "20160226110000") + { + if (g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items == "7") + { + g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items = "7,31"; + configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items); + } + } + + g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO; + configfile.setString("version_pseudo", g_settings.version_pseudo); + + if (configfile.getModifiedFlag()) + configfile.saveConfig(fname); +} + /************************************************************************************** * CNeutrinoApp - saveSetup, save the application-settings * **************************************************************************************/ diff --git a/src/neutrino.h b/src/neutrino.h index d65f6760c..17508a1f2 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -162,6 +162,7 @@ public: void saveSetup(const char * fname); int loadSetup(const char * fname); + void upgradeSetup(const char * fname); void loadKeys(const char * fname = NULL); void saveKeys(const char * fname = NULL); void SetupTiming(); diff --git a/version_pseudo.h b/version_pseudo.h index 3b2ae8143..56e5e0b75 100644 --- a/version_pseudo.h +++ b/version_pseudo.h @@ -1 +1 @@ -#define NEUTRINO_VERSION_PSEUDO "19700101000000" +#define NEUTRINO_VERSION_PSEUDO "20160226110000" From 163dab2f58b817c04eec6f80bdd76febd66a7b0e Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 3 Mar 2016 09:04:11 +0100 Subject: [PATCH 200/690] Display of livestream infos in IV if no EPG data available Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb1826ebee95521af8485ed10d4209e1c5653ff6 Author: Michael Liebmann Date: 2016-03-03 (Thu, 03 Mar 2016) --- src/gui/infoviewer.cpp | 75 ++++++++++++++++++++++++++++++++++++++++- src/gui/infoviewer.h | 4 +++ src/gui/movieplayer.cpp | 45 ++++++++++++++++++++----- src/gui/movieplayer.h | 4 +++ 4 files changed, 118 insertions(+), 10 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 2b5148b81..d18b55e33 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -162,6 +162,9 @@ void CInfoViewer::Init() rt_x = rt_y = rt_h = rt_w = 0; infobar_txt = NULL; + + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); } /* @@ -533,7 +536,11 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) loc = LOCALE_INFOVIEWER_EPGWAIT; else loc = LOCALE_INFOVIEWER_EPGNOTLOAD; - display_Info(g_Locale->getText(loc), NULL); + + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); + if (!showLivestreamInfo()) + display_Info(g_Locale->getText(loc), NULL); } else { show_Data (); } @@ -924,6 +931,66 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) break; } } + +bool CInfoViewer::showLivestreamInfo() +{ + CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); + if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv && + cc->getEpgID() == 0 && !cc->getScriptName().empty()) { + std::string livestreamInfo1 = ""; + std::string livestreamInfo2 = ""; + std::string tmp1 = ""; + CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1); + + if (!(videoDecoder->getBlank())) { + int xres, yres, framerate; + std::string tmp2; + videoDecoder->getPictureInfo(xres, yres, framerate); + switch (framerate) { + case 0: + tmp2 = "23.976fps"; + break; + case 1: + tmp2 = "24fps"; + break; + case 2: + tmp2 = "25fps"; + break; + case 3: + tmp2 = "29,976fps"; + break; + case 4: + tmp2 = "30fps"; + break; + case 5: + tmp2 = "50fps"; + break; + case 6: + tmp2 = "50,94fps"; + break; + case 7: + tmp2 = "60fps"; + break; + default: + tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN); + break; + } + livestreamInfo2 = to_string(xres) + "x" + to_string(yres) + ", " + tmp2; + if (!tmp1.empty()) + livestreamInfo2 += (std::string)", " + tmp1; + } + + if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) { + display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str()); + _livestreamInfo1 = livestreamInfo1; + _livestreamInfo2 = livestreamInfo2; + infoViewerBB->showBBButtons(true /*paintFooter*/); + } + return true; + } + return false; +} + void CInfoViewer::loop(bool show_dot) { bool hideIt = true; @@ -939,9 +1006,14 @@ void CInfoViewer::loop(bool show_dot) if (isVolscale) CVolume::getInstance()->showVolscale(); + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); + while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); + showLivestreamInfo(); + #ifdef ENABLE_PIP if ((msg == (neutrino_msg_t) g_settings.key_pip_close) || (msg == (neutrino_msg_t) g_settings.key_pip_setup) || @@ -1418,6 +1490,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) if ((*(t_channel_id *) data) == current_channel_id) { if (is_visible && showButtonBar) { infoViewerBB->showIcon_DD(); + showLivestreamInfo(); infoViewerBB->showBBButtons(true /*paintFooter*/); // in case button text has changed } if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index e32ca4b94..44465c389 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -112,6 +112,8 @@ class CInfoViewer bool channellogoChange; uint32_t lcdUpdateTimer; int zap_mode; + std::string _livestreamInfo1; + std::string _livestreamInfo2; void paintBackground(int col_Numbox); void paintHead(); @@ -146,6 +148,8 @@ class CInfoViewer void reset_allScala(); void check_channellogo_ca_SettingsChange(); void sendNoEpg(const t_channel_id channel_id); + bool showLivestreamInfo(); + public: bool chanready; bool is_visible; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 88de19dd9..da809484a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -203,6 +203,8 @@ void CMoviePlayerGui::Init(void) m_screensaver = false; m_idletime = time(NULL); liveStreamList.clear(); + livestreamInfo1.clear(); + livestreamInfo2.clear(); } void CMoviePlayerGui::cutNeutrino() @@ -887,10 +889,9 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st } static t_channel_id oldChan = 0; - std::string realUrl = file; + std::string realUrl = file; + std::string _script = script; std::string _pretty_name = name; - std::string _epgTitle = name; - std::string _script = script; livestream_info_t info; if (!_script.empty()) { if (_script.find("/") == std::string::npos) @@ -900,24 +901,48 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st if ((file_exists(_script.c_str())) && (pos != std::string::npos) && (_script.length()-pos == 4)) { if ((oldChan != chan) || liveStreamList.empty()) { liveStreamList.clear(); - if (!luaGetUrl(_script, file, liveStreamList)) + if (!luaGetUrl(_script, file, liveStreamList)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] lua script error\n", __file__, __func__, __LINE__); return false; + } oldChan = chan; } - if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) + if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] error selectLivestream\n", __file__, __func__, __LINE__); return false; + } realUrl = info.url; if (!info.name.empty()) { + livestreamInfo1 = info.name; _pretty_name = info.name; - _epgTitle = info.name; } +#if 0 if (!info.resolution.empty()) - _epgTitle += (std::string)" (" + info.resolution + ")"; + livestreamInfo2 = info.resolution; + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + livestreamInfo2 += (std::string)", " + (std::string)buf; + } +#else + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + livestreamInfo2 = (std::string)buf; + } +#endif } - else + else { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] script error\n", __file__, __func__, __LINE__); return false; + } } OpenThreads::ScopedLock m_lock(mutex); @@ -932,7 +957,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->file_name = realUrl; instance_bg->pretty_name = _pretty_name; - instance_bg->movie_info.epgTitle = _epgTitle; + instance_bg->movie_info.epgTitle = name; instance_bg->movie_info.epgChannel = realUrl; instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; @@ -959,6 +984,8 @@ void CMoviePlayerGui::stopPlayBack(void) pthread_join(bgThread, NULL); bgThread = 0; } + livestreamInfo1.clear(); + livestreamInfo2.clear(); printf("%s: stopped\n", __func__); } diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 49ce48ba5..1c9d55f2a 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -94,6 +94,9 @@ class CMoviePlayerGui : public CMenuTarget int bandwidth; } livestream_info_struct_t; + std::string livestreamInfo1; + std::string livestreamInfo2; + CFrameBuffer * frameBuffer; int m_LastMode; @@ -257,6 +260,7 @@ class CMoviePlayerGui : public CMenuTarget void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; }; bool getBlockedFromPlugin() { return blockedFromPlugin; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; + void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; }; }; #endif From 7e72618001b24771bcac35e0f386f2417435531a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 3 Mar 2016 09:04:14 +0100 Subject: [PATCH 201/690] infoviewer: we don't have starttimes in livestream mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a12d3ef8d62cc0dbee3f3c889c8198b748ac52d Author: vanhofen Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - infoviewer: we don't have starttimes in livestream mode --- src/gui/infoviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index d18b55e33..0636a5eba 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -981,7 +981,7 @@ bool CInfoViewer::showLivestreamInfo() } if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) { - display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str()); + display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false); _livestreamInfo1 = livestreamInfo1; _livestreamInfo2 = livestreamInfo2; infoViewerBB->showBBButtons(true /*paintFooter*/); @@ -1770,7 +1770,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, txt_cur_event->hide(); txt_cur_event->paint(CC_SAVE_SCREEN_YES); - if (runningStart){ + if (runningStart && starttimes){ if (txt_cur_start == NULL) txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height); else @@ -1805,7 +1805,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, txt_next_event->hide(); txt_next_event->paint(CC_SAVE_SCREEN_YES); - if (nextStart){ + if (nextStart && starttimes){ if (txt_next_start == NULL) txt_next_start = new CComponentsTextTransp(NULL, InfoX, NextInfoY, info_time_width, height); else From 3204a2f038d4d0cab5fd75ec0df476aee4b3a925 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Mar 2016 08:12:04 +0100 Subject: [PATCH 202/690] COPKGManager: generate a readable string for installation time Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33135a5bc55f5ea88220bce009cc8a5dfc87f30e Author: Thilo Graf Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/opkg_manager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 4afbe1df4..91e6320ef 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -174,6 +174,16 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) //show package info... bool is_installed = pkg_vec[selected]->installed; string infostr = getPkgInfo(pkg_vec[selected]->name, "", is_installed /*status or info*/); + + //if available, generate a readable string for installation time + if (is_installed){ + string tstr = getPkgInfo(pkg_vec[selected]->name, "Installed-Time", is_installed); + stringstream sstr(tstr); + time_t tval; sstr >> tval; + string newstr = asctime(localtime(&tval)); + infostr = str_replace(tstr, newstr, infostr); + } + DisplayInfoMessage(infostr.c_str()); return res; } From 39c87f723bef0a77245671f7972a541eec31afed Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Mar 2016 09:10:15 +0100 Subject: [PATCH 203/690] CNeutrinoApp: add signal OnAfterSetupFonts This allows to implement methodes already inside classes without any additional external var constructions. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a87d16f62aad1950419694dedc9476f0db7afc46 Author: Thilo Graf Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/neutrino.cpp | 1 + src/neutrino.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e5b85fb50..a31dcdb47 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1742,6 +1742,7 @@ void CNeutrinoApp::SetupFonts(int fmode) /* recalculate infobar position */ if (g_InfoViewer) g_InfoViewer->start(); + OnAfterSetupFonts(); } /************************************************************************************** diff --git a/src/neutrino.h b/src/neutrino.h index 17508a1f2..d37880b3d 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -239,6 +239,7 @@ public: void screensaver(bool); //signal/event handler before restart of neutrino gui sigc::signal OnBeforeRestart; + sigc::signal OnAfterSetupFonts; void channelRezap(); }; #endif From ea239c54cfa379ea266a25c02883ddbfee8ebc6d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 25 Feb 2016 22:23:39 +0100 Subject: [PATCH 204/690] CUpnpBrowserGui: rework broken detail info - apply current dline functionality - use footer class to paint footer, So footer is usable as object. - use infobox to show content and time info Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3a19f4d8ff7cb668a93025b9b9d870efcee70fc Author: Thilo Graf Date: 2016-02-25 (Thu, 25 Feb 2016) --- src/gui/upnpbrowser.cpp | 122 +++++++++++++++++++--------------------- src/gui/upnpbrowser.h | 2 + 2 files changed, 59 insertions(+), 65 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 598ebe0af..f34234593 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -43,10 +43,7 @@ #include #include #include - #include -#include -#include #include #include #include @@ -72,13 +69,28 @@ CUpnpBrowserGui::CUpnpBrowserGui() m_socket = new CUPnPSocket(); m_frameBuffer = CFrameBuffer::getInstance(); m_playing_entry_is_shown = false; + ibox.enableFrame(true, 2); + ibox.setCorner(RADIUS_LARGE); + ibox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + + timebox.enableFrame(true, 2); + timebox.setCorner(RADIUS_LARGE); + timebox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + dline = NULL; } CUpnpBrowserGui::~CUpnpBrowserGui() { delete m_socket; - delete dline; + if (dline){ + delete dline; + dline = NULL; + } } int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/) @@ -102,7 +114,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ m_height = m_frameBuffer->getScreenHeightRel(); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - m_buttonHeight = std::min(25, m_sheight); + m_buttonHeight = std::max(footer.getHeight(), m_sheight); m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); @@ -952,10 +964,7 @@ void CUpnpBrowserGui::paintDevices() // Foot top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - - m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); -// m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_0); - ::paintButtons(m_x, top, 0, 1, &RescanButton, m_width, m_buttonHeight); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2); paintItem2DetailsLine (-1); // clear it } @@ -1137,99 +1146,82 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, // Foot buttons top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(m_x, top, 0, 4, BrowseButtons, m_width, m_buttonHeight); + size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons); } void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) { // Foot info - int top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; - int text_start = m_x + 10; -printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); - if ((!use_playing) && entry->isdir) - { - m_frameBuffer->paintBackgroundBoxRel(m_x+2, top + 2, m_width-4, 2 * m_buttonHeight+8); + int i_height = 2 * m_buttonHeight; + ibox.setDimensionsAll(m_x, footer.getYPos()+ footer.getHeight()+2, m_width-i_height-SHADOW_OFFSET, i_height); + timebox.setDimensionsAll(m_x + m_width - i_height, footer.getYPos()+ footer.getHeight()+2, i_height, i_height); + + printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); + if ((!use_playing) && entry->isdir){ + ibox.kill(); m_playing_entry_is_shown = false; - } - else - { - int ih = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); - //m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - if (use_playing) - { - if (!m_playing_entry_is_shown) - { + }else{ + string text = ""; + if (use_playing){ + if (!m_playing_entry_is_shown){ m_playing_entry_is_shown = true; - m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 1 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.title + " - " + - m_playing_entry.artist, COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK_TEXT); + text = m_playing_entry.title; + text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : ""; + text += "\n" + m_playing_entry.album; + ibox.setText(text, CTextBox::AUTO_WIDTH); + ibox.paint0(); } - } - else - { - if (entry == NULL) return; + }else{ + if (!entry) + return; m_playing_entry_is_shown = false; - m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 1 * m_buttonHeight + 4, m_x + m_width - 8, entry->title + " - " + - entry->artist, COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, entry->album, COL_MENUCONTENTDARK_TEXT); + text = entry->title; + text += !entry->artist.empty() ? " - " + entry->artist : ""; + text += "\n" + entry->album; + ibox.setText(text, CTextBox::AUTO_WIDTH); + ibox.paint0(); } + timebox.paint0(); } } void CUpnpBrowserGui::paintItem2DetailsLine (int pos) { - if (dline) { - dline->kill(); - delete dline; - dline = NULL; - } - if (pos < 0) return; int xpos = m_x - ConnectLineBox_Width; int ypos1 = m_y + m_title_height+0 + m_theight + pos*m_fheight; - int ypos2 = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; + int ypos2 = ibox.getYPos()+ ibox.getHeight()-ibox.getHeight()/2; int ypos1a = ypos1 + (m_fheight/2); - int ypos2a = ypos2 + (m_info_height/2)-4; - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_info_height-RADIUS_LARGE*2); - dline->paint(CC_SAVE_SCREEN_NO); + if (!dline) + dline = new CComponentsDetailLine(); + dline->setDimensionsAll(xpos, ypos1a, ypos2, m_fheight/2, ibox.getHeight()-RADIUS_LARGE*3); + dline->paint(); } void CUpnpBrowserGui::updateTimes(const bool force) { - int top; - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - { + if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP){ bool updatePlayed = force; - if ((m_time_played != CAudioPlayer::getInstance()->getTimePlayed())) - { + if ((m_time_played != CAudioPlayer::getInstance()->getTimePlayed())){ m_time_played = CAudioPlayer::getInstance()->getTimePlayed(); updatePlayed = true; } -printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); + printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); char play_time[8]; snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60); char tmp_time[] = "000:00"; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(tmp_time); + int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); - if (updatePlayed) - { - paintDetails(NULL, true); - top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + m_buttonHeight + 4; - m_frameBuffer->paintBoxRel(m_x + m_width - w - 15, top + 1, w + 4, m_buttonHeight, COL_MENUCONTENTDARK_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + m_width - w - 11, top + 1 + m_buttonHeight, w, play_time, COL_MENUCONTENTDARK_TEXT); + if (updatePlayed){ + timebox.setText(play_time, CTextBox::CENTER); + timebox.paint0(); } } } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 940122d6a..c5f14a2cb 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -102,6 +102,8 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers bool m_playing_entry_is_shown; time_t timeout; CComponentsDetailLine * dline; + CComponentsFooter footer; + CComponentsInfoBox ibox, timebox; bool discoverDevices(); void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); From 84774b7ab21bac92a5cfe3733cb52a594bbaec01 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 26 Feb 2016 14:56:38 +0100 Subject: [PATCH 205/690] CUpnpBrowserGui: rework top box arrangement Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2db623a445590bb651f45eaf8fc71fb593b236af Author: Thilo Graf Date: 2016-02-26 (Fri, 26 Feb 2016) --- src/gui/upnpbrowser.cpp | 129 +++++++++++++++++++++++----------------- src/gui/upnpbrowser.h | 2 +- 2 files changed, 74 insertions(+), 57 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index f34234593..9aecd2f93 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -69,15 +69,22 @@ CUpnpBrowserGui::CUpnpBrowserGui() m_socket = new CUPnPSocket(); m_frameBuffer = CFrameBuffer::getInstance(); m_playing_entry_is_shown = false; + + topbox.enableFrame(true, 2); + topbox.setCorner(RADIUS_LARGE); + topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); + topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); + topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Head_gradient_direction); + ibox.enableFrame(true, 2); ibox.setCorner(RADIUS_LARGE); - ibox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + ibox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); - timebox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); @@ -864,39 +871,44 @@ bool CUpnpBrowserGui::selectItem(std::string id) void CUpnpBrowserGui::paintDeviceInfo() { std::string tmp; - int w, xstart; +// int w, xstart; CVFD::getInstance()->showMenuText(0, m_devices[m_selecteddevice].friendlyname.c_str(), -1, true); + + topbox.setDimensionsAll(m_x, m_y, m_width, m_title_height-10); +// topbox.paint0(); // Info - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); - m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); +// m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); +// m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); // first line tmp = m_devices[m_selecteddevice].manufacturer + " " + - m_devices[m_selecteddevice].manufacturerurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + m_devices[m_selecteddevice].manufacturerurl + "\n"; +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); // second line - tmp = m_devices[m_selecteddevice].modelname + " " + + tmp += m_devices[m_selecteddevice].modelname + " " + m_devices[m_selecteddevice].modelnumber + " " + - m_devices[m_selecteddevice].modeldescription; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + m_devices[m_selecteddevice].modeldescription + "\n"; +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); // third line - tmp = m_devices[m_selecteddevice].modelurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + tmp += m_devices[m_selecteddevice].modelurl; +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); + topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.paint0(); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) @@ -1052,8 +1064,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) CVFD::getInstance()->showMenuText(0, entry->title.c_str(), -1, true); // Info - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); - m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); +// m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); +// m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); // first line ts << "Resources: " << entry->resources.size() << " Selected: " << preferred+1 << " "; @@ -1063,52 +1075,59 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) tmp = tmp + "Duration: " + entry->resources[preferred].duration; else tmp = tmp + "No resource for Item"; + tmp += "\n"; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); // second line if (entry->isdir) - tmp = "Directory"; + tmp += "Directory"; else { - tmp = ""; + tmp += ""; if (preferred != -1) - tmp = "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; + tmp += "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; } - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + tmp += "\n"; +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); //third line - tmp = ""; +// tmp += ""; if (!entry->isdir && preferred != -1) - tmp = "URL: " + entry->resources[preferred].url; + tmp += "URL: " + entry->resources[preferred].url; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); +// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); +// w = std::min(w, m_width - 20); +// xstart = (m_width - w) / 2; +// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, +// tmp, COL_MENUCONTENTSELECTED_TEXT); + +#if 0 static std::string lastname = "", tmpname = ""; if(!entry->albumArtURI.empty()){ static int flogo_w = 0, flogo_h = 0; if(lastname != entry->albumArtURI){ tmpname = lastname = entry->albumArtURI.c_str(); tmpname = g_PicViewer->DownloadImage(tmpname ); - flogo_w = 0, flogo_h = 0; - g_PicViewer->getSize(tmpname.c_str(), &flogo_w, &flogo_h); - if((flogo_h > m_title_height-14) || (m_title_height*2 > flogo_h)){ - g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, m_title_height*2, m_title_height-14); - } +// flogo_w = 0, flogo_h = 0; +// g_PicViewer->getSize(tmpname.c_str(), &flogo_w, &flogo_h); +// if((flogo_h > m_title_height-14) || (m_title_height*2 > flogo_h)){ +// g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, m_title_height*2, m_title_height-14); +// } } - g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h); + //g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h); } +#endif + topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.paint0(); } void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset) @@ -1154,8 +1173,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) { // Foot info int i_height = 2 * m_buttonHeight; - ibox.setDimensionsAll(m_x, footer.getYPos()+ footer.getHeight()+2, m_width-i_height-SHADOW_OFFSET, i_height); - timebox.setDimensionsAll(m_x + m_width - i_height, footer.getYPos()+ footer.getHeight()+2, i_height, i_height); + ibox.setDimensionsAll(m_x, footer.getYPos()+ footer.getHeight()+SHADOW_OFFSET, m_width-i_height-SHADOW_OFFSET, i_height); + timebox.setDimensionsAll(m_x + m_width - i_height, ibox.getYPos(), i_height, i_height); printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); if ((!use_playing) && entry->isdir){ @@ -1216,8 +1235,6 @@ void CUpnpBrowserGui::updateTimes(const bool force) printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); char play_time[8]; snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60); - char tmp_time[] = "000:00"; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); if (updatePlayed){ timebox.setText(play_time, CTextBox::CENTER); diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index c5f14a2cb..ff8d68a5e 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -103,7 +103,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers time_t timeout; CComponentsDetailLine * dline; CComponentsFooter footer; - CComponentsInfoBox ibox, timebox; + CComponentsInfoBox ibox, timebox, topbox; bool discoverDevices(); void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); From 9e97aa923ee6d059afce8980c38b7c5551fb7e59 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 26 Feb 2016 16:22:35 +0100 Subject: [PATCH 206/690] CUpnpBrowserGui: rework image view Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64513ec10dc230630d3534f20956fb6660c4daf7 Author: Thilo Graf Date: 2016-02-26 (Fri, 26 Feb 2016) --- src/gui/upnpbrowser.cpp | 80 +++++++++++++---------------------------- src/gui/upnpbrowser.h | 1 + 2 files changed, 26 insertions(+), 55 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 9aecd2f93..a5353c218 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -89,15 +89,17 @@ CUpnpBrowserGui::CUpnpBrowserGui() timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); dline = NULL; + image = NULL; } CUpnpBrowserGui::~CUpnpBrowserGui() { delete m_socket; if (dline){ - delete dline; - dline = NULL; + delete dline; dline = NULL; } + if (image) + delete image, image = NULL; } int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/) @@ -870,43 +872,24 @@ bool CUpnpBrowserGui::selectItem(std::string id) void CUpnpBrowserGui::paintDeviceInfo() { - std::string tmp; -// int w, xstart; - CVFD::getInstance()->showMenuText(0, m_devices[m_selecteddevice].friendlyname.c_str(), -1, true); - - topbox.setDimensionsAll(m_x, m_y, m_width, m_title_height-10); -// topbox.paint0(); // Info -// m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); -// m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); + std::string tmp; // first line tmp = m_devices[m_selecteddevice].manufacturer + " " + m_devices[m_selecteddevice].manufacturerurl + "\n"; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); // second line tmp += m_devices[m_selecteddevice].modelname + " " + m_devices[m_selecteddevice].modelnumber + " " + m_devices[m_selecteddevice].modeldescription + "\n"; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); + // third line tmp += m_devices[m_selecteddevice].modelurl; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); + + topbox.setDimensionsAll(m_x, m_y, m_width, m_title_height-10); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -1063,10 +1046,6 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) // LCD CVFD::getInstance()->showMenuText(0, entry->title.c_str(), -1, true); - // Info -// m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); -// m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); - // first line ts << "Resources: " << entry->resources.size() << " Selected: " << preferred+1 << " "; tmp = ts.str(); @@ -1077,12 +1056,6 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) tmp = tmp + "No resource for Item"; tmp += "\n"; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); - // second line if (entry->isdir) tmp += "Directory"; @@ -1093,39 +1066,34 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) tmp += "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; } tmp += "\n"; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); //third line // tmp += ""; if (!entry->isdir && preferred != -1) tmp += "URL: " + entry->resources[preferred].url; -// w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); -// w = std::min(w, m_width - 20); -// xstart = (m_width - w) / 2; -// g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, -// tmp, COL_MENUCONTENTSELECTED_TEXT); - -#if 0 static std::string lastname = "", tmpname = ""; if(!entry->albumArtURI.empty()){ static int flogo_w = 0, flogo_h = 0; if(lastname != entry->albumArtURI){ tmpname = lastname = entry->albumArtURI.c_str(); - tmpname = g_PicViewer->DownloadImage(tmpname ); -// flogo_w = 0, flogo_h = 0; -// g_PicViewer->getSize(tmpname.c_str(), &flogo_w, &flogo_h); -// if((flogo_h > m_title_height-14) || (m_title_height*2 > flogo_h)){ -// g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, m_title_height*2, m_title_height-14); -// } + tmpname = g_PicViewer->DownloadImage(tmpname); + int h_image = ibox.getHeight()- SHADOW_OFFSET - ibox.getCornerRadius(); + int y_image = ibox.getYPos() + ibox.getHeight()/2 - h_image/2; + if (!image){ + image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0); + } + image->setPicture(tmpname); + image->setHeight(h_image, true); + int x_image = ibox.getXPos() + ibox.getWidth()- image->getWidth()- SHADOW_OFFSET - ibox.getCornerRadius(); + image->setXPos(x_image); + } + }else{ + if (image){ + delete image; image = NULL; } - //g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h); } -#endif + topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -1200,6 +1168,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text += "\n" + entry->album; ibox.setText(text, CTextBox::AUTO_WIDTH); ibox.paint0(); + if (image) + image->paint0(); } timebox.paint0(); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index ff8d68a5e..208765e9d 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -104,6 +104,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers CComponentsDetailLine * dline; CComponentsFooter footer; CComponentsInfoBox ibox, timebox, topbox; + CComponentsPicture *image; bool discoverDevices(); void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); From 949df8ae4a233019a06c4904f68608bad2a1f06a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 26 Feb 2016 19:18:48 +0100 Subject: [PATCH 207/690] CUpnpBrowserGui: sort buttons related to remote control Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0897b2ac64477a12f1cb5143e8f962c94eaac0ec Author: Thilo Graf Date: 2016-02-26 (Fri, 26 Feb 2016) --- src/gui/upnpbrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a5353c218..0903252f0 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -58,9 +58,9 @@ extern CPictureViewer * g_PicViewer; const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN}; const struct button_label BrowseButtons[4] = { - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP }, { NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_FILEBROWSER_PREVPAGE }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP }, { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY } }; From 9ef6e5b89e8666b4a09fa91d387c4cb0c26d4f33 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 26 Feb 2016 19:29:14 +0100 Subject: [PATCH 208/690] CUpnpBrowserGui: add missing exit button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e8ddae2a5b38a778f41d65f384b47e209e062d7 Author: Thilo Graf Date: 2016-02-26 (Fri, 26 Feb 2016) --- src/gui/upnpbrowser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 0903252f0..2a8570393 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -56,12 +56,13 @@ extern cVideo * videoDecoder; extern CPictureViewer * g_PicViewer; const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN}; -const struct button_label BrowseButtons[4] = +const struct button_label BrowseButtons[] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_FILEBROWSER_PREVPAGE }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP }, - { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY } + { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, + { NEUTRINO_ICON_BUTTON_HOME , LOCALE_MENU_BACK, } }; CUpnpBrowserGui::CUpnpBrowserGui() From 85c5f448078220e1111ebcb3b871fbb5d279c15a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Mar 2016 09:13:07 +0100 Subject: [PATCH 209/690] CUpnpBrowserGui: update license text Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a9ad49430f1d5f6db22d4152ecbbe19cdd9f4f5e Author: Thilo Graf Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/upnpbrowser.cpp | 4 ++-- src/gui/upnpbrowser.h | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 2a8570393..08d786fb8 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -3,6 +3,7 @@ UPnP Browser (c) 2007 by Jochen Friedrich (c) 2009-2011,2016 Stefan Seyfried + (c) 2016 Thilo Graf License: GPL @@ -17,8 +18,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 208765e9d..02e2ea08d 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -4,14 +4,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - License: GPL This program is free software; you can redistribute it and/or modify @@ -25,8 +17,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef __upnpplayergui__ From 42d0617e2b2e19d8050426358579706d281cf981 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 Feb 2016 20:06:48 +0100 Subject: [PATCH 210/690] CUpnpBrowserGui: move module init into own member Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f55f6fcbdf249c7acc7b2b305f244e27dc0a3654 Author: Thilo Graf Date: 2016-02-27 (Sat, 27 Feb 2016) --- src/gui/upnpbrowser.cpp | 13 +++++++++---- src/gui/upnpbrowser.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 08d786fb8..586305a57 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -70,7 +70,15 @@ CUpnpBrowserGui::CUpnpBrowserGui() m_socket = new CUPnPSocket(); m_frameBuffer = CFrameBuffer::getInstance(); m_playing_entry_is_shown = false; - + + initModules(); + + dline = NULL; + image = NULL; +} + +void CUpnpBrowserGui::initModules() +{ topbox.enableFrame(true, 2); topbox.setCorner(RADIUS_LARGE); topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); @@ -88,9 +96,6 @@ CUpnpBrowserGui::CUpnpBrowserGui() timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); - - dline = NULL; - image = NULL; } CUpnpBrowserGui::~CUpnpBrowserGui() diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 02e2ea08d..4df99a780 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -101,7 +101,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); bool getResults(std::string id, unsigned int start, unsigned int count, std::list &results); std::vector *decodeResult(std::string); - + void initModules(); void updateDeviceSelection(int newpos); void selectDevice(); void paintDevices(); From 04bc6633e8ca173ca4d8228369130a6a8ebedbfa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 Feb 2016 11:37:08 +0100 Subject: [PATCH 211/690] CUpnpBrowserGui: do intit screen properties already on changed settings on runtime Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b297c57a31b93f660cb2b2c2cf5a6f4430762670 Author: Thilo Graf Date: 2016-02-29 (Mon, 29 Feb 2016) --- src/gui/upnpbrowser.cpp | 51 ++++++++++++++++++++++++----------------- src/gui/upnpbrowser.h | 2 +- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 586305a57..7bcf16280 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -71,13 +71,17 @@ CUpnpBrowserGui::CUpnpBrowserGui() m_frameBuffer = CFrameBuffer::getInstance(); m_playing_entry_is_shown = false; - initModules(); + Init(); dline = NULL; image = NULL; + + sigc::slot0 reinit = sigc::mem_fun(this, &CUpnpBrowserGui::Init); + CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit); + CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit); } -void CUpnpBrowserGui::initModules() +void CUpnpBrowserGui::Init() { topbox.enableFrame(true, 2); topbox.setCorner(RADIUS_LARGE); @@ -96,6 +100,27 @@ void CUpnpBrowserGui::initModules() timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + + m_width = m_frameBuffer->getScreenWidthRel(); + m_height = m_frameBuffer->getScreenHeightRel(); + + m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + m_buttonHeight = m_theight; + m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); + m_title_height = m_mheight*2 + 20 + m_sheight + 4; + m_info_height = m_mheight*2; + m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); + m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height + + footer.setColorBody(COL_INFOBAR_SHADOW_PLUS_1); + footer.setHeight(m_buttonHeight); + + m_x=getScreenStartX(m_width); + if (m_x < ConnectLineBox_Width) + m_x = ConnectLineBox_Width; + m_y=getScreenStartY(m_height); } CUpnpBrowserGui::~CUpnpBrowserGui() @@ -125,24 +150,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - m_width = m_frameBuffer->getScreenWidthRel(); - m_height = m_frameBuffer->getScreenHeightRel(); - - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - m_buttonHeight = std::max(footer.getHeight(), m_sheight); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); - m_title_height = m_mheight*2 + 20 + m_sheight + 4; - m_info_height = m_mheight*2; - m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); - 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; - m_y=getScreenStartY(m_height); - // Stop sectionsd g_Sectionsd->setPauseScanning(true); @@ -946,8 +953,10 @@ void CUpnpBrowserGui::paintDevices() // Head CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); - if (CNeutrinoApp::getInstance()->isMuted()) + if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); + else + header.removeContextButtons(); header.paint(CC_SAVE_SCREEN_NO); // Items diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 4df99a780..22870f406 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -101,7 +101,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); bool getResults(std::string id, unsigned int start, unsigned int count, std::list &results); std::vector *decodeResult(std::string); - void initModules(); + void Init(); void updateDeviceSelection(int newpos); void selectDevice(); void paintDevices(); From 5eef321c19e9444b4dc7b8f353a4dacbacda3d49 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Mar 2016 09:01:31 +0100 Subject: [PATCH 212/690] CUpnpBrowserGui: clean up, remove unused vars Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c4bdb382a2096982110d19f687ab6763cf3ae72 Author: Thilo Graf Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/upnpbrowser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 7bcf16280..088041e82 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -672,7 +672,7 @@ bool CUpnpBrowserGui::updateItemSelection(std::string id, std::vector selected = newpos; liststart = (selected/m_listmaxshow)*m_listmaxshow; - printf("updateItemSelection: list start old %d new %d selected old %d new %d\n", oldliststart, liststart, prev_selected, selected); + printf("updateItemSelection: list start old %u new %d selected old %d new %d\n", oldliststart, liststart, prev_selected, selected); if (oldliststart != liststart) { unsigned int total; if (!getItems(id, liststart, entries, total)) @@ -945,7 +945,6 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) void CUpnpBrowserGui::paintDevices() { - std::string tmp; int ypos, top; // LCD @@ -1055,7 +1054,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) { std::string tmp; std::stringstream ts; - int w, xstart; + int preferred=entry->preferred; // LCD @@ -1083,13 +1082,11 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) tmp += "\n"; //third line -// tmp += ""; if (!entry->isdir && preferred != -1) tmp += "URL: " + entry->resources[preferred].url; static std::string lastname = "", tmpname = ""; if(!entry->albumArtURI.empty()){ - static int flogo_w = 0, flogo_h = 0; if(lastname != entry->albumArtURI){ tmpname = lastname = entry->albumArtURI.c_str(); tmpname = g_PicViewer->DownloadImage(tmpname); From a4699de0700476415782247f4c37802e9fd8314b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Mar 2016 09:24:16 +0100 Subject: [PATCH 213/690] CUpnpBrowserGui: block infoclock Infoclock was not blocked in all modes, e.g. after stopped video infoclock was unblocked and clock was back on screen. Clock should be now not visible while upnp browser window is openend. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2358c6333ec20974765786fdc62fd6dcd797b2f0 Author: Thilo Graf Date: 2016-03-03 (Thu, 03 Mar 2016) --- src/gui/upnpbrowser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 088041e82..9d5643d72 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -47,7 +47,7 @@ #include #include #include - +#include #include #include #include @@ -1115,6 +1115,9 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset); int ypos, top; + //block infoclock + CInfoClock::getInstance()->block(); + // LCD CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Entry"); From 06aae05e486c293f12056ed07ee9d8634ca30786 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 3 Mar 2016 10:54:45 +0100 Subject: [PATCH 214/690] adzap: port code from martiis-neutrino-mp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c015d4670f79fd00d64896fc2b1291ee02b6083a Author: martii Date: 2016-03-03 (Thu, 03 Mar 2016) Origin message was: ------------------ - adzap: port code from martiis-neutrino-mp --- data/locale/deutsch.locale | 10 ++ data/locale/english.locale | 10 ++ src/gui/Makefile.am | 1 + src/gui/adzap.cpp | 291 +++++++++++++++++++++++++++++++++++ src/gui/adzap.h | 61 ++++++++ src/gui/user_menue.cpp | 2 +- src/gui/user_menue_setup.cpp | 2 +- src/neutrino.cpp | 7 + src/system/locals.h | 10 ++ src/system/locals_intern.h | 10 ++ src/system/settings.h | 9 +- 11 files changed, 406 insertions(+), 7 deletions(-) create mode 100644 src/gui/adzap.cpp create mode 100644 src/gui/adzap.h diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index fc567f46f..cb914b55b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -108,6 +108,14 @@ GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt adzap Werbezapper +adzap.announce In 15 Sekunden wird umgeschaltet auf +adzap.cancel Deaktiviert +adzap.disable Deaktivieren +adzap.enable Einmalig aktivieren +adzap.minute Minute +adzap.minutes Minuten +adzap.monitor Daueraktiv bei aktueller Sendung +adzap.switchback Zurückschalten nach apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark @@ -939,6 +947,7 @@ mbkey.truncate Film kürzen menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter +menu.hint_adzap Der Werbe-Zapper schaltet nach der eingestellten Zeit wieder auf den ursprünglichen Kanal zurück menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen und mehr @@ -2359,6 +2368,7 @@ usermenu.button_green Benutzermenü 'grün' usermenu.button_red Benutzermenü 'rot' usermenu.button_yellow Benutzermenü 'gelb' usermenu.head Benutzermenü +usermenu.item_adzap Werbezapper usermenu.item_bar ---- Trennung ---- usermenu.item_epg_misc EPG Funktionen usermenu.item_none (frei) diff --git a/data/locale/english.locale b/data/locale/english.locale index fe9592abf..a9877339a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -108,6 +108,14 @@ GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown adzap AdZap +adzap.announce In 15 seconds, the channel will be switched to +adzap.cancel Timer was cancelled +adzap.disable Deactivate +adzap.enable Activate once +adzap.minute minute +adzap.minutes minutes +adzap.monitor Stay active during current broadcast +adzap.switchback Switch back after apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy @@ -939,6 +947,7 @@ mbkey.truncate Truncate movie menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer +menu.hint_adzap AdZap will switch back to the current channel when the selected time is up menu.hint_aplay Audio player menu.hint_aplay_setup Change title display, start directory, screen saver and more menu.hint_audio Audio output, DD\nSRS True volume options @@ -2359,6 +2368,7 @@ usermenu.button_green User menu green usermenu.button_red User menu red usermenu.button_yellow User menu yellow usermenu.head User menu +usermenu.item_adzap Adzap usermenu.item_bar ---- Boarder ---- usermenu.item_epg_misc EPG functions usermenu.item_none (empty) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 509a67b5a..8a275ac33 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -42,6 +42,7 @@ AM_CPPFLAGS += \ noinst_LIBRARIES = libtimerlist.a libneutrino_gui.a libneutrino_gui2.a libneutrino_gui_a_SOURCES = \ + adzap.cpp \ audio_select.cpp \ audio_setup.cpp \ audiomute.cpp \ diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp new file mode 100644 index 000000000..424f0120d --- /dev/null +++ b/src/gui/adzap.cpp @@ -0,0 +1,291 @@ +/* + * adzap.cpp + * + * (C)2012-2013 by martii + * + * 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * AS SOME FOLKS DON'T SEEM TO UNDERSTAND THE GPL: YOU ARE FREE TO USE + * THIS CODE FOR YOUR OWN LITTLE STB IMAGE. BUT IF YOU ARE DISTRIBUTING + * THAT IMAGE, YOU ARE BOUND TO THE GPL, AND YOU HAVE TO DISTRIBUTE THE + * SOURCE CODE, TOO. IF YOU DON'T: A) YOU ACKNOWLEDGE THAT YOU'RE AN + * ABSOLUTE JERK, AND B) YOU'RE NOT PERMITTED TO USE THIS CODE. AT ALL. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZAPBACK_ALERT_PERIOD 15 // seconds. Keep this in sync with the locales. + +static CAdZapMenu *azm = NULL; + +CAdZapMenu *CAdZapMenu::getInstance() +{ + if (!azm) + azm = new CAdZapMenu(); + return azm; +} + +CAdZapMenu::CAdZapMenu() +{ + frameBuffer = CFrameBuffer::getInstance(); + width = w_max(40, 10); + hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + height = hheight + 13 * mheight + 10; + + x = (((g_settings.screen_EndX - g_settings.screen_StartX) - width) / 2) + g_settings.screen_StartX; + y = (((g_settings.screen_EndY - g_settings.screen_StartY) - height) / 2) + g_settings.screen_StartY; + + sem_init(&sem, 0, 0); + + pthread_t thr; + if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) + fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); + else + pthread_detach(thr); + channelId = -1; + armed = false; + monitor = false; + alerted = false; +} + +static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) +{ + return a.startTime < b.startTime; +} + +void CAdZapMenu::Update() +{ + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; + sem_post(&sem); +} + +void *CAdZapMenu::Run(void *arg) +{ + CAdZapMenu *me = (CAdZapMenu *) arg; + me->Run(); + pthread_exit(NULL); +} + +void CAdZapMenu::Run() +{ + set_threadname("CAdZapMenu::Run"); + while (true) { + CChannelList *channelList = NULL; + t_channel_id curChannelId = -1; + + if (monitor) { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; + + sem_timedwait(&sem, &ts); + + if (monitor && (monitorLifeTime.tv_sec > ts.tv_sec)) { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = + channelList ? channelList->getActiveChannel_ChannelID() + : -1; + if (!armed && (channelId != curChannelId)) { + armed = true; + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += + g_settings.adzap_zapBackPeriod - + ZAPBACK_ALERT_PERIOD; + alerted = false; + } else if (channelId == curChannelId) { + armed = false; + alerted = false; + } + } else { + monitor = false; + armed = false; + alerted = false; + } + } else if (armed) + sem_timedwait(&sem, &zapBackTime); + else + sem_wait(&sem); + + if (armed) { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + if (ts.tv_sec >= zapBackTime.tv_sec) { + if (!channelList) { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = + channelList ? + channelList->getActiveChannel_ChannelID() : -1; + } + if (!alerted) { + if (channelId != curChannelId) { + std::string name = + g_Locale->getText(LOCALE_ADZAP_ANNOUNCE); + name += "\n" + channelName; + ShowHint(LOCALE_ADZAP, name.c_str()); + } + alerted = true; + zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD; + } else { + alerted = false; + if (channelList) + channelList->zapTo_ChannelID(channelId); + armed = false; + } + } + } + } +} + +int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) +{ + int res = menu_return::RETURN_EXIT_ALL; + + if (actionKey == "enable") { + if (!monitor) + armed = true; + alerted = false; + Update(); + return res; + } + if (actionKey == "disable") { + armed = false; + monitor = false; + alerted = false; + Update(); + return res; + } + if (actionKey == "monitor") { + armed = false; + monitor = true; + alerted = false; + Update(); + return res; + } + + if (actionKey == "adzap") { + if (armed || monitor) { + armed = false; + monitor = false; + alerted = false; + Update(); + ShowHint(LOCALE_ADZAP, LOCALE_ADZAP_CANCEL, 450, 1); + return res; + } + } + if (actionKey.length() == 1) { + g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; + for (int shortcut = 1; shortcut < 10; shortcut++) + forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod); + g_settings.adzap_zapBackPeriod *= 60; + return menu_return::RETURN_REPAINT; + } + + if (parent) + parent->hide(); + + Settings(); + + return res; +} + +void CAdZapMenu::Settings() +{ + CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; + channelId = + channelList ? channelList->getActiveChannel_ChannelID() : -1; + channelName = channelList->getActiveChannelName(); + + CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); + menu->addItem(new + CMenuSeparator(CMenuSeparator::LINE | + CMenuSeparator::STRING, + LOCALE_ADZAP_SWITCHBACK)); + neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; + for (int shortcut = 1; shortcut < 10; shortcut++) { + char actionKey[2]; + actionKey[0] = '0' + shortcut; + actionKey[1] = 0; + bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; + forwarders[shortcut - 1] = + new CMenuForwarder(minute, true, NULL, this, actionKey, + CRCInput::convertDigitToKey(shortcut)); + forwarders[shortcut - 1]->setMarked(selected); + menu->addItem(forwarders[shortcut - 1], selected); + minute = LOCALE_ADZAP_MINUTES; + } + + menu->addItem(GenericMenuSeparatorLine); + + menu->addItem(new + CMenuForwarder(LOCALE_ADZAP_DISABLE, true, NULL, this, + "disable", CRCInput::RC_red, + NEUTRINO_ICON_BUTTON_RED)); + menu->addItem(new + CMenuForwarder(LOCALE_ADZAP_ENABLE, true, NULL, this, + "enable", CRCInput::RC_green, + NEUTRINO_ICON_BUTTON_GREEN)); + + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(channelId & + 0xFFFFFFFFFFFFULL, + evtlist); + monitorLifeTime.tv_sec = 0; + if (!evtlist.empty()) { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + CChannelEventList::iterator eli; + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) { + if ((u_int) eli->startTime + (u_int) eli->duration > + (u_int) ts.tv_sec) { + monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; + Update(); + break; + } + } + } + + menu->addItem(new + CMenuForwarder(LOCALE_ADZAP_MONITOR, + monitorLifeTime.tv_sec, NULL, this, + "monitor", CRCInput::RC_blue, + NEUTRINO_ICON_BUTTON_BLUE)); + + monitor = false; + menu->exec(NULL, ""); + menu->hide(); + delete menu; + Update(); +} diff --git a/src/gui/adzap.h b/src/gui/adzap.h new file mode 100644 index 000000000..6be3dd433 --- /dev/null +++ b/src/gui/adzap.h @@ -0,0 +1,61 @@ +/* + * adzap.h + * + * (C)2012 by martii + * + * 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef __adzap__ +#define __adzap__ + +#include "widget/menue.h" +#include +#include +#include +#include + +class CAdZapMenu: public CMenuTarget +{ + private: + CFrameBuffer * frameBuffer; + int x; + int y; + int width; + int height; + int hheight, mheight; // head/menu font height + bool running; + bool armed; + bool alerted; + bool monitor; + struct timespec zapBackTime; + std::string channelName; + CMenuForwarder *forwarders[9]; + struct timespec monitorLifeTime; + t_channel_id channelId; + sem_t sem; + CAdZapMenu(); + void Settings(); + void Update(); + void Run(void); + static void *Run(void *arg); + public: + static CAdZapMenu *getInstance(); + int exec(CMenuTarget * parent, const std::string & actionKey); +}; +#endif // __adzap__ diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 60e5f6b37..f4e643dc1 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -372,12 +372,12 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item = new CMenuForwarder(!g_settings.mode_clock ? LOCALE_CLOCK_SWITCH_ON:LOCALE_CLOCK_SWITCH_OFF, true, NULL, neutrino, "clock_switch", key, icon); menu_item->setHint("", LOCALE_MENU_HINT_CLOCK_MODE); break; -#if 0 case SNeutrinoSettings::ITEM_ADZAP: keyhelper.get(&key,&icon,CRCInput::RC_blue); menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, NULL, neutrino, "adzap", key, icon); menu_item->setHint("", LOCALE_MENU_HINT_ADZAP); break; +#if 0 case SNeutrinoSettings::ITEM_TUNER_RESTART: keyhelper.get(&key,&icon); menu_item = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, neutrino, "restarttuner", key, icon); diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 643e0a2db..1e3527344 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -100,7 +100,6 @@ static keyvals usermenu_items[] = { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS, usermenu_show }, { SNeutrinoSettings::ITEM_LUA, LOCALE_MAINMENU_LUA, usermenu_show }, #if 0 - { SNeutrinoSettings::ITEM_ADZAP, LOCALE_USERMENU_ITEM_ADZAP, usermenu_show }, { SNeutrinoSettings::ITEM_TUNER_RESTART, LOCALE_SERVICEMENU_RESTART_TUNER, usermenu_show }, { SNeutrinoSettings::ITEM_THREE_D_MODE, LOCALE_THREE_D_SETTINGS, usermenu_show_three_d_mode }, { SNeutrinoSettings::ITEM_RASS, LOCALE_RASS_HEAD, usermenu_show }, @@ -112,6 +111,7 @@ static keyvals usermenu_items[] = { SNeutrinoSettings::ITEM_NETSETTINGS, LOCALE_MAINSETTINGS_NETWORK, usermenu_show }, { SNeutrinoSettings::ITEM_SWUPDATE, LOCALE_SERVICEMENU_UPDATE, usermenu_show }, { SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION,LOCALE_LIVESTREAM_RESOLUTION, usermenu_show }, + { SNeutrinoSettings::ITEM_ADZAP, LOCALE_USERMENU_ITEM_ADZAP, usermenu_show }, { SNeutrinoSettings::ITEM_MAX, NONEXISTANT_LOCALE, usermenu_show } }; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a31dcdb47..c8cc9041b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -65,6 +65,7 @@ #include #include +#include "gui/adzap.h" #include "gui/audiomute.h" #include "gui/audioplayer.h" #include "gui/bouquetlist.h" @@ -828,6 +829,7 @@ int CNeutrinoApp::loadSetup(const char * fname) } g_settings.epg_search_history_size = g_settings.epg_search_history.size(); + g_settings.adzap_zapBackPeriod = configfile.getInt32("adzap_zapBackPeriod", 180); // USERMENU -> in system/settings.h //------------------------------------------- @@ -1314,6 +1316,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt64("startchanneltv_id", g_settings.startchanneltv_id); configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); configfile.setInt32("uselastchannel", g_settings.uselastchannel); + configfile.setInt32("adzap_zapBackPeriod", g_settings.adzap_zapBackPeriod); //epg search g_settings.epg_search_history_size = g_settings.epg_search_history.size(); if (g_settings.epg_search_history_size > g_settings.epg_search_history_max) @@ -4000,6 +4003,10 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) exit(1); } } + else if(actionKey == "adzap") { + CAdZapMenu::getInstance()->exec(parent, "adzap"); + return menu_return::RETURN_EXIT_ALL; + } else if(actionKey == "moviedir") { parent->hide(); diff --git a/src/system/locals.h b/src/system/locals.h index 7ed5c56ee..965d6cd84 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -135,6 +135,14 @@ typedef enum LOCALE_GENRE_TRAVEL_HOBBIES_7, LOCALE_GENRE_UNKNOWN, LOCALE_ADZAP, + LOCALE_ADZAP_ANNOUNCE, + LOCALE_ADZAP_CANCEL, + LOCALE_ADZAP_DISABLE, + LOCALE_ADZAP_ENABLE, + LOCALE_ADZAP_MINUTE, + LOCALE_ADZAP_MINUTES, + LOCALE_ADZAP_MONITOR, + LOCALE_ADZAP_SWITCHBACK, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, @@ -966,6 +974,7 @@ typedef enum LOCALE_MENU_BACK, LOCALE_MENU_CANCEL, LOCALE_MENU_HINT_A_PIC, + LOCALE_MENU_HINT_ADZAP, LOCALE_MENU_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP, LOCALE_MENU_HINT_AUDIO, @@ -2386,6 +2395,7 @@ typedef enum LOCALE_USERMENU_BUTTON_RED, LOCALE_USERMENU_BUTTON_YELLOW, LOCALE_USERMENU_HEAD, + LOCALE_USERMENU_ITEM_ADZAP, LOCALE_USERMENU_ITEM_BAR, LOCALE_USERMENU_ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_NONE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d2fc1f5e2..2eb1f2b95 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -135,6 +135,14 @@ const char * locale_real_names[] = "GENRE.TRAVEL_HOBBIES.7", "GENRE.UNKNOWN", "adzap", + "adzap.announce", + "adzap.cancel", + "adzap.disable", + "adzap.enable", + "adzap.minute", + "adzap.minutes", + "adzap.monitor", + "adzap.switchback", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", @@ -966,6 +974,7 @@ const char * locale_real_names[] = "menu.back", "menu.cancel", "menu.hint_a_pic", + "menu.hint_adzap", "menu.hint_aplay", "menu.hint_aplay_setup", "menu.hint_audio", @@ -2386,6 +2395,7 @@ const char * locale_real_names[] = "usermenu.button_red", "usermenu.button_yellow", "usermenu.head", + "usermenu.item_adzap", "usermenu.item_bar", "usermenu.item_epg_misc", "usermenu.item_none", diff --git a/src/system/settings.h b/src/system/settings.h index 1dede46a9..c254c7184 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -729,6 +729,9 @@ struct SNeutrinoSettings t_channel_id startchannelradio_id; int uselastchannel; + //adzap + int adzap_zapBackPeriod; + int power_standby; int hdd_sleep; int hdd_noise; @@ -789,6 +792,7 @@ struct SNeutrinoSettings ITEM_SWUPDATE = 30, ITEM_LIVESTREAM_RESOLUTION = 31, + ITEM_ADZAP = 32, ITEM_MAX // MUST be always the last in the list } USER_ITEM; @@ -817,8 +821,6 @@ struct SNeutrinoSettings }; }; -/* some default Values */ - extern const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SETTINGS_MAX]; typedef struct time_settings_t @@ -865,9 +867,6 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO // shadow #define SHADOW_OFFSET 6 -/* end default values */ - - struct SglobalInfo { unsigned char box_Type; From f7997f67e03387d3b44dc8c1ffe609b427b378c8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 01:21:36 +0100 Subject: [PATCH 215/690] adzap: re-format code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/40840cef367e21945e4ded8cb80ac652d7c35d08 Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: re-format code --- src/gui/adzap.cpp | 423 +++++++++++++++++++++++----------------------- src/gui/adzap.h | 43 ++--- 2 files changed, 229 insertions(+), 237 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 424f0120d..ae275500c 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -1,32 +1,26 @@ /* - * adzap.cpp - * - * (C)2012-2013 by martii - * - * 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ + adzap.cpp -/* - * AS SOME FOLKS DON'T SEEM TO UNDERSTAND THE GPL: YOU ARE FREE TO USE - * THIS CODE FOR YOUR OWN LITTLE STB IMAGE. BUT IF YOU ARE DISTRIBUTING - * THAT IMAGE, YOU ARE BOUND TO THE GPL, AND YOU HAVE TO DISTRIBUTE THE - * SOURCE CODE, TOO. IF YOU DON'T: A) YOU ACKNOWLEDGE THAT YOU'RE AN - * ABSOLUTE JERK, AND B) YOU'RE NOT PERMITTED TO USE THIS CODE. AT ALL. - */ + (C) 2012-2013 by martii + (C) 2016 Sven Hoefer (svenhoefer) + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ #ifdef HAVE_CONFIG_H #include @@ -50,242 +44,239 @@ static CAdZapMenu *azm = NULL; CAdZapMenu *CAdZapMenu::getInstance() { - if (!azm) - azm = new CAdZapMenu(); - return azm; + if (!azm) + azm = new CAdZapMenu(); + return azm; } CAdZapMenu::CAdZapMenu() { - frameBuffer = CFrameBuffer::getInstance(); - width = w_max(40, 10); - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - height = hheight + 13 * mheight + 10; + frameBuffer = CFrameBuffer::getInstance(); + width = w_max(40, 10); + hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + height = hheight + 13 * mheight + 10; - x = (((g_settings.screen_EndX - g_settings.screen_StartX) - width) / 2) + g_settings.screen_StartX; - y = (((g_settings.screen_EndY - g_settings.screen_StartY) - height) / 2) + g_settings.screen_StartY; + x = (((g_settings.screen_EndX - g_settings.screen_StartX) - width) / 2) + g_settings.screen_StartX; + y = (((g_settings.screen_EndY - g_settings.screen_StartY) - height) / 2) + g_settings.screen_StartY; - sem_init(&sem, 0, 0); + sem_init(&sem, 0, 0); - pthread_t thr; - if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) + pthread_t thr; + if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); - else + else pthread_detach(thr); - channelId = -1; - armed = false; - monitor = false; - alerted = false; + channelId = -1; + armed = false; + monitor = false; + alerted = false; } static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) { - return a.startTime < b.startTime; + return a.startTime < b.startTime; } void CAdZapMenu::Update() { - clock_gettime(CLOCK_REALTIME, &zapBackTime); - zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; - sem_post(&sem); + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; + sem_post(&sem); } void *CAdZapMenu::Run(void *arg) { - CAdZapMenu *me = (CAdZapMenu *) arg; - me->Run(); - pthread_exit(NULL); + CAdZapMenu *me = (CAdZapMenu *) arg; + me->Run(); + pthread_exit(NULL); } void CAdZapMenu::Run() { - set_threadname("CAdZapMenu::Run"); - while (true) { - CChannelList *channelList = NULL; - t_channel_id curChannelId = -1; + set_threadname("CAdZapMenu::Run"); + while (true) + { + CChannelList *channelList = NULL; + t_channel_id curChannelId = -1; - if (monitor) { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_sec += 1; + if (monitor) + { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; - sem_timedwait(&sem, &ts); + sem_timedwait(&sem, &ts); - if (monitor && (monitorLifeTime.tv_sec > ts.tv_sec)) { - channelList = CNeutrinoApp::getInstance()->channelList; - curChannelId = - channelList ? channelList->getActiveChannel_ChannelID() - : -1; - if (!armed && (channelId != curChannelId)) { - armed = true; - clock_gettime(CLOCK_REALTIME, &zapBackTime); - zapBackTime.tv_sec += - g_settings.adzap_zapBackPeriod - - ZAPBACK_ALERT_PERIOD; - alerted = false; - } else if (channelId == curChannelId) { - armed = false; - alerted = false; + if (monitor && (monitorLifeTime.tv_sec > ts.tv_sec)) + { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + if (!armed && (channelId != curChannelId)) + { + armed = true; + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; + alerted = false; + } + else if (channelId == curChannelId) + { + armed = false; + alerted = false; + } + } + else + { + monitor = false; + armed = false; + alerted = false; + } } - } else { - monitor = false; - armed = false; - alerted = false; - } - } else if (armed) - sem_timedwait(&sem, &zapBackTime); - else - sem_wait(&sem); + else if (armed) + sem_timedwait(&sem, &zapBackTime); + else + sem_wait(&sem); - if (armed) { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - if (ts.tv_sec >= zapBackTime.tv_sec) { - if (!channelList) { - channelList = CNeutrinoApp::getInstance()->channelList; - curChannelId = - channelList ? - channelList->getActiveChannel_ChannelID() : -1; + if (armed) + { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + if (ts.tv_sec >= zapBackTime.tv_sec) + { + if (!channelList) + { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + } + if (!alerted) + { + if (channelId != curChannelId) + { + std::string name = g_Locale->getText(LOCALE_ADZAP_ANNOUNCE); + name += "\n" + channelName; + ShowHint(LOCALE_ADZAP, name.c_str()); + } + alerted = true; + zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD; + } + else + { + alerted = false; + if (channelList) + channelList->zapTo_ChannelID(channelId); + armed = false; + } + } } - if (!alerted) { - if (channelId != curChannelId) { - std::string name = - g_Locale->getText(LOCALE_ADZAP_ANNOUNCE); - name += "\n" + channelName; - ShowHint(LOCALE_ADZAP, name.c_str()); - } - alerted = true; - zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD; - } else { - alerted = false; - if (channelList) - channelList->zapTo_ChannelID(channelId); - armed = false; - } - } } - } } int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) { - int res = menu_return::RETURN_EXIT_ALL; + int res = menu_return::RETURN_EXIT_ALL; - if (actionKey == "enable") { - if (!monitor) - armed = true; - alerted = false; - Update(); - return res; - } - if (actionKey == "disable") { - armed = false; - monitor = false; - alerted = false; - Update(); - return res; - } - if (actionKey == "monitor") { - armed = false; - monitor = true; - alerted = false; - Update(); - return res; - } - - if (actionKey == "adzap") { - if (armed || monitor) { - armed = false; - monitor = false; - alerted = false; - Update(); - ShowHint(LOCALE_ADZAP, LOCALE_ADZAP_CANCEL, 450, 1); - return res; + if (actionKey == "enable") + { + if (!monitor) + armed = true; + alerted = false; + Update(); + return res; + } + if (actionKey == "disable") + { + armed = false; + monitor = false; + alerted = false; + Update(); + return res; + } + if (actionKey == "monitor") + { + armed = false; + monitor = true; + alerted = false; + Update(); + return res; + } + if (actionKey == "adzap") + { + if (armed || monitor) { + armed = false; + monitor = false; + alerted = false; + Update(); + ShowHint(LOCALE_ADZAP, LOCALE_ADZAP_CANCEL, 450, 1); + return res; + } + } + if (actionKey.length() == 1) + { + g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; + for (int shortcut = 1; shortcut < 10; shortcut++) + forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod); + g_settings.adzap_zapBackPeriod *= 60; + return menu_return::RETURN_REPAINT; } - } - if (actionKey.length() == 1) { - g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; - for (int shortcut = 1; shortcut < 10; shortcut++) - forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod); - g_settings.adzap_zapBackPeriod *= 60; - return menu_return::RETURN_REPAINT; - } - if (parent) - parent->hide(); + if (parent) + parent->hide(); - Settings(); + Settings(); - return res; + return res; } void CAdZapMenu::Settings() { - CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; - channelId = - channelList ? channelList->getActiveChannel_ChannelID() : -1; - channelName = channelList->getActiveChannelName(); + CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; + channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + channelName = channelList->getActiveChannelName(); - CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); - menu->addItem(new - CMenuSeparator(CMenuSeparator::LINE | - CMenuSeparator::STRING, - LOCALE_ADZAP_SWITCHBACK)); - neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; - for (int shortcut = 1; shortcut < 10; shortcut++) { - char actionKey[2]; - actionKey[0] = '0' + shortcut; - actionKey[1] = 0; - bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; - forwarders[shortcut - 1] = - new CMenuForwarder(minute, true, NULL, this, actionKey, - CRCInput::convertDigitToKey(shortcut)); - forwarders[shortcut - 1]->setMarked(selected); - menu->addItem(forwarders[shortcut - 1], selected); - minute = LOCALE_ADZAP_MINUTES; - } - - menu->addItem(GenericMenuSeparatorLine); - - menu->addItem(new - CMenuForwarder(LOCALE_ADZAP_DISABLE, true, NULL, this, - "disable", CRCInput::RC_red, - NEUTRINO_ICON_BUTTON_RED)); - menu->addItem(new - CMenuForwarder(LOCALE_ADZAP_ENABLE, true, NULL, this, - "enable", CRCInput::RC_green, - NEUTRINO_ICON_BUTTON_GREEN)); - - CChannelEventList evtlist; - CEitManager::getInstance()->getEventsServiceKey(channelId & - 0xFFFFFFFFFFFFULL, - evtlist); - monitorLifeTime.tv_sec = 0; - if (!evtlist.empty()) { - sort(evtlist.begin(), evtlist.end(), sortByDateTime); - CChannelEventList::iterator eli; - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) { - if ((u_int) eli->startTime + (u_int) eli->duration > - (u_int) ts.tv_sec) { - monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; - Update(); - break; - } + CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); + neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; + for (int shortcut = 1; shortcut < 10; shortcut++) { + char actionKey[2]; + actionKey[0] = '0' + shortcut; + actionKey[1] = 0; + bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; + forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); + forwarders[shortcut - 1]->setMarked(selected); + menu->addItem(forwarders[shortcut - 1], selected); + minute = LOCALE_ADZAP_MINUTES; } - } - menu->addItem(new - CMenuForwarder(LOCALE_ADZAP_MONITOR, - monitorLifeTime.tv_sec, NULL, this, - "monitor", CRCInput::RC_blue, - NEUTRINO_ICON_BUTTON_BLUE)); + menu->addItem(GenericMenuSeparatorLine); - monitor = false; - menu->exec(NULL, ""); - menu->hide(); - delete menu; - Update(); + menu->addItem(new CMenuForwarder(LOCALE_ADZAP_DISABLE, true, NULL, this, "disable", CRCInput::RC_red)); + menu->addItem(new CMenuForwarder(LOCALE_ADZAP_ENABLE, true, NULL, this, "enable", CRCInput::RC_green)); + + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); + monitorLifeTime.tv_sec = 0; + if (!evtlist.empty()) + { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + CChannelEventList::iterator eli; + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) + { + if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) + { + monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; + Update(); + break; + } + } + } + + menu->addItem(new CMenuForwarder(LOCALE_ADZAP_MONITOR, monitorLifeTime.tv_sec, NULL, this, "monitor", CRCInput::RC_blue)); + + monitor = false; + menu->exec(NULL, ""); + menu->hide(); + delete menu; + Update(); } diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 6be3dd433..0dc6bbd62 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -1,25 +1,26 @@ /* - * adzap.h - * - * (C)2012 by martii - * - * 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ + adzap.h + (C) 2012-2013 by martii + (C) 2016 Sven Hoefer (svenhoefer) + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ #ifndef __adzap__ #define __adzap__ @@ -58,4 +59,4 @@ class CAdZapMenu: public CMenuTarget static CAdZapMenu *getInstance(); int exec(CMenuTarget * parent, const std::string & actionKey); }; -#endif // __adzap__ +#endif // __adzap__ From 2a0b9258cf79031456a2bdc38e90003b5be7c547 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 01:47:46 +0100 Subject: [PATCH 216/690] adzap: make locale to announce zap back more flexible Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/193ef7b14d3805718b805071570c01819c38432e Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: make locale to announce zap back more flexible --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/gui/adzap.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cb914b55b..afd8ab2fa 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -108,7 +108,7 @@ GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt adzap Werbezapper -adzap.announce In 15 Sekunden wird umgeschaltet auf +adzap.announce In %d Sekunden wird umgeschaltet auf\n%s adzap.cancel Deaktiviert adzap.disable Deaktivieren adzap.enable Einmalig aktivieren diff --git a/data/locale/english.locale b/data/locale/english.locale index a9877339a..899b15d83 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -108,7 +108,7 @@ GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown adzap AdZap -adzap.announce In 15 seconds, the channel will be switched to +adzap.announce In %d seconds, the channel will be switched to\n%s adzap.cancel Timer was cancelled adzap.disable Deactivate adzap.enable Activate once diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index ae275500c..4f2ecf06b 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -38,7 +38,7 @@ #include #include -#define ZAPBACK_ALERT_PERIOD 15 // seconds. Keep this in sync with the locales. +#define ZAPBACK_ALERT_PERIOD 15 // seconds static CAdZapMenu *azm = NULL; @@ -152,9 +152,9 @@ void CAdZapMenu::Run() { if (channelId != curChannelId) { - std::string name = g_Locale->getText(LOCALE_ADZAP_ANNOUNCE); - name += "\n" + channelName; - ShowHint(LOCALE_ADZAP, name.c_str()); + char name[1024]; + snprintf(name, sizeof(name)-1, g_Locale->getText(LOCALE_ADZAP_ANNOUNCE), ZAPBACK_ALERT_PERIOD, channelName.c_str()); + ShowHint(LOCALE_ADZAP, name); } alerted = true; zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD; From 479ab4fe27b10df574e32d4f1ad13420d46a08e2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 21:24:26 +0100 Subject: [PATCH 217/690] adzap: use footer buttons to enable/disable adzap Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2fd298fa221b26adc738d182cfb0c0685dc49233 Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: use footer buttons to enable/disable adzap --- data/locale/deutsch.locale | 6 ++--- data/locale/english.locale | 6 ++--- src/gui/adzap.cpp | 50 ++++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index afd8ab2fa..77df22846 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -110,11 +110,11 @@ GENRE.UNKNOWN Unbekannt adzap Werbezapper adzap.announce In %d Sekunden wird umgeschaltet auf\n%s adzap.cancel Deaktiviert -adzap.disable Deaktivieren -adzap.enable Einmalig aktivieren +adzap.disable Aus +adzap.enable Ein (einmalig) adzap.minute Minute adzap.minutes Minuten -adzap.monitor Daueraktiv bei aktueller Sendung +adzap.monitor Ein (dauerhaft) adzap.switchback Zurückschalten nach apidselector.head Sprachauswahl audio.srs_algo Art diff --git a/data/locale/english.locale b/data/locale/english.locale index 899b15d83..60fa687eb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -110,11 +110,11 @@ GENRE.UNKNOWN unknown adzap AdZap adzap.announce In %d seconds, the channel will be switched to\n%s adzap.cancel Timer was cancelled -adzap.disable Deactivate -adzap.enable Activate once +adzap.disable Off +adzap.enable On (once) adzap.minute minute adzap.minutes minutes -adzap.monitor Stay active during current broadcast +adzap.monitor On (durable) adzap.switchback Switch back after apidselector.head Select language audio.srs_algo Type diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 4f2ecf06b..7600eb4fc 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -40,6 +40,13 @@ #define ZAPBACK_ALERT_PERIOD 15 // seconds +static const struct button_label CAdZapMenuFooterButtons[] = { + { NEUTRINO_ICON_BUTTON_RED, LOCALE_ADZAP_DISABLE }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_ADZAP_ENABLE }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_ADZAP_MONITOR } +}; +#define CAdZapMenuFooterButtonCount (sizeof(CAdZapMenuFooterButtons)/sizeof(button_label)) + static CAdZapMenu *azm = NULL; CAdZapMenu *CAdZapMenu::getInstance() @@ -232,26 +239,6 @@ void CAdZapMenu::Settings() CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; channelName = channelList->getActiveChannelName(); - - CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); - menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); - neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; - for (int shortcut = 1; shortcut < 10; shortcut++) { - char actionKey[2]; - actionKey[0] = '0' + shortcut; - actionKey[1] = 0; - bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; - forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); - forwarders[shortcut - 1]->setMarked(selected); - menu->addItem(forwarders[shortcut - 1], selected); - minute = LOCALE_ADZAP_MINUTES; - } - - menu->addItem(GenericMenuSeparatorLine); - - menu->addItem(new CMenuForwarder(LOCALE_ADZAP_DISABLE, true, NULL, this, "disable", CRCInput::RC_red)); - menu->addItem(new CMenuForwarder(LOCALE_ADZAP_ENABLE, true, NULL, this, "enable", CRCInput::RC_green)); - CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); monitorLifeTime.tv_sec = 0; @@ -271,10 +258,27 @@ void CAdZapMenu::Settings() } } } - - menu->addItem(new CMenuForwarder(LOCALE_ADZAP_MONITOR, monitorLifeTime.tv_sec, NULL, this, "monitor", CRCInput::RC_blue)); - monitor = false; + + CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); + menu->addKey(CRCInput::RC_red, this, "disable"); + menu->addKey(CRCInput::RC_green, this, "enable"); + menu->addKey(CRCInput::RC_blue, this, "monitor"); + menu->addIntroItems(NONEXISTANT_LOCALE, LOCALE_ADZAP_SWITCHBACK); + + neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; + for (int shortcut = 1; shortcut < 10; shortcut++) { + char actionKey[2]; + actionKey[0] = '0' + shortcut; + actionKey[1] = 0; + bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; + forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); + forwarders[shortcut - 1]->setMarked(selected); + menu->addItem(forwarders[shortcut - 1], selected); + minute = LOCALE_ADZAP_MINUTES; + } + + menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount); menu->exec(NULL, ""); menu->hide(); delete menu; From 83079553ae60f12e7a7e8add7ce309ff41d998f0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 21:33:10 +0100 Subject: [PATCH 218/690] adzap: hide blue button if needed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b104f05097eb9ef5c3bbdd1109eb3a528f2dd40 Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: hide blue button if needed --- src/gui/adzap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 7600eb4fc..e5a69c628 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -242,6 +242,7 @@ void CAdZapMenu::Settings() CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); monitorLifeTime.tv_sec = 0; + bool show_monitor = false; if (!evtlist.empty()) { sort(evtlist.begin(), evtlist.end(), sortByDateTime); @@ -253,6 +254,7 @@ void CAdZapMenu::Settings() if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) { monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; + show_monitor = true; Update(); break; } @@ -278,7 +280,7 @@ void CAdZapMenu::Settings() minute = LOCALE_ADZAP_MINUTES; } - menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount); + menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount - (show_monitor ? 0 : 1)); menu->exec(NULL, ""); menu->hide(); delete menu; From a984e9f8296b0651e4dc792b934228113d5d3d6f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 21:54:57 +0100 Subject: [PATCH 219/690] adzap: cleanup from unused variables Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bd84273c39cb4e26c727bb6ac6d54aa71741b958 Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: cleanup from unused variables --- src/gui/adzap.cpp | 12 +++--------- src/gui/adzap.h | 4 ---- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index e5a69c628..3e87a697d 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -59,21 +59,15 @@ CAdZapMenu *CAdZapMenu::getInstance() CAdZapMenu::CAdZapMenu() { frameBuffer = CFrameBuffer::getInstance(); - width = w_max(40, 10); - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - height = hheight + 13 * mheight + 10; - - x = (((g_settings.screen_EndX - g_settings.screen_StartX) - width) / 2) + g_settings.screen_StartX; - y = (((g_settings.screen_EndY - g_settings.screen_StartY) - height) / 2) + g_settings.screen_StartY; + width = 40; sem_init(&sem, 0, 0); pthread_t thr; if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) - fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); + fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); else - pthread_detach(thr); + pthread_detach(thr); channelId = -1; armed = false; monitor = false; diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 0dc6bbd62..842769ae8 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -35,11 +35,7 @@ class CAdZapMenu: public CMenuTarget { private: CFrameBuffer * frameBuffer; - int x; - int y; int width; - int height; - int hheight, mheight; // head/menu font height bool running; bool armed; bool alerted; From 21a01e174516f21ed6596312972bf1771fe3484e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 22:02:42 +0100 Subject: [PATCH 220/690] adzap: move non-menu code to Init() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5bc5093e78de33b6b5061c2d188ddc7d686c4a2 Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: move non-menu code to Init() function --- src/gui/adzap.cpp | 57 ++++++++++++++++++++++++++--------------------- src/gui/adzap.h | 1 + 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 3e87a697d..2fde271b1 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -79,6 +79,32 @@ static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) return a.startTime < b.startTime; } +void CAdZapMenu::Init() +{ + CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; + channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + channelName = channelList->getActiveChannelName(); + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); + monitorLifeTime.tv_sec = 0; + if (!evtlist.empty()) + { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + CChannelEventList::iterator eli; + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) + { + if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) + { + monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; + Update(); + break; + } + } + } +} + void CAdZapMenu::Update() { clock_gettime(CLOCK_REALTIME, &zapBackTime); @@ -164,7 +190,7 @@ void CAdZapMenu::Run() { alerted = false; if (channelList) - channelList->zapTo_ChannelID(channelId); + channelList->zapTo_ChannelID(channelId); armed = false; } } @@ -174,6 +200,8 @@ void CAdZapMenu::Run() int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) { + Init(); + int res = menu_return::RETURN_EXIT_ALL; if (actionKey == "enable") @@ -223,6 +251,7 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) if (parent) parent->hide(); + monitor = false; Settings(); return res; @@ -230,31 +259,7 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) void CAdZapMenu::Settings() { - CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; - channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; - channelName = channelList->getActiveChannelName(); - CChannelEventList evtlist; - CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); - monitorLifeTime.tv_sec = 0; - bool show_monitor = false; - if (!evtlist.empty()) - { - sort(evtlist.begin(), evtlist.end(), sortByDateTime); - CChannelEventList::iterator eli; - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) - { - if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) - { - monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; - show_monitor = true; - Update(); - break; - } - } - } - monitor = false; + bool show_monitor = monitorLifeTime.tv_sec; CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); menu->addKey(CRCInput::RC_red, this, "disable"); diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 842769ae8..ccf6ad7a3 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -47,6 +47,7 @@ class CAdZapMenu: public CMenuTarget t_channel_id channelId; sem_t sem; CAdZapMenu(); + void Init(); void Settings(); void Update(); void Run(void); From 7154d0293c003e1f2e822dc434546aeb5ad1d921 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 23:08:52 +0100 Subject: [PATCH 221/690] adzap: move code to determinate monitorLifeTime to own function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/527f11d4de80498724cf60c25a3ff1698892a2ea Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: move code to determinate monitorLifeTime to own function --- src/gui/adzap.cpp | 33 ++++++++++++++++++++------------- src/gui/adzap.h | 2 ++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 2fde271b1..845bb1f36 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -84,25 +84,32 @@ void CAdZapMenu::Init() CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; channelName = channelList->getActiveChannelName(); - CChannelEventList evtlist; + evtlist.clear(); CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); monitorLifeTime.tv_sec = 0; if (!evtlist.empty()) { sort(evtlist.begin(), evtlist.end(), sortByDateTime); - CChannelEventList::iterator eli; - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) - { - if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) - { - monitorLifeTime.tv_sec = (uint) eli->startTime + eli->duration; - Update(); - break; - } - } + monitorLifeTime.tv_sec = getMonitorLifeTime(); + Update(); } + printf("CAdZapMenu::%s: monitorLifeTime.tv_sec: %d\n", __func__, (uint) monitorLifeTime.tv_sec); +} + +time_t CAdZapMenu::getMonitorLifeTime() +{ + if (evtlist.empty()) + return 0; + + CChannelEventList::iterator eli; + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) + { + if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) + return (uint) eli->startTime + eli->duration; + } + return 0; } void CAdZapMenu::Update() diff --git a/src/gui/adzap.h b/src/gui/adzap.h index ccf6ad7a3..af0ed495e 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -43,11 +43,13 @@ class CAdZapMenu: public CMenuTarget struct timespec zapBackTime; std::string channelName; CMenuForwarder *forwarders[9]; + CChannelEventList evtlist; struct timespec monitorLifeTime; t_channel_id channelId; sem_t sem; CAdZapMenu(); void Init(); + time_t getMonitorLifeTime(); void Settings(); void Update(); void Run(void); From f25907e3601e09d1d1e9864f7d5b913aa0a3a8ed Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Feb 2016 23:09:44 +0100 Subject: [PATCH 222/690] adzap: update monitorLifeTime before leaving in case event has changed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3cee9eeb6e4c4f091bb22147b8d3362d8d8be13a Author: vanhofen Date: 2016-02-28 (Sun, 28 Feb 2016) Origin message was: ------------------ - adzap: update monitorLifeTime before leaving in case event has changed --- src/gui/adzap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 845bb1f36..902efddba 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -232,6 +232,9 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) armed = false; monitor = true; alerted = false; + if (!evtlist.empty()) + monitorLifeTime.tv_sec = getMonitorLifeTime(); + printf("CAdZapMenu::%s: monitorLifeTime.tv_sec: %d\n", __func__, (uint) monitorLifeTime.tv_sec); Update(); return res; } From 08c7aa0f6744d0843d2b65826f4782be839e232e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 00:11:44 +0100 Subject: [PATCH 223/690] adzap: add isActive() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/809b0ea20c6f8957dff84a54ab2b42f5f752dbfc Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: add isActive() function --- src/gui/adzap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/adzap.h b/src/gui/adzap.h index af0ed495e..f68b39721 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -57,5 +57,6 @@ class CAdZapMenu: public CMenuTarget public: static CAdZapMenu *getInstance(); int exec(CMenuTarget * parent, const std::string & actionKey); + bool isActive() { return (armed || monitor); }; }; #endif // __adzap__ From 4534e82b39cce9ffff45cd968260e39fc16fb577 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 00:12:41 +0100 Subject: [PATCH 224/690] adzap: don't leave all menues, when adzap isn't active Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6d4aba4a6ca3467524356e63753139dc3f36794e Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: don't leave all menues, when adzap isn't active --- src/neutrino.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c8cc9041b..0a581c21f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4005,7 +4005,10 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) } else if(actionKey == "adzap") { CAdZapMenu::getInstance()->exec(parent, "adzap"); - return menu_return::RETURN_EXIT_ALL; + if (CAdZapMenu::getInstance()->isActive()) + return menu_return::RETURN_EXIT_ALL; + else + return menu_return::RETURN_REPAINT; } else if(actionKey == "moviedir") { parent->hide(); From 6dfd01e1cd9d6bf936e1634f321772999ab006cd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 00:13:38 +0100 Subject: [PATCH 225/690] adzap: align locale in usermenu item to adzap active status Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1dfc1bc452c0c24dd77290ca07c65ba0c3b09250 Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: align locale in usermenu item to adzap active status --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/user_menue.cpp | 7 +++++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 77df22846..41d361536 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -948,6 +948,7 @@ menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter menu.hint_adzap Der Werbe-Zapper schaltet nach der eingestellten Zeit wieder auf den ursprünglichen Kanal zurück +menu.hint_adzap_active Der Werbe-Zapper ist aktiv. Mit einem erneuten Aufruf wird er deaktiviert. menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen und mehr diff --git a/data/locale/english.locale b/data/locale/english.locale index 60fa687eb..df7a3336b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -948,6 +948,7 @@ menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer menu.hint_adzap AdZap will switch back to the current channel when the selected time is up +menu.hint_adzap_active AdZap is active. With a new call it will be deactivated. menu.hint_aplay Audio player menu.hint_aplay_setup Change title display, start directory, screen saver and more menu.hint_audio Audio output, DD\nSRS True volume options diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f4e643dc1..95ee64bc6 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -68,6 +68,7 @@ #include #include +#include #include #include #include @@ -186,6 +187,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + bool adzap_active = CAdZapMenu::getInstance()->isActive(); + std::string itemstr_last("1"); std::vector items = ::split(g_settings.usermenu[button]->items, ','); @@ -374,8 +377,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) break; case SNeutrinoSettings::ITEM_ADZAP: keyhelper.get(&key,&icon,CRCInput::RC_blue); - menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, NULL, neutrino, "adzap", key, icon); - menu_item->setHint("", LOCALE_MENU_HINT_ADZAP); + menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, adzap_active ? g_Locale->getText(LOCALE_OPTIONS_OFF) : NULL, neutrino, "adzap", key, icon); + menu_item->setHint("", adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP); break; #if 0 case SNeutrinoSettings::ITEM_TUNER_RESTART: diff --git a/src/system/locals.h b/src/system/locals.h index 965d6cd84..331a9fff6 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -975,6 +975,7 @@ typedef enum LOCALE_MENU_CANCEL, LOCALE_MENU_HINT_A_PIC, LOCALE_MENU_HINT_ADZAP, + LOCALE_MENU_HINT_ADZAP_ACTIVE, LOCALE_MENU_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP, LOCALE_MENU_HINT_AUDIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2eb1f2b95..f33bb62ab 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -975,6 +975,7 @@ const char * locale_real_names[] = "menu.cancel", "menu.hint_a_pic", "menu.hint_adzap", + "menu.hint_adzap_active", "menu.hint_aplay", "menu.hint_aplay_setup", "menu.hint_audio", From ef3bd7774af60dc258fec9debab3229f38b68274 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 10:31:22 +0100 Subject: [PATCH 226/690] adzap: add possibility to write status data to /tmp/adzap.data Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/00e5cf6759cd285f4fae0926b88718c373ae0044 Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: add possibility to write status data to /tmp/adzap.data --- data/locale/deutsch.locale | 7 ++++-- data/locale/english.locale | 3 +++ src/gui/adzap.cpp | 51 ++++++++++++++++++++++++++++++++++---- src/gui/adzap.h | 2 +- src/neutrino.cpp | 2 ++ src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ src/system/settings.h | 2 +- 8 files changed, 64 insertions(+), 9 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 41d361536..3aadf2bed 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -116,6 +116,7 @@ adzap.minute Minute adzap.minutes Minuten adzap.monitor Ein (dauerhaft) adzap.switchback Zurückschalten nach +adzap.writedata Schreibe Status-Daten apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark @@ -947,8 +948,10 @@ mbkey.truncate Film kürzen menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter -menu.hint_adzap Der Werbe-Zapper schaltet nach der eingestellten Zeit wieder auf den ursprünglichen Kanal zurück -menu.hint_adzap_active Der Werbe-Zapper ist aktiv. Mit einem erneuten Aufruf wird er deaktiviert. +menu.hint_adzap Der Werbezapper schaltet nach der eingestellten Zeit wieder auf den ursprünglichen Kanal zurück +menu.hint_adzap_active Der Werbezapper ist aktiv. Mit einem erneuten Aufruf wird er deaktiviert. +menu.hint_adzap_setup Einstellungen für den Werbezapper +menu.hint_adzap_writedata Schreibe Daten über den Status des Werbezappers nach /tmp/adzap.data menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen und mehr diff --git a/data/locale/english.locale b/data/locale/english.locale index df7a3336b..36e9e06c2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -116,6 +116,7 @@ adzap.minute minute adzap.minutes minutes adzap.monitor On (durable) adzap.switchback Switch back after +adzap.writedata Write status data apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy @@ -949,6 +950,8 @@ menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer menu.hint_adzap AdZap will switch back to the current channel when the selected time is up menu.hint_adzap_active AdZap is active. With a new call it will be deactivated. +menu.hint_adzap_setup Settings for the AdZap service +menu.hint_adzap_writedata Write data according to adzap status to /tmp/adzap.data menu.hint_aplay Audio player menu.hint_aplay_setup Change title display, start directory, screen saver and more menu.hint_audio Audio output, DD\nSRS True volume options diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 902efddba..70022a9b8 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -31,14 +31,17 @@ #include #include #include +#include #include #include #include #include #include +#include #include #define ZAPBACK_ALERT_PERIOD 15 // seconds +#define ADZAP_DATA "/tmp/adzap.data" static const struct button_label CAdZapMenuFooterButtons[] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_ADZAP_DISABLE }, @@ -167,9 +170,41 @@ void CAdZapMenu::Run() } } else if (armed) - sem_timedwait(&sem, &zapBackTime); + { + if (g_settings.adzap_writeData) + { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; + + sem_timedwait(&sem, &ts); + + int zp = g_settings.adzap_zapBackPeriod; + long int zb = zapBackTime.tv_sec + ZAPBACK_ALERT_PERIOD - ts.tv_sec; + + if (FILE *f = fopen(ADZAP_DATA, "w")) + { + fprintf(f, "%" PRIx64 "\n%s\n%d\n%d:%02d\n%ld\n%ld:%02ld\n", + channelId, + channelName.c_str(), + zp, + zp / 60, zp % 60, + zb, + zb / 60, zb % 60); + fclose(f); + } + else + printf("CAdZapMenu::%s: write data failed.\n", __func__); + } + else + sem_timedwait(&sem, &zapBackTime); + } else + { + if (access(ADZAP_DATA, F_OK) == 0) + unlink(ADZAP_DATA); sem_wait(&sem); + } if (armed) { @@ -262,20 +297,26 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) parent->hide(); monitor = false; - Settings(); + ShowMenu(); return res; } -void CAdZapMenu::Settings() +void CAdZapMenu::ShowMenu() { bool show_monitor = monitorLifeTime.tv_sec; - CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, "settings", width); + CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, NEUTRINO_ICON_SETTINGS, width); menu->addKey(CRCInput::RC_red, this, "disable"); menu->addKey(CRCInput::RC_green, this, "enable"); menu->addKey(CRCInput::RC_blue, this, "monitor"); - menu->addIntroItems(NONEXISTANT_LOCALE, LOCALE_ADZAP_SWITCHBACK); + menu->addIntroItems(); + + CMenuOptionChooser *oc = new CMenuOptionChooser(LOCALE_ADZAP_WRITEDATA, &g_settings.adzap_writeData, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + oc->setHint("", LOCALE_MENU_HINT_ADZAP_WRITEDATA); + menu->addItem(oc); + + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; for (int shortcut = 1; shortcut < 10; shortcut++) { diff --git a/src/gui/adzap.h b/src/gui/adzap.h index f68b39721..26b2eea62 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -50,7 +50,7 @@ class CAdZapMenu: public CMenuTarget CAdZapMenu(); void Init(); time_t getMonitorLifeTime(); - void Settings(); + void ShowMenu(); void Update(); void Run(void); static void *Run(void *arg); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0a581c21f..1a35f4d59 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -830,6 +830,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_search_history_size = g_settings.epg_search_history.size(); g_settings.adzap_zapBackPeriod = configfile.getInt32("adzap_zapBackPeriod", 180); + g_settings.adzap_writeData = configfile.getInt32("adzap_writeData", 0); // USERMENU -> in system/settings.h //------------------------------------------- @@ -1317,6 +1318,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); configfile.setInt32("uselastchannel", g_settings.uselastchannel); configfile.setInt32("adzap_zapBackPeriod", g_settings.adzap_zapBackPeriod); + configfile.setInt32("adzap_writeData", g_settings.adzap_writeData); //epg search g_settings.epg_search_history_size = g_settings.epg_search_history.size(); if (g_settings.epg_search_history_size > g_settings.epg_search_history_max) diff --git a/src/system/locals.h b/src/system/locals.h index 331a9fff6..dfac7511d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -143,6 +143,7 @@ typedef enum LOCALE_ADZAP_MINUTES, LOCALE_ADZAP_MONITOR, LOCALE_ADZAP_SWITCHBACK, + LOCALE_ADZAP_WRITEDATA, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, @@ -976,6 +977,8 @@ typedef enum LOCALE_MENU_HINT_A_PIC, LOCALE_MENU_HINT_ADZAP, LOCALE_MENU_HINT_ADZAP_ACTIVE, + LOCALE_MENU_HINT_ADZAP_SETUP, + LOCALE_MENU_HINT_ADZAP_WRITEDATA, LOCALE_MENU_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP, LOCALE_MENU_HINT_AUDIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f33bb62ab..47237fb20 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -143,6 +143,7 @@ const char * locale_real_names[] = "adzap.minutes", "adzap.monitor", "adzap.switchback", + "adzap.writedata", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", @@ -976,6 +977,8 @@ const char * locale_real_names[] = "menu.hint_a_pic", "menu.hint_adzap", "menu.hint_adzap_active", + "menu.hint_adzap_setup", + "menu.hint_adzap_writedata", "menu.hint_aplay", "menu.hint_aplay_setup", "menu.hint_audio", diff --git a/src/system/settings.h b/src/system/settings.h index c254c7184..0c0b86f01 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -731,6 +731,7 @@ struct SNeutrinoSettings //adzap int adzap_zapBackPeriod; + int adzap_writeData; int power_standby; int hdd_sleep; @@ -884,7 +885,6 @@ const int PARENTALLOCK_PROMPT_ONSTART = 1; const int PARENTALLOCK_PROMPT_CHANGETOLOCKED = 2; const int PARENTALLOCK_PROMPT_ONSIGNAL = 3; - class CScanSettings { public: From f3a4938585f504f3a79c308e7df5ac694c6bed21 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 11:08:44 +0100 Subject: [PATCH 227/690] adzap: add hint icon by fred_feuerstein Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1df41008a4aea16dc75ee82526512b25acb973be Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: add hint icon by fred_feuerstein --- data/icons/Makefile.am | 1 + data/icons/hint_adzap.png | Bin 0 -> 1940 bytes src/gui/adzap.cpp | 3 ++- src/gui/user_menue.cpp | 2 +- src/gui/widget/icons.h | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 data/icons/hint_adzap.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 8e519e47d..c662933d7 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -86,6 +86,7 @@ install_DATA += \ help_small.png \ hidden.png \ hint_a_pic.png \ + hint_adzap.png \ hint_aplay.png \ hint_audio.png \ hint_back.png \ diff --git a/data/icons/hint_adzap.png b/data/icons/hint_adzap.png new file mode 100644 index 0000000000000000000000000000000000000000..164cffcb76105d5f26c93e2be63063292d77463d GIT binary patch literal 1940 zcmV;F2W$9=P)w>jsxyw(S{p|OLA=GI@di<=9LBuvMgrNYkcS}r;WzV}O!B?`_WQlOeOXul zK12r$Ya2TdladM+tXQXm&EXhzTz5wo-T0_v1(+#K(bbq5GZ%!#Ndb$+VvIGxFm9LF zW5>J7O3GMlHv4Tghx?7u)tsJ?{9XiD(%enGC;^tCKzO_im|0jc##)U@R|5G9NJgCa zhq4pCsh*8}H;}Y!<+}@*TUi@*oW+pvSuA;-wzvG`zUfkhrJ+C%m);HI%v>d7Ir5s9 zTxms}z}g}7O||;E4+BYAc?~_hlR!dhHt6c$)a-HmPR@aX*h^17Eic&pPqg3fT?S#k1)d;Vl#7{wEon2y>$asq zp58#7y{g%BwTXZskx2`6>l`Nt!%}Px#`6%5&N{)C*J^d^epu{w>T^E5G0@v$u6v^>)-N*5(3w=I5>jGZRz5$gzRCZ>Iiw=`3>c$t8!y?c@}Z_lQ^Bmr$Lz)sHn);2nO zhtH(U1G9Y6PONZST>5L51-GsWlAmhmovFD-n}QgS^P-_xTSiZ$AENgejnDiqG z_peWHb6j}kwE6r8Rh%ShHj`e!wty1Yfh0h!O|z)%AAKig9Ecmakgf;h}7R;@L9SL5-otHemuv@bNB(IBEvS5oZ>n-viGEiC|X zcVS0^3@Iq4+H3v~6Vgk%9>l64D#Miz;GW`Y82?k%Yq>rd_u#Ig=TK4j1hQICn}+bu z{Mo1rnCw4g5tw}wqEdFJ4$`63YN5m8+l<_y^VRh^2tAeekZaSB?orE)6L1@^VM1diYUe3s=$_)h8+(N2L!;LQ0^7w-8MhQ^2zZQ7p z-*q7397I9=sIE~U?J6UuDu3Q6u=)m4T^e%6kt(V++$aGmc;pv__rRBDAqotE)XR*V zs{C1_z^Zbjx->-4#uB5p(E8wzK^xA38AT8UhQN{wj2uH?moajxYyUP1=aSaA`l zE)D7I6N@B3xCN(zusj`3#J~0D0rtA!QYA>LfQ5!ujTrss9@ol zhcIK$b;t@ut4mDT^%x**p|6&ZnWYyL2uII+ENHt11Qx*7hDE^+ zD$r7|TK#8u(3V=lH~lu@;=7a0=6v!l&Fe!Xw6ISghC~&K{Iee5pHN_IeRcZ(9Lr-37G_Mc(L4*}wWGWGk%YO<2 zwn33($xVzWp#RBaM?pUUG_PN)^bd}Jf(u?f`=a-6c72Vvg%G#vg zJzBH*hM;E69Shi`!TmDtafQUFRxZ!ui>+r+-}an(`8Ek24=1N^FzztW^o)Lp5Ah-1 aWBdo!M+@gDIaddIntroItems(); CMenuOptionChooser *oc = new CMenuOptionChooser(LOCALE_ADZAP_WRITEDATA, &g_settings.adzap_writeData, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - oc->setHint("", LOCALE_MENU_HINT_ADZAP_WRITEDATA); + oc->setHint(NEUTRINO_ICON_HINT_ADZAP, LOCALE_MENU_HINT_ADZAP_WRITEDATA); menu->addItem(oc); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); @@ -326,6 +326,7 @@ void CAdZapMenu::ShowMenu() bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); forwarders[shortcut - 1]->setMarked(selected); + forwarders[shortcut - 1]->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); menu->addItem(forwarders[shortcut - 1], selected); minute = LOCALE_ADZAP_MINUTES; } diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 95ee64bc6..511b0cf7b 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -378,7 +378,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_ADZAP: keyhelper.get(&key,&icon,CRCInput::RC_blue); menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, adzap_active ? g_Locale->getText(LOCALE_OPTIONS_OFF) : NULL, neutrino, "adzap", key, icon); - menu_item->setHint("", adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP); + menu_item->setHint(NEUTRINO_ICON_HINT_ADZAP, adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP); break; #if 0 case SNeutrinoSettings::ITEM_TUNER_RESTART: diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 2b5264475..5f380c7c8 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -204,6 +204,7 @@ #define NEUTRINO_ICON_HINT_SHUTDOWN "hint_shutdown" #define NEUTRINO_ICON_HINT_INFO "hint_info" #define NEUTRINO_ICON_HINT_CI "hint_ci" +#define NEUTRINO_ICON_HINT_ADZAP "hint_adzap" /* media */ #define NEUTRINO_ICON_HINT_APLAY "hint_aplay" #define NEUTRINO_ICON_HINT_INET_RADIO "hint_inetradio" From 87689bdf1e87e693013aa7da52b492e6c3b584fd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 14:00:09 +0100 Subject: [PATCH 228/690] adzap: use adzap-thread in epg view; remove pseudo timertype ADZAP Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/19154192db0ebe87240e9268248f63dd71c1b460 Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: use adzap-thread in epg view; remove pseudo timertype ADZAP --- lib/timerdclient/timerdclient.cpp | 15 +------ lib/timerdclient/timerdclient.h | 13 ------ lib/timerdclient/timerdtypes.h | 3 +- src/gui/epgview.cpp | 72 +++++++++++++++---------------- src/gui/epgview.h | 2 +- src/neutrino.cpp | 2 - src/system/settings.h | 1 - src/timerd/timermanager.cpp | 3 -- 8 files changed, 39 insertions(+), 72 deletions(-) diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index c6b62b6f0..f25f8ffcf 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -28,7 +28,6 @@ #include #include -int CTimerdClient::adzap_eventID = 0; unsigned char CTimerdClient::getVersion () const { return CTimerdMsg::ACTVERSION; @@ -296,11 +295,6 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, return -1; } } - bool adzaptimer = false; - if(evType == CTimerd::TIMER_ADZAP){ - evType = CTimerd::TIMER_ZAPTO; - adzaptimer = true; - } CTimerd::TransferEventInfo tei; CTimerd::TransferRecordingInfo tri; CTimerdMsg::commandAddTimer msgAddTimer; @@ -317,8 +311,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, } /* else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || */ else if (evType == CTimerd::TIMER_ZAPTO || - evType == CTimerd::TIMER_IMMEDIATE_RECORD || - evType == CTimerd::TIMER_ADZAP) + evType == CTimerd::TIMER_IMMEDIATE_RECORD) { CTimerd::EventInfo *ei=static_cast(data); tei.apids = ei->apids; @@ -367,18 +360,12 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, receive_data((char*)&response, sizeof(response)); close_connection(); - if(adzaptimer){ - adzap_eventID = response.eventID;//set adzap flag - } return( response.eventID); } //------------------------------------------------------------------------- void CTimerdClient::removeTimerEvent( int evId) { - if(evId == adzap_eventID) - adzap_eventID = 0;//reset adzap flag - CTimerdMsg::commandRemoveTimer msgRemoveTimer; msgRemoveTimer.eventID = evId; diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 157c8f0f0..212f94cfa 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -61,7 +61,6 @@ class CTimerdClient:private CBasicClient void registerEvent(unsigned int eventID, unsigned int clientID, const char * const udsName); void unRegisterEvent(unsigned int eventID, unsigned int clientID); - static int adzap_eventID; bool isTimerdAvailable(); // check if timerd is running @@ -153,18 +152,6 @@ class CTimerdClient:private CBasicClient eventInfo.recordingSafety = false; return addTimerEvent(CTimerd::TIMER_ZAPTO, &eventInfo, announcetime, alarmtime, stoptime); }; - // adds new adzap timer event //pseudo TIMER_ADZAP - int addAdZaptoTimerEvent(const t_channel_id channel_id, time_t alarmtime) - { - CTimerd::EventInfo eventInfo; - eventInfo.channel_id = channel_id; - eventInfo.epgID = 1; - eventInfo.epg_starttime = 0; - eventInfo.apids = 0; - eventInfo.recordingSafety = false; - return addTimerEvent(CTimerd::TIMER_ADZAP, &eventInfo, 0, alarmtime, 0); - }; - #if 0 int addNextProgramTimerEvent(CTimerd::EventInfo eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0) diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index a741318d6..7e5146771 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -68,8 +68,7 @@ class CTimerd TIMER_REMIND, TIMER_SLEEPTIMER, TIMER_EXEC_PLUGIN, - TIMER_IMMEDIATE_RECORD, - TIMER_ADZAP + TIMER_IMMEDIATE_RECORD }; enum CTimerEventStates diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 97deca924..1a4715062 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -671,9 +672,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - bool wzap = isCurrentEPG(channel_id); // show Timer Event Buttons - showTimerEventBar (true,wzap); + showTimerEventBar (true, isCurrentEPG(channel_id)); //show progressbar if ( epg_done!= -1 ) @@ -783,24 +783,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_page_up: if(isCurrentEPG(channel_id)){ - if(g_settings.wzap_time> 14) - g_settings.wzap_time+=5; - else - g_settings.wzap_time++; - if(g_settings.wzap_time>60) - g_settings.wzap_time = 0; + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + if (zapBackPeriod < 9) + zapBackPeriod++; + if (zapBackPeriod > 9) + zapBackPeriod = 9; + g_settings.adzap_zapBackPeriod = zapBackPeriod * 60; showTimerEventBar(true, true); } break; case CRCInput::RC_page_down: if(isCurrentEPG(channel_id)){ - if(g_settings.wzap_time> 19) - g_settings.wzap_time-=5; - else - g_settings.wzap_time--; - - if(g_settings.wzap_time<0) - g_settings.wzap_time = 60; + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + if (zapBackPeriod > 1) + zapBackPeriod--; + if (zapBackPeriod < 1) + zapBackPeriod = 1; + g_settings.adzap_zapBackPeriod = zapBackPeriod * 60; showTimerEventBar(true, true); } break; @@ -889,20 +888,20 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 31.05.2002 dirch zapto timer case CRCInput::RC_yellow: { - //CTimerdClient timerdclient; - if (g_Timerd->isTimerdAvailable()) + if (isCurrentEPG(channel_id)) + { + CAdZapMenu::getInstance()->exec(NULL, "enable"); + loop = false; + } + //CTimerdClient timerdclient; + else if (g_Timerd->isTimerdAvailable()) { - if(!g_Timerd->adzap_eventID && g_settings.wzap_time && isCurrentEPG(channel_id)){ - g_Timerd->addAdZaptoTimerEvent(channel_id, - time (NULL) + (g_settings.wzap_time * 60)); - loop = false; - }else{ - g_Timerd->addZaptoTimerEvent(channel_id, - epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), - epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, - epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - } + g_Timerd->addZaptoTimerEvent(channel_id, + epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), + epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, + epgData.eventID, epgData.epg_times.startzeit, 0); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else @@ -1170,7 +1169,7 @@ const struct button_label EpgButtons[] = }; -void CEpgData::showTimerEventBar (bool pshow, bool webzap) +void CEpgData::showTimerEventBar (bool pshow, bool adzap) { int x,y,h,fh; @@ -1192,16 +1191,17 @@ void CEpgData::showTimerEventBar (bool pshow, bool webzap) frameBuffer->paintBoxRel(sx,y,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);//round /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); - std::string tmp_but_name; - if(g_settings.wzap_time && webzap && !g_Timerd->adzap_eventID){ - tmp_but_name = g_Locale->getText(LOCALE_ADZAP); - tmp_but_name += " "+ to_string(g_settings.wzap_time) + " "; - tmp_but_name += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + std::string adzap_button; + if (adzap) + { + adzap_button = g_Locale->getText(LOCALE_ADZAP); + adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; + adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),1); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 2); else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),0); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); #if 0 // Button: Timer Record & Channelswitch diff --git a/src/gui/epgview.h b/src/gui/epgview.h index c15b00f5d..e45b706cc 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -87,7 +87,7 @@ class CEpgData void showText( int startPos, int ypos ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); - void showTimerEventBar(bool show, bool webzap=false); + void showTimerEventBar(bool show, bool adzap = false); bool isCurrentEPG(const t_channel_id channel_id); public: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1a35f4d59..7239ff10c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -484,7 +484,6 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); - g_settings.wzap_time = configfile.getInt32("wzap_time", 3 ); g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); @@ -1058,7 +1057,6 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); - configfile.setInt32("wzap_time" , g_settings.wzap_time ); configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); //audio diff --git a/src/system/settings.h b/src/system/settings.h index 0c0b86f01..a6cc0b6c8 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -196,7 +196,6 @@ struct SNeutrinoSettings int infobar_show_res; int infobar_show_tuner; int infobar_show_dd_available; - int wzap_time; //audio int audio_AnalogMode; int audio_DolbyDigital; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index ff6757cd0..404a07225 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1294,9 +1294,6 @@ void CTimerEvent_Zapto::announceEvent() //------------------------------------------------------------ void CTimerEvent_Zapto::fireEvent() { - if(CTimerdClient::adzap_eventID == eventID) - CTimerdClient::adzap_eventID = 0;//reset adzap flag - CTimerManager::getInstance()->getEventServer()->sendEvent(CTimerdClient::EVT_ZAPTO, CEventServer::INITID_TIMERD, &eventInfo, From 091b14fb596e00eb8a5eba35faf0ef891361352e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Feb 2016 22:44:06 +0100 Subject: [PATCH 229/690] adzap: call adzap directly from usermenu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2b0996e3d3ade949a9a71962f44a47c2574cff40 Author: vanhofen Date: 2016-02-29 (Mon, 29 Feb 2016) Origin message was: ------------------ - adzap: call adzap directly from usermenu --- src/gui/user_menue.cpp | 2 +- src/neutrino.cpp | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 511b0cf7b..925d95011 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -377,7 +377,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) break; case SNeutrinoSettings::ITEM_ADZAP: keyhelper.get(&key,&icon,CRCInput::RC_blue); - menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, adzap_active ? g_Locale->getText(LOCALE_OPTIONS_OFF) : NULL, neutrino, "adzap", key, icon); + menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, adzap_active ? g_Locale->getText(LOCALE_OPTIONS_OFF) : NULL, CAdZapMenu::getInstance(), "adzap", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_ADZAP, adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP); break; #if 0 diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7239ff10c..9c9a54919 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4003,13 +4003,6 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) exit(1); } } - else if(actionKey == "adzap") { - CAdZapMenu::getInstance()->exec(parent, "adzap"); - if (CAdZapMenu::getInstance()->isActive()) - return menu_return::RETURN_EXIT_ALL; - else - return menu_return::RETURN_REPAINT; - } else if(actionKey == "moviedir") { parent->hide(); From 3a61fd5cbf2ca34016cb2b09f9a3ba1c458ed378 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 1 Mar 2016 09:53:55 +0100 Subject: [PATCH 230/690] adzap: allow user-definable zap back time > 9 min Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca6d1f69ee024c0b1a3bc0cc03d624ae1446d13b Author: vanhofen Date: 2016-03-01 (Tue, 01 Mar 2016) Origin message was: ------------------ - adzap: allow user-definable zap back time > 9 min --- src/gui/adzap.cpp | 21 ++++++++++++++++++++- src/gui/adzap.h | 4 +++- src/gui/epgview.cpp | 6 +++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 9a14efbec..d9b693fc3 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -62,7 +62,7 @@ CAdZapMenu *CAdZapMenu::getInstance() CAdZapMenu::CAdZapMenu() { frameBuffer = CFrameBuffer::getInstance(); - width = 40; + width = 35; sem_init(&sem, 0, 0); @@ -289,6 +289,7 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; for (int shortcut = 1; shortcut < 10; shortcut++) forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod); + nc->setMarked(false); g_settings.adzap_zapBackPeriod *= 60; return menu_return::RETURN_REPAINT; } @@ -331,9 +332,27 @@ void CAdZapMenu::ShowMenu() minute = LOCALE_ADZAP_MINUTES; } + menu->addItem(GenericMenuSeparator); + + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + nc = new CMenuOptionNumberChooser(minute, &zapBackPeriod, true, 10, 120, this, CRCInput::RC_0); + nc->setMarked(g_settings.adzap_zapBackPeriod / 60 > 9); + nc->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); + menu->addItem(nc); + menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount - (show_monitor ? 0 : 1)); menu->exec(NULL, ""); menu->hide(); delete menu; Update(); } + +bool CAdZapMenu::changeNotify(const neutrino_locale_t, void * data) +{ + int z = (*(int *)data); + g_settings.adzap_zapBackPeriod = z * 60; + for (int shortcut = 1; shortcut < 10; shortcut++) + forwarders[shortcut - 1]->setMarked(false); + nc->setMarked(true); + return false; +} diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 26b2eea62..1317e5019 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -31,7 +31,7 @@ #include #include -class CAdZapMenu: public CMenuTarget +class CAdZapMenu: public CMenuTarget, CChangeObserver { private: CFrameBuffer * frameBuffer; @@ -43,6 +43,7 @@ class CAdZapMenu: public CMenuTarget struct timespec zapBackTime; std::string channelName; CMenuForwarder *forwarders[9]; + CMenuOptionNumberChooser *nc; CChannelEventList evtlist; struct timespec monitorLifeTime; t_channel_id channelId; @@ -57,6 +58,7 @@ class CAdZapMenu: public CMenuTarget public: static CAdZapMenu *getInstance(); int exec(CMenuTarget * parent, const std::string & actionKey); + bool changeNotify(const neutrino_locale_t, void * data); bool isActive() { return (armed || monitor); }; }; #endif // __adzap__ diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 1a4715062..dfd7bcd24 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -784,10 +784,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start case CRCInput::RC_page_up: if(isCurrentEPG(channel_id)){ int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; - if (zapBackPeriod < 9) + if (zapBackPeriod < 120) zapBackPeriod++; - if (zapBackPeriod > 9) - zapBackPeriod = 9; + if (zapBackPeriod > 120) + zapBackPeriod = 120; g_settings.adzap_zapBackPeriod = zapBackPeriod * 60; showTimerEventBar(true, true); } From 5b3b2b19c1aec6f97be3bfb675043c0517fb0f03 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Mar 2016 20:49:58 +0100 Subject: [PATCH 231/690] src/nhttpd/tuxboxapi/controlapi.cpp fix 64bit AddressSanitizer: heap-buffer-overflow Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9fc9b228ed9ab2b2cbe9ce7a3211814a5c72ad96 Author: Jacek Jendrzej Date: 2016-03-03 (Thu, 03 Mar 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 43d769619..68db0a057 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -347,8 +347,8 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) if (hh->ParamList["1"] == "radio") // switch to radio mode { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ - int mode = NeutrinoMessages::mode_radio; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + neutrino_msg_data_t mode = NeutrinoMessages::mode_radio; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(neutrino_msg_data_t)); sleep(1); NeutrinoAPI->UpdateBouquets(); }else{ @@ -359,8 +359,8 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) else if (hh->ParamList["1"] == "tv") // switch to tv mode { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ - int mode = NeutrinoMessages::mode_tv; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + neutrino_msg_data_t mode = NeutrinoMessages::mode_tv; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(neutrino_msg_data_t)); sleep(1); NeutrinoAPI->UpdateBouquets(); }else{ From a5aec06a6e70cfcf54bc45c2df2087c67b688eb6 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 4 Mar 2016 13:03:32 +0300 Subject: [PATCH 232/690] gui/movieplayer.cpp: split live url via lua code to be used from other code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/54d26aed1c7bf0bb234b3a6960a5e7deed928160 Author: [CST] Focus Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/movieplayer.cpp | 121 +++++++++++++++++++++------------------- src/gui/movieplayer.h | 3 +- 2 files changed, 66 insertions(+), 58 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index da809484a..11e8a8e19 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -202,9 +202,6 @@ void CMoviePlayerGui::Init(void) blockedFromPlugin = false; m_screensaver = false; m_idletime = time(NULL); - liveStreamList.clear(); - livestreamInfo1.clear(); - livestreamInfo2.clear(); } void CMoviePlayerGui::cutNeutrino() @@ -856,6 +853,68 @@ bool CMoviePlayerGui::selectLivestream(std::vector &streamLis return false; } +bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2) +{ + static t_channel_id oldChan = 0; + static std::vector liveStreamList; + livestream_info_t info; + + if (script.empty()) { + realUrl = url; + return true; + } + std::string _script = script; + + if (_script.find("/") == std::string::npos) + _script = g_settings.livestreamScriptPath + "/" + _script; + + size_t pos = _script.find(".lua"); + if (!file_exists(_script.c_str()) || (pos == std::string::npos) || (_script.length()-pos != 4)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] script error\n", __file__, __func__, __LINE__); + return false; + } + if ((oldChan != chan) || liveStreamList.empty()) { + liveStreamList.clear(); + if (!luaGetUrl(_script, url, liveStreamList)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] lua script error\n", __file__, __func__, __LINE__); + return false; + } + oldChan = chan; + } + + if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] error selectLivestream\n", __file__, __func__, __LINE__); + return false; + } + + realUrl = info.url; + if (!info.name.empty()) { + info1 = info.name; + _pretty_name = info.name; + } +#if 0 + if (!info.resolution.empty()) + info2 = info.resolution; + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + info2 += (std::string)", " + (std::string)buf; + } +#else + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + info2 = (std::string)buf; + } +#endif + return true; +} + bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script) { printf("%s: starting...\n", __func__); @@ -888,62 +947,10 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st } } - static t_channel_id oldChan = 0; std::string realUrl = file; - std::string _script = script; std::string _pretty_name = name; - livestream_info_t info; - if (!_script.empty()) { - if (_script.find("/") == std::string::npos) - _script = g_settings.livestreamScriptPath + "/" + _script; - - size_t pos = _script.find(".lua"); - if ((file_exists(_script.c_str())) && (pos != std::string::npos) && (_script.length()-pos == 4)) { - if ((oldChan != chan) || liveStreamList.empty()) { - liveStreamList.clear(); - if (!luaGetUrl(_script, file, liveStreamList)) { - liveStreamList.clear(); - printf(">>>>> [%s:%s:%d] lua script error\n", __file__, __func__, __LINE__); - return false; - } - oldChan = chan; - } - - if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) { - liveStreamList.clear(); - printf(">>>>> [%s:%s:%d] error selectLivestream\n", __file__, __func__, __LINE__); - return false; - } - - realUrl = info.url; - if (!info.name.empty()) { - livestreamInfo1 = info.name; - _pretty_name = info.name; - } -#if 0 - if (!info.resolution.empty()) - livestreamInfo2 = info.resolution; - if (info.bandwidth > 0) { - char buf[32]; - memset(buf, '\0', sizeof(buf)); - snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); - livestreamInfo2 += (std::string)", " + (std::string)buf; - } -#else - if (info.bandwidth > 0) { - char buf[32]; - memset(buf, '\0', sizeof(buf)); - snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); - livestreamInfo2 = (std::string)buf; - } -#endif - } - else { - liveStreamList.clear(); - printf(">>>>> [%s:%s:%d] script error\n", __file__, __func__, __LINE__); - return false; - } - } + if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2)) + return false; OpenThreads::ScopedLock m_lock(mutex); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 1c9d55f2a..5219d84c2 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -171,7 +171,7 @@ class CMoviePlayerGui : public CMenuTarget std::string Path_local; int menu_ret; bool autoshot_done; - std::vector liveStreamList; + //std::vector liveStreamList; /* playback from bookmark */ static CBookmarkManager * bookmarkmanager; @@ -261,6 +261,7 @@ class CMoviePlayerGui : public CMenuTarget bool getBlockedFromPlugin() { return blockedFromPlugin; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; }; + bool getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2); }; #endif From fa9ecede2c5a659584ee16eac7dc65de9676a1ca Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 4 Mar 2016 13:04:17 +0300 Subject: [PATCH 233/690] driver/record.cpp: fix webtv record for live urls via lua plugins Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e65e72c7204e8b4b8394de7cb911c32d7d8a835 Author: [CST] Focus Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/driver/record.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index fb4211c20..38e72ec7e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1894,7 +1894,6 @@ void CStreamRec::GetPids(CZapitChannel * channel) void CStreamRec::FillMovieInfo(CZapitChannel * channel, APIDList & apid_list) { - CRecordInstance::FillMovieInfo(channel, apid_list); recMovieInfo->VideoType = 0; for (unsigned i = 0; i < ofcx->nb_streams; i++) { @@ -2014,13 +2013,14 @@ record_error_msg_t CStreamRec::Record() return ret; } + CRecordInstance::FillMovieInfo(channel, apid_list); if (!Open(channel) || !Start()) { Close(); hintBox.hide(); return RECORD_FAILURE; } - FillMovieInfo(channel, apid_list); + SaveXml(); if(recording_id == 0) { time_t now = time(NULL); @@ -2062,6 +2062,12 @@ bool CStreamRec::Open(CZapitChannel * channel) if (url.empty()) return false; + std::string pretty_name; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, recMovieInfo->epgInfo1, recMovieInfo->epgInfo2)) { + printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); + return false; + } + //av_log_set_level(AV_LOG_VERBOSE); av_register_all(); avcodec_register_all(); From 43f91c0db972b0ed1be491de390db00448415047 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 4 Mar 2016 13:04:34 +0300 Subject: [PATCH 234/690] driver/streamts.cpp: fix webtv streaming for live urls via lua plugins Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a19083f60dc5b618a4cc115b7abc974bd9fab7f7 Author: [CST] Focus Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/driver/streamts.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index c4c7f4326..1554ce230 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include /* experimental mode: @@ -764,6 +765,12 @@ bool CStreamStream::Open() if (url.empty()) return false; + std::string pretty_name, livestreamInfo1, livestreamInfo2; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, livestreamInfo1, livestreamInfo2)) { + printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); + return false; + } + //av_log_set_level(AV_LOG_VERBOSE); av_register_all(); avcodec_register_all(); From f39fd3de29a3c3b805b2f93142c826a679419a30 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:02 +0100 Subject: [PATCH 235/690] Sort locales Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2dee0e1047e50f4509b2e5083460d5f24303b7d4 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/system/locals.h | 2 +- src/system/locals_intern.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3aadf2bed..70e5504d4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1789,9 +1789,9 @@ movieplayer.bookmarkname Bookmark Name movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel -movieplayer.plugin Movieplayer-Plugin movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer +movieplayer.plugin Movieplayer-Plugin movieplayer.starting Wiedergabe starten... movieplayer.titles Titel movieplayer.toomanybookmarks Sie haben bereits zu viele Lesezeichen angelegt.\nEs muß erst ein anderes gelöscht werden. diff --git a/data/locale/english.locale b/data/locale/english.locale index 36e9e06c2..9e5391b59 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1789,9 +1789,9 @@ movieplayer.bookmarkname Bookmarkname movieplayer.bookmarkname_hint1 Enter a name for your new bookmark movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters -movieplayer.plugin Movieplayer plugin movieplayer.fileplayback File play movieplayer.head Movieplayer +movieplayer.plugin Movieplayer plugin movieplayer.starting Starting playback... movieplayer.titles Titles movieplayer.toomanybookmarks There are too many bookmarks.\nYou need to delete one of them first. diff --git a/src/system/locals.h b/src/system/locals.h index dfac7511d..3bed3f77c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1816,9 +1816,9 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, - LOCALE_MOVIEPLAYER_PLUGIN, LOCALE_MOVIEPLAYER_FILEPLAYBACK, LOCALE_MOVIEPLAYER_HEAD, + LOCALE_MOVIEPLAYER_PLUGIN, LOCALE_MOVIEPLAYER_STARTING, LOCALE_MOVIEPLAYER_TITLES, LOCALE_MOVIEPLAYER_TOOMANYBOOKMARKS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 47237fb20..24eb84ac0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1816,9 +1816,9 @@ const char * locale_real_names[] = "movieplayer.bookmarkname_hint1", "movieplayer.bookmarkname_hint2", "movieplayer.chapters", - "movieplayer.plugin", "movieplayer.fileplayback", "movieplayer.head", + "movieplayer.plugin", "movieplayer.starting", "movieplayer.titles", "movieplayer.toomanybookmarks", From e08f9dc6bf23f6571f3524e00066c466c7bf764d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:11 +0100 Subject: [PATCH 236/690] src/driver/record.cpp: Fix compiler warning Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a92d7bd037f3bd07449cd636d4e3756844ad649f Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/driver/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 38e72ec7e..b642a6b74 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1892,7 +1892,7 @@ void CStreamRec::GetPids(CZapitChannel * channel) channel = channel; } -void CStreamRec::FillMovieInfo(CZapitChannel * channel, APIDList & apid_list) +void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_list*/) { recMovieInfo->VideoType = 0; From f2791f7f9c6d7ba2652f55df57937796f647b1a2 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 4 Mar 2016 13:57:14 +0100 Subject: [PATCH 237/690] neutrino-mp tmdb -> neutrino-hd Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f07b01b4187e4d37f322be9fce452703640961fa Author: TangoCash Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/Makefile.am | 1 + src/gui/epgview.cpp | 70 +++++++- src/gui/epgview.h | 5 +- src/gui/moviebrowser.cpp | 41 +++++ src/gui/tmdb.cpp | 345 +++++++++++++++++++++++++++++++++++++++ src/gui/tmdb.h | 84 ++++++++++ 6 files changed, 539 insertions(+), 7 deletions(-) create mode 100644 src/gui/tmdb.cpp create mode 100644 src/gui/tmdb.h diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 8a275ac33..d9cb6931e 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -98,6 +98,7 @@ libneutrino_gui_a_SOURCES = \ subchannel_select.cpp \ themes.cpp \ timeosd.cpp \ + tmdb.cpp \ update.cpp \ update_ext.cpp \ update_menue.cpp \ diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index dfd7bcd24..70abe52f7 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -118,6 +120,7 @@ CEpgData::CEpgData() { bigFonts = false; frameBuffer = CFrameBuffer::getInstance(); + tmdbtoggle = false; } void CEpgData::start() @@ -182,7 +185,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (tmdbtoggle? (std::min((sb-10)*342/513,342)) :0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -217,12 +220,15 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 addTextToArray( aktLine + aktWord, screening ); } -void CEpgData::showText( int startPos, int ypos ) +void CEpgData::showText( int startPos, int ypos, bool cover ) { // recalculate medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); medlinecount = sb / medlineheight; + int cover_height = std::min(sb-10,513); + int cover_width = std::min((sb-10)*342/513,342); + int cover_offset = cover ? cover_width+3 : 0; int textSize = epgText.size(); int y=ypos; const char tok = ' '; @@ -236,6 +242,9 @@ void CEpgData::showText( int startPos, int ypos ) max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ")); } frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + if (cover) { + if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, 1)) + cover_offset = 0; } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { if(epgText[i].second){ @@ -262,7 +271,18 @@ void CEpgData::showText( int startPos, int ypos ) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT); + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT); + } + } + + if (stars > 0 && startPos == 0){ + int icon_w,icon_h; + frameBuffer->getIconSize(ICONSDIR"/star-off.png", &icon_w, &icon_h); + for (int i=1; i < 11;i++) { + frameBuffer->paintIcon(ICONSDIR"/star-off.png", sx+3+cover_offset+i*icon_w+3, ypos+3); + } + for (int i=1; i < stars+1;i++) { + frameBuffer->paintIcon(ICONSDIR"/star-on.png", sx+3+cover_offset+i*icon_w+3, ypos+3); } } @@ -458,6 +478,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start startzeit=*a_startzeit; id=a_id; + tmdbtoggle = false; + stars = 0; + CComponentsHeader* header = NULL; CComponentsPicture* headerPic = NULL; CComponentsText* headerText = NULL; @@ -770,7 +793,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (showPos+scrollCountgetResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + if (tmdb->hasCover()) { + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + processTextToArray(tmdb->CreateEPGText()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + tmdbtoggle = !tmdbtoggle; + } + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + if (tmdb) + delete tmdb; + } else { + epgText.clear(); + epgText = epgText_saved; + textCount = epgText.size(); + stars=0; + showText(showPos, sy + toph); + tmdbtoggle = !tmdbtoggle; + } + break; + } // 31.05.2002 dirch zapto timer case CRCInput::RC_yellow: @@ -932,7 +990,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } break; } - case CRCInput::RC_info: case CRCInput::RC_help: bigFonts = bigFonts ? false : true; frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); @@ -1165,6 +1222,7 @@ const struct button_label EpgButtons[] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } }; diff --git a/src/gui/epgview.h b/src/gui/epgview.h index e45b706cc..b1567b8bb 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -64,6 +64,8 @@ class CEpgData bool bigFonts; bool has_follow_screenings; bool call_fromfollowlist; + bool tmdbtoggle; + int stars; time_t tmp_curent_zeit; uint64_t prev_id; @@ -76,6 +78,7 @@ class CEpgData int textCount; typedef std::pair epg_pair; std::vector epgText; + std::vector epgText_saved; int topheight,topboxheight; int buttonheight,botboxheight; int medlineheight,medlinecount; @@ -84,7 +87,7 @@ class CEpgData void GetPrevNextEPGData( uint64_t id, time_t* startzeit ); void addTextToArray( const std::string & text, int screening ); void processTextToArray(std::string text, int screening = 0); - void showText( int startPos, int ypos ); + void showText( int startPos, int ypos, bool cover= false ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); void showTimerEventBar(bool show, bool adzap = false); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 66077c183..8218eea66 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -45,6 +45,7 @@ #include #include "moviebrowser.h" #include "filebrowser.h" +#include #include #include #include @@ -1981,6 +1982,46 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } + else if (msg == CRCInput::RC_favorites) + { + if (m_movieSelectionHandler != NULL) { +#if 0 + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()) + unlink(fname.c_str()); + refresh(); + } +#else + std::string fname = m_movieSelectionHandler->file.Name.c_str(); + int ext_pos = 0; + ext_pos = fname.rfind('.'); + if( ext_pos > 0) { + std::string extension; + extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = "." + extension; + strReplace(fname, extension.c_str(), ".jpg"); + } + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + if (!access(fname, F_OK)) { + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if (!fname.empty()) + unlink(fname.c_str()); + refresh(); + } + } else { + cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); + if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { + if (!fname.empty()) + if (tmdb->getSmallCover(fname)) + refresh(); + } + if (tmdb) + delete tmdb; + } +#endif + } + } else { //TRACE("[mb]->onButtonPressMainFrame none\n"); diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp new file mode 100644 index 000000000..688ecacfb --- /dev/null +++ b/src/gui/tmdb.cpp @@ -0,0 +1,345 @@ +/* + Copyright (C) 2015 TangoCash + + License: GPLv2 + + 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; + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "system/settings.h" +#include "system/helpers.h" +#include "system/set_threadname.h" + +#include + +#include +#include + +#include "tmdb.h" + +#if LIBCURL_VERSION_NUM < 0x071507 +#include +#endif + +#define URL_TIMEOUT 60 +#define API_KEY_1 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +#define API_KEY_2 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +#define API_KEY_3 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +#define API_KEY_4 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +#define TMDB_COVER "/tmp/tmdb.jpg" + +cTmdb::cTmdb(std::string epgtitle) +{ + frameBuffer = CFrameBuffer::getInstance(); + minfo.epgtitle = epgtitle; + curl_handle = curl_easy_init(); + form = NULL; + + ox = frameBuffer->getScreenWidthRel(false); + oy = frameBuffer->getScreenHeightRel(false); + + int buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; + toph = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight() + 6; + + sx = getScreenStartX(ox); + sy = getScreenStartY(oy + buttonheight); /* button box is handled separately (why?) */ + + + GetMovieDetails(); +} + +cTmdb::~cTmdb() +{ + curl_easy_cleanup(curl_handle); + delete form; +} + +size_t cTmdb::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) +{ + if (size * nmemb > 0) { + std::string* pStr = (std::string*) data; + pStr->append((char*) ptr, nmemb); + } + return size*nmemb; +} + +std::string cTmdb::decodeUrl(std::string url) +{ + char * str = curl_easy_unescape(curl_handle, url.c_str(), 0, NULL); + if (str) + url = str; + curl_free(str); + return url; +} + +std::string cTmdb::encodeUrl(std::string txt) +{ + char * str = curl_easy_escape(curl_handle, txt.c_str(), txt.length()); + if (str) + txt = str; + curl_free(str); + return txt; +} + +bool cTmdb::getUrl(std::string &url, std::string &answer, CURL *_curl_handle) +{ + printf("[TMDB]: %s\n",__func__); + if (!_curl_handle) + _curl_handle = curl_handle; + + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, &cTmdb::CurlWriteToString); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, (void *)&answer); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(_curl_handle, CURLOPT_SSL_VERIFYPEER, false); + + if (!g_settings.softupdate_proxyserver.empty()) { + curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str()); + if (!g_settings.softupdate_proxyusername.empty()) { + std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword; + curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str()); + } + } + + char cerror[CURL_ERROR_SIZE]; + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); + + printf("try to get [%s] ...\n", url.c_str()); + CURLcode httpres = curl_easy_perform(_curl_handle); + + printf("http: res %d size %d\n", httpres, (int)answer.size()); + + if (httpres != 0 || answer.empty()) { + printf("error: %s\n", cerror); + return false; + } + return true; +} + +bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle) +{ + if (!_curl_handle) + _curl_handle = curl_handle; + + FILE * fp = fopen(file.c_str(), "wb"); + if (fp == NULL) { + perror(file.c_str()); + return false; + } + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, NULL); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, fp); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(_curl_handle, CURLOPT_SSL_VERIFYPEER, false); + + if (!g_settings.softupdate_proxyserver.empty()) { + curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str()); + if (!g_settings.softupdate_proxyusername.empty()) { + std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword; + curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str()); + } + } + + char cerror[CURL_ERROR_SIZE]; + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); + + printf("try to get [%s] ...\n", url.c_str()); + CURLcode httpres = curl_easy_perform(_curl_handle); + + double dsize; + curl_easy_getinfo(_curl_handle, CURLINFO_SIZE_DOWNLOAD, &dsize); + fclose(fp); + + printf("http: res %d size %g.\n", httpres, dsize); + + if (httpres != 0) { + printf("curl error: %s\n", cerror); + unlink(file.c_str()); + return false; + } + return true; +} +std::string cTmdb::random_API_KEY() +{ + std::string keys[] = {API_KEY_1,API_KEY_2,API_KEY_3,API_KEY_4}; + int i = rand() % (sizeof(keys) / sizeof(keys[0])); + return keys[i]; +} + + +bool cTmdb::GetMovieDetails() +{ + printf("[TMDB]: %s\n",__func__); + std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+random_API_KEY()+"&language=de&query=" + encodeUrl(minfo.epgtitle); + std::string answer; + if (!getUrl(url, answer)) + return false; + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(answer, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + return false; + } + + minfo.result = root.get("total_results",0).asInt(); + + printf("[TMDB]: results: %d\n",minfo.result); + + if (minfo.result > 0) { + Json::Value elements = root["results"]; + minfo.id = elements[0].get("id",-1).asInt(); + minfo.media_type = elements[0].get("media_type","").asString(); + if (minfo.id > -1) { + url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+random_API_KEY()+"&language=de&append_to_response=credits"; + answer.clear(); + if (!getUrl(url, answer)) + return false; + parsedSuccess = reader.parse(answer, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + return false; + } + + minfo.overview = root.get("overview","").asString(); + minfo.poster_path = root.get("poster_path","").asString(); + minfo.original_title = root.get("original_title","").asString();; + minfo.release_date = root.get("release_date","").asString();; + minfo.vote_average = root.get("vote_average","").asString();; + minfo.vote_count = root.get("vote_count",0).asInt();; + minfo.runtime = root.get("runtime",0).asInt();; + if (minfo.media_type == "tv") { + minfo.original_title = root.get("original_name","").asString();; + minfo.episodes = root.get("number_of_episodes",0).asInt();; + minfo.seasons = root.get("number_of_seasons",0).asInt();; + minfo.release_date = root.get("first_air_date","").asString();; + elements = root["episode_run_time"]; + minfo.runtimes = elements[0].asString(); + for (unsigned int i= 1; igetText(LOCALE_EPGVIEWER_LENGTH)+": "+minfo.runtimes+"\n"; + else + epgtext += (std::string)g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)+": "+to_string(minfo.runtime)+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGVIEWER_GENRE)+": "+minfo.genres+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ORIGINAL_TITLE) +" : "+ minfo.original_title+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_YEAR_OF_PRODUCTION)+" : "+ minfo.release_date.substr(0,4) +"\n"; + if (minfo.media_type == "tv") + epgtext += "Seasons/Episodes: "+to_string(minfo.seasons)+"/"+to_string(minfo.episodes)+"\n"; + if (!minfo.cast.empty()) + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ minfo.cast+"\n"; + return epgtext; +} + +int cTmdb::exec() +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + + if (form == NULL) + form = new CComponentsForm(); + form->setDimensionsAll(sx, sy, ox, oy); + + CComponentsHeader *header = new CComponentsHeader(0, 0, ox, toph); + CComponentsText *headerText = new CComponentsText(15, 0, ox-15, toph, getTitle(), CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);; + headerText->doPaintBg(false); + headerText->setTextColor(COL_MENUHEAD_TEXT); + form->addCCItem(header); + form->addCCItem(headerText); + + + CComponentsPicture *ptmp = new CComponentsPicture(5, toph+5, "/tmp/tmdb.jpg"); + ptmp->setWidth(342); + ptmp->setHeight(513); + ptmp->setColorBody(COL_BLUE); + ptmp->setCorner(RADIUS_MID, CORNER_TOP_LEFT); + form->addCCItem(ptmp); + + CComponentsText *des = new CComponentsText(ptmp->getWidth()+10, toph+5, form->getWidth()-ptmp->getWidth()-10, form->getHeight(), CreateEPGText(), CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS | CTextBox::TOP); + des->setCorner(RADIUS_MID, CORNER_BOTTOM_RIGHT); + des->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]); + form->addCCItem(des); + + form->paint(); + frameBuffer->blit(); + + while (1) { + g_RCInput->getMsg(&msg, &data, 100); + if (msg == CRCInput::RC_home) + break; + } + + if (form->isPainted()) { + form->hide(); + delete form; + form = NULL; + } +} diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h new file mode 100644 index 000000000..751b48560 --- /dev/null +++ b/src/gui/tmdb.h @@ -0,0 +1,84 @@ +/* + Copyright (C) 2015 TangoCash + + License: GPLv2 + + 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; + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __TMDB__ +#define __TMDB__ + +#include +#include + +#include +#include + +typedef struct { + std::string epgtitle; + std::string poster_path; + std::string overview; + std::string original_title; + std::string release_date; + std::string vote_average; + int vote_count; + int id; + std::string media_type; + int result; + int runtime; + std::string runtimes; + std::string genres; + int episodes; + int seasons; + std::string cast; +}tmdbinfo; + +class cTmdb +{ + private: + CURL *curl_handle; + CComponentsForm *form; + tmdbinfo minfo; + + CFrameBuffer *frameBuffer; + int ox, oy, sx, sy, toph; + + static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); + std::string encodeUrl(std::string txt); + std::string decodeUrl(std::string url); + std::string random_API_KEY(); + bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL); + bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL); + bool GetMovieDetails(); + + public: + cTmdb(std::string epgtitle); + ~cTmdb(); + int exec(); + std::string CreateEPGText(); + + std::string getTitle() { return minfo.epgtitle;} + std::string getOrgTitle() { return minfo.original_title;} + std::string getReleaseDate() { return minfo.release_date;} + std::string getDescription() { return minfo.overview;} + std::string getVote() { return minfo.vote_average;} + bool hasCover() { return !minfo.poster_path.empty();} + bool getBigCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w342" + minfo.poster_path, cover);} + bool getSmallCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w185" + minfo.poster_path, cover);} + int getResults() { return minfo.result;} + int getStars() { return (int) (atof(minfo.vote_average.c_str())+0.5);} +}; + +#endif From 6164c666796e0e9c2ff7fc31b999ea6be3dd18aa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 4 Mar 2016 13:57:16 +0100 Subject: [PATCH 238/690] tmdb: fix function type Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8ba37ed0c9e698193ee3c6be7db3ec2ac9d1a07b Author: vanhofen Date: 2016-03-04 (Fri, 04 Mar 2016) Origin message was: ------------------ - tmdb: fix function type --- src/gui/tmdb.cpp | 2 +- src/gui/tmdb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 688ecacfb..292f4d0b9 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -299,7 +299,7 @@ std::string cTmdb::CreateEPGText() return epgtext; } -int cTmdb::exec() +void cTmdb::exec() { neutrino_msg_t msg; neutrino_msg_data_t data; diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index 751b48560..2e5e82a03 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -66,7 +66,7 @@ class cTmdb public: cTmdb(std::string epgtitle); ~cTmdb(); - int exec(); + void exec(); std::string CreateEPGText(); std::string getTitle() { return minfo.epgtitle;} From 44e0253995d42436cf1223979988dd17ed4d17e7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 4 Mar 2016 13:57:20 +0100 Subject: [PATCH 239/690] tmdb: fix return value Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b657748f95dc8d60b7653c388673442c9577f159 Author: vanhofen Date: 2016-03-04 (Fri, 04 Mar 2016) Origin message was: ------------------ - tmdb: fix return value --- src/gui/tmdb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 292f4d0b9..2dc19a45d 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -275,6 +275,8 @@ bool cTmdb::GetMovieDetails() } } else return false; + + return false; } std::string cTmdb::CreateEPGText() From 4bdb765185fb43702d644d82ec0046b41be37466 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:22 +0100 Subject: [PATCH 240/690] tmdb: Suppress cover flickering when scrolling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/99a9cfe8c68d18158e789fb44d04a44b6646dd66 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/epgview.cpp | 16 ++++++++++------ src/gui/epgview.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 70abe52f7..d8283ef8d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -220,7 +220,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 addTextToArray( aktLine + aktWord, screening ); } -void CEpgData::showText( int startPos, int ypos, bool cover ) +void CEpgData::showText( int startPos, int ypos, bool cover, bool fullClear) { // recalculate medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); @@ -241,10 +241,14 @@ void CEpgData::showText( int startPos, int ypos, bool cover ) continue; max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ")); } - frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + int offs = fullClear ? 0 : cover_offset; + frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box if (cover) { - if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, 1)) - cover_offset = 0; } + if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, 1)) { + cover_offset = 0; + frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + } + } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { if(epgText[i].second){ @@ -793,7 +797,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (showPos+scrollCount Date: Fri, 4 Mar 2016 13:57:25 +0100 Subject: [PATCH 241/690] tmdb: Add read apikey from neutrino.conf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e8b9b6d1be7efea70fb9194d57ca21226bd8549 Author: bazi98 Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/tmdb.cpp | 20 +++++++------------- src/gui/tmdb.h | 2 +- src/neutrino.cpp | 2 ++ src/system/settings.h | 1 + 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 2dc19a45d..0f7096e67 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -49,10 +49,6 @@ #endif #define URL_TIMEOUT 60 -#define API_KEY_1 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -#define API_KEY_2 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -#define API_KEY_3 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -#define API_KEY_4 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #define TMDB_COVER "/tmp/tmdb.jpg" cTmdb::cTmdb(std::string epgtitle) @@ -71,6 +67,11 @@ cTmdb::cTmdb(std::string epgtitle) sx = getScreenStartX(ox); sy = getScreenStartY(oy + buttonheight); /* button box is handled separately (why?) */ +#ifdef TMDB_API_KEY + key = TMDB_API_KEY; +#else + key = g_settings.tmdb_api_key; +#endif GetMovieDetails(); } @@ -190,18 +191,11 @@ bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle) } return true; } -std::string cTmdb::random_API_KEY() -{ - std::string keys[] = {API_KEY_1,API_KEY_2,API_KEY_3,API_KEY_4}; - int i = rand() % (sizeof(keys) / sizeof(keys[0])); - return keys[i]; -} - bool cTmdb::GetMovieDetails() { printf("[TMDB]: %s\n",__func__); - std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+random_API_KEY()+"&language=de&query=" + encodeUrl(minfo.epgtitle); + std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language=de&query=" + encodeUrl(minfo.epgtitle); std::string answer; if (!getUrl(url, answer)) return false; @@ -224,7 +218,7 @@ bool cTmdb::GetMovieDetails() minfo.id = elements[0].get("id",-1).asInt(); minfo.media_type = elements[0].get("media_type","").asString(); if (minfo.id > -1) { - url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+random_API_KEY()+"&language=de&append_to_response=credits"; + url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language=de&append_to_response=credits"; answer.clear(); if (!getUrl(url, answer)) return false; diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index 2e5e82a03..fc7d84198 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -58,7 +58,7 @@ class cTmdb static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); std::string encodeUrl(std::string txt); std::string decodeUrl(std::string url); - std::string random_API_KEY(); + std::string key; // tmdb api key bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL); bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL); bool GetMovieDetails(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9c9a54919..451f340e2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -802,6 +802,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); @@ -1303,6 +1304,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); configfile.setString( "youtube_dev_id", g_settings.youtube_dev_id ); + configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key ); //Filebrowser configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); diff --git a/src/system/settings.h b/src/system/settings.h index a6cc0b6c8..f31688213 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -720,6 +720,7 @@ struct SNeutrinoSettings //movieplayer int movieplayer_repeat_on; std::string youtube_dev_id; + std::string tmdb_api_key; //zapit setup std::string StartChannelTV; From 19dcbe2c5e2f2280eebab5f631c52b7d2c1df56f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:28 +0100 Subject: [PATCH 242/690] src/system/helpers.cpp: Add function Lang2ISO639_1() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/53ef02ad2fab30764c741d3bff3f85df6060e6f6 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/system/helpers.cpp | 33 +++++++++++++++++++++++++++++++++ src/system/helpers.h | 1 + 2 files changed, 34 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index de76cb728..70dd11838 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -944,3 +944,36 @@ std::string getJFFS2MountPoint(int mtdPos) fclose(fd); return ""; } + +std::string Lang2ISO639_1(std::string& lang) +{ + std::string ret = ""; + if ((lang == "deutsch") || (lang == "bayrisch") || (lang == "ch-baslerdeutsch") || (lang == "ch-berndeutsch")) + ret = "de"; + else if (lang == "english") + ret = "en"; + else if (lang == "nederlands") + ret = "nl"; + else if (lang == "slovak") + ret = "sk"; + else if (lang == "bosanski") + ret = "bs"; + else if (lang == "czech") + ret = "cs"; + else if (lang == "francais") + ret = "fr"; + else if (lang == "italiano") + ret = "it"; + else if (lang == "polski") + ret = "pl"; + else if (lang == "portugues") + ret = "pt"; + else if (lang == "russkij") + ret = "ru"; + else if (lang == "suomi") + ret = "fi"; + else if (lang == "svenska") + ret = "sv"; + + return ret; +} diff --git a/src/system/helpers.h b/src/system/helpers.h index b6da33508..486d1e8e6 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -117,5 +117,6 @@ std::vector split(const std::string &s, char delim); bool split_config_string(const std::string &str, std::map &smap); std::string getJFFS2MountPoint(int mtdPos); +std::string Lang2ISO639_1(std::string& lang); #endif From 624b4b303534c3c85718eacf009a7b74499357d9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:31 +0100 Subject: [PATCH 243/690] tmdb: Use osd language for search & display data Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/11cdccac526dd1997da6b7807cea99c3b1e45756 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/tmdb.cpp | 11 +++++++---- src/gui/tmdb.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 0f7096e67..05e08d722 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -73,7 +73,10 @@ cTmdb::cTmdb(std::string epgtitle) key = g_settings.tmdb_api_key; #endif - GetMovieDetails(); + std::string lang = Lang2ISO639_1(g_settings.language); + GetMovieDetails(lang); + if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en") + GetMovieDetails("en"); } cTmdb::~cTmdb() @@ -192,10 +195,10 @@ bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle) return true; } -bool cTmdb::GetMovieDetails() +bool cTmdb::GetMovieDetails(std::string lang) { printf("[TMDB]: %s\n",__func__); - std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language=de&query=" + encodeUrl(minfo.epgtitle); + std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(minfo.epgtitle); std::string answer; if (!getUrl(url, answer)) return false; @@ -218,7 +221,7 @@ bool cTmdb::GetMovieDetails() minfo.id = elements[0].get("id",-1).asInt(); minfo.media_type = elements[0].get("media_type","").asString(); if (minfo.id > -1) { - url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language=de&append_to_response=credits"; + url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language="+lang+"&append_to_response=credits"; answer.clear(); if (!getUrl(url, answer)) return false; diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index fc7d84198..0c4a45448 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -61,7 +61,7 @@ class cTmdb std::string key; // tmdb api key bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL); bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL); - bool GetMovieDetails(); + bool GetMovieDetails(std::string lang); public: cTmdb(std::string epgtitle); From ae83c0dda87bf845a5da31b06d85a9f35cf8cd46 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:34 +0100 Subject: [PATCH 244/690] tmdb: Add hintbox when search data Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5d1120f9f519c40ceee05ef5a0904539eafec29 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + data/locale/nederlands.locale | 1 + data/locale/slovak.locale | 1 + src/gui/tmdb.cpp | 9 +++++++++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 7 files changed, 15 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 70e5504d4..cf1ad78ed 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2354,6 +2354,7 @@ timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige +tmdb.read_data Suche TMDB Daten... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz unicable.scr Unicable SCR diff --git a/data/locale/english.locale b/data/locale/english.locale index 9e5391b59..e60cf5a4c 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2354,6 +2354,7 @@ timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap timing.volumebar Volume bar +tmdb.read_data Search TMDB Data... unicable.lnb Unicable Input unicable.qrg Unicable Frequency unicable.scr Unicable SCR diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 3ba931bec..68dbea5bc 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -2196,6 +2196,7 @@ timing.infobar_radio Infobalk (radio modus) timing.menu Menu timing.numericzap Numeriek Zap timing.volumebar Volume balk +tmdb.read_data Zoeken TMDB data... unicable.lnb Invoer Unicable unicable.qrg Unicable Frequentie unicable.scr Unicable SCR diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 9469975cd..9651642ef 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -2296,6 +2296,7 @@ timing.infobar_radio Stavový riadok (rádio mód) timing.menu Menu timing.numericzap Prepínanie číslami timing.volumebar Ukazovateľ hlasitosti +tmdb.read_data Hľadaj TMDB dáta... unicable.lnb Vstup Unicable unicable.qrg Kmitočet Unicable unicable.scr SCR Unicable diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 05e08d722..f295d2dbe 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -36,6 +36,7 @@ #include "system/settings.h" #include "system/helpers.h" #include "system/set_threadname.h" +#include "gui/widget/hintbox.h" #include @@ -73,10 +74,18 @@ cTmdb::cTmdb(std::string epgtitle) key = g_settings.tmdb_api_key; #endif + CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); + box->paint(); + std::string lang = Lang2ISO639_1(g_settings.language); GetMovieDetails(lang); if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en") GetMovieDetails("en"); + + if (box != NULL) { + box->hide(); + delete box; + } } cTmdb::~cTmdb() diff --git a/src/system/locals.h b/src/system/locals.h index 3bed3f77c..bd76e37d4 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2381,6 +2381,7 @@ typedef enum LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_VOLUMEBAR, + LOCALE_TMDB_READ_DATA, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, LOCALE_UNICABLE_SCR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 24eb84ac0..320b7b794 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2381,6 +2381,7 @@ const char * locale_real_names[] = "timing.menu", "timing.numericzap", "timing.volumebar", + "tmdb.read_data", "unicable.lnb", "unicable.qrg", "unicable.scr", From ae655ab357d6bd21e758bdec2fdd90e245831b73 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 13:57:37 +0100 Subject: [PATCH 245/690] tmdb: Add star icons (THX flk) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e0b952ece343c9591c9fab064fde85600b7beabf Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- data/icons/Makefile.am | 2 ++ data/icons/star-off.png | Bin 0 -> 1034 bytes data/icons/star-on.png | Bin 0 -> 1139 bytes src/gui/epgview.cpp | 12 +++++------- src/gui/widget/icons.h | 2 ++ 5 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 data/icons/star-off.png create mode 100644 data/icons/star-on.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index c662933d7..e1ffa5c61 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -244,6 +244,8 @@ install_DATA += \ shell.png \ shutdown.jpg \ softupdate.png \ + star-off.png \ + star-on.png \ start.jpg \ streaming.png \ subt.png \ diff --git a/data/icons/star-off.png b/data/icons/star-off.png new file mode 100644 index 0000000000000000000000000000000000000000..d40be7f27af0bb2b6ad9c585494933b6d2ea3724 GIT binary patch literal 1034 zcmV+l1oiugP)DKyZ1(>F>wxX;?Kg}u zS*=!iKA#_cu7JtG!GRP)NY1$|7K`a;p{}m3{%l#6bX`|6#$=^Zk*QQF_LQIc*fx~Q z<+kqb?yo7Oa2y9h2!ui*^z`)n0$}vfW!5XRv$L&+VT26B2pWbFqLhZbUhikUy}jQz zH#Za0G$Ew~Ap{o}7pz<^zv7%9*tY%7w(U#DaV~4M+PlfgNfQ9b+S=NSa5%hX7=}tI zRaI406-7}sO;ahQMAvmN#!#(RA%p+`NGahs4mjt+bzROFrva+om-71hx^y?V2f+ZK>$;+8T7TX7AqgSi zx-Jw&@dN^a{s$+&|JpQ7BdV(Q-R<}Jd$>tN_;#6Nnx-Kb3?dv3 z!?LXHjg5^j1_uW}9U2;nluD(a&d<-^nx+Zcw&C;n`g}g0=Si@lD4$0n5m=Umot>TU z3WdTaqobn>_3@FBksr^_&OR)aN^_-B3Bh2{!x;PM$uybE<=*7;`QN6druNGweSY_(8=v`Fi;^S+P&y)LE;P$-Rfw&(o6|H*g0 z^BtIFe6||>la*+*tygDTShH#M0q_Oq&%en36-Qdbb$@)@F*SDVwZ!4)j776~BhQrV zZMOiZs9(G#Hm}x-#`Sn*Q)Ba;xrd6rea|}X_3l7i+!^%m+n9dnjscEtpZiu-Q-daX zNdh;^g8F$yUvDdU{XYTsv_%1UTgI$fUe{rj%_qoS$M-Tsq7DmJ)a-fz^qDA;0Cs~> zxtvlnPI0uNByPs7;!s2{)^%lF{Zs2-ja4?t;`T`pQ^*KXNzeb~0pZw}cL?~am}zS+58RatG#@mR$iLSb3ev_Mr=NmVpm(ZX?bGYsA&{?sK1 zJir5A;Mg8+-ox{J;X1-|Y~f|6a$f2$H%N}VPpZQ85~h*KR#rduh#D@1K*INJ5H|QJ z$c^J?u7OBHARzD|@X(|@TF3zSAR>$JBtYZ}fCvyd0%sC@7lHs~?pm~}4M^4q7ke-KK6qke_47U1akaPI zqNOW&>z$M7Y6<7m;$`Ma(-Z{02l&$+iUN?AA@J?#>8L0b8`0<0A=J|h9UncjcgK}= zpM&Uaw@?lb*z~kT*?G?KmrNu(WlgFnin@)a?iRZ9GT@~^WD6fm&s??|(JQL3R}v#E)KDm>l_by%Flyq+4J#SCGH2?_IW6VbV1^xJcO2pR z=+St6X_+UtbR}n|!p^Geiz0$hMFhFNp4*w)iL(br-&^$3aLJN47M1*XBD`ntlA7?c zH&N_iB6ErvzooBwpb06e-&|T7As27pY-g(Lr-Q>w*6beHRhZU*_sqxHH!t@Yb*H~G zzZ&VkO6+kPBPz8#@H9zspx?Zz^qtvrq2rYwyzlQdzve^fKY^`ZY>qwc$FlDmaYKjX zgU(Q~{^5!uv*5+Cd)i`8Ta=^Q3f8)JsTtnC(fpT&{swZyxUA*)riK6j002ovPDHLk FV1nTaC_MlG literal 0 HcmV?d00001 diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d8283ef8d..5d309562d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -281,13 +281,11 @@ void CEpgData::showText( int startPos, int ypos, bool cover, bool fullClear) if (stars > 0 && startPos == 0){ int icon_w,icon_h; - frameBuffer->getIconSize(ICONSDIR"/star-off.png", &icon_w, &icon_h); - for (int i=1; i < 11;i++) { - frameBuffer->paintIcon(ICONSDIR"/star-off.png", sx+3+cover_offset+i*icon_w+3, ypos+3); - } - for (int i=1; i < stars+1;i++) { - frameBuffer->paintIcon(ICONSDIR"/star-on.png", sx+3+cover_offset+i*icon_w+3, ypos+3); - } + frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); + for (int i = 0; i < 10; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset + i*(icon_w+3), ypos+3); + for (int i = 0; i < stars; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset + i*(icon_w+3), ypos+3); } int sbc = ((textSize - 1)/ medlinecount) + 1; diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 5f380c7c8..0fbb826d3 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -179,6 +179,8 @@ #define NEUTRINO_ICON_RECORDING_EVENT_MARKER "rec_event_marker" #define NEUTRINO_ICON_ZAP "zap" #define NEUTRINO_ICON_PIP "pip" +#define NEUTRINO_ICON_STAR_ON "star-on" +#define NEUTRINO_ICON_STAR_OFF "star-off" #define DUMMY_ICON "dummy" From f8e727a0fe57a44a792f7e3463fd8a964f2d0674 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 4 Mar 2016 17:13:32 +0100 Subject: [PATCH 246/690] egpview: Fix display buttons & button labels Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/094d224f7f8507557f57823caec62f0acb8b7e18 Author: Michael Liebmann Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/epgview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5d309562d..650788a36 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1259,9 +1259,9 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap) adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 2); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 4:3, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); #if 0 // Button: Timer Record & Channelswitch From e0d10b6849de6e1d335e6f798c59f521810a5d1f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 6 Mar 2016 13:15:36 +0100 Subject: [PATCH 247/690] src/gui/user_menue.cpp fix AddressSanitizer: heap-use-after-free Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4947a71782a24cffdd7a1f5da3289aa3b0392805 Author: Jacek Jendrzej Date: 2016-03-06 (Sun, 06 Mar 2016) --- src/gui/user_menue.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 925d95011..0e59617a6 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -533,7 +533,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { if(loc == NONEXISTANT_LOCALE && !text) { CWebTVResolution webtvres; - text = webtvres.getResolutionValue(); + std::string tmp = webtvres.getResolutionValue(); if (!(videoDecoder->getBlank())) { int xres = 0, yres = 0, framerate; @@ -541,12 +541,14 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu if (xres && yres) { std::string res = to_string(xres) + "x" + to_string(yres); - if (res.compare(text)) + if (res.compare(tmp)) { - std::string tmp = (string)text + " (" + res + ")"; + tmp = " (" + res + ")"; text = tmp.c_str(); } } + }else{ + text = tmp.c_str(); } } else return_title = true; From 8d693524386bdb3747aaa0c8efd0c7d360dd2658 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 Mar 2016 14:31:46 +0300 Subject: [PATCH 248/690] tmdb: add tmdb logo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0e4d2071aeb52f13e03f15df637c51ddda0d7148 Author: [CST] Focus Date: 2016-03-07 (Mon, 07 Mar 2016) --- data/icons/tmdb.png | Bin 0 -> 4051 bytes src/gui/widget/icons.h | 1 + 2 files changed, 1 insertion(+) create mode 100644 data/icons/tmdb.png diff --git a/data/icons/tmdb.png b/data/icons/tmdb.png new file mode 100644 index 0000000000000000000000000000000000000000..a38816732e2622a0189c1fec4bbe3c4446d48826 GIT binary patch literal 4051 zcmV;^4=nJBP)1Q>g=LHGaw4`4|| zK~!ko?OJ=j{38o^#pv z%4yBZ3+xCFtI3EFc<)Mcj8pKg#O0kLl?pRjrX!ZYJWoo&J!9fr+ZUt}- zfE}?I9tj44Cp(XS?%B8-DgH$h@-7~G>@n=yx9{6ZsmE;Fo@m=P9LItG*N-WsQe~yo zx#c401f~H!1Dg?*oH3ySF)|G4V9IZ*t>V{ z8;;{#t{Y`GWA(5MI>T|C8KtGAb2>XaS7aMhFfP@KMuz%pw4%aSLmik+jf~!>T90iy4u{^+xvJ?Q4v%px4?$|B>_(hqC zCp$)VPCO-#uy(QK0QjMf-&PyM+Qn8{pHqs>GXb0m;Isbj*hl)9)2oA6zck6qEmgs> z0LChXaY_M1$hr>hS|o0%3ZCKe_sJtI*4|@zcHgso!{sC9@ljA_qOT){f)W#bT}ODi z+A#57@ffBQn-c*X=Hwx?-f40X){%6}#DO*8*T} zhM{%?_^F7;_My6Uf|Cp92ajwWz+Nd)APpc*CHkk$F|X_EiXD^zz*Cm^gA73Gn3Q;0O1zea zCGl6M%`sDF@o96+6;k3AX<(FZyj&J||Cbf!4FDhwC||u-el`tfT-h+!udhEtu}a$VC-j!^M~O%+d7c1Jb?uE9Bu8VRhV_mcvTt* zWZ?hpX>-i-)H(%lz~gmVh4~jB*Dp*dF^!wb&0T^qS1^!4&lHR%5s$~eHaIwlL?YoC zZ*1PYc@&96Miu}FvBxu5X7-dbwv}n>u*3nDILI=2Z1B}XFt!MZcYWB@o<Wt#Ir&oAd>wm!RQr?r~RB}h#6JE^H|aY+OutA zNo%z-m}$xMxxrK1HQ1~1dYXIviIjv5%VXV!fek`noDhJk&k2ELLcr26Tg2n>xMsA7 z$KxU%kB`V`%gV~Y%%ePmb-gX5lo^i%EYkGl)eTnO>IN%!b%XUvh6UW&(`a4X(_mfd z!@ui#jW8QHoehAKZ~4WKwpmruK);8vfip6An8f;4>%#S|R=yA4yuQ`?o-}ZUjtfpk z-z-t7^$QN*l1JODA~x`>j>`c4mJLECeY7pM!-q`(0Fp!19kU|Ux5R<j0!B0Y^(wGjAT8qWB~OzXIAi3KoP()f`0 z(fU?vCQGc<@KG$0>&_+Js~fm%eXDimBP|w9pBp@jCH-7~2{x>VUAJLHtdb>tqQ49x z9*=MH3^$QTz_#sgw6(RV;^N|CHr$Sm4lr|pX0VV_!Y~Xg^HG6x<)hT^%!1qQc3dPS zgp`1kIIwoH^?u>}U>{4|?_!V=PrGe(jTO!hQU?43mtg-k?~Qkj*6*%$P1b$@kP`o{ z;gAwv_mxxXwm+<4rw-W>Ty@91G1b<<+QRw4GYjVjV^ZQQ7ax=oalv%IkE7>Z-h>a& z#3xvi0RY_*YpV}GH*0inq|bBR5^KAQccjhRz&~W*`n`3Ft#@Y33wmk03w_6eXQt0h z)sbE&6N$vDzEl>9i;D-9Qda`LASH`bR8%Y_q9P##m>EO_X10lFdzQT7@aY>qcAPm$ zh%2Lu>xTq>Zz_c**H|)>FOLm##|vr2y&ArIMClwkH1#yhyz{lu&lc8-pKEy3-!ucSD&@J8_xM?V|KVmUBR4XUNc_rgxBv{t zao(IcbLOW+)I~(UC!&}Tf`|x2B$+u#L*H|K|^D+fO2-o_L7^>f3U9}f2 zS~P8>3Gw4dn1dx=25@6)r3CVq-5veND_1@k%GtIp=?PAV$CcOv;5@f@zJ_1vYq~Ro z;nMPZqL}kQDBp*_G_1#!*aoD$?uX0kq8DlNL*;{^QEhie4+(iB-RH_B0A3ezG!I>YCmEcnCmF zRa5AE!FU4cq1C>cJ~xkipPO5iHk1OStS5LL|loSxe91zoA%Kp^n3VHnE;fdCA{NNGz;i;?|prq|OVM5a}OsZB6l zn<+@qzw`_ZT-08cv_tDJk0m`KB)!3sZeU5dEU6?*Fp@Dy8LllPI(_)mKrY2uQsBsZ z@OQn7qG+v+LK@hpWe)^Ps%J^39>LJmdRO$%!v$wTVzF<`ON68knCU5&G?68p&5}kp z*F+oBc$IX0ZEIMuq)UAGq)c-Zk`~sshLvC{)bL+7*F-npULOqPnsk4zN#R_R#^i?R zi8~sCXt^^wlO^rf+TSb#bdV((9!3(^x7-;W%*M4Rr3*snS{Qv%2uu@bkC@ql4Pp+bIwTjFD2F%FGj_loJfY7-O1dps}%$ zB9X|rg$oznv0%Xh3Iqbb$;ruaa&mHD7)D0Jt!)j18HIu|=siR#HNtq%mtRyu9(mJz zxO<2bYDx9L`7H6gFCFDwTP%}7lvc0U0I}hnXVX=~lpk-Yj_zjz=dyv_8ODmSfuA?m zL^lIKZA%zSs-x3b;?*IEc>{-8V%?JJ=v}of;nbPauK>_o9sQUCn5d_}WB}kmDh0J& zxalS#@B_g(EWEU#1cbmo!T7bt_xIhl2ZX@KL)Iag{&R%Db4`^4H{974#;S-lIL4&E zj0qCP1POV0^!Bnk3)PKbNCT5uVpkUKr!K9IZfaON4jI-UO*-#S#&hipqK^xK=e4|T zj}UlCD=RwDe|~6dYa2yGKfL3PJDwV@U0r*a0DO}Ola<020K0$k6YRQr`~d1Z!+PN2 zL`nxf2apx_ z8*@B>2}HO^DQpI?yQc2hG`6ZKG+5OXQdLc%`25Zg zxv|81E~cuQLie3;k9$&1%3mWj&7rda>~w=MySXMR=PeD6Rf_a~s{Qh$;hvN)l-$`G zJ`>5DFMG!t03b?zY_T1O^2AB1PRbWWYFolMxF5R(W2--4^gj8L!1yKA`wpMS|5v-gW>0002ovPDHLk FV1hF-yC(nu literal 0 HcmV?d00001 diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 0fbb826d3..0d20fa35d 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -181,6 +181,7 @@ #define NEUTRINO_ICON_PIP "pip" #define NEUTRINO_ICON_STAR_ON "star-on" #define NEUTRINO_ICON_STAR_OFF "star-off" +#define NEUTRINO_ICON_TMDB "tmdb" #define DUMMY_ICON "dummy" From 1caaaf0b99f7f1442f4b920142330c1aef502ee8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 Mar 2016 14:34:29 +0300 Subject: [PATCH 249/690] gui/epgview.cpp: attribute with TMDB logo along with stars Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7680cf156f9e0a44092c2761cbd679b45ed96d06 Author: [CST] Focus Date: 2016-03-07 (Mon, 07 Mar 2016) --- src/gui/epgview.cpp | 64 ++++++++++++++++++++++----------------------- src/gui/epgview.h | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 650788a36..2d0bc5263 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -165,7 +165,7 @@ void CEpgData::addTextToArray(const std::string & text, int screening) // UTF-8 } } -void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 +void CEpgData::processTextToArray(std::string text, int screening, bool has_cover) // UTF-8 { std::string aktLine = ""; std::string aktWord = ""; @@ -185,7 +185,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (tmdbtoggle? (std::min((sb-10)*342/513,342)) :0))) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (has_cover? (std::min((sb-10)*342/513,342)) :0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -220,7 +220,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 addTextToArray( aktLine + aktWord, screening ); } -void CEpgData::showText( int startPos, int ypos, bool cover, bool fullClear) +void CEpgData::showText(int startPos, int ypos, bool cover, bool fullClear) { // recalculate medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); @@ -243,12 +243,28 @@ void CEpgData::showText( int startPos, int ypos, bool cover, bool fullClear) } int offs = fullClear ? 0 : cover_offset; frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + if (cover) { - if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, 1)) { + if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, CFrameBuffer::TM_NONE)) { cover_offset = 0; frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box } } + int logo_offset = 0; + if (tmdbtoggle && startPos == 0) { + int icon_w,icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); + frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, ypos+5); + logo_offset = icon_w + 10; + } + if (stars > 0 && startPos == 0) { + int icon_w,icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); + for (int i = 0; i < 10; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+3); + for (int i = 0; i < stars; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+3); + } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { if(epgText[i].second){ @@ -279,14 +295,6 @@ void CEpgData::showText( int startPos, int ypos, bool cover, bool fullClear) } } - if (stars > 0 && startPos == 0){ - int icon_w,icon_h; - frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); - for (int i = 0; i < 10; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset + i*(icon_w+3), ypos+3); - for (int i = 0; i < stars; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset + i*(icon_w+3), ypos+3); - } int sbc = ((textSize - 1)/ medlinecount) + 1; int sbs= (startPos+ 1)/ medlinecount; @@ -800,11 +808,12 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_up: - showPos -= scrollCount; - if (showPos<0) - showPos=0; - else + if (showPos > 0) { + showPos -= scrollCount; + if (showPos < 0) + showPos = 0; showText(showPos, sy + toph, tmdbtoggle, false); + } break; case CRCInput::RC_page_up: if(isCurrentEPG(channel_id)){ @@ -911,31 +920,22 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_info: { + showPos = 0; if (!tmdbtoggle) { cTmdb* tmdb = new cTmdb(epgData.title); if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { epgText_saved = epgText; epgText.clear(); - if (tmdb->hasCover()) { - tmdbtoggle = !tmdbtoggle; - processTextToArray(tmdb->CreateEPGText()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); - } else { - processTextToArray(tmdb->CreateEPGText()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); - tmdbtoggle = !tmdbtoggle; - } + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); } else { ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); } - if (tmdb) - delete tmdb; + delete tmdb; } else { - epgText.clear(); epgText = epgText_saved; textCount = epgText.size(); stars=0; diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 707129c02..316126def 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -86,7 +86,7 @@ class CEpgData void GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear = true ); void GetPrevNextEPGData( uint64_t id, time_t* startzeit ); void addTextToArray( const std::string & text, int screening ); - void processTextToArray(std::string text, int screening = 0); + void processTextToArray(std::string text, int screening = 0, bool has_cover = false); void showText( int startPos, int ypos, bool cover=false, bool fullClear=true ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); From fa2470b11a16ff7c7689ce48bdbe59de2da37f67 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 Mar 2016 15:59:30 +0300 Subject: [PATCH 250/690] gui/movieplayer.cpp: hack to fix loop at neutrino start for non-working webtv channel via lua plugin Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f1a3010f9e6c05325edf295cb02923eaef419e6 Author: [CST] Focus Date: 2016-03-07 (Mon, 07 Mar 2016) --- src/gui/movieplayer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 11e8a8e19..8275c214f 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -642,6 +642,9 @@ void *CMoviePlayerGui::ShowStartHint(void *arg) else if (msg != NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE && msg != CRCInput::RC_timeout && msg > CRCInput::RC_MaxRC) { CNeutrinoApp::getInstance()->handleMsg(msg, data); } + else if ((msg>= CRCInput::RC_WithData) && (msg< CRCInput::RC_WithData+ 0x10000000)) + delete[] (unsigned char*) data; + } if (hintbox != NULL) { hintbox->hide(); @@ -949,8 +952,11 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st std::string realUrl = file; std::string _pretty_name = name; - if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2)) - return false; + if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2)) { + /* FIXME: lua->runScript calling channelRezap, which makes neutrino to loop at start, + let playback start -> drop messages in ShowStartHint */ + //return false; + } OpenThreads::ScopedLock m_lock(mutex); From cdad28aafe355248d32281ae580a3c0a349e304b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 Mar 2016 16:15:29 +0300 Subject: [PATCH 251/690] gui/epgview.cpp: fix tmdb logo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e93332a56f0278c36e82da17ada82e5ce3e45b37 Author: [CST] Focus Date: 2016-03-07 (Mon, 07 Mar 2016) --- src/gui/epgview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 2d0bc5263..ab674d61f 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -938,9 +938,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else { epgText = epgText_saved; textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; stars=0; showText(showPos, sy + toph); - tmdbtoggle = !tmdbtoggle; } break; } From b900b262fd61e15fb672ea79d17d315133ae6a37 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 6 Mar 2016 20:03:09 +0100 Subject: [PATCH 252/690] partly revert af4c52f488922910431010030b08dde65de7e3ad; ... ... "copy event to prevent crash in multi-threaded mode" Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b648619124e334e2827b0c63f8079be04bd157f Author: vanhofen Date: 2016-03-06 (Sun, 06 Mar 2016) Origin message was: ------------------ - partly revert af4c52f488922910431010030b08dde65de7e3ad; ... ... "copy event to prevent crash in multi-threaded mode" --- src/nhttpd/tuxboxapi/controlapi.cpp | 45 ++++++++++++----------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 68db0a057..61aa735f5 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1045,35 +1045,32 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CChannelEvent event; - event.eventID = 0; + CChannelEvent *event; NeutrinoAPI->Lock(); - CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - if (evt) - event = *evt; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; NeutrinoAPI->Unlock(); bool return_epginfo = (hh->ParamList["epginfo"] != "false"); result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", false); - if (event.eventID) { + if (event) { int percentage = 100; - if (event.duration > 0) - percentage = 100 * (time(NULL) - event.startTime) / event.duration; + if (event->duration > 0) + percentage = 100 * (time(NULL) - event->startTime) / event->duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event.startTime); + timestr = timeString(event->startTime); firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); - firstEPG += hh->outPair("description", hh->outValue(event.description), true); + firstEPG += hh->outPair("description", hh->outValue(event->description), true); if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) { firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); } firstEPG += hh->outPair("startTime", timestr, true); - firstEPG += hh->outPair("timeTotal", string_printf("%d", event.duration / 60), true); - firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event.startTime) / 60), true); + firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); + firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { @@ -1126,21 +1123,18 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * result = hh->outArrayItem("channel", result, false); } else { - CChannelEvent event; - event.eventID = 0; + CChannelEvent *event; NeutrinoAPI->Lock(); - CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - if (evt) - event = *evt; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; NeutrinoAPI->Unlock(); - if (event.eventID && isEPGdetails) { + if (event && isEPGdetails) { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s (%s)\n", channelNr, channel->getChannelID(), - channel->getName().c_str(), event.description.c_str()); + channel->getName().c_str(), event->description.c_str()); } else { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS @@ -1847,27 +1841,24 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (param_empty || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent event; + CChannelEvent *event = NULL; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - event.eventID = 0; NeutrinoAPI->Lock(); - CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - if (evt) - event = *evt; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; NeutrinoAPI->Unlock(); - if (event.eventID) { + if (event) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", channel->getChannelID(), event.eventID, event.description.c_str()); + " %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str()); } else { // ext output hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %ld %u %llu %s\n", channel->getChannelID(), event.startTime, event.duration, event.eventID, event.description.c_str()); + " %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str()); } } } From 029ead9bcb838595b9a79c377d8ae9fa7f72d722 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Mar 2016 20:17:51 +0100 Subject: [PATCH 253/690] yrequest: remove double Connection->Method = M_PUT Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d41f190b4d29b44a073632e66fef51779487b604 Author: vanhofen Date: 2016-03-07 (Mon, 07 Mar 2016) Origin message was: ------------------ - yrequest: remove double Connection->Method = M_PUT --- src/nhttpd/yhttpd_core/yrequest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 85f25c99f..2b4ae42af 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -124,9 +124,8 @@ bool CWebserverRequest::ParseStartLine(std::string start_line) { analyzeURL(url); UrlData["httprotocol"] = Connection->httprotocol; // determine http Method - if (method.compare("POST") == 0) Connection->Method = M_POST; + if (method.compare("POST") == 0) Connection->Method = M_POST; else if (method.compare("GET") == 0) Connection->Method = M_GET; - else if (method.compare("PUT") == 0) Connection->Method = M_PUT; else if (method.compare("HEAD") == 0) Connection->Method = M_HEAD; else if (method.compare("PUT") == 0) Connection->Method = M_PUT; else if (method.compare("DELETE") == 0) Connection->Method = M_DELETE; From 86c6632755d451136c23a2ce25d5d9bea384180d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 8 Mar 2016 18:05:34 +0300 Subject: [PATCH 254/690] nhttpd: try to fix threaded nhttp crashes (again) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/14a73c3b80f10fe79cdb497085ca9ed3218fc162 Author: [CST] Focus Date: 2016-03-08 (Tue, 08 Mar 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 98 +++++++++++++----------- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 9 +++ src/nhttpd/tuxboxapi/neutrinoapi.h | 30 ++++---- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 7 +- 4 files changed, 80 insertions(+), 64 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 61aa735f5..95b53c2e1 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -807,7 +807,8 @@ int CControlAPI::rc_send(int ev, unsigned int code, unsigned int value) //----------------------------------------------------------------------------- // The code here is based on rcsim. Thx Carjay! -void CControlAPI::RCEmCGI(CyhookHandler *hh) { +void CControlAPI::RCEmCGI(CyhookHandler *hh) +{ if (hh->ParamList.empty()) { hh->SendError(); return; @@ -1038,39 +1039,38 @@ void CControlAPI::LogolistCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- // get actual and next event data for given channel //----------------------------------------------------------------------------- -std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) { +std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) +{ std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); std::string timestr; CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CChannelEvent *event; - NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->Unlock(); + CChannelEvent event; + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); bool return_epginfo = (hh->ParamList["epginfo"] != "false"); result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", false); - if (event) { + if (event.eventID) { int percentage = 100; - if (event->duration > 0) - percentage = 100 * (time(NULL) - event->startTime) / event->duration; + if (event.duration > 0) + percentage = 100 * (time(NULL) - event.startTime) / event.duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event->startTime); + timestr = timeString(event.startTime); firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); - firstEPG += hh->outPair("description", hh->outValue(event->description), true); + firstEPG += hh->outPair("description", hh->outValue(event.description), true); if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) { firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); } firstEPG += hh->outPair("startTime", timestr, true); - firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); - firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); + firstEPG += hh->outPair("timeTotal", string_printf("%d", event.duration / 60), true); + firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event.startTime) / 60), true); firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { @@ -1100,7 +1100,8 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann //----------------------------------------------------------------------------- // produce data (collection) for given channel -std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr) { +std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr) +{ std::string result = ""; bool isEPGdetails = !(hh->ParamList["epg"].empty()); if (hh->outType == json || hh->outType == xml) { @@ -1123,18 +1124,16 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * result = hh->outArrayItem("channel", result, false); } else { - CChannelEvent *event; - NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->Unlock(); + CChannelEvent event; + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); - if (event && isEPGdetails) { + if (event.eventID && isEPGdetails) { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s (%s)\n", channelNr, channel->getChannelID(), - channel->getName().c_str(), event->description.c_str()); + channel->getName().c_str(), event.description.c_str()); } else { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS @@ -1212,7 +1211,8 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { +void CControlAPI::GetBouquetCGI(CyhookHandler *hh) +{ TOutType outType = hh->outStart(true /*old mode*/); std::string result = ""; @@ -1412,7 +1412,8 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh) * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { +void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) +{ bool show_hidden = true; bool encode = false; std::string result = ""; @@ -1472,10 +1473,12 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { //----------------------------------------------------------------------------- // details EPG Information for channelid //----------------------------------------------------------------------------- -std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) { +std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) +{ std::string result = ""; std::string channelData = ""; - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), true); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); @@ -1486,7 +1489,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ int i = 0; CChannelEventList::iterator eventIterator; bool isFirstLine = true; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, i++) { + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator, i++) { if ((max != -1 && i >= max) || (stoptime != -1 && eventIterator->startTime >= stoptime)) break; std::string prog = ""; @@ -1536,7 +1539,8 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ //----------------------------------------------------------------------------- // Detailed EPG list in XML or JSON //----------------------------------------------------------------------------- -void CControlAPI::epgDetailList(CyhookHandler *hh) { +void CControlAPI::epgDetailList(CyhookHandler *hh) +{ // ------ get parameters ------- // max = maximal output items int max = -1; @@ -1579,7 +1583,6 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { hh->outStart(true /*old mode*/); std::string result = ""; - NeutrinoAPI->eList.clear(); if (bouquetnr >= 0 || all_bouquets) { int bouquet_size = (int) g_bouquetManager->Bouquets.size(); int start_bouquet = 0; @@ -1829,8 +1832,8 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) */ //------------------------------------------------------------------------- -void CControlAPI::EpgCGI(CyhookHandler *hh) { - NeutrinoAPI->eList.clear(); +void CControlAPI::EpgCGI(CyhookHandler *hh) +{ bool param_empty = hh->ParamList.empty(); hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default // Detailed EPG list in XML or JSON @@ -1841,24 +1844,22 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (param_empty || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent *event = NULL; + CChannelEvent event; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - NeutrinoAPI->Lock(); - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - NeutrinoAPI->Unlock(); - if (event) { + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); + if (event.eventID) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str()); + " %llu %s\n", channel->getChannelID(), event.eventID, event.description.c_str()); } else { // ext output hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str()); + " %ld %u %llu %s\n", channel->getChannelID(), event.startTime, event.duration, event.eventID, event.description.c_str()); } } } @@ -1897,9 +1898,10 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (!(hh->ParamList["id"].empty())) { t_channel_id channel_id = 0; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); CChannelEventList::iterator eventIterator; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) { + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) { CShortEPGData epg; if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration); @@ -2113,10 +2115,11 @@ void CControlAPI::LCDAction(CyhookHandler *hh) void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { int pos = 0; - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); CChannelEventList::iterator eventIterator; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++) + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator, pos++) hh->printf("%llu %ld %d %s\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration, eventIterator->description.c_str()); } @@ -3141,7 +3144,8 @@ void CControlAPI::logoCGI(CyhookHandler *hh) * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::ConfigCGI(CyhookHandler *hh) { +void CControlAPI::ConfigCGI(CyhookHandler *hh) +{ bool load = true; CConfigFile *Config = new CConfigFile(','); ConfigDataMap conf; @@ -3264,7 +3268,8 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { * action =new_folder|delete|read_file|write_file|set_properties */ //----------------------------------------------------------------------------- -void CControlAPI::FileCGI(CyhookHandler *hh) { +void CControlAPI::FileCGI(CyhookHandler *hh) +{ std::string result = ""; if (hh->ParamList["action"] == "list") { // directory list: action=list&path= @@ -3400,7 +3405,8 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { * @endcode */ //----------------------------------------------------------------------------- -void CControlAPI::StatfsCGI(CyhookHandler *hh) { +void CControlAPI::StatfsCGI(CyhookHandler *hh) +{ std::string result = ""; if (hh->ParamList["path"].empty()) @@ -3459,7 +3465,8 @@ void CControlAPI::StatfsCGI(CyhookHandler *hh) { * */ //----------------------------------------------------------------------------- -void CControlAPI::getDirCGI(CyhookHandler *hh) { +void CControlAPI::getDirCGI(CyhookHandler *hh) +{ std::string result = ""; std::string item = ""; bool isFirstLine = true; @@ -3519,7 +3526,8 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) { } //Helpfunction to get subdirs of a dir -std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) { +std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) +{ std::string item = ""; std::string dirname; DIR *dirp; diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 52733e5b5..b519f5f5f 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -291,6 +291,15 @@ bool CNeutrinoAPI::GetChannelEvents(void) return true; } +void CNeutrinoAPI::GetChannelEvent(t_channel_id channel_id, CChannelEvent &event) +{ + OpenThreads::ScopedPointerLock lock(pmutex); + event.eventID = 0; + CChannelEvent * evt = ChannelListEvents[channel_id]; + if (evt) + event = *evt; +} + //------------------------------------------------------------------------- std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 5e0a90596..fc3f8483e 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -25,23 +25,27 @@ bool _initialize_iso639_map(void); //------------------------------------------------------------------------- class CNeutrinoAPI { +private: + CChannelEventList eList; OpenThreads::Mutex *pmutex; + std::map ChannelListEvents; + + // complete channellists + //CZapitClient::BouquetChannelList RadioChannelList,TVChannelList; + // events of actual channel + // List of available tv bouquets + //std::map TVBouquetsList; + // List of available radio bouquets + //std::map RadioBouquetsList; + // List of bouquets + CZapitClient::BouquetList BouquetList; +public: // Clientlibs CSectionsdClient *Sectionsd; CZapitClient *Zapit; CTimerdClient *Timerd; CEventServer *EventServer; - // complete channellists - CZapitClient::BouquetChannelList RadioChannelList,TVChannelList; - // events of actual channel - std::map ChannelListEvents; - // List of available tv bouquets - std::map TVBouquetsList; - // List of available radio bouquets - std::map RadioBouquetsList; - // List of bouquets - CZapitClient::BouquetList BouquetList; //bool standby_mode; @@ -85,14 +89,14 @@ public: CNeutrinoAPI(); ~CNeutrinoAPI(void); - CChannelEventList eList; CNeutrinoYParser *NeutrinoYParser; CControlAPI *ControlAPI; void Lock() { pmutex->lock(); } void Unlock() { pmutex->unlock(); } + void GetChannelEvent(t_channel_id channel_id, CChannelEvent &event); - friend class CNeutrinoYParser; // Backreference - friend class CControlAPI; + //friend class CNeutrinoYParser; // Backreference + //friend class CControlAPI; }; #endif /*__nhttpd_neutrinoapi_h__*/ diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 203012bc0..c1da704f8 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -359,12 +359,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: { CZapitChannel * channel = channels[j]; CChannelEvent event; - event.eventID = 0; - NeutrinoAPI->Lock(); - CChannelEvent * evt = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - if (evt) - event = *evt; - NeutrinoAPI->Unlock(); + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); classname = (i++ & 1) ? 'a' : 'b'; if (channel->getChannelID() == current_channel) From ffd48bb389f0f277b0d804c89aaa424e7fcb933a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 9 Mar 2016 10:53:15 +0300 Subject: [PATCH 255/690] neutrino.cpp: try to fix sat/fav keys handling after calling zap history Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e3b1c58443b7d1e1aa41466dbda59d48a63956f Author: [CST] Focus Date: 2016-03-09 (Wed, 09 Mar 2016) --- src/gui/channellist.cpp | 2 ++ src/neutrino.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 17655dc91..e8a11f3e7 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1278,6 +1278,7 @@ int CChannelList::numericZap(int key) bool showEPG = false; neutrino_msg_t msg; neutrino_msg_data_t data; + g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); while(1) { if (lastchan != chn) { @@ -1361,6 +1362,7 @@ int CChannelList::numericZap(int key) if (chan && showEPG) g_EventList->exec(chan->getChannelID(), chan->getName()); } + g_InfoViewer->resetSwitchMode(); return res; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 451f340e2..fa7d9f0c0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2179,7 +2179,6 @@ void CNeutrinoApp::quickZap(int msg) void CNeutrinoApp::numericZap(int msg) { StopSubtitles(); - g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); int res = channelList->numericZap( msg ); StartSubtitles(res < 0); if (res >= 0 && CRCInput::isNumeric(msg)) { From 7fcb15572a7e2ec3e73f61b0cdcad13b845588b2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 9 Mar 2016 21:45:38 +0100 Subject: [PATCH 256/690] src/driver/netfile.cpp fix possible segfaults Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e625836bc2eb92329bdbdcb5ce8d722112cc1d1e Author: Jacek Jendrzej Date: 2016-03-09 (Wed, 09 Mar 2016) --- src/driver/netfile.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 288342d8c..cdcb848af 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -1801,6 +1801,10 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) FILTERDATA *filterdata = (FILTERDATA*)arg->user; int meta_int = filterdata->meta_int; int len = *arg->len; + if(len < 0){ + dprintf(stderr, "[%s] : error ---> len %i < 0\n",__func__, len); + return; + } char*buf = (char*)arg->buf; int meta_start; @@ -1815,6 +1819,12 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) if(filterdata->stored < filterdata->len) { int bsize = (filterdata->len + 1) - filterdata->stored; + printf("filterdata->len %i bsize %i len %i\n",filterdata->len,bsize,len); + /*check overload size*/ + if(bsize > len){ + dprintf(stderr, "[%s] : error ---> bsize %i > len %i\n",__func__,bsize, len); + return; + } /* if there is some meta data, extract it */ /* there can be zero size blocks too */ @@ -1883,7 +1893,12 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) //dprintf(stderr, "filter : metadata : \n\n\n----------\n%s\n----------\n\n\n", filterdata->meta_data); } - + /*check negative size*/ + if(len - b < 0) + { + dprintf(stderr, "[%s] : error ---> len - b %i\n",__func__,len-b); + return; + } /* remove the metadata and it's size indicator from the buffer */ memmove(buf + meta_start, buf + b, len - b ); From 54fc703cf556d013db0bb42ebe9680f1c7238482 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Mar 2016 09:33:50 +0100 Subject: [PATCH 257/690] adzap: don't zap when rezap-channel is already tuned Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a6a3c3543aa03cd3dadf446156c67fdef05df98 Author: vanhofen Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - adzap: don't zap when rezap-channel is already tuned --- src/gui/adzap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index d9b693fc3..695b13a13 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -231,7 +231,7 @@ void CAdZapMenu::Run() else { alerted = false; - if (channelList) + if ((channelId != curChannelId) && channelList) channelList->zapTo_ChannelID(channelId); armed = false; } From 67d7a3105f249fa8929d08dda60b7949fb3c965c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Mar 2016 09:51:34 +0100 Subject: [PATCH 258/690] adzap: start adzap directly when ok is pressed on marked item Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/817e6dc67e3b165d33b8992425d26d80eeccb97b Author: vanhofen Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - adzap: start adzap directly when ok is pressed on marked item --- src/gui/adzap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 695b13a13..e6d51740c 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -245,8 +245,9 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) Init(); int res = menu_return::RETURN_EXIT_ALL; + bool marked_ok = (actionKey.length() == 1 && g_settings.adzap_zapBackPeriod == (actionKey[0] - '0') * 60); - if (actionKey == "enable") + if (actionKey == "enable" || marked_ok) { if (!monitor) armed = true; From 8c80cf24a050924fb1bf4c91e86383dcbcf36b10 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Mar 2016 09:52:52 +0100 Subject: [PATCH 259/690] adzap: add checkmark-icon to marked item Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ce8837e6e73f226ab5f6b7481ae925f32a1441a4 Author: vanhofen Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - adzap: add checkmark-icon to marked item --- src/gui/adzap.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index e6d51740c..21fdcf97e 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -289,7 +289,11 @@ int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) { g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; for (int shortcut = 1; shortcut < 10; shortcut++) - forwarders[shortcut - 1]->setMarked(shortcut == g_settings.adzap_zapBackPeriod); + { + bool selected = (g_settings.adzap_zapBackPeriod == shortcut); + forwarders[shortcut - 1]->setMarked(selected); + forwarders[shortcut - 1]->iconName_Info_right = selected ? NEUTRINO_ICON_CHECKMARK : NULL; + } nc->setMarked(false); g_settings.adzap_zapBackPeriod *= 60; return menu_return::RETURN_REPAINT; @@ -328,6 +332,7 @@ void CAdZapMenu::ShowMenu() bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); forwarders[shortcut - 1]->setMarked(selected); + forwarders[shortcut - 1]->iconName_Info_right = selected ? NEUTRINO_ICON_CHECKMARK : NULL; forwarders[shortcut - 1]->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); menu->addItem(forwarders[shortcut - 1], selected); minute = LOCALE_ADZAP_MINUTES; From 8a7e151013d5e141c7b44854e261ee085a399f64 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Mar 2016 09:54:49 +0100 Subject: [PATCH 260/690] adzap: remove useless red button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0672fdf20e14c4500ef309f4937f27af45564431 Author: vanhofen Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - adzap: remove useless red button --- src/gui/adzap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 21fdcf97e..1643cc6f5 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -44,7 +44,7 @@ #define ADZAP_DATA "/tmp/adzap.data" static const struct button_label CAdZapMenuFooterButtons[] = { - { NEUTRINO_ICON_BUTTON_RED, LOCALE_ADZAP_DISABLE }, + //{ NEUTRINO_ICON_BUTTON_RED, LOCALE_ADZAP_DISABLE }, { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_ADZAP_ENABLE }, { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_ADZAP_MONITOR } }; @@ -313,7 +313,7 @@ void CAdZapMenu::ShowMenu() bool show_monitor = monitorLifeTime.tv_sec; CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, NEUTRINO_ICON_SETTINGS, width); - menu->addKey(CRCInput::RC_red, this, "disable"); + //menu->addKey(CRCInput::RC_red, this, "disable"); menu->addKey(CRCInput::RC_green, this, "enable"); menu->addKey(CRCInput::RC_blue, this, "monitor"); menu->addIntroItems(); From 15d64da48905bac7106d3d15a159ba84c20b3652 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Mar 2016 09:57:43 +0100 Subject: [PATCH 261/690] adzap: write adzap.data in monitor-mode too Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a522e891dedf5db7e27afdedad8fffbcae59755 Author: vanhofen Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - adzap: write adzap.data in monitor-mode too --- src/gui/adzap.cpp | 56 ++++++++++++++++++++++++++--------------------- src/gui/adzap.h | 3 +++ 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 1643cc6f5..094b1f5eb 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -105,7 +105,6 @@ time_t CAdZapMenu::getMonitorLifeTime() return 0; CChannelEventList::iterator eli; - struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) { @@ -139,7 +138,6 @@ void CAdZapMenu::Run() if (monitor) { - struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += 1; @@ -173,42 +171,19 @@ void CAdZapMenu::Run() { if (g_settings.adzap_writeData) { - struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += 1; sem_timedwait(&sem, &ts); - - int zp = g_settings.adzap_zapBackPeriod; - long int zb = zapBackTime.tv_sec + ZAPBACK_ALERT_PERIOD - ts.tv_sec; - - if (FILE *f = fopen(ADZAP_DATA, "w")) - { - fprintf(f, "%" PRIx64 "\n%s\n%d\n%d:%02d\n%ld\n%ld:%02ld\n", - channelId, - channelName.c_str(), - zp, - zp / 60, zp % 60, - zb, - zb / 60, zb % 60); - fclose(f); - } - else - printf("CAdZapMenu::%s: write data failed.\n", __func__); } else sem_timedwait(&sem, &zapBackTime); } else - { - if (access(ADZAP_DATA, F_OK) == 0) - unlink(ADZAP_DATA); sem_wait(&sem); - } if (armed) { - struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); if (ts.tv_sec >= zapBackTime.tv_sec) { @@ -237,9 +212,40 @@ void CAdZapMenu::Run() } } } + + if (g_settings.adzap_writeData && (monitor || armed)) + WriteData(); + else + RemoveData(); } } +void CAdZapMenu::WriteData() +{ + int zp = g_settings.adzap_zapBackPeriod; + clock_gettime(CLOCK_REALTIME, &ts); + long int zb = armed ? zapBackTime.tv_sec + ZAPBACK_ALERT_PERIOD - ts.tv_sec : 0; + + if (FILE *f = fopen(ADZAP_DATA, "w")) + { + fprintf(f, "%" PRIx64 "\n%s\n%d\n%d:%02d\n%ld\n%ld:%02ld\n", + channelId, + channelName.c_str(), + zp, + zp / 60, zp % 60, + zb, + zb / 60, zb % 60); + fclose(f); + } + else + printf("CAdZapMenu::%s: failed.\n", __func__); +} + +void CAdZapMenu::RemoveData() +{ + if (access(ADZAP_DATA, F_OK) == 0) + unlink(ADZAP_DATA); +} int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) { Init(); diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 1317e5019..72df84a1d 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -40,6 +40,7 @@ class CAdZapMenu: public CMenuTarget, CChangeObserver bool armed; bool alerted; bool monitor; + struct timespec ts; struct timespec zapBackTime; std::string channelName; CMenuForwarder *forwarders[9]; @@ -54,6 +55,8 @@ class CAdZapMenu: public CMenuTarget, CChangeObserver void ShowMenu(); void Update(); void Run(void); + void WriteData(void); + void RemoveData(void); static void *Run(void *arg); public: static CAdZapMenu *getInstance(); From 9093418f0068f2614e7b3aaa54446a93b4d7a4d0 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Tue, 8 Mar 2016 10:41:10 +0100 Subject: [PATCH 262/690] install tmdb.png Signed-off-by: flk Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc9dff2f582f4ee1de03c2002a0a52655a491842 Author: Markus Volk Date: 2016-03-08 (Tue, 08 Mar 2016) --- data/icons/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index e1ffa5c61..d1bbad31a 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -251,6 +251,7 @@ install_DATA += \ subt.png \ subt_gray.png \ timer.png \ + tmdb.png \ tuner_1.png \ tuner_2.png \ tuner_3.png \ From 10a053b74af10be0391e3b2269624738ecd9bb30 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 10 Mar 2016 18:49:57 +0100 Subject: [PATCH 263/690] src/driver/netfile.cpp fix skip over bufer size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/30b1cdb4599778a847bd4187d7eb3c29d0cb961b Author: Jacek Jendrzej Date: 2016-03-10 (Thu, 10 Mar 2016) --- src/driver/netfile.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index cdcb848af..cf76fd0c9 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -1708,16 +1708,13 @@ int f_status(FILE *stream, void (*cb)(void*)) /* information into the CSTATE structure */ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) { - #define SKIP(a) for(;(a && !isalnum(*a)); ++a) {}; - char *ptr; - /* abort if we were submitted a NULL pointer */ if((!md) || (!state)) return; dprintf(stderr, "ShoutCAST_ParseMetaData(%p : %s, %p)\n", md, md, state); - ptr = strstr(md, "StreamTitle="); + char *ptr = strstr(md, "StreamTitle="); if(ptr) { @@ -1727,13 +1724,13 @@ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) if(!ptr) ptr = strstr(md, ", "); - + const int bufsize = 4095; /* no separator, simply copy everything into the 'title' field */ if(!ptr) { ptr = strchr(md, '='); - strncpy(state->title, ptr + 2, 4095); - state->title[4095] = '\0'; + strncpy(state->title, ptr + 2, bufsize); + state->title[bufsize] = '\0'; ptr = strchr(state->title, ';'); if(ptr) *(ptr - 1) = 0; @@ -1741,16 +1738,18 @@ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) } else { - SKIP(ptr); - strcpy(state->title, ptr); + //SKIP() + for(int i = 0;(ptr && i < bufsize && !isalnum(*ptr)); ++ptr,i++){}; + + strncpy(state->title, ptr,bufsize); ptr = strchr(state->title, ';'); if(ptr) *(ptr - 1) = 0; ptr = strstr(md, "StreamTitle="); ptr = strchr(ptr, '\''); - strncpy(state->artist, ptr + 1, 4095); - state->artist[4095] = '\0'; + strncpy(state->artist, ptr + 1, bufsize); + state->artist[bufsize] = '\0'; ptr = strstr(state->artist, " - "); if(!ptr) ptr = strstr(state->artist, ", "); From 1e908d977ee0e8f1575d091b6e5243ceda61fecd Mon Sep 17 00:00:00 2001 From: defans Date: Thu, 10 Mar 2016 22:15:04 +0100 Subject: [PATCH 264/690] infoviewer: don't handle volume keys in movieplayer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/de490421e3a2e25edb9f62aa9c3fdd2d7f909d6f Author: defans Date: 2016-03-10 (Thu, 10 Mar 2016) Origin message was: ------------------ - infoviewer: don't handle volume keys in movieplayer --- src/gui/infoviewer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0636a5eba..6b57dae19 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1117,7 +1117,14 @@ void CInfoViewer::loop(bool show_dot) /* this debug message will only hit in movieplayer mode, where console is * spammed to death anyway... */ printf("%s:%d msg->MP: %08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); - if (msg < CRCInput::RC_Events) /* RC / Keyboard event */ + + bool volume_keys = ( + msg == CRCInput::RC_spkr + || msg == (neutrino_msg_t) g_settings.key_volumeup + || msg == (neutrino_msg_t) g_settings.key_volumedown + ); + + if (msg < CRCInput::RC_Events && !volume_keys) { g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; From 537506ad0ab620ceced9dacaa49e864ca6b9e1bb Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 10 Mar 2016 23:39:32 +0100 Subject: [PATCH 265/690] src/gui/user_menue_setup.cpp fix possible AddressSanitizer: global-buffer-overflow Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5a0bb67e1a0bfaa5dc26aae0e4ea91663055d61 Author: Jacek Jendrzej Date: 2016-03-10 (Thu, 10 Mar 2016) --- src/gui/user_menue_setup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 1e3527344..d59be22ab 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -190,6 +190,10 @@ int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &actionKey) static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX]; neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key) { + if(key >= SNeutrinoSettings::ITEM_MAX){ + key = SNeutrinoSettings::ITEM_MAX-1; + } + static bool initialized = false; if (!initialized) { initialized = true; From d5704673593f3e2a6f302a040b7091d4fd81bee0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 11 Mar 2016 08:49:25 +0100 Subject: [PATCH 266/690] src/gui/user_menue_setup.cpp use ITEM_NONE Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8238bfd492a892e172b0c33de8252e5bfb041c02 Author: Jacek Jendrzej Date: 2016-03-11 (Fri, 11 Mar 2016) --- src/gui/user_menue_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index d59be22ab..ac39d1393 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -191,7 +191,7 @@ static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX]; neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key) { if(key >= SNeutrinoSettings::ITEM_MAX){ - key = SNeutrinoSettings::ITEM_MAX-1; + key = SNeutrinoSettings::ITEM_NONE; } static bool initialized = false; From 6f4ce7e5495de6e5241f8599e3d0c91ed0590821 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 11 Mar 2016 14:10:38 +0100 Subject: [PATCH 267/690] src/driver/netfile.cpp fix redirect url Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c49d9293a8fbe41654a79f137514edb073d7f9a Author: Jacek Jendrzej Date: 2016-03-11 (Fri, 11 Mar 2016) --- src/driver/netfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index cf76fd0c9..f7ac9658e 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -419,7 +419,7 @@ int request_file(URL *url) send(url->fd, str, strlen(str), 0); if( (meta_int = parse_response(url, &id3, &tmp)) < 0) - return -1; + return meta_int; if(meta_int) { @@ -493,7 +493,7 @@ int request_file(URL *url) send(url->fd, str, strlen(str), 0); if( (meta_int = parse_response(url, &id3, &tmp)) < 0) - return -1; + return meta_int; if(meta_int) { From 007207bc87e7a37b7565fa848eb1c53b6ecf0d6f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 12 Mar 2016 14:53:11 +0300 Subject: [PATCH 268/690] driver/record.cpp, driver/streamts.cpp: add more formats, for testing Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f3a2657c9e0670c5f5498c8298ad617bc5d4d0b2 Author: [CST] Focus Date: 2016-03-12 (Sat, 12 Mar 2016) --- src/driver/record.cpp | 34 +++++++++++++++++++++++++++++++--- src/driver/record.h | 1 + src/driver/streamts.cpp | 34 +++++++++++++++++++++++++++++++++- src/driver/streamts.h | 1 + 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index b642a6b74..b608b2ada 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1882,9 +1882,11 @@ void CStreamRec::Close() } avformat_free_context(ofcx); } - + if (bsfc) + av_bitstream_filter_close(bsfc); ifcx = NULL; ofcx = NULL; + bsfc = NULL; } void CStreamRec::GetPids(CZapitChannel * channel) @@ -1939,7 +1941,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li recMovieInfo->epgVideoPid = st->id; if (codec->codec_id == AV_CODEC_ID_H264) recMovieInfo->VideoType = 1; - printf("%s: [VIDEO] 0x%x \n", __FUNCTION__, recMovieInfo->epgVideoPid); + printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->epgVideoPid); } } } @@ -2085,7 +2087,11 @@ bool CStreamRec::Open(CZapitChannel * channel) printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); return false; } - if (!strstr(ifcx->iformat->name, "applehttp") && !strstr(ifcx->iformat->name, "mpegts")) { + if (!strstr(ifcx->iformat->name, "applehttp") && + !strstr(ifcx->iformat->name, "mpegts") && + !strstr(ifcx->iformat->name, "matroska") && + !strstr(ifcx->iformat->name, "avi") && + !strstr(ifcx->iformat->name, "mp4")) { printf("%s: not supported format [%s]!\n", __FUNCTION__, ifcx->iformat->name); return false; } @@ -2132,6 +2138,9 @@ bool CStreamRec::Open(CZapitChannel * channel) av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); + bsfc = av_bitstream_filter_init("h264_mp4toannexb"); + if (!bsfc) + printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); return true; } @@ -2156,6 +2165,25 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; + + AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; + if (bsfc && codec->codec_id == CODEC_ID_H264) { + AVPacket newpkt = pkt; + + int len; + if ((len = av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY)) < 0) { + av_free_packet(&pkt); + continue; + } + + av_free_packet(&pkt); + + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } + pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + av_write_frame(ofcx, &pkt); av_free_packet(&pkt); diff --git a/src/driver/record.h b/src/driver/record.h index 440de6d2a..d5d5c4495 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -242,6 +242,7 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread private: AVFormatContext *ifcx; AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; bool stopped; bool interrupt; time_t time_started; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 1554ce230..6ef96b9c5 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -749,8 +749,12 @@ void CStreamStream::Close() if (avio_ctx) av_free(avio_ctx); + if (bsfc) + av_bitstream_filter_close(bsfc); + ifcx = NULL; ofcx = NULL; + bsfc = NULL; avio_ctx = NULL; } @@ -788,7 +792,11 @@ bool CStreamStream::Open() printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); return false; } - if (!strstr(ifcx->iformat->name, "applehttp") && !strstr(ifcx->iformat->name, "mpegts")) { + if (!strstr(ifcx->iformat->name, "applehttp") && + !strstr(ifcx->iformat->name, "mpegts") && + !strstr(ifcx->iformat->name, "matroska") && + !strstr(ifcx->iformat->name, "avi") && + !strstr(ifcx->iformat->name, "mp4")) { printf("%s: not supported format [%s]!\n", __FUNCTION__, ifcx->iformat->name); return false; } @@ -830,6 +838,9 @@ bool CStreamStream::Open() av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); + bsfc = av_bitstream_filter_init("h264_mp4toannexb"); + if (!bsfc) + printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); return true; } @@ -872,6 +883,27 @@ void CStreamStream::run() av_init_packet(&pkt); if (av_read_frame(ifcx, &pkt) < 0) break; + if (pkt.stream_index < 0) + continue; + + AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; + if (bsfc && codec->codec_id == CODEC_ID_H264 ) { + AVPacket newpkt = pkt; + + int len; + if ((len = av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY)) < 0) { + av_free_packet(&pkt); + continue; + } + + av_free_packet(&pkt); + + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } + pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + av_write_frame(ofcx, &pkt); av_free_packet(&pkt); } diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 6c6d7dd72..da2708e51 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -73,6 +73,7 @@ class CStreamStream : public CStreamInstance private: AVFormatContext *ifcx; AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; AVIOContext *avio_ctx; bool stopped; From 632508bae552954510c755de9e81d4355edac53c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 12 Mar 2016 13:48:42 +0100 Subject: [PATCH 269/690] src/gui/test_menu.cpp fix pugixml compil Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/929bc61cf50d50707e61c6ca84465fa3d0917ce6 Author: Jacek Jendrzej Date: 2016-03-12 (Sat, 12 Mar 2016) --- src/gui/test_menu.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 02e839237..e3690d791 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -135,13 +135,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) CVFD::getInstance()->ShowIcon((fp_icon) 0x09000002, true); CVFD::getInstance()->ShowIcon((fp_icon) 0x0B000002, true); char text[255]; - char buf[XML_UTF8_ENCODE_MAX]; int ch = 0x2588; - int len = XmlUtf8Encode(ch, buf); - + std::string tmp = Unicode_Character_to_UTF8(ch); + size_t len = tmp.size(); for (int i = 0; i < 12; i++) { - memmove(&text[i*len], buf, len); + memmove(&text[i*len], tmp.c_str(), len); } text[12*len] = 0; From db2aae67234eeb597c928409511d2bf702b4fe67 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 12 Mar 2016 16:13:22 +0100 Subject: [PATCH 270/690] src/driver/streamts.cpp init bsfc, fix possible segfault Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2adcd8b5d649b97f28af10a8f0dd474d0a9fbb99 Author: Jacek Jendrzej Date: 2016-03-12 (Sat, 12 Mar 2016) --- src/driver/streamts.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 6ef96b9c5..e5a6b1e48 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -709,6 +709,7 @@ CStreamStream::CStreamStream(int clientfd, t_channel_id chid, stream_pids_t &_pi { ifcx = NULL; ofcx = NULL; + bsfc = NULL; avio_ctx = NULL; stopped = true; interrupt = false; From 964e9042cbf10289fa1d89d28c12517279cc7771 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 12 Mar 2016 18:55:53 +0100 Subject: [PATCH 271/690] src/nhttpd/tuxboxapi/ fix AddressSanitizer: strcpy-param-overlap: memory ranges Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f2c2c7631d6db8d863517ea3cc292502aa13828 Author: Jacek Jendrzej Date: 2016-03-12 (Sat, 12 Mar 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 3 ++- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 95b53c2e1..af3a3c07e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2247,7 +2247,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) { if(!(init_iso)) { - strncpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ),DESC_MAX_LEN ); + std::string tmp_desc = _getISO639Description( pids.APIDs[j].desc); + strncpy(pids.APIDs[j].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].desc,pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].desc,pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index c1da704f8..367e3ee89 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -694,7 +694,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { if(!(init_iso)) { - strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) ); + std::string tmp_desc = _getISO639Description( pids.APIDs[j].desc); + strncpy(pids.APIDs[j].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,(j==selected_apid) ? "selected=\"selected\"" : "",std::string(pids.APIDs[j].desc).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } @@ -711,7 +712,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { if(!(init_iso)) { - strcpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ) ); + std::string tmp_desc = _getISO639Description( pids.APIDs[i].desc); + strncpy(pids.APIDs[i].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } yresult += string_printf("\r\n", idx_as_id ? i : it->pid, (i==selected_apid) ? "selected=\"selected\"" : "",pids.APIDs[i].desc, From daca0fd830abffb5ffc320563052e06f573040ad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Mar 2016 23:58:51 +0100 Subject: [PATCH 272/690] epgview: resort EpgButtons; keep color keys together Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/091e28f229b95aea5c5cf165712dbc8806870a21 Author: vanhofen Date: 2016-03-12 (Sat, 12 Mar 2016) Origin message was: ------------------ - epgview: resort EpgButtons; keep color keys together --- src/gui/epgview.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ab674d61f..f7a3459ef 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1224,9 +1224,8 @@ const struct button_label EpgButtons[] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } - + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } }; void CEpgData::showTimerEventBar (bool pshow, bool adzap) From 699a4a73e97b5af8899ac70fb82d3d0c5020c5b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 13 Mar 2016 00:31:30 +0100 Subject: [PATCH 273/690] Revert "- epgview: resort EpgButtons; keep color keys together" This reverts commit daca0fd, because it breakes footers logic :/ Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/51df1933b0eb2b58476a8363cac6603e8c590a4e Author: vanhofen Date: 2016-03-13 (Sun, 13 Mar 2016) --- src/gui/epgview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f7a3459ef..ab674d61f 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1224,8 +1224,9 @@ const struct button_label EpgButtons[] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } + }; void CEpgData::showTimerEventBar (bool pshow, bool adzap) From 6ad61a2b1b3e71a2a34b3a9299d4c7d56ac16a01 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Mar 2016 13:10:56 +0100 Subject: [PATCH 274/690] neutrinoyparser: smoother view in channellist; align icons right Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fd9c12aa95c043630bb82d12e7e4d748b71a6e7 Author: vanhofen Date: 2016-03-14 (Mon, 14 Mar 2016) Origin message was: ------------------ - neutrinoyparser: smoother view in channellist; align icons right --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 58 +++++++++++++++--------- src/nhttpd/web/Y_Main.css | 8 ++++ src/nhttpd/web/Y_Version.txt | 4 +- 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 367e3ee89..60dbac08a 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -126,7 +126,6 @@ const CNeutrinoYParser::TyFuncCall CNeutrinoYParser::yFuncCallList[]= {"set_timer_form", &CNeutrinoYParser::func_set_timer_form}, {"bouquet_editor_main", &CNeutrinoYParser::func_bouquet_editor_main}, {"set_bouquet_edit_form", &CNeutrinoYParser::func_set_bouquet_edit_form}, - }; //------------------------------------------------------------------------- // y-func : dispatching and executing @@ -400,7 +399,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if(event.eventID && event.duration > 0) { prozent = 100 * (time(NULL) - event.startTime) / event.duration; - yresult += string_printf(" - + - + @@ -50,7 +50,7 @@ function do_submit() { - +
\n" + yresult += string_printf(" - + diff --git a/src/nhttpd/web/Y_Settings_Live.yhtm b/src/nhttpd/web/Y_Settings_Live.yhtm index 69e8256b6..f851e3846 100644 --- a/src/nhttpd/web/Y_Settings_Live.yhtm +++ b/src/nhttpd/web/Y_Settings_Live.yhtm @@ -24,7 +24,7 @@ function do_refresh_liveview() - + @@ -35,15 +35,15 @@ function do_refresh_liveview() - + - +
\n" "\t" "" "" @@ -414,7 +413,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } else { - yresult += string_printf("\n\n"; if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) diff --git a/src/nhttpd/web/Y_Baselib.js b/src/nhttpd/web/Y_Baselib.js index fa4754711..7bd0552e6 100644 --- a/src/nhttpd/web/Y_Baselib.js +++ b/src/nhttpd/web/Y_Baselib.js @@ -476,3 +476,27 @@ function yhttpd_cache_clear(category) else loadSyncURL("/y/cache-clear?category="+category); } + +function saveTextAsFile(content, filename, filetype) +{ + var textFileAsBlob = new Blob([content], { type: filetype }); + var downloadLink = document.createElement("a"); + downloadLink.download = filename; + downloadLink.innerHTML = "Download File"; + if (window.webkitURL != null) + { + // Chrome allows the link to be clicked + // without actually adding it to the DOM. + downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob); + } + else + { + // Firefox requires the link to be added to the DOM + // before it can be clicked. + downloadLink.href = window.URL.createObjectURL(textFileAsBlob); + downloadLink.onclick = function() { this.parentNode.removeChild(this); }; + downloadLink.style.display = "none"; + document.body.appendChild(downloadLink); + } + downloadLink.click(); +} diff --git a/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm b/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm index 70fc17378..072ebe026 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm @@ -10,6 +10,15 @@ function do_zap(channelid) { function do_epg(channelid,logoid) { window.location.href="Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channelid+"&logoid="+logoid; } +function do_stream(channelid, channelname) +{ + var title = "livestream.m3u" + var type = "application/octet-stream" + var plist = "#EXTM3U\n"; + plist += "#EXTINF:-1," + channelname + "\n"; + plist += "http://" + window.location.hostname + ":31339/id=" + channelid + "\n"; + saveTextAsFile(plist, title, type); +} function do_streaminfo() { window.open("Y_StreamInfo.yhtm", "stream", "width=400"); } diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index c933d7fa9..5e1a41265 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.34 +version=2.9.0.35 date=14.03.2016 type=Release info=Port CST From de7fd8bcde184d6bd83b207db05da333398f2393 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Mar 2016 21:55:45 +0100 Subject: [PATCH 278/690] yWeb/neutrinoyparser: add icons for scrabled and webtv channels Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/129dacc9126a479e520fbb3b6fca97d577f20cd3 Author: vanhofen Date: 2016-03-14 (Mon, 14 Mar 2016) Origin message was: ------------------ - yWeb/neutrinoyparser: add icons for scrabled and webtv channels --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 9 +++++++++ src/nhttpd/web/Y_Version.txt | 2 +- src/nhttpd/web/images/Makefile.am | 2 ++ src/nhttpd/web/images/key.png | Bin 0 -> 612 bytes src/nhttpd/web/images/webtv.png | Bin 0 -> 904 bytes 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/nhttpd/web/images/key.png create mode 100644 src/nhttpd/web/images/webtv.png diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index b50ab79d1..637e64198 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -450,6 +450,15 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: yresult += "\n"; } + if (!channel->getUrl().empty()) + { + yresult += "\"WebTV\"\n"; + } + + if (channel->scrambled) + { + yresult += "\"Scrambled\"\n"; + } if (event.eventID) { yresult += string_printf("" diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 5e1a41265..f2f7e0cd8 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.35 +version=2.9.0.36 date=14.03.2016 type=Release info=Port CST diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am index b5b1af3aa..f8a8e47be 100644 --- a/src/nhttpd/web/images/Makefile.am +++ b/src/nhttpd/web/images/Makefile.am @@ -34,6 +34,7 @@ install_DATA = accept.png \ hidden.png \ info.png \ inlink.gif \ + key.png \ live.png \ live_popup.png \ livelock.png \ @@ -82,6 +83,7 @@ install_DATA = accept.png \ volumeunmute.png \ volumeup.png \ wait.gif \ + webtv.png \ wget.png \ x_red.png \ zap.png diff --git a/src/nhttpd/web/images/key.png b/src/nhttpd/web/images/key.png new file mode 100644 index 0000000000000000000000000000000000000000..4ec1a928140311ff30a0a9120e958096c77f446e GIT binary patch literal 612 zcmV-q0-ODbP)nmX^MrbE*gmZ6|p*GkKoxa?X?hD9M+@sRvFH{EqYA??u6x z2pu{uGnrwz*>rh zfvUA@7b#acN?M*mBG3rQV?e^+0R5m3YXWyRZL5Bt@3vAw{9JaEW$}=f4bXO52yBH{ z;G~ZN|GLn>k~{On3Swd-Sy(gFkOdyw-RP%&exwl01RJRp))TI*SsngruhZksQ*NT%!X?K0000f8V*xNivgW#x$5qM)m zrKme?K(SUtrJya*pw&i_617T+mqf{=P125;$;>2~bIx~lVU59e`SQHK=Y@wyIOo_t zqmv_tfLDP1Ko<}Ibzs_A_txu&PMzPb7yklACr1Kc40z_L;*qG(+C`(8r71z11kDX5 zR?cao%@=9HVx6H$hH4s7PFlHE54kP(5QE)!?UkuI z4dAaGT|5Z9c4GIF{uQ&y3Nf+OY$Q3VX-Ff1xutdLo0~+13Zi3GDkfp^tjE1_*uSJddD#Q@ z7kBhA8!xl0R@vdQSRAFY0x zQ;Hy|abn*-!Z3sZu-0O&CB8eRQmK$62~?CH7;UQ!+34%^^R&0z$F;u#5*3p3TF7Rz zXswY_VvM0ys}aXB&N-ZOXlXV*t@IBI)kW@XE3#ak#D+^`{1lZm(OMHl5kd&+^*Y8F zf*`>2{z>0zTk@3DZ+!gg1$}$2i=eqgz49G}LW)r7mb+34&-1np0fZ2^y8g_2=ZQ1p zGF6|C&tBk>zWeF$vlMccR!?mKgb-vh8Nx6miXy@=#P@x;(wqnYRH~l;dhYVYG?sgh zJ#d)c$^kkT^5yt>2BxO?FrVj+UAriiO4Mp=^mO+iJb}z~{8y&oHy>-)N}tin9DQNv z#h_Y(Z%&^@8iUgstu@9NthE?pFvhUHzJ5gfzs^G^4?JzOdC3^N#~NF>xvm4h0H?k` edHKEV`o95l+q4i#qD!d&0000 Date: Tue, 15 Mar 2016 18:53:47 +0100 Subject: [PATCH 279/690] cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/24c6da150a671a4bc990ba42116995e59de115c8 Author: vanhofen Date: 2016-03-15 (Tue, 15 Mar 2016) Origin message was: ------------------ - cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" --- data/cables.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/data/cables.xml b/data/cables.xml index 0e54cd3d8..674617504 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -484,10 +484,10 @@ + - @@ -495,7 +495,6 @@ - @@ -512,22 +511,26 @@ - + - + - + - + + + + + From b11faa31f973df4af64f081b989048ebed65bf17 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 15 Mar 2016 20:44:36 +0100 Subject: [PATCH 280/690] cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f8f42fd32be0374cbb94a5fd00f1fb8f09ffe8b1 Author: vanhofen Date: 2016-03-15 (Tue, 15 Mar 2016) Origin message was: ------------------ - cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" --- data/cables.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/data/cables.xml b/data/cables.xml index 674617504..c9d0eb201 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -495,6 +495,7 @@ + From fc29aa59c7c25798a4c6d21d1d4a4ac0d886c003 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Mar 2016 09:12:43 +0100 Subject: [PATCH 281/690] CComponentsButton: fix button icon position on dynamic changed conditions In some constellations it is possible, that costum icons with other dimensions will be not correct positionized. This should fix this issue. This reverts partial commit 289f5b30e67174fee00f7d480520ca1e8df6061b. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7197f51e8992c75bc27778029a8e1780d7d516cc Author: Thilo Graf Date: 2016-03-17 (Thu, 17 Mar 2016) --- src/gui/components/cc_frm_button.cpp | 43 ++++++++++++++++------------ 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 4a9b4b68f..163c4be5c 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -142,29 +142,29 @@ void CComponentsButton::initIcon() } //initialize icon object + string::size_type pos = cc_btn_icon.find("/", 0); + if (pos == string::npos) + cc_btn_icon = frameBuffer->getIconBasePath() + "/" + cc_btn_icon + ".png"; + if (cc_btn_icon_obj == NULL){ - int y_icon = 0; - - string::size_type pos = cc_btn_icon.find("/", 0); - if (pos == string::npos) - cc_btn_icon = frameBuffer->getIconBasePath() + "/" + cc_btn_icon + ".png"; - - cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, y_icon, cc_btn_icon, this); + cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, 0, cc_btn_icon, this); cc_btn_icon_obj->SetTransparent(CFrameBuffer::TM_BLACK); - int h_icon = cc_btn_icon_obj->getHeight(); - - //get required icon height - int h_max = height-2*fr_thickness; - - //get current icon dimensions - if (h_icon > h_max) - cc_btn_icon_obj->setHeight(h_max, true); - - y_icon = h_max/2 - cc_btn_icon_obj->getHeight()/2; - - cc_btn_icon_obj->setYPos(y_icon); cc_btn_icon_obj->doPaintBg(false); } + + int y_icon = cc_btn_icon_obj->getYPos(); + int h_icon = cc_btn_icon_obj->getHeight(); + + //get required icon height + int h_max = height-2*fr_thickness; + + //get current icon dimensions + if (h_icon > h_max) + cc_btn_icon_obj->setHeight(h_max, true); + + y_icon = h_max/2 - cc_btn_icon_obj->getHeight()/2; + + cc_btn_icon_obj->setYPos(y_icon); } void CComponentsButton::initCaption() @@ -237,6 +237,11 @@ void CComponentsButton::initCaption() x_icon += fr_thickness + append_x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); + /*in case of dynamic changed height of caption or button opbject itself, + *we must ensure centered y position of icon object + */ + int y_icon = height/2 - cc_btn_icon_obj->getHeight()/2; + cc_btn_icon_obj->setYPos(y_icon); } if (cc_btn_capt_obj){ cc_btn_capt_obj->setXPos(x_icon + w_icon + append_x_offset); From 6e9f947b8f27185bdde4fb21f27e45c59ace23a3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Mar 2016 09:14:50 +0100 Subject: [PATCH 282/690] CComponentsButton: use full height if no frame available Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/95885c4f6ec0045010646d03f31d48b83b435a60 Author: Thilo Graf Date: 2016-03-17 (Thu, 17 Mar 2016) --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 7edb21395..c5c8a890c 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -142,7 +142,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/(btn_contour ? 4 : 3), txt, btn_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, btn_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btn->enableFrame(btn_contour); From b82a6b0ed42c2f0e83da918774f4c76beaac1cf8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Mar 2016 10:25:26 +0100 Subject: [PATCH 283/690] CFrameBuffer: outsource code for icon path detecting Unified handling and makes it possible to use in other objects. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/97343d1190c60d58e9715934e3c3f8a2004acbe5 Author: Thilo Graf Date: 2016-03-17 (Thu, 17 Mar 2016) --- src/driver/framebuffer.cpp | 22 ++++++++++++++-------- src/driver/framebuffer.h | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 4c77ed633..d02149ce0 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1013,6 +1013,18 @@ void CFrameBuffer::setIconBasePath(const std::string & iconPath) iconBasePath = iconPath; } +std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_type) +{ + std::string path, filetype; + filetype = "." + file_type; + path = std::string(ICONSDIR_VAR) + "/" + icon_name + filetype; + if (access(path.c_str(), F_OK)) + path = iconBasePath + "/" + icon_name + filetype; + if (icon_name.find("/", 0) != std::string::npos) + path = icon_name; + return path; +} + void CFrameBuffer::getIconSize(const char * const filename, int* width, int *height) { *width = 0; @@ -1110,11 +1122,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in /* we cache and check original name */ it = icon_cache.find(filename); if(it == icon_cache.end()) { - std::string newname = std::string(ICONSDIR_VAR) + "/" + filename + ".png"; - if (access(newname.c_str(), F_OK)) - newname = iconBasePath + "/" + filename + ".png"; - if (filename.find("/", 0) != std::string::npos) - newname = filename; + std::string newname = getIconPath(filename); //printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout); data = g_PicViewer->getIcon(newname, &width, &height); @@ -1133,9 +1141,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in goto _display; } - newname = std::string(ICONSDIR_VAR) + "/" + filename + ".raw"; - if (access(newname.c_str(), F_OK)) - newname = iconBasePath + "/" + filename + ".raw"; + newname = getIconPath(filename, "raw"); int lfd = open(newname.c_str(), O_RDONLY); diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 6ee46df62..9ed2ca839 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -226,6 +226,7 @@ class CFrameBuffer : public sigc::trackable void setIconBasePath(const std::string & iconPath); std::string getIconBasePath(){return iconBasePath;}; + std::string getIconPath(std::string icon_name, std::string file_type = "png"); void getIconSize(const char * const filename, int* width, int *height); /* h is the height of the target "window", if != 0 the icon gets centered in that window */ From 5308b910ef276b037854232b9f17e487283557df Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Mar 2016 10:30:47 +0100 Subject: [PATCH 284/690] CComponentsButton: get image path from framebuffer Buttons didn't get icons from custom path e.g. /var/tuxbox/icons This should fix this. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/95e9ca5de806a86fc732d2057ac03231ca51e2bd Author: Thilo Graf Date: 2016-03-17 (Thu, 17 Mar 2016) --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 163c4be5c..ee7b4a23d 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -144,7 +144,7 @@ void CComponentsButton::initIcon() //initialize icon object string::size_type pos = cc_btn_icon.find("/", 0); if (pos == string::npos) - cc_btn_icon = frameBuffer->getIconBasePath() + "/" + cc_btn_icon + ".png"; + cc_btn_icon = frameBuffer->getIconPath(cc_btn_icon); if (cc_btn_icon_obj == NULL){ cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, 0, cc_btn_icon, this); From 7d29ddbafc3023a94f0de3b4b729ba39521b0a6d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Mar 2016 10:49:35 +0100 Subject: [PATCH 285/690] CComponentsScrollBar: fix missed navi arrows Paths were broken comes in with 9c85004d31727e0066f44c3eacb5bad953977eab Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c07f9994761406e495fb58778399b14720156678 Author: Thilo Graf Date: 2016-03-17 (Thu, 17 Mar 2016) --- src/gui/components/cc_frm_scrollbar.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 309f6be95..62dc7cffc 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -80,9 +80,8 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_up_obj = sb_down_obj = NULL; sb_segments_obj = NULL; - string ftype = ".png"; - sb_up_icon = NEUTRINO_ICON_BUTTON_TOP + ftype; - sb_down_icon = NEUTRINO_ICON_BUTTON_DOWN + ftype; + sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_TOP) ; + sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); sb_segments_count = count; sb_mark_id = 0; From 07ee447e97a7f98ca884e3191cdbdbe786b4a9bd Mon Sep 17 00:00:00 2001 From: Marc Szymkowiak Date: Fri, 19 Feb 2016 21:37:02 +0100 Subject: [PATCH 286/690] remove unused vars in controlapi Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ac755f75c0657977e0108360be68df2b13a9a49 Author: Marc Szymkowiak Date: 2016-02-19 (Fri, 19 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index af3a3c07e..cde36f552 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3479,7 +3479,6 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) CConfigFile *Config = new CConfigFile(','); Config->loadConfig(MOVIEBROWSER_CONFIGFILE); char index[21]; - std::string mb_dir_used; std::string mb_dir; for(int i=0;i<8;i++) { @@ -3530,7 +3529,6 @@ void CControlAPI::getDirCGI(CyhookHandler *hh) std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) { std::string item = ""; - std::string dirname; DIR *dirp; struct dirent *entry; From 73f6e9df2a8b5ecffea06ae8d03744432fb265d4 Mon Sep 17 00:00:00 2001 From: Marc Szymkowiak Date: Fri, 19 Feb 2016 21:34:53 +0100 Subject: [PATCH 287/690] add getmovies control Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f323f61785015a33ea130c764967d1c0901223a5 Author: Marc Szymkowiak Date: 2016-02-19 (Fri, 19 Feb 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 152 +++++++++++++++++++++++++++- src/nhttpd/tuxboxapi/controlapi.h | 2 + 2 files changed, 153 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index cde36f552..c9610f635 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -225,7 +225,8 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= // filehandling {"file", &CControlAPI::FileCGI, "+xml"}, {"statfs", &CControlAPI::StatfsCGI, "+xml"}, - {"getdir", &CControlAPI::getDirCGI, "+xml"} + {"getdir", &CControlAPI::getDirCGI, "+xml"}, + {"getmovies", &CControlAPI::getMoviesCGI, "+xml"} }; //----------------------------------------------------------------------------- // Main Dispatcher @@ -3550,3 +3551,152 @@ std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, } return result; } + +//----------------------------------------------------------------------------- +/** Get neutrino movies + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getmovies?ir=allmoviedirs&[&subdirs=true][&format=|xml|json] + * @endcode + * +{"success": "true", "data":{"movies": [{"title": "Sample.mkv", +"path": "/media/sda1/movies/Sample.mkv", +"size": "1136242099" +} +,{"title": "Aufnahme1.ts", +"path": "/media/sda1/recording/Aufnahme1.ts", +"size": "941" +} +,{"title": "Aufnahme2.ts", +"path": "/media/sda1/recording/Aufnahme2.ts", +"size": "941" +} +] +}} + * @endcode + * + */ +//----------------------------------------------------------------------------- +void CControlAPI::getMoviesCGI(CyhookHandler *hh) { + std::string result = ""; + bool isFirstLine = true; + bool subdirs = true; + + if(hh->ParamList["subdirs"] == "false") { + subdirs = false; + } + + TOutType outType = hh->outStart(); + + //Shows all movies with path in moviebrowser.conf + if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { + CConfigFile *Config = new CConfigFile(','); + Config->loadConfig(MOVIEBROWSER_CONFIGFILE); + char index[21]; + std::string mb_dir; + + for(int i=0;i<8;i++) { + snprintf(index, sizeof(index), "%d", i); + mb_dir = "mb_dir_"; + mb_dir = mb_dir + index; + mb_dir = Config->getString(mb_dir, ""); + + if(!mb_dir.empty()) { + result = readMovies(hh, mb_dir, result, subdirs); + } + } + } + + //Shows all movies in the recordingdir + if (hh->ParamList["dir"] == "recordingdir" || hh->ParamList["dir"] == "allmoviedirs" ) { + result = readMovies(hh, g_settings.network_nfs_recordingdir, result, subdirs); + } + + //Shows movie from a given path + if (hh->ParamList["dir"][0] == '/') { + result = readMovies(hh, hh->ParamList["dir"], result, subdirs); + } + + result = hh->outArray("movies", result); + // write footer + if (outType == json) { + hh->WriteLn(json_out_success(result)); + } + else { + hh->WriteLn(result); + } +} + +//Helpfunction to get subdirs of a dir +std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) { + std::string item = ""; + std::string dirname; + DIR *dirp; + struct dirent *entry; + + if ((dirp = opendir(path.c_str()))) { + while ((entry = readdir(dirp))) { + if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { + if (path[path.length() - 1] != '/') { + path += "/"; + } + std::string fullname = path + entry->d_name; + item += hh->outPair("dir", hh->outValue(fullname), false); + result += hh->outNext(); + result += hh->outArrayItem("item", item, false); + item = ""; + result = getSubdirectories(hh, fullname, result); + } + } + closedir(dirp); + } + return result; +} + +//Helpfunction to get movies of a dir +std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs) { + std::string item = ""; + std::string fullname; + DIR *dirp; + struct dirent *entry; + + if ((dirp = opendir(path.c_str()))) { + if (path[path.length() - 1] != '/') { + path += "/"; + } + while ((entry = readdir(dirp))) { + if(entry->d_type == 8) { + fullname = path + entry->d_name; + item += hh->outPair("title", hh->outValue(entry->d_name),true); + item += hh->outPair("path", hh->outValue(fullname), true); + struct stat statbuf; + if (stat(fullname.c_str(), &statbuf) != -1) { + /* Print size of file. */ + item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), false); + } + if(!result.empty()) { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + item = ""; + } + } + closedir(dirp); + if ((dirp = opendir(path.c_str()))) { + if(subdirs) + { + while ((entry = readdir(dirp))) { + if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { + fullname = path + entry->d_name; + result = readMovies(hh, fullname, result, subdirs); + } + } + } + closedir(dirp); + } + } + return result; +} diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 95bdef974..238dc1cf8 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -130,6 +130,8 @@ private: void StatfsCGI(CyhookHandler *hh); void SignalInfoCGI(CyhookHandler *hh); void getDirCGI(CyhookHandler *hh); + void getMoviesCGI(CyhookHandler *hh); + std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result); From dba4d0efc5a5b89d0e69d53cf277fdf24e254927 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 19 Mar 2016 10:02:40 +0100 Subject: [PATCH 288/690] controlapi: whitespace cleanup; remove dup getSubdirectories() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2fd4d6c4a174d148171dab6250ff370bba786245 Author: vanhofen Date: 2016-03-19 (Sat, 19 Mar 2016) Origin message was: ------------------ - controlapi: whitespace cleanup; remove dup getSubdirectories() --- src/nhttpd/tuxboxapi/controlapi.cpp | 29 ++--------------------------- src/nhttpd/tuxboxapi/controlapi.h | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index c9610f635..03c165a93 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3552,6 +3552,7 @@ std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, return result; } + //----------------------------------------------------------------------------- /** Get neutrino movies * @@ -3630,32 +3631,6 @@ void CControlAPI::getMoviesCGI(CyhookHandler *hh) { } } -//Helpfunction to get subdirs of a dir -std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) { - std::string item = ""; - std::string dirname; - DIR *dirp; - struct dirent *entry; - - if ((dirp = opendir(path.c_str()))) { - while ((entry = readdir(dirp))) { - if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { - if (path[path.length() - 1] != '/') { - path += "/"; - } - std::string fullname = path + entry->d_name; - item += hh->outPair("dir", hh->outValue(fullname), false); - result += hh->outNext(); - result += hh->outArrayItem("item", item, false); - item = ""; - result = getSubdirectories(hh, fullname, result); - } - } - closedir(dirp); - } - return result; -} - //Helpfunction to get movies of a dir std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs) { std::string item = ""; @@ -3681,7 +3656,7 @@ std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::st result += hh->outNext(); } result += hh->outArrayItem("item", item, false); - item = ""; + item = ""; } } closedir(dirp); diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 238dc1cf8..05749b7f5 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -131,7 +131,7 @@ private: void SignalInfoCGI(CyhookHandler *hh); void getDirCGI(CyhookHandler *hh); void getMoviesCGI(CyhookHandler *hh); - std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); + std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result); From 6f5e577c2c2534388a70bba1b4bcb49ce9cabfb7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 19 Mar 2016 10:18:16 +0100 Subject: [PATCH 289/690] controlapi: use hh->SendResult() in new getMoviesCGI() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5f3531913c26547a6932485adc48f3b81ebcc2d Author: vanhofen Date: 2016-03-19 (Sat, 19 Mar 2016) Origin message was: ------------------ - controlapi: use hh->SendResult() in new getMoviesCGI() --- src/nhttpd/tuxboxapi/controlapi.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 03c165a93..30d0874cc 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3622,13 +3622,8 @@ void CControlAPI::getMoviesCGI(CyhookHandler *hh) { } result = hh->outArray("movies", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } //Helpfunction to get movies of a dir From 0625fcb709acc982ad1b5ef88952f814a2541c07 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 19 Mar 2016 16:13:56 +0100 Subject: [PATCH 290/690] nhttpd: unused var and function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/136955157de960f312a6d8ed24309facc84121b9 Author: Jacek Jendrzej Date: 2016-03-19 (Sat, 19 Mar 2016) Origin message was: ------------------ nhttpd: unused var and function --- src/nhttpd/tuxboxapi/controlapi.cpp | 3 +-- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 4 ++-- src/nhttpd/tuxboxapi/neutrinoapi.h | 8 ++++---- src/nhttpd/yhttpd_core/ysocket.cpp | 3 ++- src/nhttpd/yhttpd_core/ysocket.h | 3 ++- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 30d0874cc..284663c89 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3583,14 +3583,13 @@ std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, //----------------------------------------------------------------------------- void CControlAPI::getMoviesCGI(CyhookHandler *hh) { std::string result = ""; - bool isFirstLine = true; bool subdirs = true; if(hh->ParamList["subdirs"] == "false") { subdirs = false; } - TOutType outType = hh->outStart(); + hh->outStart(); //Shows all movies with path in moviebrowser.conf if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index b519f5f5f..82e2100cd 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -309,7 +309,7 @@ std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) } //------------------------------------------------------------------------- - +#if 0 //never used CZapitClient::BouquetChannelList *CNeutrinoAPI::GetBouquet(unsigned int, int) { //FIXME @@ -337,7 +337,7 @@ void CNeutrinoAPI::UpdateChannelList(void) { //FIXME } - +#endif //------------------------------------------------------------------------- std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index fc3f8483e..1685d5874 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -61,10 +61,12 @@ public: bool GetChannelEvents(void); #if 0 /* unused funktion*/ bool GetStreamInfo(int bitinfo[10]); -#endif - std::string GetServiceName(t_channel_id channel_id); CZapitClient::BouquetChannelList *GetBouquet(unsigned int BouquetNr, int Mode); CZapitClient::BouquetChannelList *GetChannelList(int Mode); + void UpdateBouquet(unsigned int BouquetNr); + void UpdateChannelList(void); +#endif + std::string GetServiceName(t_channel_id channel_id); // support functions void ZapTo (const char * const target); @@ -72,8 +74,6 @@ public: void ZapToChannelId (t_channel_id channel_id); t_channel_id ChannelNameToChannelId(std::string search_channel_name); - void UpdateBouquet(unsigned int BouquetNr); - void UpdateChannelList(void); void UpdateBouquets(void); std::string timerEventType2Str(CTimerd::CTimerEventTypes type); diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index 4b3f4c6cf..93b1af233 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -291,6 +291,7 @@ int CySocket::Send(char const *buffer, unsigned int length) { BytesSend += len; return len; } +#if 0 //never used //----------------------------------------------------------------------------- // Check if Socket was closed by client //----------------------------------------------------------------------------- @@ -303,7 +304,7 @@ bool CySocket::CheckSocketOpen() { return !(recv(sock, buffer, sizeof(buffer), MSG_PEEK | MSG_DONTWAIT) == 0); #endif } - +#endif //============================================================================= // Aggregated Send- and Receive- Operations //============================================================================= diff --git a/src/nhttpd/yhttpd_core/ysocket.h b/src/nhttpd/yhttpd_core/ysocket.h index 8cd1b172e..06396b4c0 100644 --- a/src/nhttpd/yhttpd_core/ysocket.h +++ b/src/nhttpd/yhttpd_core/ysocket.h @@ -68,8 +68,9 @@ public: // send & receive (basic) int Read(char *buffer, unsigned int length); // Read a buffer (normal or SSL) int Send(char const *buffer, unsigned int length); // Send a buffer (normal or SSL) +#if 0 //#endif bool CheckSocketOpen(); // check if socket was closed by client - +#endif // send & receive bool SendFile(int filed, off_t start = 0, off_t size = -1); // Send a File std::string ReceiveBlock(); // receive a Block. Look at length From 33b04e842722bd21341c475e0779732a857cd457 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 21 Mar 2016 13:44:43 +0300 Subject: [PATCH 291/690] driver/record.cpp, driver/streamts.cpp: ignore bitstream filter errors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59c4b4237663223744aba01d4edf031a03571504 Author: [CST] Focus Date: 2016-03-21 (Mon, 21 Mar 2016) --- src/driver/record.cpp | 12 ++++-------- src/driver/streamts.cpp | 13 ++++--------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index b608b2ada..a9be1ea70 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1862,6 +1862,7 @@ CStreamRec::CStreamRec(const CTimerd::RecordingInfo * const eventinfo, std::stri ofcx = NULL; stopped = true; interrupt = false; + bsfc = NULL; } CStreamRec::~CStreamRec() @@ -2170,16 +2171,11 @@ void CStreamRec::run() if (bsfc && codec->codec_id == CODEC_ID_H264) { AVPacket newpkt = pkt; - int len; - if ((len = av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY)) < 0) { + if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_free_packet(&pkt); - continue; + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; } - - av_free_packet(&pkt); - - newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); - pkt = newpkt; } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index e5a6b1e48..f729fe580 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -891,16 +891,11 @@ void CStreamStream::run() if (bsfc && codec->codec_id == CODEC_ID_H264 ) { AVPacket newpkt = pkt; - int len; - if ((len = av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY)) < 0) { + if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_free_packet(&pkt); - continue; - } - - av_free_packet(&pkt); - - newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); - pkt = newpkt; + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } } pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); From 33636cae0ec370f4398cec69b89fded27fd90f76 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Mar 2016 08:40:14 +0100 Subject: [PATCH 292/690] CCDraw: don't use clear screen for cleanup before gradient paint Until now clean up screen was required to avoid ghost paints with hardware acceleration. But this causes partial flicker effects, especially when new instances are created. So it makes more sense to hold instances and use captured screen instead blank screen. Optional paint cache or clean up must be enabled. You can enable/disable clean up with: enableGradientBgCleanUp()/disableGradientBgCleanUp() Paint cache: enablePaintCache()/disablePaintCache() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8250d20fa724cd80b16d548b6d2d354c603ecdd0 Author: Thilo Graf Date: 2016-03-22 (Tue, 22 Mar 2016) --- src/gui/components/cc_draw.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 309fd2419..0dd74c5be 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -596,15 +596,29 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.gradient_data = getGradientData(); } - // if found empty gradient buffer, create it, otherwise paint from cache - if (cc_gradient_bg_cleanup) - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + // if found empty gradient buffer, create it, otherwise paint from gradient cache if (fbdata.gradient_data->boxBuf == NULL){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); - fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); - if (cc_paint_cache) + 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); + + // 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, 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{ + //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); From 1538428615b62f7e431e31e7f918b4f89fc53110 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Mar 2016 10:04:16 +0100 Subject: [PATCH 293/690] CEpgData: hold header instance to prevent flickering on page scroll Header class is not required here, square-object is adequate, therefore usage of title text object is justified and can be used on stack, heap is not required in this case. Note: Header class provides a title parameter and could do this at once. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/14da9e510b11b48d38941bc9fd481213450a162a Author: Thilo Graf Date: 2016-03-22 (Tue, 22 Mar 2016) --- src/gui/epgview.cpp | 34 ++++++++++++++++++++-------------- src/gui/epgview.h | 3 ++- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ab674d61f..d5c32834e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -121,6 +121,13 @@ CEpgData::CEpgData() bigFonts = false; frameBuffer = CFrameBuffer::getInstance(); tmdbtoggle = false; + header = NULL; +} + +CEpgData::~CEpgData() +{ + delete header; + header = NULL; } void CEpgData::start() @@ -491,10 +498,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start tmdbtoggle = false; stars = 0; - CComponentsHeader* header = NULL; - CComponentsPicture* headerPic = NULL; - CComponentsText* headerText = NULL; - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); t_channel_id epg_id = channel_id; @@ -675,17 +678,25 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start //show the epg // header + logo int header_h = std::max(toph, logo_h); - header = new CComponentsHeader(sx, sy, ox, header_h); + if (!header){ + header = new CComponentsShapeSquare(sx, sy, ox, header_h); + header->setCorner(RADIUS_LARGE, CORNER_TOP); + } + header->setColorBody(COL_MENUHEAD_PLUS_0); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->setHeight(header_h); + + CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos if (pic_offx > 0) { headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); - headerText->doPaintBg(false); - headerText->setTextColor(COL_MENUHEAD_TEXT); + CComponentsText headerText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + headerText.doPaintBg(false); + headerText.setTextColor(COL_MENUHEAD_TEXT); header->paint(CC_SAVE_SCREEN_NO); - headerText->paint(CC_SAVE_SCREEN_NO); + headerText.paint(CC_SAVE_SCREEN_NO); if (headerPic) headerPic->paint(CC_SAVE_SCREEN_NO); @@ -1057,11 +1068,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } if (headerPic) delete headerPic; - if (headerText) - delete headerText; - if (header) - delete header; - return res; } diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 316126def..4375eebc5 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -56,7 +56,7 @@ class CEpgData CChannelEventList evtlist; CChannelEventList followlist; CEPGData epgData; - + CComponentsShapeSquare* header; std::string epg_date; std::string epg_start; std::string epg_end; @@ -96,6 +96,7 @@ class CEpgData public: CEpgData(); + ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); void hide(); From 363d521343da1cc0e07e22e924f51963dd19153a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Mar 2016 10:27:56 +0100 Subject: [PATCH 294/690] CEventList: hold header instance to reduce flicker effects Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/65f4b82f62248b2e1f10749f62b027acad5d1c20 Author: Thilo Graf Date: 2016-03-22 (Tue, 22 Mar 2016) --- src/gui/eventlist.cpp | 24 +++++++++++++++--------- src/gui/eventlist.h | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index df70f65ed..bf1559639 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -116,10 +116,13 @@ CEventList::CEventList() oldIndex = -1; oldEventID = -1; bgRightBoxPaint = false; + header = NULL; } CEventList::~CEventList() { + delete header; + header = NULL; } void CEventList::UpdateTimerList(void) @@ -857,16 +860,19 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE; int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; - CComponentsFrmChain header(x, y, full_width, theight); - header.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header.setCorner(RADIUS_LARGE, CORNER_TOP); + if (!header){ + header = new CComponentsFrmChain(x, y, full_width, theight); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->setCorner(RADIUS_LARGE, CORNER_TOP); + } + header->clear(); int x_off = 10; int mid_width = full_width * 40 / 100; // 40% int side_width = ((full_width - mid_width) / 2) - (2 * x_off); //create an logo object - CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, &header); + CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header); if (midLogo->hasLogo()) { //if logo object has found a logo and was ititialized, the hand it's size int w_logo = midLogo->getWidth(); @@ -885,24 +891,24 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s side_width = ((full_width - w_logo) / 2) - (4 * x_off); } else { - header.removeCCItem(midLogo); //remove/destroy logo object, if it is not available - CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available + CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); midText->doPaintBg(false); } if (!_channelname_prev.empty()) { - CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); lText->doPaintBg(false); } if (!_channelname_next.empty()) { int name_w = std::min(g_Font[font_lr]->getRenderWidth(_channelname_next), side_width); int x_pos = full_width - name_w - x_off; - CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, name_w, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, name_w, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); rText->doPaintBg(false); } - header.paint(CC_SAVE_SCREEN_NO); + header->paint(CC_SAVE_SCREEN_NO); } void CEventList::paint(t_channel_id channel_id) diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index a5d9b9737..f98223fcd 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -109,7 +109,7 @@ class CEventList : public CListHelpers int sort_mode; event_id_t item_event_ID; CComponentsText *cc_infozone; - + CComponentsFrmChain *header; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); From 694fea40ad9b05ca9b138ad877874ccbb3c80f6e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Mar 2016 11:35:02 +0100 Subject: [PATCH 295/690] CDBoxInfoWidget: remove superfluous paint of header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d8e3ecfa1dca131baaf4df085af99b0252a8f22e Author: Thilo Graf Date: 2016-03-22 (Tue, 22 Mar 2016) --- src/gui/dboxinfo.cpp | 17 +++++++++++++---- src/gui/dboxinfo.h | 4 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 5de8a1250..19119bb24 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -39,7 +39,7 @@ #include #include -#include + #include #include @@ -74,7 +74,7 @@ CDBoxInfoWidget::CDBoxInfoWidget() height = 0; x = 0; y = 0; - + header = NULL; fontWidth = fm->getWidth(); sizeWidth = 6 * fm->getMaxDigitWidth() + fm->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); ;//9999.99 MiB @@ -83,6 +83,12 @@ CDBoxInfoWidget::CDBoxInfoWidget() nameWidth = fontWidth * 17; } +CDBoxInfoWidget::~CDBoxInfoWidget() +{ + delete header; + header = NULL; +} + int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) { if (parent) @@ -166,6 +172,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) void CDBoxInfoWidget::hide() { + header->kill(); frameBuffer->paintBackgroundBoxRel(x,y, width,height); frameBuffer->blit(); } @@ -360,8 +367,10 @@ void CDBoxInfoWidget::paint() width = max(width, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(title, true) + 50); x = getScreenStartX(width); - CComponentsHeader header(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL); - header.paint(CC_SAVE_SCREEN_NO); + if (!header) + header = new CComponentsHeader(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL); + if (!header->isPainted()) + header->paint(CC_SAVE_SCREEN_NO); //paint body frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/gui/dboxinfo.h b/src/gui/dboxinfo.h index 6a2260094..a78878570 100644 --- a/src/gui/dboxinfo.h +++ b/src/gui/dboxinfo.h @@ -36,6 +36,7 @@ #include #include #include +#include #include class CDBoxInfoWidget : public CMenuTarget @@ -54,12 +55,13 @@ class CDBoxInfoWidget : public CMenuTarget int nameWidth; void paint(); - + CComponentsHeader *header; Font *fm, *ft; public: CDBoxInfoWidget(); + ~CDBoxInfoWidget(); void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); From cc1b2ddfd9f91323b2df4e78cd0c094b2b6fcbe3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 22 Mar 2016 22:04:51 +0100 Subject: [PATCH 296/690] movieinfo/moviebrowser: add (better) rating feature Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87dcc80502ba740493f0ce606854d2fb9d5fa67b Author: vanhofen Date: 2016-03-22 (Tue, 22 Mar 2016) Origin message was: ------------------ - movieinfo/moviebrowser: add (better) rating feature --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/moviebrowser.cpp | 56 ++++++++++++++++++++++++++++++-------- src/gui/moviebrowser.h | 3 +- src/gui/movieinfo.cpp | 14 ++++++++++ src/gui/movieinfo.h | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 8 files changed, 71 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cf1ad78ed..af0342b3b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1692,6 +1692,7 @@ moviebrowser.info_prevplaydate Letzte Wiedergabe moviebrowser.info_prodcountry Land moviebrowser.info_prodyear Jahr moviebrowser.info_quality Qualität +moviebrowser.info_rating Bewertung moviebrowser.info_recorddate Aufnahmedatum moviebrowser.info_serie Serie moviebrowser.info_size Dateigröße (MB) @@ -1741,6 +1742,7 @@ moviebrowser.short_path Pfad moviebrowser.short_prevplaydate Zuletzt moviebrowser.short_prodyear Jahr moviebrowser.short_quality Qualität +moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie moviebrowser.short_size Größe diff --git a/data/locale/english.locale b/data/locale/english.locale index e60cf5a4c..9190af6d6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1692,6 +1692,7 @@ moviebrowser.info_prevplaydate Last play date moviebrowser.info_prodcountry Country moviebrowser.info_prodyear Year moviebrowser.info_quality Quality +moviebrowser.info_rating Rating moviebrowser.info_recorddate Record date moviebrowser.info_serie Serie moviebrowser.info_size File size (MB) @@ -1741,6 +1742,7 @@ moviebrowser.short_path Path moviebrowser.short_prevplaydate Last moviebrowser.short_prodyear Year moviebrowser.short_quality * (quality) +moviebrowser.short_rating Vote moviebrowser.short_recorddate Date moviebrowser.short_serie Serie moviebrowser.short_size MB diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 8218eea66..7534dbc94 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -86,7 +86,7 @@ typedef struct dirent64 dirent_struct; #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list #define MOVIE_SMSKEY_TIMEOUT 800 -#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 20 +#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 21 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = { { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME }, @@ -108,7 +108,8 @@ const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ { MB_INFO_GEOMETRIE, LOCALE_MOVIEBROWSER_INFO_VIDEOFORMAT }, { MB_INFO_AUDIO, LOCALE_MOVIEBROWSER_INFO_AUDIO }, { MB_INFO_LENGTH, LOCALE_MOVIEBROWSER_INFO_LENGTH }, - { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE } + { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE }, + { MB_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RATING } }; #define MESSAGEBOX_YES_NO_OPTIONS_COUNT 2 @@ -167,6 +168,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = LOCALE_MOVIEBROWSER_SHORT_AUDIO, LOCALE_MOVIEBROWSER_SHORT_LENGTH, LOCALE_MOVIEBROWSER_SHORT_SIZE, + LOCALE_MOVIEBROWSER_SHORT_RATING, NONEXISTANT_LOCALE }; @@ -191,6 +193,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_AUDIO 8 #define MB_ROW_WIDTH_LENGTH 10 #define MB_ROW_WIDTH_SIZE 12 +#define MB_ROW_WIDTH_RATING 5 const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = { @@ -214,6 +217,7 @@ const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = MB_ROW_WIDTH_AUDIO, MB_ROW_WIDTH_LENGTH, MB_ROW_WIDTH_SIZE, + MB_ROW_WIDTH_RATING, 0 //MB_ROW_WIDTH_MAX_NUMBER }; static MI_MOVIE_INFO* playing_info; @@ -283,6 +287,13 @@ bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) else return a->parentalLockAge < b->parentalLockAge; } +bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->rating > b->rating; + else + return a->rating < b->rating; +} bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) { if (sortDirection) @@ -328,7 +339,8 @@ bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOV NULL, //MB_INFO_AUDIO = 17, NULL, //MB_INFO_LENGTH = 18, &sortBySize, //MB_INFO_SIZE = 19, - NULL //MB_INFO_MAX_NUMBER = 20 + &sortByRating, //MB_INFO_RATING = 20, + NULL //MB_INFO_MAX_NUMBER = 21 }; CMovieBrowser::CMovieBrowser(): configfile ('\t') @@ -849,6 +861,10 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) movieInfoUpdateAll[MB_INFO_MAJOR_GENRE]) (*current_list)[i]->genreMajor = m_movieSelectionHandler->genreMajor; + if (!((*current_list)[i]->rating!=0 && movieInfoUpdateAllIfDestEmptyOnly == true) && + movieInfoUpdateAll[MB_INFO_RATING]) + (*current_list)[i]->rating = m_movieSelectionHandler->rating; + if (!((*current_list)[i]->quality!=0 && movieInfoUpdateAllIfDestEmptyOnly == true) && movieInfoUpdateAll[MB_INFO_QUALITY]) (*current_list)[i]->quality = m_movieSelectionHandler->quality; @@ -2526,7 +2542,8 @@ bool CMovieBrowser::onSortMovieInfoHandleList(std::vector& handl { if (sort_item == MB_INFO_QUALITY || sort_item == MB_INFO_PARENTAL_LOCKAGE || sort_item == MB_INFO_PREVPLAYDATE || sort_item == MB_INFO_RECORDDATE || - sort_item == MB_INFO_PRODDATE || sort_item == MB_INFO_SIZE) + sort_item == MB_INFO_PRODDATE || sort_item == MB_INFO_SIZE || + sort_item == MB_INFO_RATING) sortDirection = 1; else sortDirection = 0; @@ -2944,6 +2961,11 @@ void CMovieBrowser::showHelp(void) help.exec(NULL,NULL); } +static std::string rateFormat(int i) +{ + return to_string(i/10) + "," + to_string(i%10); +} + #define MAX_STRING 30 int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) { @@ -3008,12 +3030,13 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_TITLE, &movieInfoUpdateAll[MB_INFO_TITLE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_1)); movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_INFO1, &movieInfoUpdateAll[MB_INFO_INFO1], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_2)); movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_SERIE, &movieInfoUpdateAll[MB_INFO_SERIE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_3)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_5)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_6)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_7)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_8)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_9)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movieInfoUpdateAll[MB_INFO_RATING], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_5)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_6)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_7)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_8)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_9)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_0)); /********************************************************************/ /** movieInfo ******************************************************/ @@ -3034,6 +3057,9 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int *)&movie_info->length, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int *)&movie_info->productionDate, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + CMenuOptionNumberChooser *rate = new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movie_info->rating, true, 0, 100, NULL); + rate->setNumberFormat(rateFormat); + CMenuWidget movieInfoMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); movieInfoMenu.addIntroItems(LOCALE_MOVIEBROWSER_INFO_HEAD); @@ -3046,6 +3072,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_INFO1, (movie_info->epgInfo1.size() <= MAX_STRING) /*true*/, movie_info->epgInfo1, &epgUserInput,NULL, CRCInput::RC_3)); movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movie_info->genreMajor, GENRE_ALL, GENRE_ALL_COUNT, true,NULL, CRCInput::RC_4, "", true)); movieInfoMenu.addItem(GenericMenuSeparatorLine); + movieInfoMenu.addItem(rate); movieInfoMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY,&movie_info->quality,true,0,3, NULL)); movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movie_info->parentalLockAge, MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS, MESSAGEBOX_PARENTAL_LOCKAGE_OPTION_COUNT, true,NULL, CRCInput::RC_6)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); @@ -3507,7 +3534,14 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite snprintf(str_tmp, sizeof(str_tmp),"%4" PRIu64 "",movie_info.file.Size>>20); *item_string = str_tmp; break; - case MB_INFO_MAX_NUMBER: // = 20 + case MB_INFO_RATING: // = 20, + if (movie_info.rating) + { + snprintf(str_tmp, sizeof(str_tmp),"%d,%d",movie_info.rating/10, movie_info.rating%10); + *item_string = str_tmp; + } + break; + case MB_INFO_MAX_NUMBER: // = 21 default: *item_string=""; result = false; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 94054e7f5..cf0bf36a0 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -114,7 +114,8 @@ typedef enum MB_INFO_AUDIO = 17, MB_INFO_LENGTH = 18, MB_INFO_SIZE = 19, - MB_INFO_MAX_NUMBER = 20 // MUST be allways the last item in the list + MB_INFO_RATING = 20, + MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list }MB_INFO_ITEM; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 451f6c72f..7b104ba5e 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -193,6 +193,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_LENGTH, movie_info->length); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_RATING, movie_info->rating); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_QUALITY, movie_info->quality); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay); @@ -364,6 +365,7 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) XML_GET_DATA_STRING(xam1, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); //if(!strcmp(xam1->GetType(), MI_XML_TAG_PRODUCT_COUNTRY)) if(xam1->GetData() != NULL)strncpy(movie_info->productionCountry, xam1->GetData(),4); XML_GET_DATA_INT(xam1, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); + XML_GET_DATA_INT(xam1, MI_XML_TAG_RATING, movie_info->rating); XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITIY, movie_info->quality); XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITY, movie_info->quality); XML_GET_DATA_INT(xam1, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); @@ -421,6 +423,15 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) print_buffer += movie_info.epgChannel; print_buffer += "\n"; } + if (movie_info.rating != 0) { + print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RATING); + print_buffer += ": "; + print_buffer += to_string(movie_info.rating / 10); + print_buffer += ","; + print_buffer += to_string(movie_info.rating % 10); + print_buffer += "/10"; + print_buffer += "\n"; + } if (movie_info.quality != 0) { print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); print_buffer += ": "; @@ -516,6 +527,7 @@ void CMovieInfo::printDebugMovieInfo(MI_MOVIE_INFO & movie_info) TRACE(" genreMajor: \t\t%d\r\n", movie_info.genreMajor); //genreMajor; TRACE(" genreMinor: \t\t%d\r\n", movie_info.genreMinor); //genreMinor; TRACE(" length: \t\t%d\r\n", movie_info.length); // (minutes) + TRACE(" rating: \t\t%d,%d\r\n", movie_info.rating / 10, movie_info.rating % 10); // user rating (like IMDb rating; 75 means 7.5/10) TRACE(" quality: \t\t%d\r\n", movie_info.quality); // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) TRACE(" productionCount:\t>%s<\r\n", movie_info.productionCountry.c_str()); TRACE(" productionDate: \t%d\r\n", movie_info.productionDate); // (Year) years since 1900 @@ -660,6 +672,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info GET_XML_DATA_STRING(text, pos, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_RATING, movie_info->rating) GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITIY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay) @@ -863,6 +876,7 @@ void MI_MOVIE_INFO::clear(void) genreMajor = 0; //genreMajor; genreMinor = 0; //genreMinor; length = 0; // (minutes) + rating = 0; // (like IMDb rating) quality = 0; // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) productionDate = 0; // (Year) years since 1900 parentalLockAge = 0; // MI_PARENTAL_LOCKAGE (0,6,12,16,18) diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index f6d271a69..c3dfc4040 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -89,6 +89,7 @@ #define MI_XML_TAG_LENGTH "length" #define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" #define MI_XML_TAG_PRODUCT_DATE "productiondate" +#define MI_XML_TAG_RATING "rating" #define MI_XML_TAG_QUALITY "quality" #define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files #define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage" @@ -160,6 +161,7 @@ class MI_MOVIE_INFO int genreMajor; // see showEPG class for more info, usually filled by EPG char genreMinor; // genreMinor not used so far int length; // movie length in minutes, usually filled by EPG + int rating; // user rating (like IMDb rating; 75 means 7.5/10) int quality; // user classification (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) int productionDate; // user defined Country (not from EPG yet, but might be possible) int parentalLockAge; // used for age rating(0:never,6,12,16,18 years,99:always), usually filled by EPG (if available) diff --git a/src/system/locals.h b/src/system/locals.h index bd76e37d4..1738cfc60 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1719,6 +1719,7 @@ typedef enum LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, LOCALE_MOVIEBROWSER_INFO_PRODYEAR, LOCALE_MOVIEBROWSER_INFO_QUALITY, + LOCALE_MOVIEBROWSER_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RECORDDATE, LOCALE_MOVIEBROWSER_INFO_SERIE, LOCALE_MOVIEBROWSER_INFO_SIZE, @@ -1768,6 +1769,7 @@ typedef enum LOCALE_MOVIEBROWSER_SHORT_PREVPLAYDATE, LOCALE_MOVIEBROWSER_SHORT_PRODYEAR, LOCALE_MOVIEBROWSER_SHORT_QUALITY, + LOCALE_MOVIEBROWSER_SHORT_RATING, LOCALE_MOVIEBROWSER_SHORT_RECORDDATE, LOCALE_MOVIEBROWSER_SHORT_SERIE, LOCALE_MOVIEBROWSER_SHORT_SIZE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 320b7b794..04979cfda 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1719,6 +1719,7 @@ const char * locale_real_names[] = "moviebrowser.info_prodcountry", "moviebrowser.info_prodyear", "moviebrowser.info_quality", + "moviebrowser.info_rating", "moviebrowser.info_recorddate", "moviebrowser.info_serie", "moviebrowser.info_size", @@ -1768,6 +1769,7 @@ const char * locale_real_names[] = "moviebrowser.short_prevplaydate", "moviebrowser.short_prodyear", "moviebrowser.short_quality", + "moviebrowser.short_rating", "moviebrowser.short_recorddate", "moviebrowser.short_serie", "moviebrowser.short_size", From 451d835aee0348e0508a2fd7743592b2ca15822e Mon Sep 17 00:00:00 2001 From: Marc Szymkowiak Date: Mon, 21 Mar 2016 19:16:17 +0100 Subject: [PATCH 297/690] add documentation for getdir control Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/046104962189e12afb24089634b62356089d4168 Author: Marc Szymkowiak Date: 2016-03-21 (Mon, 21 Mar 2016) --- src/nhttpd/doc/nhttpd_controlapi.html | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 5ddcc8e26..c4d946ce0 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -265,7 +265,12 @@ - + + + + + @@ -2213,6 +2218,34 @@ Beispiel:
519d0007008532da;Folx TV;7008532da
  + +
Neutrino-Ordner auflisten
+
Handler: http://box_ip/control/getdir
+
+Parameter: dir, subdirs, format +

+Dir kann folgende Werte erhalten:
+
  • moviedir - gibt alle Pfade der moviebrowser.conf zurück
  • +
  • recordingdir - gibt den Aufnahmeordner der neutrino.conf zurück
  • +
  • allmoviedirs - moviedir + recordingdir
  • +
    +subdirs gibt an ob die Unterordner mit ausgegeben werden sollen (true/false)
    +format gibt das Ausgabeformat an (xml,json) +

    +Rückgabe: dir [absoluter Pfad zum Ordner] +

    +
    +
    +Beispiel:
    +
    +>>>http://box_ip/control/getdir?dir=allmoviedirs&subdirs=true&format=json

    +{"success": "true", "data":{"dirs": [{"dir": "/mnt/series/", +} +,{"dir": "/mnt/movies/", +}] +}} + 
    +   

    From 2627010f062fb77bc7250fbf31b1c522900a0e5e Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 21 Mar 2016 20:16:33 +0100 Subject: [PATCH 298/690] fix json unicode output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5dadb260c159728bc74c0ea2b920b5067b93cd75 Author: TangoCash Date: 2016-03-21 (Mon, 21 Mar 2016) --- src/nhttpd/yhttpd_core/helper.cpp | 48 +++++++++++++++++++++++++++++++ src/nhttpd/yhttpd_core/helper.h | 2 ++ 2 files changed, 50 insertions(+) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index ee457860f..6361bd0c7 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -296,6 +296,53 @@ std::string json_out_error(std::string _error) { // JSON: convert string to JSON-String //----------------------------------------------------------------------------- +std::string json_convert_string(std::string value) +{ + std::string result; + for (size_t i = 0; i < value.length(); i++) + { + unsigned char c = unsigned(value[i]); + switch(c) + { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + default: + if ( isControlCharacter( c ) ) + { + std::ostringstream oss; + oss << "\\u" << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << static_cast(c); + result += oss.str(); + } + else + { + result += c; + } + break; + } + } + return result; +} + +#if 0 std::string json_convert_string(std::string s) { std::stringstream ss; for (size_t i = 0; i < s.length(); ) { @@ -350,6 +397,7 @@ std::string json_convert_string(std::string s) { } return ss.str(); } +#endif // 0 std::string yExecuteScript(std::string cmd) { std::string script, para, result; diff --git a/src/nhttpd/yhttpd_core/helper.h b/src/nhttpd/yhttpd_core/helper.h index 0984cf54c..d322c04ad 100644 --- a/src/nhttpd/yhttpd_core/helper.h +++ b/src/nhttpd/yhttpd_core/helper.h @@ -48,6 +48,8 @@ std::string json_out_pair(std::string _key, std::string _value); std::string json_out_success(std::string _result); std::string json_out_error(std::string _error); std::string json_convert_string(std::string s); +/// Returns true if ch is a control character (in range [0,32]). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F;} //----------------------------------------------------------------------------- // Script Helpers From d1ed63e4f65d06b482d6bb37315dc028ee919fa5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Mar 2016 09:23:36 +0100 Subject: [PATCH 299/690] CEpgData: fix header size on used magnify feature TODO: Make this feature recognizable for users Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/384b6aca117e79e43e9cf6c35679e7e1fbf9a335 Author: Thilo Graf Date: 2016-03-23 (Wed, 23 Mar 2016) --- src/gui/epgview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d5c32834e..3e5181b22 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -682,9 +682,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start header = new CComponentsShapeSquare(sx, sy, ox, header_h); header->setCorner(RADIUS_LARGE, CORNER_TOP); } + header->setDimensionsAll(sx, sy, ox, header_h); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setHeight(header_h); CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos if (pic_offx > 0) { From 38ede6dfb0f6730a092840a335e6e869e9113e5a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 23 Mar 2016 16:36:00 +0300 Subject: [PATCH 300/690] neutrino: add webtv channel list mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/302642cee779c5dfdb030e24ee19e26b09e3092e Author: [CST] Focus Date: 2016-03-23 (Wed, 23 Mar 2016) --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bouquetlist.cpp | 6 ++++ src/gui/buildinfo.cpp | 2 +- src/gui/channellist.cpp | 4 +-- src/gui/channellist.h | 1 + src/gui/dboxinfo.cpp | 2 +- src/gui/epgplus.cpp | 2 +- src/gui/epgview.cpp | 1 + src/gui/eventlist.cpp | 2 +- src/gui/imageinfo.cpp | 2 +- src/gui/infoviewer.cpp | 2 +- src/gui/lua/lua_hintbox.cpp | 2 +- src/gui/moviebrowser.cpp | 2 +- src/gui/movieplayer.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/screensetup.cpp | 1 + src/gui/streaminfo2.cpp | 2 +- src/gui/timerlist.cpp | 2 +- src/gui/widget/colorchooser.cpp | 1 + src/gui/widget/hintbox.cpp | 2 +- src/gui/widget/keyboard_input.cpp | 2 +- src/gui/widget/listbox.cpp | 2 +- src/gui/widget/menue.cpp | 1 + src/gui/widget/messagebox.cpp | 2 +- src/gui/widget/msgbox.cpp | 2 +- src/gui/widget/stringinput.cpp | 2 +- src/gui/widget/stringinput_ext.cpp | 2 +- src/neutrino.cpp | 36 +++++++++++++++++++++++- 29 files changed, 69 insertions(+), 24 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 3f829e2b8..8326163df 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -366,7 +366,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveBouquet(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 2286dbc17..88ae91ab2 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -447,7 +447,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveChannel(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index ae8dd7b3f..1bb805dd2 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -500,6 +500,12 @@ int CBouquetList::show(bool bShowChannelList) hide(); return CHANLIST_CHANGE_MODE; } + } else if(msg == CRCInput::RC_www) { + if(!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_WEBTV) { + CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_WEBTV); + hide(); + return CHANLIST_CHANGE_MODE; + } } else if ( msg == CRCInput::RC_setup) { if (!favonly && !Bouquets.empty()) { diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 3cc1ed0b9..ca8a31e6d 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -82,7 +82,7 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e8a11f3e7..02dfe231c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -697,7 +697,7 @@ int CChannelList::show() loop = false; } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { if (!edit_state) { int newmode = msg == CRCInput::RC_sat ? LIST_MODE_SAT : LIST_MODE_FAV; CNeutrinoApp::getInstance()->SetChannelMode(newmode); @@ -1303,7 +1303,7 @@ int CChannelList::numericZap(int key) doZap = true; break; } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_right) { + else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_www || msg == CRCInput::RC_right) { } else if (CRCInput::isNumeric(msg)) { if (pos == 4) { diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 21d2babda..5f159ed05 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -50,6 +50,7 @@ enum { LIST_MODE_FAV, LIST_MODE_PROV, + LIST_MODE_WEBTV, LIST_MODE_SAT, LIST_MODE_ALL, LIST_MODE_LAST diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 19119bb24..d9351a9c3 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -138,7 +138,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; doLoop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; doLoop = false; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bf91e3088..12e3e2f27 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1130,7 +1130,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 3e5181b22..e3e35faf8 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1034,6 +1034,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_favorites: case CRCInput::RC_sat: + case CRCInput::RC_www: if( !call_fromfollowlist){ g_RCInput->postMsg (msg, 0); loop = false; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index bf1559639..22246ca31 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -650,7 +650,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna in_search = findEvents(); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 596419934..82bb1e46c 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -151,7 +151,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->kill(); btn_red->paint(false); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6b57dae19..a4bf3253b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1025,7 +1025,7 @@ void CInfoViewer::loop(bool show_dot) if (msg == (neutrino_msg_t) g_settings.key_screenshot) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 900637777..14c7489b2 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -154,7 +154,7 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) D->b->scroll_up(); else D->b->scroll_down(); - } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if (msg == CRCInput::RC_mode) { res = messages_return::handled; break; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 7534dbc94..5d59f9015 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1102,7 +1102,7 @@ int CMovieBrowser::exec(const char* path) { loop = false; } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { //FIXME do nothing ? } else if (msg == NeutrinoMessages::STANDBY_ON || diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 8275c214f..336a4107a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1515,7 +1515,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { if (playstate == CMoviePlayerGui::PLAY && (position >= 300000 || (duration < 300000 && (position > (duration /2))))) makeScreenShot(true); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { //FIXME do nothing ? } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index fdb0873f1..40e5c3b28 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -633,7 +633,7 @@ int CPictureViewerGui::show() loop = false; g_RCInput->postMsg(msg, data); } - else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 447f1102e..1906518ee 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -211,6 +211,7 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_favorites: case CRCInput::RC_sat: + case CRCInput::RC_www: break; default: diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d42532a6d..0856435e0 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -238,7 +238,7 @@ int CStreamInfo2::doSignalStrengthLoop () res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index a0a5faac4..473d6ac4c 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -623,7 +623,7 @@ int CTimerList::show() } // help key } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index e2924c173..92634eece 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -232,6 +232,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) case CRCInput::RC_sat: case CRCInput::RC_favorites: + case CRCInput::RC_www: break; case CRCInput::RC_timeout: case CRCInput::RC_ok: diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index eb9900a58..9bc61d433 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -290,7 +290,7 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt else hintBox->scroll_down(); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if(msg == CRCInput::RC_mode) { res = messages_return::handled; diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index cc4eaf6f3..4d459fefe 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -610,7 +610,7 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) loop = false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 74f63bf65..0ddf8d791 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -223,7 +223,7 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { onBlueKeyPressed(); } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8a021fc9a..a15b51eab 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -967,6 +967,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) case (CRCInput::RC_sat): case (CRCInput::RC_favorites): + case (CRCInput::RC_www): g_RCInput->postMsg (msg, 0); //close any menue on dbox-key case (CRCInput::RC_setup): diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 0a5ef4356..835ff9e20 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -271,7 +271,7 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 13b417409..45cffebf6 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -719,7 +719,7 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) { loop = false; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 4020f6fea..e6354805e 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -494,7 +494,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) loop=false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 803cc4843..bf2a51972 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -257,7 +257,7 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) *cancel = true; } } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fa7d9f0c0..2cc5de6d2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -188,11 +188,13 @@ CBouquetList * TVbouquetList; CBouquetList * TVsatList; CBouquetList * TVfavList; CBouquetList * TVallList; +CBouquetList * TVwebList; CBouquetList * RADIObouquetList; CBouquetList * RADIOsatList; CBouquetList * RADIOfavList; CBouquetList * RADIOallList; +CBouquetList * RADIOwebList; CBouquetList * AllFavBouquetList; @@ -1411,11 +1413,16 @@ void CNeutrinoApp::channelsInit(bool bOnly) if(TVchannelList) delete TVchannelList; if(RADIOchannelList) delete RADIOchannelList; + if(TVwebList) delete TVwebList; + if(RADIOwebList) delete RADIOwebList; + TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); TVfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); + TVwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV)); + RADIOwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV)); RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); @@ -1556,6 +1563,8 @@ void CNeutrinoApp::channelsInit(bool bOnly) if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = TVfavList->addBouquet(b); + else if(b->bWebtv) + tmp = TVwebList->addBouquet(b); else tmp = TVbouquetList->addBouquet(b); @@ -1565,6 +1574,8 @@ void CNeutrinoApp::channelsInit(bool bOnly) if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = RADIOfavList->addBouquet(b); + else if(b->bWebtv) + tmp = RADIOwebList->addBouquet(b); else tmp = RADIObouquetList->addBouquet(b); @@ -1621,6 +1632,12 @@ void CNeutrinoApp::SetChannelMode(int newmode) else bouquetList = TVsatList; break; + case LIST_MODE_WEBTV: + if(mode == mode_radio) + bouquetList = RADIOwebList; + else + bouquetList = TVwebList; + break; case LIST_MODE_ALL: if(mode == mode_radio) bouquetList = RADIOallList; @@ -2597,6 +2614,11 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu) if (bouquetList->Bouquets.empty()) SetChannelMode(LIST_MODE_PROV); nNewChannel = bouquetList->exec(true); + } else if(msg == CRCInput::RC_www) { + SetChannelMode(LIST_MODE_WEBTV); + if (bouquetList->Bouquets.empty()) + SetChannelMode(LIST_MODE_PROV); + nNewChannel = bouquetList->exec(true); } _repeat: printf("CNeutrinoApp::showChannelList: nNewChannel %d\n", nNewChannel);fflush(stdout); @@ -2816,7 +2838,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; @@ -4628,6 +4650,12 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if (has_channel && first_mode_found < 0) first_mode_found = LIST_MODE_PROV; if(!has_channel && old_mode == LIST_MODE_PROV) + new_mode = LIST_MODE_WEBTV; + + has_channel = TVwebList->adjustToChannelID(channel_id); + if (has_channel && first_mode_found < 0) + first_mode_found = LIST_MODE_WEBTV; + if(!has_channel && old_mode == LIST_MODE_WEBTV) new_mode = LIST_MODE_SAT; has_channel = TVsatList->adjustToChannelID(channel_id); @@ -4649,6 +4677,12 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if (has_channel && first_mode_found < 0) first_mode_found = LIST_MODE_PROV; if(!has_channel && old_mode == LIST_MODE_PROV) + new_mode = LIST_MODE_WEBTV; + + has_channel = RADIOwebList->adjustToChannelID(channel_id); + if (has_channel && first_mode_found < 0) + first_mode_found = LIST_MODE_WEBTV; + if(!has_channel && old_mode == LIST_MODE_WEBTV) new_mode = LIST_MODE_SAT; has_channel = RADIOsatList->adjustToChannelID(channel_id); From 9403e63831d3b4de2c7ac256d8b119e3fc9a5e95 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 25 Mar 2016 19:04:32 +0300 Subject: [PATCH 301/690] libcoolstream2/playback_cs.h: update header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/427936c87440ef0cfca9065b19478dc9ddc3ee1c Author: [CST] Focus Date: 2016-03-25 (Fri, 25 Mar 2016) --- lib/libcoolstream2/playback_cs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libcoolstream2/playback_cs.h b/lib/libcoolstream2/playback_cs.h index 8480ed0aa..d0dfea272 100644 --- a/lib/libcoolstream2/playback_cs.h +++ b/lib/libcoolstream2/playback_cs.h @@ -55,6 +55,7 @@ public: bool Open(playmode_t PlayMode); void Close(void); bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0); + bool Start(std::string filename, std::string headers = ""); bool Stop(void); bool SetAPid(unsigned short pid, int audio_flag); bool SetSpeed(int speed); From c91dd805650ce06ca1510e2324982d8cf485d3fe Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Mar 2016 17:16:54 +0100 Subject: [PATCH 302/690] add headers ffmpeg option for luascript bg play; use in script 'entry['header'] = 'Cookie: var=name'; Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a61b8de6916a82f4597c87411cda86bf1530ed78 Author: Jacek Jendrzej Date: 2016-03-25 (Fri, 25 Mar 2016) --- src/driver/record.cpp | 6 ++++-- src/driver/streamts.cpp | 6 ++++-- src/gui/movieplayer.cpp | 31 +++++++++++++++++++++++++------ src/gui/movieplayer.h | 4 +++- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index a9be1ea70..04e3871b2 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2065,8 +2065,8 @@ bool CStreamRec::Open(CZapitChannel * channel) if (url.empty()) return false; - std::string pretty_name; - if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, recMovieInfo->epgInfo1, recMovieInfo->epgInfo2)) { + std::string pretty_name,headers; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, recMovieInfo->epgInfo1, recMovieInfo->epgInfo2,headers)) { printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); return false; } @@ -2078,6 +2078,8 @@ bool CStreamRec::Open(CZapitChannel * channel) printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); AVDictionary *options = NULL; + if (!headers.empty())//add cookies + av_dict_set(&options, "headers", headers.c_str(), 0); if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str()); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f729fe580..b1740bfd1 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -770,8 +770,8 @@ bool CStreamStream::Open() if (url.empty()) return false; - std::string pretty_name, livestreamInfo1, livestreamInfo2; - if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, livestreamInfo1, livestreamInfo2)) { + std::string pretty_name, livestreamInfo1, livestreamInfo2, headers; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, livestreamInfo1, livestreamInfo2,headers)) { printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); return false; } @@ -784,6 +784,8 @@ bool CStreamStream::Open() printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); AVDictionary *options = NULL; + if (!headers.empty()) + av_dict_set(&options, "headers", headers.c_str(), 0); if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); return false; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 336a4107a..b33d2de7e 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -532,6 +532,7 @@ bool CMoviePlayerGui::SelectFile() info_2 = ""; pretty_name.clear(); file_name.clear(); + cookie_header.clear(); //reinit Path_local for webif reloadsetup if (g_settings.network_nfs_moviedir.empty()) Path_local = "/"; @@ -735,7 +736,7 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi bool haveurl = false; if ( !root.isObject() ) { for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { - info.url=""; info.name=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + info.url=""; info.name=""; info.header=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; tmp = "0"; Json::Value object_it = *it; for (Json::Value::iterator iti = object_it.begin(); iti != object_it.end(); iti++) { @@ -745,7 +746,11 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi haveurl = true; } else if (name=="name") { info.name = (*iti).asString(); - } else if (name=="band") { + } + else if (name=="header") { + info.header = (*iti).asString(); + } + else if (name=="band") { info.bandwidth = atoi((*iti).asString().c_str()); } else if (name=="res1") { tmp = (*iti).asString(); @@ -762,7 +767,7 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi } if (root.isObject()) { for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { - info.url=""; info.name=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + info.url=""; info.name=""; info.header=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; tmp = "0"; std::string name = it.name(); if (name=="url") { @@ -770,6 +775,8 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi haveurl = true; } else if (name=="name") { info.name = (*it).asString(); + } else if (name=="header") { + info.header = (*it).asString(); } else if (name=="band") { info.bandwidth = atoi((*it).asString().c_str()); } else if (name=="res1") { @@ -827,6 +834,7 @@ bool CMoviePlayerGui::selectLivestream(std::vector &streamLis if (_info->res1 == _res) { info->url = _info->url; info->name = _info->name; + info->header = _info->header; info->resolution = _info->resolution; info->res1 = _info->res1; info->bandwidth = _info->bandwidth; @@ -856,7 +864,7 @@ bool CMoviePlayerGui::selectLivestream(std::vector &streamLis return false; } -bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2) +bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2, std::string &header) { static t_channel_id oldChan = 0; static std::vector liveStreamList; @@ -898,6 +906,10 @@ bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url info1 = info.name; _pretty_name = info.name; } + if (!info.header.empty()) { + header = info.header; + } + #if 0 if (!info.resolution.empty()) info2 = info.resolution; @@ -952,7 +964,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st std::string realUrl = file; std::string _pretty_name = name; - if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2)) { + if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2, cookie_header)) { /* FIXME: lua->runScript calling channelRezap, which makes neutrino to loop at start, let playback start -> drop messages in ShowStartHint */ //return false; @@ -969,6 +981,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->isHTTP = true; instance_bg->file_name = realUrl; instance_bg->pretty_name = _pretty_name; + instance_bg->cookie_header = cookie_header; instance_bg->movie_info.epgTitle = name; instance_bg->movie_info.epgChannel = realUrl; @@ -1070,7 +1083,13 @@ bool CMoviePlayerGui::PlayFileStart(void) showStartingHint = true; pthread_create(&thrStartHint, NULL, CMoviePlayerGui::ShowStartHint, this); } - bool res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); + bool res = false; + if(cookie_header.empty()){ + res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); + }else{ + res = playback->Start((char *) file_name.c_str(), cookie_header);//url with cookies + } + if (thrStartHint) { showStartingHint = false; pthread_join(thrStartHint, NULL); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 5219d84c2..4585aca37 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -90,6 +90,7 @@ class CMoviePlayerGui : public CMenuTarget std::string url; std::string name; std::string resolution; + std::string header;//cookie int res1; int bandwidth; } livestream_info_struct_t; @@ -102,6 +103,7 @@ class CMoviePlayerGui : public CMenuTarget std::string file_name; std::string pretty_name; + std::string cookie_header; std::string info_1, info_2; std::string currentaudioname; bool playing; @@ -261,7 +263,7 @@ class CMoviePlayerGui : public CMenuTarget bool getBlockedFromPlugin() { return blockedFromPlugin; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; }; - bool getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2); + bool getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2, std::string &header); }; #endif From d90d5b3b530d3f42eea44b9ffef5b7580382cb13 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Mar 2016 20:20:48 +0100 Subject: [PATCH 303/690] add postfields and header curl option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/35898bb7fd745542d2600c67b0af44d5c96a4ad8 Author: Jacek Jendrzej Date: 2016-03-25 (Fri, 25 Mar 2016) --- src/gui/lua/lua_curl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/lua/lua_curl.cpp b/src/gui/lua/lua_curl.cpp index c6a3f77a7..389aad1f9 100644 --- a/src/gui/lua/lua_curl.cpp +++ b/src/gui/lua/lua_curl.cpp @@ -137,8 +137,10 @@ int CLuaInstCurl::CurlDownload(lua_State *L) o, outputfile string when empty then save to string as secund return value A, userAgent string empty + P, postfields string empty v, verbose bool false s, silent bool false + h, header bool false connectTimeout number 20 ipv4 bool false ipv6 bool false @@ -219,6 +221,9 @@ Example: std::string userAgent = ""; tableLookup(L, "A", userAgent) || tableLookup(L, "userAgent", userAgent); + std::string postfields = "";//specify data to POST to server + tableLookup(L, "P", postfields) || tableLookup(L, "postfields", postfields); + bool verbose = false; tableLookup(L, "v", verbose) || tableLookup(L, "verbose", verbose); @@ -226,6 +231,9 @@ Example: if (!verbose) tableLookup(L, "s", silent) || tableLookup(L, "silent", silent); + bool pass_header = false;//pass headers to the data stream + tableLookup(L, "header", pass_header); + lua_Integer connectTimeout = 20; tableLookup(L, "connectTimeout", connectTimeout); @@ -261,6 +269,9 @@ Example: if (!userAgent.empty()) curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, userAgent.c_str()); + if (!postfields.empty()) + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, postfields.c_str()); + if (ipv4 && ipv6) curl_easy_setopt(curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER); else if (ipv4) @@ -280,6 +291,7 @@ Example: curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, (long)maxRedirs); curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, (silent)?1L:0L); curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, (verbose)?1L:0L); + curl_easy_setopt(curl_handle, CURLOPT_HEADER, (pass_header)?1L:0L); progressData pgd; From 82ebe8bdd15ba4f5a0f9a2dfdad9f565e2034388 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 28 Mar 2016 13:29:57 +0300 Subject: [PATCH 304/690] libcoolstream2/playback_cs.h: update header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9bb3cdf3ec1f0f7197685e8643814230a31f06ea Author: [CST] Focus Date: 2016-03-28 (Mon, 28 Mar 2016) --- lib/libcoolstream/playback_cs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index 8be1ba391..c5eb51377 100644 --- a/lib/libcoolstream/playback_cs.h +++ b/lib/libcoolstream/playback_cs.h @@ -54,6 +54,7 @@ public: bool Open(playmode_t PlayMode); void Close(void); bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0); + bool Start(std::string filename, std::string headers = ""); bool Stop(void); bool SetAPid(unsigned short pid, int audio_flag); bool SetSpeed(int speed); From 4a426cd065802ee829e60818a27b8d726bcb4da1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 28 Mar 2016 15:26:18 +0300 Subject: [PATCH 305/690] gui/movieplayer.cpp clear cookie_header before call lua script Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a88da91269e63d06e79dd23e8aa435c21051d6fc Author: [CST] Focus Date: 2016-03-28 (Mon, 28 Mar 2016) --- src/gui/movieplayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b33d2de7e..5667ed958 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -964,6 +964,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st std::string realUrl = file; std::string _pretty_name = name; + cookie_header.clear(); if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2, cookie_header)) { /* FIXME: lua->runScript calling channelRezap, which makes neutrino to loop at start, let playback start -> drop messages in ShowStartHint */ From 5055f5f78da1456df4521651f9f82ccad6d15db4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 28 Mar 2016 15:03:29 +0200 Subject: [PATCH 306/690] rnd for random_shuffle Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3491f2c206c0b935a418b03846fd94480f96c1c Author: Jacek Jendrzej Date: 2016-03-28 (Mon, 28 Mar 2016) --- src/gui/audioplayer.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 6d8db5bbc..297f5605a 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -76,12 +76,11 @@ class RandomNumber public: RandomNumber() { - srand(time(0)); + std::srand(time(0)); } - int operator()(int n) - { - return (n * rand() / RAND_MAX); + int operator()(int n){ + return std::rand() / (1.0 + RAND_MAX) * n; } }; From 49f4381d68fc9494fed8bf550410cd9f28fb6fa5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 28 Mar 2016 17:05:53 +0200 Subject: [PATCH 307/690] src/gui/movieplayer.cpp fi possible segaults Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/179d955075b395c09be10c45050450dd19c6cfa2 Author: Jacek Jendrzej Date: 2016-03-28 (Mon, 28 Mar 2016) --- src/gui/movieplayer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5667ed958..749584f85 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -502,9 +502,11 @@ bool CMoviePlayerGui::prepareFile(CFile *file) if (isMovieBrowser) { if (filelist_it != filelist.end()) { unsigned idx = filelist_it - filelist.begin(); - p_movie_info = milist[idx]; - startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; - printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + if(milist.size() > idx){ + p_movie_info = milist[idx]; + startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; + printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + } } if (isYT) { file_name = file->Url; @@ -1643,7 +1645,8 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) if (vzap_it <= filelist.end()) { unsigned idx = vzap_it - filelist.begin(); //printf("CMoviePlayerGui::%s: idx: %d\n", __func__, idx); - mi = milist[idx]; + if(milist.size() > idx) + mi = milist[idx]; } } g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, From ff43e80f8ea18472fa0850acb027f2259b4baf1c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 1 Apr 2016 16:10:01 +0300 Subject: [PATCH 308/690] gui/movieplayer.cpp: add non-blocking webtv zap, for testing Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5a64d515911d068d832b1db6e057bbdc361753e Author: [CST] Focus Date: 2016-04-01 (Fri, 01 Apr 2016) --- src/gui/movieplayer.cpp | 91 ++++++++++++++++++++++++++++------------- src/gui/movieplayer.h | 2 + 2 files changed, 65 insertions(+), 28 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 749584f85..0781aba21 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -74,6 +74,7 @@ #include #include #include +#include extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ @@ -90,12 +91,13 @@ OpenThreads::Mutex CMoviePlayerGui::bgmutex; OpenThreads::Condition CMoviePlayerGui::cond; pthread_t CMoviePlayerGui::bgThread; cPlayback *CMoviePlayerGui::playback; +bool CMoviePlayerGui::webtv_started; CMovieBrowser* CMoviePlayerGui::moviebrowser; CBookmarkManager * CMoviePlayerGui::bookmarkmanager; CMoviePlayerGui& CMoviePlayerGui::getInstance(bool background) { - OpenThreads::ScopedLock m_lock(bgmutex); + OpenThreads::ScopedLock m_lock(mutex); if (!instance_mp ) { instance_mp = new CMoviePlayerGui(); @@ -656,13 +658,52 @@ void *CMoviePlayerGui::ShowStartHint(void *arg) return NULL; } +bool CMoviePlayerGui::StartWebtv(void) +{ + printf("%s: starting...\n", __func__);fflush(stdout); + last_read = position = duration = 0; + + cutNeutrino(); + clearSubtitle(); + + playback->Open(is_file_player ? PLAYMODE_FILE : PLAYMODE_TS); + + bool res = playback->Start((char *) file_name.c_str(), cookie_header);//url with cookies + + playback->SetSpeed(1); + if (!res) { + playback->Close(); + } else { + getCurrentAudioName(is_file_player, currentaudioname); + if (is_file_player) + selectAutoLang(); + } + + return res; +} + void* CMoviePlayerGui::bgPlayThread(void *arg) { set_threadname(__func__); CMoviePlayerGui *mp = (CMoviePlayerGui *) arg; + printf("%s: starting... instance %p\n", __func__, mp);fflush(stdout); int eof = 0, pos = 0; - while(true) { + unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; + *(t_channel_id*)chid = mp->movie_info.epgId; + + bool started = mp->StartWebtv(); + printf("%s: started: %d\n", __func__, started);fflush(stdout); + + mutex.lock(); + if (!webtv_started) + started = false; + else if (!started) + g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, (neutrino_msg_data_t) chid); + webtv_started = started; + mutex.unlock(); + + while(webtv_started) { if (mp->playback->GetPosition(mp->position, mp->duration)) { #if 0 printf("CMoviePlayerGui::bgPlayThread: position %d duration %d (%d)\n", mp->position, mp->duration, mp->duration-mp->position); @@ -673,8 +714,6 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) eof = 0; if (eof > 5) { printf("CMoviePlayerGui::bgPlayThread: playback stopped, try to rezap...\n"); - unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; - *(t_channel_id*)chid = mp->movie_info.epgId; g_RCInput->postMsg(NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE, (neutrino_msg_data_t) chid); break; } @@ -687,7 +726,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) break; mp->showSubtitle(0); } - printf("%s: play end...\n", __func__); + printf("%s: play end...\n", __func__);fflush(stdout); mp->PlayFileEnd(); pthread_exit(NULL); } @@ -934,7 +973,7 @@ bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script) { - printf("%s: starting...\n", __func__); + printf("%s: starting...\n", __func__);fflush(stdout); static CZapProtection *zp = NULL; if (zp) return true; @@ -964,17 +1003,13 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st } } - std::string realUrl = file; + std::string realUrl; std::string _pretty_name = name; cookie_header.clear(); if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2, cookie_header)) { - /* FIXME: lua->runScript calling channelRezap, which makes neutrino to loop at start, - let playback start -> drop messages in ShowStartHint */ - //return false; + return false; } - OpenThreads::ScopedLock m_lock(mutex); - instance_bg->Cleanup(); instance_bg->ClearFlags(); instance_bg->ClearQueue(); @@ -991,14 +1026,16 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; - bool res = instance_bg->PlayFileStart(); - if (res) { - if (pthread_create (&bgThread, 0, CMoviePlayerGui::bgPlayThread, instance_bg)) - fprintf(stderr, "ERROR: pthread_create(%s)\n", __func__); - } else - instance_bg->PlayFileEnd(); - printf("%s: this %p started: res %d thread %lx\n", __func__, this, res, bgThread);fflush(stdout); - return res; + stopPlayBack(); + webtv_started = true; + if (pthread_create (&bgThread, 0, CMoviePlayerGui::bgPlayThread, instance_bg)) { + printf("ERROR: pthread_create(%s)\n", __func__); + webtv_started = false; + return false; + } + + printf("%s: this %p started, thread %lx\n", __func__, this, bgThread);fflush(stdout); + return true; } void CMoviePlayerGui::stopPlayBack(void) @@ -1009,6 +1046,10 @@ void CMoviePlayerGui::stopPlayBack(void) repeat_mode = REPEAT_OFF; if (bgThread) { printf("%s: this %p join background thread %lx\n", __func__, this, bgThread);fflush(stdout); + mutex.lock(); + webtv_started = false; + playback->RequestAbort(); + mutex.unlock(); cond.broadcast(); pthread_join(bgThread, NULL); bgThread = 0; @@ -1033,9 +1074,7 @@ void CMoviePlayerGui::Pause(bool b) void CMoviePlayerGui::PlayFile(void) { - mutex.lock(); PlayFileStart(); - mutex.unlock(); PlayFileLoop(); bool repeat = (repeat_mode == REPEAT_OFF); if (isLuaPlay) @@ -1063,6 +1102,7 @@ bool CMoviePlayerGui::PlayFileStart(void) cutNeutrino(); if (isWebTV) videoDecoder->setBlank(true); + clearSubtitle(); printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); @@ -1086,12 +1126,7 @@ bool CMoviePlayerGui::PlayFileStart(void) showStartingHint = true; pthread_create(&thrStartHint, NULL, CMoviePlayerGui::ShowStartHint, this); } - bool res = false; - if(cookie_header.empty()){ - res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); - }else{ - res = playback->Start((char *) file_name.c_str(), cookie_header);//url with cookies - } + bool res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); if (thrStartHint) { showStartingHint = false; diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 4585aca37..c2101cdf7 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -183,6 +183,7 @@ class CMoviePlayerGui : public CMenuTarget static OpenThreads::Mutex bgmutex; static OpenThreads::Condition cond; static pthread_t bgThread; + static bool webtv_started; static cPlayback *playback; static CMoviePlayerGui* instance_mp; @@ -194,6 +195,7 @@ class CMoviePlayerGui : public CMenuTarget void PlayFileLoop(); void PlayFileEnd(bool restore = true); void cutNeutrino(); + bool StartWebtv(); void quickZap(neutrino_msg_t msg); void showHelpTS(void); From 9e5bc3ec154169abb24f77446294bf85068f4ab8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 3 Apr 2016 11:05:21 +0200 Subject: [PATCH 309/690] supplement to 73dc76ef70dd4a01a629405633bbc5f75898d173 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/270a60687cda8907979bce3532744784ce3416a8 Author: Jacek Jendrzej Date: 2016-04-03 (Sun, 03 Apr 2016) --- src/gui/lua/lua_misc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 3514f19c8..c732c7d6d 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -315,7 +316,8 @@ int CLuaInstMisc::checkVersion(lua_State *L) LUA_API_VERSION_MAJOR, LUA_API_VERSION_MINOR, g_Locale->getText(LOCALE_LUA_VERSIONSCHECK2), major, minor); - luaL_error(L, msg); + DisplayErrorMessage(msg, "Lua Script Error:"); + } lua_pushinteger(L, 1); /* for backward compatibility */ return 1; From fb0eacff9b571381d6a69c5914b754da39e63bc9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 4 Apr 2016 15:38:51 +0200 Subject: [PATCH 310/690] add av_dict_free, fix memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a830d0d58714a0fd59272cdcad8930182b1511ef Author: Jacek Jendrzej Date: 2016-04-04 (Mon, 04 Apr 2016) --- src/driver/record.cpp | 4 ++++ src/driver/streamts.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 04e3871b2..6a15e4775 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2083,8 +2083,12 @@ bool CStreamRec::Open(CZapitChannel * channel) if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str()); + if (!headers.empty()) + av_dict_free(&options); return false; } + if (!headers.empty()) + av_dict_free(&options); if (avformat_find_stream_info(ifcx, NULL) < 0) { printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index b1740bfd1..2ab401258 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -788,8 +788,12 @@ bool CStreamStream::Open() av_dict_set(&options, "headers", headers.c_str(), 0); if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); + if (!headers.empty()) + av_dict_free(&options); return false; } + if (!headers.empty()) + av_dict_free(&options); if (avformat_find_stream_info(ifcx, NULL) < 0) { printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); From 1da21f8936b9b59f963525c117b6ae7b9cbf4bb5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 5 Apr 2016 16:53:40 +0200 Subject: [PATCH 311/690] src/daemonc/remotecontrol.cpp: fix PARENTALLOCK in onsignal mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c700641c11b7f9985c5d2f8f1233252c3c73e7f Author: Jacek Jendrzej Date: 2016-04-05 (Tue, 05 Apr 2016) --- src/daemonc/remotecontrol.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index b8e64a95b..03e515d01 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -138,6 +138,16 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((!is_video_started) && (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); + + //check epg fsk in onsignal mode + if ((!is_video_started) && + (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL)){ + CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); + if(currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage){ + g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); + } + } } } else { if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED ) || From 19083cb2552431da837df6c613c3ec5c270d8e06 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 5 Apr 2016 17:09:17 +0200 Subject: [PATCH 312/690] bouquetedit classes: use static button font instead auto font size User request Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fdf5239587ac0c25e49986018453a5b6eb00b404 Author: Thilo Graf Date: 2016-04-05 (Tue, 05 Apr 2016) --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 8326163df..1853719f3 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -147,7 +147,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-20); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 88ae91ab2..5a62215da 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -190,7 +190,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 2888bab7a..4f3923de9 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -252,7 +252,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); } std::string CBEChannelSelectWidget::getInfoText(int index) From 9aaa68bf47c5123200d98c6ae823f3025041122e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 5 Apr 2016 17:17:47 +0200 Subject: [PATCH 313/690] supplement to 1da21f8936b9b59f963525c117b6ae7b9cbf4bb5 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f684fd50a0ea889ea6e14e664be24afbe0959f39 Author: Jacek Jendrzej Date: 2016-04-05 (Tue, 05 Apr 2016) --- src/daemonc/remotecontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 03e515d01..6d7980917 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -144,7 +144,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL)){ CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); - if(currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage){ + if(currentNextInfo.current_fsk && currentNextInfo.current_fsk > g_settings.parentallock_lockage){ g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); } } From 899886e57c3964b3391634ce18187a05e78fc72e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 5 Apr 2016 17:38:25 +0200 Subject: [PATCH 314/690] Revert "supplement to 1da21f8936b9b59f963525c117b6ae7b9cbf4bb5" This reverts commit 9aaa68bf47c5123200d98c6ae823f3025041122e. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee9addceb053a4d7373d41664078d74d8e37f02e Author: Jacek Jendrzej Date: 2016-04-05 (Tue, 05 Apr 2016) --- src/daemonc/remotecontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 6d7980917..03e515d01 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -144,7 +144,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL)){ CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); - if(currentNextInfo.current_fsk && currentNextInfo.current_fsk > g_settings.parentallock_lockage){ + if(currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage){ g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); } } From 2831d3c45bb3a17c3451ab1db1100d6a2f96be0c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 5 Apr 2016 17:41:21 +0200 Subject: [PATCH 315/690] add Bluemoon-3.0.theme Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1cf1aee40b2537f2bd74035a7516ef215942d951 Author: Jacek Jendrzej Date: 2016-04-05 (Tue, 05 Apr 2016) --- data/themes/Bluemoon-3.0.theme | 67 ++++++++++++++++++++++++++++++++++ data/themes/Makefile.am | 1 + 2 files changed, 68 insertions(+) create mode 100644 data/themes/Bluemoon-3.0.theme diff --git a/data/themes/Bluemoon-3.0.theme b/data/themes/Bluemoon-3.0.theme new file mode 100644 index 000000000..1b18e72cf --- /dev/null +++ b/data/themes/Bluemoon-3.0.theme @@ -0,0 +1,67 @@ +clock_Digit_alpha=0 +clock_Digit_blue=80 +clock_Digit_green=80 +clock_Digit_red=80 +colored_events_alpha=0 +colored_events_blue=20 +colored_events_channellist=1 +colored_events_green=50 +colored_events_infobar=2 +colored_events_red=80 +infobar_Text_alpha=0 +infobar_Text_blue=80 +infobar_Text_green=80 +infobar_Text_red=80 +infobar_alpha=20 +infobar_blue=100 +infobar_casystem_alpha=20 +infobar_casystem_blue=20 +infobar_casystem_green=20 +infobar_casystem_red=20 +infobar_gradient_body=5 +infobar_gradient_body_direction=1 +infobar_gradient_bottom=1 +infobar_gradient_bottom_direction=1 +infobar_gradient_top=1 +infobar_gradient_top_direction=1 +infobar_green=60 +infobar_red=0 +menu_ButtonBar_gradient=0 +menu_ButtonBar_gradient_direction=1 +menu_Content_Selected_Text_alpha=0 +menu_Content_Selected_Text_blue=100 +menu_Content_Selected_Text_green=100 +menu_Content_Selected_Text_red=100 +menu_Content_Selected_alpha=20 +menu_Content_Selected_blue=80 +menu_Content_Selected_green=50 +menu_Content_Selected_red=20 +menu_Content_Text_alpha=0 +menu_Content_Text_blue=80 +menu_Content_Text_green=80 +menu_Content_Text_red=80 +menu_Content_alpha=20 +menu_Content_blue=20 +menu_Content_green=20 +menu_Content_inactive_Text_alpha=0 +menu_Content_inactive_Text_blue=20 +menu_Content_inactive_Text_green=50 +menu_Content_inactive_Text_red=80 +menu_Content_inactive_alpha=20 +menu_Content_inactive_blue=20 +menu_Content_inactive_green=20 +menu_Content_inactive_red=20 +menu_Content_red=20 +menu_Head_Text_alpha=0 +menu_Head_Text_blue=80 +menu_Head_Text_green=80 +menu_Head_Text_red=80 +menu_Head_alpha=20 +menu_Head_blue=100 +menu_Head_gradient=1 +menu_Head_gradient_direction=1 +menu_Head_green=60 +menu_Head_red=0 +menu_Hint_gradient=1 +menu_Hint_gradient_direction=1 +menu_Separator_gradient_enable=1 diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 4947e59a2..8914d5b0e 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -1,6 +1,7 @@ installdir = $(THEMESDIR) install_DATA = \ + Bluemoon-3.0.theme \ Classic.theme \ Crema.theme \ DVB2000.theme \ From 51ed6764cc4728b83256321a5953bd3ba669a9fa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 5 Apr 2016 20:53:21 +0200 Subject: [PATCH 316/690] CComponentsInfoBox: use framed infobox as default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3d3b724457ac5efeabd4b54317aea24e8737d30a Author: Thilo Graf Date: 2016-04-05 (Tue, 05 Apr 2016) --- src/gui/components/cc_item_infobox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 01a03fba3..00fafa24c 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -57,6 +57,7 @@ CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, height = h; shadow = shadow_mode; col_frame = color_frame; + cc_enable_frame = true; col_body = color_body; col_shadow = color_shadow; From 3d71c205049d0f78f4c88ba0f688d6dd7be5682d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 7 Apr 2016 17:29:10 +0200 Subject: [PATCH 317/690] CComponentsWindow: add member to set button font and use infobar font as default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74e08ddb503d1601828a3d10a280f2ec4af9afb6 Author: Thilo Graf Date: 2016-04-07 (Thu, 07 Apr 2016) --- src/gui/components/cc_frm_window.cpp | 4 +++- src/gui/components/cc_frm_window.h | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 01c3be3a6..f964a7f06 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012-2014 Thilo Graf 'dbt' + Copyright (C) 2012-2016 Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -144,6 +144,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_right_sidebar= NULL; ccw_body = NULL; ccw_footer = NULL; + ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; ccw_buttons = 0; //no header buttons ccw_show_footer = true; @@ -218,6 +219,7 @@ void CComponentsWindow::initFooter() ccw_footer->setWidth(width-2*fr_thickness); ccw_footer->enableShadow(shadow); ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); + ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); } } diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index da09fb342..b88187458 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.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-2016, Thilo Graf 'dbt' License: GPL @@ -89,6 +89,8 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t ccw_col_head_text; ///footer bg color fb_pixel_t ccw_col_footer; + ///footer button font + Font* ccw_button_font; ///initialze header object void initHeader(); @@ -190,6 +192,8 @@ class CComponentsWindow : public CComponentsForm ///set background to footer void setWindowFooterColor(const fb_pixel_t& color){ccw_col_footer = color;} + ///set font for footer buttons + void setWindowFooterFont(Font* font_type){ccw_button_font = font_type;} ///returns a pointer to the internal left side bar object, use this to get access to left sidebar properities CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; From 2ddd5a556c873d6e6fcaf6591fa7c2abbb078d37 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 8 Apr 2016 15:18:53 +0200 Subject: [PATCH 318/690] src/gui/movieplayer.cpp fix update duration on first call Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ccd63eac903656115cb8cba7e3762ee5b5c42c25 Author: Jacek Jendrzej Date: 2016-04-08 (Fri, 08 Apr 2016) --- src/gui/movieplayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0781aba21..e5e5d89c2 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1671,6 +1671,9 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) return; } + if(duration == 0) + UpdatePosition(); + if (isMovieBrowser && p_movie_info) { MI_MOVIE_INFO *mi; From 002c435e1521a33640856a895f97290816ee516a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Apr 2016 14:11:15 +0200 Subject: [PATCH 319/690] CInfoViewer: remove clock object interval allocation Already allocated with default value (1s) by constructor and also not required, because internal clock timer is not used here. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74caa1a94983a5fa90cae497ca919693dd5e2606 Author: Thilo Graf Date: 2016-04-10 (Sun, 10 Apr 2016) --- src/gui/infoviewer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index a4bf3253b..e5e1004df 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -249,7 +249,6 @@ void CInfoViewer::initClock() if (clock == NULL){ clock = new CComponentsFrmClock(); clock->setClockFormat("%H:%M", "%H %M"); - clock->setClockIntervall(1); } CInfoClock::getInstance()->disableInfoClock(); From 2062685a97d49d2279835486dc26567c02859f61 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 10 Apr 2016 19:42:39 +0200 Subject: [PATCH 320/690] src/driver/streamts.cpp check after new Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b526c2480caee3a1c893354cd9d50654bd18118f Author: Jacek Jendrzej Date: 2016-04-10 (Sun, 10 Apr 2016) --- src/driver/streamts.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 2ab401258..6609ead9b 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -169,6 +169,8 @@ bool CStreamInstance::Open() return false; dmx = new cDemux(tmpchan->getRecordDemux());//FIXME + if(!dmx) + return false; return dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); } From adb7c0e6701f9aa1e7f842f94991ef929455e9a2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 11 Apr 2016 12:48:09 +0200 Subject: [PATCH 321/690] src/driver/streamts.cpp try to fix send err loop Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed02b4c81eb003b4a671656888013fe86d80d866 Author: Jacek Jendrzej Date: 2016-04-11 (Mon, 11 Apr 2016) --- src/driver/streamts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 6609ead9b..74379e4be 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -596,7 +596,7 @@ void CStreamManager::run() printf("CStreamManager::run(): POLLHUP, fd %d\n", pfd[i].fd); RemoveClient(pfd[i].fd); if (streams.empty()) { - poll_timeout = -1; + poll_timeout = 2000; g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_STOP, 0); } } From fbc7d1f66e9027a56c324c4a71fc5f109f6ef13f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 14 Apr 2016 17:28:32 +0300 Subject: [PATCH 322/690] lib/libcoolstream2/cs_api.h: update header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/16cbac13fe20c7d5f1cdd47afc25813ce44fd5d0 Author: [CST] Focus Date: 2016-04-14 (Thu, 14 Apr 2016) --- lib/libcoolstream2/cs_api.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h index 6cb6b01a5..fe1b463da 100644 --- a/lib/libcoolstream2/cs_api.h +++ b/lib/libcoolstream2/cs_api.h @@ -17,6 +17,16 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); +#define CS_REVISION_CHIP_TYPE(a) (((a) >> 16) & 0xFFF0) +#define CS_REVISION_HW_VERSION_MAJOR(a) (((a) >> 8) & 0x00FF) +#define CS_REVISION_HW_HAS_CI(a) (!(CS_REVISION_HW_VERSION_MAJOR(a) & 0xC0)) +#define CS_REVISION_HW_VERSION_MINOR(a) (((a) >> 0) & 0x00FF) +#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 + enum CS_LOG_MODULE { CS_LOG_CI = 0, CS_LOG_HDMI_CEC, @@ -63,6 +73,8 @@ unsigned int cs_get_ts_output(void); int cs_set_ts_output(unsigned int port); int cs_set_ts_ci_clock(unsigned int speed); int cs_get_ts_ci_clock(unsigned int *speed); +int cs_set_ts_ci_clk_src(unsigned int clk_src); +int cs_get_ts_ci_clk_src(unsigned int *clk_src); int cs_set_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_get_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_set_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); @@ -71,6 +83,8 @@ 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); +unsigned int cs_get_chip_type(void); +bool cs_box_has_ci(void); unsigned int cs_get_chip_id(void); unsigned int cs_get_chip_rev_id(void); From d2767791a24420c3a187ae4cffd31413fd5a45c5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 15 Apr 2016 08:53:22 +0200 Subject: [PATCH 323/690] CUpnpBrowserGui: use static button font instead auto font size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9a40ff3d64ede8a3cebf5db536d241a62409c02 Author: Thilo Graf Date: 2016-04-15 (Fri, 15 Apr 2016) --- src/gui/upnpbrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 9d5643d72..43fc71852 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -973,7 +973,7 @@ void CUpnpBrowserGui::paintDevices() // Foot top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); paintItem2DetailsLine (-1); // clear it } @@ -1149,7 +1149,7 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, // Foot buttons top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); } void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) From c20774f8d4a0406b55dca39e08c8c0f7e65805bf Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 15 Apr 2016 20:58:04 +0200 Subject: [PATCH 324/690] src/gui/components/cc_item_progressbar.cpp fix possible memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e38d90b239e7b0b13f2d19602ed66710786de74 Author: Jacek Jendrzej Date: 2016-04-15 (Fri, 15 Apr 2016) --- src/gui/components/cc_item_progressbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index 5bf56adff..1221f31dc 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -197,6 +197,7 @@ void CProgressBarCache::pbcClear() free((*it)->pbc_active); if ((*it)->pbc_passive) free((*it)->pbc_passive); + delete (*it); } pbCache.clear(); } From 11c66eea2c9d04678b95f3fde246adaadae6577d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 16 Apr 2016 17:50:52 +0200 Subject: [PATCH 325/690] src/gui/movieplayer.cpp delete chid if not used Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7daf49644d5dda089de9efaaf2d8ead47b000631 Author: Jacek Jendrzej Date: 2016-04-16 (Sat, 16 Apr 2016) --- src/gui/movieplayer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e5e5d89c2..c34af0661 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -694,12 +694,15 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) bool started = mp->StartWebtv(); printf("%s: started: %d\n", __func__, started);fflush(stdout); + bool chidused = false; mutex.lock(); if (!webtv_started) started = false; - else if (!started) + else if (!started){ g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, (neutrino_msg_data_t) chid); + chidused = true; + } webtv_started = started; mutex.unlock(); @@ -715,6 +718,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) if (eof > 5) { printf("CMoviePlayerGui::bgPlayThread: playback stopped, try to rezap...\n"); g_RCInput->postMsg(NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE, (neutrino_msg_data_t) chid); + chidused = true; break; } pos = mp->position; @@ -728,6 +732,9 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) } printf("%s: play end...\n", __func__);fflush(stdout); mp->PlayFileEnd(); + if(!chidused) + delete [] chid; + pthread_exit(NULL); } From e540c57ac0289998c7d4e20a1ff292557930ef62 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 16 Apr 2016 18:07:16 +0200 Subject: [PATCH 326/690] lib/libdvbsub/tools.h unused Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c804997045ed4eb1900225be928fbd9c1021c26b Author: Jacek Jendrzej Date: 2016-04-16 (Sat, 16 Apr 2016) --- lib/libdvbsub/tools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libdvbsub/tools.h b/lib/libdvbsub/tools.h index ed3a2dea3..3786d52aa 100644 --- a/lib/libdvbsub/tools.h +++ b/lib/libdvbsub/tools.h @@ -120,8 +120,8 @@ private: mutable int allocated; mutable int size; mutable T *data; - cVector(const cVector &Vector) {} // don't copy... - cVector &operator=(const cVector &Vector) { return *this; } // ...or assign this! +// cVector(const cVector &Vector) {} // don't copy... +// cVector &operator=(const cVector &Vector) { return *this; } // ...or assign this! void Realloc(int Index) const { if (++Index > allocated) { From a53c0ee6bf3a9791e1c06535a93f6135df442278 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 16 Apr 2016 20:37:50 +0200 Subject: [PATCH 327/690] src/gui/components/cc_signals.h fix typo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c521e67b109ba4cb394ecfbd8d0dcdd64c42210f Author: Jacek Jendrzej Date: 2016-04-16 (Sat, 16 Apr 2016) --- src/gui/components/cc_signals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index 4a8cf0bb2..feee1ef67 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -85,7 +85,7 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor! */ #ifndef __CC_SIGNALS_H__ -#define __CC_SIGNALS_H____ +#define __CC_SIGNALS_H__ #include #include From 2f5086ec0e3ba66f9a51642ec2d41450ad7d2644 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 13:46:16 +0200 Subject: [PATCH 328/690] remove unused and some clang compil fixes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/374a172aefbcc298ab4a4c11edb5d96e3c83295c Author: Jacek Jendrzej Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/driver/fontrenderer.h | 2 +- src/eitd/edvbstring.cpp | 2 +- src/gui/adzap.h | 1 - src/gui/bouquetlist.h | 1 - src/gui/channellist.h | 1 - src/gui/epgplus.cpp | 26 +++++++++++++------------- src/gui/eventlist.h | 7 ++----- src/gui/keybind_setup.cpp | 4 ++-- src/gui/keybind_setup.h | 1 - src/gui/miscsettings_menu.cpp | 3 ++- src/gui/miscsettings_menu.h | 1 - src/gui/motorcontrol.h | 1 - src/gui/opkg_manager.h | 1 - src/gui/osd_setup.cpp | 14 ++++++++------ src/gui/record_setup.cpp | 3 +-- src/gui/update_settings.h | 1 - src/gui/videosettings.h | 1 - src/gui/volumebar.h | 4 ++-- src/gui/widget/stringinput.h | 1 - src/system/ytcache.cpp | 3 ++- src/timerd/timermanager.cpp | 2 +- 21 files changed, 35 insertions(+), 45 deletions(-) diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index e34b81366..c061a7934 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -100,7 +100,7 @@ class FBFontRenderClass FT_Library library; FTC_Manager cacheManager; /* the cache manager */ - FTC_ImageCache imageCache; /* the glyph image cache */ +// FTC_ImageCache imageCache; /* the glyph image cache */ FTC_SBitCache sbitsCache; /* the glyph small bitmaps cache */ FTC_FaceID getFaceID(const char * const family, const char * const style); diff --git a/src/eitd/edvbstring.cpp b/src/eitd/edvbstring.cpp index 0267cea1c..cfe9a90ee 100644 --- a/src/eitd/edvbstring.cpp +++ b/src/eitd/edvbstring.cpp @@ -2141,7 +2141,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) res[t++]=char(code); else if((table == 5) && (code == 0x8A)) res[t++]= 0x20; - else if ((code == 0x8A)) + else if (code == 0x8A) res[t++]= '\n'; // 0x8a is vertical tab. Just use newline for now. else if((code >= 0x80) && (code <= 0x9F)) continue; diff --git a/src/gui/adzap.h b/src/gui/adzap.h index 72df84a1d..078d18faf 100644 --- a/src/gui/adzap.h +++ b/src/gui/adzap.h @@ -36,7 +36,6 @@ class CAdZapMenu: public CMenuTarget, CChangeObserver private: CFrameBuffer * frameBuffer; int width; - bool running; bool armed; bool alerted; bool monitor; diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 1ba8a199e..193146b5a 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -88,7 +88,6 @@ class CBouquetList : public CListHelpers unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; - unsigned int maxpos; int fheight; // Fonthoehe Bouquetlist-Inhalt int theight; // Fonthoehe Bouquetlist-Titel int footerHeight; diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 5f159ed05..d1bd179e4 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -82,7 +82,6 @@ private: unsigned int origPosition; unsigned int newPosition; bool channelsChanged; - bool favoritesChanged; unsigned int tuned; t_channel_id selected_chid; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 12e3e2f27..0793ac5cb 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -126,8 +126,8 @@ void EpgPlus::Header::paint(const char * Name) { std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); - CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); - header.paint(CC_SAVE_SCREEN_NO); + CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight()+4, head); + _header.paint(CC_SAVE_SCREEN_NO); } int EpgPlus::Header::getUsedHeight() @@ -158,7 +158,7 @@ EpgPlus::TimeLine::~TimeLine() { } -void EpgPlus::TimeLine::paint (time_t startTime, int pduration) +void EpgPlus::TimeLine::paint (time_t _startTime, int pduration) { this->clearMark(); @@ -167,7 +167,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) this->currentDuration = pduration; int numberOfTicks = this->currentDuration / (60 * 60) * 2; int tickDist = (this->durationX) / numberOfTicks; - time_t tickTime = startTime; + time_t tickTime = _startTime; bool toggleColor = false; // display date of begin @@ -175,7 +175,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) , toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); this->fontDate->RenderString (this->x + 4, this->y + this->fontDate->getHeight() - , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT_TEXT); + , this->width, EpgPlus::getTimeString (_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) { @@ -214,7 +214,7 @@ void EpgPlus::TimeLine::paintGrid() } } -void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int pwidth) +void EpgPlus::TimeLine::paintMark (time_t _startTime, int pduration, int px, int pwidth) { // clear old mark this->clearMark(); @@ -224,14 +224,14 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int , pwidth, this->fontTime->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); // display start time before mark - std::string timeStr = EpgPlus::getTimeString (startTime, "%H:%M"); + std::string timeStr = EpgPlus::getTimeString (_startTime, "%H:%M"); int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() , textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark - timeStr = EpgPlus::getTimeString (startTime + pduration, "%H:%M"); + timeStr = EpgPlus::getTimeString (_startTime + pduration, "%H:%M"); textWidth = fontTime->getRenderWidth (timeStr); if (px + pwidth + textWidth < this->x + this->width) { @@ -282,9 +282,9 @@ EpgPlus::ChannelEventEntry::~ChannelEventEntry() { } -bool EpgPlus::ChannelEventEntry::isSelected (time_t selectedTime) const +bool EpgPlus::ChannelEventEntry::isSelected (time_t _selectedTime) const { - return (selectedTime >= this->channelEvent.startTime) && (selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); + return (_selectedTime >= this->channelEvent.startTime) && (_selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); } void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) @@ -363,7 +363,7 @@ EpgPlus::ChannelEntry::~ChannelEntry() this->channelEventEntries.clear(); } -void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime) +void EpgPlus::ChannelEntry::paint (bool isSelected, time_t _selectedTime) { this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight(), isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); @@ -408,7 +408,7 @@ void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime) for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin(); It != this->channelEventEntries.end(); ++It) { - (*It)->paint (isSelected && (*It)->isSelected (selectedTime), toggleColor); + (*It)->paint (isSelected && (*It)->isSelected (_selectedTime), toggleColor); toggleColor = !toggleColor; } @@ -839,7 +839,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu refreshAll = true; break; } - else if ((msg == CRCInput::RC_page_down)) { + else if (msg == CRCInput::RC_page_down) { int selected = this->selectedChannelEntry->index; int prev_selected = selected; int step = this->maxNumberOfDisplayableEntries; diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index f98223fcd..1dcdd6dac 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -75,7 +75,6 @@ class CEventList : public CListHelpers t_channel_id m_search_channel_id; t_bouquet_id m_search_bouquet_id; bool m_showChannel; - int FunctionBarHeight; int oldIndex; event_id_t oldEventID; bool bgRightBoxPaint; @@ -91,18 +90,16 @@ class CEventList : public CListHelpers unsigned int current_event; unsigned int liststart; unsigned int listmaxshow; - unsigned int numwidth; int fheight; // Fonthoehe Channellist-Inhalt int fheight1,fheight2; int fwidth1,fwidth2; int theight; // Fonthoehe Channellist-Titel int iheight; // Height info bar - int key; std::string search_head_name; - int full_width, width, infozone_width, fw; - int height, infozone_height, fh; + int full_width, width, infozone_width; + int height; int x; int y; std::string infozone_text; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 4c4d2513a..3db50e64c 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -140,7 +140,7 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS[K { SNeutrinoSettings::VOLUME, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VOLUME }, { SNeutrinoSettings::INFOBAR, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_INFOBAR } }; - +#if 0 //not used #define KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT 3 const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT] = { @@ -148,7 +148,7 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDI { 1, LOCALE_KEYBINDINGMENU_BOUQUETLIST_ON_OK }, { 2, LOCALE_KEYBINDINGMENU_ALLCHANNELS_ON_OK } }; - +#endif typedef struct key_settings_t { const neutrino_locale_t keydescription; diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 46be84c82..ff3cb1f17 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -100,7 +100,6 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver }; private: - CFrameBuffer *frameBuffer; CKeyChooser *keychooser[KEYBINDS_COUNT]; int width; diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 4f5d2bcc8..6abdb8d48 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -139,7 +139,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) return showMiscSettingsMenu(); } - +#if 0 //not used #define MISCSETTINGS_FB_DESTINATION_OPTION_COUNT 3 const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTINGS_FB_DESTINATION_OPTION_COUNT] = { @@ -147,6 +147,7 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTING { 1, LOCALE_OPTIONS_SERIAL }, { 2, LOCALE_OPTIONS_FB } }; +#endif #define MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT 2 const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT] = diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 3439ed74a..6084f3f92 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -41,7 +41,6 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; //COnOffNotifier* miscNotifier; - COnOffNotifier* miscEpgScanNotifier; CMenuOptionChooser * epg_save; CMenuOptionChooser * epg_save_standby; CMenuOptionChooser * epg_save_frequently; diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h index 9d2dcab91..96fc16fdf 100644 --- a/src/gui/motorcontrol.h +++ b/src/gui/motorcontrol.h @@ -58,7 +58,6 @@ class CMotorControl : public CMenuTarget int hheight,mheight; // head/menu font height int ypos; int ypos_status; - int ypos_menue; Font* m_font; int8_t stepSize; int32_t stepDelay; diff --git a/src/gui/opkg_manager.h b/src/gui/opkg_manager.h index 78cebaa49..75865a047 100644 --- a/src/gui/opkg_manager.h +++ b/src/gui/opkg_manager.h @@ -46,7 +46,6 @@ class COPKGManager : public CMenuTarget private: int width; std::string tmp_str; - CFrameBuffer *frameBuffer; CConfigFile opkg_conf; void saveConfig(); void loadConfig(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 12d1b8e49..2ce4485cc 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -371,14 +371,14 @@ const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_ { 2, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_MINI }, { 3, LOCALE_OPTIONS_OFF }, }; - +#if 0 //not used #define SHOW_INFOMENU_MODE_OPTION_COUNT 2 const CMenuOptionChooser::keyval SHOW_INFOMENU_MODE_OPTIONS[SHOW_INFOMENU_MODE_OPTION_COUNT] = { { 0, LOCALE_MAINMENU_HEAD }, { 1, LOCALE_MAINMENU_SERVICE }, }; - +#endif #define MENU_CORNERSETTINGS_TYPE_OPTION_COUNT 2 const CMenuOptionChooser::keyval MENU_CORNERSETTINGS_TYPE_OPTIONS[MENU_CORNERSETTINGS_TYPE_OPTION_COUNT] = { @@ -448,7 +448,7 @@ const CMenuOptionChooser::keyval CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS[CHANNE { 0 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT }, { 1 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT } }; - +#if 0 //not used #define CHANNELLIST_EXTENDED_OPTIONS_COUNT 3 const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTENDED_OPTIONS_COUNT]= { @@ -456,7 +456,7 @@ const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTEND { 1, LOCALE_CHANNELLIST_EXTENDED_SIMPLE }, //unicolor { 2, LOCALE_CHANNELLIST_EXTENDED_COLORED } //colored }; - +#endif #define OPTIONS_COLORED_EVENTS_OPTION_COUNT 3 const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_EVENTS_OPTION_COUNT] = { @@ -897,7 +897,8 @@ public: void COsdSetup::AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry) { - font_Settings.addItem(new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile())); + CMenuNumberInput *bla = new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile()); + font_Settings.addItem(bla); } //font settings menu @@ -997,6 +998,7 @@ const CMenuOptionChooser::keyval PROGRESSBAR_INFOBAR_POSITION_OPTIONS[PROGRESSBA { 2 , LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION_2 }, { 3 , LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION_3 } }; +#if 0 //not used //menus void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) @@ -1005,7 +1007,7 @@ void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) CMenuOptionChooser * mc; submenu_menus->addIntroItems(LOCALE_SETTINGS_MENUS); - +#endif // menu position mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_MENU_POS); diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 3e9a1b095..3388937b3 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -147,7 +147,7 @@ int CRecordSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } - +#if 0 //not used #define RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT 4 const CMenuOptionChooser::keyval RECORDINGMENU_RECORDING_TYPE_OPTIONS[RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT] = { @@ -157,7 +157,6 @@ const CMenuOptionChooser::keyval RECORDINGMENU_RECORDING_TYPE_OPTIONS[RECORDINGM { CNeutrinoApp::RECORDING_FILE , LOCALE_RECORDINGMENU_FILE } }; -#if 0 //not used #define CHOOSE_DIRECT_REC_DIR_COUNT 3 const CMenuOptionChooser::keyval CHOOSE_DIRECT_REC_DIR[RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT] = { diff --git a/src/gui/update_settings.h b/src/gui/update_settings.h index 44a7a16df..c4cfc520d 100644 --- a/src/gui/update_settings.h +++ b/src/gui/update_settings.h @@ -61,7 +61,6 @@ class CUpdateSettings : public CMenuTarget int width; int initMenu(); - CFlashExpert *fe; #ifdef USE_SMS_INPUT CStringInputSMS *input_url_file; #endif diff --git a/src/gui/videosettings.h b/src/gui/videosettings.h index 824b4ed3a..2b07076a6 100644 --- a/src/gui/videosettings.h +++ b/src/gui/videosettings.h @@ -42,7 +42,6 @@ class CVideoSettings : public CMenuWidget, CChangeObserver CMenuForwarder *SyncControlerForwarder; CMenuOptionChooser *VcrVideoOutSignalOptionChooser; - int vcr_video_out_signal; int prev_video_mode; int is_wizard; diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 02d8a378e..1f09a056b 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -39,8 +39,8 @@ class CVolumeBar : public CComponentsForm CComponentsLabel *vb_digit; int vb_digit_mode; int VolumeFont; - int sy, sw, sh; - int mute_ax, mute_ay, mute_dx, mute_dy, mute_ay_old; + int sw, sh; + int mute_ax, mute_ay, mute_dx, mute_dy; int h_spacer, v_spacer; int vb_item_offset; diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index d460b2bae..2a8d9bcd4 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -95,7 +95,6 @@ class CStringInput : public CMenuTarget class CStringInputSMS : public CStringInput { - bool capsMode; int arraySizes[10]; char Chars[10][10]; // maximal 10 character in one CharList entry! diff --git a/src/system/ytcache.cpp b/src/system/ytcache.cpp index 7e15acf35..64dcb6672 100644 --- a/src/system/ytcache.cpp +++ b/src/system/ytcache.cpp @@ -290,12 +290,13 @@ void cYTCache::cancelAll(MI_MOVIE_INFO::miSource source) if (pending.empty()) return; if (pending.size() > 1) - for (std::vector::iterator it = pending.begin() + 1; it != pending.end();) + for (std::vector::iterator it = pending.begin() + 1; it != pending.end();){ if ((*it).source == source) { failed.push_back(*it); it = pending.erase(it); } else ++it; + } if (pending.front().source != source) return; } diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 404a07225..2ba830035 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -292,7 +292,7 @@ int CTimerManager::unlockEvents() bool CTimerManager::listEvents(CTimerEventMap &Events) { - if(!&Events) + if(Events.empty()) return false; From c91323b5c1c9c5a7f966bb5b15f2de95b369670c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 14:01:00 +0200 Subject: [PATCH 329/690] i for last commit Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/72ac0747e87c34ef9d44544c2e1e644b534efc7a Author: Jacek Jendrzej Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/gui/osd_setup.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 2ce4485cc..66538b57a 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -897,8 +897,8 @@ public: void COsdSetup::AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry) { - CMenuNumberInput *bla = new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile()); - font_Settings.addItem(bla); + CMenuNumberInput *ni = new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile()); + font_Settings.addItem(ni); } //font settings menu @@ -998,7 +998,6 @@ const CMenuOptionChooser::keyval PROGRESSBAR_INFOBAR_POSITION_OPTIONS[PROGRESSBA { 2 , LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION_2 }, { 3 , LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION_3 } }; -#if 0 //not used //menus void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) @@ -1007,7 +1006,6 @@ void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) CMenuOptionChooser * mc; submenu_menus->addIntroItems(LOCALE_SETTINGS_MENUS); -#endif // menu position mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_MENU_POS); From 168622ec5a4c5f3c230713094b1c82eb3f8e6276 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 14:53:38 +0200 Subject: [PATCH 330/690] zapit: fix comparison of constant 0 with expression of type 'bool' is always false Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/66fb9d45342d3bc412e0011a06961adda646999c Author: Jacek Jendrzej Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/zapit/src/fastscan.cpp | 4 ++-- src/zapit/src/pat.cpp | 2 +- src/zapit/src/scanbat.cpp | 2 +- src/zapit/src/scannit.cpp | 2 +- src/zapit/src/scanpmt.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index c6cf21a8f..96e5ed532 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -336,7 +336,7 @@ bool CServiceScan::ReadFst(unsigned short pid, unsigned short operator_id, bool cDemux * dmx = new cDemux(); dmx->Open(DMX_PSI_CHANNEL); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } @@ -586,7 +586,7 @@ bool CServiceScan::ParseFnt(unsigned short pid, unsigned short operator_id) mask[0] = mask[1] = mask[2] = 0xFF; printf("[FNT] scaning pid %d operator %d\n", pid, operator_id); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } diff --git a/src/zapit/src/pat.cpp b/src/zapit/src/pat.cpp index 82588a9c3..9f3fd6d3f 100644 --- a/src/zapit/src/pat.cpp +++ b/src/zapit/src/pat.cpp @@ -70,7 +70,7 @@ bool CPat::Parse() do { /* set filter for program association section */ /* read section */ - if ((dmx->sectionFilter(0, filter, mask, 5) < 0) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) + if ((!dmx->sectionFilter(0, filter, mask, 5)) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) { delete dmx; printf("[pat.cpp] dmx read failed\n"); diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index 24112fed8..01d655599 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -97,7 +97,7 @@ bool CBat::Read() filter[0] = 0x4A; mask[0] = 0xFF; - if (dmx->sectionFilter(0x11, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x11, filter, mask, flen)) { delete dmx; return false; } diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index dfa106759..dc47c6686 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -106,7 +106,7 @@ bool CNit::Read() flen = 3; } - if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x10, filter, mask, flen)) { delete dmx; #ifdef DEBUG_NIT printf("[NIT] filter failed\n"); diff --git a/src/zapit/src/scanpmt.cpp b/src/zapit/src/scanpmt.cpp index f62cbf60b..be71ac995 100644 --- a/src/zapit/src/scanpmt.cpp +++ b/src/zapit/src/scanpmt.cpp @@ -73,7 +73,7 @@ bool CPmt::Read(unsigned short pid, unsigned short sid) mask[2] = 0xFF; mask[3] = 0x01; mask[4] = 0xFF; - if ((dmx->sectionFilter(pid, filter, mask, 5) < 0) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { + if ((!dmx->sectionFilter(pid, filter, mask, 5)) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { printf("CPmt::Read: pid %x failed\n", pid); ret = false; } From 46e5d62aa9d84cf018dff8e9e420fb91821beb96 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 15:21:07 +0200 Subject: [PATCH 331/690] src/timerd/timermanager.cpp revert last change Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0bf186f256a070115f2b5c4c71b939d16490b8c4 Author: Jacek Jendrzej Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 2ba830035..404a07225 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -292,7 +292,7 @@ int CTimerManager::unlockEvents() bool CTimerManager::listEvents(CTimerEventMap &Events) { - if(Events.empty()) + if(!&Events) return false; From 53976b2ecec570eaa0ae40924788c93128756a52 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 17 Apr 2016 20:04:15 +0200 Subject: [PATCH 332/690] src/eitd/xmlutil.cpp fix possible segfault Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b4fccb307c49121ef4d9d7425bb7205eb30f5321 Author: Jacek Jendrzej Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/eitd/xmlutil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index c88461e06..6748e14f5 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -306,7 +306,10 @@ bool readEventsFromFile(std::string &epgname, int &ev_count) onid = xmlGetNumericAttribute(service, "original_network_id", 16); tsid = xmlGetNumericAttribute(service, "transport_stream_id", 16); sid = xmlGetNumericAttribute(service, "service_id", 16); - + if(!onid || !tsid || !sid){ + service = xmlNextNode(service); + continue; + } event = xmlChildrenNode(service); while (event) { From bb2c510f57ee835e7eec13cb66d3d53adccb3d8b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 18 Apr 2016 17:55:02 +0200 Subject: [PATCH 333/690] data/satellites.xml update Astra19 Hotbird13 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/da8569f2e701e152b3839b7d9d9c1e2b33b9a12d Author: Jacek Jendrzej Date: 2016-04-18 (Mon, 18 Apr 2016) --- data/satellites.xml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/data/satellites.xml b/data/satellites.xml index f8c198fd2..2c276ec42 100644 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -2200,7 +2200,6 @@ - @@ -2212,6 +2211,7 @@ + @@ -2234,8 +2234,9 @@ - + + @@ -2267,6 +2268,7 @@ + @@ -2274,12 +2276,12 @@ - + @@ -2506,8 +2508,7 @@ - - + @@ -2515,6 +2516,7 @@ + @@ -2533,12 +2535,10 @@ - - @@ -2549,9 +2549,8 @@ - + - @@ -2565,7 +2564,7 @@ - + @@ -2577,7 +2576,7 @@ - + @@ -2600,9 +2599,9 @@ - + - + From 58356ce4e3eeb4546d06f3091ed7974e61bbcbf9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Apr 2016 16:21:36 +0200 Subject: [PATCH 334/690] CComponentsFrmClock: ensure slot connect, if it is empty Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2b41e1c60fc3c9d7cf912631109849c7028f3834 Author: Thilo Graf Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/gui/components/cc_frm_clock.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index e20ef0916..cae23549c 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -317,8 +317,10 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(); - dprintf(DEBUG_INFO, "[CComponentsFrmClock] [%s] init slot...\n", __func__); - cl_timer->OnTimer.connect(cl_sl); + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl); + } } cl_timer->setTimerIntervall(cl_interval); From a2587c0d8c4ba895d779decf0239cf0f2360cc4a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Apr 2016 16:26:22 +0200 Subject: [PATCH 335/690] ComponentsTimer: ensure slot connect/disconnect dependency from slot state Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4eb9e45ec26a412063ea8ee567eb20f150f2609 Author: Thilo Graf Date: 2016-04-17 (Sun, 17 Apr 2016) --- src/gui/components/cc_timer.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index f7cbfa4ad..129f19dbc 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -83,8 +83,10 @@ bool CComponentsTimer::startTimer() return false; } if (res == 0){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s - %d] timer thread [%lu] created with interval = %d\033[0m\n", __func__, __LINE__, pthread_self(), tm_interval); - CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl); + if (!sl.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s - %d] timer thread [%lu] created with interval = %d\033[0m\n", __func__, __LINE__, pthread_self(), tm_interval); + CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl); + } }else{ dprintf(DEBUG_NORMAL, "\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); } @@ -107,9 +109,12 @@ bool CComponentsTimer::stopTimer() if (thres == 0){ tm_thread = 0; + dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s] timer thread terminated ...\033[0m\n", __func__); //ensure disconnect of unused slot - sl.disconnect(); - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s] timer thread terminated ...\033[0m\n", __func__); + if (!sl.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer][%s] disconnect timer slot ...\033[0m\n", __func__); + sl.disconnect(); + } return true; } } From 5942128c5bae02d9279a173c50fb88ff719d4dad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Apr 2016 13:09:45 +0200 Subject: [PATCH 336/690] neutrinoyparser: add Link and Trinity Duo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/feae5aef97f91ddde533e7c355fa3cbea873fd2a Author: vanhofen Date: 2016-04-19 (Tue, 19 Apr 2016) Origin message was: ------------------ - neutrinoyparser: add Link and Trinity Duo --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 637e64198..b053470ef 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -855,6 +855,12 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) case 12: boxname += "Zee2"; break; + case 13: + boxname += "Link"; + break; + case 14: + boxname += "Trinity Duo"; + break; default: char buffer[10]; @@ -889,6 +895,8 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) boxmodel = "Shiner"; break; case 12: + case 13: + case 14: boxmodel = "Kronos"; break; default: From cf223099a7de97370df8688d33831a86b2b7abb0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Apr 2016 13:24:12 +0200 Subject: [PATCH 337/690] neutrinoyparser: fix Trinity detection Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5e6720a849a8c37d8b8ce5246947df31702888c0 Author: vanhofen Date: 2016-04-19 (Tue, 19 Apr 2016) Origin message was: ------------------ - neutrinoyparser: fix Trinity detection --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index b053470ef..8b020c626 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -851,6 +851,8 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) break; case 11: boxname += "Trinity"; + if (cs_get_chip_type() != 33904 /*0x8470*/) + boxname += " V2"; break; case 12: boxname += "Zee2"; @@ -892,7 +894,10 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) boxmodel = "Apollo"; break; case 11: - boxmodel = "Shiner"; + if (cs_get_chip_type() == 33904 /*0x8470*/) + boxmodel = "Shiner"; + else + boxmodel = "Kronos"; break; case 12: case 13: From 0493e5c8f8f109ce424864b90a9340e471f2d808 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Apr 2016 08:26:40 +0200 Subject: [PATCH 338/690] neutrinoyparser: try to fix nevis build Todo: BOXMODEL_NEVIS should be renamed to HAVE_COOLSTREAM_HD1 BOXMODEL_APOLLO should be renamed to HAVE_COOLSTREAM_HD2 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f764fe6c5413ae70db548eee63fb16bb3f196373 Author: vanhofen Date: 2016-04-20 (Wed, 20 Apr 2016) Origin message was: ------------------ - neutrinoyparser: try to fix nevis build Todo: BOXMODEL_NEVIS should be renamed to HAVE_COOLSTREAM_HD1 BOXMODEL_APOLLO should be renamed to HAVE_COOLSTREAM_HD2 --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 8b020c626..5066e5698 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -832,6 +832,7 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) if( boxname == "Armas ") boxname += "TripleDragon"; break; +#ifdef BOXMODEL_NEVIS case 6: boxname += "HD1"; break; @@ -843,12 +844,14 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) if (CFEManager::getInstance()->getFrontendCount() > 1) boxname += " Twin"; break; - case 9: - boxname += "Tank"; - break; case 10: boxname += "Zee"; break; +#endif +#ifdef BOXMODEL_APOLLO + case 9: + boxname += "Tank"; + break; case 11: boxname += "Trinity"; if (cs_get_chip_type() != 33904 /*0x8470*/) @@ -863,7 +866,7 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) case 14: boxname += "Trinity Duo"; break; - +#endif default: char buffer[10]; snprintf(buffer, sizeof(buffer), "%u\n", system_rev); @@ -884,12 +887,15 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) switch(system_rev) { +#ifdef BOXMODEL_NEVIS case 6: case 7: case 8: case 10: boxmodel = "Nevis"; break; +#endif +#ifdef BOXMODEL_APOLLO case 9: boxmodel = "Apollo"; break; @@ -904,6 +910,7 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) case 14: boxmodel = "Kronos"; break; +#endif default: break; } From f964a56c0d64d5672e8c985e9a0801d2fa5a8e39 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 20 Apr 2016 12:52:16 +0200 Subject: [PATCH 339/690] pass by reference Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a918ca56b6c6e9b0b775d71dc952058c3fd8c439 Author: Jacek Jendrzej Date: 2016-04-20 (Wed, 20 Apr 2016) --- src/gui/hdd_menu.h | 2 +- src/gui/widget/menue.cpp | 2 +- src/gui/widget/menue.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/hdd_menu.h b/src/gui/hdd_menu.h index 899d0f6e5..13a320e62 100644 --- a/src/gui/hdd_menu.h +++ b/src/gui/hdd_menu.h @@ -66,7 +66,7 @@ class CHDDMenuHandler : public CMenuTarget std::vector hdd_list; struct cmp_hdd_by_name: public binary_function { - bool operator() (const struct hdd_s c1, const struct hdd_s c2) + bool operator() (const struct hdd_s &c1, const struct hdd_s &c2) { return std::lexicographical_compare(c1.devname.begin(), c1.devname.end(), c2.devname.begin(), c2.devname.end()); }; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a15b51eab..d2c36c0f6 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2258,7 +2258,7 @@ CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, boo nameString = ""; } -CMenuSeparator::CMenuSeparator(const int Type, const std::string Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) +CMenuSeparator::CMenuSeparator(const int Type, const std::string &Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) { type = Type; name = NONEXISTANT_LOCALE; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 97bf7bd26..104078179 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -190,7 +190,7 @@ class CMenuItem : public CComponentsSignals virtual int isMenueOptionChooser(void) const{return 0;} void setHint(const char * const icon, const neutrino_locale_t text) { hintIcon = (icon && *icon) ? icon : NULL; hint = text; } - void setHint(const char * const icon, const std::string text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; } + void setHint(const char * const icon, const std::string &text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; } void setLua(lua_State *_luaState, std::string &_luaAction, std::string &_luaId) { luaState = _luaState; luaAction = _luaAction; luaId = _luaId; }; virtual const char *getName(); @@ -226,7 +226,7 @@ class CMenuSeparator : public CMenuItem CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE, bool IsStatic = false); - CMenuSeparator(const int Type, const std::string Text, bool IsStatic = false); + CMenuSeparator(const int Type, const std::string &Text, bool IsStatic = false); virtual ~CMenuSeparator(){} int paint(bool selected=false); From 5fbc92695cb8a73c85785a4255875c825b824770 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 20 Apr 2016 12:54:27 +0200 Subject: [PATCH 340/690] eitd : fix add ExtendedTextCache option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/797fd44a353809953089658e705725922a1a864f Author: Jacek Jendrzej Date: 2016-04-20 (Wed, 20 Apr 2016) --- src/eitd/SIevents.cpp | 4 ++++ src/eitd/sectionsd.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index b68072cb6..32ef385d5 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -182,6 +182,8 @@ void SIevent::parse(Event &event) { int tsidonid = (transport_stream_id << 16) | original_network_id; time_t start_time = parseDVBtime(event.getStartTimeMjd(), event.getStartTimeBcd()); + extern long int secondsExtendedTextCache; + time_t now = time(NULL); running = event.getRunningStatus(); @@ -226,6 +228,8 @@ void SIevent::parse(Event &event) } case EXTENDED_EVENT_DESCRIPTOR: { + if(now && secondsExtendedTextCache && start_time > now + secondsExtendedTextCache) + continue; const ExtendedEventDescriptor *d = (ExtendedEventDescriptor*) *dit; std::string lang = d->getIso639LanguageCode(); std::transform(lang.begin(), lang.end(), lang.begin(), tolower); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 558343e37..91e6b0dfa 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -86,7 +86,7 @@ static bool notify_complete = false; static unsigned int epg_save_frequently; static long secondsToCache; -static long secondsExtendedTextCache; +long int secondsExtendedTextCache = 0; static long oldEventsAre; static int scanning = 1; From f62086378cf79abb2b51f47150e80aaf25601ad3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 20 Apr 2016 22:49:52 +0200 Subject: [PATCH 341/690] CComponentsFrmClock: remove unnecessary paint Is already handled with OnTimer signal. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/71adac0a0b1567b9060d46075f26be2b52e89cd2 Author: Thilo Graf Date: 2016-04-20 (Wed, 20 Apr 2016) --- src/gui/components/cc_frm_clock.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index cae23549c..c0c547ca5 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -349,8 +349,6 @@ bool CComponentsFrmClock::stopClock() bool CComponentsFrmClock::Start(bool do_save_bg) { if (startClock()) { - //ensure paint of segements on first paint - paint(do_save_bg); paintClock = true; return true; } From a787c2990d66d92b42582c0c02edc8bcde6a0cf0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Apr 2016 18:08:17 +0200 Subject: [PATCH 342/690] avoid division by zero Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/49c86a38b4d8082eb042f03071ef6fc6cc3aecaf Author: Jacek Jendrzej Date: 2016-04-21 (Thu, 21 Apr 2016) --- src/driver/pictureviewer/pictureviewer.cpp | 16 +++++++++------- src/gui/channellist.cpp | 6 +++--- src/gui/upnpbrowser.cpp | 6 +++--- src/gui/widget/buttons.cpp | 14 +++++++++----- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index c13ce7251..7c81ef2ed 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -774,10 +774,11 @@ unsigned char * CPictureViewer::int_Resize(unsigned char *orgin, int ox, int oy, r+=q[0]; g+=q[1]; b+=q[2]; a+=q[3]; } } - p[0]= uint8_t(r/sq); - p[1]= uint8_t(g/sq); - p[2]= uint8_t(b/sq); - p[3]= uint8_t(a/sq); + int sq_tmp = sq ? sq : 1;//avoid division by zero + p[0]= uint8_t(r/sq_tmp); + p[1]= uint8_t(g/sq_tmp); + p[2]= uint8_t(b/sq_tmp); + p[3]= uint8_t(a/sq_tmp); } } }else @@ -796,9 +797,10 @@ unsigned char * CPictureViewer::int_Resize(unsigned char *orgin, int ox, int oy, r+=q[0]; g+=q[1]; b+=q[2]; } } - p[0]= uint8_t(r/sq); - p[1]= uint8_t(g/sq); - p[2]= uint8_t(b/sq); + int sq_tmp = sq ? sq : 1;//avoid division by zero + p[0]= uint8_t(r/sq_tmp); + p[1]= uint8_t(g/sq_tmp); + p[2]= uint8_t(b/sq_tmp); } } } diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 02dfe231c..ccc3dce1e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2161,9 +2161,9 @@ void CChannelList::paintBody() const int ypos = y+ theight; const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= (((*chanlist).size()- 1)/ listmaxshow)+ 1; - const int sbs= (selected/listmaxshow); + unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero + int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1; + const int sbs= (selected/listmaxshow_tmp); if (sbc < 1) sbc = 1; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 43fc71852..649b22860 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1137,9 +1137,9 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, ypos = m_y + m_title_height + m_theight; int sb = m_fheight * m_listmaxshow; m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc = ((max + offset - 1) / m_listmaxshow) + 1; - int sbs = ((selected + offset) / m_listmaxshow); + unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero + int sbc = ((max + offset - 1) / tmp) + 1; + int sbs = ((selected + offset) / tmp); int sbh = 0; if ((sbc > 0) && (sbc > sb-4)) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 4134eb0a8..b054760cc 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -221,12 +221,15 @@ int paintButtons( const button_label_ext * const content, } if (spacing >= 0) - { /* add half of the inter-object space to the */ - spacing /= count_labels; /* left and right (this might break vertical */ - x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ - } /* and I'm don't know how it should work. */ + { + int tmp = count_labels ? count_labels : 1;//avoid division by zero + /* add half of the inter-object space to the */ + spacing /= tmp; /* left and right (this might break vertical */ + x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ + } /* and I'm don't know how it should work. */ else { + w_text = w_text ? w_text : 1; /* shorten captions relative to their length */ for (int i = 0; i < cnt; i++) fwidth[i] = (fwidth[i] * (w_text + spacing)) / w_text; /* spacing is negative...*/ @@ -410,8 +413,9 @@ int paintButtons( const int &x, else { /* shorten captions relative to their length */ + int tmp = w_text ? w_text : 1;//avoid division by zero for (i = 0; i < cnt; i++) - fwidth[i] = (fwidth[i] * (w_text + spacing)) / w_text; /* spacing is negative...*/ + fwidth[i] = (fwidth[i] * (w_text + spacing)) / tmp; /* spacing is negative...*/ spacing = 0; } From 419b55bb979c48f34f230b358aec10feced036ea Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Apr 2016 15:29:18 +0200 Subject: [PATCH 343/690] avoid null pointer use Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8fb4e1b78e4ea1a9a307623693e9e9ceb4fa8fd0 Author: Jacek Jendrzej Date: 2016-04-21 (Thu, 21 Apr 2016) --- src/gui/adzap.cpp | 3 ++- src/gui/cam_menu.cpp | 4 ++-- src/gui/lua/lua_cc_window.cpp | 6 +++--- src/gui/movieplayer.cpp | 8 +++++--- src/gui/pictureviewer_setup.cpp | 1 - src/gui/timerlist.cpp | 6 ++++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 094b1f5eb..0199bc779 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -86,7 +86,8 @@ void CAdZapMenu::Init() { CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; - channelName = channelList->getActiveChannelName(); + if(channelList) + channelName = channelList->getActiveChannelName(); evtlist.clear(); CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); monitorLifeTime.tv_sec = 0; diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 349937009..da9c5723a 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -104,7 +104,7 @@ int CCAMMenuHandler::doMainMenu() char name1[255]={0}; char str1[255]={0}; - int CiSlots = ca->GetNumberCISlots(); + int CiSlots = ca ? ca->GetNumberCISlots() : 0; CMenuWidget* cammenu = new CMenuWidget(LOCALE_CI_SETTINGS, NEUTRINO_ICON_SETTINGS); cammenu->addIntroItems(); @@ -171,7 +171,7 @@ int CCAMMenuHandler::doMainMenu() } i = 0; - int ScNum = ca->GetNumberSmartCardSlots(); + int ScNum = ca ? ca->GetNumberSmartCardSlots() : 0; printf("CCAMMenuHandler::doMainMenu sc slots: %d\n", ScNum); if(ScNum && CiSlots) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 7fe6617a2..969014378 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -248,10 +248,10 @@ int CLuaInstCCWindow::CCWindowPaintHeader(lua_State *L) if (!D) return 0; CComponentsHeader* header = D->w->getHeaderObject(); - if (header) + if (header){ D->w->showHeader(); - header->paint(); - + header->paint(); + } return 0; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c34af0661..38e7e7532 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1055,7 +1055,8 @@ void CMoviePlayerGui::stopPlayBack(void) printf("%s: this %p join background thread %lx\n", __func__, this, bgThread);fflush(stdout); mutex.lock(); webtv_started = false; - playback->RequestAbort(); + if(playback) + playback->RequestAbort(); mutex.unlock(); cond.broadcast(); pthread_join(bgThread, NULL); @@ -1832,7 +1833,7 @@ void CMoviePlayerGui::selectAudioPid() APIDSelector.addItem(item, defpid); } - int percent[numpida]; + int percent[numpida+1]; if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); @@ -2061,7 +2062,8 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) #endif const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); char play_pos[32]; - snprintf(play_pos, sizeof(play_pos), "%3d %s", p_movie_info->bookmarks.lastPlayStop/60, unit_short_minute); + int lastplaystop = p_movie_info ? p_movie_info->bookmarks.lastPlayStop/60:0; + snprintf(play_pos, sizeof(play_pos), "%3d %s", lastplaystop, unit_short_minute); char start_pos[32] = {0}; if (p_movie_info->bookmarks.start != 0) snprintf(start_pos, sizeof(start_pos), "%3d %s", p_movie_info->bookmarks.start/60, unit_short_minute); diff --git a/src/gui/pictureviewer_setup.cpp b/src/gui/pictureviewer_setup.cpp index 052299c39..a00de31e5 100644 --- a/src/gui/pictureviewer_setup.cpp +++ b/src/gui/pictureviewer_setup.cpp @@ -72,7 +72,6 @@ int CPictureViewerSetup::exec(CMenuTarget* parent, const std::string &actionKey) if(actionKey == "picturedir") { - parent->hide(); CFileBrowser b; b.Dir_Mode=true; if (b.exec(g_settings.network_nfs_picturedir.c_str())) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 473d6ac4c..f7fc38c5f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -382,7 +382,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_EXIT; } else if(actionKey == "rec_dir1") { - parent->hide(); + if (parent) + parent->hide(); const char *action_str = "RecDir1"; if(chooserDir(timerlist[selected].recordingDir, true, action_str, sizeof(timerlist[selected].recordingDir)-1)) { printf("[timerlist] new %s dir %s\n", action_str, timerlist[selected].recordingDir); @@ -391,7 +392,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_REPAINT; } else if(actionKey == "rec_dir2") { - parent->hide(); + if (parent) + parent->hide(); const char *action_str = "RecDir2"; if(chooserDir(timerNew.recordingDir, true, action_str, sizeof(timerNew.recordingDir)-1)) { printf("[timerlist] new %s dir %s\n", action_str, timerNew.recordingDir); From c167f68b78aed022c4c16b6090e5e68fac68b342 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Apr 2016 16:59:51 +0200 Subject: [PATCH 344/690] avoid pssible memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d1e34a527801fcce935ad400f0f274d56cc431c Author: Jacek Jendrzej Date: 2016-04-21 (Thu, 21 Apr 2016) --- src/driver/colorgradient.cpp | 4 +++- src/driver/rcinput.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/colorgradient.cpp b/src/driver/colorgradient.cpp index e9ed0e97e..ee8e91150 100644 --- a/src/driver/colorgradient.cpp +++ b/src/driver/colorgradient.cpp @@ -142,8 +142,10 @@ fb_pixel_t* CColorGradient::gradientOneColor(fb_pixel_t col, fb_pixel_t *gradien start_v = max_v; end_v = min_v; break; - default: + default:{ + free(gradientBuf); return 0; + } } int bSize1 = ((mode == gradientDark2Light2Dark) || (mode == gradientLight2Dark2Light)) ? bSize/2 : bSize; diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 1954fbdb0..65856a9fe 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1183,7 +1183,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 case NeutrinoMessages::EVT_NEXTEPG: { CSectionsdClient::CurrentNextInfo *cn = (CSectionsdClient::CurrentNextInfo *) p; - delete cn; + delete [] cn; p = NULL; break; } From b0db75af05639659f11b2b62f9f5faf2a9f7408f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 22 Apr 2016 13:29:34 +0200 Subject: [PATCH 345/690] CComponentsFrmClock: remove unused parameter,fix possible compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8573db8019fbe73624c93ac0ea14ae33cd40bf3a Author: Thilo Graf Date: 2016-04-22 (Fri, 22 Apr 2016) --- src/gui/components/cc_frm_clock.cpp | 2 +- src/gui/components/cc_frm_clock.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index c0c547ca5..391823c3e 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -346,7 +346,7 @@ bool CComponentsFrmClock::stopClock() return false; } -bool CComponentsFrmClock::Start(bool do_save_bg) +bool CComponentsFrmClock::Start() { if (startClock()) { paintClock = true; diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 8f5fe47b4..bb9ca186e 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -134,9 +134,9 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen virtual void setClockFormat(const char* prformat_str, const char* secformat_str = NULL); ///start and paint ticking clock - virtual bool Start(bool do_save_bg = CC_SAVE_SCREEN_NO); + virtual bool Start(); ///same like Start() but for usage as simple call without return value - virtual void unblock(/*bool do_save_bg = CC_SAVE_SCREEN_NO*/){Start(cc_save_bg);} + virtual void unblock(){Start();} ///stop ticking clock, but don't hide, use kill() or hide() to remove from screen virtual bool Stop(); ///same like Stop() but for usage as simple call without return value From 5ee708dd97aa6db0518bad14390e45e0c65d2ddd Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 22 Apr 2016 15:10:39 +0200 Subject: [PATCH 346/690] src/gui/timerlist.cpp fix memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f78fc97fe3a11bf517b3c99ef7ba26b8c354b372 Author: Jacek Jendrzej Date: 2016-04-22 (Fri, 22 Apr 2016) --- src/gui/timerlist.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f7fc38c5f..e695a5a0f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1056,19 +1056,18 @@ int CTimerList::modifyTimer() //printf("TIMER: rec dir %s len %s\n", timer->recordingDir, strlen(timer->recordingDir)); - if (!strlen(timer->recordingDir)) - strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); - timer_recordingDir = timer->recordingDir; - - bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? - CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green); - timerSettings.addItem(GenericMenuSeparatorLine); timerSettings.addItem(m3); timerSettings.addItem(m4); timerSettings.addItem(m5); if (timer->eventType == CTimerd::TIMER_RECORD) { + if (!strlen(timer->recordingDir)) + strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); + timer_recordingDir = timer->recordingDir; + + bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? + CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green); timerSettings.addItem(GenericMenuSeparatorLine); timerSettings.addItem(m6); } From b06b3db4361b5166507dc6e15f27208274ebaa2b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 22 Apr 2016 16:46:21 +0200 Subject: [PATCH 347/690] some compil warning fixes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8638cd73b7faef42fe20bf8f32cbfb79ab339847 Author: Jacek Jendrzej Date: 2016-04-22 (Fri, 22 Apr 2016) --- src/driver/record.cpp | 2 -- src/gui/audio_select.cpp | 2 +- src/gui/bouquetlist.cpp | 6 +++--- src/gui/lua/luainstance.cpp | 9 ++++++--- src/gui/widget/shellwindow.cpp | 2 +- src/zapit/src/zapit.cpp | 3 +-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 6a15e4775..0592347ff 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -706,8 +706,6 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) MakeExtFileName(channel, ext_file_name); strcpy(&(filename[pos]), UTF8_TO_FILESYSTEM_ENCODING(ext_file_name.c_str())); - pos = strlen(filename); - if(autoshift) strncat(filename, "_temp",FILENAMEBUFFERSIZE - strlen(filename)-1); diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index 51935640b..8d2adfba9 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -198,7 +198,7 @@ int CAudioSelectMenuHandler::doMenu () /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ CVolume::getInstance()->SetCurrentChannel(0); CVolume::getInstance()->SetCurrentPid(0); - int percent[p_count]; + int percent[p_count+1];//+1 avoid zero size for (uint i=0; i < p_count; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid, g_RemoteControl->current_PIDs.APIDs[i].is_ac3); AudioSelector.addItem(new CMenuOptionNumberChooser(g_RemoteControl->current_PIDs.APIDs[i].desc, diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 1bb805dd2..37320e3df 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -717,9 +717,9 @@ void CBouquetList::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((bsize - 1)/ listmaxshow)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow); + int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero + int sbc= ((bsize - 1)/ listmaxshow_tmp)+ 1; /* bsize is > 0, so sbc is also > 0 */ + int sbs= (selected/listmaxshow_tmp); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); } diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f3bf6b45f..3a7f44ab3 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -682,9 +682,12 @@ int CLuaInstance::GCWindow(lua_State *L) else if (videoDecoder->getBlank()) CLuaInstVideo::getInstance()->channelRezap(L); - delete w->fbwin; - w->rcinput = NULL; - delete w; + if(w){ + if(w->fbwin) + delete w->fbwin; + w->rcinput = NULL; + delete w; + } return 0; } diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 60eab7cb3..4147fb717 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -233,7 +233,7 @@ void CShellWindow::showResult() show_button = true; } else if (mode & ACKNOWLEDGE_EVENT){ - if (*res != 0){ + if (res && *res != 0){ OnResultError(res); if (OnResultError.empty()) DisplayErrorMessage("Error while execution of task. Please see window for details!"); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index cfb3e448b..6cf7d90d5 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2638,14 +2638,13 @@ bool CZapitSdtMonitor::Stop() void CZapitSdtMonitor::run() { - time_t /*tstart,*/ tcur, wtime = 0; + time_t /*tstart,*/ tcur = 0, wtime = 0; t_transport_stream_id transport_stream_id = 0; t_original_network_id original_network_id = 0; t_satellite_position satellitePosition = 0; freq_id_t freq = 0; transponder_id_t tpid = 0; - tcur = time(0); //tstart = time(0); sdt_tp.clear(); printf("[zapit] sdt monitor started\n"); From 958e33ddd69daa69e3de8fa14e92caa0ac04143a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 23 Apr 2016 21:19:04 +0200 Subject: [PATCH 348/690] some compil warning fixes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a471b2af101873c5c71dc19987f540aedf822159 Author: Jacek Jendrzej Date: 2016-04-23 (Sat, 23 Apr 2016) --- src/driver/volume.cpp | 4 ++-- src/gui/lua/lua_video.cpp | 3 ++- src/gui/movieplayer.cpp | 4 ++-- src/timerd/timermanager.cpp | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 0e8c55825..4a3112c52 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -100,8 +100,8 @@ void CVolume::setVolume(const neutrino_msg_t key) hideVolscale(); showVolscale(); - neutrino_msg_data_t data; - uint64_t timeoutEnd; + neutrino_msg_data_t data = 0; + uint64_t timeoutEnd = 0; int vol = g_settings.current_volume; do { diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index 8ee09629f..627cb94af 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -152,7 +152,8 @@ int CLuaInstVideo::PlayFile(lua_State *L) bool sp = false; if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) - sp = D->singlePlay; + if (D) + sp = D->singlePlay; if ((sp == false) && (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false)) CMoviePlayerGui::getInstance().setBlockedFromPlugin(true); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 38e7e7532..f6017d99f 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2065,10 +2065,10 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) int lastplaystop = p_movie_info ? p_movie_info->bookmarks.lastPlayStop/60:0; snprintf(play_pos, sizeof(play_pos), "%3d %s", lastplaystop, unit_short_minute); char start_pos[32] = {0}; - if (p_movie_info->bookmarks.start != 0) + if (p_movie_info && p_movie_info->bookmarks.start != 0) snprintf(start_pos, sizeof(start_pos), "%3d %s", p_movie_info->bookmarks.start/60, unit_short_minute); char end_pos[32] = {0}; - if (p_movie_info->bookmarks.end != 0) + if (p_movie_info && p_movie_info->bookmarks.end != 0) snprintf(end_pos, sizeof(end_pos), "%3d %s", p_movie_info->bookmarks.end/60, unit_short_minute); bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_LASTMOVIESTOP, isMovieBrowser, play_pos, &cSelectedMenuBookStart[1])); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 404a07225..6d9c12f3e 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -814,7 +814,7 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, time_t announcetime, stopTime = stoptime; repeatCount = repeatcount; previousState = CTimerd::TIMERSTATE_SCHEDULED; - +#if 0 //never used time_t diff = 0; time_t mtime = time(NULL); struct tm *tmtime = localtime(&mtime); @@ -832,6 +832,7 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, time_t announcetime, { diff+=3600; } +#endif #if 0 //FIXME EPG vs manual timer ? printf("############## CTimerEvent dst %d -> %d diff %d\n", isdst1, isdst2, diff); alarmTime += diff; From 1486711d168819fba5e34ba79ac2e52b7e3e7968 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 24 Apr 2016 17:18:37 +0200 Subject: [PATCH 349/690] some never read compil warning fixes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0d9fbd537813c05a469e9fdc2f8d7498f9431d42 Author: Jacek Jendrzej Date: 2016-04-24 (Sun, 24 Apr 2016) --- lib/libdvbsub/dvbsub.cpp | 3 --- src/driver/audiodec/ffmpegdec.cpp | 1 - src/driver/fontrenderer.cpp | 1 - src/eitd/edvbstring.cpp | 2 +- src/gui/channellist.cpp | 2 +- src/gui/components/cc_frm_chain.cpp | 8 ++------ src/gui/components/cc_frm_scrollbar.cpp | 4 ++-- src/gui/epgplus.cpp | 3 +-- src/gui/infoviewer.cpp | 3 ++- src/gui/lua/lua_hintbox.cpp | 1 - src/gui/motorcontrol.cpp | 2 +- src/gui/moviebrowser.cpp | 8 ++++---- src/gui/movieplayer.cpp | 1 - src/gui/osd_setup.cpp | 1 - src/gui/update.cpp | 2 +- src/gui/widget/hintboxext.cpp | 8 ++------ src/gui/widget/menue.cpp | 5 ++--- src/gui/widget/stringinput_ext.cpp | 1 - src/zapit/src/getservices.cpp | 1 - 19 files changed, 19 insertions(+), 38 deletions(-) diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index ff37178cd..a0f061202 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -276,9 +276,6 @@ static void* reader_thread(void * /*arg*/) sub_debug.print(Debug::VERBOSE, "%s changed to pid 0x%x\n", __FUNCTION__, dvbsub_pid); } - len = 0; - count = 0; - len = dmx->Read(tmp, 6, 1000); if(len <= 0) continue; diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index ddcb58c26..a4eb905c1 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -297,7 +297,6 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, seek_flags = 0; } av_seek_frame(avc, best_stream, pts, seek_flags); - skip = 0; // if a custom value was set we only jump once if (actSecsToSkip != 0) { *state=PLAY; diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index bf7d4023d..29a42be01 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -365,7 +365,6 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on text++; if (((*text) & 0xc0) != 0x80) { - remaining_unicode_length = -1; return -1; // incomplete or corrupted character } unicode_value <<= 6; diff --git a/src/eitd/edvbstring.cpp b/src/eitd/edvbstring.cpp index cfe9a90ee..0e29d0456 100644 --- a/src/eitd/edvbstring.cpp +++ b/src/eitd/edvbstring.cpp @@ -2060,7 +2060,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) } case 0x11:// Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode) table = 65; - tsidonid = 0; +// tsidonid = 0; ++i; break; case 0x12: diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ccc3dce1e..0ac572d00 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1371,7 +1371,7 @@ CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl) if(sl >= (*chanlist).size()) sl = (*chanlist).size()-1; - CZapitChannel* channel = (*chanlist)[sl]; + CZapitChannel* channel = NULL; int bsize = bouquetList->Bouquets.size(); int bactive = bouquetList->getActiveBouquetNumber(); diff --git a/src/gui/components/cc_frm_chain.cpp b/src/gui/components/cc_frm_chain.cpp index c6e666fe1..4910e469c 100644 --- a/src/gui/components/cc_frm_chain.cpp +++ b/src/gui/components/cc_frm_chain.cpp @@ -81,17 +81,13 @@ void CComponentsFrmChain::setDirection(int direction) void CComponentsFrmChain::initChainItems() { - //init required dimensions, preferred are current width and height - int w_tmp = width; - int h_tmp = height; - //exit if no item available if (v_cc_items.empty()) return; //set new values - w_tmp = append_x_offset; - h_tmp = append_y_offset; + int w_tmp = append_x_offset; + int h_tmp = append_y_offset; for (size_t i= 0; i< v_cc_items.size(); i++){ int x_item = v_cc_items[i]->getXPos(); diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 62dc7cffc..37a29c84d 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -128,7 +128,7 @@ void CComponentsScrollBar::initSegments() { //init dimensions for segments int w_seg = width - 4*fr_thickness; - int h_seg = height - (sb_segments_count-1)*append_y_offset; +//never read int h_seg = height - (sb_segments_count-1)*append_y_offset; //calculate height of segment container int h_seg_obj = height - 2*sb_up_obj->getHeight() - 3*append_y_offset; @@ -149,7 +149,7 @@ void CComponentsScrollBar::initSegments() //set y position of 1st segment and set height of segments int y_seg = 1+ append_y_offset; - h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; + int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; //create and add segments to segment container for(u_int8_t i=0; igetEventsServiceKey(channel->getEpgID(), channelEventList); //printf("channelEventList size %d\n", channelEventList.size()); - int xPosEventEntry = this->eventsTableX; int widthEventEntry = 0; time_t lastEndTime = this->startTime; @@ -601,7 +600,7 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) channelEntry->channelEventEntries.push_back (channelEventEntry); } // correct position - xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration; + int xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration; // correct width widthEventEntry = ((It->duration + startTimeDiff + endTimeDiff) * this->eventsTableWidth) / this->duration + 1; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e5e1004df..f0f52151c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -384,10 +384,11 @@ void CInfoViewer::showRecordIcon (const bool show) void CInfoViewer::paintBackground(int col_NumBox) { int c_rad_mid = RADIUS_MID; +#if 0 // kill left side int BoxEndInfoY = BoxEndY; if (showButtonBar) // add button bar and blinkenlights BoxEndInfoY += infoViewerBB->InfoHeightY_Info + infoViewerBB->bottom_bar_offset; -#if 0 // kill left side + frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY + ChanHeight - 6, BoxStartX + ChanWidth / 3, diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 14c7489b2..4cee2bbbb 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -156,7 +156,6 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) D->b->scroll_down(); } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if (msg == CRCInput::RC_mode) { - res = messages_return::handled; break; } else if ((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { res = messages_return::cancel_all; diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 49604e0a3..d10cdfbb5 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -138,7 +138,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) TP.feparams.polarization = scansettings.sat_TP_pol; TP.feparams.delsys = (delivery_system_t) scansettings.sat_TP_delsys; TP.feparams.modulation = (fe_modulation_t) scansettings.sat_TP_mod; - + TP.TP_id = 0; g_Zapit->tune_TP(TP); paintHead(); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 5d59f9015..71729f51e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1363,13 +1363,13 @@ void CMovieBrowser::refreshMovieInfo(void) flogo_h = m_cBoxFrameInfo.iHeight*90/100; } - static int logo_w = 0; - static int logo_h = 0; +// static int logo_w = 0; +// static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); - int lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; - int ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; + int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; + int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = 104; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f6017d99f..6842cb732 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -837,7 +837,6 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi if (haveurl) { streamList.push_back(info); } - haveurl = false; } /* sort streamlist */ std::sort(streamList.begin(), streamList.end(), sortStreamList); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 66538b57a..276302e5d 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -274,7 +274,6 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); if ( msg == CRCInput::RC_ok ) { - loop = false; memset(window_size_value, 0, sizeof(window_size_value)); snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height); mfWindowSize->setOption(window_size_value); diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 7853e338c..34923644e 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -474,7 +474,7 @@ printf("[update] mode is %d\n", softupdate_mode); } strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION)); - msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; +//never read msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; } return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 } diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index 11ac55675..ac4f881ab 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -47,9 +47,7 @@ CHintBoxExt::CHintBoxExt(const neutrino_locale_t Caption, const char * const Tex { m_message = strdup(Text); - char *begin = m_message; - - begin = strtok(m_message, "\n"); + char *begin = strtok(m_message, "\n"); while (begin != NULL) { std::vector oneLine; @@ -67,9 +65,7 @@ CHintBoxExt::CHintBoxExt(const std::string &CaptionString, const char * const Te { m_message = strdup(Text); - char *begin = m_message; - - begin = strtok(m_message, "\n"); + char *begin = strtok(m_message, "\n"); while (begin != NULL) { std::vector oneLine; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d2c36c0f6..64baaca59 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -379,7 +379,7 @@ void CMenuItem::paintItemButton(const bool select_mode, int item_height, const c if (icon_w>0 && icon_h>0) { - icon_painted = frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); + frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); } } } @@ -1996,12 +1996,11 @@ int CMenuOptionChooser::paint( bool selected) int CMenuOptionChooser::getWidth(void) { - int ow = 0; int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); int width = tw; for(unsigned int count = 0; count < options.size(); count++) { - ow = 0; + int ow = 0; if (options[count].valname) ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(options[count].valname); else diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index bf2a51972..d95d07681 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -310,7 +310,6 @@ void CExtendedInput::paint() tmp_y += iheight; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT); } - tmp_y += offset; } for(unsigned int i=0; iflags = flags; channel->scrambled = scrambled; channel->polarization = polarization; - service_type = channel->getServiceType(); if(pmtpid != 0 && (((channel->getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) && (apid > 0)) || ( (channel->getServiceType() == ST_DIGITAL_TELEVISION_SERVICE) && (vpid > 0) && (apid > 0))) ) { DBG("[getserv] preset chan %s vpid %X sid %X tpid %X onid %X\n", name.c_str(), vpid, service_id, transport_stream_id, transport_stream_id); From 52d3483e782a591d08c39e08524cd8de58dabf84 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 24 Apr 2016 13:22:38 +0200 Subject: [PATCH 350/690] Fix first paint mute icon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/46659ddaf073e7cb59b313f19971bb202141c6cc Author: Michael Liebmann Date: 2016-04-24 (Sun, 24 Apr 2016) --- src/driver/framebuffer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index d02149ce0..e7c7ad682 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -2167,6 +2167,8 @@ bool CFrameBuffer::_checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) if (v_fbarea.empty()) return true; + static bool firstMutePaint = true; + for (unsigned int i = 0; i < v_fbarea.size(); i++) { int ret = checkFbAreaElement(_x, _y, _dx, _dy, &v_fbarea[i]); if (ret == FB_PAINTAREA_MATCH_OK) { @@ -2176,10 +2178,14 @@ bool CFrameBuffer::_checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) break; // waitForIdle(); fb_no_check = true; - if (prev) + if (prev) { + firstMutePaint = false; CAudioMute::getInstance()->hide(); - else - CAudioMute::getInstance()->paint(); + } + else { + if (!firstMutePaint) + CAudioMute::getInstance()->paint(); + } fb_no_check = false; break; default: From 7211a3e7fa8917d6a7b1f1f43bea39b320193151 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 24 Apr 2016 19:35:32 +0200 Subject: [PATCH 351/690] CLuaInstance: Fix compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/10f17ad5ee7ecaa7949ed96ff684f09dcb825d61 Author: Michael Liebmann Date: 2016-04-24 (Sun, 24 Apr 2016) --- src/gui/lua/lua_threads.cpp | 2 +- src/gui/lua/lua_threads_functions.cpp | 2 +- src/gui/lua/luainstance.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_threads.cpp b/src/gui/lua/lua_threads.cpp index c4f7fdee3..6a63c8bd5 100644 --- a/src/gui/lua/lua_threads.cpp +++ b/src/gui/lua/lua_threads.cpp @@ -174,7 +174,7 @@ llthread_t *CLLThread::llthread_create(lua_State *L, const char *code, size_t co /* non-string error message. */ lua_pushfstring(L, "luaL_loadbuffer() failed to load Lua code: rc=%d", rc); } - /* llthread_destroy(_this); */ + llthread_destroy(_this); lua_error(L); return NULL; } diff --git a/src/gui/lua/lua_threads_functions.cpp b/src/gui/lua/lua_threads_functions.cpp index 3d8f210cc..ac8df53fb 100644 --- a/src/gui/lua/lua_threads_functions.cpp +++ b/src/gui/lua/lua_threads_functions.cpp @@ -263,7 +263,7 @@ int CLLThread::l_llthread_delete(lua_State *L) { llthread_t **pthis = (llthread_t **)luaL_checkudata(L, 1, LLTHREAD_TAG); luaL_argcheck (L, pthis != NULL, 1, "thread expected"); - if (*pthis == NULL) return 0; + if (pthis == NULL || *pthis == NULL) return 0; llthread_destroy(*pthis); *pthis = NULL; diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 3a7f44ab3..6c7516e4a 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -625,8 +625,10 @@ CLuaData *CLuaInstance::CheckData(lua_State *L, int narg) { luaL_checktype(L, narg, LUA_TUSERDATA); void *ud = luaL_checkudata(L, narg, className); - if (!ud) + if (!ud) { fprintf(stderr, "[CLuaInstance::%s] wrong type %p, %d, %s\n", __func__, L, narg, className); + return NULL; + } return *(CLuaData **)ud; // unbox pointer } From f5932d9cd840979ca60a7c1f8e7d97b16ad5614c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 25 Apr 2016 10:26:32 +0200 Subject: [PATCH 352/690] CComponentsTimer: rework timer class Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4904279fd5f3c4336053b1d4b34fcb10d0e867a3 Author: Thilo Graf Date: 2016-04-25 (Mon, 25 Apr 2016) --- src/gui/components/cc_frm_clock.cpp | 6 +- src/gui/components/cc_frm_clock.h | 2 +- src/gui/components/cc_timer.cpp | 105 ++++++++++++++++++---------- src/gui/components/cc_timer.h | 90 +++++++++++++++++++----- src/gui/test_menu.cpp | 2 +- 5 files changed, 144 insertions(+), 61 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 391823c3e..7a36db280 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -316,15 +316,15 @@ bool CComponentsFrmClock::startClock() } if (cl_timer == NULL){ - cl_timer = new CComponentsTimer(); + cl_timer = new CComponentsTimer(0); if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); cl_timer->OnTimer.connect(cl_sl); } } - cl_timer->setTimerIntervall(cl_interval); + cl_timer->setTimerInterval(cl_interval); - if (cl_timer->isRun()) + if (cl_timer->startTimer()) return true; return false; diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index bb9ca186e..b91d2454b 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -147,7 +147,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///returns true, if clock is running virtual bool isRun() const {return cl_timer ? true : false;}; ///set refresh interval in seconds, default value=1 (=1 sec) - virtual void setClockIntervall(const int& seconds){cl_interval = seconds;}; + virtual void setClockInterval(const int& seconds){cl_interval = seconds;}; ///show clock on screen virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index 129f19dbc..966d0bcc2 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Generic Timer. - Copyright (C) 2013, Thilo Graf 'dbt' + Copyright (C) 2013-2016, Thilo Graf 'dbt' License: GPL @@ -36,66 +36,72 @@ using namespace std; -CComponentsTimer::CComponentsTimer( const int& interval) +CComponentsTimer::CComponentsTimer(const int& interval) { tm_thread = 0; - tm_interval = interval; + tm_interval = interval; + + sl_stop_timer = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); - sl = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); if (interval > 0) startTimer(); } CComponentsTimer::~CComponentsTimer() { - if (stopTimer()) - dprintf(DEBUG_INFO,"[CComponentsTimer] [%s] timer stopped\n", __func__); + stopTimer(); +} + +void CComponentsTimer::runSharedTimerAction() +{ + //start loop + + while(tm_enable && tm_interval > 0) { + tm_mutex.lock(); + OnTimer(); + mySleep(tm_interval); + tm_mutex.unlock(); + } + + if (tm_thread) + stopThread(); } //thread handle -void* CComponentsTimer::initTimerThread(void *arg) +void* CComponentsTimer::initThreadAction(void *arg) { CComponentsTimer *timer = static_cast(arg); - //start loop - while(timer) { - timer->mutex.lock(); - timer->OnTimer(); - timer->mutex.unlock(); - mySleep(timer->tm_interval); - } + timer->runSharedTimerAction(); return 0; } //start up running timer with own thread, return true on succses -bool CComponentsTimer::startTimer() +void CComponentsTimer::initThread() { - void *ptr = static_cast(this); - - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); + if (!tm_enable) + return; if(!tm_thread) { - int res = pthread_create (&tm_thread, NULL, initTimerThread, ptr) ; + void *ptr = static_cast(this); + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); + pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); + + int res = pthread_create (&tm_thread, NULL, initThreadAction, ptr); + if (res != 0){ dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); - return false; - } - if (res == 0){ - if (!sl.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s - %d] timer thread [%lu] created with interval = %d\033[0m\n", __func__, __LINE__, pthread_self(), tm_interval); - CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl); - } - }else{ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); + return; } + + if (res == 0) + CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl_stop_timer); } - return true; } -//stop ticking timer and kill thread, return true on succses -bool CComponentsTimer::stopTimer() +void CComponentsTimer::stopThread() { if(tm_thread) { int thres = pthread_cancel(tm_thread); @@ -109,14 +115,37 @@ bool CComponentsTimer::stopTimer() if (thres == 0){ tm_thread = 0; - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s] timer thread terminated ...\033[0m\n", __func__); //ensure disconnect of unused slot - if (!sl.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer][%s] disconnect timer slot ...\033[0m\n", __func__); - sl.disconnect(); - } - return true; + while (!sl_stop_timer.empty()) + sl_stop_timer.disconnect(); } } +} + +bool CComponentsTimer::startTimer() +{ + tm_enable = true; + initThread(); + if(tm_thread) + return true; + return false; } + +bool CComponentsTimer::stopTimer() +{ + tm_enable = false; + stopThread(); + if(tm_thread == 0) + return true; + + return false; +} + +void CComponentsTimer::setTimerInterval(const int& seconds) +{ + if (tm_interval == seconds) + return; + + tm_interval = seconds; +} diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index 321a0b184..a653889c3 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -34,42 +34,96 @@ #include #include -//! Member of CComponents. Provides a generic timer class -/*! - +/**CComponentsTimer +* Member of CComponents. Provides a generic timer class +* @see +* CComponentsTimer() */ - class CComponentsTimer : public sigc::trackable { private: ///thread pthread_t tm_thread; + ///refresh interval in seconds int tm_interval; - ///init function to start timer in own thread - static void* initTimerThread(void *arg); - ///mutex for timer - OpenThreads::Mutex mutex; - ///slot for signals - sigc::slot0 sl; + ///init function to init shared timer action + static void* initThreadAction(void *arg); + + ///init function to start/stop timer in own thread + void initThread(); + void stopThread(); + + ///runs shared timer action provided inside OnTimer() signal + void runSharedTimerAction(); + + ///flag to control thread state + bool tm_enable; + + ///mutex for timer + OpenThreads::Mutex tm_mutex; + ///slot for restart signals + sigc::slot0 sl_stop_timer; public: - ///class constructor, parameter interval sets the interval in seconds, default value=1 (1 sec) + /**Constructor for timer class + * + * @param[in] interval + * @li int interval in seconds, default value=1 (1 sec) + * If init value for interval > 0, timer starts immediately + * @see + * setTimerInterval(); + */ CComponentsTimer(const int& interval = 1); ~CComponentsTimer(); - ///start timer thread, returns true on success, if false causes log output + /**Starts timer thread + * @return + * bool + * returns true, if timer is running in thread + * @see + * stopTimer() + */ bool startTimer(); - ///stop timer thread, returns true on success, if false causes log output + + /**Stops timer thread + * @return + * bool + * returns true, if timer thread stopped + * @see + * startTimer() + */ bool stopTimer(); - ///returns true, if timer is running in thread + /**get current timer status + * @return + * bool + * returns true, if timer is running in thread + * @see + * startTimer() + * stopTimer() + */ bool isRun() const {return tm_thread;}; - ///set another interval in seconds - void setTimerIntervall(const int& seconds){tm_interval = seconds;}; - ///signal for timer event, use this in your class where ever you need time controled actions - ///for more details see also CComponentsSignals for similar handlings + /**set interval in seconds + * @param[in] seconds + * @li int + * @return + * void + * @see + * tm_interval + */ + void setTimerInterval(const int& seconds); + + /**Provides a signal handler to receive any function or methode. + * Use this in your class where ever you need time controled actions. + * + * @param[in] seconds + * @li int + * @see + * CComponentsSignals for similar handlings. + * CComponentsFrmClock::startClock() + */ sigc::signal OnTimer; }; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index e3690d791..b9116d6f2 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -679,7 +679,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (clock_r == NULL){ clock_r = new CComponentsFrmClock(100, 50, NULL, "%H.%M:%S", NULL, true); clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); - clock_r->setClockIntervall(1); + clock_r->setClockInterval(1); // clock_r->doPaintBg(false); } From ab87ecabe74e1654d3a91e55f865f81de1f50159 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 25 Apr 2016 15:41:06 +0200 Subject: [PATCH 353/690] fix memleak Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f371cc9181d598c5ca5f280a0f6787e5adb2751 Author: Jacek Jendrzej Date: 2016-04-25 (Mon, 25 Apr 2016) --- src/driver/rcinput.cpp | 1 + src/gui/scan_setup.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 65856a9fe..a7d0fafa0 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1181,6 +1181,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 switch (emsg.eventID) { case NeutrinoMessages::EVT_CURRENTEPG: case NeutrinoMessages::EVT_NEXTEPG: + case NeutrinoMessages::EVT_NOEPG_YET: { CSectionsdClient::CurrentNextInfo *cn = (CSectionsdClient::CurrentNextInfo *) p; delete [] cn; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index e2c05c29b..5ad95d794 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1985,6 +1985,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) std::string text = "No transponders found for "; text += name; ShowHint(LOCALE_MESSAGEBOX_ERROR, text.c_str(), 450, 2); + delete selector; return menu_return::RETURN_REPAINT; } From a404fca5c1e55441fe9307b6a91148e297fc3986 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 26 Apr 2016 09:32:09 +0200 Subject: [PATCH 354/690] CAudioMute: remove explicit paint Already done by InfoClock itself with timer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a94916f2db2900cf65240f4352c05ea18484bfd5 Author: Thilo Graf Date: 2016-04-26 (Tue, 26 Apr 2016) --- src/gui/audiomute.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index 2b26a5d9f..fbc68e88e 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -84,7 +84,6 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) */ if (!CInfoClock::getInstance()->isBlocked()){ CInfoClock::getInstance()->ClearDisplay(); - CInfoClock::getInstance()->paint();//avoids delay } frameBuffer->fbNoCheck(true); @@ -98,7 +97,6 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) CInfoClock::getInstance()->ClearDisplay(); this->kill(); clearSavedScreen(); - CInfoClock::getInstance()->paint();//avoids delay }else this->hide(); frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); From 301046f96381fa02f0157171d6bfacb3edc1db1e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 26 Apr 2016 12:02:49 +0200 Subject: [PATCH 355/690] CSignalBar: unified var init inside constructors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e61a4e46c0ed0929046000ad469c98fd3728559c Author: Thilo Graf Date: 2016-04-26 (Tue, 26 Apr 2016) --- src/gui/components/cc_frm_signalbars.cpp | 57 +++++++++++------------- src/gui/components/cc_frm_signalbars.h | 2 +- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 27061c8b8..b091a704f 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -40,17 +40,37 @@ using namespace std; CSignalBar::CSignalBar(CComponentsForm *parent) { - initVarSigBar(); - sb_name = "SIG"; - - initDimensions(); - initSBItems(); - initParent(parent); + initVarSigBar(0, 0, 100, SB_MIN_HEIGHT, NULL, "SIG", parent); } CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const string& sbname, CComponentsForm *parent) { - initVarSigBar(); + initVarSigBar(xpos, ypos, w, h, frontend_ref, sbname, parent); +} + +void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sbname, CComponentsForm *parent) +{ + cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; + + corner_rad = 0; + corner_type = 0; + append_x_offset = 2; + append_y_offset = 2; + + sb_scale_height = -1; + dy_font = CNeutrinoFonts::getInstance(); + + sb_caption_color= COL_INFOBAR_TEXT; + sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT; + + sb_lastsig = 0; + sb_signal = 0; + + sb_frontend = NULL; + sb_scale = NULL; + sb_vlbl = NULL; + sb_lbl = NULL; + sb_frontend = frontend_ref; x = xpos; y = ypos; @@ -99,29 +119,6 @@ void CSignalBar::initSBItems() initSBarName(); } -void CSignalBar::initVarSigBar() -{ - corner_rad = 0; - corner_type = 0; - append_x_offset = 2; - append_y_offset = 2; - height = SB_MIN_HEIGHT; - cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; - sb_scale_height = -1; - dy_font = CNeutrinoFonts::getInstance(); - - sb_caption_color= COL_INFOBAR_TEXT; - sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT; - - sb_lastsig = 0; - sb_signal = 0; - - sb_frontend = NULL; - sb_scale = NULL; - sb_vlbl = NULL; - sb_lbl = NULL; -} - void CSignalBar::initSBarScale() { //create scale object if required diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 216b221af..be9ade31c 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -91,7 +91,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen uint16_t sb_signal; ///initialize all needed basich attributes and objects - void initVarSigBar(); + void initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name, CComponentsForm *parent); ///initianlize position and dimensions of signalbar container void initDimensions(); ///initialize scale object From c936d09ec41d670218a99a39bba20df7cc961645 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 26 Apr 2016 19:38:24 +0200 Subject: [PATCH 356/690] src/driver/rcinput.cpp revert (not sure) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3b33d1ef387c3cb3dee584b44ebc5cb7a503758b Author: Jacek Jendrzej Date: 2016-04-26 (Tue, 26 Apr 2016) --- src/driver/rcinput.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index a7d0fafa0..65856a9fe 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1181,7 +1181,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 switch (emsg.eventID) { case NeutrinoMessages::EVT_CURRENTEPG: case NeutrinoMessages::EVT_NEXTEPG: - case NeutrinoMessages::EVT_NOEPG_YET: { CSectionsdClient::CurrentNextInfo *cn = (CSectionsdClient::CurrentNextInfo *) p; delete [] cn; From f3f69bb8ce2945d957ba1d2dc526f0a7796dec39 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 26 Apr 2016 19:39:43 +0200 Subject: [PATCH 357/690] some nver read compil fixes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a98ee851e15b642883fbff0d44692fbb12bb183 Author: Jacek Jendrzej Date: 2016-04-26 (Tue, 26 Apr 2016) --- src/gui/movieplayer.cpp | 2 +- src/neutrino.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 6842cb732..f6576ed0e 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -576,7 +576,7 @@ bool CMoviePlayerGui::SelectFile() if (moviebrowser->getSelectedFiles(filelist, milist)) { filelist_it = filelist.begin(); p_movie_info = *(milist.begin()); - file = &(*filelist_it); +// file = &(*filelist_it); } else if ((file = moviebrowser->getSelectedFile()) != NULL) { p_movie_info = moviebrowser->getCurrentMovieInfo(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 2cc5de6d2..7475b55a6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4727,12 +4727,11 @@ void CNeutrinoApp::migrateConfig(const char *fname) migconf.loadConfig(fname); /* here we do a simple rename of config file keys */ int magic = -424242; /* obviously a value that does not appear in real cases */ - int tmp = magic; int i; for (i = 0; key_rename[i].from != NULL; i++) { const char *from = key_rename[i].from; const char *to = key_rename[i].to; - tmp = migconf.getInt32(from, magic); + int tmp = migconf.getInt32(from, magic); if (tmp == magic) /* old key does not exist */ continue; /* only set new key to old value if the new key does not yet exist */ From 726912412c77e8a76cb997c4f90983bec2a63206 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 30 Apr 2016 18:57:49 +0200 Subject: [PATCH 358/690] Update LUA_WIKI urls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ad7e63692001662ae99136a6c8ab84e0bbb3aeb Author: Michael Liebmann Date: 2016-04-30 (Sat, 30 Apr 2016) --- src/gui/lua/luainstance_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/luainstance_helpers.h b/src/gui/lua/luainstance_helpers.h index 5b6dfb141..cf6b9ba30 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -31,8 +31,8 @@ #define LUA_CURL_CLASSNAME "curl" #define LUA_HEADER_CLASSNAME "header" -//#define LUA_WIKI "http://wiki.tuxbox.org/....." -#define LUA_WIKI "https://slknet.de/wiki/w" +#define LUA_WIKI "https://wiki.neutrino-hd.de/wiki" +//#define LUA_WIKI "https://wiki.slknet.de/wiki" /* the magic color that tells us we are using one of the palette colors */ #define MAGIC_COLOR 0x42424200 From 5c80402d366fce83a47519b1c759a5736646a50a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 30 Apr 2016 19:01:30 +0200 Subject: [PATCH 359/690] CLuaInstVideo::VideoCheckData(): Fix segfault when invalid parameter is passed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec2afe52a95c370a0951a71a8f3d507ffa71e8f3 Author: Michael Liebmann Date: 2016-04-30 (Sat, 30 Apr 2016) --- src/gui/lua/lua_video.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index 627cb94af..74f1586cc 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -48,7 +48,11 @@ CLuaInstVideo* CLuaInstVideo::getInstance() CLuaVideo *CLuaInstVideo::VideoCheckData(lua_State *L, int n) { - return *(CLuaVideo **) luaL_checkudata(L, n, LUA_VIDEO_CLASSNAME); + void* ret = luaL_testudata(L, n, LUA_VIDEO_CLASSNAME); + if (ret == NULL) + return NULL; + else + return *(CLuaVideo **) ret; } void CLuaInstVideo::LuaVideoRegister(lua_State *L) From 20f0b4b37858b283b17068acd7560933954b8b2c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 4 May 2016 15:55:57 +0200 Subject: [PATCH 360/690] src/gui/widget/messagebox.cpp fix egfault if Text after call is deleted (lua script error) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d7c22cff06699541efeb00af8998e118b86d784 Author: Jacek Jendrzej Date: 2016-05-04 (Wed, 04 May 2016) --- src/gui/widget/messagebox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 835ff9e20..21319d493 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -289,7 +289,8 @@ int CMessageBox::exec(int timeout) int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); + std::string tmpText = Text; + CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); int res = messageBox->result; @@ -300,7 +301,8 @@ int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMes int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); + std::string tmpText = Text; + CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); int res = messageBox->result; From b76ddb5ea760e590db560c5c483ec6eadb1928aa Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 4 May 2016 16:05:17 +0200 Subject: [PATCH 361/690] src/driver/neutrinofonts.cpp add cache for dynSize Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4ec5589c5497d401e97978a29746aa695848d8b9 Author: Jacek Jendrzej Date: 2016-05-04 (Wed, 04 May 2016) --- src/driver/neutrinofonts.cpp | 45 +++++++++++++++++++++++++++++++----- src/driver/neutrinofonts.h | 10 ++++++++ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 4dc538f65..ae69f117d 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -102,7 +102,9 @@ CNeutrinoFonts::~CNeutrinoFonts() delete v_dyn_fonts[i].font; v_dyn_fonts.clear(); } - + if (!vDynSize.empty()) { + vDynSize.clear(); + } deleteDynFontExtAll(); } @@ -124,6 +126,9 @@ void CNeutrinoFonts::SetupDynamicFonts(bool initRenderClass/*=true*/) dynFontStyle[0] = g_dynFontRenderer->AddFont(fontDescr.filename.c_str()); fontDescr.name = g_dynFontRenderer->getFamily(fontDescr.filename.c_str()); + if (!vDynSize.empty()) { + vDynSize.clear(); + } dprintf(DEBUG_NORMAL, "[CNeutrinoFonts] [%s - %d] dynamic font family: %s\n", __func__, __LINE__, fontDescr.name.c_str()); dynFontStyle[1] = "Bold Regular"; @@ -161,6 +166,9 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) old_fontDescr.name = fontDescr.name; fontDescr.name = ""; fontDescr.name = g_fontRenderer->getFamily(fontDescr.filename.c_str()); + if (!vDynSize.empty()) { + vDynSize.clear(); + } dprintf(DEBUG_NORMAL, "[CNeutrinoFonts] [%s - %d] standard font family: %s\n", __func__, __LINE__, fontDescr.name.c_str()); fontStyle[1] = "Bold Regular"; @@ -233,11 +241,22 @@ int CNeutrinoFonts::getFontHeight(Font* fnt) int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) { - Font *dynFont = NULL; - int dynSize = 8; - bool dynFlag = false; - + int dynSize = dy/1.6; if (dx == 0) dx = 1280; + + if (!vDynSize.empty()) { + for (size_t i = 0; i < vDynSize.size(); i++) { + if ((vDynSize[i].dy == dy) && + (vDynSize[i].dx == dx) && + (vDynSize[i].style == style) && + (vDynSize[i].text == text)) { + dynSize = vDynSize[i].dynsize; + return dynSize; + } + } + } + Font *dynFont = NULL; + bool dynFlag = false; while (1) { if (dynFont) delete dynFont; @@ -264,9 +283,23 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) break; } - if (dynFont) + if (dynFont){ delete dynFont; + if (!vDynSize.empty() && vDynSize.size() > 99) { + vDynSize.clear(); + } + if(dynSize){ + dyn_size_t v; + v.dx = dx; + v.dy = dy; + v.dynsize = dynSize; + v.style = style; + v.text = text; + vDynSize.push_back(v); + } + } + return dynSize; } diff --git a/src/driver/neutrinofonts.h b/src/driver/neutrinofonts.h index 6073f0dba..965b89f8f 100644 --- a/src/driver/neutrinofonts.h +++ b/src/driver/neutrinofonts.h @@ -55,6 +55,16 @@ class CNeutrinoFonts private: std::string fontStyle[3]; std::string dynFontStyle[3]; + typedef struct dyn_size_t + { + int dx; + int dy; + int dynsize; + int style; + std::string text; + } dyn_size_struct_t; + typedef std::vector v_dyn_size_t; + v_dyn_size_t vDynSize; typedef struct dyn_font_t { From 85b1b23b90e7b95b8c5a844ceaec0ea75179f58c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 26 Apr 2016 14:49:17 +0200 Subject: [PATCH 362/690] CSignalBar: remove dub init Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/358b46cfa5d66db631be23d1b2cc8124facc623d Author: Thilo Graf Date: 2016-04-26 (Tue, 26 Apr 2016) --- src/gui/components/cc_frm_signalbars.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index b091a704f..ccef5a4af 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -66,7 +66,6 @@ void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, c sb_lastsig = 0; sb_signal = 0; - sb_frontend = NULL; sb_scale = NULL; sb_vlbl = NULL; sb_lbl = NULL; From 35ca18beeef93bda778316ca55eb256cbace8d84 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 7 May 2016 22:32:25 +0200 Subject: [PATCH 363/690] CScreenSaver: use common time format Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7091383170bab9d8598aa3e14513aae9fcc03a65 Author: Thilo Graf Date: 2016-05-07 (Sat, 07 May 2016) --- src/gui/screensaver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 05c7396e5..e84c52144 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -269,7 +269,7 @@ void CScreenSaver::paint() } else{ if (!scr_clock){ - scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true); + scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); scr_clock->disableSaveBg(); scr_clock->doPaintBg(false); From 4d571895b6fc063770b9682ffde7fda445aef323 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 10 May 2016 14:00:37 +0200 Subject: [PATCH 364/690] add epg remaping Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c416cf1c318396d66d1233e4a45f48262787e380 Author: Jacek Jendrzej Date: 2016-05-10 (Tue, 10 May 2016) --- data/epgmap.xml | 19 +++++++++++ src/zapit/include/zapit/bouquets.h | 5 ++- src/zapit/include/zapit/channel.h | 1 + src/zapit/src/bouquets.cpp | 55 ++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 data/epgmap.xml diff --git a/data/epgmap.xml b/data/epgmap.xml new file mode 100644 index 000000000..49cead598 --- /dev/null +++ b/data/epgmap.xml @@ -0,0 +1,19 @@ + + + + --rai1 + --rai1 + + --rai2 + --rai2 + + --rai3 + --rai3 + + --rai4 + + --raisport1 + --rainews24 + + --Das Erste + diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h index 007133a45..6c885a562 100644 --- a/src/zapit/include/zapit/bouquets.h +++ b/src/zapit/include/zapit/bouquets.h @@ -98,7 +98,10 @@ class CBouquetManager void writeBouquetChannels (FILE * bouq_fd, uint32_t i, bool bUser = false); void writeChannels(FILE * bouq_fd, ZapitChannelList &list, bool bUser); void writeBouquet(FILE * bouq_fd, uint32_t i, bool bUser); - + //remap epg_id + std::map EpgIDMapping; + void readEPGMapping(); + t_channel_id reMapEpgID(t_channel_id channelid); public: CBouquetManager() { remainChannels = NULL; }; ~CBouquetManager(); diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index de156827a..834873afa 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -290,6 +290,7 @@ class CZapitChannel }; bool Locked() { return (bLocked || !!bLockCount); } t_channel_id getEpgID(void) const { return epg_id; } + void setEPGid(t_channel_id pEPGid) { epg_id = pEPGid; } //remap epg_id }; struct CmpChannelBySat: public std::binary_function diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 38b1d529b..271751cd0 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -387,6 +387,10 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) xmlNodePtr channel_node; if (search) { + if(!bUser){ + readEPGMapping(); + } + t_original_network_id original_network_id; t_service_id service_id; t_transport_stream_id transport_stream_id; @@ -448,6 +452,10 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) chan->pname = (char *) newBouquet->Name.c_str(); chan->bLocked = clock; chan->bUseCI = newBouquet->bUseCI; + //remapinng epg_id + t_channel_id new_epgid = reMapEpgID(chan->getChannelID()); + if(new_epgid) + chan->setEPGid(new_epgid); newBouquet->addService(chan); } else if (bUser) { @@ -483,6 +491,9 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) search = xmlNextNode(search); } INFO("total: %d bouquets", (int)Bouquets.size()); + if(!bUser && !EpgIDMapping.empty()){ + EpgIDMapping.clear(); + } } xmlFreeDoc(parser); } @@ -929,3 +940,47 @@ int CBouquetManager::ChannelIterator::getNrofFirstChannelofBouquet(const unsigne return i; } + +t_channel_id CBouquetManager::reMapEpgID(t_channel_id channelid) +{ + if(!EpgIDMapping.empty()){ + std::map::iterator it = EpgIDMapping.find(channelid); + if ( it != EpgIDMapping.end() ) + return it->second; + } + return 0; +} + +void CBouquetManager::readEPGMapping() +{ + if(!EpgIDMapping.empty()) + EpgIDMapping.clear(); + + const std::string epg_map_dir = CONFIGDIR "/zapit/epgmap.xml"; + xmlDocPtr epgmap_parser = parseXmlFile(epg_map_dir.c_str()); + + if (epgmap_parser != NULL) + { + + xmlNodePtr epgmap = xmlDocGetRootElement(epgmap_parser); + if(epgmap) + epgmap = xmlChildrenNode(epgmap); + + while (epgmap) { + const char *cannelid = xmlGetAttribute(epgmap, "channel_id"); + const char *epgid = xmlGetAttribute(epgmap, "new_epg_id"); + t_channel_id epg_id = 0; + t_channel_id chid = 0; + if (epgid) + epg_id = strtoull(epgid, NULL, 16); + if (cannelid) + chid = strtoull(cannelid, NULL, 16); + if(chid && epg_id){ + EpgIDMapping[chid]=epg_id; + } + + epgmap = xmlNextNode(epgmap); + } + } + xmlFreeDoc(epgmap_parser); +} From 11ff271a192cf1c563f99bd48c4afd8026ef9544 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 11 May 2016 12:52:11 +0200 Subject: [PATCH 365/690] nhttpd use epg id to get events Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/52f4312aefd8070065d229ac86080cc37ca3ba73 Author: Jacek Jendrzej Date: 2016-05-11 (Wed, 11 May 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 11 +++++++++-- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 8 +++++++- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 4 +++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 284663c89..0134b523c 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1478,8 +1478,6 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ { std::string result = ""; std::string channelData = ""; - CChannelEventList eList; - CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), true); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); @@ -1490,6 +1488,15 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ int i = 0; CChannelEventList::iterator eventIterator; bool isFirstLine = true; + + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(epg_id, eList); + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator, i++) { if ((max != -1 && i >= max) || (stoptime != -1 && eventIterator->startTime >= stoptime)) break; diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 82e2100cd..f0a30f604 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -295,7 +295,13 @@ void CNeutrinoAPI::GetChannelEvent(t_channel_id channel_id, CChannelEvent &event { OpenThreads::ScopedPointerLock lock(pmutex); event.eventID = 0; - CChannelEvent * evt = ChannelListEvents[channel_id]; + + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + + CChannelEvent * evt = ChannelListEvents[epg_id]; if (evt) event = *evt; } diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 5066e5698..266363e22 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -524,7 +524,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: else if (event.eventID) { bool has_current_next = true; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); + t_channel_id epg_id = channel->getChannelID(); + epg_id = channel->getEpgID(); + CEitManager::getInstance()->getCurrentNextServiceKey(epg_id, currentNextInfo); timestr = timeString(event.startTime); CShortEPGData epg; From ad4b6a897ac8ea5a26e35f5d76c8c95128436634 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 11 May 2016 13:01:08 +0200 Subject: [PATCH 366/690] nhttpd remove unused Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d139c1c8ddaface3930a07e7a4d05b9e139253e2 Author: Jacek Jendrzej Date: 2016-05-11 (Wed, 11 May 2016) --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 266363e22..0b713d901 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -524,9 +524,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: else if (event.eventID) { bool has_current_next = true; - t_channel_id epg_id = channel->getChannelID(); - epg_id = channel->getEpgID(); - CEitManager::getInstance()->getCurrentNextServiceKey(epg_id, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->getEpgID(), currentNextInfo); timestr = timeString(event.startTime); CShortEPGData epg; From cfb34b2ea8a4bb60f976c47a5ca74d949aed424f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 13 May 2016 19:14:17 +0200 Subject: [PATCH 367/690] fix create-locals-work helper script Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ae264d5039f1ed38681320594d0e36b427844b7 Author: vanhofen Date: 2016-05-13 (Fri, 13 May 2016) Origin message was: ------------------ - fix create-locals-work helper script --- data/locale/helpers/create-locals-work | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/helpers/create-locals-work b/data/locale/helpers/create-locals-work index cb0a755ef..6e1479338 100755 --- a/data/locale/helpers/create-locals-work +++ b/data/locale/helpers/create-locals-work @@ -49,7 +49,7 @@ foreach $term (sort keys %master) { } } -if ($no_errors == 0) {} +if ($no_errors == 0) { unlink($outfilename); } else { print "There were ", $no_errors, " error(s) in ", $localefilename, ".\n"; From fb2f8d9afe2dd890f52af7461b57b630e63fcf8a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 16 May 2016 22:21:06 +0200 Subject: [PATCH 368/690] src/gui/channellist.cpp fix current channel after edit mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6593dcb0649366c8245d143395e8129856042912 Author: Jacek Jendrzej Date: 2016-05-16 (Mon, 16 May 2016) --- src/gui/channellist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 0ac572d00..8129e6488 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1185,7 +1185,8 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) selected_chid = channel->getChannelID(); g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), channel->number, (channel->Locked() == g_settings.parentallock_defaultlocked)); - CNeutrinoApp::getInstance()->adjustToChannelID(channel->getChannelID()); + if(CNeutrinoApp::getInstance()->adjustToChannelID(channel->getChannelID())) + CZapit::getInstance()->SetCurrentChannelID(channel->getChannelID()); } if(new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ From 81b82474e47bf0883b5e8f4097ddd16431da157b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 17 May 2016 09:46:10 +0200 Subject: [PATCH 369/690] Revert "very bad idea src/gui/channellist.cpp fix current channel after edit mode" This reverts commit fb2f8d9afe2dd890f52af7461b57b630e63fcf8a. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0b07edaffe388ae1360ee1dc54b2149d344aea6c Author: Jacek Jendrzej Date: 2016-05-17 (Tue, 17 May 2016) --- src/gui/channellist.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 8129e6488..0ac572d00 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1185,8 +1185,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) selected_chid = channel->getChannelID(); g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), channel->number, (channel->Locked() == g_settings.parentallock_defaultlocked)); - if(CNeutrinoApp::getInstance()->adjustToChannelID(channel->getChannelID())) - CZapit::getInstance()->SetCurrentChannelID(channel->getChannelID()); + CNeutrinoApp::getInstance()->adjustToChannelID(channel->getChannelID()); } if(new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ From 62adf72b7d2ca5b3bf04fc15507c6a31272fe3c2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 17 May 2016 14:11:59 +0200 Subject: [PATCH 370/690] try to fix current channel after edit mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e7e158a2739344ff37849e7f7b025bcbb9eb35db Author: Jacek Jendrzej Date: 2016-05-17 (Tue, 17 May 2016) --- src/neutrino.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7475b55a6..d0377ab1f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2667,7 +2667,9 @@ _repeat: bouquets_changed = false; channels_init = false; - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + t_channel_id live_channel_id = channelList->getActiveChannel_ChannelID(); + if(!live_channel_id) + live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); adjustToChannelID(live_channel_id);//FIXME what if deleted ? delete hintBox; } From 5b9ab4a91bb06012ee0acd4023c818a1410965c6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 19 May 2016 15:22:15 +0200 Subject: [PATCH 371/690] check if string msg is not NULL, fix segfault Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9e8a5741884bd76a44b10807f4612f6fab4183d Author: Jacek Jendrzej Date: 2016-05-19 (Thu, 19 May 2016) --- src/gui/lua/lua_menue.cpp | 30 ++++++++++++++++++++---------- src/gui/lua/lua_video.cpp | 4 +++- src/gui/lua/luainstance.cpp | 12 ++++++++---- src/gui/widget/messagebox.cpp | 8 ++++++-- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/gui/lua/lua_menue.cpp b/src/gui/lua/lua_menue.cpp index 0f3998402..100056ba5 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -56,8 +56,10 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc lua_pushstring(L, optionValue); int status = lua_pcall(L, 2 /* two args */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1): null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0; return (((int)res == menu_return::RETURN_REPAINT) || ((int)res == menu_return::RETURN_EXIT_REPAINT)); @@ -135,8 +137,10 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio lua_pushstring(L, luaId.c_str()); int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } if (lua_isnumber(L, -1)) res = (int) lua_tonumber(L, -1); @@ -179,8 +183,10 @@ int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*acti lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } lua_pop(L, 1); } @@ -222,8 +228,10 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } lua_pop(L, 2); } @@ -260,8 +268,10 @@ int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*a lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } lua_pop(L, 2); } diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index 74f1586cc..c7df7912d 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -221,7 +221,9 @@ bool CLuaInstVideo::execLuaInfoFunc(lua_State *L, int xres, int yres, int aspect lua_getstack(L, 1, &ar); lua_getinfo(L, "Sl", &ar); memset(msg, '\0', sizeof(msg)); - snprintf(msg, sizeof(msg)-1, "[%s:%d] error running function '%s': %s", ar.short_src, ar.currentline, D->infoFunc.c_str(), lua_tostring(L, -1)); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + snprintf(msg, sizeof(msg)-1, "[%s:%d] error running function '%s': %s", ar.short_src, ar.currentline, D->infoFunc.c_str(), isString ? lua_tostring(L, -1):null); fprintf(stderr, "[CLuaInstVideo::%s:%d] %s\n", __func__, __LINE__, msg); DisplayErrorMessage(msg); return false; diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 6c7516e4a..62aca87c7 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -435,8 +435,10 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg /* run the script */ int status = luaL_loadfile(lua, fileName); if (status) { - fprintf(stderr, "[CLuaInstance::%s] Can't load file: %s\n", __func__, lua_tostring(lua, -1)); - DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:"); + bool isString = lua_isstring(lua,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaInstance::%s] Can't load file: %s\n", __func__, isString ? lua_tostring(lua, -1):null); + DisplayErrorMessage(isString ? lua_tostring(lua, -1):null, "Lua Script Error:"); if (error_string) *error_string = std::string(lua_tostring(lua, -1)); return; @@ -466,8 +468,10 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg *result_string = std::string(lua_tostring(lua, -1)); if (status) { - fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, lua_tostring(lua, -1)); - DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:"); + bool isString = lua_isstring(lua,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, isString ? lua_tostring(lua, -1):null); + DisplayErrorMessage(isString ? lua_tostring(lua, -1):null, "Lua Script Error:"); if (error_string) *error_string = std::string(lua_tostring(lua, -1)); /* restoreNeutrino at plugin crash, when blocked from plugin */ diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 21319d493..b506f3cee 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -289,7 +289,9 @@ int CMessageBox::exec(int timeout) int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - std::string tmpText = Text; + std::string tmpText = "msg error"; + if(!Text) + tmpText = Text; CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); @@ -301,7 +303,9 @@ int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMes int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - std::string tmpText = Text; + std::string tmpText = "msg error"; + if(!Text) + tmpText = Text; CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); From 0e2678b648956b7f8d65e497bc3a9f44966f43ca Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 19 May 2016 15:56:49 +0200 Subject: [PATCH 372/690] fix logic check null and add mute to skip Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/89f51df9e7460183d9af7b81cf93d9934a682903 Author: Jacek Jendrzej Date: 2016-05-19 (Thu, 19 May 2016) --- src/gui/widget/messagebox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index b506f3cee..429d55a41 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -271,7 +271,7 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr) ) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) @@ -290,7 +290,7 @@ int CMessageBox::exec(int timeout) int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { std::string tmpText = "msg error"; - if(!Text) + if(Text) tmpText = Text; CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); @@ -304,7 +304,7 @@ int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMes int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { std::string tmpText = "msg error"; - if(!Text) + if(Text) tmpText = Text; CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); From 4202a47a5493f4377a4445906f1e87153de46dd7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 19 May 2016 16:58:38 +0200 Subject: [PATCH 373/690] remove unneeded include of system/lastchannel.h Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2864a8e6de8532065681ae95fd7280d70968140 Author: vanhofen Date: 2016-05-19 (Thu, 19 May 2016) Origin message was: ------------------ - remove unneeded include of system/lastchannel.h --- src/gui/bouquetlist.h | 1 - src/gui/personalize.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 193146b5a..0682242c2 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -37,7 +37,6 @@ #include #include -#include #include #include diff --git a/src/gui/personalize.h b/src/gui/personalize.h index 0ffcb24f9..2a92f6f2b 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -58,7 +58,6 @@ #include #include #include -#include #include class CPlugins; From fbff846e40e3d370e7cfeeffe3ea584591adf554 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 19 May 2016 16:59:56 +0200 Subject: [PATCH 374/690] channellist: add possibility to clear channel history Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ffd0e7225199607836baa25f27898c6b938af845 Author: vanhofen Date: 2016-05-19 (Thu, 19 May 2016) Origin message was: ------------------ - channellist: add possibility to clear channel history --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/channellist.cpp | 23 +++++++++++++++++++---- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index af0342b3b..42fb6169a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -255,6 +255,7 @@ channellist.foot_sort_freq Sortiert[freq] channellist.foot_sort_sat Sortiert[sat] channellist.head Alle Kanäle channellist.history Verlauf +channellist.history_clear Verlauf löschen channellist.keep_numbers Dauerhafte Kanalnummern channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen diff --git a/data/locale/english.locale b/data/locale/english.locale index 9190af6d6..77a3b7a87 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -255,6 +255,7 @@ channellist.foot_sort_freq sorted[freq] channellist.foot_sort_sat sorted[sat] channellist.head All Services channellist.history History +channellist.history_clear Clear history channellist.keep_numbers Persistent channel numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 0ac572d00..428fdb19e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -311,6 +311,7 @@ int CChannelList::doChannelMenu(void) bool empty = (*chanlist).empty(); bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bWebtv); + bool got_history = (CNeutrinoApp::getInstance()->channelList->getLastChannels().size() > 1); int i = 0; snprintf(cnt, sizeof(cnt), "%d", i); @@ -328,6 +329,10 @@ int CChannelList::doChannelMenu(void) snprintf(cnt, sizeof(cnt), "%d", i); menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); + menu->addItem(GenericMenuSeparator); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_HISTORY_CLEAR, got_history, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); snprintf(cnt, sizeof(cnt), "%d", i); menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); @@ -411,7 +416,14 @@ int CChannelList::doChannelMenu(void) if(g_settings.make_new_list) CNeutrinoApp::getInstance()->MarkChannelsInit(); break; - case 5: // settings + case 5: // clear channel history + { + CNeutrinoApp::getInstance()->channelList->getLastChannels().clear(); + printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__); + ret = -2; // exit channellist + } + break; + case 6: // settings { previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; @@ -713,10 +725,13 @@ int CChannelList::show() if (selected + 1 < (*chanlist).size()) selected++; } - if (ret != 0) { - paint(); + if (ret == -2) // exit channellist + loop = false; + else { + if (ret != 0) + paint(); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } else if (!empty && msg == (neutrino_msg_t) g_settings.key_list_start) { actzap = updateSelection(0); diff --git a/src/system/locals.h b/src/system/locals.h index 1738cfc60..cac322dd7 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -282,6 +282,7 @@ typedef enum LOCALE_CHANNELLIST_FOOT_SORT_SAT, LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HISTORY, + LOCALE_CHANNELLIST_HISTORY_CLEAR, LOCALE_CHANNELLIST_KEEP_NUMBERS, LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 04979cfda..105344a05 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -282,6 +282,7 @@ const char * locale_real_names[] = "channellist.foot_sort_sat", "channellist.head", "channellist.history", + "channellist.history_clear", "channellist.keep_numbers", "channellist.make_hdlist", "channellist.make_newlist", From b4013d8f99fe2824086d094128042e8fe598993b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 21 May 2016 21:42:27 +0200 Subject: [PATCH 375/690] hdd_menu: add key confirmation to hdd-check result Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b6421b8b0d1289892f90e1f3cec03c26132fe84 Author: vanhofen Date: 2016-05-21 (Sat, 21 May 2016) Origin message was: ------------------ - hdd_menu: add key confirmation to hdd-check result --- src/gui/hdd_menu.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 5b3cf5730..a8afb2431 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -1010,6 +1010,11 @@ int CHDDMenuHandler::checkDevice(std::string dev) int percent = 0, opercent = 0; char buf[256] = { 0 }; + bool loop; + uint64_t timeoutEnd; + neutrino_msg_t msg; + neutrino_msg_data_t data; + std::string devname = "/dev/" + dev; printf("CHDDMenuHandler::checkDevice: dev %s\n", dev.c_str()); @@ -1079,7 +1084,16 @@ int CHDDMenuHandler::checkDevice(std::string dev) progress->showGlobalStatus(100); progress->showStatusMessageUTF(buf); - sleep(2); + + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + loop = true; + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_ok || msg == CRCInput::RC_home) + loop = false; + } + progress->hide(); delete progress; From c1aa2509a39cef40263c1884e11c32d8a746f566 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 23 May 2016 14:17:25 +0200 Subject: [PATCH 376/690] avoid division by zero and fix segfault Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9f20b278903c7d3af4b8de253c22a7b55b878273 Author: Jacek Jendrzej Date: 2016-05-23 (Mon, 23 May 2016) --- src/gui/components/cc_draw.cpp | 2 +- src/gui/components/cc_item_picture.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0dd74c5be..b5ef5bf0d 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -431,7 +431,7 @@ bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int //screen area save fb_pixel_t* CCDraw::getScreen(int ax, int ay, int dx, int dy) { - if (dx * dy == 0) + if (dx < 1 || dy < 1 || dx * dy == 0) return NULL; dprintf(DEBUG_INFO, "[CCDraw] INFO! [%s - %d], ax = %d, ay = %d, dx = %d, dy = %d\n", __func__, __LINE__, ax, ay, dx, dy); diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 91f59a9b5..be77e7a44 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -216,7 +216,7 @@ void CComponentsPicture::initCCItem() * by setters setWidth/setHeight * these steps are required to assign the current image dimensions to item dimensions */ - if (keep_dx_aspect){ + if (keep_dx_aspect && dy){ float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); #ifdef BOXMODEL_APOLLO @@ -224,7 +224,7 @@ void CComponentsPicture::initCCItem() width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; #endif } - if (keep_dy_aspect){ + if (keep_dy_aspect & dx){ float w_ratio = float(width)*100/(float)dx; height = int(w_ratio*(float)dy/100); } From 1e9647f29fca301aadc98b474a8e9428f05d5d69 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 30 May 2016 11:21:22 +0200 Subject: [PATCH 377/690] setting_helpers: whitespace cleanup and code format changes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/30a3093d9fc13e816c8ca3b6c663d1179a7bbd3b Author: vanhofen Date: 2016-05-30 (Mon, 30 May 2016) Origin message was: ------------------ - setting_helpers: whitespace cleanup and code format changes --- src/system/setting_helpers.cpp | 8 ++++---- src/system/setting_helpers.h | 35 ++++++++++++++++------------------ 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 7c098a086..9a0bd59e9 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -401,7 +401,7 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr() int s, i; int ok = 0; s = socket(AF_INET, SOCK_DGRAM, 0); - if (s==-1) + if (s==-1) { return -1; } @@ -413,11 +413,11 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr() for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; IFR++) { strcpy(ifr.ifr_name, IFR->ifr_name); - if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) + if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) { - if (! (ifr.ifr_flags & IFF_LOOPBACK)) + if (! (ifr.ifr_flags & IFF_LOOPBACK)) { - if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0) + if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0) { ok = 1; break; diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index 50ea5ef6c..98be19f84 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -69,19 +69,16 @@ class COnOffNotifier : public CChangeObserver class CSectionsdConfigNotifier : public CChangeObserver { - public: - bool changeNotify(const neutrino_locale_t, void * ); + public: + bool changeNotify(const neutrino_locale_t, void * ); }; class CTouchFileNotifier : public CChangeObserver { const char * filename; - public: - inline CTouchFileNotifier(const char * file_to_modify) - { - filename = file_to_modify; - }; - bool changeNotify(const neutrino_locale_t, void * data); + public: + inline CTouchFileNotifier(const char * _filename) { filename = _filename; }; + bool changeNotify(const neutrino_locale_t, void * data); }; class CColorSetupNotifier : public CChangeObserver @@ -123,33 +120,33 @@ class CMoviePluginChangeExec : public CMenuTarget class CTZChangeNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; class CDataResetNotifier : public CMenuTarget { -public: - int exec(CMenuTarget* parent, const std::string& actionKey); + public: + int exec(CMenuTarget* parent, const std::string& actionKey); }; class CFanControlNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); - static void setSpeed(unsigned int speed); + public: + bool changeNotify(const neutrino_locale_t, void * data); + static void setSpeed(unsigned int speed); }; class CCpuFreqNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; class CAutoModeNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; #endif From d67420b77a232affa28e3d0efa589cb922c587e9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 1 Jun 2016 15:41:08 +0200 Subject: [PATCH 378/690] src/gui/eventlist.cpp restore channel name after call search if not used Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be2417068ee793e03807c5f2fdb07904aded4efc Author: Jacek Jendrzej Date: 2016-06-01 (Wed, 01 Jun 2016) --- src/gui/eventlist.cpp | 23 +++++++++++------------ src/gui/eventlist.h | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 22246ca31..7956d7870 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -647,7 +647,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna oldIndex = -1; oldEventID = -1; bgRightBoxPaint = false; - in_search = findEvents(); + in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { @@ -1034,12 +1034,11 @@ int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey* } /************************************************************************************************/ -bool CEventList::findEvents(void) +bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) /************************************************************************************************/ { bool res = false; int event = 0; - t_channel_id channel_id = 0; if((m_search_keyword.empty() || m_search_keyword == m_search_autokeyword) && evtlist[selected].eventID != 0) { @@ -1130,14 +1129,11 @@ bool CEventList::findEvents(void) } if(evtlist.empty()) { - if ( evtlist.empty() ) - { - CChannelEvent evt; - //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); - evt.description = g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); - evt.eventID = 0; - evtlist.push_back(evt); - } + CChannelEvent evt; + //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); + evt.description = g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); + evt.eventID = 0; + evtlist.push_back(evt); } if (current_event == (unsigned int)-1) current_event = 0; @@ -1163,7 +1159,10 @@ bool CEventList::findEvents(void) } } - paintHead(0, search_head_name); + if(event) + paintHead(0, search_head_name); + else + paintHead(channel_id, channelname); paint(); showFunctionBar(true, channel_id); return(res); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 1dcdd6dac..25e9e656e 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -79,7 +79,7 @@ class CEventList : public CListHelpers event_id_t oldEventID; bool bgRightBoxPaint; - bool findEvents(void); + bool findEvents(t_channel_id channel_id, std::string channelname); // Eventfinder end CFrameBuffer *frameBuffer; From 3fd0290be3925cdb92895d282471165e3df6f04d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Jun 2016 16:48:35 +0200 Subject: [PATCH 379/690] CComponentsChannelLogo: rework logic of inital statement in setChannel() This should fix missing logos on existant chnannellogo instances. For example, this was to see if user has opened eventlist and opens timerlist with button '0'. After closed timerlist logos were lost. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/69ab25e11166af0dcb222ce14077426f4ff0e198 Author: Thilo Graf Date: 2016-06-02 (Thu, 02 Jun 2016) --- src/gui/components/cc_item_picture.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index be77e7a44..ba35b446b 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -399,17 +399,15 @@ void CComponentsChannelLogo::setAltLogo(const char* picture_name) void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { - if (channel_id) - if (channel_id == channelId) - return; - channel_id = channelId; - - if (!channel_name.empty()) - if (channel_name == channelName) - return; - need_init = true; + if (channelId || !channelName.empty()){ + if ((channel_id == channelId) && (channel_name == channelName)) + need_init = false; + } + + channel_id = channelId; channel_name = channelName; + int dummy; has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &dummy, &dummy); From 4ff7be45bd4e903141cffcf8a028aad6fcf464a5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Jun 2016 20:13:38 +0200 Subject: [PATCH 380/690] CMovieBrowser: remove hide() from destructor hide() in constructor could make problems on created moviebrowser instances if gui functionality of moviebrowser is not required, eg if only members are used without gui. Gui parts could be unintended removed from screen. Note: hide() must be called explicit now. I didn't found any problems at the moment, but please report if you found problems, so we can fix it. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/137598d36834eb0ceb98f757a7b7c9e3896c4938 Author: Thilo Graf Date: 2016-06-02 (Thu, 02 Jun 2016) --- src/gui/moviebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 71729f51e..ae4c5b550 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -351,7 +351,7 @@ CMovieBrowser::CMovieBrowser(): configfile ('\t') CMovieBrowser::~CMovieBrowser() { //TRACE("[mb] del\n"); - hide(); + m_dir.clear(); m_dirNames.clear(); From 878de7f24a49dd34e89b0cb940e06b5d2ed51b4d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Jun 2016 20:34:51 +0200 Subject: [PATCH 381/690] CSignalBar: use correct initial value This should fix wrong values if signal = 0. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff3f44d4d22187c59787a7b152c4e909250a70db Author: Thilo Graf Date: 2016-06-02 (Thu, 02 Jun 2016) --- src/gui/components/cc_frm_signalbars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index ccef5a4af..ed43f3ade 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -140,7 +140,7 @@ void CSignalBar::initSBarValue() //create value label object with basic properties if (sb_vlbl == NULL){ sb_vlbl = new CComponentsLabel(); - sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font); + sb_vlbl->setText("0%", sb_val_mode, sb_font); } sb_vlbl->doPaintBg(false); From 2c239533a65cf6a69e34a8313a0fef1263a56a35 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 2 Jun 2016 21:37:33 +0200 Subject: [PATCH 382/690] record_setup: add check existing recordings before set new timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6dddaff0d2b4338964ccd291a67afbff98675a97 Author: vanhofen Date: 2016-06-02 (Thu, 02 Jun 2016) Origin message was: ------------------ - record_setup: add check existing recordings before set new timers --- data/locale/deutsch.locale | 4 ++++ data/locale/english.locale | 4 ++++ src/gui/epgplus.cpp | 35 +++++++++++++++++++++++++++++------ src/gui/epgview.cpp | 17 +++++++++++++++++ src/gui/eventlist.cpp | 20 +++++++++++++++++++- src/gui/moviebrowser.cpp | 20 ++++++++++++++++++++ src/gui/moviebrowser.h | 1 + src/gui/record_setup.cpp | 5 +++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 4 ++++ src/system/locals_intern.h | 4 ++++ src/system/settings.h | 1 + 12 files changed, 110 insertions(+), 7 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 42fb6169a..cae2476ef 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1257,6 +1257,7 @@ menu.hint_progressbar_timescale_yellow Hier können Sie den gelben Farbanteil bu menu.hint_protection Schützen Sie Inhalte per PIN-Code\nStandard-PIN ist 0000 menu.hint_radiomode Schaltet zum Radio-Modus menu.hint_reboot Startet die Box neu\nDer Neustart erfolgt ohne Bestätigung! +menu.hint_record_already_found_check Prüft vor dem Setzen eines neues Aufnahmetimers, ob ein gleichnamiger Titel bereits vorhanden ist menu.hint_record_apid_ac3 Schließt bei einer Aufnahme die durch den Sender definierte Tonspur 'Dolby Digital' in die Aufnahme ein, sofern diese vorhanden ist menu.hint_record_apid_alt Sind weitere Tonspuren verfügbar, dann können diese hiermit bei einer Aufnahme entsprechend ein- bzw. ausgeschlossen werden menu.hint_record_apid_std Schließt bei einer Aufnahme die durch den Sender definierte Tonspur 'Standard' in die Aufnahme ein bzw. aus @@ -2027,6 +2028,8 @@ rclock.locked Gesperrt rclock.lockmsg Die Fernbedienung wird gesperrt.\nUm die Sperre aufzuheben, bitte\n[rot] gefolgt von [%s]\nauf der Fernbedienung drücken. rclock.title Fernbedienung sperren rclock.unlockmsg Fernbedienung reaktiviert +recording.already_found %s\nwurde bereits gefunden. Trotzdem aufnehmen? +recording.already_found_check Prüfe Aufnahmen recording.is_running Folgende Aufnahme läuft bereits! Neue Aufnahme starten? recording.start Starte Aufnahme, bitte warten...! recording.startstop_msg Meldung bei Aufnahme Start/Ende @@ -2034,6 +2037,7 @@ recording.stop Beende Aufnahme, bitte warten...! recording.time_hour Stunde recording.time_hours Stunden recording.time_min Min +recordingmenu.already_found_check Prüfe, ob Titel bereits vorhanden recordingmenu.apids Tonspuren recordingmenu.apids_ac3 AC3 Tonspuren aufnehmen recordingmenu.apids_alt Alternative Tonspuren aufn. diff --git a/data/locale/english.locale b/data/locale/english.locale index 77a3b7a87..c675c25b5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1257,6 +1257,7 @@ menu.hint_progressbar_timescale_yellow Choose the yellow portion of colored prog menu.hint_protection Protect content by PIN code\nDefault PIN 0000 menu.hint_radiomode Switch box to radio mode menu.hint_reboot Reboot box\nNo confirmation +menu.hint_record_already_found_check Checks before setting a new record timer if an eponymous title already exists menu.hint_record_apid_ac3 Record AC3 audio pids menu.hint_record_apid_alt Record alternative non-AC3 audio pids menu.hint_record_apid_std Record first audio pid @@ -2027,6 +2028,8 @@ rclock.locked Locked rclock.lockmsg Remote control will be locked.\nTo unlock, press\n[red] followed by [%s]\non your remote control. rclock.title Lock remote control rclock.unlockmsg Remote control unlocked +recording.already_found %s\nwas already found. Nevertheless start record? +recording.already_found_check Check recordings recording.is_running This channel already recording. Start new record? recording.start Start recording, please wait...! recording.startstop_msg Message when recording is start/stop @@ -2034,6 +2037,7 @@ recording.stop Stop recording, please wait...! recording.time_hour hour recording.time_hours hours recording.time_min min +recordingmenu.already_found_check Check, if title is already present recordingmenu.apids Audio streams recordingmenu.apids_ac3 record AC3 streams recordingmenu.apids_alt record alternative streams diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 0114f9096..c48af512c 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -34,12 +34,14 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include "bouquetlist.h" @@ -1308,12 +1310,33 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end()) && (!(*It)->channelEvent.description.empty()) ) { - if (g_Timerd->isTimerdAvailable()) { - - g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime, (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime - (ANNOUNCETIME + 120) - , TIMERD_APIDS_CONF, true); - ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG) - , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + bool doRecord = true; + if (g_settings.recording_already_found_check) + { + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = (*It)->channelEvent.description.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) + { + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + } + } + if (g_Timerd->isTimerdAvailable() && doRecord) + { + g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), + (*It)->channelEvent.startTime, + (*It)->channelEvent.startTime + (*It)->channelEvent.duration, + (*It)->channelEvent.eventID, + (*It)->channelEvent.startTime, + (*It)->channelEvent.startTime - (ANNOUNCETIME + 120), + TIMERD_APIDS_CONF, true); + ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); } else printf ("timerd not available\n"); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index e3e35faf8..5d687ed04 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -898,6 +899,22 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (lid != -1) recDir = g_settings.network_nfs[lid].local_dir; } + if (doRecord && g_settings.recording_already_found_check) + { + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = epgData.title.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) + { + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + } + } if (doRecord) { if (g_Timerd->addRecordTimerEvent(channel_id, diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7956d7870..90acdf162 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -466,8 +467,25 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else recDir = ""; } + bool doRecord = true; + if (g_settings.recording_already_found_check) + { + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = evtlist[selected].description.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) + { + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + } + } t_channel_id used_id = IS_WEBTV(channel_id) ? channel_id : evtlist[selected].channelID; - if (!recDir.empty()) //add/remove recording timer events and check/warn for conflicts + if (!recDir.empty() && doRecord) //add/remove recording timer events and check/warn for conflicts { if (g_Timerd->addRecordTimerEvent(used_id, evtlist[selected].startTime, diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ae4c5b550..7ca2f5d0a 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -2609,6 +2609,26 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) TRACE("[mb] Dir%d, Files:%d\n", (int)m_dirNames.size(), (int)m_vMovieInfo.size()); } +bool CMovieBrowser::gotMovie(const char *rec_title) +{ + //TRACE("[mb]->gotMovie\n"); + + m_doRefresh = false; + loadAllTsFileNamesFromStorage(); + + bool found = false; + for (unsigned int i = 0; i < m_vMovieInfo.size(); i++) + { + //printf("[mb] search for %s in %s\n", rec_title, m_vMovieInfo[i].epgTitle.c_str()); + if (strcmp(rec_title, m_vMovieInfo[i].epgTitle.c_str()) == 0) + { + found = true; + break; + } + } + return found; +} + static const char * const ext_list[] = { "avi", "mkv", "mp4", "flv", "mov", "mpg", "mpeg", "m2ts", "iso" diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index cf0bf36a0..2f662334f 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -387,6 +387,7 @@ class CMovieBrowser : public CMenuTarget m_file_info_stale = true; show_mode = mode; } + bool gotMovie(const char *rec_title); private: //Functions ///// MovieBrowser init /////////////// diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 3388937b3..70e1d3f8b 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -234,6 +234,11 @@ int CRecordSetup::showRecordSetup() end_of_recording->setHint("", LOCALE_MENU_HINT_RECORD_END); recordingSettings->addItem(end_of_recording); + // already_found + CMenuOptionChooser* already_found = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, &g_settings.recording_already_found_check, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + already_found->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK); + recordingSettings->addItem(already_found); + if (!g_settings.easymenu) { CMenuOptionChooser* slow_warn = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SLOW_WARN, &g_settings.recording_slow_warning, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); slow_warn->setHint("", LOCALE_MENU_HINT_RECORD_SLOW_WARN); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d0377ab1f..0d0268c3d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -641,6 +641,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); g_settings.recording_startstop_msg = configfile.getBool("recording_startstop_msg" , true); + g_settings.recording_already_found_check = configfile.getBool("recording_already_found_check", false); // default plugin for movieplayer g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "---" ); @@ -1172,6 +1173,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); configfile.setBool ("recording_slow_warning" , g_settings.recording_slow_warning ); configfile.setBool ("recording_startstop_msg" , g_settings.recording_startstop_msg ); + configfile.setBool ("recording_already_found_check" , g_settings.recording_already_found_check ); // default plugin for movieplayer configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); diff --git a/src/system/locals.h b/src/system/locals.h index cac322dd7..218e1ac98 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1284,6 +1284,7 @@ typedef enum LOCALE_MENU_HINT_PROTECTION, LOCALE_MENU_HINT_RADIOMODE, LOCALE_MENU_HINT_REBOOT, + LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK, LOCALE_MENU_HINT_RECORD_APID_AC3, LOCALE_MENU_HINT_RECORD_APID_ALT, LOCALE_MENU_HINT_RECORD_APID_STD, @@ -2054,6 +2055,8 @@ typedef enum LOCALE_RCLOCK_LOCKMSG, LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, + LOCALE_RECORDING_ALREADY_FOUND, + LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_RECORDING_IS_RUNNING, LOCALE_RECORDING_START, LOCALE_RECORDING_STARTSTOP_MSG, @@ -2061,6 +2064,7 @@ typedef enum LOCALE_RECORDING_TIME_HOUR, LOCALE_RECORDING_TIME_HOURS, LOCALE_RECORDING_TIME_MIN, + LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, LOCALE_RECORDINGMENU_APIDS, LOCALE_RECORDINGMENU_APIDS_AC3, LOCALE_RECORDINGMENU_APIDS_ALT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 105344a05..d68ecba46 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1284,6 +1284,7 @@ const char * locale_real_names[] = "menu.hint_protection", "menu.hint_radiomode", "menu.hint_reboot", + "menu.hint_record_already_found_check", "menu.hint_record_apid_ac3", "menu.hint_record_apid_alt", "menu.hint_record_apid_std", @@ -2054,6 +2055,8 @@ const char * locale_real_names[] = "rclock.lockmsg", "rclock.title", "rclock.unlockmsg", + "recording.already_found", + "recording.already_found_check", "recording.is_running", "recording.start", "recording.startstop_msg", @@ -2061,6 +2064,7 @@ const char * locale_real_names[] = "recording.time_hour", "recording.time_hours", "recording.time_min", + "recordingmenu.already_found_check", "recordingmenu.apids", "recordingmenu.apids_ac3", "recordingmenu.apids_alt", diff --git a/src/system/settings.h b/src/system/settings.h index f31688213..c3e7e2f98 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -441,6 +441,7 @@ struct SNeutrinoSettings int recording_startstop_msg; int shutdown_timer_record_type; std::string recording_filename_template; + int recording_already_found_check; int filesystem_is_utf8; // default plugin for ts-movieplayer (red button) From e5f88eaecc723e58da799e6741b0d9fc4554055a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 2 Jun 2016 22:00:40 +0200 Subject: [PATCH 383/690] record_setup: remove undefined hint icon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c89f21c054f09ee7e73652ff099c66ee5f39abca Author: vanhofen Date: 2016-06-02 (Thu, 02 Jun 2016) Origin message was: ------------------ - record_setup: remove undefined hint icon --- src/gui/record_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 70e1d3f8b..89a5c714d 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -236,7 +236,7 @@ int CRecordSetup::showRecordSetup() // already_found CMenuOptionChooser* already_found = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, &g_settings.recording_already_found_check, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - already_found->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK); + already_found->setHint("", LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK); recordingSettings->addItem(already_found); if (!g_settings.easymenu) { From 33a013bf58055db5a8bb0b7b058593f0424c1735 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 2 Jun 2016 22:13:49 +0200 Subject: [PATCH 384/690] supplement to 2d0f53f15fafe2d0ac5caadfdd5ba7bb1912769c Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fd1c0cfb60e3766ea27b3dbfdb799a11f150bae1 Author: Jacek Jendrzej Date: 2016-06-02 (Thu, 02 Jun 2016) --- src/gui/moviebrowser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 7ca2f5d0a..4610e4979 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1248,7 +1248,11 @@ int CMovieBrowser::paint(void) refreshLCD(); if (m_settings.gui == MB_GUI_FILTER) m_settings.gui = MB_GUI_MOVIE_INFO; - onSetGUIWindow(m_settings.gui); + if (show_mode == MB_SHOW_YT) + onSetGUIWindow(MB_GUI_MOVIE_INFO); + else + onSetGUIWindow(m_settings.gui); + return (true); } From 78e90171d6980e6f83f2d4f67d913b373c3f05ef Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 4 Jun 2016 15:36:46 +0200 Subject: [PATCH 385/690] avoid division by zero Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75a96a2fb32389daf1517700ff124ade6eb946bf Author: Jacek Jendrzej Date: 2016-06-04 (Sat, 04 Jun 2016) --- src/gui/audioplayer.cpp | 9 ++++++--- src/gui/pictureviewer.cpp | 7 +++++-- src/gui/upnpbrowser.cpp | 8 +++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4d1e9ccc6..cb97df43e 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1793,7 +1793,10 @@ void CAudioPlayerGui::paint() { if (m_show_playlist) { - m_liststart = (m_selected / m_listmaxshow) * m_listmaxshow; + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + m_liststart = (m_selected / tmp_max) * m_listmaxshow; paintHead(); for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - int sbc = ((m_playlist.size() - 1) / m_listmaxshow) + 1; - int sbs = (m_selected / m_listmaxshow); + int sbc = ((m_playlist.size() - 1) / tmp_max) + 1; + int sbs = (m_selected / tmp_max); if (sbc < 1) sbc = 1; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 40e5c3b28..9adbf5555 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -761,8 +761,11 @@ void CPictureViewerGui::paint() int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - int sbc= ((playlist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((playlist.size()- 1)/ tmp_max)+ 1; + int sbs= (selected/tmp_max); if (sbc < 1) sbc = 1; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 649b22860..5baa6df67 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -965,9 +965,11 @@ void CUpnpBrowserGui::paintDevices() ypos = m_y + m_title_height + m_theight; int sb = m_fheight * m_listmaxshow; m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc = ((m_devices.size() - 1) / m_listmaxshow) + 1; - int sbs = ((m_selecteddevice) / m_listmaxshow); + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc = ((m_devices.size() - 1) / tmp_max) + 1; + int sbs = ((m_selecteddevice) / tmp_max); m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); From fa9472384da7ea46f03c4b8426268ecd2416d734 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 4 Jun 2016 16:19:57 +0200 Subject: [PATCH 386/690] src/system/localize.cpp Undefined allocation of 0 bytes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb2c84434aa0d2c81b6a2f6949c03595e36c5cc8 Author: Jacek Jendrzej Date: 2016-06-04 (Sat, 04 Jun 2016) --- src/system/localize.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/system/localize.cpp b/src/system/localize.cpp index 607f7b95f..63f562437 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -223,17 +223,18 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l fclose(fd); if(buf) free(buf); - char *_mem = (char *) realloc(*mem, memp - *mem); - if (_mem) { - if (_mem != *mem) { - // most likely doesn't happen - for(unsigned int i = 1; i < sizeof(locale_real_names)/sizeof(const char *); i++) - if (loadData[i] != locale_real_names[i]) - loadData[i] -= *mem - _mem; - *mem = _mem; + if(memp - *mem > 0){ + char *_mem = (char *) realloc(*mem, memp - *mem); + if (_mem) { + if (_mem != *mem) { + // most likely doesn't happen + for(unsigned int i = 1; i < sizeof(locale_real_names)/sizeof(const char *); i++) + if (loadData[i] != locale_real_names[i]) + loadData[i] -= *mem - _mem; + *mem = _mem; + } } } - for (unsigned j = 1; j < (sizeof(locale_real_names)/sizeof(const char *)); j++) if (loadData[j] == locale_real_names[j]) { From e607a775bff557bac603a818741e9027453a29ea Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 4 Jun 2016 17:21:18 +0200 Subject: [PATCH 387/690] avoid division by zero Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f6eb565ea3c1dc0248fd14c1fb8f5eea54b4bac3 Author: Jacek Jendrzej Date: 2016-06-04 (Sat, 04 Jun 2016) --- src/gui/bookmarkmanager.cpp | 6 ++++-- src/gui/timerlist.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 92b4dd1e8..94fe00bfb 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -469,8 +469,10 @@ void CBookmarkManager::paint() int ypos = y+ theight; int sb = 2*fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((bookmarks.size()- 1)/ listmaxshow)+ 1; + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((bookmarks.size()- 1)/ tmp_max)+ 1; if (sbc < 1) sbc = 1; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index e695a5a0f..fb8927463 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -881,8 +881,10 @@ void CTimerList::paint() int ypos = y+ theight; int sb = 2*fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((timerlist.size()- 1)/ listmaxshow)+ 1; + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((timerlist.size()- 1)/ tmp_max)+ 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); } From 6409485f5b29ddc099d9122c2bd6279310f3faa1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 7 Jun 2016 13:35:10 +0200 Subject: [PATCH 388/690] yWeb: add Link and Trinity Duo to selection of remote controls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/926705eaf1ef531cc3eda45fe95e1352bc544d33 Author: vanhofen Date: 2016-06-07 (Tue, 07 Jun 2016) Origin message was: ------------------ - yWeb: add Link and Trinity Duo to selection of remote controls --- src/nhttpd/web/Y_Blocks.txt | 8 ++++++-- src/nhttpd/web/Y_Settings_yWeb.yhtm | 4 ++++ src/nhttpd/web/Y_Version.txt | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 6ac61d28b..1e17bb252 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -520,9 +520,11 @@ start-block~remote {=if-equal:{=var-get:boxtype=}~CST Tank~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:boxtype=}~CST Trinity~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=if-equal:{=var-get:boxtype=}~CST Zee2~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ + {=if-equal:{=var-get:boxtype=}~CST Link~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ + {=if-equal:{=var-get:boxtype=}~CST Trinity Duo~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=}=} + =}=}=}=}=}=}=}=} =}=} ~ {=if-equal:{=var-get:yfbtype=}~-2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~ @@ -533,9 +535,11 @@ start-block~remote {=if-equal:{=var-get:yfbtype=}~4~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ {=if-equal:{=var-get:yfbtype=}~5~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:yfbtype=}~6~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ + {=if-equal:{=var-get:yfbtype=}~7~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ + {=if-equal:{=var-get:yfbtype=}~8~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=}=}=}=} + =}=}=}=}=}=}=}=}=}=} =} end-block~remote diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm index e3d9a8d14..02638bdbd 100644 --- a/src/nhttpd/web/Y_Settings_yWeb.yhtm +++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm @@ -38,6 +38,8 @@ function do_init(){ case "4": // cst neo twin case "5": // cst tank case "6": // cst trinity + case "7": // cst link + case "8": // cst trinity duo sel=(sel*1+val*1); break; default: @@ -123,6 +125,8 @@ select { + + diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index f2f7e0cd8..afdb04898 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.36 -date=14.03.2016 +version=2.9.0.37 +date=07.06.2016 type=Release info=Port CST From 64322561e4a65cce57fcdcd56302d126aa35c628 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 7 Jun 2016 17:09:34 +0200 Subject: [PATCH 389/690] cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bacba3c555eadb2bec298ead38c513af73d117d0 Author: vanhofen Date: 2016-06-07 (Tue, 07 Jun 2016) Origin message was: ------------------ - cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" --- data/cables.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/cables.xml b/data/cables.xml index c9d0eb201..debbe767f 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -484,10 +484,10 @@ - + @@ -495,7 +495,7 @@ - + @@ -530,6 +530,7 @@ + From a7f0a58f703e14b94468cb3df11598267ace015c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 7 Jun 2016 17:27:39 +0200 Subject: [PATCH 390/690] slovak.locale: update Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c8dd068bd43490079c09e58e332a4a4836a9a49 Author: vanhofen Date: 2016-06-07 (Tue, 07 Jun 2016) Origin message was: ------------------ - slovak.locale: update --- data/locale/slovak.locale | 1711 +++++++++++++++++++------------------ 1 file changed, 888 insertions(+), 823 deletions(-) diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 9651642ef..8700d3f97 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -8,21 +8,21 @@ EPGPlus.actions Akcie EPGPlus.bybouquet_mode buketmi EPGPlus.bypage_mode stranami EPGPlus.head Multi EPG -EPGPlus.next_bouquet nasl.buket +EPGPlus.next_bouquet Nasledujúci buket EPGPlus.options Možnosti EPGPlus.page_down Predchádzajúca strana EPGPlus.page_up Nasledujúca strana -EPGPlus.prev_bouquet predch.buket -EPGPlus.record Nahraj -EPGPlus.refresh_epg Obnov -EPGPlus.remind Pripomeň +EPGPlus.prev_bouquet Predchádzajúci buket +EPGPlus.record Nahrať +EPGPlus.refresh_epg Obnoviť +EPGPlus.remind Pripomenúť EPGPlus.scroll_mode pretáčanie EPGPlus.stretch_mode rozšírenie EPGPlus.swap_mode Zmena stránkovania EPGPlus.view_mode Spôsob zobrazenia -GENRE.ALL vypnuté -GENRE.ARTS umelecké -GENRE.ARTS.0 umenie/kultúra +GENRE.ALL vyp +GENRE.ARTS Umenie +GENRE.ARTS.0 umenie / kultúra GENRE.ARTS.1 divadlo GENRE.ARTS.10 umelecké/kultúrne maazíny GENRE.ARTS.11 móda @@ -32,16 +32,16 @@ GENRE.ARTS.4 ľudové umenie GENRE.ARTS.5 literatúra GENRE.ARTS.6 film/kino GENRE.ARTS.7 experimentálny film /video -GENRE.ARTS.8 prenosy/tlačovky +GENRE.ARTS.8 vysielanie/tlač GENRE.ARTS.9 nové média -GENRE.CHILDRENs_PROGRAMMES detské +GENRE.CHILDRENs_PROGRAMMES programy pre deti GENRE.CHILDRENs_PROGRAMMES.0 programy pre deti a mládež GENRE.CHILDRENs_PROGRAMMES.1 programy pre deti predškolského veku GENRE.CHILDRENs_PROGRAMMES.2 zábavné programy pre ľudí vo veku 6 – 14 rokov GENRE.CHILDRENs_PROGRAMMES.3 zábavné programy pre ľudí vo veku 10 – 16 rokov GENRE.CHILDRENs_PROGRAMMES.4 informačné a náučné školské programy GENRE.CHILDRENs_PROGRAMMES.5 animované programy -GENRE.DOCUS_MAGAZINES dokumentárne +GENRE.DOCUS_MAGAZINES dokumenty GENRE.DOCUS_MAGAZINES.0 dokumenty/magazíny GENRE.DOCUS_MAGAZINES.1 príroda/zvieratá/životné prostredie GENRE.DOCUS_MAGAZINES.2 technológie/prírodné vedy @@ -50,7 +50,7 @@ GENRE.DOCUS_MAGAZINES.4 zahraničie/výpravy GENRE.DOCUS_MAGAZINES.5 spoločenské/humanitné vedy GENRE.DOCUS_MAGAZINES.6 osveta GENRE.DOCUS_MAGAZINES.7 jazyky -GENRE.MOVIE filmové +GENRE.MOVIE film GENRE.MOVIE.0 kinofilm/dráma GENRE.MOVIE.1 kriminálny/napínavý GENRE.MOVIE.2 dobrodružný/western/vojenský @@ -60,7 +60,7 @@ GENRE.MOVIE.5 telenovela/melodráma/folklór GENRE.MOVIE.6 romantika GENRE.MOVIE.7 vážna dráma/klasika/náboženský/historický GENRE.MOVIE.8 filmy pre dospelých -GENRE.MUSIC_DANCE hudobné +GENRE.MUSIC_DANCE hudba GENRE.MUSIC_DANCE.0 hudba/tanec GENRE.MUSIC_DANCE.1 rock/pop GENRE.MUSIC_DANCE.2 vážna/klasická hudba @@ -68,28 +68,28 @@ GENRE.MUSIC_DANCE.3 národná/ľudová hudba GENRE.MUSIC_DANCE.4 jazz GENRE.MUSIC_DANCE.5 muzikál/opera GENRE.MUSIC_DANCE.6 balet -GENRE.NEWS spravodajské +GENRE.NEWS správy GENRE.NEWS.0 správy GENRE.NEWS.1 správy/počasie GENRE.NEWS.2 spravodajský magazín GENRE.NEWS.3 dokument GENRE.NEWS.4 diskusia/rozhovor/rokovanie -GENRE.SHOW estrádne +GENRE.SHOW Show GENRE.SHOW.0 estráda/telehra GENRE.SHOW.1 telehra/kvíz/súťaž GENRE.SHOW.2 varieté GENRE.SHOW.3 debata -GENRE.SOCIAL_POLITICAL spoločenské +GENRE.SOCIAL_POLITICAL sociálne GENRE.SOCIAL_POLITICAL.0 spoločenské a politické udalosti/obchod GENRE.SOCIAL_POLITICAL.1 magazíny/reportáže/dokumenty GENRE.SOCIAL_POLITICAL.2 ekonomické/spoločenské poradenstvo GENRE.SOCIAL_POLITICAL.3 významný ľudia -GENRE.SPORTS športové +GENRE.SPORTS športy GENRE.SPORTS.0 šport GENRE.SPORTS.1 mimoriadne udalosti (olimpiady, majstrovstvá sveta...) GENRE.SPORTS.10 jazdectvo -GENRE.SPORTS.11 vojenský šport -GENRE.SPORTS.2 športový magazín +GENRE.SPORTS.11 vojenské športy +GENRE.SPORTS.2 športové magazíny GENRE.SPORTS.3 futbal GENRE.SPORTS.4 tenis GENRE.SPORTS.5 skupinové športy @@ -97,7 +97,7 @@ GENRE.SPORTS.6 atletika GENRE.SPORTS.7 motorizmus GENRE.SPORTS.8 vodné športy GENRE.SPORTS.9 zimné športy -GENRE.TRAVEL_HOBBIES voľné chvíle +GENRE.TRAVEL_HOBBIES Voľný čas GENRE.TRAVEL_HOBBIES.0 cestovanie a odych GENRE.TRAVEL_HOBBIES.1 turistika/cestovanie GENRE.TRAVEL_HOBBIES.2 plavba @@ -107,7 +107,16 @@ GENRE.TRAVEL_HOBBIES.5 varenie GENRE.TRAVEL_HOBBIES.6 inzertovanie/nakupovanie GENRE.TRAVEL_HOBBIES.7 záhradkárstvo GENRE.UNKNOWN neznáme -adzap prepni za +adzap Prepnúť za +adzap.announce O %d sekúnd bude kanál prepnutý na\n%s +adzap.cancel Časovač bol zrušený +adzap.disable Vyp +adzap.enable Zap (raz) +adzap.minute minúta +adzap.minutes minút +adzap.monitor Zap (trvanlivý) +adzap.switchback Prepnúť späť po +adzap.writedata Zapísať stavové údaje apidselector.head Výber jazyka audio.srs_algo Režim audio.srs_algo_heavy Hrubý @@ -119,56 +128,56 @@ audio.srs_volume Východzia hlasitosť audiomenu.PCMOffset Zníženie hlasitosti PCM audiomenu.analog_mode Analógový režim audiomenu.analog_out Analógový výstup -audiomenu.auto_lang Automatický výber zvuku +audiomenu.auto_lang Automatický výber zvukovej stopy audiomenu.auto_subs Automatický výber titulkov audiomenu.avs avs -audiomenu.avsync A/V synch +audiomenu.avsync A/V synchronizácia audiomenu.avsync_am Hlavný zvuk audiomenu.clockrec Vzorkovanie audiomenu.dolbydigital Zvuk Dolby Digital -audiomenu.hdmi_dd Zvuk DD na HDMI +audiomenu.hdmi_dd Zvuk DD cez HDMI audiomenu.hdmi_dd_auto auto audiomenu.hdmi_dd_force nútene audiomenu.monoleft mono ľavý kanál audiomenu.monoright mono pravý kanál audiomenu.pref_lang Preferovaný jazyk -audiomenu.pref_lang_head Nastavenie jazyku zvuku/EPG -audiomenu.pref_languages Jazykové nastavenia +audiomenu.pref_lang_head Nastavenie jazyka zvuku / EPG +audiomenu.pref_languages Nastavenie zvuku a titulkov audiomenu.pref_subs Preferované titulky -audiomenu.pref_subs_head Nastavenie jazyku vybraných titulkov -audiomenu.spdif_dd Zvuk DD na SPDIF +audiomenu.pref_subs_head Nastavenie jazyka vybraných titulkov +audiomenu.spdif_dd Zvuk DD cez SPDIF audiomenu.stereo stereo audiomenu.volume_adjust Nastavená hlasitosť, v % -audiomenu.volume_adjustment Špecifické nastavenie hlasitosti kanála -audiomenu.volume_adjustment_ac3 AC3 prúdy -audiomenu.volume_adjustment_clear Vyčistiť uložené hodnoty -audiomenu.volume_adjustment_pcm PCM prúdy +audiomenu.volume_adjustment Špecifické nastavenie hlasitosti kanálu +audiomenu.volume_adjustment_ac3 AC3 zvuková stopa +audiomenu.volume_adjustment_clear Vymazať uložené hodnoty +audiomenu.volume_adjustment_pcm PCM zvuková stopa audiomenu.volume_start Počiatočná hlasitosť audiomenu.volume_step Krok hlasitosti -audioplayer.add pridaj +audioplayer.add Pridať audioplayer.add_ic Icecast audioplayer.add_loc Webrádio audioplayer.add_sc Shoutcast audioplayer.artist_title Umelec, Názov audioplayer.building_search_index Tvorenie vyhľadávacieho indexu -audioplayer.button_select_title_by_id hľadaj podľa ID -audioplayer.button_select_title_by_name hľadaj podľa názvu -audioplayer.defdir Východzí adresár -audioplayer.delete zmaž -audioplayer.deleteall zmaž všetko +audioplayer.button_select_title_by_id hľadať podľa ID +audioplayer.button_select_title_by_name hľadať podľa názvu +audioplayer.defdir Predvolená zložka +audioplayer.delete Zmazať +audioplayer.deleteall Všetko zmazať audioplayer.display_order Poradie -audioplayer.enable_sc_metadata Použi meta-data pre shoutcast -audioplayer.fastforward pretoč dopredu -audioplayer.follow Urob výber hraného +audioplayer.enable_sc_metadata Použiť meta-data pre shoutcast +audioplayer.fastforward pretočiť vpred +audioplayer.follow Výber aktuálnej stopy audioplayer.head Zoznam prehrávania audioplayer.highprio Vyššia priorita dekódovania audioplayer.jump_backwards skoč dozadu -audioplayer.jump_dialog_hint1 čas skoku +audioplayer.jump_dialog_hint1 Čas skoku audioplayer.jump_dialog_hint2 v sekundách. audioplayer.jump_dialog_title Zadaj čas skoku audioplayer.jump_forwards skoč dopredu audioplayer.keylevel funkcie klávesy -audioplayer.load_radio_stations Nahratie internetových rádií +audioplayer.load_radio_stations Načítanie internetových rádií audioplayer.name Prehrávač hudby audioplayer.pause pauza audioplayer.play spusti @@ -181,35 +190,35 @@ audioplayer.playlist_name_hint1 Zadajte názov súboru do zoznamu prehrávania audioplayer.playlist_name_hint2 Prípona .m3u bude doplnená automaticky audioplayer.reading_files Načítavam súbory audioplayer.receiving_list Načítavam zoznam, čakaj... -audioplayer.repeat_on Spusti režim opakovania -audioplayer.rewind pretoč dozadu -audioplayer.save_playlist ulož zoznam -audioplayer.select_title_by_name Vyber titul podľa názvu (SMS) -audioplayer.show_playlist Zobraz zoznam -audioplayer.shuffle náhodne -audioplayer.spectrum lcd a-spektrum -audioplayer.stop zastav +audioplayer.repeat_on Povoliť režim opakovania +audioplayer.rewind pretočiť dozadu +audioplayer.save_playlist uložiť zoznam +audioplayer.select_title_by_name Výber titulu podľa názvu (SMS) +audioplayer.show_playlist Zobraziť zoznam +audioplayer.shuffle Náhodne +audioplayer.spectrum LCD a-spektrum +audioplayer.stop Zastaviť audioplayer.title_artist Titul, Umelec -bookmarkmanager.delete zmaž -bookmarkmanager.name záložky -bookmarkmanager.rename premenuj -bookmarkmanager.select vyber -bouqueteditor.add pridaj +bookmarkmanager.delete Zmazať +bookmarkmanager.name Záložky +bookmarkmanager.rename Premenovať +bookmarkmanager.select Vybrať +bouqueteditor.add Pridať bouqueteditor.bouquetname Názov buketu -bouqueteditor.delete zmaž +bouqueteditor.delete Zmazať bouqueteditor.delete_question Vymazať kanál z buketu? -bouqueteditor.discardingchanges Zrušenie zmien. Prosím čakaj... -bouqueteditor.hide skri -bouqueteditor.lock zamkni -bouqueteditor.move presuň -bouqueteditor.move_to presuň do +bouqueteditor.discardingchanges Zrušenie zmien. Čakajte prosím... +bouqueteditor.hide Skryť +bouqueteditor.lock Zamknúť +bouqueteditor.move Presunúť +bouqueteditor.move_to Presunúť do bouqueteditor.name Úprava buketov bouqueteditor.newbouquetname Nový názov buketu -bouqueteditor.rename premenuj -bouqueteditor.return naspäť +bouqueteditor.rename Premenovať +bouqueteditor.return Naspäť bouqueteditor.savechanges? Uloženie týchto zmien? -bouqueteditor.savingchanges Ukladám zmeny. Prosím čakaj... -bouqueteditor.switch pridaj/odstráň +bouqueteditor.savingchanges Ukladám zmeny. Čakajte prosím... +bouqueteditor.switch Pridať/Odstrániť kanál bouqueteditor.switchmode TV/Rádio bouquetlist.head Bukety bouquetname.hdtv HD programy @@ -218,95 +227,97 @@ bouquetname.other Neznámy poskytovateľ bouquetname.removed Odstránené programy bouquetname.webtv WebTV kanály buildinfo.compiled_on Kompilované na: -buildinfo.compiled_with Verzia kompilera: -buildinfo.compiler_flags Príkazy kompilera: +buildinfo.compiled_with Verzia kompiléru +buildinfo.compiler_flags Znaky kompiléru buildinfo.creator Tvorca: buildinfo.kernel Verzia jadra: buildinfo.menu Build Informácie: cablesetup.provider Káblový poskytovateľ channellist.additional Rozšírené informácie -channellist.additional_off VYP -channellist.additional_on ZAP -channellist.additional_on_minitv ZAP (s MiniTV) +channellist.additional_off Vyp +channellist.additional_on Zap +channellist.additional_on_minitv Zap (s MiniTV) channellist.current_tp Aktuálny transpondér -channellist.edit Uprav -channellist.epgtext_align_left do ľava -channellist.epgtext_align_right do prava +channellist.edit Upraviť +channellist.epgtext_align_left doľava +channellist.epgtext_align_right doprava channellist.extended Grafické EPG v zozname -channellist.extended_colored s farebným ukazovateľom -channellist.extended_simple s jednoduchým ukazovateľom +channellist.extended_colored s farebným ukazateľom +channellist.extended_simple s jednoduchým ukazateľom channellist.favs Obľúbené channellist.foot Informácie programu -channellist.foot_freq Informácie kmitočtu +channellist.foot_freq Informácie frekvencie channellist.foot_next ďaľšia udalosť -channellist.foot_off VYP -channellist.foot_sort_alpha triediť[abeceda] -channellist.foot_sort_chnum triediť[číslo] -channellist.foot_sort_freq triediť[kmitočet] -channellist.foot_sort_sat triediť[satelit] +channellist.foot_off Vyp +channellist.foot_sort_alpha Triediť [abeceda] +channellist.foot_sort_chnum Triediť [číslo] +channellist.foot_sort_freq Triediť [frekvencia] +channellist.foot_sort_sat Triediť [satelit] channellist.head Všetky kanály channellist.history História channellist.keep_numbers Zachovať čísla predvolieb -channellist.make_hdlist Vytvor zoznam pre HD kanály -channellist.make_newlist Vytvor zoznam pre nové kanály -channellist.make_removedlist Vytvor zoznam pre odstránené kanály -channellist.make_webtvlist Vytvor zoznam pre WebTV kanály -channellist.new_zap_mode Okamžité prepínanie v zozname +channellist.make_hdlist Vytvoriť zoznam pre HD kanály +channellist.make_newlist Vytvoriť zoznam pre nové kanály +channellist.make_removedlist Vytvoriť buket odstránených kanálov +channellist.make_webtvlist Vytvoriť zoznam pre WebTV kanály +channellist.new_zap_mode Rýchle prepnutie v zozname channellist.new_zap_mode_active aktívne channellist.new_zap_mode_allow povolené channellist.new_zap_mode_off vypnuté -channellist.nonefound Nenájdený zoznam kanálov!\nVykonaj vyhľadanie kanálov\n(MENU -> Služby) +channellist.nonefound Zoznam staníc nenájdený!\nVykonajte prosím vyhľadanie staníc\n(MENU -> Služby) channellist.numeric_adjust Zadanie čísla na prepnutie channellist.provs Poskytovatelia channellist.recording_not_possible Nahrávanie nedostupné! -channellist.remember Posledne použité +channellist.remember Posledne použitý channellist.reset_all Odstrániť značku "Nový" pre všetky kanály channellist.reset_flags Odstrániť na kanály značku "Nový" channellist.sats Satelity -channellist.show_channellogo Zobraziť logo staníc -channellist.show_channelnumber Zobraziť čísla kanála +channellist.show_channellogo Zobraziť logo stanice +channellist.show_channelnumber Zobraziť čísla kanálov channellist.show_empty_favs Zobraziť aj prázdne obľúbené -channellist.show_infobox Zobraziť spodný InfoBox +channellist.show_infobox Zobraziť spodnú informačnú lištu channellist.since od -channellist.start spúšťa +channellist.start Spustiť ci.clock CI taktovanie (MHz) ci.empty Žiadny modul v šachte -ci.ignore_msg Ignoruj CA správy +ci.ignore_msg Ignorovať CA správy ci.init_failed Chybná inicializácia modulu ci.init_ok Inicializácia modulu ukončená ci.inserted Vložený modul do šachty ci.removed Odstránený modul zo šachty ci.reset Resetnúť ci.reset_standby Resetovať po spustení -ci.save_pincode Uložiť PIN kód +ci.save_pincode Uložiť PIN-kód ci.settings Podmienený prístup ci.timeout Čas čakania uplynul,\nvraciam sa do menu -ci.tuner Použiť CI len s tunerom: -ci.use Použiť CI +ci.tuner Použiť CI iba s tunerom: +ci.use Povoliť CI ci.waiting Čakám na odpoveď clock_background Zobraziť pozadie clock_seconds Zobraziť sekundy clock_size_height Výška zobrazenia clock_switch_off Skryť hodiny clock_switch_on Zobraziť hodiny -color.gradient Farebný gradient -color.gradient_a2b color A to B -color.gradient_b2a color B to A -color.gradient_d2l dark nach light -color.gradient_dld dark light dark -color.gradient_l2d light to dark -color.gradient_ldl light dark light +color.gradient Farebný prechod +color.gradient_a2b farba A do B +color.gradient_b2a farba B do A +color.gradient_d2l tmavá -> svetlá +color.gradient_dld tmavá svetlá tmavá +color.gradient_l2d svetlá -> tmavá +color.gradient_ldl svetlá tmavá svetlá color.gradient_mode_direction Smer -color.gradient_mode_direction_hor horizontálne -color.gradient_mode_direction_ver vertikálne -color.gradient_separator_enable Gradient pre Separator +color.gradient_mode_direction_hor horizontálny +color.gradient_mode_direction_ver vertikálny +color.gradient_separator_enable Oddelovacia čiara farebnej výplne colorchooser.alpha Priehľadnosť colorchooser.blue Modrý colorchooser.green Zelený colorchooser.red Červený -colorchooser.save Save +colorchooser.save Uložiť +colormenu.advanced_mode_off Predvolené hodnoty +colormenu.advanced_mode_on Rozšírené voľby colormenu.background Pozadie -colormenu.clock_textcolor Farba čílic +colormenu.clock_textcolor Farba číslic colormenu.contrast_fonts Kontrast písma colormenu.fade Miznúce menu colormenu.font Výber písma @@ -317,25 +328,25 @@ colormenu.osd_preset Druh TV colormenu.sd_preset CRT colormenu.textcolor Farba textu colormenu.themeselect Výber tém -colormenu.timing Čas zobrazenia na OSD +colormenu.timing Čas zobrazenia OSD colormenusetup.menucontent Obsahové okno colormenusetup.menucontent_inactive Neaktívne v obsahovom okne colormenusetup.menucontent_selected Vybrané v obsahovom okne colormenusetup.menuhead Hlavička colorstatusbar.text Text stavového riadku colorthememenu.head Výber vzhľadu -colorthememenu.head2 Nahraj vzhľad -colorthememenu.menu_hints Tipy boxu +colorthememenu.head2 Načítanie vzhľadu +colorthememenu.menu_hints Okno nápovedy colorthememenu.name Názov vzhľadu colorthememenu.neutrino_theme Neutrino colorthememenu.question Použiť vybraný vzhľad? colorthememenu.save Uložiť aktuálny vzhľad -colorthememenu.select1 Uživateľský vzhľad +colorthememenu.select1 Užívateľský vzhľad colorthememenu.select2 Predvolený vzhľad -cpu.freq Cpu kmitočet -cpu.freq_default Predvolený kmitočet -cpu.freq_normal Pracovný kmitočet -cpu.freq_standby Standby kmitočet +cpu.freq Frekvencia CPU +cpu.freq_default Predvolená frekvencia +cpu.freq_normal Pracovná frekvencia +cpu.freq_standby Pohotovostná frekvencia date.Apr Apr date.Aug Aug date.Dec Dec @@ -360,7 +371,7 @@ debug.level Úroveň debug.level_1 normálne debug.level_2 informatívne debug.level_3 detailne -epg.saving Uloženie EPG +epg.saving Ukladanie EPG epgextended.actors Herci epgextended.director Režisér epgextended.guests Hostia @@ -368,36 +379,36 @@ epgextended.original_title Originálny titul epgextended.presenter Produkcia epgextended.year_of_production Rok výroby epglist.noevents Programové informácie (EPG) sú nedostupné... -epgviewer.More_Screenings Podobné relácie na tomto kanály +epgviewer.More_Screenings Podobné relácie na tomto kanáli epgviewer.More_Screenings_short Ďaľšie vysielania epgviewer.age_rating Vekové obmedzenie epgviewer.audio Zvuk epgviewer.genre Žáner epgviewer.length Dĺžka (min.) epgviewer.nodetailed Detailné informácie sú nedostupné -epgviewer.notfound Nenájdené programové informácie (EPG) -eventfinder.fsk Filtrovať vek -eventfinder.genre Filtrovať žáner -eventfinder.head Hľadaj v EPG +epgviewer.notfound EPG nenájdené +eventfinder.fsk Filter hodnotenia veku +eventfinder.genre Filter žánru +eventfinder.head Hľadať v EPG eventfinder.history Hľadať históriu eventfinder.keyword Slovo eventfinder.max_history Max. počet výsledkov -eventfinder.search hľadaj +eventfinder.search Hľadať eventfinder.search_all_epg Všade -eventfinder.search_within_epg Hľadaj v EPG -eventfinder.search_within_list Hľadaj v zozname +eventfinder.search_within_epg Hľadať v EPG +eventfinder.search_within_list Hľadať v zozname eventfinder.searching Hľadám slovo v EPG... -eventfinder.start_search Spusti hľadanie -eventlist.additional Podrobnejšie informácie -eventlist.name Zoznam relácií -eventlistbar.channelswitch prepni -eventlistbar.eventsort triedenie -eventlistbar.recordevent nahraj -extra.add_to_bouquet Pridanie do buketu +eventfinder.start_search Spustiť hľadanie +eventlist.additional Podrobnejšie informácie EPG +eventlist.name Zoznam udalostí EPG +eventlistbar.channelswitch Prepnúť +eventlistbar.eventsort Triediť +eventlistbar.recordevent Nahrať +extra.add_to_bouquet Pridať do buketu extra.audio_run_player Stlačenie AUDIO spustí prehrávač -extra.auto_delete Auto-mazanie -extra.auto_timeshift Auto-nahrávanie, sec (0=vypnuté) -extra.cache_txt Zachytávanie teletextu +extra.auto_delete Automatické mazanie +extra.auto_timeshift Automatické nahrávanie, sekundy (0 = vypnuté) +extra.cache_txt Vyrovnávacia pamäť teletextu extra.chadded Aktuálny kanál bol pridaný do vybraného buketu....\n extra.chalreadyinbq Aktuálny kanál sa už nachádza vo vybranom bukete....\n extra.dboxinfo Informácie o systéme @@ -409,7 +420,7 @@ extra.dboxinfo_load Zaťaženie extra.dboxinfo_memory Pamäť extra.dboxinfo_ram RAM extra.dboxinfo_size Celkom -extra.dboxinfo_swap Swap +extra.dboxinfo_swap SWAP extra.dboxinfo_time Čas extra.dboxinfo_timeformat %F, %H:%M:%S extra.dboxinfo_uptime Beží @@ -429,42 +440,43 @@ extra.fec_9_10 9/10 extra.fec_auto Auto extra.key_current_transponder Aktuálny kľúč transpondéra extra.key_format_mode Mód obrazu -extra.key_help Tlačítko nápovedy +extra.key_help Tlačidlo nápovedy extra.key_list_end Na koniec extra.key_list_start Na začiatok -extra.key_next43mode Ďaľší pomer +extra.key_next43mode Nasledujúci pomer strán extra.key_pic_mode Formát obrazu extra.key_pic_size Zobrazenie formátu 4:3 -extra.key_pip_close Spustiť/Zastaviť PiP +extra.key_pip_close Spustiť / Zastaviť PiP extra.key_pip_setup Nastavenie PiP extra.key_pip_swap Prehodiť PiP/Hlavný obraz -extra.key_plugin Tlačítko zobrazujúce doplnky -extra.key_record Tlačítko nahrávania -extra.key_screenshot Tlačítko zosnímania obrazovky +extra.key_plugin Tlačidlo zobrazujúce doplnky +extra.key_record Tlačidlo nahrávania +extra.key_screenshot Tlačidlo zosnímania obrazovky extra.key_switchformat Ďaľšie rozlíšenie extra.key_timeshift Časový posun -extra.key_unlock Odblokuj +extra.key_unlock Odblokovanie extra.ladirection Umiestnenie zem.šírky extra.latitude Zem.šírka [N/S] -extra.loadconfig Nahraj nastavenia z ... -extra.loadkeys Nahraj nastavenia kláves z ... +extra.loadconfig Neutrino-HD: Obnoviť nastavenia z... +extra.loadkeys Obnoviť nastavenia kláves z ... extra.lodirection Umiestnenie zem.dľžky extra.longitude Zem.dľžka [E/W] extra.menu_left_exit "Ľavý" = návrat menu extra.north Severne -extra.record_time Rýchly čas nahrávania (hodiny) -extra.record_time_ts Maximálna dĺžka časového posuvu +extra.record_time Maximálny čas nahrávania +extra.record_time_ts Maximálna dĺžka časového posunu extra.rotor_swap Vymeniť východ/západ motoru extra.rounded_corners Vzhľad rohov extra.rounded_corners_off hranatý extra.rounded_corners_on zaoblený -extra.saveconfig Ulož nastavenia ako ... -extra.savekeys Ulož nastavenia kláves -extra.scrambled_message Správa kódovania +extra.saveconfig Neutrino-HD: Uložiť nastavenia do... +extra.savekeys Uložiť nastavenia kláves do ... +extra.scrambled_message Správa o kódovaní extra.show_mute_icon Ikona umlčania pri hlasitosti 0 extra.sms_channel Mód SMS pre kanál +extra.sms_movie SMS filmový mód extra.south Južne -extra.start_tostandby Spustenie do stavu pripravenosti +extra.start_tostandby Spustenie do pohotovostného režimu extra.temp_timeshift Dočasný časový posun extra.timeshift_pause Pozastavenie časového posunu extra.tp_bandwidth Šírka pásma @@ -478,7 +490,7 @@ extra.tp_bandwidth_auto Auto extra.tp_coderate_hp Coderate(HP) extra.tp_coderate_lp Coderate(LP) extra.tp_constellation Konštelácia -extra.tp_delsys Odbavovací systém +extra.tp_delsys Systém príjmu extra.tp_delsys_dss DSS extra.tp_delsys_dtmb DTMB extra.tp_delsys_dvbc DVB-C @@ -491,8 +503,8 @@ extra.tp_delsys_isdbc ISDB-C extra.tp_delsys_isdbs ISDB-S extra.tp_delsys_isdbt ISDB-T extra.tp_delsys_turbo Turbo -extra.tp_fec FEC -extra.tp_freq Kmitočet +extra.tp_fec Korekcia chybovosti (FEC) +extra.tp_freq Frekvencia extra.tp_gi Ochranný interval extra.tp_gi_19_128 19/128 extra.tp_gi_19_256 19/256 @@ -522,14 +534,14 @@ extra.tp_mod_64 QAM/64 extra.tp_mod_8 8PSK extra.tp_mod_auto QAM/AUTO extra.tp_pilot Pilot -extra.tp_pilot_auto Automaticky (HW) -extra.tp_pilot_auto_sw Automaticky (SW) +extra.tp_pilot_auto Auto (HW) +extra.tp_pilot_auto_sw Auto (SW) extra.tp_pol Polarizácia extra.tp_pol_h H extra.tp_pol_l L extra.tp_pol_r R extra.tp_pol_v V -extra.tp_rate Symbolová rýchlosť +extra.tp_rate Symbolová rýchlosť (SR) extra.tp_transmit_mode Vysielací režim extra.tp_transmit_mode_16k 16K extra.tp_transmit_mode_1k 1K @@ -540,7 +552,7 @@ extra.tp_transmit_mode_8k 8K extra.tp_transmit_mode_auto Auto extra.tp_transmit_mode_c1 C1 extra.tp_transmit_mode_c3780 C3780 -extra.update_dir Adresár aktualizácie +extra.update_dir Zložka aktualizácie extra.use_gotoxx Použi gotoXX extra.volume_digits Hlasitoť číselne extra.volume_pos Ukazovateľ hlasitosti @@ -551,33 +563,33 @@ extra.zapit_fe_timeout Časový limit naladenia (1 = 10 msek) extra.zapit_hvoltage 18V pri točení motora extra.zapit_make_bouquet Vykonaj ostatné zoznamy kanálov extra.zapit_motor_speed Rýchlosť točenia (10 = 1st/sek) -extra.zapit_scanpids Vyhľadávanie s PIDmi -extra.zapit_sdt_changed Zmenené kanály, načítavam nastavenia. +extra.zapit_scanpids Vyhľadať a použiť PIDy (Packet Identifier) +extra.zapit_sdt_changed Kanály zmenené, načítavanie nastavenia... fan_speed Rýchlosť CPU ventilátora favorites.addchannel Aktuálny kanál bude pridaný \ndo buketu "Obľúbené". \nTo potrvá niekoľko sekúnd... favorites.bouquetname Obľúbené favorites.bqcreated Buket "Obľúbené" bol vytvorený...\n favorites.chadded Aktuálny kanál bol pridaný do obľúbených...\n favorites.chalreadyinbq Aktuálny kanál sa už nachádza v obľúbených...\n -favorites.copy Kopíruj buket do Obľúbených -favorites.finalhint \nPouži editor buketov pre dokonačenie\nzmien v obľúbených.\n -favorites.menueadd Pridaj kanál do obľúbených +favorites.copy Kopírovať buket do Obľúbených +favorites.finalhint \nPoužiť editor buketov pre dokončenie\nzmien v obľúbených.\n +favorites.menueadd Pridať kanál do obľúbených favorites.nobouquets Obľúbené sú dostupné len pri použití Buketov. filebrowser.add Pridať filebrowser.delete Zmazať -filebrowser.denydirectoryleave Hlavný adresár -filebrowser.dodelete1 zmaž +filebrowser.denydirectoryleave Hlavná zložka +filebrowser.dodelete1 Zmazať filebrowser.dodelete2 ? -filebrowser.filter.active filtruj -filebrowser.filter.inactive nefiltruj +filebrowser.filter.active Filtrovať +filebrowser.filter.inactive Nefiltrovať filebrowser.head Prehliadač súborov -filebrowser.mark označ -filebrowser.nextpage nasl.strana +filebrowser.mark Označiť +filebrowser.nextpage Nasl.strana filebrowser.pm Manažér prehrávania -filebrowser.prevpage pred.strana +filebrowser.prevpage Predch.strana filebrowser.scan Prehľadanie adesára -filebrowser.select výber -filebrowser.showrights Zobraz práva súborov +filebrowser.select Výber +filebrowser.showrights Zobraziť práva súborov filebrowser.sort.date (dátum) filebrowser.sort.name (súbory) filebrowser.sort.namedirsfirst (kat,súbory) @@ -591,89 +603,91 @@ flashupdate.apply_settings Preniesť aktuálne nastavenia do nového image? flashupdate.autocheck Automatická kontrola aktualizácií pri zavádzaní flashupdate.cantopenfile Otvorenie súboru nemožné flashupdate.cantopenmtd Otvorenie MTD-zariadenia nemožné -flashupdate.checkupdate_internet Skontrolovať aktualizácie on-line +flashupdate.checkupdate_internet Kontrola aktualizácie cez sieť flashupdate.checkupdate_local Lokálna aktualizácia -flashupdate.copy_image Kopítrovať Image do hlavnej pamäte +flashupdate.copy_image Kopíruje sa Image do hlavnej pamäte flashupdate.createimage Uložiť Image flashupdate.createimage_add_env Pridať "env" flashupdate.createimage_add_kernel Pridať "kernel" -flashupdate.createimage_add_root1 Pridať "root1" +flashupdate.createimage_add_root1 Pridať 'root1' flashupdate.createimage_add_spare Pridať "spare" flashupdate.createimage_add_u_boot Pridať "u-boot" flashupdate.createimage_add_uldr Pridať "uldr" -flashupdate.createimage_add_var Pridať "var" +flashupdate.createimage_add_var Pridať 'var' flashupdate.createimage_menu Uložiť aktuálny softvér flashupdate.createimage_options Nastavenia -flashupdate.createimage_other Vytvorenie Image pre %s STB +flashupdate.createimage_other Vytvoriť Image pre %s STB flashupdate.createimage_warning Bude vytvorený Image pre %s STB.\nTento Image bude možné spustiť iba na %s STB!\n \nSkutočne pokračovať ? flashupdate.currentversion_sep Aktuálna verzia -flashupdate.currentversiondate Dátum -flashupdate.currentversiontime Hodina +flashupdate.currentversiondate Dátum: +flashupdate.currentversiontime Hodina: flashupdate.erasefailed Vymazanie pamäte FLASH sa nepodarilo flashupdate.erasing Mazanie pamäte FLASH -flashupdate.experimentalimage Vybraný IMAGE je testovacou verziou\na môže spôsobiť chybu zavádzania po inštalácii.\n\nNaozaj chceš nainštalovať túto verziu? +flashupdate.experimentalimage Zvolený softvér je testovacou verziou\na môže spôsobiť chybu zavádzania po inštalácii.\n\nNaozaj chcete nainštalovať túto verziu? flashupdate.expertfunctions Doplnkové funkcie flashupdate.fileis0bytes Veľkosť súboru je 0 bajtov flashupdate.fileselector Výber súboru -flashupdate.flashreadyreboot Nainštalovanie IMAGE je správne.\nBox sa opätovne spustí. +flashupdate.flashreadyreboot Softvér bol úspešne nainštalovaný.\nPrijímač sa opätovne spustí. flashupdate.getinfofile Získavanie informácie o verzii -flashupdate.getinfofileerror Nie je možné zistiť verziu +flashupdate.getinfofileerror Nie je možné zistiť verziu aktualizácie! flashupdate.getupdatefile Získavanie aktualizácie -flashupdate.getupdatefileerror Nie je možná aktualizácia +flashupdate.getupdatefileerror Aktualizácia nie je možná! flashupdate.globalprogress Celkový postup: -flashupdate.head SW aktualizácia -flashupdate.md5check Kontrola IMAGE -flashupdate.md5sumerror IMAGE má chyby +flashupdate.head Aktualizácia softvéru +flashupdate.install_image Aktualizovať stiahnutý softvér? +flashupdate.install_package Nainštalovať stiahnutý balík? +flashupdate.md5check Kontrola softvéru +flashupdate.md5sumerror Softvér má chyby flashupdate.menu_apply_kernel Nahranie jadra (kernelu) flashupdate.menu_apply_settings Povoliť aplikovanie nastavení -flashupdate.mkfs_create_image Vytvoriť Image -flashupdate.mkfs_preparing_files Pripraviť súbory a adresáre +flashupdate.mkfs_create_image Vytvoriť zálohu +flashupdate.mkfs_preparing_files Pripraviť súbory a zložky flashupdate.mkfs_using_sumtool Použiť "sumtool" -flashupdate.msgbox Zistený nový súbor:\nDátum: %s, %s\nZákledné Image: %s\nTyp: %s\n\nNaozaj prevziať a nainštalovať\ntento súbor? -flashupdate.msgbox_manual Zistený nový súbor:\nDátum: %s, %s\nZákladné Image: %s\nTyp IMAGE: %s\n\nNaozaj nainštalovať\ntento súbor? +flashupdate.msgbox Nájdená nová verzia:\nDátum: %s, %s\nZákladný Image: %s\nTyp: %s\n\nChcete stiahnúť a nainštalovať\ntúto verziu? +flashupdate.msgbox_manual Nájdená nová verzia:\nDátum: %s, %s\nZákladný Image: %s\nTyp Image: %s\n\nChcete nainštalovať\ntúto verziu? flashupdate.mtdselector Výber partície flashupdate.namemode1 Názov súboru nastavení flashupdate.namemode1_default +settings.img flashupdate.namemode1_hostname_time +<Čas>+settings.img flashupdate.namemode1_orgname_time +<Čas>+settings.img -flashupdate.namemode2 Zálohovanie súboru +flashupdate.namemode2 Názov súboru zálohy flashupdate.namemode2_default +<Čas>.img flashupdate.namemode2_hostname_time +<Čas>+.img -flashupdate.new_found Nájdený nový IMAGE ! -flashupdate.new_notfound Žiadny nový IMAGE -flashupdate.noversion Kontrola verzie je momentálne podporovaná len pri aktualizácii cez web.\nSkutočne chcet inštalovať tento IMAGE? +flashupdate.new_found Dostupná nová aktualizácia! +flashupdate.new_notfound Aktualizácia nie je k dispozícii +flashupdate.noversion Kontrola verzie je momentálne podporovaná len pri aktualizácii cez web.\nSkutočne chcete inštalovať túto verziu? flashupdate.programmingflash Programovanie pamäte FLASH flashupdate.proxypassword Heslo -flashupdate.proxypassword_hint1 Vloženie hesla servera proxy +flashupdate.proxypassword_hint1 Vloženie hesla proxy servera flashupdate.proxypassword_hint2 Prázdne pole znamená nepoužitie hesla -flashupdate.proxyserver Názov servera proxy +flashupdate.proxyserver Názov proxy servera flashupdate.proxyserver_hint1 Vloženie názovu servera proxy alebo IP (host:port) flashupdate.proxyserver_hint2 Prázdne pole znamená nepoužitie proxy servera -flashupdate.proxyserver_sep Server proxy +flashupdate.proxyserver_sep Proxy server flashupdate.proxyusername Užívateľ -flashupdate.proxyusername_hint1 Vloženie mena uživateľa servera proxy +flashupdate.proxyusername_hint1 Vloženie mena užívateľa proxy servera flashupdate.proxyusername_hint2 Prázdne pole znamená nepoužite autorizácie -flashupdate.read_directory_not_exist Zálohovací adresár %s \nneexistuje! +flashupdate.read_directory_not_exist Zálohovacia zložka %s \nneexistuje! flashupdate.read_no_available_space Maximálna dostupná veľkosť miesta v %s \nje %d KB, potrebné sú ale %d KB.\n \nOperácia sa zruší, vyberte iný disk! flashupdate.read_volume_error Veľkosť disku %s \nnie je možné zistiť! -flashupdate.readflash Načítanie celého IMAGE z pamäte FLASH +flashupdate.readflash Načítanie celého softvéru z pamäte FLASH flashupdate.readflashmtd Uloženie jednej partície -flashupdate.ready Hotovo. +flashupdate.ready Hotovo flashupdate.reallyflashmtd Naozaj vykonať programovanie?\n\nV prípade výskytu chyby alebo nesprávneho súboru\n box nenabehne.\n\nNázov súboru: %s\nCieľ: %s flashupdate.savesuccess IMAGE bol úspešne uložený \nako %s. -flashupdate.selectimage Dostupné súbory +flashupdate.selectimage Dostupné verzie / súbory flashupdate.settings Aktualizácia nastavení -flashupdate.titlereadflash Načítanie pamäte FLASH -flashupdate.titlewriteflash Zapísanie pamäte FLASH -flashupdate.update_with_settings_del_skipped Adresár [%s] nebol vymazaný. Zadanie je preskočené. +flashupdate.titlereadflash Načítavanie pamäte FLASH +flashupdate.titlewriteflash Zapisovanie pamäte FLASH +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... -flashupdate.update_with_settings_skipped Adresár [%s] nebol uložený. Zadanie je preskočené. +flashupdate.update_with_settings_skipped Zložka [%s] nebola uložená. Zadanie je prerušené. flashupdate.update_with_settings_successfully Nastavenie úspešne prevzaté.\nIMAGE sa môže nahrať. -flashupdate.update_with_settings_warning Pozor nahrávanie!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. Pravdepodobne \n je málo miesta na dokončenie operácie...\n \nSkutočne chcete pokračovať? +flashupdate.update_with_settings_warning Varovanie flash pamäte!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. Pravdepodobne \n je málo miesta na dokončenie operácie...\n \nSkutočne chcete pokračovať? flashupdate.updatemode Spôsob aktualizácie flashupdate.updatemode_internet Internet -flashupdate.updatemode_manual Lokálny adresár +flashupdate.updatemode_manual Lokálna zložka flashupdate.url_file Konfiguračný súbor flashupdate.versioncheck Kontrola verzie flashupdate.writeflash Zapísanie celého IMAGE do pamäte FLASH @@ -682,7 +696,7 @@ flashupdate.wrongbase Vaša verzia je odlišná.\nPokračovať? fontmenu.channellist Zoznam kanálov fontmenu.epg EPG fontmenu.eventlist Programový sprievodca -fontmenu.head Nastavenia písma +fontmenu.head Nastavenie písma fontmenu.infobar Informačná lišta fontmenu.menu Menu fontmenu.other Iné @@ -692,7 +706,7 @@ fontmenu.scaling_x_hint2 Vodorovne (v %) min 50 / max 200 fontmenu.scaling_y Zvislo (v %) fontmenu.scaling_y_hint2 Zvislo (v %) min 50 / max 200 fontmenu.sizes Veľkosti písma -fontsize.channel_num_zap priamy výber +fontsize.channel_num_zap Priamy výber fontsize.channellist Zoznam kanálov fontsize.channellist_descr Popis fontsize.channellist_event Prehľad relácií @@ -701,23 +715,23 @@ fontsize.epg_date Dátum EPG fontsize.epg_info1 Informácia EPG 1 fontsize.epg_info2 Informácia EPG 2 fontsize.epg_title Titul EPG -fontsize.eventlist_datetime Dátum/Čas EPG +fontsize.eventlist_datetime Dátum / Čas EPG fontsize.eventlist_event Udalosť EPG fontsize.eventlist_itemlarge Veľké EPG fontsize.eventlist_itemsmall Malé EPG fontsize.eventlist_title Titul EPG fontsize.filebrowser_item Položka prehliadača súborov -fontsize.hint Inicializácia písma,\nprosím čakaj... +fontsize.hint Inicializácia písma,\nčakajte prosím... fontsize.infobar_channame Názov kanálu fontsize.infobar_info Informácia na informačnej lište +fontsize.infobar_ng_ecminfo ECM Informácia fontsize.infobar_number Kanál na informačnej lište -fontsize.infobar_small Malá informačná lišta fontsize.menu Text menu fontsize.menu_hint Popis menu fontsize.menu_info Informačné menu fontsize.menu_title Titulok menu fontsize.subtitles Text titulkov -fsk.all Vypnuté +fsk.all vyp fsk.from_12 od 12 fsk.from_16 od 16 fsk.from_18 od 18 @@ -731,42 +745,42 @@ hdd_20min 20 minút hdd_30min 30 minút hdd_5min 5 minút hdd_60min 60 minút -hdd_activate Použi nastavenia +hdd_activate Použiť nastavenia hdd_check Kontrola súborového systému -hdd_check_failed Chyba kontroly disku ! -hdd_check_format_bad Kontrola diskov s formátom %s ak je nepodporovaný. -hdd_extended_settings Rozšírené nastavenia disku -hdd_fast rýchle +hdd_check_failed Chyba kontroly disku! +hdd_check_format_bad Kontrola diskov s formátom %s nie je podporovaná. +hdd_extended_settings Rozšírené nastavenie disku +hdd_fast Rýchlo hdd_format Formátovanie HDD -hdd_format_failed Chyba počas formátovania disku ! +hdd_format_failed Chyba formátovania disku! hdd_format_warn Naozaj formátovať? Všetky dáta budú stratené! hdd_fs Súborový systém hdd_fs_unknown neznámy hdd_manage Spravovanie HDD -hdd_middle stredne +hdd_middle Stredne hdd_mount Pripojenie hdd_mount_failed Chyba pripojenia. hdd_mount_ok Zariadenie pripravené k používaniu. hdd_mount_umount Pripojenie/Odpojenie hdd_noise Hlučnosť (AAM) -hdd_not_found Nenájdený disk +hdd_not_found Disk nenájdený hdd_removable_device Odstrániteľné zariadenie -hdd_set_recdir Použiť zariadenie k nahrávaniu ? -hdd_settings Nastavenia HDD/USB -hdd_sleep Čas uspania -hdd_slow pomaly +hdd_set_recdir Použiť zariadenie k nahrávaniu? +hdd_settings Nastavenie HDD / USB +hdd_sleep Čas uspania / vypnutia +hdd_slow Pomaly hdd_statfs Zadaná úroveň dotazu -hdd_statfs_always vždy +hdd_statfs_always Vždy hdd_statfs_recording len pri nahrávaní hdd_umount Odpojenie -hdd_umount_warn Chyba počas odpojenia disku ! +hdd_umount_warn Chyba odpájania disku! hdd_umounted Zariadenie odstránené imageinfo.creator Vytvoril: imageinfo.date Dátum: imageinfo.dokumentation Dokumentácia: imageinfo.forum Fórum: -imageinfo.head Informácia o IMAGE -imageinfo.homepage Domov: +imageinfo.head Informácie o softvéri +imageinfo.homepage Adresa: imageinfo.image Image: imageinfo.kernel Jadro: imageinfo.license Licencia: @@ -774,9 +788,7 @@ imageinfo.vcs Git: imageinfo.version Verzia: inetradio.name Internetové rádio infoviewer.epgnotload EPG informácie nie sú načítané... -infoviewer.epgwait čakám na informácie EPG... -infoviewer.eventlist Prehľad EPG -infoviewer.languages Zvuk +infoviewer.epgwait Načítavanie EPG informácie... infoviewer.motor_moving Nastavenie antény infoviewer.next Nasleduje infoviewer.nocurrent Nedostupné informácie pre aktuálny program @@ -784,16 +796,14 @@ infoviewer.noepg EPG je nedostupné infoviewer.notavailable Kanál (teraz) nedostupný infoviewer.now Teraz infoviewer.selecttime Časy začatia -infoviewer.streaminfo Infodoplnky infoviewer.subchan_disp_pos Zobrazenie podkanálov -infoviewer.subchan_infobar Celé info -infoviewer.subservice Doplnkové služby -infoviewer.waittime Načítavanie hodín... +infoviewer.subchan_infobar Infolišta +infoviewer.waittime Načítavanie času... ipsetup.hint_1 Použi 0...9 alebo klávesy NAHOR/NADOL ipsetup.hint_2 OK = uloženie, EXIT = zrušenie keybindingmenu.RC Nastavenie ovládača -keybindingmenu.addrecord Pridanie nahrávania -keybindingmenu.addremind Pridanie zmeny kanálu +keybindingmenu.addrecord Pridať časovač nahrávania +keybindingmenu.addremind Pridať časovač prepnutia keybindingmenu.allchannels_on_ok Všetky kanály keybindingmenu.bouquetchannels_on_ok Aktuálny buket keybindingmenu.bouquetdown Predchádzajúci buket @@ -804,17 +814,17 @@ keybindingmenu.cancel Zatvorenie zoznamu kanálov keybindingmenu.channeldown Nasledujúci kanál keybindingmenu.channellist Zoznam kanálov keybindingmenu.channelup Predchádzajúci kanál -keybindingmenu.edit Úprava -keybindingmenu.head Nastavenie klávesov -keybindingmenu.lastchannel Späť na posledný kanála +keybindingmenu.edit Upraviť nastavenia kláves +keybindingmenu.head Nastavenia kláves +keybindingmenu.lastchannel Späť na posledný kanál keybindingmenu.longkeypress_duration Dlhý stisk klávesy keybindingmenu.misc Rôzne -keybindingmenu.mode_left_right_key_tv Činnosť Ľavého/Pravého kurzora v TV režime -keybindingmenu.mode_left_right_key_tv_infobar Zobraz informačnú lištu +keybindingmenu.mode_left_right_key_tv Činnosť ľavého / pravého kurzora v TV režime +keybindingmenu.mode_left_right_key_tv_infobar Zobraziť informačnú lištu keybindingmenu.mode_left_right_key_tv_volume Ovládanie hlasitosti keybindingmenu.mode_left_right_key_tv_vzap Virtuálne prepnutie keybindingmenu.mode_left_right_key_tv_zap Prepnutie -keybindingmenu.modechange Zmena spôsobu +keybindingmenu.modechange Zmena režimu keybindingmenu.navigation Navigácia keybindingmenu.pagedown Nasledujúca strana keybindingmenu.pageup Predchádzajúca strana @@ -825,7 +835,7 @@ keybindingmenu.remotecontrol_hardware_coolstream CST keybindingmenu.remotecontrol_hardware_dbox d-box Nokia keybindingmenu.remotecontrol_hardware_msg_part1 Diaľkové ovládanie bolo zmenené z ' keybindingmenu.remotecontrol_hardware_msg_part2 ' na ' -keybindingmenu.remotecontrol_hardware_msg_part3 \nJe to správne ?\nProsím potvrdiť tento výber do 15 sekúnd použitím nového ovládača.\nInak bude výber vrátený. +keybindingmenu.remotecontrol_hardware_msg_part3 \nJe to správne ?\nPotvrďte prosím tento výber do 15 sekúnd použitím nového ovládača,\ninak bude výber zrušený. keybindingmenu.remotecontrol_hardware_philips Philips keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon keybindingmenu.repeatblock Základné oneskorenie @@ -834,48 +844,53 @@ keybindingmenu.sort Zmena poradia triedenia keybindingmenu.special_active Špeciálne klávesy keybindingmenu.subchanneldown Predchádzajúci podkanál keybindingmenu.subchannelup Nasledujúci podkanál -keybindingmenu.tvradiomode TV/Rádio +keybindingmenu.tvradiomode TV / Rádio keybindingmenu.video Obraz keybindingmenu.volume Hlasitosť keybindingmenu.volumedown Znížiť keybindingmenu.volumeup Zvýšiť keybindingmenu.zaphistory História prepínania buketov -keychooser.head Nastvenie nového klávesu -keychooser.text1 Stlač kláves -keychooser.text2 Čakám na stlačenie -keychoosermenu.currentkey aktuálny kláves -keychoosermenu.setnew Nastavenie nového klávesu +keychooser.head Nastavenie novej klávesy +keychooser.text1 Stlačte prosím klávesu +keychooser.text2 Čaká sa na stlačenie +keychoosermenu.currentkey Aktuálna klávesa +keychoosermenu.setnew Nastavenie novej klávesy keychoosermenu.setnone Zrušenie priradenia -languagesetup.head Nastavenie jazyka +languagesetup.head Jazyk / Časové pásmo languagesetup.osd Jazyk OSD -languagesetup.select Jazyk1 -lcd_info_line Zobrazenie v inforiadku +languagesetup.select Jazyk +lcd_info_line Zobrazenie v infolište lcd_info_line_channel Názov kanálu lcd_info_line_clock Hodiny lcdcontroler.brightness Jas -lcdcontroler.brightnessdeepstandby Jas v hlbokom spánku -lcdcontroler.brightnessstandby Jas v spánku -lcdmenu.dim_brightness Jas po zhasnutí +lcdcontroler.brightnessdeepstandby Jas vo vypnutom stave +lcdcontroler.brightnessstandby Jas v pohotovostnom režime +lcdmenu.dim_brightness Jas po uplynutí času zhasnutia lcdmenu.dim_time Čas zhasnutia lcdmenu.head Nastavenie VFD lcdmenu.lcdcontroler Jas +lcdmenu.notify_rclock Upozorniť na uzamknuté DO lcdmenu.scroll Povoliť pohyb textu lcdmenu.statusline Stavový riadok lcdmenu.statusline.both hlasitosť/odohratý čas -lcdmenu.statusline.playtime odohratý čas -lcdmenu.statusline.volume hlasitosť +lcdmenu.statusline.playtime Odohratý čas +lcdmenu.statusline.volume Hlasitosť ledcontroler.backlight Podsvietené tlačidlá ledcontroler.backlight.tv TV režim -ledcontroler.blink Blikať v hlbokom spánku ak je nastavený časovač -ledcontroler.menu Podsvietenie Power tlačítka -ledcontroler.mode.deepstandby Hlboký spánok +ledcontroler.blink Blikať pri vypnutí, ak je nastavený časovač +ledcontroler.menu Podsvietenie tlačidla napájania +ledcontroler.mode.deepstandby Vypnutie ledcontroler.mode.record Blikať pri nahrávaní -ledcontroler.mode.standby Pripravenosť +ledcontroler.mode.standby Pohotovostný režim ledcontroler.mode.tv TV režim ledcontroler.off Led1 a Led2 vyp. ledcontroler.on.all Led1 a Led2 zap. ledcontroler.on.led1 Led1 zap. ledcontroler.on.led2 Led2 zap. +livestream.head Online data +livestream.read_data Načítavanie dát... +livestream.resolution Rozlíšenie +livestream.scriptpath Script path lua.boolparam_deprecated1 Upozornenie! lua.boolparam_deprecated2 Použité číslo alebo reťazec lua.boolparam_deprecated3 pre Boolean parameter je zastarané.\n Prosím použiť prirodzenú bool hodnotu napr. @@ -883,54 +898,63 @@ lua.function_deprecated1 Upozornenie! lua.function_deprecated2 Funkcia lua.function_deprecated3 je kritická,\n prosím použiť lua.parameter_deprecated2 Parameter -lua.versionscheck1 Vaša Lua API veryia je zastaralá -lua.versionscheck2 Je vyžadovaná novšia +lua.versionscheck1 Verzia API je príliš stará +lua.versionscheck2 Je potrebná minimálne mainmenu.audioplayer Prehrávač hudby mainmenu.channels Zoznam kanálov -mainmenu.clearsectionsd Vyčistenie EPG zachytávania +mainmenu.clearsectionsd Vyčistenie uloženého EPG mainmenu.games Hry mainmenu.head Hlavné menu -mainmenu.lua Doplnky +mainmenu.lua Lua doplnky mainmenu.media Média mainmenu.movieplayer Prehrávač filmov mainmenu.pausesectionsd Načítavanie EPG mainmenu.pictureviewer Prehliadač obrázkov mainmenu.radiomode Rádio -mainmenu.reboot Reboot +mainmenu.reboot Reštartovať mainmenu.recording Nahrávanie mainmenu.recording_start Spustiť mainmenu.recording_stop Zastaviť mainmenu.scripts Skripty -mainmenu.service Služby +mainmenu.service Inštalácia / služby mainmenu.settings Nastavenia mainmenu.shutdown Vypnúť -mainmenu.shutdown_menu Nastavenie vypnutia +mainmenu.shutdown_menu Vypnutie... mainmenu.sleeptimer Časovač vypnutia -mainmenu.standby Pohotovostný stav +mainmenu.standby Pohotovostný režim mainmenu.tools Nástroje -mainmenu.tvmode TV -mainmenu.tvradio_switch Prepnutie TV-Rádio +mainmenu.tvmode TV mód +mainmenu.tvradio_switch Prepnutie TV / Rádio mainsettings.audio Zvuk mainsettings.head Nastavenia -mainsettings.keybinding Nastavenia kláves +mainsettings.keybinding Nastavenie kláves mainsettings.language Jazyk / Časové pásmo -mainsettings.lcd Zobrazovač VFD -mainsettings.manage Spravovanie nastavení -mainsettings.misc Iné nastavenia +mainsettings.lcd Predný panel / VFD +mainsettings.manage Správa nastavení +mainsettings.misc Rôzne nastavenia mainsettings.multimedia Multimédia mainsettings.network Sieť -mainsettings.osd Nastavenia OSD +mainsettings.osd Nastavenie OSD mainsettings.recording Nahrávanie -mainsettings.savesettingsnow Uloženie nastavenia -mainsettings.savesettingsnow_hint Ukladanie nastavení,\nprosím čakaj... +mainsettings.savesettingsnow Uloženie nastavení +mainsettings.savesettingsnow_hint Ukladanie nastavení,\nčakajte prosím... mainsettings.timezone Časová zóna mainsettings.video Obraz -menu.back späť -menu.cancel zrušiť -menu.hint_a_pic Nastavenie prehrávača hudby a obrázkového prehliadača +mbkey.copy_onefile Kopírovať film +mbkey.copy_several Kopírovať a rozdeliť film +mbkey.cover Vytvoriť/odstrániť náhľad filmu +mbkey.cut Vystrihnúť film +mbkey.truncate Skrátiť film +menu.back Späť +menu.cancel Zrušiť +menu.hint_a_pic Nastavenie prehrávača hudby, prehliadača obrázkov, WebTV, TS, YouTube +menu.hint_adzap Automatické prepnutie prepne späť na aktuálny kanál ak uplynie zvolený čas +menu.hint_adzap_active Automatické prepnutie je aktívne. Novým prepnutím bude deaktivované. +menu.hint_adzap_setup Nastavenia služby automatického prepnutia +menu.hint_adzap_writedata Zapísanie dát na základe stavu funkcie automatického prepnutia do zložky /tmp/adzap.data menu.hint_aplay Prehrávanie zvukových súborov -menu.hint_aplay_setup Zmena zobrazenia titulu, východzieho adresára, šetriča a ďaľšieho -menu.hint_audio Audio výstup, DD, SRS TrueVolume \nVoľby +menu.hint_aplay_setup Zmena zobrazenia titulu, predvolená zložka, šetrič obrazovky a ďaľšie +menu.hint_audio Zvukový výstup, Dolby Digital, SRS TrueVolume voľby a iné menu.hint_audio_adjust_vol_ac3 Špecifické nastavenie hlasitosti pre AC3 prúdy menu.hint_audio_adjust_vol_clear Vyčistenie všetkých uložených hodnôt pre PCM a AC3 prúdy menu.hint_audio_adjust_vol_pcm Špecifické nastavenie hlasitosti pre PCM prúdy @@ -943,50 +967,52 @@ menu.hint_audio_srs SRS TruVolume ovládanie hlasitosti \npoužitím zmien obsah menu.hint_audio_srs_algo Účinnosť ovládania, jemná alebo klasická menu.hint_audio_srs_nmgr Potlačovač šumu menu.hint_audio_srs_volume Referenčná úroveň citlivosti -menu.hint_audio_volstart Vždy nastaví zvolenú hodnotu hlasitosti pri spustení +menu.hint_audio_volstart Vždy nastaviť zvolenú hodnotu hlasitosti pri spustení menu.hint_audio_volstep Zvýšenie/zníženie kroku pre klávesy VOL +/- -menu.hint_audioplayer_defdir Prednastavený adresár prehrávača hudby -menu.hint_audioplayer_follow Pohyb vybraného ukazovateľa zoznamu prehrávania\nna aktuálne hrajúcu pieseň +menu.hint_audioplayer_defdir Prednastavená zložka prehrávača hudby +menu.hint_audioplayer_follow Pohyb vybraného ukazateľa zoznamu prehrávania\nna aktuálne hrajúcu pieseň menu.hint_audioplayer_highprio Zvýšenie priority prehrávania -menu.hint_audioplayer_order Zmena triedenia zonamu prehrávania +menu.hint_audioplayer_order Zmena triedenia zoznamu prehrávania menu.hint_audioplayer_playlist Zobrazenie položiek zoznamu prehrávania menu.hint_audioplayer_repeat Použiť opakovanie zoznamu prehrávania pri dosiahnutí konca menu.hint_audioplayer_sc_metadata Použije extrakciu meta-dát z prehrávaného zvuku menu.hint_audioplayer_title Použije SMS štýl vyhľadávania titulov v zozname prehrávania menu.hint_auto_lang Automatické prepnutie zvuku na preferovaný jazyk menu.hint_auto_subs Automatické spustenie titulkov pre preferovaný jazyk -menu.hint_back Návrat do predchádzajúcej položky.\nStlačenie MENU klávesy uzavrie všetky položky +menu.hint_back Návrat do predchádzajúcej položky.\nStlačením tlačidla MENU okamžite opustíte menu. menu.hint_back_brief Návrat do predchádzajúcej ponuky menu.hint_backlight Nastavenie podsvietených tlačidiel -menu.hint_backup Záloha konfigurácií a kanálov do vybraného adresára +menu.hint_backup Záloha konfigurácie a kanálov do vybranej zložky menu.hint_bedit Úprava obľúbených a buketov -menu.hint_buildinfo Informácie o kompileroch, kompilácii, jadre -menu.hint_cache_txt Spustenie zachytávania teletextu po prepnutí kanála +menu.hint_buildinfo Informácie o kompiléroch, kompilácii, jadre +menu.hint_cache_txt Spustenie vyrovnávacej pamäte teletextu po prepnutí kanálu menu.hint_cec_mode CEC režim -menu.hint_cec_standby Ováldanie externými CEC príkazami v pripravenosti -menu.hint_cec_view_on Ovládanie externými CEC príkazami pri sledovaní -menu.hint_channellist_additional Zobrazenie doplnkových informácií\nv hlavnom boxe +menu.hint_cec_standby Ovládanie externými CEC príkazmi v pohotovostnom režime +menu.hint_cec_view_on Ovládanie externými CEC príkazmi pri sledovaní TV +menu.hint_channellist_additional Zobrazenie doplnkových informácií\nv hlavnom okne menu.hint_channellist_epg_align Zarovnanie EPG udalostí menu.hint_channellist_extended Grafické zobrazenie aktuálnej udalosti menu.hint_channellist_fonts Zmena veľkosti písma zoznamu kanálov -menu.hint_channellist_foot Zobrazenie ďaľších informácií\nv dolnom boxe +menu.hint_channellist_foot Zobrazenie ďalších informácií\nv dolnom boxe menu.hint_channellist_mode Použiť vybraný režim zoznamu kanálov pri spustení ak posledný režim je TV menu.hint_channellist_mode_radio Použiť vybraný režim zoznamu kanálov pri spustení ak posledný režim je Radio menu.hint_channellist_setup Konfigurácia GUI volieb zonamu kanálov menu.hint_channellist_show_channellogo Zobrazenie loga staníc v zozname kanálov -menu.hint_channellist_show_channelnumber Zobrazenie čísla kanála v zozname kanálov +menu.hint_channellist_show_channelnumber Zobrazenie čísla kanálu v zozname kanálov menu.hint_channellist_show_empty_favs Zobrazenie / skrytie prázdnych buketov v obľúbených -menu.hint_channellist_show_infobox Zobrazenie / skrytie dolneho InfoBoxu zo zoznamu kanálov -menu.hint_channels Otvorí zoznam kanálov +menu.hint_channellist_show_infobox Zobraziť alebo skryť informačnú lištu na spodnom okraji v zozname kanálov +menu.hint_channels Otvoriť zoznam kanálov menu.hint_ci Nastavovacie menu podmieneného pristupu\npre váš CI CAM alebo vloženú Conax kartu menu.hint_clock_background Zobrazenie hodín s farbami témy vzhľadu menu.hint_clock_mode Zapnutie alebo vypnutie zobrazenia hodín -menu.hint_clock_seconds Zobraenie formátu času so sekundami +menu.hint_clock_seconds Zobrazenie formátu času so sekundami menu.hint_clock_size Nastavenie veľkosti informačných hodín. menu.hint_clock_textcolor Nastavenie ferieb číslic -menu.hint_color_gradient Prepne farebné prechody pre rôzne položky ponuky Zap/Vyp -menu.hint_color_gradient_direction Definujte smer farebného prechodu. -menu.hint_color_gradient_separator_enable Povoliť/zakázať farebný gradient pre menu oddeľovacích liniek +menu.hint_color_gradient Zapína alebo vypína farebné prechody pre rôzne položky ponuky +menu.hint_color_gradient_direction Definícia smeru farebnej výplne. +menu.hint_color_gradient_separator_enable Zakázať/povoliť farebnú výplä pre oddelovacie čiary +menu.hint_colored_events Použiť odlišnú farbu pre aktuálnu alebo nasledujúcu udalosť +menu.hint_colored_events_textcolor Zmena farby pre farebné udalosti v zozname kanálov a na informačnej lište menu.hint_colors Konfigurácia farieb GUI menu.hint_content_back Zmena farby podkladu GUI okna menu.hint_content_textcolor Zmena farby textu GUI okna @@ -994,29 +1020,29 @@ menu.hint_contrast_fonts Zvýraznenie kontrastu pisma (neúčinné pri podklade) menu.hint_dboxinfo Informácia o procesore a úložisku menu.hint_delete_channels Odstránenie všetkých kanálov menu.hint_delete_removed Vymazanie kanálov v bukete "Odstránené kanaly" -menu.hint_epg_cache Maximum dní pre zachytávanie ďaľších udalostí -menu.hint_epg_dir Výber adresára na disku alebo usb \npre uloženie EPG. -menu.hint_epg_extendedcache Maximálny čas zachytávania\npopisov doplňujúcich udalostí +menu.hint_epg_cache Maximálny počet dní pre ukladanie ďalších udalostí +menu.hint_epg_dir Výber zložky na disku alebo usb \npre uloženie EPG. +menu.hint_epg_extendedcache Maximálny čas ukladania\npopisov doplňujúcich udalostí menu.hint_epg_fonts Zmena veľkosti písma okna EPG podrobností -menu.hint_epg_max_events Maximum udalostí zachytávania. Po dosiahnutí hranice\nEPG cache odstráni nasledujúce udalosti -menu.hint_epg_old_events Hodiny po skončení udalosti aby sa označilo\nako staré a odstránilo sa zo zachytávania +menu.hint_epg_max_events Maximálny počet uložených udalostí. Po dosiahnutí hranice\nEPG cache odstráni nasledujúce udalosti +menu.hint_epg_old_events Hodiny po skončení udalosti, kedy sa označí\nako staré a odstráni sa z uložených menu.hint_epg_read Načíta uložené EPG údaje po zavedení z externého zariadenia -menu.hint_epg_save Uloženie zachyteného EPG na disk alebo usb\na načítanie po spustení -menu.hint_epg_save_frequently Uloženie zachyteného EPG v pravidelných intervaloch na externé zariadenie -menu.hint_epg_save_mode Kešovať EPG len pre kanály prítomné v obľúbených buketoch -menu.hint_epg_save_standby Uloženie EPG v režime pripravenosti +menu.hint_epg_save Uloženie EPG na disk alebo usb\pre načítanie po spustení +menu.hint_epg_save_frequently Ukladanie EPG v pravidelných intervaloch na externé zariadenie +menu.hint_epg_save_mode Ukladať EPG iba pre kanály uložené v obľúbených buketoch +menu.hint_epg_save_standby Uložiť EPG pred prechodom do pohotovostného režimu menu.hint_epg_scan Povolenie prehľadávania EPG na pozadí ak je voľný tuner -menu.hint_epg_scan_mode Výber výsledku príjmača pre spustenie prehľadania EPG +menu.hint_epg_scan_mode Výber výsledku prijímača pre spustenie prehľadania EPG menu.hint_eventlist_additional Zobrazí podrobnejšie informácie\nv hlavnom okne menu.hint_eventlist_fonts Zmena veľkosti písma zoznamu udalostí -menu.hint_eventlist_setup Konfigurácia GUI volieb zoznamu udalostí +menu.hint_eventlist_setup Konfigurácia GUI volieb zoznamu udalostí v EPG menu.hint_extended Správa napájania, voľby ukladania/nahrania EPG \nHDMI-CEC, štartovací kanál, voľby prepínania -menu.hint_factory Reset príjmača do výrobného stavu\nPríjmač sa musí rebotovať po resete +menu.hint_factory Reset prijímača do výrobného stavu. Prijímač sa musí po resete zreštartovať. menu.hint_fade Postupné miznutie GUI okien menu.hint_fan_speed Kontrola rýchlosti ventilátora -menu.hint_filebrowser_denydirectoryleave Nepovoliť prehliadaču súborov odísť z hlavného adresára +menu.hint_filebrowser_denydirectoryleave Nepovoliť prehliadaču súborov odísť z hlavnej zložky menu.hint_filebrowser_showrights Zobrazenie oprávnení súboru v prehliadači súborov -menu.hint_fileplay Prehrávanie rôznych obrazových súborov +menu.hint_fileplay Prehrávanie video súborov (mkv, mp4 atd.) menu.hint_filesystem_is_utf8 Kódovanie súborového systemu prehliadača súborov menu.hint_font_gui Výber súboru písma pre GUI menu.hint_font_scaling Zvislé a vodorovné nastavenie globálnej mierky písma @@ -1030,29 +1056,30 @@ menu.hint_hdd_fmt Výber formátu disku menu.hint_hdd_format Vytvorenie HDD partície a jej formátovanie menu.hint_hdd_noise Nastavenie Automatic Acoustic Management\nnie je podporované u všetkých zariadení menu.hint_hdd_sleep Výber času zastavenia disku pri neaktivite -menu.hint_hdd_statfs Určí kedy úroveň zaplnenia adresára nahrávania v "infovieweri" a ak je dostupné bude aktualizované na VFD +menu.hint_hdd_statfs Určiť úroveň zaplnenia zložky nahrávania v "infovieweri" a ak je dostupné, bude aktualizované na VFD menu.hint_hdd_tools Inicializácia HDD, kontrola súborového systému menu.hint_head_back Zmena farby podkladu nadpisu hlavičky menu.hint_head_textcolor Zmena farby nadpisu hlavičky menu.hint_imageinfo Informácia o inštalovanom programe -menu.hint_inact_timer Vypnutie príjmača pri neaktivite +menu.hint_inact_timer Vypnutie prijímača pri neaktivite menu.hint_inactive_back Zmena farby podkladu nektívnej položky menu.hint_inactive_textcolor Zmena farby textu neaktívnej položky menu.hint_inet_radio Internetové rádia -menu.hint_info Informácia o IMAGE, systéme, streame a podmienenom prístupe +menu.hint_info Informácia o softvéri, systéme, streame a podmienenom prístupe menu.hint_infobar_back Zmena farby podkladu informačnej lišty +menu.hint_infobar_buttons_usertitle Vynúti užívateľom definované názvy farebných tlačidiel menu.hint_infobar_casys áno: zobrazí všetko farebne,\n CA mini: jedna ikona zámku, CA mód: len aktívne systémy, nie: nezobrazí -menu.hint_infobar_casys_color Zmena farby pozadia CA-Systému -menu.hint_infobar_casys_dotmatrix Ihličkový CA-Systém v pozadí -menu.hint_infobar_casys_frame áno: CA-Systém s rámom +menu.hint_infobar_casys_color Zmena pozadia farby CA-Systému +menu.hint_infobar_casys_dotmatrix on: CA-Systém s bodmi v pozadí +menu.hint_infobar_casys_frame on: CA-Systém s rámom menu.hint_infobar_dd Zobrazenie DolbyDigital ikony menu.hint_infobar_filesys Zobrazenie úrovne obsadenia pamäte a disku menu.hint_infobar_fonts Zmena veľkosti fontu informačnej lišty -menu.hint_infobar_logo Voľby loga / signálu -menu.hint_infobar_logo_dir Výber adresára pre vyhľadanie loga kanálu +menu.hint_infobar_logo Zobrazenie loga, čísla kanálu a signálu; Voľby v [zátvorkách] budú zobrazené v malom informačnom okne +menu.hint_infobar_logo_dir Výber zložky pre vyhľadanie loga kanálu menu.hint_infobar_on_epg Zobrazenie informačnej lišty pri zmene aktuálnej udalosti EPG menu.hint_infobar_radiotext Zobrazí rádiotext okno -menu.hint_infobar_res Zobrazenie ikony rozlíšenia kanála +menu.hint_infobar_res Zobrazenie ikony rozlíšenia kanálu menu.hint_infobar_sat Zobrazenie aktuálneho satelitného alebo káblového poskytovateľa menu.hint_infobar_setup Nastavenie vlastností informačnej lišty menu.hint_infobar_textcolor Zmena farby textu informačnej lišty @@ -1066,7 +1093,6 @@ menu.hint_key_binding Predefinovanie kláves použitých pre príkazové operác menu.hint_key_bouquetdown Pridelenie klávesy pre zmenu zoznamu kanálov\ndo predchádzajúceho buketu menu.hint_key_bouquetup Pridelenie klávesy pre zmenu zoznamu kanálov\ndo nasledujúceho buketu menu.hint_key_cancel Pridelenie klávesy pre zatvorenie GUI okna -menu.hint_key_channel_sms Ak zapnuté, číselné klávesy v zozname kanálov\nsú použité na hľadanie kanála v SMS štýle menu.hint_key_channeldown Priradenie klávesy pre rýchlu zmenu na predchádzajúci\nkanál v zozname kanálov menu.hint_key_channellist Konfigurácia klávesových skratiek pre zoznam kanálov menu.hint_key_channelup Priradenie klávesy pre rýchlu zmenu na nasledujúci\nkanál v zozname kanálov @@ -1078,7 +1104,8 @@ menu.hint_key_left_exit Povolí návrat do predchádzajúceho menu s klávesou ' menu.hint_key_list_end Priradenie klávesy pre skok na koniec zoznamu menu.hint_key_list_start Priradenie klávesy pre skok na žačiatok zoznamu menu.hint_key_load Nahrá klávesové skratky zo súboru -menu.hint_key_modechange Zmena TV/Rádio režimu a kláves pripravenosti +menu.hint_key_modechange Zmena TV/Rádio režimu a kláves pohotovostného režimu +menu.hint_key_moviebrowser Konfigurácia priradenia kláves prehliadača filmov menu.hint_key_movieplayer Konfigurácia klávesových skratiek pre prehrávač filmov menu.hint_key_mpaudio Priradenie klávesy pre zobrazenie výberu zvuku\nv režime nahrávky menu.hint_key_mpbookmark Priradenie klávesy pre vytvorenie záložky\npočas nahrávky @@ -1096,10 +1123,10 @@ menu.hint_key_pic_mode_active Povolenie/zakázanie klávesy pre zmenu formátu o menu.hint_key_pic_size_active Povolenie/zakázanie klávesy pre zmenu správneho zobrazenia 4:3 menu.hint_key_pip_close Priradenie klávesy pre ukončenie PiP\nalebo spustenia ho na aktuálnom kanály menu.hint_key_pip_setup Priradenie klávesy pre konfiguráciu PiP -menu.hint_key_pip_swap Priradenie klávesy pre zmenu PiP a živého kanála +menu.hint_key_pip_swap Priradenie klávesy pre zmenu PiP a živého kanálu menu.hint_key_plugin Priradenie klávesy pre vykonanie jedného vyskúšania doplnku -menu.hint_key_poweroff Priradenie klávesy pre zmenu stavu napájania\n (pripravenosť/spánok <-> práca) -menu.hint_key_quickzap Konfigurácia klávesových skratiek pre rýchlu\nzmenu kanála +menu.hint_key_poweroff Priradenie klávesy pre zmenu stavu napájania\n (pohotovostný režim/vypnutie <-> práca) +menu.hint_key_quickzap Konfigurácia klávesových skratiek pre rýchlu\nzmenu kanálu menu.hint_key_record Priradenie klávesy pre spustenie nahrávania menu.hint_key_repeatblock Oneskorenie po stlačení klávesy a pred\nprvým opakovním povelu menu.hint_key_repeatblockgeneric Oneskorenie medzi opakovanim povelov\npočas stlačenia klávesy @@ -1110,46 +1137,47 @@ menu.hint_key_sort Priradenie klávesy pre zmenu triedenia zoznamu kanálov menu.hint_key_special_active Povolenie/zakázanie niektorých špeciálnych kláves menu.hint_key_subchanneldown Priradenie klávesy pre rýchlu zmenu\n do predchádzajúceho subkanálu menu.hint_key_subchannelup Priradenie klávesy pre rýchlu zmenu\n do nasledujúceho subkanálu -menu.hint_key_timeshift Priradenie klávesy pre spustenie časového posunu +menu.hint_key_timeshift Priradiť tlačidlo na spustenie časového nahrávania (timeshift) menu.hint_key_transponder Priradenie klávesy pre zobrazenie zoznamu kanálov\nz aktuálneho transpondéra menu.hint_key_tvradiomode Priradenie klávesy pre zmenu TV <> Rádio režimu -menu.hint_key_unlock Priradenie klávesy pre odomknutie poľa ak je zamknuté\nPre odomknutie stlačiť 'RED', potom počas 5 sekúnd to tlačítko +menu.hint_key_unlock Priradenie klávesy pre odomknutie poľa ak je zamknuté\nPre odomknutie stlačiť 'RED', potom počas 5 sekúnd to tlačidlo menu.hint_key_volumedown Priradenie klávesy pre zníženie hlasitosti menu.hint_key_volumeup Priradenie klávesy pre zvýšenie hlasitosti -menu.hint_keys Rýchlosť opakovania diaľkového ovládača\nÚprava väzieb tlačítok +menu.hint_keys Rýchlosť opakovania diaľkového ovládača\nÚprava väzieb tlačidiel menu.hint_lang_pref Konfigurácia preferovaného zvuku, EPG a jazyka titulkov menu.hint_language OSD jazyk, časové pásmo\nPreferovaný zvuk a jazyk titulkov -menu.hint_last_radio Spustenie príjmača na vybranom kanáli\nak posledný režim je Rádio -menu.hint_last_tv Spustenie príjmača na vybranom kanáli\nak posledný režim je TV -menu.hint_last_use Spustenie príjmača na poslednom použitom kanáli +menu.hint_last_radio Spustenie prijímača na vybranom kanáli\nak posledný režim je Rádio +menu.hint_last_tv Spustenie prijímača na vybranom kanáli\nak posledný režim je TV +menu.hint_last_use Spustenie prijímača na poslednom použitom kanáli menu.hint_leds_blink Blikanie LED v režime spánku menu.hint_leds_deepstandby Stav LED v režime spánku menu.hint_leds_record Stav LED počas nahrávania -menu.hint_leds_standby Stav LED v režime pripravenosti +menu.hint_leds_standby Stav LED v pohotovostnom režime menu.hint_leds_tv Funkčný stav LED -menu.hint_load Nahranie GUI nastavení zo súboru +menu.hint_load Načítanie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) zo súboru menu.hint_longkeypress_duration Stlačenie klávesy bude vyhodnotené ako "dlhý stisk klávesy" ak bude stlačené dlhšie ako špecifikovaný čas. menu.hint_lua Spustenie doplnkov -menu.hint_make_hdlist Automaticky vytvorí HD zoznam kanálov na základe\ntypu kanála a názvu -menu.hint_make_newlist Vytvorí zoznam nedávno pridaných kanálov -menu.hint_make_removedlist Vytvorí zoznam nedávno odstránených kanálov -menu.hint_make_webtvlist Automaticky vytvorí WebTV zoznam kanálov na základe\ntypu kanála a názvu -menu.hint_manage_settings Záloha, obnova, východzí stav\nVýrobné nastavenie príjmača -menu.hint_mb Vaše nahrávky +menu.hint_make_hdlist Automaticky vytvorí HD zoznam kanálov na základe\ntypu kanálu a názvu +menu.hint_make_newlist Vytvoriť zoznam nedávno pridaných kanálov +menu.hint_make_removedlist Vytvoriť zoznam nedávno odstránených kanálov +menu.hint_make_webtvlist Automaticky vytvorí WebTV zoznam kanálov na základe\ntypu kanálu a názvu +menu.hint_manage_settings Záloha, obnova, východzí stav, výrobné nastavenie prijímača +menu.hint_mb Vaše nahrávky, prehrávanie súborov .ts +menu.hint_mbkey_cover Priradiť tlačidlo na vytvorenie náhľadu filmu počas prehrávania alebo na vymazanie v prehliadači filmov menu.hint_media Prehrávanie filmov a hudby, prezeranie obrázkov menu.hint_menu_fonts Zmena veľkosti písma menu -menu.hint_menu_hints Zobrazí túto radu. Taktiež môžno zmeniť\nkedykoľvek použitím ´HELP´ tlačítka +menu.hint_menu_hints Zobrazí túto nápovedu. Taktiež môžno kedykoľvek zmeniť použitím tlačidla ´HELP´. menu.hint_menu_pos Výber umiestnenia menu menu.hint_menus Konfigurácia volieb ponuky menu.hint_misc_cec HDMI-CEC voľby menu.hint_misc_channellist HD/Nové/Odstránené zoznamy kanálov, cyklické prepnutie -menu.hint_misc_energy Použitie pripravenosti, oddialené vypnutie\nčasovače neaktivity -menu.hint_misc_epg Voľby uloženia/nahrania EPG, voľby zachytávania EPG,\nEPG adresár uloženia -menu.hint_misc_filebrowser Kódovanie súborového systemu, oprávnenia súboru,\nzákaz odstrániť adresáre -menu.hint_misc_general Spustenie do pripravenosti, zachytávanie teletextu, hdd adresár doplnkov,\núroveň debugovania +menu.hint_misc_energy Použitie pohotovostného režimu, oneskorené vypnutie\nčasovače neaktivity +menu.hint_misc_epg Voľby uloženia/načítania EPG, voľby ukladania EPG,\nEPG zložka uloženia +menu.hint_misc_filebrowser Kódovanie súborového systemu, oprávnenia súboru,\nzákaz odstrániť zložky +menu.hint_misc_general Spustenie do pohotovostného režimu, vyrovnávacia pamäť teletextu, hdd zložka doplnkov,\núroveň debugovania menu.hint_misc_zapit Východzie TV/Radio kanály menu.hint_movie Prehrávanie filmov -menu.hint_moviebrowser_setup Nastavenie výberu a volieb zobrazenia. +menu.hint_moviebrowser_setup Nastavenie výberu a volieb zobrazenia menu.hint_movieplayer_plugin Výber doplnku pre overenie s jedným potvrdením klávesy v režime prehrávača menu.hint_net_broadcast Zadanie adresy vysielania, ak netušíte použite IP adresu s koncom .255 menu.hint_net_dhcp Použije DHCP server pre automatickú konfiguráciu @@ -1157,39 +1185,41 @@ menu.hint_net_djmount Pripojenie UPnP zariadení ako filesystem\npodľa /media/0 menu.hint_net_dropbear Použitie ssh prístupu do boxu menu.hint_net_ftpd Použitie prenosu súboru cez FTP menu.hint_net_gateway Vloženie IP adresy brány smerovača -menu.hint_net_hostname Zmena hosťovacieho názvu príjmača +menu.hint_net_hostname Zmena hosťovacieho názvu prijímača menu.hint_net_if Výber interface pre konfiguráciu -menu.hint_net_ipaddress Vloženie IP adresy vášho príjmača -menu.hint_net_mount Konfigurácia, pripojenie a odpojenie sieťových zdielaní\nNFS a CIFS podpora +menu.hint_net_ipaddress Vloženie IP adresy vášho prijímača +menu.hint_net_mount Konfigurácia, pripojenie a odpojenie sieťových zdielaní. Podpora NFS a CIFS. menu.hint_net_nameserver Zadanie IP adresy DNS servera menu.hint_net_netmask Zadanie sieťovej masky, ak netušíte použite 255.255.255.0 menu.hint_net_nfs_mount Konfigurácia a pripojenie sieťových zdielaní menu.hint_net_nfs_umount Odpojenie sieťových zdielaných pripojení -menu.hint_net_ntp Konfigurácia synchronizácie času -menu.hint_net_ntpenable Použije synchronizáciu času pomocou NTP protokolu\nAk NTP synchronizácia nie je úspešná, bude použité DVB +menu.hint_net_ntp Konfigurácia synchronizácie času / hodín +menu.hint_net_ntpenable Použije synchronizáciu času pomocou NTP protokolu\nAk nebude NTP synchronizácia úspešná, použije sa sychronicácia cez DVB. menu.hint_net_ntprefresh Časový interval synchronizácie menu.hint_net_ntpserver Vloženie názvu NTP servera menu.hint_net_pass Vloženie kryptovacieho kľúča (WPA-PSK) menu.hint_net_proxy Ak používate proxy prístup k internetu\nnastavte tu on-line aktualizáciu software -menu.hint_net_proxypass Proxy uživateľské heslo\nak vyžaduje autorizáciu +menu.hint_net_proxypass Proxy užívateľské heslo\nak vyžaduje autorizáciu menu.hint_net_proxyserver Názov proxy servera menu.hint_net_proxyuser Proxy užívateľský názov\nak vyžaduje autorizáciu menu.hint_net_services Konfigurácia sieťových služieb:\nftp, Telnet, uPnp menu.hint_net_setupnow Použitie aktuálnych nastavení -menu.hint_net_setuponstartup Spustenie siete v čase spúštania príjmača +menu.hint_net_setuponstartup Spustenie siete v čase spúštania prijímača menu.hint_net_show Zobrazenie aktuálneho sieťového nastavenia menu.hint_net_ssid Zadanie SSID wireless siete\npre pripojenie sa k menu.hint_net_ssid_scan Vyhľadanie dostupných WLAN sietí -menu.hint_net_telnet Použitie telnet prihlásenia do vášho príjmača +menu.hint_net_telnet Použitie telnet prihlásenia do vášho prijímača menu.hint_net_test Test sieťového pripojenia: ping brány,\n názov servera a externé IP menu.hint_net_ushare Zdielanie pripojeného HDD cez uPnp menu.hint_net_xupnpd Zdielanie "Živých kanálov" cez uPnp menu.hint_network IP adresa, brána, DNS, Synch. času\nSieťové zdielanie a služby -menu.hint_new_zap_mode Povoliť prepnutie kanála počas prehliadania\n(prepnuť režim s 'MUTE' v zozname kanálov) -menu.hint_next Pokračovať na ďaľšie menu\nStlačenie MENU tlačítka zatvorí všetky ponuky -menu.hint_next_brief Pokračovať na ďaľšej ponuke +menu.hint_new_zap_mode Povoliť prepnutie kanálu počas prehliadania\n(mód prepnutia tlačidlom 'MUTE' v zozname kanálov) +menu.hint_next Pokračovanie na ďalšie menu\nStlačte tlačidlo menu pre ukončenie +menu.hint_next_brief Pokračovanie na ďalšie menu menu.hint_numeric_adjust Nastavenie režimu zoznamu kanálov na číselné prepnutie menu.hint_opkg Inštalovať alebo aktualizovať programové balíčky +menu.hint_opkg_feed_addresses_edit Upraviť adresy zdrojov +menu.hint_opkg_install_local_package Inštalácia balíka z USB, SD, zdieľanej alebo lokálnej zložky. menu.hint_opkg_upgrade Aktualizuje všetky inštalované balíčky na poslednú dostupnú verziu menu.hint_osd Farby, písma, veľkosť obrazu\nvzhľad a možnosti GUI menu.hint_osd_language Výber OSD jazyka @@ -1200,75 +1230,75 @@ menu.hint_parentallock_changepin Zmena PIN kódu menu.hint_parentallock_lockage Výber povoleného veku pre sledovanie menu.hint_parentallock_menu Zamknutie ponúk s pin kódom menu.hint_parentallock_prompt Konfigurácia keď sa Neutrino-HD opýta na PIN kód -menu.hint_personalize Povolenie/zakázanie alebo Položky menu zabezpečenia\nKonfigurácia farebných tlačítok uživateľských ponúk -menu.hint_pictureviewer_defdir Východzí adresár prehliadača obrázkov +menu.hint_personalize Povolenie/zakázanie alebo Položky menu zabezpečenia\nKonfigurácia farebných tlačidiel užívateľských ponúk +menu.hint_pictureviewer_defdir Predvolená zložka prehliadača obrázkov menu.hint_pictureviewer_scaling Algoritmus mierky obrázku -menu.hint_pictureviewer_setup Konfigurácia správania sa prehliadača obrázkov +menu.hint_pictureviewer_setup Konfigurácia správania prehliadača obrázkov menu.hint_pictureviewer_slide_time Interval zmeny obrázka, v sekundách menu.hint_picview Sledovanie obrázkov -menu.hint_plugin_type_games Zobrazí hry v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_lua Zobrazí doplnky v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_scripts Zobrazí skripty v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_tools Zobrazí nástroje v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugins_hdd_dir Výber adresára pre nahranie doplnkov -menu.hint_power_leds Konfigurácia správania LED podsvietenia tlačítka napájania +menu.hint_plugin_type_games Zobrazí hry v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_lua Zobrazí doplnky v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_scripts Zobrazí skripty v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_tools Zobrazí nástroje v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugins_hdd_dir Výber zložky pre načítanie doplnkov +menu.hint_power_leds Konfigurácia správania LED podsvietenia tlačidla napájania menu.hint_pref_lang Výber preferovaných jayzkov zvuku a EPG\nvýber 'none' pre nepoužitie menu.hint_pref_subs Výber preferovaných jazykov titulkov\nvýber 'none' pre nepoužitie -menu.hint_progressbar Výber volieb pre ukazovateľ -menu.hint_progressbar_color Zobrazenie farebného ukazovateľa -menu.hint_progressbar_gradient Pridanie vertikálneho jasového gradientu do stavového ukazovateľa -menu.hint_progressbar_infobar_position Vyberie možnosti ukazovateľa v infobare +menu.hint_progressbar Výber volieb ukazateľa +menu.hint_progressbar_color Zobrazenie farebného ukazateľa +menu.hint_progressbar_gradient Pridanie vertikálneho jasového gradientu do stavového ukazateľa +menu.hint_progressbar_infobar_position Vyberie možnosti ukazateľa v infobare menu.hint_progressbar_preview Použiť OK na zmenu aktuálneho stavu infobaru menu.hint_progressbar_timescale_green Výber množstva zelenej vo farebnosti infobaru menu.hint_progressbar_timescale_invert Výber preferovaného farebného prechodu menu.hint_progressbar_timescale_red Výber množstva červenej vo farebnosti infobaru menu.hint_progressbar_timescale_yellow Výber množstva žltej vo farebnosti infobaru menu.hint_protection Ochrana obsahu PIN kódom\nVýchodzí PIN 0000 -menu.hint_radiomode Prepne príjmač do rádio režimu -menu.hint_reboot Reboot príjmača\nBez potvrdzovania +menu.hint_radiomode Prepne prijímač do režimu Rádio +menu.hint_reboot Reštart prijímača - bez potvrdzovania menu.hint_record_apid_ac3 Nahrá AC3 zvukové pidy menu.hint_record_apid_alt Nahrá ostatné zvukové pidy menu.hint_record_apid_std Nahrá prvý zvukový pid menu.hint_record_apids Konfigurácia volieb zvukových pidov pre nahrávanie menu.hint_record_apply Použije voľby nahrávania menu.hint_record_auto_cover Automatické vytvorenie náhľadu pre filmový prehliadač na nahranom prehrávaní -menu.hint_record_chandir Vytvorí adresár s názvom kanála\npre uloženie nahrávky -menu.hint_record_data Konfigurácia dátových služieb (TeleText, Titulky) pre nahrávanie +menu.hint_record_chandir Vytvoriť zložku s názvom kanálu\npre uloženie nahrávky +menu.hint_record_data Konfigurácia datových služieb (TeleText, Titulky) pre nahrávanie menu.hint_record_data_dvbsub Nahrá pid/stream s titulkami menu.hint_record_data_vtxt Nahrá pid/stream s teletextom -menu.hint_record_dir Výber adresára pre ukladanie nahrávok +menu.hint_record_dir Výber zložky pre ukladanie nahrávok menu.hint_record_end Zastaviť nahrávanie po max. čase alebo\npo čase ukončenia aktuálnej udalosti menu.hint_record_filename_template Upraiť dočasný názov menu.hint_record_slow_warn Zobrazenie upozornenia, ak nahrávací buffer je blízko k preplneniu menu.hint_record_startstop_msg Zobrazenie správy o začatí/ukončení nahrávania pri začatí alebo ukončení -menu.hint_record_tdir Výber adresára pre uloženie nahrávok časového posunu\nv režime dočasného časového posunu -menu.hint_record_time Čas nahrávania do konca ak\nsa použije nahrávanie s tlačitkom nahrávania (REC) -menu.hint_record_time_ts Dĺžka časového posuvu pred zastavením keď\nje použitý -menu.hint_record_timeafter Zastavenie nahrávania po ukonční udalosti\nv minútach -menu.hint_record_timebefore Spustenie nahrávania pred začatím udalosti\nv minútach +menu.hint_record_tdir Výber zložky pre uloženie nahrávok časového posunu\nv režime dočasného časového posunu +menu.hint_record_time Dĺžka nahrávania v prípade spustenia nahrávania tlačidlom nahrávania (REC) +menu.hint_record_time_ts Dĺžka časového posuvu pred zastavením keď je použitý +menu.hint_record_timeafter Zastavenie nahrávania po ukonční udalosti v minútach +menu.hint_record_timebefore Spustenie nahrávania pred začatím udalosti v minútach menu.hint_record_timer Konfigurácia volieb časového nahrávania menu.hint_record_timeshift Konfigurácia volieb časového posunu menu.hint_record_timeshift_auto Automatické spustenie časového posunu po zmene kanálu, v sekundách menu.hint_record_timeshift_delete Zmazanie súborov časového posunu po jeho zastavení menu.hint_record_timeshift_pause Spustenie prehrávania časoveho posunu v pauza móde -menu.hint_record_timeshift_temp Ak NIE, časový posun spustený ako\nnejaké priame nahrávanie -menu.hint_record_zap Prepnutie na kanál nahrávania\na zobrazenie oznámenia -menu.hint_record_zap_pre_time Pri prepnutí časovačov, zmena kanála pred spustením udalosti\nv minútach -menu.hint_recording Voľby nahrávania a časového posunu\nZabezpečenie časovača, voľby zvukových pidov +menu.hint_record_timeshift_temp Ak je vypnutý, časový posun sa spustí ako\nobyčajné nahrávanie +menu.hint_record_zap Prepnutie na nahrávaný kanál pri zobrazení oznámenia o začatí nahrávania +menu.hint_record_zap_pre_time Prepnutie na kanál pred začatím udalosti v časovači, v minútach. +menu.hint_recording Voľby nahrávania a časového posunu, zabezpečenie časovača, voľby zvukových pidov menu.hint_reload_channels Znovunačítanie kanálov z pamäte menu.hint_reload_plugins Znovunačítanie doplnkov z pamäte -menu.hint_reset Resetovanie GUI nastavení do východzích hodnôt\nKonfigurácia tunera a kanálov bez zmien -menu.hint_restore Obnova súborov z vybranej zálohy -menu.hint_rotor_swap Výmena umiestnenia motora výchd/západ \nv ovládaní motora +menu.hint_reset Resetovanie GUI nastavení do východzích hodnôt, konfigurácia tunera a kanálov bez zmien +menu.hint_restore Obnova konfigurácie a kanálov zo zvolenej zálohy +menu.hint_rotor_swap Výmena umiestnenia motora východ/západ v ovládaní motora menu.hint_rounded_corners Kruhové vykreslovanie alebo zaoblené rohy okien menu.hint_save_settings Uloženie všetkých nastavení do pamäte -menu.hint_saveas Uloženie GUI nastavení do súboru +menu.hint_saveas Uloženie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) do súboru menu.hint_scan_auto Prehľadanie vybraného satelitu menu.hint_scan_autoall Prehľadanie niektorých vybraných satelitov menu.hint_scan_autoall_select Pridá vybrané satelity do prehľadávania -menu.hint_scan_bouquet aktualizácia: pridá aktuálne bukety\nzmaž všetky:odstráni staré bukety, bez zmien: nepridá alebo nezmení +menu.hint_scan_bouquet aktualizácia: pridá aktuálne bukety\nzmazať všetky:odstráni staré bukety, bez zmien: nepridá alebo nezmení menu.hint_scan_bouquet_writenames Zapísanie názvov služieb do buketov \n nikdy -> len obľúbené -> len poskytovateľ -> oba -menu.hint_scan_bw Výber šírky pásma kanála +menu.hint_scan_bw Výber šírky pásma kanálu menu.hint_scan_cable Výber káblovej siete na prehľadanie menu.hint_scan_cable_simple Káblové prehľadávanie s možnosťou\nčíslovania kanálov poskytovateľom menu.hint_scan_commited Výber potvrdeného vstupu pre\ntento satelit @@ -1277,7 +1307,7 @@ menu.hint_scan_diseqc Výber vstupu DiSEqC prepínača pre\ntento satelit menu.hint_scan_diseqcorder Vykoná príkaz DiSEqC pre kaskádne prepínače menu.hint_scan_diseqcrepeat DiSEqC opakovania pre kaskádne prepínače menu.hint_scan_diseqctype Výber protokolu 'rozšírené' pre DiSEqC prepínač\n môžete použiť na nepotvrdené prepínače -menu.hint_scan_fast CanalDigitaal/TéléSAT/TV Vlaanderen vyhľadanie poskytovateľa\nPOZOR: nastavenie DiSEqC bude prepísané +menu.hint_scan_fast CanalDigitaal/TéléSAT/TV Vlaanderen/M7 Group vyhľadanie poskytovateľa. POZOR: nastavenie DiSEqC bude prepísané. menu.hint_scan_fastdiseqc Spustiť automatickú konfiguráciu DiSEqC menu.hint_scan_fastprov Výber poskytovateľa pre vyhľadávanie menu.hint_scan_fasttype Výber typu rýchleho vyhľadávania @@ -1287,7 +1317,7 @@ menu.hint_scan_felink Výber tuneru pre vzájomné prepojenie menu.hint_scan_femode Výber typu pripojeného tuneru menu.hint_scan_fesetup Konfigurácia tuneru(ov) menu.hint_scan_fetimeout Čas čakania na signál, v desatinách sekundy -menu.hint_scan_freq Zadanie kmitočtu transpondéra +menu.hint_scan_freq Zadanie frekvencie transpondéra menu.hint_scan_fta Pridá len Free-To-Air (nekódované) kanály menu.hint_scan_gi Výber ochranného intervalu pre tento pozemný kanál menu.hint_scan_hierarchy Výber hierarchie pre tento pozemný kanál @@ -1295,9 +1325,9 @@ menu.hint_scan_ladirection Výber umiestnenia zemepisnej šírky menu.hint_scan_latitude Zadanie vašej zemepisnej šírky menu.hint_scan_lnbconfig Konfigurácia LNB parameterov pre tento satelit menu.hint_scan_lodirection Výber umiestnenia zemepisnej dĺžky -menu.hint_scan_lofh Kmitočet oscilátora horného pásma LNB -menu.hint_scan_lofl Kmitočet oscilátora spodného pásma LNB -menu.hint_scan_lofs Kmitočet prepnutia pásma LNB +menu.hint_scan_lofh Frekvencia oscilátora horného pásma LNB +menu.hint_scan_lofl Frekvencia oscilátora spodného pásma LNB +menu.hint_scan_lofs Frekvencia prepnutia pásma LNB menu.hint_scan_logical Použije číslovanie predvolieb poskytovateľom menu.hint_scan_logical_hd Ak je dostupná SD a HD verzia kanálu\nvloží HD na začiatok zoznamu menu.hint_scan_longitude Zadanie vašej zemepisnej dĺžky @@ -1309,8 +1339,8 @@ menu.hint_scan_motor_speed Rýchlosť pohybu motora v 1/10 stupňa\nza sekundu menu.hint_scan_motorpos Výber čísla uloženej pozície pre\ntento satelit menu.hint_scan_nid Vloženie network ID (dekadicky) menu.hint_scan_nit Pridanie transpondérov zo sieťovej informácie -menu.hint_scan_pids Hľadanie a uloženie audio/video/PMT pidov -menu.hint_scan_pilot Výber parametra pilotu +menu.hint_scan_pids Hľadať a uložiť audio/video/PMT PIDy +menu.hint_scan_pilot Výber parametru pilotného signálu (áno - ON, nie - OFF) menu.hint_scan_pol Výber polarizácie transpondéra menu.hint_scan_rate Zadanie symbolovej rýchlosti transpondéra menu.hint_scan_reset_numbers Resetovanie existujúcich čísel kanálov\na prečíslovanie kanálov po vyhľadaní @@ -1325,8 +1355,8 @@ menu.hint_scan_satsetup Konfigurácia volieb satelitu menu.hint_scan_savesettings Uloženie konfigurácie tunera a natavení prehľadania\nTaktiež uložiť, ak spustíte hľadanie služieb menu.hint_scan_scantype Výber, aké typy kanálov hľadať menu.hint_scan_setup_fe Konfigurácia volieb vybraného vstupného dielu -menu.hint_scan_start Spustenie hľadania. Môžete použiť 'EXIT' tlačítko na zastavenie -menu.hint_scan_test Otestovanie signálu z tohto transpondéra +menu.hint_scan_start Spustenie hľadania. Môžete použiť 'EXIT' tlačidlo na zastavenie +menu.hint_scan_test Test signálu z tohto transpondéra menu.hint_scan_tpselect Výber transpondéra pre prehľadanie menu.hint_scan_transmit_mode Výber režimu prenosu pre tento pozemný kanál menu.hint_scan_uncommited Výber nepotvrdeného vstupu pre\ntento satelit @@ -1336,32 +1366,36 @@ menu.hint_scan_usalsall Nastavenie USALS označenia pre všetky satelity menu.hint_scan_useusals Použije USALS pre\ntento satelit menu.hint_scrambled_message Zobrazenie správy kódovania, pokiaľ kanál nebol dekódovaný menu.hint_screen_setup Konfigurácia okrajov obrazu -menu.hint_screensaver_delay Nastavte čas (v minútach), po ktorom sa šetrič obrazovky spustí alebo vypne -menu.hint_screensaver_dir Vyberte adresár v ktorom sa šetrič obrazovky spustí -menu.hint_screensaver_setup Konfigurácia možností šetríča obrazovky pre zvukový prehrávač a rádio režim -menu.hint_screensaver_timeout Zvoľte časový interval zmeny obrazovky v šetriči obrazovky +menu.hint_screensaver_delay Nastaví čas (v minútach) po ktorom sa spustí šetrič obrazovky +menu.hint_screensaver_dir Výber zložky v ktorej sa spustí šetrič obrazovky +menu.hint_screensaver_mode Voľba režimu šetriča obrazovky. +menu.hint_screensaver_random Povoliť/zakázať náhodnú voľbu obrázku. +menu.hint_screensaver_setup Konfigurácia volieb šetriča obrazovky pre prehrávač hudby a mód rádia +menu.hint_screensaver_timeout Výber času pre zmenu obrázkov v šetriči obrazovky menu.hint_screenshot_count Pokiaľ žiadny GUI na obrazovke, môže byť uložených 1-5\nsériových zosnímaní -menu.hint_screenshot_cover ZAP: Pokiaľ prehráva nahrávky, prepíše jedno\nzachytenie do zobrazenia v Prehliadači filmov -menu.hint_screenshot_dir Výber adresára pre uloženie zachyteného obrázku +menu.hint_screenshot_cover Zap: Pokiaľ prehráva nahrávky, prepíše jedno\nzachytenie do zobrazenia v Prehliadači filmov +menu.hint_screenshot_dir Výber zložky pre uloženie zachyteného obrázku menu.hint_screenshot_format Formát súboru pre uloženie zachyteného obrázku -menu.hint_screenshot_res Veľkosť zosnímania: veľkosť obrazového rozmeru aktuálneho kanála\nalebo veľkosť OSD (1280x720) +menu.hint_screenshot_res Veľkosť zosnímania: veľkosť obrazového rozmeru aktuálneho kanálu\nalebo veľkosť OSD (1280x720) menu.hint_screenshot_scale Pre obraz+OSD zosnímanie, mierka z obrazového rozlíšenia menu.hint_screenshot_setup Konfigurácia volieb zosnímania obrázku menu.hint_screenshot_video Vrátane živého obrazu v zosnímanom obrázku -menu.hint_scripts Spustenie zadaní +menu.hint_scripts Spustenie zadania menu.hint_selected_back Zmena farby podkladu označenej položky menu.hint_selected_text Zmena farby textu označenej položky menu.hint_service Nastavenie tuneru, vyhľadanie služieb,\núprava buketov, aktualizácia software -menu.hint_service_scan Nastavenie tuneru, vyhľadanie služieb +menu.hint_service_scan Automatické / manuálne vyhľadávanie staníc, FastScan, Test signálu menu.hint_settings Konfigurácia Neutrino-HD, sieť, zvuk, obraz, OSD a iné menu.hint_show_mute_icon Zobrazenie ikony umlčania, ak nastavenie hlasitosťi bude 0 -menu.hint_shutdown Prepne váš príjmač do spánku\nBez potvrdzovania -menu.hint_shutdown_count Čas prepnutia príjmača do spánku\nz režimu pripravenosti -menu.hint_shutdown_menu Prepne Váš príjmač do pohotovstného alebo hlbokého spánku, nastaví časovač vypnutia -menu.hint_shutdown_rcdelay Použije režim spánku, ak tlačítko zapnutia\nje stlačené viac ako 1 sekundu -menu.hint_shutdown_real Použije režim pripravenosti\nAk sa nepoužije, tlačítko zapnutia prepne príjmač do spánku -menu.hint_sleeptimer Nastavenie časovača pre prechod vašeho príjmača\ndo režimu pripravenosti +menu.hint_shutdown Vypnutie prijímača - bez potvrdzovania +menu.hint_shutdown_count Čas prepnutia prijímača z pohotovostného režimu do stavu vypnutia +menu.hint_shutdown_menu Prepne prijímač do pohotovostného režimu alebo ho vypne, nastaví časovač vypnutia +menu.hint_shutdown_rcdelay Aktivuje vypnutie prijímača, ak je tlačidlo zapnutia\nstlačené viac ako 1 sekundu +menu.hint_shutdown_real Aktivuje pohotovostný režim\nAk je zakázané, tlačidlo zapnutia vypne prístroj +menu.hint_sleeptimer Nastavenie časovača pre prechod prijímača do pohotovostného režimu menu.hint_sleeptimer_min Prednastavené nastavenia pre časovač vypnutia +menu.hint_sms_channel Ak povolené, číselné klávesy v zozname kanálov budú použité pre vyhľadávanie kanálu v štýle SMS +menu.hint_sms_movie Ak povolené, číselné klávesy v prehliadači filmov budú použité pre vyhľadávanie filmu v štýle SMS menu.hint_soft_restart Reštartovanie Neutrino-HD bez rebootu menu.hint_softupdate_check Kontrola dostupných aktualizácií, stiahnutie a naprogramovanie firmware menu.hint_softupdate_check_local Výber a programovanie firmware z lokálneho súboru @@ -1369,10 +1403,10 @@ menu.hint_softupdate_createimage_menu Zálohovanie aktuálneho firmware vrátane menu.hint_softupdate_expert Oddelené partície z pamäte, čítanie/zapisovanie do pamäte menu.hint_softupdate_expert_read Načítanie oddelených partícií z pamäte (U-Boot 512kB, Kernel 4MB, SystemFS 28MB) menu.hint_softupdate_expert_write Zápis oddelených partícií do pamäte (U-Boot 512kB, Kernel 4MB, SystemFS 28MB, SystemFS+nastavenia) -menu.hint_softupdate_settings Adresár lokálnej aktualizácie a konfiguračný súbor pre nastavenie -menu.hint_standby Prepne príjmač do pohotovostného režimu -menu.hint_start_tostandby Zostane v režime pripravenosti po spustení -menu.hint_streaminfo Aktuálna informácia kanála: pidy, signál a kvalita,\nBitrate graf +menu.hint_softupdate_settings Zložka lokálnej aktualizácie a konfiguračný súbor pre nastavenie +menu.hint_standby Prepnutie prijímača do pohotovostného režimu +menu.hint_start_tostandby Zostane po spustení v pohotovostnom režime +menu.hint_streaminfo Aktuálna informácia kanálu: pidy, signál a kvalita,\nBitrate graf menu.hint_subchannel_pos Pozícia menu výberu sub-kanálov menu.hint_sw_update Aktualizácia software menu.hint_theme Výber prednastavených farebných vzhľadov\nUloženie alebo nahranie vzhľadu zo súborov @@ -1380,18 +1414,19 @@ menu.hint_timeouts Konfigurácia času zmiznutia GUI okien\nv sekundách menu.hint_timers Pridanie/Odstránenie/Upravenie plánovaného\nnahrávania, pripomienky atď. menu.hint_timezone Výber časového pásma menu.hint_tools Spustenie nástrojov -menu.hint_tvmode Prepne príjmač do TV režimu +menu.hint_tvmode Prepne prijímač do režimu TV menu.hint_tvradio_switch Prepínanie medzi TV a Rádio režimom -menu.hint_upnp Univerzálny Plug and Play prehliadač -menu.hint_vfd LED-ky predného panelu, VFD voľby -menu.hint_vfd_brightness Jas pri práci +menu.hint_upnp Univerzálny Plug & Play prehliadač +menu.hint_vfd LED diódy predného panelu, nastavenia VFD +menu.hint_vfd_brightness Definuje jas v TV režime menu.hint_vfd_brightness_setup Konfigurácia jasu zobrazovača predného panelu\npre rôzne režimy menu.hint_vfd_brightnessdeepstandby Jas v režime spánku menu.hint_vfd_brightnessdim Jas automatického stmavnutia -menu.hint_vfd_brightnessstandby Jas v režime pripravenosti +menu.hint_vfd_brightnessstandby Jas v pohotovostnom režime menu.hint_vfd_defaults Obnoví prednastavené hodnoty jasu menu.hint_vfd_dimtime Čas automatického stmavnutia, v sekundách menu.hint_vfd_infoline Vybrať si zobrazenie na hlavnom riadku VFD +menu.hint_vfd_notify_rclock Zobrazí upozornenie v prípade, že je stlačená klávesa a diaľkové ovládanie je v uzamknutom režime menu.hint_vfd_scroll Povolí alebo zakáže pohyb textu na VFD menu.hint_vfd_statusline Vybrať si krátke zobrazenie na \nstavovom riadku VFD menu.hint_video Obrazový výstup, rozlíšenie, formát\nPomer strán, voľby režimu rýchleho prepnutia @@ -1405,95 +1440,95 @@ menu.hint_video_format Pomer TV obrazu menu.hint_video_mode Obrazový režim HDMI výstupu menu.hint_video_modes VF klávesa bude cyklovať medzi zvolenými režimami menu.hint_video_modes_auto Povoliť režimy automatického výberu na základe obsahu -menu.hint_video_pip Veľkosť a umiestneie obrazu v obraze +menu.hint_video_pip Veľkosť a pozícia obrazu v obraze (PiP) menu.hint_video_saturation Zmena farebnosti obrázku menu.hint_video_scart_mode Výber režimu analógového výstupu pre SCART konektory menu.hint_video_sdosd Zapnúť/vypnúť OSD zorazenie na SD výstupe (scart, cinch) menu.hint_volume Konfigurácia volieb okna hlasitosti -menu.hint_volume_digits Číselné zobrazenie ukazovateľa hlasitosti ZAP/VYP +menu.hint_volume_digits Číselné zobrazenie ukazateľa hlasitosti Zap/Vyp menu.hint_volume_pos Výber pozície indikátora hlasitosti menu.hint_volume_size Výber výšky indikátora hlasitosti menu.hint_webtv_setup Tu nakonfigurované WebTV kanály budú k dispozícii v štandartnom zozname kanálov menu.hint_window_size Zoznam kanálov, EPG-Infp a niektoré iné okná sú zmenšené týmto faktorom menu.hint_ytplay Prehrávanie vybraných youtube videí -menu.hint_ytplay_setup Konfigurácia špecifických možností YouTube, napr. horná hranica výsledkov vyhľadávania +menu.hint_ytplay_setup Konfigurácia špecifických volieb YouTube, napr. horný limit výsledkov vyhľadávania menu.hint_zap_cycle Pri prepínaní kanálov zotrvať v aktuálnom bukete -menu.next ďaľej (MENU ukončí) -messagebox.back späť -messagebox.cancel zruš -messagebox.discard Zruš zmeny? +menu.next Ďalej +messagebox.back Späť +messagebox.cancel Zrušiť +messagebox.discard Zrušiť zmeny? messagebox.error Chyba -messagebox.feature_not_supported Funkcia nie je podporovaná! -messagebox.info Správa -messagebox.no nie -messagebox.ok ok -messagebox.yes áno -miscsettings.channellist Nastavenia zoznamu kanálov -miscsettings.channellist_epgtext_align Zarovnaj EPG text -miscsettings.colored_events Farebnosť udalostí +messagebox.feature_not_supported Táto vlastnosť nie je podporovaná. Kontaktujte prosím poskytovateľa vášho firmvéru! +messagebox.info Informácie +messagebox.no Nie +messagebox.ok OK +messagebox.yes Áno +miscsettings.channellist Nastavenie zoznamu kanálov +miscsettings.channellist_epgtext_align Zarovnať EPG text +miscsettings.colored_events Program farebne miscsettings.colored_events_0 žiadny miscsettings.colored_events_1 aktuálny miscsettings.colored_events_2 nasledujúci miscsettings.colored_events_channellist V zozname kanálov -miscsettings.colored_events_infobar V info lište +miscsettings.colored_events_infobar Na informačnej lište miscsettings.energy Energia -miscsettings.epg_cache Zachytávanie EPG (dni) +miscsettings.epg_cache Ukladanie EPG (dni) miscsettings.epg_cache_hint1 Ako dlho uchovávať dáta EPG v budúcnosti? -miscsettings.epg_cache_hint2 Nastavenie v dňoch. -miscsettings.epg_dir Adresár EPG -miscsettings.epg_extendedcache Podrobný popis udalosti (hodiny) -miscsettings.epg_extendedcache_hint1 Ako dlho zachytávať rozšírený -miscsettings.epg_extendedcache_hint2 popis udalosti (nastavenie v hodinách) -miscsettings.epg_head Nastavenia EPG +miscsettings.epg_cache_hint2 (Nastavenie v dňoch) +miscsettings.epg_dir Zložka EPG +miscsettings.epg_extendedcache Podrobný popis udalostí (hod.) +miscsettings.epg_extendedcache_hint1 Ako dlho ukladať rozšírený +miscsettings.epg_extendedcache_hint2 popis udalostí (nastavenie v hodinách) +miscsettings.epg_head Nastavenie EPG miscsettings.epg_max_events Maximum udalostí miscsettings.epg_max_events_hint1 Koľko udalostí bude uložených? -miscsettings.epg_max_events_hint2 normálne 6000, 0 pre zrušenie limitu -miscsettings.epg_old_events Odstráň neaktuálne EPG -miscsettings.epg_old_events_hint1 Ako dlho zapisovať dáta EPG po skončení? +miscsettings.epg_max_events_hint2 Normálne 6000, 0 pre zrušenie limitu +miscsettings.epg_old_events Odstrániť neaktuálne EPG (hod.) +miscsettings.epg_old_events_hint1 Ako dlho zapisovať EPG údaje po skončení? miscsettings.epg_old_events_hint2 Nastavenie v hodinách. -miscsettings.epg_read Obnoviť EPG pri zavádzaní -miscsettings.epg_save Ulož/Obnov EPG po reštarte +miscsettings.epg_read Obnoviť EPG po reštarte +miscsettings.epg_save Uložiť EPG pred vypnutím miscsettings.epg_save_frequently Periodické ukladanie EPG -miscsettings.epg_save_mode Len obľúbené -miscsettings.epg_save_standby Ulož EPG pri soft standby +miscsettings.epg_save_mode Iba obľúbené +miscsettings.epg_save_standby Uložiť EPG v pohotovostnom režime miscsettings.epg_scan Prehľadávanie EPG miscsettings.epg_scan_always Vždy -miscsettings.epg_scan_bouquets Prehľadanie EPG buketov +miscsettings.epg_scan_bouquets Prehľadávanie EPG buketov miscsettings.epg_scan_bq buket -miscsettings.epg_scan_fav favoritné +miscsettings.epg_scan_fav Obľúbené miscsettings.epg_scan_live Naživo miscsettings.epg_scan_sel Vybrané -miscsettings.epg_scan_standby Vspánku +miscsettings.epg_scan_standby V pohotovostnom režime miscsettings.general Hlavné nastavenia miscsettings.head Rôzne nastavenia -miscsettings.infobar Inforiadok +miscsettings.infobar Informačná lišta +miscsettings.infobar_buttons_usertitle Užívateľské názvy farebných kláves miscsettings.infobar_casystem_display Zobrazenie CA-Systému -miscsettings.infobar_casystem_dotmatrix Ihličkové zobrazenie CA -miscsettings.infobar_casystem_frame Orámované zobrazenie CA +miscsettings.infobar_casystem_dotmatrix CA displej s bodmi +miscsettings.infobar_casystem_frame CA displej s rámom miscsettings.infobar_casystem_mini CA mini miscsettings.infobar_casystem_mode CA mód -miscsettings.infobar_disp Zobrazovanie loga -miscsettings.infobar_disp_0 bez Loga -miscsettings.infobar_disp_1 Logo v číselnom boxe -miscsettings.infobar_disp_2 Logo+číslo kanála -miscsettings.infobar_disp_3 Logo+názov kanála+signál -miscsettings.infobar_disp_4 Logo+názov+číslo kanála -miscsettings.infobar_disp_5 Logo+signál -miscsettings.infobar_disp_6 Logo+číslo kanála+signál -miscsettings.infobar_disp_log len Logo -miscsettings.infobar_gradient_body Gradient EPG-area -miscsettings.infobar_gradient_bottom Gradient buttobar -miscsettings.infobar_gradient_top Gradient top -miscsettings.infobar_logo_hdd_dir Adresár loga +miscsettings.infobar_disp Zobraziť logo +miscsettings.infobar_disp_0 Názov kanálu [Číslo kanálu] +miscsettings.infobar_disp_1 Číslo kanálu, Názov kanálu [Logo] +miscsettings.infobar_disp_2 Logo [Číslo kanálu] +miscsettings.infobar_disp_3 Logo, Názov kanálu [Signál] +miscsettings.infobar_disp_4 Logo, Názov kanálu [Číslo kanálu] +miscsettings.infobar_disp_5 Logo [Signál] +miscsettings.infobar_disp_6 Číslo kanálu, Logo [Signál] +miscsettings.infobar_gradient_body Sklon plochy EPG +miscsettings.infobar_gradient_bottom Klesajúci +miscsettings.infobar_gradient_top Stúpajúci +miscsettings.infobar_logo_hdd_dir Zložka pre logo miscsettings.infobar_sat_display Zobrazenie satelitu v stavovom riadku miscsettings.infobar_show Zobraziť Info pri zmene EPG miscsettings.infobar_show_dd_available Zobraziť DD ak je dostupné miscsettings.infobar_show_res Zobraziť rozlišenie v stavovom riadku miscsettings.infobar_show_res_simple jednoduché -miscsettings.infobar_show_sysfs_hdd Zaplnenie (sysFS & HDD) +miscsettings.infobar_show_sysfs_hdd Indikátor zaplnenia (sysFS a HDD) miscsettings.infobar_show_tuner Zobraziť aktívny tuner miscsettings.infoclock Informačné hodiny -miscsettings.progressbar Ukazovateľ +miscsettings.progressbar Ukazateľ miscsettings.progressbar_color Farba miscsettings.progressbar_design Vzhľad miscsettings.progressbar_design_0 body @@ -1504,9 +1539,9 @@ miscsettings.progressbar_design_4 jednofarebne miscsettings.progressbar_design_long Vzhľad miscsettings.progressbar_gradient 3D efekt miscsettings.progressbar_infobar_position Pozícia -miscsettings.progressbar_infobar_position_0 štandartne -miscsettings.progressbar_infobar_position_1 pod názvom kanála -miscsettings.progressbar_infobar_position_2 úzky pod názvom kanála +miscsettings.progressbar_infobar_position_0 štandardne +miscsettings.progressbar_infobar_position_1 pod názvom kanálu +miscsettings.progressbar_infobar_position_2 úzky pod názvom kanálu miscsettings.progressbar_infobar_position_3 zúžený medzi EPG udalosťami miscsettings.progressbar_preview Náhľad miscsettings.progressbar_timescale Časová os @@ -1517,54 +1552,54 @@ miscsettings.progressbar_timescale_red červená miscsettings.progressbar_timescale_red_green z červenej do zelenej miscsettings.progressbar_timescale_yellow žltá miscsettings.radiotext RádioText -miscsettings.shutdown_count Vypnúť po -miscsettings.shutdown_count_hint1 Čas (v minútach) pre prepnutie zo stavu pripravenosti -miscsettings.shutdown_count_hint2 do hlbokého spánku (0=vypnuté) -miscsettings.shutdown_real Umožnenie pripravenosti +miscsettings.shutdown_count Vypnúť po (min.) +miscsettings.shutdown_count_hint1 Čas (v minútach) pre prepnutie z pohotovostného režimu +miscsettings.shutdown_count_hint2 do režimu vypnutia prístroja (0=vypnuté) +miscsettings.shutdown_real Povoliť pohotovostný režim miscsettings.shutdown_real_rcdelay Oneskorenie vypnutia miscsettings.sleeptimer Čas vypnutia pri neaktivite miscsettings.sleeptimer_min Prednastavený časovač vypnutia miscsettings.volume Hlasitosť -miscsettings.zapto_pre_time Korekcia času pred prepnutím (minuty) -motorcontrol.calc_positions Prepočítaj pozície -motorcontrol.disable_limit Vypni (soft) limity -motorcontrol.drive_mode režim pohybu +miscsettings.zapto_pre_time Korekcia času prepnutia kanálu +motorcontrol.calc_positions Prepočítať pozície +motorcontrol.disable_limit Vypnúť (soft) limity +motorcontrol.drive_mode Režim pohybu motorcontrol.drive_mode_auto Zastavenie pohybu Ručne/Auto -motorcontrol.east_limit Nastav východný (soft) limit -motorcontrol.enable_limit Zapni (soft) limity -motorcontrol.goto Choď na pozíciu motora (a) -motorcontrol.halt Zastav motor +motorcontrol.east_limit Nastaviť východný (soft) limit +motorcontrol.enable_limit Zapnúť (soft) limity +motorcontrol.goto Ísť na pozíciu motora (a) +motorcontrol.halt Zastaviť motor motorcontrol.head Satelitný vyhľadávač motorcontrol.install_menu Inštalačné menu motorcontrol.motor_pos (a) Pozícia motora: motorcontrol.movement (b) Presun: motorcontrol.msec ms -motorcontrol.network Informácie sieti -motorcontrol.no_mode nestará sa +motorcontrol.network Informácia siete +motorcontrol.no_mode nestarať sa motorcontrol.notdef Nepoužité motorcontrol.override Nahradiť pozíciu určenú pre -motorcontrol.pos_decrease Zníž pozíciu motora (a) -motorcontrol.pos_increase Zvýš pozíciu motora (a) -motorcontrol.ref_position Choď na referenčnú pozíciu +motorcontrol.pos_decrease Znížiť pozíciu motora (a) +motorcontrol.pos_increase Zvýšiť pozíciu motora (a) +motorcontrol.ref_position Ísť na referenčnú pozíciu motorcontrol.sat_pos Pozícia satelitu (krokovací režim): motorcontrol.settings Nastavenia ovládania motora motorcontrol.status Stav -motorcontrol.step_decrease Zníž veľkosť kroku (c) -motorcontrol.step_drive Prepni spôsob Krok/Posuv (b) +motorcontrol.step_decrease Znížiť veľkosť kroku (c) +motorcontrol.step_drive Prepnúť spôsob Krok/Posuv (b) motorcontrol.step_east Krok/Posuv motora na Východ (b,c) -motorcontrol.step_increase Zvýš veľkosť kroku (c) -motorcontrol.step_mode režim kroku +motorcontrol.step_increase Zvýšiť veľkosť kroku (c) +motorcontrol.step_mode Režim kroku motorcontrol.step_size (c) Veľkosť kroku: motorcontrol.step_west Krok/Posuv motora na Západ (b,c) -motorcontrol.stop_moving Zastav na signále (pohybovanie) -motorcontrol.stop_stopped Zastav na signále (zastavenie) -motorcontrol.store Ulož pozíciu motora (a) -motorcontrol.timed_mode čas pre režim kroku -motorcontrol.user_menu Uživateľské menu -motorcontrol.west_limit Nastav západný (soft) limit +motorcontrol.stop_moving Zastaviť na signále (pohybovanie) +motorcontrol.stop_stopped Zastaviť na signále (zastavenie) +motorcontrol.store Uložiť pozíciu motora (a) +motorcontrol.timed_mode Čas pre režim kroku +motorcontrol.user_menu Užívateľské menu +motorcontrol.west_limit Nastaviť západný (soft) limit moviebrowser.ask_rec_to_delete Vymazanie nahrávaných filmových stôp!\n[%s]\nSkutočne vykonať? moviebrowser.book_add Pridať záložku -moviebrowser.book_clear_all Vyčisti všetko +moviebrowser.book_clear_all Vyčistiť všetko moviebrowser.book_head Záložky moviebrowser.book_lastmoviestop Posledné prerušenie: moviebrowser.book_movieend Koniec filmu: @@ -1581,22 +1616,23 @@ moviebrowser.browser_row_head Nastavenia riadku moviebrowser.browser_row_item Položka stĺpca moviebrowser.browser_row_nr Počet stĺpcov moviebrowser.browser_row_width Šírka stĺpca [%] -moviebrowser.cache_dir Adresár cache -moviebrowser.copies Kopírovať skoky z filmu do nových súborov? -moviebrowser.copy Kopírovať skoky z filmu do nového súboru? -moviebrowser.copy_failed Kopírovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta? +moviebrowser.cache_dir Zložka vyrovnávacej pamäte +moviebrowser.copies Kopírovať skoky z filmu do nových súborov ? +moviebrowser.copy Kopírovať skoky z filmu do nového súboru ? +moviebrowser.copy_failed Kopírovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta ? moviebrowser.copying Kopírovanie, prosím čakajte ... -moviebrowser.cut Vystrihnúť skoky z filmu? -moviebrowser.cut_failed Vystrihovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta? -moviebrowser.cutting Strihanie, prosím čakajte ... -moviebrowser.delete_all Zmazať všetky vybrané filmy bez akýchkoľvek otázok? -moviebrowser.delete_info Mazanie súborov, prosim čakajte... -moviebrowser.delete_screenshot Zmazať obrázok obrazovky? -moviebrowser.dir Adresár -moviebrowser.dir_head Doplnkové adresáre -moviebrowser.edit_book Zmeň záložku +moviebrowser.cut Vystrihnúť skoky z filmu ? +moviebrowser.cut_failed Vystrihovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta ? +moviebrowser.cutting Strihanie filmu, prosím čakajte ... +moviebrowser.delete_all Vymazať všetky označené filmy bez opýtania? +moviebrowser.delete_info Mazanie súborov, prosim čakajte ... +moviebrowser.delete_screenshot Zmazať zachytený obrázok? +moviebrowser.dir Zložka +moviebrowser.directories Zložky +moviebrowser.directories_additional Dodatočné zložky +moviebrowser.edit_book Zmeniť záložku moviebrowser.edit_book_name_info1 Zadanie nového názovu záložky -moviebrowser.edit_book_name_info2 názov záložky +moviebrowser.edit_book_name_info2 Názov záložky moviebrowser.edit_book_pos_info1 Zadanie novej pozície moviebrowser.edit_book_pos_info2 ???? moviebrowser.edit_book_type_info1 Zadanie novej dĺžky skoku @@ -1609,20 +1645,30 @@ moviebrowser.foot_options Voľby moviebrowser.foot_play Štart filmu moviebrowser.foot_refresh Obnoviť zoznam moviebrowser.foot_sort Triedenie: -moviebrowser.head TS prehrávač filmov +moviebrowser.head Moje nahrávky moviebrowser.head_filter Filtrovanie filmov podľa kategórie: -moviebrowser.head_playlist Posledné pustený: -moviebrowser.head_recordlist Posledne nahraný: -moviebrowser.hide_series Skryť serialy -moviebrowser.hint_copy_onefile 11111 -moviebrowser.hint_copy_several 22222 -moviebrowser.hint_cut 33333 -moviebrowser.hint_jumpbackward Skok vzad o 5s\n '0' zruš -moviebrowser.hint_jumpforward Skok vpred o 5s\n '0' zruš -moviebrowser.hint_movieend Ukončenie sledovania za 5 s\n '0' zruš -moviebrowser.hint_newbook_backward Nový skok vzad \n 'MODRÝ' na koniec -moviebrowser.hint_newbook_forward Nový skok vpred\n 'MODRÝ' na koniec -moviebrowser.hint_truncate 44444 +moviebrowser.head_playlist Naposledy sledovaný: +moviebrowser.head_recordlist Naposledy nahraný: +moviebrowser.help_button_blue Znovunačítanie informácií o filmoch +moviebrowser.help_button_green Ukázať filter výberu +moviebrowser.help_button_left Zmena pohľadu +moviebrowser.help_button_menu Otvoriť hlavné menu +moviebrowser.help_button_mute Vymazať filmy +moviebrowser.help_button_okay Prehrať filmy +moviebrowser.help_button_play Označiť filmy +moviebrowser.help_button_red Zmena zoradenia +moviebrowser.help_button_right Zmena pohľadu +moviebrowser.help_button_yellow Prepnúť aktívne okno +moviebrowser.hide_series Skryť seriály +moviebrowser.hint_copy_onefile +moviebrowser.hint_copy_several +moviebrowser.hint_cut +moviebrowser.hint_jumpbackward Skok vzad o 5s\n '0' zrušiť +moviebrowser.hint_jumpforward Skok vpred o 5s\n '0' zrušiť +moviebrowser.hint_movieend Koniec filmu o 5 sekúnd\n'0' zrušiť +moviebrowser.hint_newbook_backward Nový skok späť spustený\n'%s' definuje koncovú pozíciu, '0' zrušiť +moviebrowser.hint_newbook_forward Nový skok vpred spustený\n'%s' definuje koncovú pozíciu, '0' zrušiť +moviebrowser.hint_truncate moviebrowser.info_audio Zvuk moviebrowser.info_channel Kanál moviebrowser.info_file Súbor @@ -1630,35 +1676,36 @@ moviebrowser.info_filename Názov moviebrowser.info_genre_major Žáner moviebrowser.info_genre_minor Vedľajší žáner moviebrowser.info_head Informácia o filme -moviebrowser.info_head_update Ulož zmeny vo všetkých informačných súboroch filmu +moviebrowser.info_head_update Uložiť zmeny vo všetkých informačných súboroch filmu moviebrowser.info_info1 Info 1 moviebrowser.info_info2 Info 2 moviebrowser.info_length Dĺžka (Min) moviebrowser.info_parental_lockage Rodičovský zámok moviebrowser.info_parental_lockage_0year vždy -moviebrowser.info_parental_lockage_12year 12 rokov -moviebrowser.info_parental_lockage_16year 16 rokov -moviebrowser.info_parental_lockage_18year 18 rokov -moviebrowser.info_parental_lockage_6year 6 rokov +moviebrowser.info_parental_lockage_12year do 12 rokov +moviebrowser.info_parental_lockage_16year do 16 rokov +moviebrowser.info_parental_lockage_18year do 18 rokov +moviebrowser.info_parental_lockage_6year do 6 rokov moviebrowser.info_parental_lockage_always nikdy -moviebrowser.info_path Adresár +moviebrowser.info_path Zložka moviebrowser.info_prevplaydate Dátum posledného pozerania moviebrowser.info_prodcountry Krajina moviebrowser.info_prodyear Rok moviebrowser.info_quality Kvalita +moviebrowser.info_rating Hodnotenie moviebrowser.info_recorddate Dátum nahrávky -moviebrowser.info_serie Serial +moviebrowser.info_serie Seriál moviebrowser.info_size Veľkosť (MB) moviebrowser.info_title Titul moviebrowser.info_videoformat Obraz -moviebrowser.last_play_max_items Počet liniek posledného prehrávania -moviebrowser.last_record_max_items Počet liniek posledného nahrávania -moviebrowser.load_default Nahrať prednastavené nastavenia +moviebrowser.last_play_max_items Počet posledných prehrávaní v zozname +moviebrowser.last_record_max_items Počet posledných nahrávaní v zozname +moviebrowser.load_default Obnoviť predvolené hodnoty moviebrowser.menu_copy_onefile Kopírovať film moviebrowser.menu_copy_several Kopírovať a rozdeliť film moviebrowser.menu_cut Vystrihnúť film moviebrowser.menu_cut_head Kopírovať, vystrihnúť a skrátiť -moviebrowser.menu_directories_head Adresáre +moviebrowser.menu_directories_head Zložky moviebrowser.menu_help_head Nápoveda moviebrowser.menu_main_bookmarks Záložky moviebrowser.menu_main_head Nastavenia @@ -1668,16 +1715,16 @@ moviebrowser.menu_parental_lock_activated_no nie moviebrowser.menu_parental_lock_activated_no_temp nie (dočasne) moviebrowser.menu_parental_lock_activated_yes áno moviebrowser.menu_parental_lock_head Blokovanie -moviebrowser.menu_parental_lock_rate_head Blokovať film z ... -moviebrowser.menu_save Ulož zmeny -moviebrowser.menu_save_all Spusti aktualizáciu informácií o súbore +moviebrowser.menu_parental_lock_rate_head Blokovať film +moviebrowser.menu_save Uložiť zmeny +moviebrowser.menu_save_all Spustiť aktualizáciu informácií o súbore moviebrowser.menu_truncate Skrátiť film moviebrowser.option_browser Možnosti prehliadača moviebrowser.reload_at_start Načítanie informácie o filme pri štarte -moviebrowser.remount_at_start Pripoj pri štarte -moviebrowser.scan_for_movies Hľadaj pre film ... -moviebrowser.serie_auto_create Automaticky vytvor serial -moviebrowser.serie_head Serialy +moviebrowser.remount_at_start Pripojiť pri štarte +moviebrowser.scan_for_movies Hľadať filmy ... +moviebrowser.serie_auto_create Automaticky doplniť seriály +moviebrowser.serie_head Seriály moviebrowser.serie_name Zmena názvu moviebrowser.short_audio Zvuk moviebrowser.short_book Kniha @@ -1691,26 +1738,27 @@ moviebrowser.short_info1 Info 1 moviebrowser.short_info2 Info 2 moviebrowser.short_length Min moviebrowser.short_parental_lockage Vek -moviebrowser.short_path Adresár -moviebrowser.short_prevplaydate Posledne +moviebrowser.short_path Zložka +moviebrowser.short_prevplaydate Posledné moviebrowser.short_prodyear Rok moviebrowser.short_quality * (kvalita) +moviebrowser.short_rating Hlasy moviebrowser.short_recorddate Dátum moviebrowser.short_serie Serial moviebrowser.short_size Veľkosť moviebrowser.short_title Titul moviebrowser.start_head Pozerať film od: moviebrowser.start_record_start Začiatok filmu -moviebrowser.truncate Orezať film? -moviebrowser.truncate_failed Orezanie zlyhalo. -moviebrowser.truncate_failed_playing Nemožné orezať prehrávanie filmu. -moviebrowser.truncating Orezávanie, čakajte prosím ... +moviebrowser.truncate Skrátiť film ? +moviebrowser.truncate_failed Chybné skrátenie. +moviebrowser.truncate_failed_playing Možnosť skrátiť prehrávanie filmu. +moviebrowser.truncating Skracovanie filmu, prosím čakajte ... moviebrowser.ts_only Zobraziť iba nahrávky moviebrowser.update_if_dest_empty_only Kopírovať len ak je cieľové miesto prázdne -moviebrowser.use_dir Použi adresár -moviebrowser.use_movie_dir Použi adresár filmov -moviebrowser.use_rec_dir Použi adresár nahrávania -moviebrowser.yt_cache Stiahnutia +moviebrowser.use_dir Použiť zložku +moviebrowser.use_movie_dir Použiť zložku filmov +moviebrowser.use_rec_dir Použiť zložku nahrávania +moviebrowser.yt_cache Stiahnuté moviebrowser.yt_cache_add Plánované \n%s\nsťahovanie. moviebrowser.yt_cancel Zrušiť všetko moviebrowser.yt_cancel_transfer Zrušiť sťahovanie? @@ -1721,10 +1769,10 @@ moviebrowser.yt_error Chyba načítania youtube videa moviebrowser.yt_failed Chybné sťahovania moviebrowser.yt_history Hľadať históriu moviebrowser.yt_max_history Maximálna veľkosť hľadania histórie -moviebrowser.yt_max_results Dosiahnuté maximum výsledkov +moviebrowser.yt_max_results Maximálny počet výsledkov moviebrowser.yt_most_popular Najpopulárnejšie dnes moviebrowser.yt_most_popular_all_time Najpopulárnejšie -moviebrowser.yt_next_results Ďaľšie výsledky +moviebrowser.yt_next_results Ďalšie výsledky moviebrowser.yt_orderby Triediť podľa moviebrowser.yt_orderby.published dátum zverejnenia moviebrowser.yt_orderby.rating obľúbenosť @@ -1737,15 +1785,15 @@ moviebrowser.yt_recently_featured Nedávno odporúčané moviebrowser.yt_region Región moviebrowser.yt_related Podobné videá moviebrowser.yt_search Hľadať slovo -moviecut.cancel Zrušiť editovanie filmu? +moviecut.cancel Zrušiť úpravu filmu? movieplayer.bookmark Záložky movieplayer.bookmarkname Názov záložky -movieplayer.bookmarkname_hint1 Vloženie názvu -movieplayer.bookmarkname_hint2 novej záložky? +movieplayer.bookmarkname_hint1 Vloženie názvu novej záložky +movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitoly -movieplayer.defplugin Spustenie doplnku -movieplayer.fileplayback Súbor cez VLC +movieplayer.fileplayback Prehliadač súborov movieplayer.head Prehrávač filmov +movieplayer.plugin Doplnky Prhrávača filmov movieplayer.starting Spúšťa sa prehrávanie... movieplayer.titles Tituly movieplayer.toomanybookmarks Veľa záložiek.\nJe potrebné vymazať jednu najprv. @@ -1755,120 +1803,126 @@ movieplayer.tshelp11 asi 10 min dopredu movieplayer.tshelp12 Nápoveda: http://www.giggo.de/dbox2/movieplayer.html\n movieplayer.tshelp2 Výbrer zvukovej stopy movieplayer.tshelp3 Prerušenie/Pokračovanie -movieplayer.tshelp4 Vytvorí záložku -movieplayer.tshelp5 Zobrazí postup +movieplayer.tshelp4 Vytvoriť záložku +movieplayer.tshelp5 Zobraziť čas movieplayer.tshelp6 asi 1 min dozadu movieplayer.tshelp7 asi 1 min dopredu movieplayer.tshelp8 asi 5 min dozadu movieplayer.tshelp9 asi 5 min dopredu movieplayer.tsplayback Prehrať TS -movieplayer.ytplayback Prehrávanie youtube -mpkey.audio Zvuková stpopa -mpkey.bookmark Ulož záložku +movieplayer.ytplayback YouTube prehrávač +mpkey.audio Zvuková stopa +mpkey.bookmark Uložiť záložku mpkey.forward Dopredu -mpkey.goto Zadaj čas prehrávania -mpkey.next_repeat_mode ďaľší opakovací režim -mpkey.pause Preruš -mpkey.play Prehraj -mpkey.plugin Spusti doplnok +mpkey.goto Zadať čas prehrávania +mpkey.next_repeat_mode Ďalší opakovací režim +mpkey.pause Pozastaviť +mpkey.play Prehrať +mpkey.plugin Spustiť doplnok mpkey.rewind Dozadu -mpkey.stop Zastav +mpkey.stop Zastaviť mpkey.subtitle Titulky mpkey.time Zobrazenie času networkmenu.apply_settings Zmeny sa aplikujú... networkmenu.apply_settings_now Chcete teraz aplikovať zmeny? -networkmenu.broadcast Vysielanie -networkmenu.dhcp Prevzatie z DHCP +networkmenu.broadcast Vysielanie / Broadcast +networkmenu.dhcp Načítať IP adresu z DHCP networkmenu.error_no_address Strata %s adresy! networkmenu.gateway Predvolená brána networkmenu.hostname Názov hostiteľa -networkmenu.hostname_hint1 vložiť hostitela -networkmenu.hostname_hint2 pre zmenu potrebný Reboot +networkmenu.hostname_hint1 Vložiť hostiteľa, +networkmenu.hostname_hint2 pre zmenu potrebný reštart networkmenu.inactive_network Sieť neaktívna! -networkmenu.ipaddress Adresa IP -networkmenu.mount NFS/CIFS/FTPFS +networkmenu.ipaddress IP adresa +networkmenu.mount Úprava sieťových zložiek (NFS / CIFS) networkmenu.nameserver DNS networkmenu.netmask Maska podsiete -networkmenu.ntpenable Synchronizácia -networkmenu.ntprefresh Skontroluj po (min): +networkmenu.ntpenable Synchronizovať čas cez +networkmenu.ntprefresh Skontrolovať po (min): networkmenu.ntprefresh_hint1 Zosynchronizuje čas po (minúty) networkmenu.ntprefresh_hint2 Potrebný reštart boxu alebo reštart EPG networkmenu.ntpserver NTP server networkmenu.ntpserver_hint1 NTP server napr.: ntpl.ptb.de networkmenu.ntpserver_hint2 Potrebný reštart boxu alebo reštart EPG -networkmenu.ntptitle Aktualizácia hodín +networkmenu.ntptitle Synchronizácia času / hodín networkmenu.password Pre-Shared kľúč (PSK) networkmenu.reset_settings_now Chcete obnoviť predchádzajúce nastavenia? -networkmenu.select_if Interface +networkmenu.select_if Rozhranie networkmenu.services Sieťové služby -networkmenu.setupnow Použi nastavenia siete +networkmenu.setupnow Použiť nastavenia siete networkmenu.setuponstartup Nastavenie siete pri štarte -networkmenu.show Zobrazenie sieťového nastavenia +networkmenu.show Zobraziť nastavenia siete networkmenu.ssid Názov siete (SSID) networkmenu.ssid_scan Hľadanie WLAN sietí networkmenu.ssid_scan_error Nenájdené WLAN siete networkmenu.ssid_scan_wait Prebieha hľadanie WLAN sietí -networkmenu.test Otestovanie siete -neutrino_starting Spustenie Neutrina... -nfs.alreadymounted Adresár je už pripojený -nfs.automount Pripoj pri spustení -nfs.dir Adresár/zdielanie +networkmenu.test Test siete +neutrino_starting Start NG-Neutrino +nfs.alreadymounted Zložka je už pripojená +nfs.automount Pripojiť pri spustení +nfs.dir Zložka / Zdielanie nfs.ip IP servera NFS/CIFS -nfs.localdir Lokálny adresár -nfs.mount Pripoj adresár +nfs.localdir Lokálna zložka +nfs.mount Pripojiť sieťovú zložku nfs.mount_options Možnosti pripojenia nfs.mounterror Chyba pripojenia nfs.mounterror_notsup Nepodporovaný súborový systém -nfs.mountnow Pripoj teraz +nfs.mountnow Pripojiť teraz nfs.mountok Pripojenie úspešné -nfs.mounttimeout Chyba pripojenia: uplinul časový limit +nfs.mounttimeout Chyba pripojenia: uplynul časový limit nfs.password Heslo CIFS nfs.refresh_mac vyhľadať MAC adresu -nfs.remount Znovu pripoj +nfs.remount Znovu pripojiť nfs.type Typ nfs.type_cifs CIFS nfs.type_lufs FTPFS nfs.type_nfs NFS -nfs.umount Odpoj adresár -nfs.umounterror Chyba odpojenia adresára -nfs.username uživateľ CIFS +nfs.umount Odpojiť sieťovú zložku +nfs.umounterror Chyba odpojenia zložky +nfs.username Užívateľ CIFS nfsmenu.head Nastavenia NFS/CIFS/FTPFS nvod.percentage (prešlo: %d%% min) nvod.starting (spustenie za %d min) nvodselector.directormode Priamo nvodselector.head Výber času spustenia +nvodselector.starttime Voľba počiatočného času nvodselector.subservice Výber podkanálu -opkg.button.expert_off Štandartný mód +opkg.button.expert_off Štandardný mód opkg.button.expert_on Expertný mód opkg.button.info Informácia balíčka opkg.button.install Inštalovať balíček opkg.button.uninstall Odstrániť balíček -opkg.failure.install inštalácia zlyhala -opkg.failure.update aktualizácie zlyhala -opkg.failure.upgrade Upgrade zlyhalo -opkg.install.local.package Nainštalujte miestne balíček +opkg.enter.feed.address Vložte prosím adresu serveru, lokálnej alebo zdieľanej zložky! +opkg.enter.feed.address.example Príklad: http://pkg.nevis.neutrino-hd.com +opkg.failure.install Chyba inštalácie (%d) +opkg.failure.update Chyba aktualizácie (%d) +opkg.failure.upgrade Chyba aktualizovania (%d) +opkg.feed.addresses Adresy zdrojov +opkg.install.local.package Inštalácia lokálneho balíčku opkg.messagebox.reinstall Preinštalovať %s? opkg.messagebox.remove Odstrániť %s? -opkg.messagebox.size.error Nie je dostatok voľnej pamäte pre tento balík! -opkg.messagebox.updates.available Aktualizácia k dispozícii! -opkg.success.install inštalácia úspešne!\n Môže byť potrebné reštart neutríno. Teraz reštartovať? +opkg.messagebox.size.error Pre tento balíček nie je dostatok pamäte! +opkg.messagebox.updates.available Dostupné aktualizácie! +opkg.success.install Inštalácia dokončená!\n Je vyžadovaný reštart Neutrina. Reštartovať teraz? opkg.title Správa balíčkov +opkg.update.check Kontrola aktualizácií... +opkg.update.reading_lists Načítavanie zoznamu balíčkov... opkg.upgrade Aktualizovanie inštalovaných balíčkov -opkg.warning_3rdparty_packages Zahraničné balíčky by mohli poškodiť systém! Si si istý, že inštaláciu tohto balíka? -options.default obnov predvolené +opkg.warning_3rdparty_packages Balíčky tretích strán môžu poškodiť systém! Ste si istý inštaláciou tohoto balíčku? +options.default Obnoviť predvolené hodnoty options.fb FRAMEBUFFER -options.hint_default Nastaviť prednastavené hodnoty +options.hint_default Nastaviť späť na predvolené hodnoty. options.ntp_off DVB options.ntp_on NTP options.null nič options.off nie options.on áno -options.on.without_messages Bez správ +options.on.without_messages Bez hlásení options.serial SERIAL parentallock.bouquetmode Predvolené bukety parentallock.changepin Zmena PIN kódu parentallock.changepin_hint1 Zadanie Vášho nového bezpečnostného PIN kódu! -parentallock.changetolocked na zamknutie buketov +parentallock.changetolocked Na zamknutie buketov parentallock.defaultlocked zamknuté parentallock.defaultunlocked odomknuté parentallock.head Zadanie bezpečnostného PIN kódu @@ -1876,35 +1930,35 @@ parentallock.lockage Blokovanie parentallock.lockage12 od 12 rokov parentallock.lockage16 od 16 rokov parentallock.lockage18 od 18 rokov -parentallock.lockedchannel Kanál zamknutý... -parentallock.lockedprogram Program zamknutý (od %d rokov) +parentallock.lockedchannel Kanál uzamknutý... +parentallock.lockedprogram Program uzamknutý (od %d rokov) parentallock.menu Bezpečnosť -parentallock.never nikdy -parentallock.onsignal pri zistení zámku +parentallock.never Nikdy +parentallock.onsignal Pri zistení zámku parentallock.parentallock Rodičovský zámok parentallock.prompt Použitie PIN kódu parentallock.zaptime Čas zamknutia buketov (minúty) personalize.access Voľby prístupu personalize.apply_settings Použiť zmeny? -personalize.button_auto auto -personalize.button_blue modrý -personalize.button_green zelený -personalize.button_red červený -personalize.button_yellow žltý +personalize.button_auto Automaticky +personalize.button_blue Modré +personalize.button_green Zelené +personalize.button_red Červené +personalize.button_yellow Žlté personalize.disabled Nepoužité personalize.enabled Použité -personalize.head Osobné zohľadnenie +personalize.head Personalizácia menu personalize.help Nápoveda -personalize.help_line1 Vytvorenie osobného zohľadnenia umožnuje prispôsobiť +personalize.help_line1 Vytvorenie osobného nastavenia umožnuje prispôsobiť personalize.help_line2 dôležité ponuky, ktoré používate. Ponuky -personalize.help_line3 môžu byť viditelné, skryté, použité, nepoužité +personalize.help_line3 môžu byť viditeľné, skryté, použité, nepoužité personalize.help_line4 alebo chránené PIN-om. -personalize.help_line5 Prístup k osobnému zohľadneniu môže byť chránený +personalize.help_line5 Prístup k osobnému nastaveniu môže byť chránený personalize.help_line6 s PIN-om. PIN je totožný pre všetky chránené ponuky personalize.help_line7 (neplatí pre vekové obmedzenie). personalize.help_line8 Prednastavený PIN je: 0000 personalize.menuconfiguration Konfigurácia menu -personalize.menudisabledhint Požadovaná ponuka je momentálne nepoužitá!\nPre aktiváciu prosímt otvorte ponuku 'Osobné zohľadnenie'\nnájdenú v ponuke 'Nastavenia'! +personalize.menudisabledhint Požadovaná ponuka je momentálne neaktívna!\nPre aktiváciu prosím otvorte ponuku 'Personalizácia menu'\nv ponuke 'Nastavenia'! personalize.notprotected Nie personalize.notvisible Skryté personalize.pin PIN @@ -1912,13 +1966,13 @@ personalize.pin_in_use PIN prístup pre personalizáciu nastavenia personalize.pincode Osobný PIN personalize.pinhint Zadanie osobného PIN kódu personalize.pinprotect Áno -personalize.pinstatus vyžadujú PIN +personalize.pinstatus -vyžaduje sa PIN personalize.plugins Doplnky personalize.usermenu_plugin_types Výber Doplnku pre zobrazenie personalize.usermenu_preferred_buttons Priradenie preferovaných kláves -personalize.usermenu_show_cancel Zobraziť "Zrušiť" kláves +personalize.usermenu_show_cancel Zobraziť klávesu "Zrušiť" personalize.visible Viditeľné -pictureviewer.defdir Východzí adresár +pictureviewer.defdir Predvolená zložka pictureviewer.head Prehliadač obrázkov pictureviewer.help1 Spôsob menu pictureviewer.help10 Zobrazenie spôsobu @@ -1926,7 +1980,7 @@ pictureviewer.help11 Znovunačítanie obrázku pictureviewer.help12 Predchádzajúci obrázok pictureviewer.help13 Nasledujúci obrázok pictureviewer.help14 Zmenšenie -pictureviewer.help15 Zvečšenie +pictureviewer.help15 Zväčšenie pictureviewer.help16 Pohyb nahor pictureviewer.help17 Pohyb doľava pictureviewer.help18 Pohyb doprava @@ -1934,10 +1988,10 @@ pictureviewer.help19 Pohyb nadol pictureviewer.help2 Zobrazenie obrázku pictureviewer.help3 Zmena poradia triedenia pictureviewer.help30 Mód audio prehrávača -pictureviewer.help31 Spustenia prehrávania -pictureviewer.help32 Pauzy prehrávania -pictureviewer.help33 Zastavenia prehrávania -pictureviewer.help34 Ďaľší titul +pictureviewer.help31 Spustenie prehrávania +pictureviewer.help32 Pozastavenie prehrávania +pictureviewer.help33 Zastavenie prehrávania +pictureviewer.help34 Ďalší titul pictureviewer.help35 Predošlý titul pictureviewer.help4 Bez mierky obrázku pictureviewer.help5 Mód DIASHOW @@ -1949,79 +2003,80 @@ pictureviewer.resize.color_average rozšírené pictureviewer.resize.none žiadne pictureviewer.resize.simple jednoduché pictureviewer.scaling Prispôsobenie -pictureviewer.show zobraz +pictureviewer.show Zobraziť pictureviewer.slide_time Čas zobrazenia pri prezentácii pictureviewer.slideshow Prezentácia pictureviewer.sortorder.date Zmena poradia triedenia (dátum) pictureviewer.sortorder.filename Zmena poradia triedenia (názov súboru) -ping.ok odpovedal (ping) -ping.protocol je nedosiahnutý (chyba hostu alebo protokolu) -ping.socket je nedosiahnutý (chyba soketu) +ping.ok je dosiahnuteľný (ping) +ping.protocol nedosiahnuteľný (chyba hostu alebo protokolu) +ping.socket nedosiahnuteľný (chyba soketu) ping.unreachable neodpovedal pinprotection.head Zadanie PIN kódu pinprotection.wrongcode Nespávny PIN kód! Skúste znova. -plugins.hdd_dir Plugin adresár na HDD +plugins.hdd_dir Zložka pre externý doplnok +plugins.no_plugin Žiadny doplnok plugins.result Výstup doplnku plugintype.disabled Nepoužitý plugintype.game Hra plugintype.lua Lua doplnok plugintype.script Skript plugintype.tool Nástroj -rclock.lockmsg Váš ovládač boxu bude zablokovaný.\n\nPre odblokovanie stlačte [ČERVENÝ] \na [MENU] na Vašom ovládači. -rclock.menueadd Zamknutie DO -rclock.title Zamknutie Diaľkového Ovládača -rclock.unlockmsg Ovládač opäť funkčný. +rclock.locked Uzamknuté +rclock.lockmsg Diaľkový ovládač uzamknutý.\n\nPre odblokovanie stlačte [ČERVENÉ] \na [MENU] na Vašom ovládači. +rclock.title Uzamknutie diaľkového ovládača +rclock.unlockmsg Diaľkové ovládanie funkčné... recording.is_running Tento kanál sa nahráva. Spustiť nové nahrávanie? -recording.start Spustenie nahrávania, prosím čakajte...! -recording.startstop_msg Správa pri spustení alebo ukončení nahrávania -recording.stop Zastavenie nahrávania, prosím čakajte...! -recording.time_hour hodina -recording.time_hours hodín -recording.time_min min +recording.start Spúšťanie nahrávania, čakajte prosím...! +recording.startstop_msg Upozorniť o začatí / ukončení nahrávania +recording.stop Zastavenie nahrávania, čakajte prosím...! +recording.time_hour Hodina +recording.time_hours Hodín +recording.time_min Min recordingmenu.apids Predvolené zvukové stopy -recordingmenu.apids_ac3 Nahraj zvuk AC3 -recordingmenu.apids_alt Nahraj ostatné zvukové stopy -recordingmenu.apids_std Nahraj štandartný zvuk +recordingmenu.apids_ac3 Nahrať zvuk AC3 +recordingmenu.apids_alt Nahrať ostatné zvukové stopy +recordingmenu.apids_std Nahrať štandartný zvuk recordingmenu.auto_cover Automatický náhľad -recordingmenu.data_pids Dátové stopy -recordingmenu.defdir Adresár nahrávania -recordingmenu.dvbsub_pids Nahraj titulky -recordingmenu.end_of_recording_epg EPG akt.udalosť -recordingmenu.end_of_recording_max max. čas nahrávania -recordingmenu.end_of_recording_name Konečný čas nahrávania -recordingmenu.file disk (súbor) +recordingmenu.data_pids Datové stopy +recordingmenu.defdir Zložka pre nahrávanie +recordingmenu.dvbsub_pids Nahrať titulky +recordingmenu.end_of_recording_epg času udalosti v EPG +recordingmenu.end_of_recording_max max. času nahrávania +recordingmenu.end_of_recording_name Ukončiť nahrávanie podľa +recordingmenu.file Disk (súbor) recordingmenu.filename_template Dočasný názov -recordingmenu.filename_template_hint wildcards budú nahradené +recordingmenu.filename_template_hint Zástupné znaky súborov budú nahradené recordingmenu.filename_template_hint2 %C = kanál, %T = názov, %I = info, %d = dátum, %t = čas -recordingmenu.help Nahrávacie zariadenie:\n--------------------------------------\nserver:\npotrebný streamovaci SW na PC\n\(analóg) VCR:\npotrebný VCR (druhý SCART)\n\ndisk (súbor):\npotrebný pripojený sieťový NFS adresár\nalebo vnútorný HDD disk\nTS: použi SPTS režim(dBox2)\nPES: nepouži SPTS režim(dBox2)\n\n\nMaximálna veľkosť súboru:\n---------------------\nNFS V2: 2 GB (2048 MB)\nNFS V3: takmer nekonečné (0 MB)\nFAT: 2 GB (2048 MB)\nFAT32: 4 GB (4096 MB)\n\nPre NFS (UDP) sa doporučuje synchronizovaný zápis -recordingmenu.multimenu.ask_stop_all skutočne zastaviť všetky %d nahrávania? -recordingmenu.multimenu.info_stop_all %d z %d nahrávaní budú zastavené. -recordingmenu.multimenu.rec_akt nahrať aktuálny kanál -recordingmenu.multimenu.stop_all zastaviť všetky nahrávania +recordingmenu.help Nahrávacie zariadenie:\n--------------------------------------\nserver:\npotrebný streamovaci SW na PC\n\(analóg) VCR:\npotrebný VCR (druhý SCART)\n\ndisk (súbor):\npotrebná pripojená sieťová zložka NFS\nalebo vnútorný HDD disk\nTS: použi SPTS režim(dBox2)\nPES: nepouži SPTS režim(dBox2)\n\n\nMaximálna veľkosť súboru:\n---------------------\nNFS V2: 2 GB (2048 MB)\nNFS V3: takmer nekonečné (0 MB)\nFAT: 2 GB (2048 MB)\nFAT32: 4 GB (4096 MB)\n\nPre NFS (UDP) sa doporučuje synchronizovaný zápis +recordingmenu.multimenu.ask_stop_all Skutočne zastaviť všetky %d nahrávania? +recordingmenu.multimenu.info_stop_all %d z %d nahrávaní bude zastavených. +recordingmenu.multimenu.rec_akt Nahrať aktuálny kanál +recordingmenu.multimenu.stop_all Zastaviť všetky nahrávania recordingmenu.multimenu.timeshift Časový posun recordingmenu.off vypnuté recordingmenu.record_is_not_running Žiadne nahrávanie nebeží! recordingmenu.record_is_running Nahrávanie beží! -recordingmenu.save_in_channeldir Zapísanie do adresára kanálu +recordingmenu.save_in_channeldir Nahrávanie do zložky s názvom kanálu recordingmenu.server server recordingmenu.server_mac Adresa MAC servera -recordingmenu.setupnow Použi nastavenia -recordingmenu.slow_warn Použi pomalé nahrávacie upozornenie +recordingmenu.setupnow Použiť nastavenia +recordingmenu.slow_warn Upozorniť na pomalé nahrávanie recordingmenu.timeshift Časový posun -recordingmenu.tsdir Adresár časového posunu -recordingmenu.vcr videomagnetofón -recordingmenu.vtxt_pid Nahraj teletext -recordingmenu.zap_on_announce Informuj o zapnutí nahrávania +recordingmenu.tsdir Zložka časového posunu +recordingmenu.vcr Videorekordér +recordingmenu.vtxt_pid Nahrať teletext +recordingmenu.zap_on_announce Prepnúť na kanál pred začatím nahrávania recordtimer.announce Začatie nahrávania za pár minút. -reset_all Továrenské nastavenie +reset_all Továrenské nastavenia reset_channels Zmazanie všetkych kanálov reset_confirm Skutočne? reset_removed Zmazanie odstránených kanálov -reset_settings Návrat k prednastavenému nastaveniu -satsetup.auto_scan Automatické prehľadanie vybraného satelitu -satsetup.auto_scan_all Automatické prehľadanie vybraných satelitov +reset_settings Návrat k predvoleným nastaveniam +satsetup.auto_scan Automatické prehľadávanie vybraného satelitu +satsetup.auto_scan_all Automatické prehľadávanie vybraných satelitov satsetup.cable Káblové vyhľadávanie -satsetup.cable_nid Network ID +satsetup.cable_nid ID siete satsetup.comm_input Potvrdený vstup satsetup.diseqc DiSEqC satsetup.diseqc10 DiSEqC 1.0 @@ -2033,26 +2088,26 @@ satsetup.diseqc_input DiSEqC vstup satsetup.diseqc_order Poradie DiSEqC príkazu satsetup.diseqc_uncom_com Nepotvrdený/Potvrdený satsetup.diseqcrepeat DiSEqC opakovania -satsetup.extended Nastavenia DiSEqC -satsetup.extended_motor Nastavenia motora +satsetup.extended Nastavenie DiSEqC +satsetup.extended_motor Nastavenie motora satsetup.fastscan_all SD a HD satsetup.fastscan_auto_diseqc Spustiť automatickú konfiguráciu DiSEqC satsetup.fastscan_auto_diseqc_wait Prebieha automatická konfigurácia DiSEqC satsetup.fastscan_hd len HD -satsetup.fastscan_head Rýchle prehľadanie (Fast-SCAN) +satsetup.fastscan_head Rýchle prehľadávanie (FastScan) satsetup.fastscan_prov Poskytovateľ satsetup.fastscan_prov_cd_hd CanalDigitaal (HD) satsetup.fastscan_prov_cd_sd CanalDigitaal (SD) satsetup.fastscan_prov_hda AustriaSat (HD) satsetup.fastscan_prov_hello M7 Group (HU) -satsetup.fastscan_prov_skylink_c M7 Group (CZ) -satsetup.fastscan_prov_skylink_s M7 Group (SK) +satsetup.fastscan_prov_skylink_c M7 Group [Skylink] (CZ) +satsetup.fastscan_prov_skylink_s M7 Group [Skylink] (SK) satsetup.fastscan_prov_telesat_b TeleSAT Belgium satsetup.fastscan_prov_telesat_l TeleSAT Luxemburg satsetup.fastscan_prov_tvv_hd TV Vlaanderen (HD) satsetup.fastscan_prov_tvv_sd TV Vlaanderen (SD) satsetup.fastscan_sd len SD -satsetup.fastscan_type Typ prehľadania +satsetup.fastscan_type Typ prehľadávania satsetup.fastscan_update Automatická aktualizácia satsetup.fe_delsys_mode Režim odbavovacieho systému satsetup.fe_delsys_mode_auto Auto @@ -2061,21 +2116,21 @@ satsetup.fe_delsys_mode_sat Družica satsetup.fe_delsys_mode_terrestrial Pozemne satsetup.fe_mode Mód tuneru satsetup.fe_mode_independent Nezávislý -satsetup.fe_mode_link_loop Prepojený +satsetup.fe_mode_link_loop Prepojený [loop] satsetup.fe_mode_link_twin Dvojitý satsetup.fe_mode_master Hlavný satsetup.fe_mode_unused Nepoužitý satsetup.fe_setup Nastavenie tuneru -satsetup.lofh LNB horné pásmo -satsetup.lofl LNB spodné pásmo -satsetup.lofs LNB prepnutie pásma +satsetup.lofh LNB Horné pásmo +satsetup.lofl LNB Dolné pásmo +satsetup.lofs LNB Prepnutie pásma satsetup.logical_hd Preferovať HD kanály satsetup.logical_numbers Použiť logické čísla satsetup.manual_scan Ručné prehľadávanie satsetup.minidiseqc Mini-DiSEqC satsetup.motor_pos Pozícia v motore satsetup.nodiseqc bez DiSEqC -satsetup.reset_numbers Resetovať čísla kanálu +satsetup.reset_numbers Resetovať čísla kanálov satsetup.sat_setup Nastavenia vstupov a LNB pre satelity satsetup.satellite Satelit satsetup.select_sat Výber satelitov @@ -2086,13 +2141,13 @@ satsetup.unicable Unicable satsetup.usals_repeat Opakovanie USALS príkazu satsetup.use_bat Použitie BAT satsetup.use_fta_flag Len nekódované -satsetup.use_nit Použitie NIT +satsetup.use_nit Použiť NIT (Network Information Table) satsetup.use_usals Použitie USALS sc.empty Žiadna karta v čítačke sc.init_failed Chyba inicializácie karty -sc.init_ok Inicializácia karty kompletná +sc.init_ok Inicializácia karty dokončená sc.inserted Karta vložená do čítačky -sc.removed Karta odstránená z čítačky +sc.removed Karta vytiahnutá z čítačky sc.reset Reset karty sc.timeout Vypršanie času menu karty sc.waiting Čakanie na odpoveď karty @@ -2101,10 +2156,10 @@ scants.abort_header Prerušenie vyhľadávania scants.actcable Kábel: scants.acthybrid Hybrid: scants.actsatellite Satelit: -scants.actterrestrial Pozemne: +scants.actterrestrial Pozemné: scants.bouquet Bukety -scants.bouquet_create vytvor nový -scants.bouquet_erase zmaž všetky +scants.bouquet_create vytvoriť nový +scants.bouquet_erase zmazať všetky scants.bouquet_leave bez zmien scants.bouquet_satellite Satelitný Buket scants.bouquet_update aktualizácia @@ -2115,81 +2170,86 @@ scants.bouquet_writenames_never nikdy scants.bouquet_writenames_ubouquets obľúbené scants.channel Kanál: scants.failed Neúspešné prehľadávanie! -scants.finished Dokončené prehľadávanie transpondérov! -scants.freqdata Kmitočet: -scants.head Prehľadanie transpondéra +scants.finished Prehľadávanie dokončené! +scants.freqdata Frekvencia: +scants.head Prehľadávanie transpondéra scants.numberofdataservices Data scants.numberofradioservices Rádio scants.numberoftotalservices Celkom scants.numberoftvservices TV -scants.preverences_receiving_system Preferencie +scants.preverences_receiving_system Nastavenia scants.preverences_scan Mód hľadania scants.provider Poskytovateľ: -scants.select_tp Vyber transpondér -scants.startnow Spusti prehľadávanie -scants.test Otestovanie signálu +scants.select_tp Výber transpondéru +scants.startnow Spustiť prehľadávanie +scants.test Test signálu scants.transponders Transpondéry: scrambled_channel Kódovaný kanál screensaver.delay Oneskorenie -screensaver.dir Adresár +screensaver.dir Zložka screensaver.menu Šetrič obrazovky -screensaver.off Vypnutie šetriča -screensaver.timeout Zmena obrázkov +screensaver.mode Režim +screensaver.mode_clock Hodiny +screensaver.mode_clock_color Farebné hodiny +screensaver.mode_image Obrázky +screensaver.off Šetrič obrazovky +screensaver.random Náhodné obrázky +screensaver.timeout Zmena intervalu screensetup.lowerright zelený = dolný, pravý okraj screensetup.upperleft červený = horný, ľavý oraj screenshot.count Počet -screenshot.cover Vytvor obálku pre prehliadač filmov -screenshot.defdir Umiestnenie adresára +screenshot.cover Vytvoriť obálku pre prehliadač filmov +screenshot.defdir Umiestnenie zložky screenshot.format Formát -screenshot.info Screenshot kláves nepoužitý -screenshot.menu Obrázok obrazovky +screenshot.info Screenshot klávesa nepoužitá +screenshot.menu Snímok obrazovky screenshot.osd OSD rozlíšenie screenshot.res Rozlíšenie screenshot.scale Pomer screenshot.tv TV rozlíšenie screenshot.video Obraz na pozadí servicemenu.getplugins Načítanie doplnkov -servicemenu.getplugins_hint Načítavanie doplnkov,\nprosím čakaj... -servicemenu.head Služby -servicemenu.imageinfo Informácia o IMAGE +servicemenu.getplugins_hint Načítavanie doplnkov,\nčakajte prosím... +servicemenu.head Inštalácia / služby +servicemenu.imageinfo Informácie o softvéri servicemenu.reload Načítanie zoznamu kanálov -servicemenu.reload_hint Načítavanie zoznamu kanálov,\nprosím čakaj... -servicemenu.restart Reštart software -servicemenu.restart_hint Reštartovanie, prosím čakaj... -servicemenu.restart_refused_recording Neumožnené reštartovanie, prebieha nahrávanie -servicemenu.scants Hľadanie kanálov -servicemenu.update Aktualizácia software -settings.backup Záloha nastavení +servicemenu.reload_hint Načítavanie zoznamu kanálov,\nčakajte prosím... +servicemenu.restart Softvérový reštart +servicemenu.restart_hint Reštartovanie, čakajte prosím... +servicemenu.restart_refused_recording Prebieha nahrávanie... Reštart nie je povolený! +servicemenu.scants Prehľadávanie kanálov +servicemenu.update Aktualizácia softvéru +settings.backup NG-Záloha: Uloženie nastavení settings.backup_failed Chybná záloha! settings.help Nápoveda -settings.menu_hints Zobrazí rady nápovedy +settings.menu_hints Zobraziť nápovedu settings.menu_pos Umiestnenie ponuky settings.menus Ponuky -settings.missingoptionsconffile Nastavenia Neutrino boli aktualizované.\nNové možosti budú mať prednastavené hodnoty. -settings.noconffile Nenájdené nastavenia Neutrino.\nPoužité budú prednastavené hodnoty. -settings.pos_bottom_center spodný stred -settings.pos_bottom_left ľavý spodok -settings.pos_bottom_right pravý spodok -settings.pos_default_center stred +settings.missingoptionsconffile Nastavenia Neutrino boli aktualizované.\nNové možnosti budú mať predvolené hodnoty. +settings.noconffile Nenájdené nastavenia Neutrino.\nPoužité budú predvolené hodnoty. +settings.pos_bottom_center v strede naspodu +settings.pos_bottom_left vľavo dole +settings.pos_bottom_right vpravo dole +settings.pos_default_center v strede settings.pos_higher_center spodný vyšší stred -settings.pos_top_center vrchný stred -settings.pos_top_left ľavý vrch -settings.pos_top_right pravý vrch -settings.restore Obnovenie nastavení -settings.restore_warn Budú nahradené všetky nastavenia a reštartujem sa\nPokračovať ? +settings.pos_top_center v strede navrchu +settings.pos_top_left vľavo hore +settings.pos_top_right vpravo hore +settings.restore NG-Záloha: Obnovenie nastavení +settings.restore_warn Všetky nastavenia budú nahradené a vykoná sa reštart.\nPokračovať? shutdown.recording_query Skutočne prerušiť nahrávanie? shutdowntimer.announce Vypnutie boxu za minútu.\nZrušiť vypnutie? -sleeptimerbox.announce Do vypnutia ostáva minúta. -sleeptimerbox.hint1 Čas do vypnutia v minútach (000=vypnuté) -sleeptimerbox.hint2 Po uplinutí tohto času sa vypnem. -sleeptimerbox.hint3 Po uplinutí tohto času sa vypnem, ak sa nepoužije diaľkový ovládač +sleeptimerbox.announce Do vypnutia zostáva minúta. +sleeptimerbox.hint1 Čas do vypnutia v minútach (000 = vypnuté). +sleeptimerbox.hint2 Po uplynutí tohto času dôjde k vypnutiu prijímača. +sleeptimerbox.hint3 Po uplynutí tohto času dôjde k vypnutiu, ak sa nepoužije diaľkový ovládač. sleeptimerbox.title Časovač vypnutia sleeptimerbox.title2 Čas vypnutia pri neaktivite streaminfo.aratio Formát obrazu streaminfo.aratio_unknown Formát obrazu: neznámy streaminfo.audiotype Formát zvuku streaminfo.audiotype_unknown neznámy -streaminfo.average_bitrate priemer +streaminfo.average_bitrate Priemer streaminfo.bitrate Prenosová rýchlosť streaminfo.framerate Snímková rýchlosť streaminfo.framerate_unknown Snímková rýchlosť: neznáma @@ -2198,53 +2258,53 @@ streaminfo.not_available nedostupné streaminfo.resolution Rozlíšenie streaminfo.signal Parametre signálu streaming.busy Nahrávací proces aktívny.\nAk sa správa zobrazuje a nie je nič nahrávané,\nreštartujte Neutrino. -streaming.dir_not_writable Do nahrávacieho adresára nie je možné nahrávať.\nNahrávanie nebude pracovať. -streaming.overflow Pretečenie buferu nahrávania, zvážte zastavenie niekterých nahrávaní -streaming.slow System/HDD je pomalý, zvážte zastavenie niekterých nahrávaní -streaming.write_error Nahrávanie bolo prerušené\npretože vznikla chybu počas zapisovacieho procesu. +streaming.dir_not_writable Do zložky určenéj pre nahrávanie nie je možné zapisovať.\nNahrávanie nie je možné. +streaming.overflow Pretečenie buferu nahrávania, zvážte zastavenie niektorých nahrávaní +streaming.slow Systém/HDD je pomalý, zvážte zastavenie niektorých nahrávaní +streaming.write_error Nahrávanie prerušené z dôvodu chyby zápisu. stringinput.backspace Naspäť -stringinput.caps veľké/malé znaky -stringinput.clear všetko zmaž +stringinput.caps Veľké/Malé znaky +stringinput.clear Všetko zmazať stringinput.insert Vložiť stringinput.save Uložiť subtitles.charset Znaková sada subtitles.head Titulky subtitles.stop Vypnúť titulky terrestrialsetup.area Územie -terrestrialsetup.provider Pozemný prevádzkovateľ +terrestrialsetup.provider DVB-T poskytovateľ timer.eventrecord.msg Udalosť je naplánovaná na nahrávanie.\nPre úpravu plánu otvorte časovač nahrávania. timer.eventrecord.title Plánovač nahrávania -timer.eventtimed.msg Táto relácia je naplánovaná.\nBox bude zapnutý a prepnutý \nna tento kanál v stanovenom čase. +timer.eventtimed.msg Plánované pripomenutie.\nPrijímač sa v stanovenom čase zapne\na prepne na zvolený kanál. timer.eventtimed.title Plánovač udalostí -timerbar.channelswitch prepni -timerbar.recordevent nahraj +timerbar.channelswitch Prepnúť +timerbar.recordevent Nahrať timerlist.alarmtime Čas spustenia timerlist.apids PIDy zvuku -timerlist.apids_dflt nahrávanie normálnych zvukových stôp +timerlist.apids_dflt Nahrávanie normálnych zvukových stôp timerlist.ask_to_delete Zmazanie stôp časovača aktuálneho nahrávania!\nSkutočne vykonať? timerlist.bouquetselect Výber buketu timerlist.channel Kanál timerlist.channelselect Výber kanálu -timerlist.delete zmaž -timerlist.menumodify upravenie časovača -timerlist.menunew nový plán +timerlist.delete Zmazať +timerlist.menumodify Upravenie časovača +timerlist.menunew Nový plán timerlist.message Správa timerlist.moderadio Rádiové kanály timerlist.modeselect Výber typu timerlist.modetv Televízne kanály -timerlist.modify uprav +timerlist.modify Upraviť timerlist.name Časovač -timerlist.new nový plán +timerlist.new Nový plán timerlist.overlapping_timer Konflikt časovača. Vytvoriť plán aj tak? timerlist.plugin Doplnky timerlist.program.unknown Neznámy program -timerlist.recording_dir Adresár nahrávania -timerlist.reload obnov -timerlist.repeat Opakuj -timerlist.repeat.biweekly v dňoch voľna +timerlist.recording_dir Zložka nahrávania +timerlist.reload Obnoviť +timerlist.repeat Opakovať +timerlist.repeat.biweekly V dňoch voľna timerlist.repeat.byeventdescription pozrieť plán timerlist.repeat.daily denne -timerlist.repeat.fourweekly štyri krát týždenne +timerlist.repeat.fourweekly 4-krát týždenne timerlist.repeat.friday Pi timerlist.repeat.monday Po timerlist.repeat.monthly mesačne @@ -2257,31 +2317,31 @@ timerlist.repeat.unknown neznáme timerlist.repeat.wednesday St timerlist.repeat.weekdays v dňoch týždňa timerlist.repeat.weekly týždenne -timerlist.repeatcount Opakovania +timerlist.repeatcount Opakovanie timerlist.repeatcount.help1 Počet opakovaní timerlist.repeatcount.help2 ´0´ - stále opakuj -timerlist.save Ulož plán -timerlist.standby Stav pripravenosti -timerlist.standby.off zo stavu pripravenosti -timerlist.standby.on do stavu pripravenosti +timerlist.save Uložiť plán +timerlist.standby Akcia +timerlist.standby.off Opustiť pohotovostný režim +timerlist.standby.on Do pohotovostného režimu timerlist.stoptime Čas vypnutia timerlist.type Typ časovača -timerlist.type.execplugin spustenie doplnku +timerlist.type.execplugin Spustenie doplnku timerlist.type.nextprogram Nasledujúci program -timerlist.type.record nahrávanie -timerlist.type.remind pripomenutie -timerlist.type.shutdown vypnutie -timerlist.type.sleeptimer časové vypnutie -timerlist.type.standby pripravenosť -timerlist.type.unknown neznáme -timerlist.type.zapto prepnutie +timerlist.type.record Nahrávanie +timerlist.type.remind Pripomenutie +timerlist.type.shutdown Vypnutie +timerlist.type.sleeptimer Časové vypnutie +timerlist.type.standby Akcia +timerlist.type.unknown Neznáme +timerlist.type.zapto Prepnutie timerlist.weekdays V dňoch týždňa timerlist.weekdays.hint_1 Po Ut St Št Pi So Ne timerlist.weekdays.hint_2 'X'=plánované '-' neplánované -timersettings.record_safety_time_after Korekcia ukončenia nahrávania +timersettings.record_safety_time_after Korekcia času ukončenia nahrávania timersettings.record_safety_time_after.hint_1 Čas v min. (00=vypnuté), ktorý bude pripočítaný timersettings.record_safety_time_after.hint_2 po ukončení daného plánu -timersettings.record_safety_time_before Korekcia začiatku nahrávania +timersettings.record_safety_time_before Korekcia času začiatku nahrávania timersettings.record_safety_time_before.hint_1 Čass v min. (00=vypnuté), ktorý bude odpočítaný timersettings.record_safety_time_before.hint_2 pri spustení daného plánu timersettings.separator Nastavenie časovača @@ -2293,12 +2353,12 @@ timing.hint_2 na obrazovke TV (v sekundách) timing.infobar Stavový riadok timing.infobar_movieplayer Stavový riadok (filmový mód) timing.infobar_radio Stavový riadok (rádio mód) -timing.menu Menu +timing.menu Ponuka timing.numericzap Prepínanie číslami -timing.volumebar Ukazovateľ hlasitosti -tmdb.read_data Hľadaj TMDB dáta... +timing.volumebar Ukazateľ hlasitosti +tmdb.read_data Vyhľadávanie údajov TMDB... unicable.lnb Vstup Unicable -unicable.qrg Kmitočet Unicable +unicable.qrg Frekvencia Unicable unicable.scr SCR Unicable unit.decimal . unit.long.years roky @@ -2310,24 +2370,29 @@ upnpbrowser.head UPnP prehliadač upnpbrowser.noservers Nenájdený UPnP server upnpbrowser.rescan Znova hľadať upnpbrowser.scanning Hľadanie UPnP serverov -usermenu.button_blue Uživateľské menu MODRÉ -usermenu.button_green Uživateľské menu ZELENÉ -usermenu.button_red Uživateľské menu ČERVENÉ -usermenu.button_yellow Uživateľské menu ŽLTÉ -usermenu.head Uživateľské menu +usermenu.button_blue Užívateľské menu MODRÉ +usermenu.button_green Užívateľské menu ZELENÉ +usermenu.button_red Užívateľské menu ČERVENÉ +usermenu.button_yellow Užívateľské menu ŽLTÉ +usermenu.head Užívateľské menu +usermenu.item_adzap AutPrep usermenu.item_bar --- Lemovanie --- usermenu.item_epg_misc Funkcie EPG -usermenu.item_none Nič +usermenu.item_none (prázdne) usermenu.item_plugin_types Typy doplnku usermenu.item_vtxt Teletext usermenu.items Položky menu usermenu.key Klávesa usermenu.key_select Priradená klávesa usermenu.msg_info_is_empty Nenadefinovaný názov pre toto menu!\nPoužije sa prednastavený názov:\n -usermenu.msg_warning_name Máte viac ako jednu položku vytvorené pro toto menu,\nale žiadny definovaný nový názov pro toto menu.\nDoporučujem vytvoriť nový názov! +usermenu.msg_warning_name Máte viac ako jednu položku vytvorenú pre toto menu,\nale žiadny definovaný nový názov pro toto menu.\nDoporučujem vytvoriť nový názov! usermenu.msg_warning_no_items Nedefinované žiadne položky!\nZresetovaný názov menu! usermenu.name Názov -video_mode_ok Video režim pracuje správne? +usermenu.title_blue Možnosti +usermenu.title_green Zvuk +usermenu.title_red Udalosti +usermenu.title_yellow Obraz +video_mode_ok Pracuje tento video režim správne? videomenu.43mode Zobrazenie formátu 4:3 videomenu.analog_auto AUTO videomenu.analog_cvbs CVBS @@ -2348,27 +2413,27 @@ videomenu.auto Automaticky videomenu.brightness Jas videomenu.cinch CINCH videomenu.contrast Kontrast -videomenu.dbdr MPEG2 deblock/dering -videomenu.dbdr_both deblock+dering -videomenu.dbdr_deblock deblock -videomenu.dbdr_none nič +videomenu.dbdr MPEG2 filter +videomenu.dbdr_both deBlock a deRing +videomenu.dbdr_deblock deBlock +videomenu.dbdr_none žiadne videomenu.enabled_modes Nastavenie režimov pre VF klávesu -videomenu.enabled_modes_auto Automatický výber použitých režimov +videomenu.enabled_modes_auto Automatický výber povolených režimov videomenu.fullscreen Celý obraz -videomenu.hdmi_cec Uživateľské ovládanie (HDMI-CEC) -videomenu.hdmi_cec_mode Mód HDMI-CEC +videomenu.hdmi_cec Ovládanie cez HDMI (HDMI-CEC) +videomenu.hdmi_cec_mode Režim HDMI-CEC videomenu.hdmi_cec_mode_off vyp -videomenu.hdmi_cec_mode_recorder ako Rekordér -videomenu.hdmi_cec_mode_tuner ako Tuner -videomenu.hdmi_cec_standby Použiť CEC v pripravenosti -videomenu.hdmi_cec_view_on Použiť CEC pri sledovaní -videomenu.hue Nasýtenie +videomenu.hdmi_cec_mode_recorder ako DVB-S/DVB-C rekordér +videomenu.hdmi_cec_mode_tuner ako DVB-S/DVB-C prijímač +videomenu.hdmi_cec_standby Použiť CEC v pohotovostnom režime +videomenu.hdmi_cec_view_on Použiť CEC pri sledovaní TV +videomenu.hue Odtieň videomenu.letterbox Letterbox videomenu.panscan Pan&Scan videomenu.panscan2 14:9 Pan&Scan -videomenu.pip PiP nastavenie -videomenu.pip_error Chybné spustenie PiP -videomenu.saturation Farebnosť +videomenu.pip Nastavenie PiP +videomenu.pip_error Chyba spustenia PiP +videomenu.saturation Nasýtenie videomenu.scart SCART videomenu.screensetup Nastavenie zobrazenia OSD videomenu.sdosd SD OSD @@ -2384,30 +2449,30 @@ videomenu.videoformat_43 4:3 videomenu.videomode Obrazový režim webtv.head WebTV webtv.xml WebTV XML súbory -webtv.xml.add Pridaj XML súbor -webtv.xml.del Odstráň XML súbor +webtv.xml.add Pridať XML súbor +webtv.xml.del Odstrániť XML súbor window_size Veľkosť okna v % -wizard.initial_settings Najdené ininicializačné nastavenia -wizard.install_settings Chcete inštalovať kanály pre Astra 19.2°E? +wizard.initial_settings Najdené základné nastavenia +wizard.install_settings Chcete inštalovať kanály pre Astru 19.2°E? wizard.setup Úvodná inštalácia wizard.setup_advanced Rozšírená wizard.setup_easy Jednoduchá wizard.setup_type Typ inštalácie wizard.setup_type_hint Jednoduché nastavenie pre CanalDigitaal/TĂ©lĂ©SAT/TV Vlaanderen alebo jednoduché káblové vyhľadávanie -wizard.welcome_head Vitajte v Sprievodcovi nastavenia -wizard.welcome_text Ďaľšie kroky prevedú základnú inštaláciu tohto zariadenia.\nChceš pokračovať?\nBlahoželáme k zakúpeniu CST. Nasledujúce \nkroky ťa prevedú počiatočnou inštaláciou nastavenia prístroja.\nPrajeme ti veľa radosti s týmto príjmačom!\nĎaľší krok ? +wizard.welcome_head Vitajte v NG-Sprievodcovi nastavení +wizard.welcome_text NG-Image Informácia:\nVáš prijímač môžete pohodlne ovládať\ns webovým rozhraním pre správu časovača alebo živé vysielanie cez internetový prehliadač.\nPrístupové heslo nie je zatiaľ nastavené!\nNastavte ho za pomoci použitia príkazu "passwd" cez telnet rozhranie\nChcete pokračovať ?\nBlahoželáme k zakúpeniu CST. Nasledujúce \nkroky vás prevedú počiatočnou inštaláciou nastavenia prístroja.\nPrajeme vám veľa radosti s týmto prijímačom!\nĎalší krok ? word.from z word.in v zapit.scantype Vyhľadávanie kanálov -zapit.scantype.all všetkých -zapit.scantype.radio len Rádio -zapit.scantype.tv len TV +zapit.scantype.all Všetky +zapit.scantype.radio Len Rádio +zapit.scantype.tv Len TV zapit.scantype.tvradio TV a Rádio -zapitsetup.channelmode Východzí TV zoznam kanálov -zapitsetup.channelmode_radio Východzí Radio zoznam kanálov -zapitsetup.head Nastavenia kanála spustenia +zapitsetup.channelmode Východzí zoznam TV kanálov +zapitsetup.channelmode_radio Východzí zoznam Rádio kanálov +zapitsetup.head Nastavenie kanálu pri spustení zapitsetup.info Kanál pri spustení zapitsetup.last_radio Rádiový kanál zapitsetup.last_tv TV kanál -zapitsetup.last_use posledný sledovaný kanál +zapitsetup.last_use Posledný sledovaný kanál zaptotimer.announce Minúta do zmeny kanálu. From 1cc131bce9c870cecf8f83c6616417a041cb241e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 Feb 2016 21:20:21 +0100 Subject: [PATCH 391/690] CTextBox: don't paint full background if max text width smaller than bg width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2dd2fac37609c190c01312b919d58321c08d519d Author: Thilo Graf Date: 2016-02-10 (Wed, 10 Feb 2016) --- src/gui/widget/textbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e2daec4bd..0fc38b141 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_cFrameTextRel.iWidth; + int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,6 +602,7 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); + //paint full background only on new text, otherwise paint required background frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } } From 5a6684ed94f5f02208f3f5a687aee62e1a646017 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 4 May 2016 17:42:51 +0200 Subject: [PATCH 392/690] CMenuWidget: avoid dangling pointer after delete Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91729dc48a20ce9e2e004695a535d98f789731cc Author: Thilo Graf Date: 2016-05-04 (Wed, 04 May 2016) --- src/gui/widget/menue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 64baaca59..4935cf5bf 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -677,8 +677,10 @@ void CMenuWidget::resetWidget(bool delete_items) { for(unsigned int count=0;countisStatic) + if (delete_items && !item->isStatic){ delete item; + item = NULL; + } } items.clear(); From 0df821d472def816c1669c56b1513ce95358f0cc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Jun 2016 15:26:33 +0200 Subject: [PATCH 393/690] CComponentsFrmClock: disable non-essential debug output It was just important to see how the texts are fitted inside a parent element. It's just a debugging relic. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d3f70b11269b54be1b8604cb9443fa07e15886f Author: Thilo Graf Date: 2016-06-26 (Sun, 26 Jun 2016) --- src/gui/components/cc_frm_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 7a36db280..a6e0b773b 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -420,7 +420,7 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); CCDraw::setHeight(f_height); }else CCDraw::setHeight(h); From 67e645be25a6896857814fcd273fb652a8bef0bc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 24 Feb 2016 19:10:31 +0100 Subject: [PATCH 394/690] CComponentsWindow: ensure default disable background paint on window Only basic items should have enabled background paint as default. Should be better for performance. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f64aff1dc931c13935862893c6d47ba56fdd126 Author: Thilo Graf Date: 2016-02-24 (Wed, 24 Feb 2016) --- src/gui/components/cc_frm_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index f964a7f06..e3481ac93 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -133,7 +133,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_icon_name = iconname; dprintf(DEBUG_DEBUG, "[CComponentsWindow] [%s - %d] icon name = %s\n", __func__, __LINE__, ccw_icon_name.c_str()); - + paint_bg = false; shadow = shadow_mode; col_frame = color_frame; col_body = color_body; From de5cef653cbb5f6780aa8e6787a6bd6e45ef1d65 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 17 May 2016 15:42:03 +0200 Subject: [PATCH 395/690] CComponentsWindow: use only body as background Should provide more performance Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/775e5c73a4eee0bc9864291bdfe1d18370bbdc70 Author: Thilo Graf Date: 2016-05-17 (Tue, 17 May 2016) --- src/gui/components/cc_frm_window.cpp | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index e3481ac93..388f7f6ac 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -215,12 +215,13 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, CC_APPEND); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()/*- fr_thickness*/); ccw_footer->setWidth(width-2*fr_thickness); - ccw_footer->enableShadow(shadow); - ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); + ccw_footer->enableShadow(false/*shadow*/); + ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); + ccw_footer->doPaintBg(true); } } @@ -240,7 +241,7 @@ void CComponentsWindow::initLeftSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); - ccw_left_sidebar->doPaintBg(false); + ccw_left_sidebar->doPaintBg(true); } } @@ -260,7 +261,7 @@ void CComponentsWindow::initRightSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); - ccw_right_sidebar->doPaintBg(false); + ccw_right_sidebar->doPaintBg(true); } } @@ -271,25 +272,36 @@ void CComponentsWindow::initBody() //add of body item happens initCCWItems() //set body properties if (ccw_body){ - ccw_body->setCornerType(0); + ccw_body->setCorner(corner_rad-fr_thickness/2, CORNER_NONE); int h_footer = 0; int h_header = 0; int w_l_sidebar = 0; int w_r_sidebar = 0; - if (ccw_footer) + if (ccw_footer){ h_footer = ccw_footer->getHeight(); - if (ccw_head) + } + if (ccw_head){ h_header = ccw_head->getHeight(); + } if (ccw_left_sidebar) w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer - 2*fr_thickness; + int h_body = height - h_header - h_footer/* - 2*fr_thickness*/; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; - ccw_body->setDimensionsAll(x_body, CC_APPEND, w_body, h_body); - ccw_body->doPaintBg(false); + ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); + ccw_body->doPaintBg(true); + + //handle corner behavior + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + if (!ccw_show_footer) + ccw_body->setCornerType(ccw_body->getCornerType() | CORNER_BOTTOM); + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + } } From cc71c0c923ed56aad373f6b7d79e440562795a09 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 6 Apr 2016 20:08:18 +0200 Subject: [PATCH 396/690] CCDraw: enable/disable frame if frame on changed frame width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2f96948faf229bde107fe59a57558120a93c8f6 Author: Thilo Graf Date: 2016-04-06 (Wed, 06 Apr 2016) --- src/gui/components/cc_draw.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index b5ef5bf0d..8934d66e4 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -224,6 +224,11 @@ void CCDraw::setFrameThickness(const int& thickness, const int& thickness_sel) if (fr_thickness_sel != thickness_sel) fr_thickness_sel = thickness_sel; + + //ensure enabled frame if frame width > 0 + cc_enable_frame = false; + if (fr_thickness) + cc_enable_frame = true; } bool CCDraw::enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color, const int& direction) From c9af09e064aabd9c857a6e54d0bb2e8962aac414 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Mar 2016 23:26:58 +0100 Subject: [PATCH 397/690] CUpnpBrowserGui: fix paint image while scroll, use transparent background Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/145209aaa160801615f9c6148bf3aa72adf04a49 Author: Thilo Graf Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/upnpbrowser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 5baa6df67..73ee2a79e 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1096,6 +1096,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) int y_image = ibox.getYPos() + ibox.getHeight()/2 - h_image/2; if (!image){ image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0); + image->doPaintBg(false); + image->SetTransparent(CFrameBuffer::TM_BLACK); } image->setPicture(tmpname); image->setHeight(h_image, true); @@ -1185,9 +1187,9 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text += "\n" + entry->album; ibox.setText(text, CTextBox::AUTO_WIDTH); ibox.paint0(); - if (image) - image->paint0(); } + if (image) + image->paint0(); timebox.paint0(); } } From 178163e2da164cf240150a583c133a8a3af3878a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 16 Apr 2016 20:00:32 +0200 Subject: [PATCH 398/690] dvbsubtitle.cpp: fix wconversion compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d9aab3ed812643f5547c35a83b457d7e83861395 Author: Thilo Graf Date: 2016-04-16 (Sat, 16 Apr 2016) --- lib/libdvbsub/dvbsubtitle.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index d480f6299..0be467e10 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -119,7 +119,7 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) double xc = (double) CFrameBuffer::getInstance()->getScreenWidth(true)/(double) 720; double yc = (double) CFrameBuffer::getInstance()->getScreenHeight(true)/(double) 576; xc = yc; //FIXME should we scale also to full width ? - int xf = xc * (double) 720; + int xf = int(xc * (double) 720); for (i = 0; i < Count(); i++) { uint32_t * colors = (uint32_t *) sub.rects[i]->pict.data[1]; @@ -127,15 +127,15 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int height = sub.rects[i]->h; int xoff, yoff; - int nw = width == 1280 ? ((double) width / xc) : ((double) width * xc); - int nh = (double) height * yc; + int nw = int(width == 1280 ? ((double) width / xc) : ((double) width * xc)); + int nh = int((double) height * yc); int xdiff = (wd > xf) ? ((wd - xf) / 2) : 0; - xoff = sub.rects[i]->x*xc + xstart + xdiff; + xoff = int(sub.rects[i]->x*xc + xstart + xdiff); if(sub.rects[i]->y < 576/2) { - yoff = ystart + sub.rects[i]->y*yc; + yoff = int(ystart + sub.rects[i]->y*yc); } else { - yoff = yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh; + yoff = int(yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh); if(yoff < ystart) yoff = ystart; } @@ -343,7 +343,7 @@ int cDvbSubtitleConverter::Action(void) bitmaps->Del(sb, true); } else if (Delta < WaitMs) - WaitMs = (Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta; + WaitMs = int((Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta); } else bitmaps->Del(sb, true); From 338e29a3928da4f328f489d39fe33f44e291121a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 16 May 2016 16:01:54 +0200 Subject: [PATCH 399/690] CComponentsWindow: try to fix reduce of item height on enabled frame The lower part of the window frame was always painted over. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a1d687b3500b340afc7c010d2e118732115ab89 Author: Thilo Graf Date: 2016-05-16 (Mon, 16 May 2016) --- src/gui/components/cc_frm_window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 388f7f6ac..27a190d6d 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -215,7 +215,7 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()/*- fr_thickness*/); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); ccw_footer->setWidth(width-2*fr_thickness); ccw_footer->enableShadow(false/*shadow*/); ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); @@ -287,7 +287,7 @@ void CComponentsWindow::initBody() w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer/* - 2*fr_thickness*/; + int h_body = height - h_header - h_footer - fr_thickness; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; From b57cc261e00cd7b8066f918b088bb3d77bf57407 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 16 May 2016 15:59:14 +0200 Subject: [PATCH 400/690] CComponentsItem: ensure display of frame as last layer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/711cb98754bf455e58f1a6ed751c717fb3466b47 Author: Thilo Graf Date: 2016-05-16 (Mon, 16 May 2016) --- src/gui/components/cc_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 2f36f262c..a1f30fc16 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -111,8 +111,8 @@ void CComponentsItem::paintInit(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+isw/2, height+isw/2, 0, 0, 0, 0, NULL, NULL, NULL, false}, //buffered bg {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ixsr, iy+isw/2, isw, height, col_shadow, corner_rad, corner_type & CORNER_RIGHT, 0, NULL, NULL, NULL, false}, //shadow right {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+isw/2, iysb, width, isw, col_shadow, corner_rad, corner_type & CORNER_BOTTOM, 0, NULL, NULL, NULL, false}, //shadow bottom - {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, //body + {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} //frame }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) { From 88622a07b480a626a4d97bba9e05799a9984cceb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 21 Jun 2016 12:33:49 +0200 Subject: [PATCH 401/690] CComponentsWindow: change order of items Add header and footer items as first and body as last item. Render of items occurs in listed order. So it's better for performance while render of window. This is something more advantageously because all other items are contained inside body. So we avoid possible delay while rendering of base items. It looks better on screen. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29d723a97b699f6ad3ffede29c94975f9a84db8a Author: Thilo Graf Date: 2016-06-21 (Tue, 21 Jun 2016) Origin message was: ------------------ CComponentsWindow: change order of items Add header and footer items as first and body as last item. Render of items occurs in listed order. So it's better for performance while render of window. This is something more advantageously because all other items are contained inside body. So we avoid possible delay while rendering of base items. It looks better on screen. --- src/gui/components/cc_frm_window.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 27a190d6d..67b3657a2 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -352,15 +352,19 @@ void CComponentsWindow::initCCWItems() //init window body core initBody(); - //add header, body and footer items only one time + /*Add header and footer items as first and body as last item. + Render of items occurs in listed order. So it's better for performance while render of window. + This is something more advantageously because all other items are contained inside body. + So we avoid possible delay while rendering of base items. It looks better on screen. + */ if (ccw_head) if (!ccw_head->isAdded()) addCCItem(ccw_head); - if (!ccw_body->isAdded()) - addCCItem(ccw_body); if (ccw_footer) if (!ccw_footer->isAdded()) addCCItem(ccw_footer); + if (!ccw_body->isAdded()) + addCCItem(ccw_body); } void CComponentsWindow::enableSidebar(const int& sidbar_type) From af85ced50c941885b110a9f8f2784dd1a227d7d8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 15 Apr 2016 22:07:04 +0200 Subject: [PATCH 402/690] CMessageBox: ignore mute button for message boxes In some constellations it's possible that mute button is passed. For example see deleting functionality in moviebrowser. This should avoid unintended passing. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/62861c5f969066e17ede59fa6b922dcfda9082f4 Author: Thilo Graf Date: 2016-04-15 (Fri, 15 Apr 2016) --- src/gui/widget/messagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 429d55a41..f5d6aa117 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -271,7 +271,7 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr) ) + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) From 353e0f504b58018c29e42ab29cdca832043866a0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 23 Jun 2016 15:42:14 +0200 Subject: [PATCH 403/690] no need to assign mainmenu as an argument to realrun() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c0b1981f6820c96b9c7e931237e617cd2792ec6 Author: vanhofen Date: 2016-06-23 (Thu, 23 Jun 2016) Origin message was: ------------------ - no need to assign mainmenu as an argument to realrun() --- src/neutrino.cpp | 7 ++++--- src/neutrino.h | 2 +- src/neutrino_menue.cpp | 18 ++++-------------- src/neutrino_menue.h | 10 +++++++++- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0d0268c3d..7c590d0b1 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -47,6 +47,7 @@ #include "global.h" #include "neutrino.h" +#include "neutrino_menue.h" #include "version_pseudo.h" #include @@ -2172,7 +2173,7 @@ TIMER_STOP("################################## after all ####################### } delete hintBox; } - RealRun(personalize.getWidget(0)/**main**/); + RealRun(); ExitRun(true, (cs_get_revision() > 7)); @@ -2260,9 +2261,9 @@ void CNeutrinoApp::screensaver(bool on) } } -void CNeutrinoApp::RealRun(CMenuWidget &_mainMenu) +void CNeutrinoApp::RealRun() { - mainMenu = &_mainMenu; + mainMenu = &personalize.getWidget(MENU_MAIN); neutrino_msg_t msg; neutrino_msg_data_t data; diff --git a/src/neutrino.h b/src/neutrino.h index d37880b3d..61f616bfd 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -120,7 +120,7 @@ private: void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name); void ExitRun(const bool write_si = true, int retcode = 0); - void RealRun(CMenuWidget &mainSettings); + void RealRun(); void InitZapper(); void InitTimerdClient(); void InitZapitClient(); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index e1ccb6305..158074334 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -89,16 +89,6 @@ extern CCAMMenuHandler * g_CamHandler; // extern char current_timezone[50]; // extern bool autoshift; -enum -{ - MENU_MAIN, - MENU_SETTINGS, - MENU_SERVICE, - MENU_SHUTDOWN, - - MENU_MAX //3 -}; - #define MENU_WIDTH 35 const mn_widget_struct_t menu_widgets[MENU_MAX] = @@ -150,7 +140,7 @@ void CNeutrinoApp::InitMenuMain() // Dynamic renumbering personalize.setShortcut(); - CMenuWidget &menu = personalize.getWidget(MENU_MAIN)/**main**/; + CMenuWidget &menu = personalize.getWidget(MENU_MAIN); menu.addKey(CRCInput::RC_stop, this, "easyswitch"); //top @@ -235,7 +225,7 @@ void CNeutrinoApp::InitMenuMain() //2nd section*************************************************************************************************** // settings, also as pin protected option in personalize menu, as a result of parameter value CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION - mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS)/**settings**/); + mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS)); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SETTINGS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SETTINGS], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); @@ -325,7 +315,7 @@ void CNeutrinoApp::InitMenuSettings() { dprintf(DEBUG_DEBUG, "init settings menue...\n"); - //CMenuWidget &menu = personalize.getWidget(MENU_SETTINGS)/**settings**/; + //CMenuWidget &menu = personalize.getWidget(MENU_SETTINGS); // Dynamic renumbering personalize.setShortcut(); @@ -469,7 +459,7 @@ void CNeutrinoApp::InitMenuService() { dprintf(DEBUG_DEBUG, "init service menu...\n"); - //CMenuWidget &menu = personalize.getWidget(MENU_SERVICE)/**service**/; + //CMenuWidget &menu = personalize.getWidget(MENU_SERVICE); // Dynamic renumbering personalize.setShortcut(); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index bbc976c78..2bcc209c3 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -37,7 +37,6 @@ #ifndef __neutrino_menue__ #define __neutrino_menue__ - //enums for menu widget indicies, enum MN_WIDGET_ID { @@ -193,5 +192,14 @@ enum MN_WIDGET_ID MN_WIDGET_ID_MAX }; +enum +{ + MENU_MAIN, + MENU_SETTINGS, + MENU_SERVICE, + MENU_SHUTDOWN, + + MENU_MAX +}; #endif From f1e25395ca24f11f52d315a59965a92c4ef9e9f3 Mon Sep 17 00:00:00 2001 From: martii Date: Fri, 1 Jul 2016 15:26:06 +0200 Subject: [PATCH 404/690] followscreenings: port code from martiis-neutrino-mp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61105699d44de6874fe346e9d8eff52011ebd197 Author: martii Date: 2016-07-01 (Fri, 01 Jul 2016) Origin message was: ------------------ - followscreenings: port code from martiis-neutrino-mp --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/Makefile.am | 1 + src/gui/epgplus.cpp | 22 ++-- src/gui/epgview.cpp | 12 +- src/gui/eventlist.cpp | 33 ++---- src/gui/followscreenings.cpp | 187 ++++++++++++++++++++++++++++++ src/gui/followscreenings.h | 80 +++++++++++++ src/gui/timerlist.cpp | 25 ++-- src/gui/timerlist.h | 3 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/zapit/include/zapit/channel.h | 2 +- 13 files changed, 320 insertions(+), 49 deletions(-) create mode 100644 src/gui/followscreenings.cpp create mode 100644 src/gui/followscreenings.h diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cae2476ef..a53bbf8c3 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -388,6 +388,7 @@ epgviewer.genre Genre epgviewer.length Spieldauer (Min.) epgviewer.nodetailed Keine ausführlichen Informationen verfügbar epgviewer.notfound Keine Programminformationen (EPG) gefunden +epgviewer.select_screening Terminauswahl eventfinder.fsk Altersfreigabe Filter eventfinder.genre Genre Filter eventfinder.head EPG-Suche diff --git a/data/locale/english.locale b/data/locale/english.locale index c675c25b5..cb28460c2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -388,6 +388,7 @@ epgviewer.genre Genre epgviewer.length Length (min.) epgviewer.nodetailed No detailed informations available epgviewer.notfound No EPG found +epgviewer.select_screening Select Screening eventfinder.fsk Age rating Filter eventfinder.genre Genre-Filter eventfinder.head Search in EPG diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index d9cb6931e..f1d0c89b9 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -59,6 +59,7 @@ libneutrino_gui_a_SOURCES = \ eventlist.cpp \ favorites.cpp \ filebrowser.cpp \ + followscreenings.cpp \ imageinfo.cpp \ info_menue.cpp \ infoviewer.cpp \ diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index c48af512c..d3e4f691e 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -1303,6 +1304,11 @@ EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer (EpgPlus * pepgPlus) this->epgPlus = pepgPlus; } +static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +{ + return a.startTime < b.startTime; +} + int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std::string & /*actionKey*/) { TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent(); @@ -1329,14 +1335,14 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std } if (g_Timerd->isTimerdAvailable() && doRecord) { - g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), - (*It)->channelEvent.startTime, - (*It)->channelEvent.startTime + (*It)->channelEvent.duration, - (*It)->channelEvent.eventID, - (*It)->channelEvent.startTime, - (*It)->channelEvent.startTime - (ANNOUNCETIME + 120), - TIMERD_APIDS_CONF, true); - ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(this->epgPlus->selectedChannelEntry->channel->channel_id, evtlist); + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + CFollowScreenings m(this->epgPlus->selectedChannelEntry->channel->channel_id, + (*It)->channelEvent.startTime, + (*It)->channelEvent.startTime + (*It)->channelEvent.duration, + (*It)->channelEvent.description, (*It)->channelEvent.eventID, TIMERD_APIDS_CONF, true, "", &evtlist); + m.exec(NULL, ""); } else printf ("timerd not available\n"); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5d687ed04..7047ea590 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -915,7 +916,16 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); } } - if (doRecord) + if (doRecord && !call_fromfollowlist) + { + CFollowScreenings m(channel_id, + epgData.epg_times.startzeit, + epgData.epg_times.startzeit + epgData.epg_times.dauer, + epgData.title, epgData.eventID, TIMERD_APIDS_CONF, true, recDir, &evtlist); + m.exec(NULL, ""); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + } + else if (doRecord) { if (g_Timerd->addRecordTimerEvent(channel_id, epgData.epg_times.startzeit, diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 90acdf162..9722eb3e7 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -487,32 +488,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna t_channel_id used_id = IS_WEBTV(channel_id) ? channel_id : evtlist[selected].channelID; if (!recDir.empty() && doRecord) //add/remove recording timer events and check/warn for conflicts { - if (g_Timerd->addRecordTimerEvent(used_id, - evtlist[selected].startTime, - evtlist[selected].startTime + evtlist[selected].duration, - evtlist[selected].eventID, evtlist[selected].startTime, - evtlist[selected].startTime - (ANNOUNCETIME + 120), - TIMERD_APIDS_CONF, true, recDir,false) == -1) - { - if(askUserOnTimerConflict(evtlist[selected].startTime - (ANNOUNCETIME + 120), evtlist[selected].startTime + evtlist[selected].duration)) //check for timer conflict - { - g_Timerd->addRecordTimerEvent(used_id, - evtlist[selected].startTime, - evtlist[selected].startTime + evtlist[selected].duration, - evtlist[selected].eventID, evtlist[selected].startTime, - evtlist[selected].startTime - (ANNOUNCETIME + 120), - TIMERD_APIDS_CONF, true, recDir,true); - - //ask user whether the timer event should be set anyway - ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - } - } - else - { - //ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - } + CFollowScreenings m(channel_id, + evtlist[selected].startTime, + evtlist[selected].startTime + evtlist[selected].duration, + evtlist[selected].description, evtlist[selected].eventID, TIMERD_APIDS_CONF, true, "", &evtlist); + m.exec(NULL, ""); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } timerlist.clear(); g_Timerd->getTimerList (timerlist); diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp new file mode 100644 index 000000000..cb1933d6e --- /dev/null +++ b/src/gui/followscreenings.cpp @@ -0,0 +1,187 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2013 martii + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +//#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +CFollowScreenings::~CFollowScreenings() +{ + followlist.clear(); +} + +CChannelEventList *CFollowScreenings::getFollowScreenings(void) +{ + if (evtlist && followlist.empty()) { + CChannelEventList::iterator e; + for (e = evtlist->begin(); e != evtlist->end(); ++e) + { + if (e->startTime < starttime) // this includes the current event + continue; + if (! e->eventID) + continue; + if (e->description != title) + continue; + followlist.push_back(*e); + } + } + return &followlist; +} + +int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionKey) +{ + unsigned long a; + if (1 == sscanf(actionKey.c_str(), "%lu", &a)) { + int ix = 0; + CChannelEventList::iterator e; + for (e = followlist.begin(); e != followlist.end(); e++, ix++) + if ((time_t)a == e->startTime) { + time_t start = e->startTime - (ANNOUNCETIME + 120); + time_t stop = e->startTime + e->duration; + CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(start, stop); + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if (i->eventType == CTimerd::TIMER_RECORD) { + if (channel_id == i->channel_id && e->startTime == i->epg_starttime) { + Timer.removeTimerEvent(i->eventID); +#if 0 + if (followlist.size() > 1) + forwarders[ix]->iconName_Info_right = ""; + else + ShowMsg(LOCALE_TIMER_EVENTREMOVED_TITLE, LOCALE_TIMER_EVENTREMOVED_MSG, + CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); +#else + forwarders[ix]->iconName_Info_right = ""; +#endif + return menu_return::RETURN_REPAINT; + } + if (!SAME_TRANSPONDER(channel_id, i->channel_id)) { + if (!askUserOnTimerConflict(start, stop, channel_id)) + return menu_return::RETURN_REPAINT; + } + } + + if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, recDir, true) == -1) { + //FIXME -- no error handling, but this shouldn't happen ... + } else { +#if 0 + if (followlist.size() > 1) + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; + else + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, + CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); +#else + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; +#endif + return menu_return::RETURN_REPAINT; + } + break; // for + } + return menu_return::RETURN_EXIT_ALL; + } + show(); + return menu_return::RETURN_EXIT_ALL; +} + +void CFollowScreenings::updateRightIcon(int ix, time_t start, unsigned int duration) { + time_t stop = start + duration; + start -= (ANNOUNCETIME + 120); + CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(start, stop); + start += (ANNOUNCETIME + 120); + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if (i->eventType == CTimerd::TIMER_RECORD) { + if (channel_id == i->channel_id && start == i->epg_starttime) { + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; + return; + } + if (!SAME_TRANSPONDER(channel_id, i->channel_id)) { + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_IMPORTANT; + return; + } + } +} + +void CFollowScreenings::show() +{ + char actionstr[32]; + + getFollowScreenings(); + +#if 0 + if (followlist.size() == 1) { + snprintf(actionstr, sizeof(actionstr), "%lu", followlist.front().startTime); + exec(NULL, actionstr); + } else { +#endif + CMenuWidget m(LOCALE_EPGVIEWER_SELECT_SCREENING, NEUTRINO_ICON_SETTINGS); + const char *icon = NEUTRINO_ICON_BUTTON_RED; + neutrino_msg_t directKey = CRCInput::RC_red; + CChannelEventList::iterator e; + int i = 0; + for (e = followlist.begin(); e != followlist.end(); e++, i++) + { + struct tm *tmStartZeit = localtime(&(e->startTime)); + std::string screening_date = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + screening_date += '.'; + screening_date += strftime(" %d.", tmStartZeit); + screening_date += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + screening_date += strftime(". %H:%M", tmStartZeit ); + snprintf(actionstr, sizeof(actionstr), "%lu", e->startTime); + forwarders.push_back(new CMenuForwarder(screening_date, true, NULL, this, actionstr, directKey, icon)); + updateRightIcon(i, e->startTime, e->duration); + m.addItem(forwarders[i]); + directKey = CRCInput::convertDigitToKey(1 + i); + icon = NULL; + } + m.enableSaveScreen(true); + m.exec(NULL, ""); +#if 0 + } +#endif +} + diff --git a/src/gui/followscreenings.h b/src/gui/followscreenings.h new file mode 100644 index 000000000..53e362e3e --- /dev/null +++ b/src/gui/followscreenings.h @@ -0,0 +1,80 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2013 martii + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifndef __followscreening_ +#define __followscreening_ + +#include "widget/menue.h" +#include +#include +#include +#include + +class CFollowScreenings : public CMenuTarget +{ + private: + CEPGData *epgData; + CChannelEventList *evtlist; + CChannelEventList followlist; + CTimerdClient Timer; + t_channel_id channel_id; + time_t starttime; + time_t stoptime; + std::string title; + uint64_t epgID; + unsigned char apids; + bool safety; + std::string recDir; + CTimerd::RecordingInfo eventInfo; + std::vector forwarders; + void updateRightIcon(int i, time_t start, unsigned int duration); + public: + CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0, + unsigned char Apids=TIMERD_APIDS_STD, bool Safety=false, std::string RecDir="", CChannelEventList *Evtlist=NULL) : CMenuTarget () { + this->channel_id = Channel_id; + this->starttime = Starttime; + this->stoptime = Stoptime; + this->epgID = EpgID; + this->recDir = RecDir; + this->evtlist = Evtlist; + this->title = Title; + this->safety = Safety; + this->apids = Apids; + }; + ~CFollowScreenings(); + CChannelEventList *getFollowScreenings(void); + int exec(CMenuTarget *parent, const std::string & actionKey); + void show(); +}; +#endif + diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index fb8927463..ec9cb5085 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1261,13 +1261,23 @@ int CTimerList::newTimer() return ret; } -bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) +bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id) { if (CFEManager::getInstance()->getEnabledCount() == 1) { CTimerdClient Timer; CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime); //printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime); + // Don't ask if there are overlapping timers on the same transponder. + if (channel_id) { + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if ((i->eventType != CTimerd::TIMER_RECORD || !SAME_TRANSPONDER(channel_id, i->channel_id))) + break; + if (i == overlappingTimers.end()) + return true; // yes, add timer + } + std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); timerbuf += "\n"; for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); @@ -1290,20 +1300,13 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) timerbuf += it->epgTitle; } } - timerbuf += ")"; + timerbuf += "):\n"; - timerbuf += ":\n"; - char at[25] = {0}; struct tm *annTime = localtime(&(it->announceTime)); - strftime(at,20,"%d.%m. %H:%M",annTime); - timerbuf += at; - timerbuf += " - "; + timerbuf += strftime("%d.%m. %H:%M\n",annTime); - char st[25] = {0}; struct tm *sTime = localtime(&(it->stopTime)); - strftime(st,20,"%d.%m. %H:%M",sTime); - timerbuf += st; - timerbuf += "\n"; + timerbuf += strftime("%d.%m. %H:%M\n",sTime); //printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime); } //printf("message:\n%s\n",timerbuf.c_str()); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 48c299bb8..6ca937ecb 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -97,7 +97,6 @@ class CTimerList : public CMenuTarget, public CListHelpers static std::string convertChannelId2String(const t_channel_id id); // UTF-8 }; -bool askUserOnTimerConflict(time_t announceTime, time_t stopTime); - +bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id = 0); #endif diff --git a/src/system/locals.h b/src/system/locals.h index 218e1ac98..9aca38703 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -415,6 +415,7 @@ typedef enum LOCALE_EPGVIEWER_LENGTH, LOCALE_EPGVIEWER_NODETAILED, LOCALE_EPGVIEWER_NOTFOUND, + LOCALE_EPGVIEWER_SELECT_SCREENING, LOCALE_EVENTFINDER_FSK, LOCALE_EVENTFINDER_GENRE, LOCALE_EVENTFINDER_HEAD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d68ecba46..abfce1c63 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -415,6 +415,7 @@ const char * locale_real_names[] = "epgviewer.length", "epgviewer.nodetailed", "epgviewer.notfound", + "epgviewer.select_screening", "eventfinder.fsk", "eventfinder.genre", "eventfinder.head", diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 834873afa..30f1b5a83 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -176,7 +176,6 @@ class CZapitChannel void Init(); friend class CChannelList; - t_channel_id channel_id; public: typedef enum channel_flags { @@ -198,6 +197,7 @@ class CZapitChannel int number; CChannelEvent currentEvent,nextEvent; int type; + t_channel_id channel_id; unsigned char scrambled; char * pname; bool has_bouquet; From a762eeb9ff7b6cbfc26faafd6e00c3338c3cf8e5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 29 Jun 2016 20:38:21 +0200 Subject: [PATCH 405/690] CShellWindow: add members to set/get commands and get current mode This allows to use shellwindow objects with existing instance. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e8a758ac61afff71816a478b9b9b1e138eb75074 Author: Thilo Graf Date: 2016-06-29 (Wed, 29 Jun 2016) --- src/gui/widget/shellwindow.cpp | 10 +++++++--- src/gui/widget/shellwindow.h | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 4147fb717..a0602a68d 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -51,10 +51,14 @@ CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res, textBox = NULL; frameBuffer = CFrameBuffer::getInstance(); - command = Command; - mode = Mode; - res = Res; + setCommand(Command, Mode, Res, auto_exec); +} +void CShellWindow::setCommand(const std::string &Command, const int Mode, int* Res, bool auto_exec) +{ + command = Command; + mode = Mode; + res = Res; if (auto_exec) exec(); } diff --git a/src/gui/widget/shellwindow.h b/src/gui/widget/shellwindow.h index 75cbd88f5..c875a22e4 100644 --- a/src/gui/widget/shellwindow.h +++ b/src/gui/widget/shellwindow.h @@ -56,6 +56,10 @@ class CShellWindow : public sigc::trackable }; CShellWindow(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); ~CShellWindow(); + void setCommand(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); + std::string getCommand(){return command;} + int getMode(){return mode;} + void exec(); /*! From 4df768fad6bf2d92aad2b4fe848c4eb9ec8b5342 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 6 Jul 2016 18:43:52 +0200 Subject: [PATCH 406/690] update slovak.locale (THX Pr0metheus) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5560b8606682b80aff776848fb7d7ae2de73985a Author: Jacek Jendrzej Date: 2016-07-06 (Wed, 06 Jul 2016) --- data/locale/slovak.locale | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 8700d3f97..a4138edb1 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -1857,7 +1857,7 @@ networkmenu.ssid_scan Hľadanie WLAN sietí networkmenu.ssid_scan_error Nenájdené WLAN siete networkmenu.ssid_scan_wait Prebieha hľadanie WLAN sietí networkmenu.test Test siete -neutrino_starting Start NG-Neutrino +neutrino_starting Start Neutrino... nfs.alreadymounted Zložka je už pripojená nfs.automount Pripojiť pri spustení nfs.dir Zložka / Zdielanie @@ -2219,7 +2219,7 @@ servicemenu.restart_hint Reštartovanie, čakajte prosím... servicemenu.restart_refused_recording Prebieha nahrávanie... Reštart nie je povolený! servicemenu.scants Prehľadávanie kanálov servicemenu.update Aktualizácia softvéru -settings.backup NG-Záloha: Uloženie nastavení +settings.backup Záloha: Uloženie nastavení settings.backup_failed Chybná záloha! settings.help Nápoveda settings.menu_hints Zobraziť nápovedu @@ -2235,7 +2235,7 @@ settings.pos_higher_center spodný vyšší stred settings.pos_top_center v strede navrchu settings.pos_top_left vľavo hore settings.pos_top_right vpravo hore -settings.restore NG-Záloha: Obnovenie nastavení +settings.restore Záloha: Obnovenie nastavení settings.restore_warn Všetky nastavenia budú nahradené a vykoná sa reštart.\nPokračovať? shutdown.recording_query Skutočne prerušiť nahrávanie? shutdowntimer.announce Vypnutie boxu za minútu.\nZrušiť vypnutie? @@ -2459,8 +2459,8 @@ wizard.setup_advanced Rozšírená wizard.setup_easy Jednoduchá wizard.setup_type Typ inštalácie wizard.setup_type_hint Jednoduché nastavenie pre CanalDigitaal/TĂ©lĂ©SAT/TV Vlaanderen alebo jednoduché káblové vyhľadávanie -wizard.welcome_head Vitajte v NG-Sprievodcovi nastavení -wizard.welcome_text NG-Image Informácia:\nVáš prijímač môžete pohodlne ovládať\ns webovým rozhraním pre správu časovača alebo živé vysielanie cez internetový prehliadač.\nPrístupové heslo nie je zatiaľ nastavené!\nNastavte ho za pomoci použitia príkazu "passwd" cez telnet rozhranie\nChcete pokračovať ?\nBlahoželáme k zakúpeniu CST. Nasledujúce \nkroky vás prevedú počiatočnou inštaláciou nastavenia prístroja.\nPrajeme vám veľa radosti s týmto prijímačom!\nĎalší krok ? +wizard.welcome_head Vitajte v sprievodcovi nastavení +wizard.welcome_text Nasledujúce kroky vás prevedú počiatočnou inštaláciou nastavenia prístroja.\nInformácia: Váš prijímač môžete pohodlne ovládať\ncez webové rozhranie pre správu časovača alebo živé vysielanie cez internetový prehliadač.\nPrístupové heslo nie je zatiaľ nastavené!\nNastavte ho za pomoci použitia príkazu "passwd" cez telnet rozhranie.\nChcete pokračovať? word.from z word.in v zapit.scantype Vyhľadávanie kanálov From dfc90315d9cee6bd01a0bfcc98733dfaa03057e2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Jul 2016 15:38:34 +0200 Subject: [PATCH 407/690] src/gui/widget/menue.cpp fix possible heap-buffer-overflow Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5be8af9890a0c6e368203a9ede976518ea29674e Author: Jacek Jendrzej Date: 2016-07-21 (Thu, 21 Jul 2016) --- src/gui/widget/menue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 4935cf5bf..607be4f60 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1311,9 +1311,9 @@ void CMenuWidget::paintItems() //Item not currently on screen if (selected >= 0) { - while (selected < page_start[current_page]) + while (current_page > 0 && selected < page_start[current_page]) current_page--; - while (selected >= page_start[current_page + 1]) + while (current_page+1 < page_start.size() && selected >= page_start[current_page + 1]) current_page++; } From 1ee46a273ee70404aa3e7d4dbf27baf0b0e906df Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 22 Jul 2016 17:24:39 +0200 Subject: [PATCH 408/690] src/gui/lua/lua_video.cpp fix possible segfault if argument is not a string (nil) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/021db3ab04ec9964dc2a95b3990f2658f8ce97e1 Author: Jacek Jendrzej Date: 2016-07-22 (Fri, 22 Jul 2016) --- src/gui/lua/lua_video.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index c7df7912d..fd25aeda2 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -153,6 +153,23 @@ int CLuaInstVideo::PlayFile(lua_State *L) printf("CLuaInstVideo::%s: not enough arguments (%d, expected 3)\n", __func__, numargs); return 0; } + const char *errmsg = "is not a string."; + if(!lua_isstring(L,2)){ + printf("CLuaInstVideo::%s: argument 1 %s\n", __func__, errmsg); + return 0; + } + if(!lua_isstring(L,3)){ + printf("CLuaInstVideo::%s: argument 2 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 3 && !lua_isstring(L,4)){ + printf("CLuaInstVideo::%s: argument 3 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 4 && !lua_isstring(L,5)){ + printf("CLuaInstVideo::%s: argument 4 %s\n", __func__, errmsg); + return 0; + } bool sp = false; if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) From e0d158738ad9bd4eacdefcd355a9ad3199cafc12 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 27 Jul 2016 21:37:58 +0200 Subject: [PATCH 409/690] CMsgBox: ensure repaint of background This fixes "transparent holes", because textbox object is responsible for text. The problem here is that the message box has a fixed width and text box width is not really considered. This should be fixed, but CMsgBox class is used only by CMovieinfo class and this should be enough for the moment. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab7c67d2b05e555ae10495668a935b06f1543727 Author: Thilo Graf Date: 2016-07-27 (Wed, 27 Jul 2016) --- src/gui/widget/msgbox.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 45cffebf6..4f9821ebe 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -619,6 +619,13 @@ void CMsgBox::refresh(void) refreshTitle(); refreshFoot(); + //draw body + m_pcWindow->paintBoxRel( m_cBoxFrameText.iX, + m_cBoxFrameText.iY, + m_cBoxFrameText.iWidth, + m_cBoxFrameText.iHeight, + COL_MENUCONTENT_PLUS_0); + // rep-draw textbox if there is one if(m_pcTextBox != NULL) { @@ -750,7 +757,6 @@ bool CMsgBox::setText(const std::string* newText) // update text in textbox if there is one if(m_pcTextBox != NULL && newText != NULL) { - lresult = m_pcTextBox->setText(newText); if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH) { /* window might changed in size ...*/ @@ -768,6 +774,8 @@ bool CMsgBox::setText(const std::string* newText) m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>1); } } + + lresult = m_pcTextBox->setText(newText); } return(lresult); From 9d86befe20ddbf4d623c80b068f7e84dd31c48ca Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 7 Mar 2016 22:56:14 +0100 Subject: [PATCH 410/690] adding Live-TV look alike EPG-Infos in Movieplayer incl. TMDB Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/44ca60eb172e7d02a7849143d2d6022dbc11d0a7 Author: TangoCash Date: 2016-03-07 (Mon, 07 Mar 2016) --- src/gui/epgview.cpp | 307 ++++++++++++++++++++++++++++++++++++++++ src/gui/epgview.h | 2 + src/gui/infoviewer.cpp | 7 + src/gui/movieplayer.cpp | 6 + 4 files changed, 322 insertions(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 7047ea590..4e80b49cd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -487,6 +487,313 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } +int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_duration, bool doLoop) +{ + int res = menu_return::RETURN_REPAINT; + static uint64_t channel_id = 0; + + if (mp_movie_info == NULL) + return res; + + channel_id = mp_movie_info->epgEpgId >>16; + + epgText.clear(); + + start(); + + tmdbtoggle = false; + stars = 0; + + CComponentsHeader* header = NULL; + CComponentsPicture* headerPic = NULL; + CComponentsText* headerText = NULL; + + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + + if (mp_movie_info->epgTitle.empty()) /* no epg info found */ + { + ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 + hide(); + return res; + } + // Calculate offset for the title when logo appears. + int pic_offx = 0; + std::string lname; + int logo_w = 0; + int logo_h = 0; + int logo_w_max = ox / 4; + if(channel_id) { + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, mp_movie_info->epgChannel, lname, &logo_w, &logo_h)) { + if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); + } + pic_offx = logo_w + 10; + } + } + + int pos; + std::string text1 = mp_movie_info->epgTitle; + std::string text2 = ""; + if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18) + { + do + { + pos = text1.find_last_of("[ .]+"); + if (pos != -1) + text1 = text1.substr(0, pos); + } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18)); + if (mp_movie_info->epgTitle.length() > text1.length()) // shold never be false in this place + text2 = mp_movie_info->epgTitle.substr(text1.length()+ 1, uint(-1) ); + } + + const int pic_h = 39; + + if (!text2.empty()) + toph = 2 * topboxheight; + else + toph = topboxheight; + + toph = std::max(toph, pic_h); + + sb = oy - toph ; + + // 21.07.2005 - rainerk + // Only show info1 if it's not included in info2! + std::string strEpisode = ""; // Episode title in case info1 gets stripped + if (!mp_movie_info->epgInfo1.empty()) { + bool bHide = false; + if (false == mp_movie_info->epgInfo2.empty()) { + // Look for the first . in info1, usually this is the title of an episode. + std::string::size_type nPosDot = mp_movie_info->epgInfo1.find('.'); + if (std::string::npos != nPosDot) { + nPosDot += 2; // Skip dot and first blank + if (nPosDot < mp_movie_info->epgInfo2.length() && nPosDot < mp_movie_info->epgInfo1.length()) { // Make sure we don't overrun the buffer + + // Check if the stuff after the dot equals the beginning of info2 + if (0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1.substr(nPosDot, mp_movie_info->epgInfo1.length() - nPosDot))) { + strEpisode = mp_movie_info->epgInfo1.substr(0, nPosDot) + "\n"; + bHide = true; + } + } + } + // Compare strings normally if not positively found to be equal before + if (false == bHide && 0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1)) { + bHide = true; + } + } + if (false == bHide) { + processTextToArray(mp_movie_info->epgInfo1); + } + } + + info1_lines = epgText.size(); + + //scan epg-data - sort to list + if ((mp_movie_info->epgInfo2.empty()) && (info1_lines == 0)) + processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8 + else + processTextToArray(strEpisode + mp_movie_info->epgInfo2); + + // Add a blank line + processTextToArray(""); + + // Show FSK information + if (mp_movie_info->parentalLockAge > 0) + { + char fskInfo[4]; + sprintf(fskInfo, "%d", mp_movie_info->parentalLockAge); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AGE_RATING)) + ": " + fskInfo); // UTF-8 + } + + // Show length information + char lengthInfo[11]; + sprintf(lengthInfo, "%d", mp_movie_info->length); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 + + // Show audio information + std::string audioInfo = ""; + std::vector tags = mp_movie_info->audioPids; + if (tags.size()) + { + for (unsigned int i = 0; i < tags.size(); i++) + if (!tags[i].epgAudioPidName.empty()) + audioInfo += tags[i].epgAudioPidName + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } + } + + // Show genre information +#ifdef FULL_CONTENT_CLASSIFICATION + if (!mp_movie_info->genreMajor.empty()) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor[0])); // UTF-8 +// processTextToArray( epgData.userClassification.c_str() ); +#else + if (mp_movie_info->genreMajor) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor)); // UTF-8 +#endif + + COSDFader fader(g_settings.theme.menu_Content_alpha); + fader.StartFadeIn(); + + //show the epg + // header + logo + int header_h = std::max(toph, logo_h); + header = new CComponentsHeader(sx, sy, ox, header_h); + if (pic_offx > 0) { + headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); + headerPic->doPaintBg(false); + } + std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; + headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + headerText->doPaintBg(false); + headerText->setTextColor(COL_MENUHEAD_TEXT); + header->paint(CC_SAVE_SCREEN_NO); + headerText->paint(CC_SAVE_SCREEN_NO); + if (headerPic) + headerPic->paint(CC_SAVE_SCREEN_NO); + + int showPos = 0; + textCount = epgText.size(); + showText(showPos, sy + toph); + + // show Button + const struct button_label Button[] = + { + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } + }; + int icol_w, icol_h; + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + int h = std::max(fh, icol_h+4); + int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + ::paintButtons(sx + 10, sy+oy, 0, 1, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + +#if 0 + //show progressbar + epg_done = mp_position/mp_duration*100; + if ( epg_done > 0 ) + { + int pbx = sx + 10 /*+ widthl */+ 10 + ((ox-104/*-widthr-widthl*/-10-10-20)>>1); + CProgressBar pb(pbx, sy+oy-height, 104, height-6); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } +#endif + + frameBuffer->blit(); + if ( doLoop ) + { + neutrino_msg_t msg = 0; + neutrino_msg_data_t data = 0; + + int scrollCount = 0; + + bool loop = true; + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + scrollCount = medlinecount; + + switch ( msg ) + { + case CRCInput::RC_down: + if (showPos+scrollCountepgTitle); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; + } else { + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); + } + break; + } + + case CRCInput::RC_help: + case CRCInput::RC_ok: + case CRCInput::RC_timeout: + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + break; + + default: + // konfigurierbare Keys handlen... + if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + } + else + { + if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + { + loop = false; + res = menu_return::RETURN_EXIT_ALL; + } + } + } + frameBuffer->blit(); + } + hide(); + fader.StopFade(); + } + if (headerPic) + delete headerPic; + if (headerText) + delete headerText; + if (header) + delete header; + + return res; +} + int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 4375eebc5..e7fcc1aad 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -39,6 +39,7 @@ #include #include +#include #include "widget/menue.h" #include @@ -99,6 +100,7 @@ class CEpgData ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); + int show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position = 1, int mp_duration = 1, bool doLoop = true); void hide(); }; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f0f52151c..b65d2293b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1029,6 +1029,13 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fileplay) + { + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f6576ed0e..a254e4e0b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1527,6 +1527,12 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fromInfoviewer) + { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else callInfoViewer(); update_lcd = true; clearSubtitle(); From b39e970466d2622dce2c483a295e910ac2f18c13 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 8 Mar 2016 20:58:33 +0100 Subject: [PATCH 411/690] urgent fix for last commit Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/98640e1b1f63838fe8233f9f08fc5f827ad4a212 Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) --- src/gui/epgview.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4e80b49cd..4ee53b58e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -708,6 +708,14 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura switch ( msg ) { + case NeutrinoMessages::EVT_TIMER: + if(data == fader.GetFadeTimer()) { + if(fader.FadeDone()) + loop = false; + } + else + CNeutrinoApp::getInstance()->handleMsg(msg, data); + break; case CRCInput::RC_down: if (showPos+scrollCount Date: Tue, 8 Mar 2016 23:45:33 +0100 Subject: [PATCH 412/690] add option to replace EPG Info with tmdb Info - be careful Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7aa3656b1496d01cdbeeb3d6160df0c8bb777aa5 Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) --- src/gui/epgview.cpp | 15 +++++++++++++-- src/gui/tmdb.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4ee53b58e..aaca3e69e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -491,6 +491,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura { int res = menu_return::RETURN_REPAINT; static uint64_t channel_id = 0; + std::string tmdb_str = ""; if (mp_movie_info == NULL) return res; @@ -503,6 +504,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura tmdbtoggle = false; stars = 0; + tmdb_str = mp_movie_info->epgInfo2; CComponentsHeader* header = NULL; CComponentsPicture* headerPic = NULL; @@ -663,6 +665,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura // show Button const struct button_label Button[] = { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } }; int icol_w, icol_h; @@ -671,7 +674,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura int h = std::max(fh, icol_h+4); int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(sx + 10, sy+oy, 0, 1, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 //show progressbar @@ -741,6 +744,9 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura epgText_saved = epgText; epgText.clear(); tmdbtoggle = !tmdbtoggle; + tmdb_str = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); textCount = epgText.size(); stars = tmdb->getStars(); @@ -758,7 +764,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura } break; } - + case CRCInput::RC_red: + { + if (tmdbtoggle) { + mp_movie_info->epgInfo2 = tmdb_str; + } + } case CRCInput::RC_help: case CRCInput::RC_ok: case CRCInput::RC_timeout: diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index 0c4a45448..d9f8929d6 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -74,6 +74,7 @@ class cTmdb std::string getReleaseDate() { return minfo.release_date;} std::string getDescription() { return minfo.overview;} std::string getVote() { return minfo.vote_average;} + std::string getCast() { return minfo.cast;} bool hasCover() { return !minfo.poster_path.empty();} bool getBigCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w342" + minfo.poster_path, cover);} bool getSmallCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w185" + minfo.poster_path, cover);} From c145037b533fdafa8e5cb85ac625b0dc8a486ac0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 28 Jul 2016 15:17:01 +0200 Subject: [PATCH 413/690] fix compil warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e681ca2b044fbd86b0ae8a0eef60d57ce219f339 Author: Jacek Jendrzej Date: 2016-07-28 (Thu, 28 Jul 2016) --- src/gui/epgview.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index aaca3e69e..885f97380 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -487,7 +487,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } -int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_duration, bool doLoop) +int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*mp_duration*/, bool doLoop) { int res = menu_return::RETURN_REPAINT; static uint64_t channel_id = 0; @@ -506,12 +506,10 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura stars = 0; tmdb_str = mp_movie_info->epgInfo2; - CComponentsHeader* header = NULL; + CComponentsHeader* _header = NULL; CComponentsPicture* headerPic = NULL; CComponentsText* headerText = NULL; - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); - if (mp_movie_info->epgTitle.empty()) /* no epg info found */ { ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 @@ -644,7 +642,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura //show the epg // header + logo int header_h = std::max(toph, logo_h); - header = new CComponentsHeader(sx, sy, ox, header_h); + _header = new CComponentsHeader(sx, sy, ox, header_h); if (pic_offx > 0) { headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); @@ -653,7 +651,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); headerText->setTextColor(COL_MENUHEAD_TEXT); - header->paint(CC_SAVE_SCREEN_NO); + _header->paint(CC_SAVE_SCREEN_NO); headerText->paint(CC_SAVE_SCREEN_NO); if (headerPic) headerPic->paint(CC_SAVE_SCREEN_NO); @@ -677,6 +675,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); //show progressbar epg_done = mp_position/mp_duration*100; if ( epg_done > 0 ) @@ -807,8 +806,8 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura delete headerPic; if (headerText) delete headerText; - if (header) - delete header; + if (_header) + delete _header; return res; } From f5c094a1d0d47fd346938c33e940bb162a098060 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 8 Mar 2016 23:02:03 +0100 Subject: [PATCH 414/690] fix bigfonts in last commits Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3d91b7040ecf95a5b611377574a1a3daf04c04d Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) --- src/gui/epgview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 885f97380..36847150c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -500,7 +500,15 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m epgText.clear(); - start(); + if (doLoop) + { + if (!bigFonts && g_settings.bigFonts) { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + } + bigFonts = g_settings.bigFonts; + start(); + } tmdbtoggle = false; stars = 0; From 666fe6b5fcf4ebf51dde3bed2395c261d8e14c4a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 28 Jul 2016 18:07:10 +0200 Subject: [PATCH 415/690] show epg/tmdb in moviebrowse info modus (yellow->info) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2afb0155c16772b2aea3c31c1860f2ac32220ce Author: Jacek Jendrzej Date: 2016-07-28 (Thu, 28 Jul 2016) --- src/gui/moviebrowser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 4610e4979..efa8b0f28 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -46,6 +46,7 @@ #include "moviebrowser.h" #include "filebrowser.h" #include +#include #include #include #include @@ -1922,7 +1923,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_movieInfo.showMovieInfo(*m_movieSelectionHandler); + if (m_settings.gui == MB_GUI_MOVIE_INFO && m_windowFocus == MB_FOCUS_MOVIE_INFO) + g_EpgData->show_mp(m_movieSelectionHandler,0,0); + else + m_movieInfo.showMovieInfo(*m_movieSelectionHandler); refresh(); } } From 3c54ecc3f77166dd80ace7602080d6129cf89178 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jul 2016 15:34:41 +0200 Subject: [PATCH 416/690] src/gui/moviebrowser.cpp use one key for delete cover or add tmdb cover Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/51bf5c21952b99d068238ce462b5ed0467f6225b Author: Jacek Jendrzej Date: 2016-07-29 (Fri, 29 Jul 2016) --- src/gui/moviebrowser.cpp | 72 +++++++++++++++------------------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index efa8b0f28..862d68763 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1849,11 +1849,33 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()){ + //delete Cover + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + unlink(fname.c_str()); + refresh(); + } + }else { + //add TMDB Cover + fname = m_movieSelectionHandler->file.Name.c_str(); + int ext_pos = 0; + ext_pos = fname.rfind('.'); + if( ext_pos > 0) { + std::string extension; + extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = "." + extension; + strReplace(fname, extension.c_str(), ".jpg"); + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); + if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { + if (!fname.empty()) + if (tmdb->getSmallCover(fname)) + refresh(); + } + if (tmdb) + delete tmdb; + } } } } @@ -2006,46 +2028,6 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } - else if (msg == CRCInput::RC_favorites) - { - if (m_movieSelectionHandler != NULL) { -#if 0 - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } -#else - std::string fname = m_movieSelectionHandler->file.Name.c_str(); - int ext_pos = 0; - ext_pos = fname.rfind('.'); - if( ext_pos > 0) { - std::string extension; - extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); - extension = "." + extension; - strReplace(fname, extension.c_str(), ".jpg"); - } - printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); - if (!access(fname, F_OK)) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } - } else { - cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); - if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { - if (!fname.empty()) - if (tmdb->getSmallCover(fname)) - refresh(); - } - if (tmdb) - delete tmdb; - } -#endif - } - } else { //TRACE("[mb]->onButtonPressMainFrame none\n"); From 49c3f990b6f6a10f15703f605432bf7ce71508d4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jul 2016 17:00:29 +0200 Subject: [PATCH 417/690] dont use tmdb if api key not defined Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86cea031aded11db1bb00f1baf958409b49e6b77 Author: Jacek Jendrzej Date: 2016-07-29 (Fri, 29 Jul 2016) --- src/gui/epgview.cpp | 93 +++++++++++++++++++++------------------- src/gui/moviebrowser.cpp | 2 +- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 36847150c..409b8a766 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -680,7 +680,8 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m int h = std::max(fh, icol_h+4); int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); @@ -744,36 +745,40 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m case CRCInput::RC_info: { - showPos = 0; - if (!tmdbtoggle) { - cTmdb* tmdb = new cTmdb(mp_movie_info->epgTitle); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - tmdb_str = tmdb->getDescription(); - if (!tmdb->getCast().empty()) - tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + showPos = 0; + if (!tmdbtoggle) { + cTmdb* tmdb = new cTmdb(mp_movie_info->epgTitle); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + tmdb_str = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); } break; } case CRCInput::RC_red: { - if (tmdbtoggle) { + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + break; + else if (tmdbtoggle) { mp_movie_info->epgInfo2 = tmdb_str; } } @@ -1291,27 +1296,29 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_info: { - showPos = 0; - if (!tmdbtoggle) { - cTmdb* tmdb = new cTmdb(epgData.title); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + showPos = 0; + if (!tmdbtoggle) { + cTmdb* tmdb = new cTmdb(epgData.title); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); } break; } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 862d68763..2c6356133 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1856,7 +1856,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) unlink(fname.c_str()); refresh(); } - }else { + }else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ //add TMDB Cover fname = m_movieSelectionHandler->file.Name.c_str(); int ext_pos = 0; From 1dfd0a60630ce125a98a51d992a6d13ef5bca4c6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jul 2016 19:11:13 +0200 Subject: [PATCH 418/690] fix logic Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b2e809ab2b011a6c257e79c27d4effe7a1619d3 Author: Jacek Jendrzej Date: 2016-07-29 (Fri, 29 Jul 2016) --- src/gui/epgview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 409b8a766..e581ede11 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -776,7 +776,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m } case CRCInput::RC_red: { - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + if (g_settings.tmdb_api_key == "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") break; else if (tmdbtoggle) { mp_movie_info->epgInfo2 = tmdb_str; From c3fbfd9cb3428c940728c479df8e43f5ba2d6a7c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 30 Jul 2016 18:54:53 +0200 Subject: [PATCH 419/690] src/gui/epgview.cpp use show function for mp info view Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bedd37b1afee3974d43fbb1589ef2e4788ca8ac2 Author: Jacek Jendrzej Date: 2016-07-30 (Sat, 30 Jul 2016) --- src/gui/epgview.cpp | 404 +++++++------------------------------------- src/gui/epgview.h | 5 +- 2 files changed, 66 insertions(+), 343 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index e581ede11..0e277d080 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -490,342 +490,36 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*mp_duration*/, bool doLoop) { int res = menu_return::RETURN_REPAINT; - static uint64_t channel_id = 0; - std::string tmdb_str = ""; - if (mp_movie_info == NULL) return res; - channel_id = mp_movie_info->epgEpgId >>16; - - epgText.clear(); - - if (doLoop) - { - if (!bigFonts && g_settings.bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); - } - bigFonts = g_settings.bigFonts; - start(); - } - - tmdbtoggle = false; - stars = 0; - tmdb_str = mp_movie_info->epgInfo2; - - CComponentsHeader* _header = NULL; - CComponentsPicture* headerPic = NULL; - CComponentsText* headerText = NULL; - if (mp_movie_info->epgTitle.empty()) /* no epg info found */ { ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 hide(); return res; } - // Calculate offset for the title when logo appears. - int pic_offx = 0; - std::string lname; - int logo_w = 0; - int logo_h = 0; - int logo_w_max = ox / 4; - if(channel_id) { - if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, mp_movie_info->epgChannel, lname, &logo_w, &logo_h)) { - if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); - } - pic_offx = logo_w + 10; - } - } + epgData.title = mp_movie_info->epgTitle; + epgData.info1 = mp_movie_info->epgInfo1; + epgData.info2 = mp_movie_info->epgInfo2; - int pos; - std::string text1 = mp_movie_info->epgTitle; - std::string text2 = ""; - if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18) - { - do - { - pos = text1.find_last_of("[ .]+"); - if (pos != -1) - text1 = text1.substr(0, pos); - } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18)); - if (mp_movie_info->epgTitle.length() > text1.length()) // shold never be false in this place - text2 = mp_movie_info->epgTitle.substr(text1.length()+ 1, uint(-1) ); - } - - const int pic_h = 39; - - if (!text2.empty()) - toph = 2 * topboxheight; - else - toph = topboxheight; - - toph = std::max(toph, pic_h); - - sb = oy - toph ; - - // 21.07.2005 - rainerk - // Only show info1 if it's not included in info2! - std::string strEpisode = ""; // Episode title in case info1 gets stripped - if (!mp_movie_info->epgInfo1.empty()) { - bool bHide = false; - if (false == mp_movie_info->epgInfo2.empty()) { - // Look for the first . in info1, usually this is the title of an episode. - std::string::size_type nPosDot = mp_movie_info->epgInfo1.find('.'); - if (std::string::npos != nPosDot) { - nPosDot += 2; // Skip dot and first blank - if (nPosDot < mp_movie_info->epgInfo2.length() && nPosDot < mp_movie_info->epgInfo1.length()) { // Make sure we don't overrun the buffer - - // Check if the stuff after the dot equals the beginning of info2 - if (0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1.substr(nPosDot, mp_movie_info->epgInfo1.length() - nPosDot))) { - strEpisode = mp_movie_info->epgInfo1.substr(0, nPosDot) + "\n"; - bHide = true; - } - } - } - // Compare strings normally if not positively found to be equal before - if (false == bHide && 0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1)) { - bHide = true; - } - } - if (false == bHide) { - processTextToArray(mp_movie_info->epgInfo1); - } - } - - info1_lines = epgText.size(); - - //scan epg-data - sort to list - if ((mp_movie_info->epgInfo2.empty()) && (info1_lines == 0)) - processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8 - else - processTextToArray(strEpisode + mp_movie_info->epgInfo2); - - // Add a blank line - processTextToArray(""); - - // Show FSK information - if (mp_movie_info->parentalLockAge > 0) - { - char fskInfo[4]; - sprintf(fskInfo, "%d", mp_movie_info->parentalLockAge); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AGE_RATING)) + ": " + fskInfo); // UTF-8 - } - - // Show length information - char lengthInfo[11]; - sprintf(lengthInfo, "%d", mp_movie_info->length); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 - - // Show audio information - std::string audioInfo = ""; - std::vector tags = mp_movie_info->audioPids; - if (tags.size()) - { - for (unsigned int i = 0; i < tags.size(); i++) - if (!tags[i].epgAudioPidName.empty()) - audioInfo += tags[i].epgAudioPidName + ", "; - - if (!audioInfo.empty()) - { - audioInfo.erase(audioInfo.size()-2); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 - } - } - - // Show genre information + epgData.itemDescriptions.clear(); + epgData.items.clear(); + epgData.fsk = mp_movie_info->parentalLockAge; + epgData.table_id = mp_movie_info->epgEpgId; #ifdef FULL_CONTENT_CLASSIFICATION - if (!mp_movie_info->genreMajor.empty()) - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor[0])); // UTF-8 -// processTextToArray( epgData.userClassification.c_str() ); + epgData.contentClassification.clear(); #else - if (mp_movie_info->genreMajor) - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor)); // UTF-8 + epgData.contentClassification = 0; #endif - - COSDFader fader(g_settings.theme.menu_Content_alpha); - fader.StartFadeIn(); - - //show the epg - // header + logo - int header_h = std::max(toph, logo_h); - _header = new CComponentsHeader(sx, sy, ox, header_h); - if (pic_offx > 0) { - headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); - headerPic->doPaintBg(false); - } - std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); - headerText->doPaintBg(false); - headerText->setTextColor(COL_MENUHEAD_TEXT); - _header->paint(CC_SAVE_SCREEN_NO); - headerText->paint(CC_SAVE_SCREEN_NO); - if (headerPic) - headerPic->paint(CC_SAVE_SCREEN_NO); - - int showPos = 0; - textCount = epgText.size(); - showText(showPos, sy + toph); - - // show Button - const struct button_label Button[] = - { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } - }; - int icol_w, icol_h; - int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); - int h = std::max(fh, icol_h+4); - int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); - frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") - ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); - -#if 0 - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); - //show progressbar - epg_done = mp_position/mp_duration*100; - if ( epg_done > 0 ) - { - int pbx = sx + 10 /*+ widthl */+ 10 + ((ox-104/*-widthr-widthl*/-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); - } -#endif - - frameBuffer->blit(); - if ( doLoop ) - { - neutrino_msg_t msg = 0; - neutrino_msg_data_t data = 0; - - int scrollCount = 0; - - bool loop = true; - - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - - while (loop) - { - g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); - if ( msg <= CRCInput::RC_MaxRC ) - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - - scrollCount = medlinecount; - - switch ( msg ) - { - case NeutrinoMessages::EVT_TIMER: - if(data == fader.GetFadeTimer()) { - if(fader.FadeDone()) - loop = false; - } - else - CNeutrinoApp::getInstance()->handleMsg(msg, data); - break; - case CRCInput::RC_down: - if (showPos+scrollCountepgTitle); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - tmdb_str = tmdb->getDescription(); - if (!tmdb->getCast().empty()) - tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); - } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); - } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); - } - } - break; - } - case CRCInput::RC_red: - { - if (g_settings.tmdb_api_key == "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") - break; - else if (tmdbtoggle) { - mp_movie_info->epgInfo2 = tmdb_str; - } - } - case CRCInput::RC_help: - case CRCInput::RC_ok: - case CRCInput::RC_timeout: - if(fader.StartFadeOut()) { - timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); - msg = 0; - } else - loop = false; - break; - - default: - // konfigurierbare Keys handlen... - if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { - if(fader.StartFadeOut()) { - timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); - msg = 0; - } else - loop = false; - } - else - { - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) - { - loop = false; - res = menu_return::RETURN_EXIT_ALL; - } - } - } - frameBuffer->blit(); - } - hide(); - fader.StopFade(); - } - if (headerPic) - delete headerPic; - if (headerText) - delete headerText; - if (_header) - delete _header; - + epgData.epg_times.dauer = mp_movie_info->length; + res = show(mp_movie_info->epgEpgId >>16, 0, 0, doLoop, false,true ); + if(!epgTextSwitch.empty()) + mp_movie_info->epgInfo2 = epgTextSwitch; return res; } -int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) +int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist,bool mp_info ) { int res = menu_return::RETURN_REPAINT; static uint64_t id = 0; @@ -844,8 +538,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if (channel) epg_id = channel->getEpgID(); + if(!mp_info) + GetEPGData(epg_id, id, &startzeit ); - GetEPGData(epg_id, id, &startzeit ); + epgTextSwitch.clear(); if (doLoop) { if (!bigFonts && g_settings.bigFonts) { @@ -896,6 +592,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } const int pic_h = 39; + if(!topboxheight) + start(); if (!text2.empty()) toph = 2 * topboxheight; @@ -1057,10 +755,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start textCount = epgText.size(); showText(showPos, sy + toph); // show Timer Event Buttons - showTimerEventBar (true, isCurrentEPG(channel_id)); + showTimerEventBar (true, isCurrentEPG(channel_id), mp_info); //show progressbar - if ( epg_done!= -1 ) + if ( !mp_info && epg_done!= -1 ) { int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); CProgressBar pb(pbx, sy+oy-height, 104, height-6); @@ -1090,7 +788,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int scrollCount = 0; bool loop = true; - + bool epgTextSwitchClear = true; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); while (loop) @@ -1104,6 +802,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start switch ( msg ) { case NeutrinoMessages::EVT_TIMER: + if(!mp_info){ if (data == g_InfoViewer->getUpdateTimer()) { GetEPGData(channel_id, id, &startzeit, false); if ( epg_done!= -1 ) { @@ -1120,6 +819,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else CNeutrinoApp::getInstance()->handleMsg(msg, data); + } break; case NeutrinoMessages::EVT_CURRENTNEXT_EPG: if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) { @@ -1191,7 +891,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 31.05.2002 dirch record timer case CRCInput::RC_red: - if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) + if (mp_info){ + epgTextSwitchClear = false; + loop = false; + break; + }else if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) { std::string recDir; //CTimerdClient timerdclient; @@ -1304,6 +1008,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgText_saved = epgText; epgText.clear(); tmdbtoggle = !tmdbtoggle; + + epgTextSwitch = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + epgTextSwitch += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); textCount = epgText.size(); stars = tmdb->getStars(); @@ -1326,24 +1035,26 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 31.05.2002 dirch zapto timer case CRCInput::RC_yellow: { - if (isCurrentEPG(channel_id)) - { - CAdZapMenu::getInstance()->exec(NULL, "enable"); - loop = false; - } - //CTimerdClient timerdclient; - else if (g_Timerd->isTimerdAvailable()) - { - g_Timerd->addZaptoTimerEvent(channel_id, + if (!mp_info){ + if (isCurrentEPG(channel_id)) + { + CAdZapMenu::getInstance()->exec(NULL, "enable"); + loop = false; + } + //CTimerdClient timerdclient; + else if (g_Timerd->isTimerdAvailable()) + { + g_Timerd->addZaptoTimerEvent(channel_id, epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + } + else + printf("timerd not available\n"); } - else - printf("timerd not available\n"); break; } case CRCInput::RC_blue: @@ -1433,6 +1144,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } hide(); fader.StopFade(); + if(epgTextSwitchClear) + epgTextSwitch.clear(); } if (headerPic) delete headerPic; @@ -1603,7 +1316,7 @@ const struct button_label EpgButtons[] = }; -void CEpgData::showTimerEventBar (bool pshow, bool adzap) +void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) { int x,y,h,fh; @@ -1632,9 +1345,18 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap) adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } - if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + if (!mp_info && g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 4:3, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); - else + else if (mp_info){ + const struct button_label Button[] = + { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } + }; + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + ::paintButtons(x , y, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + } + }else ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); #if 0 diff --git a/src/gui/epgview.h b/src/gui/epgview.h index e7fcc1aad..d436802de 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -80,6 +80,7 @@ class CEpgData typedef std::pair epg_pair; std::vector epgText; std::vector epgText_saved; + std::string epgTextSwitch; int topheight,topboxheight; int buttonheight,botboxheight; int medlineheight,medlinecount; @@ -91,7 +92,7 @@ class CEpgData void showText( int startPos, int ypos, bool cover=false, bool fullClear=true ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); - void showTimerEventBar(bool show, bool adzap = false); + void showTimerEventBar(bool show, bool adzap = false, bool mp_info = false); bool isCurrentEPG(const t_channel_id channel_id); public: @@ -99,7 +100,7 @@ class CEpgData CEpgData(); ~CEpgData(); void start( ); - int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); + int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); int show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position = 1, int mp_duration = 1, bool doLoop = true); void hide(); }; From 8ef5d46fd43a6db41a257e1307a04eb6ac328285 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 30 Jul 2016 19:15:15 +0200 Subject: [PATCH 420/690] src/gui/epgview.cpp fix clear epgtext Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/148ba9428a93f28e4abeabbae9683a525a429402 Author: Jacek Jendrzej Date: 2016-07-30 (Sat, 30 Jul 2016) --- src/gui/epgview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 0e277d080..d5ef21e6e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -499,6 +499,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m hide(); return res; } + epgText.clear(); epgData.title = mp_movie_info->epgTitle; epgData.info1 = mp_movie_info->epgInfo1; epgData.info2 = mp_movie_info->epgInfo2; From 2c134ac53a4fa894b23f87659b0e549d71979411 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Aug 2016 10:28:49 +0200 Subject: [PATCH 421/690] epgview: rename bool 'cover' to 'has_cover' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a4ffdcd41322b3a50685a26ac4888f78b6ed1306 Author: vanhofen Date: 2016-08-02 (Tue, 02 Aug 2016) Origin message was: ------------------ - epgview: rename bool 'cover' to 'has_cover' --- src/gui/epgview.cpp | 6 +++--- src/gui/epgview.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d5ef21e6e..8f8ca8792 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -229,7 +229,7 @@ void CEpgData::processTextToArray(std::string text, int screening, bool has_cove addTextToArray( aktLine + aktWord, screening ); } -void CEpgData::showText(int startPos, int ypos, bool cover, bool fullClear) +void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) { // recalculate medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); @@ -237,7 +237,7 @@ void CEpgData::showText(int startPos, int ypos, bool cover, bool fullClear) int cover_height = std::min(sb-10,513); int cover_width = std::min((sb-10)*342/513,342); - int cover_offset = cover ? cover_width+3 : 0; + int cover_offset = has_cover ? cover_width+3 : 0; int textSize = epgText.size(); int y=ypos; const char tok = ' '; @@ -253,7 +253,7 @@ void CEpgData::showText(int startPos, int ypos, bool cover, bool fullClear) int offs = fullClear ? 0 : cover_offset; frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box - if (cover) { + if (has_cover) { if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, CFrameBuffer::TM_NONE)) { cover_offset = 0; frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box diff --git a/src/gui/epgview.h b/src/gui/epgview.h index d436802de..bfed0261c 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -89,7 +89,7 @@ class CEpgData void GetPrevNextEPGData( uint64_t id, time_t* startzeit ); void addTextToArray( const std::string & text, int screening ); void processTextToArray(std::string text, int screening = 0, bool has_cover = false); - void showText( int startPos, int ypos, bool cover=false, bool fullClear=true ); + void showText(int startPos, int ypos, bool has_cover = false, bool fullClear = true); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); void showTimerEventBar(bool show, bool adzap = false, bool mp_info = false); From 5cb90f64d2320e259b32a3b8f1e95243c39cd7aa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Aug 2016 11:19:38 +0200 Subject: [PATCH 422/690] epgview: scale tmdb-cover; smoother view (use a larger offset) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d3cdf8d250d552d3efb860dcc45c82c80455237b Author: vanhofen Date: 2016-08-02 (Tue, 02 Aug 2016) Origin message was: ------------------ - epgview: scale tmdb-cover; smoother view (use a larger offset) --- src/gui/epgview.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 8f8ca8792..a557b743e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -235,9 +235,23 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); medlinecount = sb / medlineheight; - int cover_height = std::min(sb-10,513); - int cover_width = std::min((sb-10)*342/513,342); - int cover_offset = has_cover ? cover_width+3 : 0; + std::string cover = "/tmp/tmdb.jpg"; //todo: maybe add a getCover()-function to tmdb class + int cover_max_width = ox/4; //25% + int cover_max_height = sb-(2*10); + int cover_width = 0; + int cover_height = 0; + int cover_offset = 0; + + if (has_cover) + { + g_PicViewer->getSize(cover.c_str(), &cover_width, &cover_height); + if (cover_width && cover_height) + { + g_PicViewer->rescaleImageDimensions(&cover_width, &cover_height, cover_max_width, cover_max_height); + cover_offset = cover_width + 10; + } + } + int textSize = epgText.size(); int y=ypos; const char tok = ' '; @@ -254,7 +268,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box if (has_cover) { - if (!g_PicViewer->DisplayImage("/tmp/tmdb.jpg",sx+3,y+3+((sb-cover_height)/2),cover_width,cover_height, CFrameBuffer::TM_NONE)) { + if (!g_PicViewer->DisplayImage(cover ,sx+10 ,y+10+((sb-cover_height)/2), cover_width, cover_height, CFrameBuffer::TM_NONE)) { cover_offset = 0; frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box } @@ -263,16 +277,16 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) if (tmdbtoggle && startPos == 0) { int icon_w,icon_h; frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, ypos+5); + frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, ypos+10); logo_offset = icon_w + 10; } if (stars > 0 && startPos == 0) { int icon_w,icon_h; frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); for (int i = 0; i < 10; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+3); + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+10); for (int i = 0; i < stars; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+3); + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+10); } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { @@ -300,7 +314,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT); + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox-15-15-cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); } } From 7df47f3cae480c7793b51d4f5e815e7063fa52da Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Aug 2016 11:36:29 +0200 Subject: [PATCH 423/690] minor code cosmetics; no binary changes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/adb48f523d85c33194afb3ce5bed0d058287f05e Author: vanhofen Date: 2016-08-02 (Tue, 02 Aug 2016) Origin message was: ------------------ - minor code cosmetics; no binary changes --- src/gui/epgview.cpp | 66 ++++++++++++++++++---------------------- src/gui/infoviewer.cpp | 2 +- src/gui/moviebrowser.cpp | 12 +++++--- src/gui/movieplayer.cpp | 2 +- 4 files changed, 40 insertions(+), 42 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index a557b743e..a08645528 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -534,7 +534,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m return res; } -int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist,bool mp_info ) +int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist, bool mp_info ) { int res = menu_return::RETURN_REPAINT; static uint64_t id = 0; @@ -553,8 +553,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if (channel) epg_id = channel->getEpgID(); - if(!mp_info) - GetEPGData(epg_id, id, &startzeit ); + if (!mp_info) + GetEPGData(epg_id, id, &startzeit); epgTextSwitch.clear(); if (doLoop) @@ -770,10 +770,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start textCount = epgText.size(); showText(showPos, sy + toph); // show Timer Event Buttons - showTimerEventBar (true, isCurrentEPG(channel_id), mp_info); + showTimerEventBar(true, isCurrentEPG(channel_id), mp_info); //show progressbar - if ( !mp_info && epg_done!= -1 ) + if (!mp_info && epg_done!= -1) { int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); CProgressBar pb(pbx, sy+oy-height, 104, height-6); @@ -817,23 +817,24 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start switch ( msg ) { case NeutrinoMessages::EVT_TIMER: - if(!mp_info){ - if (data == g_InfoViewer->getUpdateTimer()) { - GetEPGData(channel_id, id, &startzeit, false); - if ( epg_done!= -1 ) { - int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); + if (!mp_info) + { + if (data == g_InfoViewer->getUpdateTimer()) { + GetEPGData(channel_id, id, &startzeit, false); + if ( epg_done!= -1 ) { + int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); + CProgressBar pb(pbx, sy+oy-height, 104, height-6); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } } - } - if(data == fader.GetFadeTimer()) { - if(fader.FadeDone()) - loop = false; - } - else - CNeutrinoApp::getInstance()->handleMsg(msg, data); + if (data == fader.GetFadeTimer()) { + if (fader.FadeDone()) + loop = false; + } + else + CNeutrinoApp::getInstance()->handleMsg(msg, data); } break; case NeutrinoMessages::EVT_CURRENTNEXT_EPG: @@ -853,7 +854,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showPos=0; } break; - case CRCInput::RC_right: if ((next_id != 0) && !call_fromfollowlist) { @@ -864,7 +864,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showPos=0; } break; - case CRCInput::RC_down: if (showPos+scrollCount 0) { showPos -= scrollCount; @@ -903,14 +901,14 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showTimerEventBar(true, true); } break; - - // 31.05.2002 dirch record timer case CRCInput::RC_red: - if (mp_info){ + if (mp_info) + { epgTextSwitchClear = false; loop = false; break; - }else if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) + } + else if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) { std::string recDir; //CTimerdClient timerdclient; @@ -1015,7 +1013,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_info: { - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + { showPos = 0; if (!tmdbtoggle) { cTmdb* tmdb = new cTmdb(epgData.title); @@ -1046,11 +1045,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } break; } - - // 31.05.2002 dirch zapto timer case CRCInput::RC_yellow: { - if (!mp_info){ + if (!mp_info) + { if (isCurrentEPG(channel_id)) { CAdZapMenu::getInstance()->exec(NULL, "enable"); @@ -1116,7 +1114,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; break; - case CRCInput::RC_ok: case CRCInput::RC_timeout: if(fader.StartFadeOut()) { @@ -1133,9 +1130,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start loop = false; } break; - default: - // konfigurierbare Keys handlen... if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { if(fader.StartFadeOut()) { timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); @@ -1332,7 +1327,6 @@ const struct button_label EpgButtons[] = }; void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) - { int x,y,h,fh; int icol_w, icol_h; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index b65d2293b..609c093d3 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1036,7 +1036,7 @@ void CInfoViewer::loop(bool show_dot) hideIt = true; } else - g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); + g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { if(fader.FadeDone()) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 2c6356133..2c83b351f 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1850,13 +1850,17 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()){ + if (!fname.empty()) + { //delete Cover - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - unlink(fname.c_str()); + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + { + unlink(fname.c_str()); refresh(); } - }else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + } + else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + { //add TMDB Cover fname = m_movieSelectionHandler->file.Name.c_str(); int ext_pos = 0; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index a254e4e0b..42d127be8 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1533,7 +1533,7 @@ void CMoviePlayerGui::PlayFileLoop(void) fromInfoviewer = false; } else - callInfoViewer(); + callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { From b936442b79b7dab1ca0bba4733e70004d1d3d6f3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Aug 2016 12:03:42 +0200 Subject: [PATCH 424/690] epgview: completion of 5cb90f64d2320e259b32a3b8f1e95243c39cd7aa Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e3ef2375b061e24725208f5e6f549b900e0226a Author: vanhofen Date: 2016-08-02 (Tue, 02 Aug 2016) Origin message was: ------------------ - epgview: completion of 5cb90f64d2320e259b32a3b8f1e95243c39cd7aa --- src/gui/epgview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index a08645528..934fc9b07 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -194,7 +194,7 @@ void CEpgData::processTextToArray(std::string text, int screening, bool has_cove // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (has_cover? (std::min((sb-10)*342/513,342)) :0))) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (has_cover? ((ox/4)+10) :0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; From a72ab439717fbfa300becfe1e4098ccf6f936d1a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Aug 2016 12:48:18 +0200 Subject: [PATCH 425/690] epgview: rename bool 'tmdbtoggle' to 'tmdb_active' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7df061947e4eeddf6f4f57b3d4c42364b1173407 Author: vanhofen Date: 2016-08-02 (Tue, 02 Aug 2016) Origin message was: ------------------ - epgview: rename bool 'tmdbtoggle' to 'tmdb_active' --- src/gui/epgview.cpp | 18 +++++++++--------- src/gui/epgview.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 934fc9b07..c0bbd2dd3 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -122,7 +122,7 @@ CEpgData::CEpgData() { bigFonts = false; frameBuffer = CFrameBuffer::getInstance(); - tmdbtoggle = false; + tmdb_active = false; header = NULL; } @@ -274,7 +274,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) } } int logo_offset = 0; - if (tmdbtoggle && startPos == 0) { + if (tmdb_active && startPos == 0) { int icon_w,icon_h; frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, ypos+10); @@ -544,7 +544,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start startzeit=*a_startzeit; id=a_id; - tmdbtoggle = false; + tmdb_active = false; stars = 0; int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); @@ -868,7 +868,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (showPos+scrollCountgetResults() > 0) && (!tmdb->getDescription().empty())) { epgText_saved = epgText; epgText.clear(); - tmdbtoggle = !tmdbtoggle; + tmdb_active = !tmdb_active; epgTextSwitch = tmdb->getDescription(); if (!tmdb->getCast().empty()) @@ -1030,7 +1030,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); textCount = epgText.size(); stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + showText(showPos, sy + toph, tmdb_active); } else { ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); } @@ -1038,7 +1038,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else { epgText = epgText_saved; textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; + tmdb_active = !tmdb_active; stars=0; showText(showPos, sy + toph); } diff --git a/src/gui/epgview.h b/src/gui/epgview.h index bfed0261c..1b23af3f3 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -65,8 +65,8 @@ class CEpgData bool bigFonts; bool has_follow_screenings; bool call_fromfollowlist; - bool tmdbtoggle; - int stars; + bool tmdb_active; + int stars; time_t tmp_curent_zeit; uint64_t prev_id; From f4262ed992bcbf1ed288cc3d45f9efd98b0ade8f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 00:12:29 +0200 Subject: [PATCH 426/690] epgview: fix y-position of tmdb-logo and rating-stars Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/25e29c30bec7e93ac75b8f749004ef72eff3ab12 Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: fix y-position of tmdb-logo and rating-stars --- src/gui/epgview.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c0bbd2dd3..5251fe627 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -274,19 +274,21 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) } } int logo_offset = 0; - if (tmdb_active && startPos == 0) { - int icon_w,icon_h; + int icon_w = 0; + int icon_h = 0; + if (tmdb_active && startPos == 0) + { frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, ypos+10); + frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, y+(medlineheight-icon_h)/2); logo_offset = icon_w + 10; } - if (stars > 0 && startPos == 0) { - int icon_w,icon_h; + if (stars > 0 && startPos == 0) + { frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); for (int i = 0; i < 10; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+10); + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+(medlineheight-icon_h)/2); for (int i = 0; i < stars; i++) - frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+10); + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+(medlineheight-icon_h)/2); } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { From fcd5fc1c9c8eb062d96e4c888f16e568801229d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 11:12:45 +0200 Subject: [PATCH 427/690] epgview: rework buttonbar logic Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/999d61f9230195d059cbfcb7649dd1c3f0b608fb Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: rework buttonbar logic --- src/gui/epgview.cpp | 53 ++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5251fe627..63387dc2e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1319,13 +1319,24 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st // -- 2002-05-13 rasc // -const struct button_label EpgButtons[] = +#define EpgButtonsMax 4 +const struct button_label EpgButtons[][EpgButtonsMax] = { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } - + { // full view + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // w/o followscreenings + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // movieplayer mode + { NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + } }; void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) @@ -1356,20 +1367,22 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } - if (!mp_info && g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 4:3, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); - else if (mp_info){ - const struct button_label Button[] = - { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } - }; - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ - ::paintButtons(x , y, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); - } - }else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); - + bool tmdb = (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + bool fscr = (has_follow_screenings && !call_fromfollowlist); + if (mp_info) + ::paintButtons(x, y, 0, tmdb ? 2 : 1, EpgButtons[2], aw, h); + else + { + int c = EpgButtonsMax; + if (!tmdb) + c--; // reduce tmdb button + if (!fscr) + c--; // reduce blue button + if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + ::paintButtons(x, y, 0, c, EpgButtons[fscr ? 0 : 1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + else + ::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); + } #if 0 // Button: Timer Record & Channelswitch if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) From 6c5c467f76a841cd719b6fcb6a00392285182553 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 12:19:52 +0200 Subject: [PATCH 428/690] epgview: cleanup from unused code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be2a5bcbb55062d12da7a51a5fb9b4cc256b1466 Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: cleanup from unused code --- src/gui/epgview.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 63387dc2e..4d1691c28 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1383,19 +1383,6 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) else ::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); } -#if 0 - // Button: Timer Record & Channelswitch - if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - { - pos = 0; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT); - } - // Button: Timer Channelswitch - pos = 2; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT); -#endif } // -- EPG Data Viewer Menu Handler Class From ae5214cd7adce2f0af26a0e55eb93ca489597a1b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 12:50:34 +0200 Subject: [PATCH 429/690] epgview: remove obsolte calculation for footer witdh Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9a8b5a65660a1345e713dcb4f5d6bbe0581f272 Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: remove obsolte calculation for footer witdh --- src/gui/epgview.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4d1691c28..b7edf6af0 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1341,11 +1341,12 @@ const struct button_label EpgButtons[][EpgButtonsMax] = void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) { - int x,y,h,fh; + int x, y, w, h, fh; int icol_w, icol_h; - x = sx + 10; + x = sx; y = sy + oy; + w = ox; fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); @@ -1357,9 +1358,7 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) frameBuffer->paintBackgroundBoxRel(sx,y,ox,h); return; } - frameBuffer->paintBoxRel(sx,y,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);//round - /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ - int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + std::string adzap_button; if (adzap) { @@ -1370,7 +1369,7 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) bool tmdb = (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); bool fscr = (has_follow_screenings && !call_fromfollowlist); if (mp_info) - ::paintButtons(x, y, 0, tmdb ? 2 : 1, EpgButtons[2], aw, h); + ::paintButtons(x, y, w, tmdb ? 2 : 1, EpgButtons[2], w, h); else { int c = EpgButtonsMax; @@ -1379,9 +1378,9 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) if (!fscr) c--; // reduce blue button if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, c, EpgButtons[fscr ? 0 : 1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + ::paintButtons(x, y, w, c, EpgButtons[fscr ? 0 : 1], w, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); else - ::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); + ::paintButtons(x, y, w, c, &EpgButtons[fscr ? 0 : 1][1], w, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); } } From e3daec4e2d69b1f2c3c21c5665f27517870cda94 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 4 Aug 2016 09:44:36 +0200 Subject: [PATCH 430/690] eventlist: allow to disable epgplus Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5837b922b1a87de04e6e8888309e45c5449f08d9 Author: vanhofen Date: 2016-08-04 (Thu, 04 Aug 2016) Origin message was: ------------------ - eventlist: allow to disable epgplus --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/eventlist.cpp | 11 +++++++---- src/gui/osd_setup.cpp | 5 +++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a53bbf8c3..9e0b4d0b8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -402,6 +402,7 @@ eventfinder.search_within_list Suche innerhalb Text eventfinder.searching Suche... eventfinder.start_search Suche starten eventlist.additional Zusatzinformationen +eventlist.epgplus EPG Plus anzeigen eventlist.name Eventliste eventlistbar.channelswitch Umschalten eventlistbar.eventsort Sortieren @@ -1036,6 +1037,7 @@ menu.hint_epg_save_standby Speichert die EPG-Daten auch, wenn in den Standby-Mod menu.hint_epg_scan Zu scannende Bouquets wählen. Aktuelles Bouquet beim Umschalten, markierte Bouquets oder alle Favoriten menu.hint_epg_scan_mode Aktivieren Sie den Hintergrundscan der EPG-Daten, wenn ein freier Tuner vorhanden ist menu.hint_eventlist_additional Definiert, ob zusätzliche Informationen im Hauptfenster angezeigt werden sollen +menu.hint_eventlist_epgplus Definiert, ob EPG Plus (Vorschau-Übersicht) mit der EPG-Taste angezeigt werden sollen menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste menu.hint_eventlist_setup Wählen Sie die Anzeigeoptionen für die Event-Liste menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal und mehr diff --git a/data/locale/english.locale b/data/locale/english.locale index cb28460c2..416e1cd80 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -402,6 +402,7 @@ eventfinder.search_within_list Search within eventfinder.searching Search for keyword in EPG... eventfinder.start_search Start Search eventlist.additional Additional informations +eventlist.epgplus Show EPG Plus eventlist.name Eventlist eventlistbar.channelswitch schedule eventlistbar.eventsort sorting @@ -1036,6 +1037,7 @@ menu.hint_epg_save_standby Save EPG on soft standby mode menu.hint_epg_scan Select bouquets to scan epg, current on zap,\nall or selected favorites menu.hint_epg_scan_mode Enable background epg scan using free tuner menu.hint_eventlist_additional Show additional informations\nin main box +menu.hint_eventlist_epgplus Show EPG Plus (Eventlist overview) when pressing EPG key menu.hint_eventlist_fonts Change event list font sizes menu.hint_eventlist_setup Configure event list GUI options menu.hint_extended Power saving, EPG save/load options\nHDMI-CEC, Start channel, zap options diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 9722eb3e7..e347f54eb 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -601,10 +601,13 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } else if (msg == CRCInput::RC_epg) { - hide(); - CEPGplusHandler eplus; - eplus.exec(NULL, ""); - loop = false; + if (g_settings.eventlist_epgplus) + { + hide(); + CEPGplusHandler eplus; + eplus.exec(NULL, ""); + loop = false; + } } else if (msg==CRCInput::RC_help || msg==CRCInput::RC_ok || msg==CRCInput::RC_info) { diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 276302e5d..f723871ad 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1195,6 +1195,11 @@ void COsdSetup::showOsdEventlistSetup(CMenuWidget *menu_eventlist) mc = new CMenuOptionChooser(LOCALE_EVENTLIST_ADDITIONAL, &g_settings.eventlist_additional, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_EVENTLIST_ADDITIONAL); menu_eventlist->addItem(mc); + + // epgplus in eventlist + mc = new CMenuOptionChooser(LOCALE_EVENTLIST_EPGPLUS, &g_settings.eventlist_epgplus, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_EVENTLIST_EPGPLUS); + menu_eventlist->addItem(mc); } // volume diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7c590d0b1..475e2a3e8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -692,6 +692,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.spectrum = configfile.getBool("spectrum" , false); g_settings.channellist_additional = configfile.getInt32("channellist_additional", 2); //default minitv g_settings.eventlist_additional = configfile.getInt32("eventlist_additional", 0); + g_settings.eventlist_epgplus = configfile.getInt32("eventlist_epgplus", 1); g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); g_settings.channellist_progressbar_design = configfile.getInt32("channellist_progressbar_design", g_settings.progressbar_design); g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event @@ -1220,6 +1221,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); configfile.setBool("spectrum", g_settings.spectrum); configfile.setInt32("eventlist_additional", g_settings.eventlist_additional); + configfile.setInt32("eventlist_epgplus", g_settings.eventlist_epgplus); configfile.setInt32("channellist_additional", g_settings.channellist_additional); configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); configfile.setInt32("channellist_progressbar_design", g_settings.channellist_progressbar_design); diff --git a/src/system/locals.h b/src/system/locals.h index 9aca38703..0affda661 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -429,6 +429,7 @@ typedef enum LOCALE_EVENTFINDER_SEARCHING, LOCALE_EVENTFINDER_START_SEARCH, LOCALE_EVENTLIST_ADDITIONAL, + LOCALE_EVENTLIST_EPGPLUS, LOCALE_EVENTLIST_NAME, LOCALE_EVENTLISTBAR_CHANNELSWITCH, LOCALE_EVENTLISTBAR_EVENTSORT, @@ -1063,6 +1064,7 @@ typedef enum LOCALE_MENU_HINT_EPG_SCAN, LOCALE_MENU_HINT_EPG_SCAN_MODE, LOCALE_MENU_HINT_EVENTLIST_ADDITIONAL, + LOCALE_MENU_HINT_EVENTLIST_EPGPLUS, LOCALE_MENU_HINT_EVENTLIST_FONTS, LOCALE_MENU_HINT_EVENTLIST_SETUP, LOCALE_MENU_HINT_EXTENDED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index abfce1c63..0fd4b7260 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -429,6 +429,7 @@ const char * locale_real_names[] = "eventfinder.searching", "eventfinder.start_search", "eventlist.additional", + "eventlist.epgplus", "eventlist.name", "eventlistbar.channelswitch", "eventlistbar.eventsort", @@ -1063,6 +1064,7 @@ const char * locale_real_names[] = "menu.hint_epg_scan", "menu.hint_epg_scan_mode", "menu.hint_eventlist_additional", + "menu.hint_eventlist_epgplus", "menu.hint_eventlist_fonts", "menu.hint_eventlist_setup", "menu.hint_extended", diff --git a/src/system/settings.h b/src/system/settings.h index c3e7e2f98..e5b19f4db 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -561,6 +561,7 @@ struct SNeutrinoSettings int window_width; int window_height; int eventlist_additional; + int eventlist_epgplus; int channellist_additional; int channellist_epgtext_align_right; int channellist_progressbar_design; From 2d54a78eb1e1ddca19951d637c76dc1e70c1d7ea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 6 Aug 2016 22:29:26 +0200 Subject: [PATCH 431/690] disable shoutcast, when shoutcast_dev_id is empty Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f224be6727e9855d0c7ae700e5cfdf1f7d8c965 Author: vanhofen Date: 2016-08-06 (Sat, 06 Aug 2016) Origin message was: ------------------ - disable shoutcast, when shoutcast_dev_id is empty --- src/gui/audioplayer.cpp | 8 +++----- src/neutrino.cpp | 1 + src/system/settings.h | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index cb97df43e..65510c4dc 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -641,12 +641,10 @@ int CAudioPlayerGui::show() InputSelector.addItem(new CMenuForwarder( LOCALE_AUDIOPLAYER_ADD_IC, true, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - if(g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX"){ - sprintf(cnt, "%d", ++count); - InputSelector.addItem(new CMenuForwarder( - LOCALE_AUDIOPLAYER_ADD_SC, true, NULL, InetRadioInputChanger, + sprintf(cnt, "%d", ++count); + InputSelector.addItem(new CMenuForwarder( + LOCALE_AUDIOPLAYER_ADD_SC, g_settings.shoutcast_enabled, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - } //InputSelector.addItem(GenericMenuSeparator); hide(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 475e2a3e8..1fb8fd12c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -803,6 +803,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); + g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); diff --git a/src/system/settings.h b/src/system/settings.h index e5b19f4db..733cb2316 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -714,6 +714,8 @@ struct SNeutrinoSettings int audioplayer_show_playlist; int audioplayer_enable_sc_metadata; std::string shoutcast_dev_id; + int shoutcast_enabled; + //Filebrowser int filebrowser_showrights; int filebrowser_sortmethod; From ed8e7c6d7881c9b9a11b6bf033b61fe93d04e8e1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 6 Aug 2016 22:29:26 +0200 Subject: [PATCH 432/690] disable tmdb, when tmdb_api_key is empty Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bbccd92b49352356729b9d8980fd000c87bc4752 Author: vanhofen Date: 2016-08-06 (Sat, 06 Aug 2016) Origin message was: ------------------ - disable tmdb, when tmdb_api_key is empty --- src/gui/epgview.cpp | 4 ++-- src/gui/moviebrowser.cpp | 2 +- src/neutrino.cpp | 1 + src/system/settings.h | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b7edf6af0..9d8f6deb7 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1015,7 +1015,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_info: { - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + if (g_settings.tmdb_enabled) { showPos = 0; if (!tmdb_active) { @@ -1366,7 +1366,7 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } - bool tmdb = (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + bool tmdb = g_settings.tmdb_enabled; bool fscr = (has_follow_screenings && !call_fromfollowlist); if (mp_info) ::paintButtons(x, y, w, tmdb ? 2 : 1, EpgButtons[2], w, h); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 2c83b351f..b83284a7d 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1859,7 +1859,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) refresh(); } } - else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + else if (g_settings.tmdb_enabled) { //add TMDB Cover fname = m_movieSelectionHandler->file.Name.c_str(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1fb8fd12c..ed64cb129 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -809,6 +809,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); diff --git a/src/system/settings.h b/src/system/settings.h index 733cb2316..dc0af7918 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -725,6 +725,7 @@ struct SNeutrinoSettings int movieplayer_repeat_on; std::string youtube_dev_id; std::string tmdb_api_key; + int tmdb_enabled; //zapit setup std::string StartChannelTV; From 80917aa8119acdc9d638ea768d2b31310b21f4cd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 6 Aug 2016 22:29:26 +0200 Subject: [PATCH 433/690] disable youtube, when youtube_dev_id is empty Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ce13c651d942a725160c01aa1c88b80fedea67f Author: vanhofen Date: 2016-08-06 (Sat, 06 Aug 2016) Origin message was: ------------------ - disable youtube, when youtube_dev_id is empty --- src/gui/mediaplayer.cpp | 2 +- src/neutrino.cpp | 1 + src/system/settings.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 993aab273..7d25e73a3 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -295,7 +295,7 @@ void CMediaPlayerMenu::showMoviePlayer(CMenuWidget *moviePlayer, CPersonalizeGui p->addItem(moviePlayer, fw_file, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_FILEPLAY]); //ytplayback if (!g_settings.easymenu) { - CMenuForwarder *fw_yt = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, &CMoviePlayerGui::getInstance(), "ytplayback", CRCInput::RC_yellow); + CMenuForwarder *fw_yt = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_settings.youtube_enabled, NULL, &CMoviePlayerGui::getInstance(), "ytplayback", CRCInput::RC_yellow); fw_yt->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); p->addItem(moviePlayer, fw_yt, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_YTPLAY]); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ed64cb129..8ed7d9051 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -808,6 +808,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); diff --git a/src/system/settings.h b/src/system/settings.h index dc0af7918..3c6eaf2bf 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -724,6 +724,7 @@ struct SNeutrinoSettings //movieplayer int movieplayer_repeat_on; std::string youtube_dev_id; + int youtube_enabled; std::string tmdb_api_key; int tmdb_enabled; From 6b442c83942bf1d42165fe3c09f14441770b28f4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 6 Aug 2016 22:29:26 +0200 Subject: [PATCH 434/690] add submenu to configure and control online services like youtube, shoutcast and tmdb Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a291b11300b4a55e35a38a3ea3f23a33200e180f Author: vanhofen Date: 2016-08-06 (Sat, 06 Aug 2016) Origin message was: ------------------ - add submenu to configure and control online services like youtube, shoutcast and tmdb --- data/locale/deutsch.locale | 8 +++++ data/locale/english.locale | 8 +++++ src/gui/miscsettings_menu.cpp | 66 +++++++++++++++++++++++++++++++++-- src/gui/miscsettings_menu.h | 5 +++ src/neutrino_menue.h | 1 + src/system/locals.h | 8 +++++ src/system/locals_intern.h | 8 +++++ 7 files changed, 102 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 9e0b4d0b8..44b6e7395 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1179,6 +1179,7 @@ menu.hint_misc_energy Energieverbrauchs- und Standby-Optionen, verzögertes Auss menu.hint_misc_epg Diverse EPG-Einstellungen und Speicherverzeichnis für EPG-Daten menu.hint_misc_filebrowser Dateisystem, Dateirechte anzeigen im Dateibrowser, Startverzeichnisoptionen menu.hint_misc_general Standby-, Teletext- und Rotor-Einstellungen, Pluginverzeichnis auf externem Datenträger +menu.hint_misc_onlineservices Konfigurieren und steuern von Online-Diensten wie YouTube, ShoutCast und TMDb menu.hint_misc_zapit Verwaltung der Start-Kanäle für den TV/Radio-Modus menu.hint_movie Wiedergabe von Filmen menu.hint_moviebrowser_setup Legen Sie Auswahl- und Anzeigeoptionen des MovieBrowsers fest @@ -1391,6 +1392,7 @@ menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhal menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung und mehr menu.hint_service_scan Automatischer / manueller Service Suchlauf menu.hint_settings Konfigurieren von Neutrino-HD,\nNetzwerk, Video, Audio, OSD und mehr +menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll menu.hint_shutdown Setzen Sie Ihre Box in den Standby-Modus oder schalten Sie die Box komplett aus menu.hint_shutdown_count Die Zeit zum Herunterfahren in den Deep-Standby, wenn die Box im Standby-Modus ist @@ -1418,6 +1420,7 @@ menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus +menu.hint_tmdb_api_key Geben Sie den TMDb API Schlüssel ein. Eine leere Eingabe schaltet die TMDb-Unterstützung aus menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um @@ -1455,6 +1458,7 @@ menu.hint_volume_pos Wählen Sie die Position der Lautstärkeanzeige aus menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige menu.hint_webtv_setup Hier konfigurierte WebTV-Kanäle finden Sie in der Kanalverwaltung. menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert +menu.hint_youtube_dev_id Geben Sie die YouTube Dev ID ein. Eine leere Eingabe schaltet die YouTube-Unterstützung aus menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann @@ -1533,6 +1537,7 @@ miscsettings.infobar_show_res_simple einfach miscsettings.infobar_show_sysfs_hdd Füllstandsanzeige (SysFS und HDD) miscsettings.infobar_show_tuner Aktiven Tuner anzeigen miscsettings.infoclock Uhr +miscsettings.onlineservices Online-Dienste miscsettings.progressbar Fortschrittsbalken miscsettings.progressbar_color Farbe miscsettings.progressbar_design Design @@ -2245,6 +2250,7 @@ settings.pos_top_left oben links settings.pos_top_right oben rechts settings.restore Image-Einstellungen: Wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? +shoutcast.dev_id SHOUTcast Dev ID shutdown.recording_query Aufnahme läuft. Trotzdem beenden? shutdowntimer.announce Die Box wird in 1 Min. heruntergefahren.\nShutdown abbrechen? sleeptimerbox.announce Die Box wird in 1 Min. in Standby-Betrieb gehen.\nStandby-Betrieb abbrechen? @@ -2364,6 +2370,7 @@ timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige +tmdb.api_key TMDb API Schlüssel tmdb.read_data Suche TMDB Daten... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz @@ -2471,6 +2478,7 @@ wizard.welcome_head Willkommen zur Ersteinrichtung Ihres Receivers! wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgenden\nSchritten begleiten wir Sie durch die Erstinstallation des Gerätes.\nWir wünschen Ihnen viel Freude mit dem wohl einzigartigsten Receiver!\nBeachten Sie: Ihre CST Set-Top-Box lässt sich bequem per Webinterface\nsteuern, um zum Beispiel die Timer-Verwaltung zu nutzen oder Live-TV im Web-Browser zu schauen.\nAchten Sie darauf, dass Ihre Gerät nicht von aussen zugänglich ist,\nda sonst ein Zugriff über das Internet nicht ausgeschlossen werden kann!\nNächster Schritt? word.from ab word.in in +youtube.dev_id YouTube Dev ID zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio diff --git a/data/locale/english.locale b/data/locale/english.locale index 416e1cd80..f8b74ca44 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1179,6 +1179,7 @@ menu.hint_misc_energy Enable soft-standby, delayed shutdown\ninactivity timers menu.hint_misc_epg Save/load EPG options, EPG cache options\nEPG save directory menu.hint_misc_filebrowser Filesystem encoding, file rights\ndeny directory leave menu.hint_misc_general Start to standby, cache teletext, swp rotor\nplugin hdd dir +menu.hint_misc_onlineservices Configure and control online services like YouTube, ShoutCast and TMDb menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies menu.hint_moviebrowser_setup Set selection and display options. @@ -1391,6 +1392,7 @@ menu.hint_selected_text Change selected item text color menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan menu.hint_settings Configure Neutrino-HD\nNetwork, audio, video, OSD and more +menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support menu.hint_show_mute_icon Show mute icon, when volume set to 0 menu.hint_shutdown Put your box in deep standby mode\nNo confirmation menu.hint_shutdown_count Time to put box in deep-standby\nfrom soft-standby mode @@ -1418,6 +1420,7 @@ menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone +menu.hint_tmdb_api_key Type your TMDb API key. An empty input disables TMDb support menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode @@ -1455,6 +1458,7 @@ menu.hint_volume_pos Select volume indicator position menu.hint_volume_size Select volume indicator height menu.hint_webtv_setup WebTV channels configured here will be available in the standard channel lists. menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor +menu.hint_youtube_dev_id Type your YouTube Dev ID. An empty input disables YouTube support menu.hint_ytplay Play selected youtube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet @@ -1533,6 +1537,7 @@ miscsettings.infobar_show_res_simple simple miscsettings.infobar_show_sysfs_hdd Fill level (SysFS and HDD) miscsettings.infobar_show_tuner Display active tuner miscsettings.infoclock Clock +miscsettings.onlineservices Online services miscsettings.progressbar Progressbar miscsettings.progressbar_color Color miscsettings.progressbar_design Design @@ -2245,6 +2250,7 @@ settings.pos_top_left top left settings.pos_top_right top right settings.restore Image-Settings: Restore settings.restore_warn This will replace all settings and reboot\nContinue ? +shoutcast.dev_id SHOUTcast Dev ID shutdown.recording_query You really want to to stop record ? shutdowntimer.announce Box will shutdown in 1 min.\nCancel Shutdown ? sleeptimerbox.announce Box will standby in 1 min.\nCancel Standby ? @@ -2364,6 +2370,7 @@ timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap timing.volumebar Volume bar +tmdb.api_key TMDb API key tmdb.read_data Search TMDB Data... unicable.lnb Unicable Input unicable.qrg Unicable Frequency @@ -2471,6 +2478,7 @@ wizard.welcome_head Welcome to the Setup Wizard wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CST set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from word.in in +youtube.dev_id YouTube Dev ID zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 6abdb8d48..206de09de 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,10 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { return showMiscSettingsMenuChanlist(); } + else if(actionKey == "onlineservices") + { + return showMiscSettingsMenuOnlineServices(); + } return showMiscSettingsMenu(); } @@ -270,11 +275,16 @@ int CMiscMenue::showMiscSettingsMenu() mf->setHint("", LOCALE_MENU_HINT_MISC_ZAPIT); misc_menue.addItem(mf); + // onlineservices + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_4); + mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES); + misc_menue.addItem(mf); + #ifdef CPU_FREQ //CPU CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width); showMiscSettingsMenuCPUFreq(&misc_menue_cpu); - misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_4)); + misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_5)); #endif /*CPU_FREQ*/ int res = misc_menue.exec(NULL, ""); @@ -536,6 +546,35 @@ int CMiscMenue::showMiscSettingsMenuChanlist() return res; } +// online services +int CMiscMenue::showMiscSettingsMenuOnlineServices() +{ + CMenuWidget *ms_oservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES); + ms_oservices->addIntroItems(LOCALE_MISCSETTINGS_ONLINESERVICES); + + changeNotify(LOCALE_TMDB_API_KEY, NULL); + CKeyboardInput tmdb_api_key_input(LOCALE_TMDB_API_KEY, &g_settings.tmdb_api_key, 32, this); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_TMDB_API_KEY, true, tmdb_api_key_short, &tmdb_api_key_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_API_KEY); + ms_oservices->addItem(mf); + + changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); + CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); + mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); + ms_oservices->addItem(mf); + + changeNotify(LOCALE_SHOUTCAST_DEV_ID, NULL); + CKeyboardInput shoutcast_dev_id_input(LOCALE_SHOUTCAST_DEV_ID, &g_settings.shoutcast_dev_id, 16, this); + mf = new CMenuForwarder(LOCALE_SHOUTCAST_DEV_ID, true, shoutcast_dev_id_short, &shoutcast_dev_id_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_DEV_ID); + ms_oservices->addItem(mf); + + int res = ms_oservices->exec(NULL, ""); + delete ms_oservices; + return res; +} + #ifdef CPU_FREQ //CPU void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) @@ -592,6 +631,29 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* epg_scan->setActive(g_settings.epg_scan_mode != CEpgScan::MODE_OFF && g_settings.epg_save_mode == 0); ret = menu_return::RETURN_REPAINT; } - + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_TMDB_API_KEY)) + { + g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); + if (g_settings.tmdb_enabled) + tmdb_api_key_short = g_settings.tmdb_api_key.substr(0, 8) + "..."; + else + tmdb_api_key_short.clear(); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_YOUTUBE_DEV_ID)) + { + g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); + if (g_settings.youtube_enabled) + youtube_dev_id_short = g_settings.youtube_dev_id.substr(0, 8) + "..."; + else + youtube_dev_id_short.clear(); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SHOUTCAST_DEV_ID)) + { + g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); + if (g_settings.shoutcast_enabled) + shoutcast_dev_id_short = g_settings.shoutcast_dev_id.substr(0, 8) + "..."; + else + shoutcast_dev_id_short.clear(); + } return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 6084f3f92..22f6f25e4 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -53,12 +53,17 @@ class CMiscMenue : public CMenuTarget, CChangeObserver std::string epg_old_events; std::string epg_max_events; + std::string tmdb_api_key_short; + std::string youtube_dev_id_short; + std::string shoutcast_dev_id_short; + int showMiscSettingsMenu(); void showMiscSettingsMenuGeneral(CMenuWidget *ms_general); void showMiscSettingsMenuEpg(CMenuWidget *ms_epg); void showMiscSettingsMenuFBrowser(CMenuWidget *ms_fbrowser); int showMiscSettingsMenuEnergy(); int showMiscSettingsMenuChanlist(); + int showMiscSettingsMenuOnlineServices(); #ifdef CPU_FREQ void showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu); #endif /*CPU_FREQ*/ diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 2bcc209c3..809466545 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -121,6 +121,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_MISCSETUP_EPG, MN_WIDGET_ID_MISCSETUP_FILEBROWSER, MN_WIDGET_ID_MISCSETUP_CHANNELLIST, + MN_WIDGET_ID_MISCSETUP_ONLINESERVICES, //media menu MN_WIDGET_ID_MEDIA, diff --git a/src/system/locals.h b/src/system/locals.h index 0affda661..8d2865671 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1206,6 +1206,7 @@ typedef enum LOCALE_MENU_HINT_MISC_EPG, LOCALE_MENU_HINT_MISC_FILEBROWSER, LOCALE_MENU_HINT_MISC_GENERAL, + LOCALE_MENU_HINT_MISC_ONLINESERVICES, LOCALE_MENU_HINT_MISC_ZAPIT, LOCALE_MENU_HINT_MOVIE, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP, @@ -1418,6 +1419,7 @@ typedef enum LOCALE_MENU_HINT_SERVICE, LOCALE_MENU_HINT_SERVICE_SCAN, LOCALE_MENU_HINT_SETTINGS, + LOCALE_MENU_HINT_SHOUTCAST_DEV_ID, LOCALE_MENU_HINT_SHOW_MUTE_ICON, LOCALE_MENU_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN_COUNT, @@ -1445,6 +1447,7 @@ typedef enum LOCALE_MENU_HINT_TIMEOUTS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, + LOCALE_MENU_HINT_TMDB_API_KEY, LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, @@ -1482,6 +1485,7 @@ typedef enum LOCALE_MENU_HINT_VOLUME_SIZE, LOCALE_MENU_HINT_WEBTV_SETUP, LOCALE_MENU_HINT_WINDOW_SIZE, + LOCALE_MENU_HINT_YOUTUBE_DEV_ID, LOCALE_MENU_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP, LOCALE_MENU_HINT_ZAP_CYCLE, @@ -1560,6 +1564,7 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, LOCALE_MISCSETTINGS_INFOCLOCK, + LOCALE_MISCSETTINGS_ONLINESERVICES, LOCALE_MISCSETTINGS_PROGRESSBAR, LOCALE_MISCSETTINGS_PROGRESSBAR_COLOR, LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN, @@ -2272,6 +2277,7 @@ typedef enum LOCALE_SETTINGS_POS_TOP_RIGHT, LOCALE_SETTINGS_RESTORE, LOCALE_SETTINGS_RESTORE_WARN, + LOCALE_SHOUTCAST_DEV_ID, LOCALE_SHUTDOWN_RECORDING_QUERY, LOCALE_SHUTDOWNTIMER_ANNOUNCE, LOCALE_SLEEPTIMERBOX_ANNOUNCE, @@ -2391,6 +2397,7 @@ typedef enum LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_VOLUMEBAR, + LOCALE_TMDB_API_KEY, LOCALE_TMDB_READ_DATA, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, @@ -2498,6 +2505,7 @@ typedef enum LOCALE_WIZARD_WELCOME_TEXT, LOCALE_WORD_FROM, LOCALE_WORD_IN, + LOCALE_YOUTUBE_DEV_ID, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0fd4b7260..d74e1d96a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1206,6 +1206,7 @@ const char * locale_real_names[] = "menu.hint_misc_epg", "menu.hint_misc_filebrowser", "menu.hint_misc_general", + "menu.hint_misc_onlineservices", "menu.hint_misc_zapit", "menu.hint_movie", "menu.hint_moviebrowser_setup", @@ -1418,6 +1419,7 @@ const char * locale_real_names[] = "menu.hint_service", "menu.hint_service_scan", "menu.hint_settings", + "menu.hint_shoutcast_dev_id", "menu.hint_show_mute_icon", "menu.hint_shutdown", "menu.hint_shutdown_count", @@ -1445,6 +1447,7 @@ const char * locale_real_names[] = "menu.hint_timeouts", "menu.hint_timers", "menu.hint_timezone", + "menu.hint_tmdb_api_key", "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", @@ -1482,6 +1485,7 @@ const char * locale_real_names[] = "menu.hint_volume_size", "menu.hint_webtv_setup", "menu.hint_window_size", + "menu.hint_youtube_dev_id", "menu.hint_ytplay", "menu.hint_ytplay_setup", "menu.hint_zap_cycle", @@ -1560,6 +1564,7 @@ const char * locale_real_names[] = "miscsettings.infobar_show_sysfs_hdd", "miscsettings.infobar_show_tuner", "miscsettings.infoclock", + "miscsettings.onlineservices", "miscsettings.progressbar", "miscsettings.progressbar_color", "miscsettings.progressbar_design", @@ -2272,6 +2277,7 @@ const char * locale_real_names[] = "settings.pos_top_right", "settings.restore", "settings.restore_warn", + "shoutcast.dev_id", "shutdown.recording_query", "shutdowntimer.announce", "sleeptimerbox.announce", @@ -2391,6 +2397,7 @@ const char * locale_real_names[] = "timing.menu", "timing.numericzap", "timing.volumebar", + "tmdb.api_key", "tmdb.read_data", "unicable.lnb", "unicable.qrg", @@ -2498,6 +2505,7 @@ const char * locale_real_names[] = "wizard.welcome_text", "word.from", "word.in", + "youtube.dev_id", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", From c128b2950b5d1052fed4d5f29e480b49e1fdda3e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 Aug 2016 23:11:17 +0200 Subject: [PATCH 435/690] allow to disable online services w/o cleaning the keys Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/db896847b95c5cd4ce932ebecde04aaa315b34bb Author: vanhofen Date: 2016-08-08 (Mon, 08 Aug 2016) Origin message was: ------------------ - allow to disable online services w/o cleaning the keys --- data/locale/deutsch.locale | 6 ++++++ data/locale/english.locale | 6 ++++++ src/gui/miscsettings_menu.cpp | 25 ++++++++++++++++++++++--- src/gui/miscsettings_menu.h | 3 +++ src/neutrino.cpp | 12 +++++++++--- src/system/locals.h | 6 ++++++ src/system/locals_intern.h | 6 ++++++ src/system/setting_helpers.h | 6 ++++++ 8 files changed, 64 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 44b6e7395..69415ead2 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1393,6 +1393,7 @@ menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung un menu.hint_service_scan Automatischer / manueller Service Suchlauf menu.hint_settings Konfigurieren von Neutrino-HD,\nNetzwerk, Video, Audio, OSD und mehr menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus +menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll menu.hint_shutdown Setzen Sie Ihre Box in den Standby-Modus oder schalten Sie die Box komplett aus menu.hint_shutdown_count Die Zeit zum Herunterfahren in den Deep-Standby, wenn die Box im Standby-Modus ist @@ -1421,6 +1422,7 @@ menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofe menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus menu.hint_tmdb_api_key Geben Sie den TMDb API Schlüssel ein. Eine leere Eingabe schaltet die TMDb-Unterstützung aus +menu.hint_tmdb_enabled Schaltet die TMDb-Unterstützung (themoviedb.org) ein bzw. aus menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um @@ -1459,6 +1461,7 @@ menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige menu.hint_webtv_setup Hier konfigurierte WebTV-Kanäle finden Sie in der Kanalverwaltung. menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert menu.hint_youtube_dev_id Geben Sie die YouTube Dev ID ein. Eine leere Eingabe schaltet die YouTube-Unterstützung aus +menu.hint_youtube_enabled Schaltet die YouTube-Unterstützung ein oder aus menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann @@ -2251,6 +2254,7 @@ settings.pos_top_right oben rechts settings.restore Image-Einstellungen: Wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast-Unterstützung shutdown.recording_query Aufnahme läuft. Trotzdem beenden? shutdowntimer.announce Die Box wird in 1 Min. heruntergefahren.\nShutdown abbrechen? sleeptimerbox.announce Die Box wird in 1 Min. in Standby-Betrieb gehen.\nStandby-Betrieb abbrechen? @@ -2371,6 +2375,7 @@ timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel +tmdb.enabled TMDb-Unterstützung tmdb.read_data Suche TMDB Daten... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz @@ -2479,6 +2484,7 @@ wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgend word.from ab word.in in youtube.dev_id YouTube Dev ID +youtube.enabled YouTube-Unterstützung zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio diff --git a/data/locale/english.locale b/data/locale/english.locale index f8b74ca44..fcb0d0f56 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1393,6 +1393,7 @@ menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan menu.hint_settings Configure Neutrino-HD\nNetwork, audio, video, OSD and more menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support +menu.hint_shoutcast_enabled Enable or disable SHOUTcast support menu.hint_show_mute_icon Show mute icon, when volume set to 0 menu.hint_shutdown Put your box in deep standby mode\nNo confirmation menu.hint_shutdown_count Time to put box in deep-standby\nfrom soft-standby mode @@ -1421,6 +1422,7 @@ menu.hint_timeouts Configure time to hide GUI windows\nin seconds menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone menu.hint_tmdb_api_key Type your TMDb API key. An empty input disables TMDb support +menu.hint_tmdb_enabled Enable or disable TMDb support (themoviedb.org) menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode @@ -1459,6 +1461,7 @@ menu.hint_volume_size Select volume indicator height menu.hint_webtv_setup WebTV channels configured here will be available in the standard channel lists. menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor menu.hint_youtube_dev_id Type your YouTube Dev ID. An empty input disables YouTube support +menu.hint_youtube_enabled Enable or disable YouTube support menu.hint_ytplay Play selected youtube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet @@ -2251,6 +2254,7 @@ settings.pos_top_right top right settings.restore Image-Settings: Restore settings.restore_warn This will replace all settings and reboot\nContinue ? shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast support shutdown.recording_query You really want to to stop record ? shutdowntimer.announce Box will shutdown in 1 min.\nCancel Shutdown ? sleeptimerbox.announce Box will standby in 1 min.\nCancel Standby ? @@ -2371,6 +2375,7 @@ timing.menu Menu timing.numericzap Numeric Zap timing.volumebar Volume bar tmdb.api_key TMDb API key +tmdb.enabled TMDb support tmdb.read_data Search TMDB Data... unicable.lnb Unicable Input unicable.qrg Unicable Frequency @@ -2479,6 +2484,7 @@ wizard.welcome_text Next steps will guide you through initial installation of th word.from from word.in in youtube.dev_id YouTube Dev ID +youtube.enabled YouTube support zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 206de09de..b76adc465 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -552,18 +552,34 @@ int CMiscMenue::showMiscSettingsMenuOnlineServices() CMenuWidget *ms_oservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES); ms_oservices->addIntroItems(LOCALE_MISCSETTINGS_ONLINESERVICES); + tmdb_onoff = new CMenuOptionChooser(LOCALE_TMDB_ENABLED, &g_settings.tmdb_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_tmdb_api_key()); + tmdb_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_ENABLED); + ms_oservices->addItem(tmdb_onoff); + changeNotify(LOCALE_TMDB_API_KEY, NULL); CKeyboardInput tmdb_api_key_input(LOCALE_TMDB_API_KEY, &g_settings.tmdb_api_key, 32, this); CMenuForwarder *mf = new CMenuForwarder(LOCALE_TMDB_API_KEY, true, tmdb_api_key_short, &tmdb_api_key_input); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_API_KEY); ms_oservices->addItem(mf); + ms_oservices->addItem(GenericMenuSeparator); + + youtube_onoff = new CMenuOptionChooser(LOCALE_YOUTUBE_ENABLED, &g_settings.youtube_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_youtube_dev_id()); + youtube_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_ENABLED); + ms_oservices->addItem(youtube_onoff); + changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); ms_oservices->addItem(mf); + ms_oservices->addItem(GenericMenuSeparator); + + shoutcast_onoff = new CMenuOptionChooser(LOCALE_SHOUTCAST_ENABLED, &g_settings.shoutcast_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_shoutcast_dev_id()); + shoutcast_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_ENABLED); + ms_oservices->addItem(shoutcast_onoff); + changeNotify(LOCALE_SHOUTCAST_DEV_ID, NULL); CKeyboardInput shoutcast_dev_id_input(LOCALE_SHOUTCAST_DEV_ID, &g_settings.shoutcast_dev_id, 16, this); mf = new CMenuForwarder(LOCALE_SHOUTCAST_DEV_ID, true, shoutcast_dev_id_short, &shoutcast_dev_id_input); @@ -633,27 +649,30 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_TMDB_API_KEY)) { - g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); + g_settings.tmdb_enabled = check_tmdb_api_key(); if (g_settings.tmdb_enabled) tmdb_api_key_short = g_settings.tmdb_api_key.substr(0, 8) + "..."; else tmdb_api_key_short.clear(); + tmdb_onoff->setActive(g_settings.tmdb_enabled); } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_YOUTUBE_DEV_ID)) { - g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); + g_settings.youtube_enabled = check_youtube_dev_id(); if (g_settings.youtube_enabled) youtube_dev_id_short = g_settings.youtube_dev_id.substr(0, 8) + "..."; else youtube_dev_id_short.clear(); + youtube_onoff->setActive(g_settings.youtube_enabled); } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SHOUTCAST_DEV_ID)) { - g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); if (g_settings.shoutcast_enabled) shoutcast_dev_id_short = g_settings.shoutcast_dev_id.substr(0, 8) + "..."; else shoutcast_dev_id_short.clear(); + shoutcast_onoff->setActive(g_settings.shoutcast_enabled); } return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 22f6f25e4..8e5848ef8 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -46,6 +46,9 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser * epg_save_frequently; CMenuOptionChooser * epg_read; CMenuOptionChooser * epg_scan; + CMenuOptionChooser * tmdb_onoff; + CMenuOptionChooser * youtube_onoff; + CMenuOptionChooser * shoutcast_onoff; CMenuForwarder * epg_dir; int width; std::string epg_cache; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8ed7d9051..b185cd004 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -803,14 +803,17 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); - g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); + g_settings.shoutcast_enabled = configfile.getInt32("shoutcast_enabled", 1); + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); + g_settings.youtube_enabled = configfile.getInt32("youtube_enabled", 1); + g_settings.youtube_enabled = check_youtube_dev_id(); g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); + g_settings.tmdb_enabled = configfile.getInt32("tmdb_enabled", 1); + g_settings.tmdb_enabled = check_tmdb_api_key(); //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); @@ -1310,11 +1313,14 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); configfile.setString( "shoutcast_dev_id", g_settings.shoutcast_dev_id ); + configfile.setInt32( "shoutcast_enabled", g_settings.shoutcast_enabled ); //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); configfile.setString( "youtube_dev_id", g_settings.youtube_dev_id ); + configfile.setInt32( "youtube_enabled", g_settings.youtube_enabled ); configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key ); + configfile.setInt32( "tmdb_enabled", g_settings.tmdb_enabled ); //Filebrowser configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); diff --git a/src/system/locals.h b/src/system/locals.h index 8d2865671..bda6f7548 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1420,6 +1420,7 @@ typedef enum LOCALE_MENU_HINT_SERVICE_SCAN, LOCALE_MENU_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_DEV_ID, + LOCALE_MENU_HINT_SHOUTCAST_ENABLED, LOCALE_MENU_HINT_SHOW_MUTE_ICON, LOCALE_MENU_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN_COUNT, @@ -1448,6 +1449,7 @@ typedef enum LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, LOCALE_MENU_HINT_TMDB_API_KEY, + LOCALE_MENU_HINT_TMDB_ENABLED, LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, @@ -1486,6 +1488,7 @@ typedef enum LOCALE_MENU_HINT_WEBTV_SETUP, LOCALE_MENU_HINT_WINDOW_SIZE, LOCALE_MENU_HINT_YOUTUBE_DEV_ID, + LOCALE_MENU_HINT_YOUTUBE_ENABLED, LOCALE_MENU_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP, LOCALE_MENU_HINT_ZAP_CYCLE, @@ -2278,6 +2281,7 @@ typedef enum LOCALE_SETTINGS_RESTORE, LOCALE_SETTINGS_RESTORE_WARN, LOCALE_SHOUTCAST_DEV_ID, + LOCALE_SHOUTCAST_ENABLED, LOCALE_SHUTDOWN_RECORDING_QUERY, LOCALE_SHUTDOWNTIMER_ANNOUNCE, LOCALE_SLEEPTIMERBOX_ANNOUNCE, @@ -2398,6 +2402,7 @@ typedef enum LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, + LOCALE_TMDB_ENABLED, LOCALE_TMDB_READ_DATA, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, @@ -2506,6 +2511,7 @@ typedef enum LOCALE_WORD_FROM, LOCALE_WORD_IN, LOCALE_YOUTUBE_DEV_ID, + LOCALE_YOUTUBE_ENABLED, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d74e1d96a..cee08f36a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1420,6 +1420,7 @@ const char * locale_real_names[] = "menu.hint_service_scan", "menu.hint_settings", "menu.hint_shoutcast_dev_id", + "menu.hint_shoutcast_enabled", "menu.hint_show_mute_icon", "menu.hint_shutdown", "menu.hint_shutdown_count", @@ -1448,6 +1449,7 @@ const char * locale_real_names[] = "menu.hint_timers", "menu.hint_timezone", "menu.hint_tmdb_api_key", + "menu.hint_tmdb_enabled", "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", @@ -1486,6 +1488,7 @@ const char * locale_real_names[] = "menu.hint_webtv_setup", "menu.hint_window_size", "menu.hint_youtube_dev_id", + "menu.hint_youtube_enabled", "menu.hint_ytplay", "menu.hint_ytplay_setup", "menu.hint_zap_cycle", @@ -2278,6 +2281,7 @@ const char * locale_real_names[] = "settings.restore", "settings.restore_warn", "shoutcast.dev_id", + "shoutcast.enabled", "shutdown.recording_query", "shutdowntimer.announce", "sleeptimerbox.announce", @@ -2398,6 +2402,7 @@ const char * locale_real_names[] = "timing.numericzap", "timing.volumebar", "tmdb.api_key", + "tmdb.enabled", "tmdb.read_data", "unicable.lnb", "unicable.qrg", @@ -2506,6 +2511,7 @@ const char * locale_real_names[] = "word.from", "word.in", "youtube.dev_id", + "youtube.enabled", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index 98be19f84..1c23a2ddc 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -33,6 +33,7 @@ */ +#include #include #include @@ -149,4 +150,9 @@ class CAutoModeNotifier : public CChangeObserver bool changeNotify(const neutrino_locale_t, void * data); }; +//do we need a class? +inline int check_shoutcast_dev_id() { return ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); } +inline int check_youtube_dev_id() { return ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); } +inline int check_tmdb_api_key() { return ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); } + #endif From 58dda090b9e6297be1a3dab7d9ec48e411fcc1f4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 Aug 2016 23:40:09 +0200 Subject: [PATCH 436/690] locals: pay attention to upper/lower case for online services Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ccca6c1af7c823eb8488abdd1cac4b168642c0e Author: vanhofen Date: 2016-08-08 (Mon, 08 Aug 2016) Origin message was: ------------------ - locals: pay attention to upper/lower case for online services --- data/locale/deutsch.locale | 12 ++++++------ data/locale/english.locale | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 69415ead2..438e61587 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -157,7 +157,7 @@ audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen audioplayer.add_ic Icecast audioplayer.add_loc Lokale Radioliste -audioplayer.add_sc Shoutcast +audioplayer.add_sc SHOUTcast audioplayer.artist_title Interpret, Titel audioplayer.building_search_index Erstelle Suchindex audioplayer.button_select_title_by_id Suche n. ID @@ -166,7 +166,7 @@ audioplayer.defdir Start-Verz. audioplayer.delete entfernen audioplayer.deleteall Alle entfernen audioplayer.display_order Anzeige -audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing +audioplayer.enable_sc_metadata Aktiviere SHOUTcast Meta-Daten Parsing audioplayer.fastforward schneller Vorl. audioplayer.follow Selektiere akt. Track audioplayer.head Audio Playlist @@ -1179,7 +1179,7 @@ menu.hint_misc_energy Energieverbrauchs- und Standby-Optionen, verzögertes Auss menu.hint_misc_epg Diverse EPG-Einstellungen und Speicherverzeichnis für EPG-Daten menu.hint_misc_filebrowser Dateisystem, Dateirechte anzeigen im Dateibrowser, Startverzeichnisoptionen menu.hint_misc_general Standby-, Teletext- und Rotor-Einstellungen, Pluginverzeichnis auf externem Datenträger -menu.hint_misc_onlineservices Konfigurieren und steuern von Online-Diensten wie YouTube, ShoutCast und TMDb +menu.hint_misc_onlineservices Konfigurieren und steuern von Online-Diensten wie YouTube, SHOUTCast und TMDb menu.hint_misc_zapit Verwaltung der Start-Kanäle für den TV/Radio-Modus menu.hint_movie Wiedergabe von Filmen menu.hint_moviebrowser_setup Legen Sie Auswahl- und Anzeigeoptionen des MovieBrowsers fest @@ -1462,7 +1462,7 @@ menu.hint_webtv_setup Hier konfigurierte WebTV-Kanäle finden Sie in der Kanalve menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert menu.hint_youtube_dev_id Geben Sie die YouTube Dev ID ein. Eine leere Eingabe schaltet die YouTube-Unterstützung aus menu.hint_youtube_enabled Schaltet die YouTube-Unterstützung ein oder aus -menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds +menu.hint_ytplay Wiedergabe von ausgewählten YouTube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann menu.next Weiter @@ -1778,7 +1778,7 @@ moviebrowser.yt_cancel_transfer Download abbrechen? moviebrowser.yt_clear Liste leeren moviebrowser.yt_completed Vollständige Downloads moviebrowser.yt_concurrent_connections Gleichzeitige Verbindungen -moviebrowser.yt_error Fehler beim Laden des Youtube-Feeds +moviebrowser.yt_error Fehler beim Laden des YouTube-Feeds moviebrowser.yt_failed Fehlgeschlagene Downloads moviebrowser.yt_history Frühere Suchen moviebrowser.yt_max_history Max. Anzahl früherer Suchen @@ -1823,7 +1823,7 @@ movieplayer.tshelp7 ca. 1 Minute vor movieplayer.tshelp8 ca. 5 Minuten zurück movieplayer.tshelp9 ca. 5 Minuten vor movieplayer.tsplayback TS Abspielen -movieplayer.ytplayback Youtube-Feed Wiedergabe +movieplayer.ytplayback YouTube-Feed Wiedergabe mpkey.audio Tonspuren mpkey.bookmark Markierungen mpkey.forward Vorlauf diff --git a/data/locale/english.locale b/data/locale/english.locale index fcb0d0f56..67a634264 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -157,7 +157,7 @@ audiomenu.volume_step Volume step audioplayer.add Add audioplayer.add_ic Icecast audioplayer.add_loc Local radio list -audioplayer.add_sc Shoutcast +audioplayer.add_sc SHOUTcast audioplayer.artist_title Artist, Title audioplayer.building_search_index building search index audioplayer.button_select_title_by_id search by ID @@ -166,7 +166,7 @@ audioplayer.defdir start dir. audioplayer.delete Remove audioplayer.deleteall remove all audioplayer.display_order display order -audioplayer.enable_sc_metadata enable shoutcast meta data parsing +audioplayer.enable_sc_metadata enable SHOUTcast meta data parsing audioplayer.fastforward fast forw. audioplayer.follow auto select current audioplayer.head Audio Playlist @@ -1179,7 +1179,7 @@ menu.hint_misc_energy Enable soft-standby, delayed shutdown\ninactivity timers menu.hint_misc_epg Save/load EPG options, EPG cache options\nEPG save directory menu.hint_misc_filebrowser Filesystem encoding, file rights\ndeny directory leave menu.hint_misc_general Start to standby, cache teletext, swp rotor\nplugin hdd dir -menu.hint_misc_onlineservices Configure and control online services like YouTube, ShoutCast and TMDb +menu.hint_misc_onlineservices Configure and control online services like YouTube, SHOUTCast and TMDb menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies menu.hint_moviebrowser_setup Set selection and display options. @@ -1462,7 +1462,7 @@ menu.hint_webtv_setup WebTV channels configured here will be available in the st menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor menu.hint_youtube_dev_id Type your YouTube Dev ID. An empty input disables YouTube support menu.hint_youtube_enabled Enable or disable YouTube support -menu.hint_ytplay Play selected youtube feeds +menu.hint_ytplay Play selected YouTube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet menu.next Next @@ -1778,7 +1778,7 @@ moviebrowser.yt_cancel_transfer Cancel download? moviebrowser.yt_clear Clear moviebrowser.yt_completed Completed downloads moviebrowser.yt_concurrent_connections Concurrent connections -moviebrowser.yt_error Failed to load youtube feed +moviebrowser.yt_error Failed to load YouTube feed moviebrowser.yt_failed Failed downloads moviebrowser.yt_history Search history moviebrowser.yt_max_history Max search history size @@ -1823,7 +1823,7 @@ movieplayer.tshelp7 skip approx. 1 minute movieplayer.tshelp8 approx. 5 minutes back movieplayer.tshelp9 skip approx. 5 minutes movieplayer.tsplayback Play TS -movieplayer.ytplayback Youtube videoplayer +movieplayer.ytplayback YouTube videoplayer mpkey.audio Audiotracks mpkey.bookmark Bookmarks mpkey.forward Forward From 29b2eab29085c879a0bccd9884b37f96e6cb93dd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Aug 2016 14:13:19 +0200 Subject: [PATCH 437/690] epgview: add extended movie info; code from movieinfo.cpp comment out unused showMovieInfo() in movieinfo.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/766c4fd9c85f21787c06881f5087c1bfaff743a6 Author: vanhofen Date: 2016-08-09 (Tue, 09 Aug 2016) Origin message was: ------------------ - epgview: add extended movie info; code from movieinfo.cpp comment out unused showMovieInfo() in movieinfo.cpp --- src/gui/epgview.cpp | 152 +++++++++++++++++++++++++++++++++++---- src/gui/epgview.h | 1 + src/gui/moviebrowser.cpp | 6 +- src/gui/movieinfo.cpp | 3 +- src/gui/movieinfo.h | 2 + src/gui/movieplayer.cpp | 2 +- 6 files changed, 145 insertions(+), 21 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9d8f6deb7..df2818164 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -529,7 +529,121 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m #else epgData.contentClassification = 0; #endif - epgData.epg_times.dauer = mp_movie_info->length; + epgData.epg_times.dauer = mp_movie_info->length * 60; // we need the seconds + + extMovieInfo.clear(); + if ( !mp_movie_info->productionCountry.empty() || mp_movie_info->productionDate != 0) + { + extMovieInfo += mp_movie_info->productionCountry; + extMovieInfo += to_string(mp_movie_info->productionDate + 1900); + extMovieInfo += "\n"; + } + if (!mp_movie_info->serieName.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SERIE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->serieName; + extMovieInfo += "\n"; + } + if (!mp_movie_info->epgChannel.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->epgChannel; + extMovieInfo += "\n"; + } + if (mp_movie_info->rating != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RATING); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->rating / 10); + extMovieInfo += ","; + extMovieInfo += to_string(mp_movie_info->rating % 10); + extMovieInfo += "/10"; + extMovieInfo += "\n"; + } + if (mp_movie_info->quality != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->quality); + extMovieInfo += "\n"; + } + if (mp_movie_info->parentalLockAge != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->parentalLockAge); + extMovieInfo += " "; + extMovieInfo += g_Locale->getText(LOCALE_UNIT_LONG_YEARS); + extMovieInfo += "\n"; + } + if (!mp_movie_info->audioPids.empty()) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); + extMovieInfo += ": "; + for (unsigned int i = 0; i < mp_movie_info->audioPids.size(); i++) + { + if (i) + extMovieInfo += ", "; + extMovieInfo += mp_movie_info->audioPids[i].epgAudioPidName; + } + extMovieInfo += "\n"; + } + if (mp_movie_info->genreMajor != 0) + { + neutrino_locale_t locale_genre; + unsigned char i = (mp_movie_info->genreMajor & 0x0F0); + if (i >= 0x010 && i < 0x0B0) + { + i >>= 4; + i--; + locale_genre = genre_sub_classes_list[i][((mp_movie_info->genreMajor & 0x0F) < genre_sub_classes[i]) ? (mp_movie_info->genreMajor & 0x0F) : 0]; + } + else + locale_genre = LOCALE_GENRE_UNKNOWN; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); + extMovieInfo += ": "; + extMovieInfo += g_Locale->getText(locale_genre); + extMovieInfo += "\n"; + } + + extMovieInfo += "\n"; + + tm *date_tm = localtime(&mp_movie_info->dateOfLastPlay); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + date_tm = localtime(&mp_movie_info->file.Time); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RECORDDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + extMovieInfo += "\n"; + + if (mp_movie_info->file.Size != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->file.Size >> 20); + extMovieInfo += "\n"; + } + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PATH); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getPath(); + extMovieInfo += "\n"; + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_FILE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getFileName(); + extMovieInfo += "\n"; + res = show(mp_movie_info->epgEpgId >>16, 0, 0, doLoop, false,true ); if(!epgTextSwitch.empty()) mp_movie_info->epgInfo2 = epgTextSwitch; @@ -559,6 +673,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start GetEPGData(epg_id, id, &startzeit); epgTextSwitch.clear(); + if (!mp_info) + extMovieInfo.clear(); if (doLoop) { if (!bigFonts && g_settings.bigFonts) { @@ -664,7 +780,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // Add a blank line processTextToArray(""); - // 21.07.2005 - rainerk // Show extended information if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { @@ -690,20 +805,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start sprintf(lengthInfo, "%d", epgData.epg_times.dauer / 60); processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 - // Show audio information - std::string audioInfo = ""; - CSectionsdClient::ComponentTagList tags; - bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); - if (hasComponentTags) + if (!mp_info) { - for (unsigned int i = 0; i < tags.size(); i++) - if (tags[i].streamContent == 2 && !tags[i].component.empty()) - audioInfo += tags[i].component + ", "; - - if (!audioInfo.empty()) + // Show audio information + std::string audioInfo = ""; + CSectionsdClient::ComponentTagList tags; + bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); + if (hasComponentTags) { - audioInfo.erase(audioInfo.size()-2); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + for (unsigned int i = 0; i < tags.size(); i++) + if (tags[i].streamContent == 2 && !tags[i].component.empty()) + audioInfo += tags[i].component + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } } } @@ -720,13 +838,17 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // -- display more screenings on the same channel // -- 2002-05-03 rasc has_follow_screenings = false; - if (hasFollowScreenings(channel_id, epgData.title)) { + if (!mp_info && hasFollowScreenings(channel_id, epgData.title)) { processTextToArray(""); // UTF-8 processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_MORE_SCREENINGS)) + ':'); // UTF-8 FollowScreenings(channel_id, epgData.title); has_follow_screenings = true; } + // show extended movie info + if (mp_info && !extMovieInfo.empty()) + processTextToArray(extMovieInfo); + COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 1b23af3f3..17b423ffe 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -81,6 +81,7 @@ class CEpgData std::vector epgText; std::vector epgText_saved; std::string epgTextSwitch; + std::string extMovieInfo; int topheight,topboxheight; int buttonheight,botboxheight; int medlineheight,medlinecount; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index b83284a7d..052ceceae 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1949,10 +1949,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - if (m_settings.gui == MB_GUI_MOVIE_INFO && m_windowFocus == MB_FOCUS_MOVIE_INFO) - g_EpgData->show_mp(m_movieSelectionHandler,0,0); - else - m_movieInfo.showMovieInfo(*m_movieSelectionHandler); + framebuffer->paintBackground(); //clear whole screen + g_EpgData->show_mp(m_movieSelectionHandler, 0, 0); refresh(); } } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 7b104ba5e..47cb242da 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -395,6 +395,7 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) /************************************************************************ ************************************************************************/ +#if 0 void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) { std::string print_buffer = movie_info.epgInfo1; @@ -818,7 +819,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info #endif return (false); } - +#endif /************************************************************************ ************************************************************************/ diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index c3dfc4040..312557fae 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -202,7 +202,9 @@ class CMovieInfo bool loadMovieInfo(MI_MOVIE_INFO* movie_info, CFile* file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead bool encodeMovieInfoXml(std::string* extMessage, MI_MOVIE_INFO * movie_info); // encode the movie_info structure to xml string bool saveMovieInfo(MI_MOVIE_INFO& movie_info, CFile* file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead +#if 0 void showMovieInfo(MI_MOVIE_INFO& movie_info); // open a Hintbox and show the movie info +#endif void printDebugMovieInfo(MI_MOVIE_INFO& movie_info); // print movie info on debug channel (RS232) bool addNewBookmark(MI_MOVIE_INFO* movie_info,MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 42d127be8..b72b52559 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2160,7 +2160,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); } else if (p_movie_info) - cMovieInfo.showMovieInfo(*p_movie_info); + g_EpgData->show_mp(p_movie_info,0,0); CInfoClock::getInstance()->enableInfoClock(true); if (restore) { From 608c7c9b35bca3cf7d9ab6ef12f7549dfd661424 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Aug 2016 15:56:19 +0200 Subject: [PATCH 438/690] movieinfo: move #endif to right place Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/34b03c246f33a91f110db86830cad41948a09347 Author: vanhofen Date: 2016-08-09 (Tue, 09 Aug 2016) Origin message was: ------------------ - movieinfo: move #endif to right place --- src/gui/movieinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 47cb242da..c154ac2b3 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -509,7 +509,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) ShowMsg2UTF(movie_info.epgTitle.empty()? movie_info.file.getFileName().c_str() : movie_info.epgTitle.c_str(), print_buffer.c_str(), CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8*/ } - +#endif /************************************************************************ ************************************************************************/ @@ -819,7 +819,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info #endif return (false); } -#endif + /************************************************************************ ************************************************************************/ From 2df1d9d786076fc1c443ff6b0f4f3869acf5189a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Aug 2016 17:48:56 +0200 Subject: [PATCH 439/690] tmdb: cleanup from unused code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/81fa43435e01cf2fb7d8f5f0230ec4d58c8ea31a Author: vanhofen Date: 2016-08-09 (Tue, 09 Aug 2016) Origin message was: ------------------ - tmdb: cleanup from unused code --- src/gui/tmdb.cpp | 57 ------------------------------------------------ src/gui/tmdb.h | 6 ----- 2 files changed, 63 deletions(-) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index f295d2dbe..0b8556440 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -54,19 +54,8 @@ cTmdb::cTmdb(std::string epgtitle) { - frameBuffer = CFrameBuffer::getInstance(); minfo.epgtitle = epgtitle; curl_handle = curl_easy_init(); - form = NULL; - - ox = frameBuffer->getScreenWidthRel(false); - oy = frameBuffer->getScreenHeightRel(false); - - int buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; - toph = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight() + 6; - - sx = getScreenStartX(ox); - sy = getScreenStartY(oy + buttonheight); /* button box is handled separately (why?) */ #ifdef TMDB_API_KEY key = TMDB_API_KEY; @@ -91,7 +80,6 @@ cTmdb::cTmdb(std::string epgtitle) cTmdb::~cTmdb() { curl_easy_cleanup(curl_handle); - delete form; } size_t cTmdb::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) @@ -306,48 +294,3 @@ std::string cTmdb::CreateEPGText() epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ minfo.cast+"\n"; return epgtext; } - -void cTmdb::exec() -{ - neutrino_msg_t msg; - neutrino_msg_data_t data; - - if (form == NULL) - form = new CComponentsForm(); - form->setDimensionsAll(sx, sy, ox, oy); - - CComponentsHeader *header = new CComponentsHeader(0, 0, ox, toph); - CComponentsText *headerText = new CComponentsText(15, 0, ox-15, toph, getTitle(), CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);; - headerText->doPaintBg(false); - headerText->setTextColor(COL_MENUHEAD_TEXT); - form->addCCItem(header); - form->addCCItem(headerText); - - - CComponentsPicture *ptmp = new CComponentsPicture(5, toph+5, "/tmp/tmdb.jpg"); - ptmp->setWidth(342); - ptmp->setHeight(513); - ptmp->setColorBody(COL_BLUE); - ptmp->setCorner(RADIUS_MID, CORNER_TOP_LEFT); - form->addCCItem(ptmp); - - CComponentsText *des = new CComponentsText(ptmp->getWidth()+10, toph+5, form->getWidth()-ptmp->getWidth()-10, form->getHeight(), CreateEPGText(), CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS | CTextBox::TOP); - des->setCorner(RADIUS_MID, CORNER_BOTTOM_RIGHT); - des->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]); - form->addCCItem(des); - - form->paint(); - frameBuffer->blit(); - - while (1) { - g_RCInput->getMsg(&msg, &data, 100); - if (msg == CRCInput::RC_home) - break; - } - - if (form->isPainted()) { - form->hide(); - delete form; - form = NULL; - } -} diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index d9f8929d6..6675955f4 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -24,7 +24,6 @@ #include #include -#include typedef struct { std::string epgtitle; @@ -49,12 +48,8 @@ class cTmdb { private: CURL *curl_handle; - CComponentsForm *form; tmdbinfo minfo; - CFrameBuffer *frameBuffer; - int ox, oy, sx, sy, toph; - static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); std::string encodeUrl(std::string txt); std::string decodeUrl(std::string url); @@ -66,7 +61,6 @@ class cTmdb public: cTmdb(std::string epgtitle); ~cTmdb(); - void exec(); std::string CreateEPGText(); std::string getTitle() { return minfo.epgtitle;} From 6685d79c8eda06619a295bebb632e2b729c6da75 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 9 Aug 2016 17:55:09 +0200 Subject: [PATCH 440/690] add missing blits Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb73d09ac30217d4b4bad94aef8f60ecd762a50b Author: TangoCash Date: 2016-08-09 (Tue, 09 Aug 2016) --- src/gui/moviebrowser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 052ceceae..aa3b69736 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1040,6 +1040,7 @@ int CMovieBrowser::exec(const char* path) uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); while (loop) { + framebuffer->blit(); g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); result = onButtonPress(msg); @@ -1127,6 +1128,7 @@ int CMovieBrowser::exec(const char* path) timeoutEnd = CRCInput::calcTimeoutEnd(timeout); // calcualate next timeout } hide(); + framebuffer->blit(); //TRACE(" return %d\n",res); m_prevBrowserSelection = m_currentBrowserSelection; From d18df6d118d11e862901b007ab13dd7908784ed1 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 9 Aug 2016 17:45:12 +0200 Subject: [PATCH 441/690] fix fading from moviebrowser Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c0f3e908fffadf46514c2056509b91722622746d Author: TangoCash Date: 2016-08-09 (Tue, 09 Aug 2016) --- src/gui/epgview.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index df2818164..f0795c2d6 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -941,6 +941,12 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start switch ( msg ) { case NeutrinoMessages::EVT_TIMER: + if (data == fader.GetFadeTimer()) { + if (fader.FadeDone()) + loop = false; + } + else + CNeutrinoApp::getInstance()->handleMsg(msg, data); if (!mp_info) { if (data == g_InfoViewer->getUpdateTimer()) { @@ -953,12 +959,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start pb.paint(false); } } - if (data == fader.GetFadeTimer()) { - if (fader.FadeDone()) - loop = false; - } - else - CNeutrinoApp::getInstance()->handleMsg(msg, data); } break; case NeutrinoMessages::EVT_CURRENTNEXT_EPG: From 30621ed39fd411ca9b39601d5a2b7de525aa6b6c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 9 Aug 2016 18:39:07 +0200 Subject: [PATCH 442/690] fix epgview channelogo (from moviebrowser) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0040a2129320f87f15f9f4468b6522aeb28cc5d9 Author: TangoCash Date: 2016-08-09 (Tue, 09 Aug 2016) --- src/gui/epgview.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f0795c2d6..ecd2efb9b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -700,13 +700,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int logo_w = 0; int logo_h = 0; int logo_w_max = ox / 4; - if(channel) { - if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel->getName(), lname, &logo_w, &logo_h)) { - if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); - } - pic_offx = logo_w + 10; + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, g_Zapit->getChannelName(channel_id), lname, &logo_w, &logo_h)) { + if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); } + pic_offx = logo_w + 10; } int pos; From 72f5f12ba14a1529246af382717be42079df9c14 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 9 Aug 2016 19:02:39 +0200 Subject: [PATCH 443/690] fix position channellogo in moviebrowser Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/23d3b61e0a680bbd95e13a112876f4723180a44e Author: TangoCash Date: 2016-08-09 (Tue, 09 Aug 2016) --- src/gui/moviebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index aa3b69736..d33b8b5f0 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1377,7 +1377,7 @@ void CMovieBrowser::refreshMovieInfo(void) //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; - short pb_hdd_offset = 104; + short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; From 3202d2731939fd22979b2fb7b76877d8ee190158 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 10 Aug 2016 12:17:16 +0200 Subject: [PATCH 444/690] epgview: fix content of small bottom box in movieplayer mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/99de005c68f02e1a5278a9d24b8f3ab21c15aaa7 Author: vanhofen Date: 2016-08-10 (Wed, 10 Aug 2016) Origin message was: ------------------ - epgview: fix content of small bottom box in movieplayer mode --- src/gui/epgview.cpp | 108 ++++++++++++++++++++++---------------------- src/gui/epgview.h | 1 + 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ecd2efb9b..ccbeaa602 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -663,8 +663,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start tmdb_active = false; stars = 0; - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); - t_channel_id epg_id = channel_id; CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if (channel) @@ -875,47 +873,43 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (headerPic) headerPic->paint(CC_SAVE_SCREEN_NO); - //show date-time.... - frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); - std::string fromto; - int widthl,widthr; - fromto = epg_start; - fromto += " - "; - fromto += epg_end; - - widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+40, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); - widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); - int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); + + // small bottom box + frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); + if (!mp_info) + { + static int iw = 0, ih = 0, io = 0; + if (!iw && !ih) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); + if (!io && iw) + io = iw + 10; + + std::string fromto = epg_start + " - " + epg_end; + + int widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+10+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); + int widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-10-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); + + GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); + if (!call_fromfollowlist) + { + int iy = sy + oy - botboxheight + (botboxheight - iw)/2; + if (prev_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 10, iy); + if (next_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy); + } + + // why we do not show movie progress? + showProgressBar(); + } + // show Timer Event Buttons showTimerEventBar(true, isCurrentEPG(channel_id), mp_info); - - //show progressbar - if (!mp_info && epg_done!= -1) - { - int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); - } - - static int iw = 0, ih = 0; - if (!iw && !ih) - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); - - GetPrevNextEPGData( epgData.eventID, &epgData.epg_times.startzeit ); - if (!call_fromfollowlist) { - int iy = sy + oy - 3 - height/2 - iw/2; - if (prev_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 5, iy); - if (next_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 5, iy); - } if ( doLoop ) { @@ -945,17 +939,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else CNeutrinoApp::getInstance()->handleMsg(msg, data); + if (!mp_info) { - if (data == g_InfoViewer->getUpdateTimer()) { + if (data == g_InfoViewer->getUpdateTimer()) + { GetEPGData(channel_id, id, &startzeit, false); - if ( epg_done!= -1 ) { - int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); - } + showProgressBar(); } } break; @@ -967,21 +957,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start CNeutrinoApp::getInstance()->handleMsg(msg, data); break; case CRCInput::RC_left: - if ((prev_id != 0) && !call_fromfollowlist) + if ((prev_id != 0) && !call_fromfollowlist && !mp_info) { - frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT_TEXT_PLUS_1); - show(channel_id, prev_id, &prev_zeit, false); showPos=0; } break; case CRCInput::RC_right: - if ((next_id != 0) && !call_fromfollowlist) + if ((next_id != 0) && !call_fromfollowlist && !mp_info) { - frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT_TEXT_PLUS_1); - show(channel_id, next_id, &next_zeit, false); showPos=0; } @@ -1433,6 +1417,22 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st return count; } +void CEpgData::showProgressBar() +{ + //show progressbar + if (epg_done != -1) + { + int w = 104; + int x = sx + (ox - w)/2; + int h = botboxheight - 12; + int y = sy + oy - botboxheight + (botboxheight - h)/2; + + CProgressBar pb(x, y, w, h); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } +} // // -- Just display or hide TimerEventbar diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 17b423ffe..884bfef26 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -94,6 +94,7 @@ class CEpgData bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); void showTimerEventBar(bool show, bool adzap = false, bool mp_info = false); + void showProgressBar(); bool isCurrentEPG(const t_channel_id channel_id); public: From 7a90c723d8d48c37b8f453b0f15d0459d7f3ec3c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 10 Aug 2016 12:58:43 +0200 Subject: [PATCH 445/690] epgview: fix bigfonts switch in movieplayer mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6875eb3f31a7ddfc3f60d6a5dacf559a2512a16 Author: vanhofen Date: 2016-08-10 (Wed, 10 Aug 2016) Origin message was: ------------------ - epgview: fix bigfonts switch in movieplayer mode --- src/gui/epgview.cpp | 12 +++++++++--- src/gui/epgview.h | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ccbeaa602..db5109c9d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -123,6 +123,7 @@ CEpgData::CEpgData() bigFonts = false; frameBuffer = CFrameBuffer::getInstance(); tmdb_active = false; + mp_movie_info = NULL; header = NULL; } @@ -503,9 +504,11 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } -int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*mp_duration*/, bool doLoop) +int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration*/, bool doLoop) { int res = menu_return::RETURN_REPAINT; + + mp_movie_info = mi; if (mp_movie_info == NULL) return res; @@ -644,7 +647,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m extMovieInfo += mp_movie_info->file.getFileName(); extMovieInfo += "\n"; - res = show(mp_movie_info->epgEpgId >>16, 0, 0, doLoop, false,true ); + res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) mp_movie_info->epgInfo2 = epgTextSwitch; return res; @@ -1217,7 +1220,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR)); } g_settings.bigFonts = bigFonts; - show(channel_id, id, &startzeit, false, call_fromfollowlist); + if (mp_info) + show(mp_movie_info->epgEpgId >> 16, 0, 0, false, false, true); + else + show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; break; case CRCInput::RC_ok: diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 884bfef26..5d18435fc 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -86,6 +86,8 @@ class CEpgData int buttonheight,botboxheight; int medlineheight,medlinecount; + MI_MOVIE_INFO *mp_movie_info; + void GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear = true ); void GetPrevNextEPGData( uint64_t id, time_t* startzeit ); void addTextToArray( const std::string & text, int screening ); @@ -103,7 +105,7 @@ class CEpgData ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); - int show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position = 1, int mp_duration = 1, bool doLoop = true); + int show_mp(MI_MOVIE_INFO *mi, int mp_position = 1, int mp_duration = 1, bool doLoop = true); void hide(); }; From e335b76b4a8e438be1412521df2afa8976d79ea5 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 10 Aug 2016 12:52:00 +0200 Subject: [PATCH 446/690] epgview: Fix save movie info Signed-off-by: svenhoefer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ad25b387e27cadd357864a77b397b3e54b57ffd Author: Michael Liebmann Date: 2016-08-10 (Wed, 10 Aug 2016) --- src/gui/epgview.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index db5109c9d..44ad2a3a1 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -649,7 +649,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration* res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) + { mp_movie_info->epgInfo2 = epgTextSwitch; + CMovieInfo m_movieInfo; + //printf("#####[%s:%d] saveMovieInfo\n", __func__, __LINE__); + m_movieInfo.saveMovieInfo(*mp_movie_info); + } return res; } From 964ad94a8726174fb032bb0a5f97bb0ff8f4ade3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 10 Aug 2016 15:53:11 +0200 Subject: [PATCH 447/690] epgview: show progressbar in movieplayer mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/de74242310e5db46f7e1f4e645ddea9cb5f78dae Author: vanhofen Date: 2016-08-10 (Wed, 10 Aug 2016) Origin message was: ------------------ - epgview: show progressbar in movieplayer mode --- src/gui/epgview.cpp | 27 +++++++++++++++++++++++---- src/gui/epgview.h | 2 +- src/gui/moviebrowser.cpp | 2 +- src/gui/movieplayer.cpp | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 44ad2a3a1..5ba2793ee 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -504,7 +505,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } -int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration*/, bool doLoop) +int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool doLoop) { int res = menu_return::RETURN_REPAINT; @@ -647,6 +648,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration* extMovieInfo += mp_movie_info->file.getFileName(); extMovieInfo += "\n"; + // this calculation is taken from timeosd.cpp + epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1; + if (epg_done > 100) + epg_done = 100; + //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); + res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) { @@ -911,10 +918,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (next_id) frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy); } - - // why we do not show movie progress? - showProgressBar(); } + showProgressBar(); // show Timer Event Buttons showTimerEventBar(true, isCurrentEPG(channel_id), mp_info); @@ -956,6 +961,20 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showProgressBar(); } } + else if (epg_done != -1) + { + CMoviePlayerGui::getInstance().UpdatePosition(); + int mp_position = CMoviePlayerGui::getInstance().GetPosition(); + int mp_duration = CMoviePlayerGui::getInstance().GetDuration(); + + // this calculation is taken from timeosd.cpp + epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1; + if (epg_done > 100) + epg_done = 100; + //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); + + showProgressBar(); + } break; case NeutrinoMessages::EVT_CURRENTNEXT_EPG: if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) { diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 5d18435fc..051efff92 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -105,7 +105,7 @@ class CEpgData ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); - int show_mp(MI_MOVIE_INFO *mi, int mp_position = 1, int mp_duration = 1, bool doLoop = true); + int show_mp(MI_MOVIE_INFO *mi, int mp_position = 0, int mp_duration = 0, bool doLoop = true); void hide(); }; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index d33b8b5f0..dc8e0b2e4 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1952,7 +1952,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if (m_movieSelectionHandler != NULL) { framebuffer->paintBackground(); //clear whole screen - g_EpgData->show_mp(m_movieSelectionHandler, 0, 0); + g_EpgData->show_mp(m_movieSelectionHandler); refresh(); } } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b72b52559..ad2f7d611 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2160,7 +2160,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); } else if (p_movie_info) - g_EpgData->show_mp(p_movie_info,0,0); + g_EpgData->show_mp(p_movie_info, position, duration); CInfoClock::getInstance()->enableInfoClock(true); if (restore) { From 416d42e2630b5e23ea64447a2983209f84d66d15 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 10 Aug 2016 16:07:16 +0200 Subject: [PATCH 448/690] moviebrowser: don't paint hdd progressbar if it's disabled by user Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4dd56385fb6771a50fe86bafb37a60260ee7669a Author: vanhofen Date: 2016-08-10 (Wed, 10 Aug 2016) Origin message was: ------------------ - moviebrowser: don't paint hdd progressbar if it's disabled by user --- src/gui/moviebrowser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index dc8e0b2e4..ee1cb9dc0 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1466,6 +1466,9 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) } } + if (paint_hdd) + paint_hdd = g_settings.infobar_show_sysfs_hdd; // don't paint if disabled by user + if (tmp_blocks_percent_used != blocks_percent_used || paint_hdd) { tmp_blocks_percent_used = blocks_percent_used; const short pbw = 100; From 298d8d811e1ba8c46ec1c2e067251f790e6e6906 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 10 Aug 2016 17:02:59 +0200 Subject: [PATCH 449/690] fix 416d42e2630b5e23ea64447a2983209f84d66d15 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddf6b6737f30506c7bce42952eb3c83948648cda Author: vanhofen Date: 2016-08-10 (Wed, 10 Aug 2016) Origin message was: ------------------ - fix 416d42e2630b5e23ea64447a2983209f84d66d15 --- src/gui/moviebrowser.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ee1cb9dc0..f3be417db 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1453,7 +1453,7 @@ void CMovieBrowser::refreshMovieInfo(void) void CMovieBrowser::info_hdd_level(bool paint_hdd) { - if (show_mode == MB_SHOW_YT) + if (show_mode == MB_SHOW_YT || !g_settings.infobar_show_sysfs_hdd) return; struct statfs s; @@ -1466,9 +1466,6 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) } } - if (paint_hdd) - paint_hdd = g_settings.infobar_show_sysfs_hdd; // don't paint if disabled by user - if (tmp_blocks_percent_used != blocks_percent_used || paint_hdd) { tmp_blocks_percent_used = blocks_percent_used; const short pbw = 100; From b175c9e6db6340828a97b703e954215eb817bb86 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Aug 2016 00:56:57 +0200 Subject: [PATCH 450/690] epgview: fix display of mp_movie_info->productionDate Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5885500e5f834b5dd68cac1376036b2a1952ec06 Author: vanhofen Date: 2016-08-11 (Thu, 11 Aug 2016) Origin message was: ------------------ - epgview: fix display of mp_movie_info->productionDate --- src/gui/epgview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5ba2793ee..f3a0be051 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -539,7 +539,8 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool if ( !mp_movie_info->productionCountry.empty() || mp_movie_info->productionDate != 0) { extMovieInfo += mp_movie_info->productionCountry; - extMovieInfo += to_string(mp_movie_info->productionDate + 1900); + extMovieInfo += " "; + extMovieInfo += to_string(mp_movie_info->productionDate); extMovieInfo += "\n"; } if (!mp_movie_info->serieName.empty()) From 7a1f95dcfa7eaca229e45edab8bc5a6ea308e9ab Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Aug 2016 11:47:00 +0200 Subject: [PATCH 451/690] movieinfo: cleanup from unused code; reformat code; no binary changes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b3b4ba4d12cc95b2614df158cdd75e06fd5f30d Author: vanhofen Date: 2016-08-11 (Thu, 11 Aug 2016) Origin message was: ------------------ - movieinfo: cleanup from unused code; reformat code; no binary changes --- src/gui/movieinfo.cpp | 474 ++++++------------------------------------ src/gui/movieinfo.h | 251 ++++++++++------------ 2 files changed, 171 insertions(+), 554 deletions(-) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index c154ac2b3..608a4789b 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -1,14 +1,10 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project +/* + movieinfo - Neutrino-GUI - Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2005 Günther - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Copyright (C) 2009, 2012 Stefan Seyfried + Copyright (C) 2015 Sven Hoefer (svenhoefer) License: GPL @@ -26,20 +22,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - *********************************************************** +*/ - Module Name: movieinfo.cpp . - - Description: Implementation of the CMovieInfo class - This class loads, saves and shows the movie Information from the any .xml File on HD - - Date: Nov 2005 - - Author: Günther@tuxbox.berlios.org - - Copyright(C) 2009, 2012 Stefan Seyfried - -****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif @@ -56,30 +40,19 @@ #include -// #define XMLTREE_LIB -#ifdef XMLTREE_LIB -#include -#include -#endif #define TRACE printf -/************************************************************************ - -************************************************************************/ CMovieInfo::CMovieInfo() { - //TRACE("[mi] new\r\n"); + //TRACE("[mi] new\n"); } CMovieInfo::~CMovieInfo() { - //TRACE("[mi] del\r\n"); + //TRACE("[mi] del\n"); ; } -/************************************************************************ - -************************************************************************/ bool CMovieInfo::convertTs2XmlName(std::string& filename) { size_t lastdot = filename.find_last_of("."); @@ -91,9 +64,6 @@ bool CMovieInfo::convertTs2XmlName(std::string& filename) return false; } -/************************************************************************ - -************************************************************************/ static void XML_ADD_TAG_STRING(std::string &_xml_text_, const char *_tag_name_, std::string _tag_content_) { _xml_text_ += "\t\t<"; @@ -127,31 +97,9 @@ static void XML_ADD_TAG_LONG(std::string &_xml_text_, const char *_tag_name_, ui _xml_text_ += ">\n"; } -#if 0 -std::string decodeXmlSpecialChars(std::string s); - -static void XML_GET_DATA_STRING(XMLTreeNode *_node_, const char *_tag_, std::string &_string_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()) - _string_dest_ = decodeXmlSpecialChars(_node_->GetData()); -} - -static void XML_GET_DATA_INT(XMLTreeNode *_node_, const char *_tag_, int _int_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()) - _int_dest_ = atoi(_node_->GetData()); -} - -static void XML_GET_DATA_LONG(XMLTreeNode *_node_, const char *_tag_,long int _int_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()); - sscanf(_node_->GetData(), "%llu", &_int_dest_); -} -#endif - bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * movie_info) { - //TRACE("[mi]->encodeMovieInfoXml\r\n"); + //TRACE("[mi]->encodeMovieInfoXml\n"); *extMessage = "\n\n" "<" MI_XML_TAG_NEUTRINO " commandversion=\"1\">\n" @@ -163,14 +111,14 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); //%d - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); // %d + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { *extMessage += "\t\t<" MI_XML_TAG_AUDIOPIDS ">\n"; - for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() + for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() { *extMessage += "\t\t\t<" MI_XML_TAG_AUDIO " " MI_XML_TAG_PID "=\""; *extMessage += to_string(movie_info->audioPids[i].epgAudioPid); @@ -184,9 +132,8 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo } *extMessage += "\t\t\n"; } - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); //%u - /***************************************************** - * new tags */ + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_SERIE_NAME, movie_info->serieName); @@ -223,12 +170,11 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo return true; } -/************************************************************************ -************************************************************************/ bool CMovieInfo::saveMovieInfo(MI_MOVIE_INFO & movie_info, CFile * file) { - //TRACE("[mi]->saveXml \r\n"); + //TRACE("[mi]->saveMovieInfo\n"); + bool result = true; std::string text; CFile file_xml; @@ -239,35 +185,35 @@ bool CMovieInfo::saveMovieInfo(MI_MOVIE_INFO & movie_info, CFile * file) } else { file_xml.Name = file->Name; } - TRACE("[mi] saveXml: %s\r\n", file_xml.Name.c_str()); + TRACE("[mi] saveMovieInfo: %s\n", file_xml.Name.c_str()); if (result == true) { result = encodeMovieInfoXml(&text, &movie_info); if (result == true) { result = saveFile(file_xml, text); // save if (result == false) { - TRACE("[mi] saveXml: save error\r\n"); + TRACE("[mi] saveMovieInfo: save error\n"); } } else { - TRACE("[mi] saveXml: encoding error\r\n"); + TRACE("[mi] saveMovieInfo: encoding error\n"); } } else { - TRACE("[mi] saveXml: error\r\n"); + TRACE("[mi] saveMovieInfo: error\n"); } return (result); } -/************************************************************************ -************************************************************************/ bool CMovieInfo::loadMovieInfo(MI_MOVIE_INFO * movie_info, CFile * file) { - //TRACE("[mi]->loadMovieInfo \r\n"); + //TRACE("[mi]->loadMovieInfo\n"); + bool result = true; CFile file_xml; if (file == NULL) { - // if there is no give file, we use the file name from movie info but we have to convert the ts name to xml name first + // if there is no give file, we use the file name from movie info + // but we have to convert the ts name to xml name first file_xml.Name = movie_info->file.Name; result = convertTs2XmlName(file_xml.Name); } else { @@ -278,296 +224,15 @@ bool CMovieInfo::loadMovieInfo(MI_MOVIE_INFO * movie_info, CFile * file) // load xml file in buffer std::string text; result = loadFile(file_xml, text); - if (result == true) { -#ifdef XMLTREE_LIB + if (result == true) result = parseXmlTree(text, movie_info); -#else /* XMLTREE_LIB */ - result = parseXmlQuickFix(text, movie_info); -#endif /* XMLTREE_LIB */ - } } - if (movie_info->productionDate > 50 && movie_info->productionDate < 200) // backwardcompaibility + if (movie_info->productionDate > 50 && movie_info->productionDate < 200) // backwardcompaibility movie_info->productionDate += 1900; return (result); } -/************************************************************************ - -************************************************************************/ -#if 0 -//never used -bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) -{ -#ifndef XMLTREE_LIB - return (false); // no XML lib available return false -#else /* XMLTREE_LIB */ - - //int helpIDtoLoad = 80; - - //XMLTreeParser *parser=new XMLTreeParser("ISO-8859-1"); - XMLTreeParser *parser = new XMLTreeParser(NULL); - - if (!parser->Parse(text, strlen(text), 1)) { - TRACE("parse error: %s at line %d \r\n", parser->ErrorString(parser->GetErrorCode()), parser->GetCurrentLineNumber()); - //fclose(in); - delete parser; - return (false); - } - - XMLTreeNode *root = parser->RootNode(); - if (!root) { - TRACE(" root error \r\n"); - delete parser; - return (false); - } - - if (strcmp(root->GetType(), MI_XML_TAG_NEUTRINO)) { - TRACE("not neutrino file. %s", root->GetType()); - delete parser; - return (false); - } - - XMLTreeNode *node = parser->RootNode(); - - for (node = node->GetChild(); node; node = node->GetNext()) { - if (!strcmp(node->GetType(), MI_XML_TAG_RECORD)) { - for (XMLTreeNode * xam1 = node->GetChild(); xam1; xam1 = xam1->GetNext()) { - XML_GET_DATA_STRING(xam1, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_GET_DATA_LONG(xam1, MI_XML_TAG_ID, movie_info->epgId); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_INFO1, movie_info->epgInfo1); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_GET_DATA_LONG(xam1, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_GET_DATA_INT(xam1, MI_XML_TAG_MODE, movie_info->epgMode); //%d - XML_GET_DATA_INT(xam1, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u - XML_GET_DATA_INT(xam1, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u - if (!strcmp(xam1->GetType(), MI_XML_TAG_AUDIOPIDS)) { - for (XMLTreeNode * xam2 = xam1->GetChild(); xam2; xam2 = xam2->GetNext()) { - if (!strcmp(xam2->GetType(), MI_XML_TAG_AUDIO)) { - EPG_AUDIO_PIDS pids; - pids.epgAudioPid = atoi(xam2->GetAttributeValue(MI_XML_TAG_PID)); - pids.atype = atoi(xam2->GetAttributeValue(MI_XML_TAG_ATYPE)); - pids.selected = atoi(xam2->GetAttributeValue(MI_XML_TAG_SELECTED)); - pids.epgAudioPidName = decodeXmlSpecialChars(xam2->GetAttributeValue(MI_XML_TAG_NAME)); -//printf("MOVIE INFO: apid %d type %d name %s selected %d\n", pids.epgAudioPid, pids.atype, pids.epgAudioPidName.c_str(), pids.selected); - movie_info->audioPids.push_back(pids); - } - } - } - XML_GET_DATA_INT(xam1, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); //%u - /***************************************************** - * new tags */ - XML_GET_DATA_INT(xam1, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); - XML_GET_DATA_INT(xam1, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_SERIE_NAME, movie_info->serieName); - XML_GET_DATA_INT(xam1, MI_XML_TAG_LENGTH, movie_info->length); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); - //if(!strcmp(xam1->GetType(), MI_XML_TAG_PRODUCT_COUNTRY)) if(xam1->GetData() != NULL)strncpy(movie_info->productionCountry, xam1->GetData(),4); - XML_GET_DATA_INT(xam1, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); - XML_GET_DATA_INT(xam1, MI_XML_TAG_RATING, movie_info->rating); - XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITIY, movie_info->quality); - XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITY, movie_info->quality); - XML_GET_DATA_INT(xam1, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); - XML_GET_DATA_INT(xam1, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay); - - if (!strcmp(xam1->GetType(), MI_XML_TAG_BOOKMARK)) { - for (XMLTreeNode * xam2 = xam1->GetChild(); xam2; xam2 = xam2->GetNext()) { - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_START, movie_info->bookmarks.start); - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end); - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop); - } - } - /*****************************************************/ - } - } - } - - delete parser; - if (movie_info->epgInfo2.empty()) { - movie_info->epgInfo2 = movie_info->epgInfo1; - //movie_info->epgInfo1 = ""; - } -#endif /* XMLTREE_LIB */ - return (true); -} -#endif -/************************************************************************ - -************************************************************************/ -#if 0 -void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) -{ - std::string print_buffer = movie_info.epgInfo1; - print_buffer += "\n"; - if (movie_info.epgInfo1 != movie_info.epgInfo2) { - print_buffer += movie_info.epgInfo2; - print_buffer += "\n"; - } - - if ( !movie_info.productionCountry.empty() || movie_info.productionDate != 0) { - print_buffer += movie_info.productionCountry; - print_buffer += to_string(movie_info.productionDate + 1900); - print_buffer += "\n"; - } - if (!movie_info.serieName.empty()) { - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SERIE); - print_buffer += ": "; - print_buffer += movie_info.serieName; - print_buffer += "\n"; - } - if (!movie_info.epgChannel.empty()) { - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); - print_buffer += ": "; - print_buffer += movie_info.epgChannel; - print_buffer += "\n"; - } - if (movie_info.rating != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RATING); - print_buffer += ": "; - print_buffer += to_string(movie_info.rating / 10); - print_buffer += ","; - print_buffer += to_string(movie_info.rating % 10); - print_buffer += "/10"; - print_buffer += "\n"; - } - if (movie_info.quality != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); - print_buffer += ": "; - print_buffer += to_string(movie_info.quality); - print_buffer += "\n"; - } - if (movie_info.parentalLockAge != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE); - print_buffer += ": "; - print_buffer += to_string(movie_info.parentalLockAge); - print_buffer += " "; - print_buffer += g_Locale->getText(LOCALE_UNIT_LONG_YEARS); - print_buffer += "\n"; - } - if (movie_info.length != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_LENGTH); - print_buffer += ": "; - print_buffer += to_string(movie_info.length); - print_buffer += "\n"; - } - if ( !movie_info.audioPids.empty() ) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); - print_buffer += ": "; - for (unsigned int i = 0; i < movie_info.audioPids.size(); i++) { - if (i) - print_buffer += ", "; - print_buffer += movie_info.audioPids[i].epgAudioPidName; - } - print_buffer += "\n"; - } - if (movie_info.genreMajor != 0) - { - neutrino_locale_t locale_genre; - unsigned char i = (movie_info.genreMajor & 0x0F0); - if (i >= 0x010 && i < 0x0B0) - { - i >>= 4; - i--; - locale_genre = genre_sub_classes_list[i][((movie_info.genreMajor & 0x0F) < genre_sub_classes[i]) ? (movie_info.genreMajor & 0x0F) : 0]; - } - else - locale_genre = LOCALE_GENRE_UNKNOWN; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); - print_buffer += ": "; - print_buffer += g_Locale->getText(locale_genre); - print_buffer += "\n"; - } - - tm *date_tm = localtime(&movie_info.dateOfLastPlay); - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE); - print_buffer += ": "; - print_buffer += strftime("%F", date_tm); - print_buffer += "\n"; - - date_tm = localtime(&movie_info.file.Time); - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RECORDDATE); - print_buffer += ": "; - print_buffer += strftime("%F", date_tm); - print_buffer += "\n"; - - if (movie_info.file.Size != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); - print_buffer += ": "; - print_buffer += to_string(movie_info.file.Size >> 20); - print_buffer += "\n"; - } - - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_FILE); - print_buffer += ": "; - print_buffer += movie_info.file.Name; - print_buffer += "\n"; - - ShowMsg2UTF(movie_info.epgTitle.empty()? movie_info.file.getFileName().c_str() : movie_info.epgTitle.c_str(), print_buffer.c_str(), CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8*/ - -} -#endif -/************************************************************************ - -************************************************************************/ -#if 0 -//never used -void CMovieInfo::printDebugMovieInfo(MI_MOVIE_INFO & movie_info) -{ - TRACE(" FileName: %s", movie_info.file.Name.c_str()); - //TRACE(" FilePath: %s", movie_info.file.GetFilePath ); - //TRACE(" FileLength: %d", movie_info.file.GetLength ); - //TRACE(" FileStatus: %d", movie_info.file.GetStatus ); - - TRACE(" ********** Movie Data ***********\r\n"); // (date, month, year) - TRACE(" dateOfLastPlay: \t%d\r\n", (int)movie_info.dateOfLastPlay); // (date, month, year) - TRACE(" dirItNr: \t\t%d\r\n", movie_info.dirItNr); // - TRACE(" genreMajor: \t\t%d\r\n", movie_info.genreMajor); //genreMajor; - TRACE(" genreMinor: \t\t%d\r\n", movie_info.genreMinor); //genreMinor; - TRACE(" length: \t\t%d\r\n", movie_info.length); // (minutes) - TRACE(" rating: \t\t%d,%d\r\n", movie_info.rating / 10, movie_info.rating % 10); // user rating (like IMDb rating; 75 means 7.5/10) - TRACE(" quality: \t\t%d\r\n", movie_info.quality); // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - TRACE(" productionCount:\t>%s<\r\n", movie_info.productionCountry.c_str()); - TRACE(" productionDate: \t%d\r\n", movie_info.productionDate); // (Year) years since 1900 - TRACE(" parentalLockAge: \t\t\t%d\r\n", movie_info.parentalLockAge); // MI_PARENTAL_LOCKAGE (0,6,12,16,18) - TRACE(" format: \t\t%d\r\n", movie_info.format); // MI_VIDEO_FORMAT(16:9, 4:3) - TRACE(" audio: \t\t%d\r\n", movie_info.audio); // MI_AUDIO (AC3, Deutsch, Englisch) - TRACE(" epgId: \t\t%d\r\n", (int)movie_info.epgId); - TRACE(" epgEpgId: \t\t%llu\r\n", movie_info.epgEpgId); - TRACE(" epgMode: \t\t%d\r\n", movie_info.epgMode); - TRACE(" epgVideoPid: \t\t%d\r\n", movie_info.epgVideoPid); - TRACE(" epgVTXPID: \t\t%d\r\n", movie_info.epgVTXPID); - TRACE(" Size: \t\t%d\r\n", (int)movie_info.file.Size >> 20); - TRACE(" Date: \t\t%d\r\n", (int)movie_info.file.Time); - - for (unsigned int i = 0; i < movie_info.audioPids.size(); i++) { - TRACE(" audioPid (%d): \t\t%d\r\n", i, movie_info.audioPids[i].epgAudioPid); - TRACE(" audioName(%d): \t\t>%s<\r\n", i, movie_info.audioPids[i].epgAudioPidName.c_str()); - } - - TRACE(" epgTitle: \t\t>%s<\r\n", movie_info.epgTitle.c_str()); - TRACE(" epgInfo1:\t\t>%s<\r\n", movie_info.epgInfo1.c_str()); //epgInfo1 - TRACE(" epgInfo2:\t\t\t>%s<\r\n", movie_info.epgInfo2.c_str()); //epgInfo2 - TRACE(" epgChannel:\t\t>%s<\r\n", movie_info.epgChannel.c_str()); - TRACE(" serieName:\t\t>%s<\r\n", movie_info.serieName.c_str()); // (name e.g. 'StarWars) - - TRACE(" bookmarks start: \t%d\r\n", movie_info.bookmarks.start); - TRACE(" bookmarks end: \t%d\r\n", movie_info.bookmarks.end); - TRACE(" bookmarks lastPlayStop: %d\r\n", movie_info.bookmarks.lastPlayStop); - - for (int i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { - if (movie_info.bookmarks.user[i].pos != 0 || i == 0) { - TRACE(" bookmarks user, pos:%d, type:%d, name: >%s<\r\n", movie_info.bookmarks.user[i].pos, movie_info.bookmarks.user[i].length, movie_info.bookmarks.user[i].name.c_str()); - } - } -} -#endif -/************************************************************************ - -************************************************************************/ static int find_next_char(char to_find, const char *text, int start_pos, int end_pos) { while (start_pos < end_pos) { @@ -607,14 +272,13 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end _pos_ += sizeof(_tag_) ;\ int pos_prev = _pos_;\ while(_pos_ < bytes && _text_[_pos_] != '<' ) pos++;\ - _dest_ = strtoull(&_text_[pos_prev], NULL, 10); /*atoll(&_text_[pos_prev]);*/\ + _dest_ = strtoull(&_text_[pos_prev], NULL, 10);\ continue;\ } -//void CMovieInfo::strReplace(std::string& orig, const char* fstr, const std::string rstr) -void strReplace(std::string & orig, const char *fstr, const std::string &rstr) +void strReplace(std::string &orig, const char *fstr, const std::string &rstr) { -// replace all occurrence of fstr with rstr and, and returns a reference to itself + // replace all occurrence of fstr with rstr and returns a reference to itself size_t index = 0; size_t fstrlen = strlen(fstr); size_t rstrlen = rstr.size(); @@ -637,18 +301,15 @@ std::string decodeXmlSpecialChars(std::string s) return s; } - /************************************************************************ -************************************************************************/ -bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info) +bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) { -#ifndef XMLTREE_LIB int bookmark_nr = 0; - movie_info->dateOfLastPlay = 0; //100*366*24*60*60; // (date, month, year) + movie_info->dateOfLastPlay = 0; //100*366*24*60*60; // (date, month, year) //bool result = false; const char *text = _text.c_str(); int bytes = _text.length(); - /** search ****/ + int pos = 0; EPG_AUDIO_PIDS audio_pids; @@ -756,10 +417,10 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info } /* parse bookmarks */ GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_START, movie_info->bookmarks.start) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop) - if (bookmark_nr < MI_MOVIE_BOOK_USER_MAX) { + if (bookmark_nr < MI_MOVIE_BOOK_USER_MAX) { if (strncmp(&text[pos], MI_XML_TAG_BOOKMARK_USER, sizeof(MI_XML_TAG_BOOKMARK_USER) - 1) == 0) { pos += sizeof(MI_XML_TAG_BOOKMARK_USER); //int pos2 = strcspn(&text[pos],MI_XML_TAG_BOOKMARK_USER_POS); @@ -816,16 +477,13 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info } return (true); -#endif - return (false); } -/************************************************************************ -************************************************************************/ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bookmark) { - TRACE("[mi] addNewBookmark\r\n"); + TRACE("[mi] addNewBookmark\n"); + bool result = false; if (movie_info != NULL) { // search for free entry @@ -854,9 +512,6 @@ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bo return (result); } -/************************************************************************ - -************************************************************************/ void MI_MOVIE_INFO::clear(void) { @@ -870,19 +525,19 @@ void MI_MOVIE_INFO::clear(void) file.Name = ""; file.Url = ""; - file.Size = 0; // Megabytes + file.Size = 0; // Megabytes file.Time = mktime(&timePlay); - dateOfLastPlay = mktime(&timePlay); // (date, month, year) - dirItNr = 0; // - genreMajor = 0; //genreMajor; - genreMinor = 0; //genreMinor; - length = 0; // (minutes) - rating = 0; // (like IMDb rating) - quality = 0; // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - productionDate = 0; // (Year) years since 1900 - parentalLockAge = 0; // MI_PARENTAL_LOCKAGE (0,6,12,16,18) -// format = 0; // MI_VIDEO_FORMAT(16:9, 4:3) -// audio = 0; // MI_AUDIO (AC3, Deutsch, Englisch) + dateOfLastPlay = mktime(&timePlay); + dirItNr = 0; + genreMajor = 0; + genreMinor = 0; + length = 0; + rating = 0; + quality = 0; + productionDate = 0; + parentalLockAge = 0; + //format = 0; + //audio = 0; epgId = 0; epgEpgId = 0; @@ -895,10 +550,10 @@ void MI_MOVIE_INFO::clear(void) productionCountry = ""; epgTitle = ""; - epgInfo1 = ""; //epgInfo1 - epgInfo2 = ""; //epgInfo2 + epgInfo1 = ""; + epgInfo2 = ""; epgChannel = ""; - serieName = ""; // (name e.g. 'StarWars) + serieName = ""; bookmarks.end = 0; bookmarks.start = 0; bookmarks.lastPlayStop = 0; @@ -908,24 +563,23 @@ void MI_MOVIE_INFO::clear(void) bookmarks.user[i].name = ""; } tfile = ""; + ytdate = ""; ytid = ""; ytitag = 0; + marked = false; delAsk = true; } -/************************************************************************ - -************************************************************************/ -bool CMovieInfo::loadFile(CFile & file, std::string &buffer) +bool CMovieInfo::loadFile(CFile &file, std::string &buffer) { bool result = true; int fd = open(file.Name.c_str(), O_RDONLY); - if (fd == -1) // cannot open file, return!!!!! + if (fd == -1) { - TRACE("[mi] loadXml: cannot open (%s)\r\n", file.Name.c_str()); + TRACE("[mi] loadFile: cannot open (%s)\n", file.Name.c_str()); return false; } struct stat st; @@ -935,7 +589,7 @@ bool CMovieInfo::loadFile(CFile & file, std::string &buffer) } char buf[st.st_size]; if (st.st_size != read(fd, buf, st.st_size)) { - TRACE("[mi] loadXml: cannot read (%s)\r\n", file.Name.c_str()); + TRACE("[mi] loadFile: cannot read (%s)\n", file.Name.c_str()); result = false; } else buffer = std::string(buf, st.st_size); @@ -945,22 +599,18 @@ bool CMovieInfo::loadFile(CFile & file, std::string &buffer) return result; } -/************************************************************************ - -************************************************************************/ bool CMovieInfo::saveFile(const CFile & file, std::string &text) { bool result = false; int fd; if ((fd = open(file.Name.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) >= 0) { - /*int nr=*/ write(fd, text.c_str(), text.size()); //fdatasync(fd); close(fd); result = true; - //TRACE("[mi] saved (%d)\r\n",nr); + //TRACE("[mi] saved (%d)\n",nr); } else { - TRACE("[mi] ERROR: cannot open\r\n"); + TRACE("[mi] ERROR: cannot open\n"); } return (result); } diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 312557fae..eaa943d66 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -1,15 +1,8 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project - - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. +/* + movieinfo - Neutrino-GUI + Copyright (C) 2005 Günther + Copyright (C) 2015 Sven Hoefer (svenhoefer) License: GPL @@ -27,21 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - *********************************************************** - - Module Name: movieinfo.h . - - Description: implementation of the CMovieInfo class - - Date: Nov 2005 - - Author: Günther@tuxbox.berlios.org - - Revision History: - Date Author Change Description - Nov 2005 Günther initial start - -****************************************************************************/ +*/ #ifndef MOVIEINFO_H_ #define MOVIEINFO_H_ @@ -57,137 +36,132 @@ #include #include "driver/file.h" -/************************************************************************/ -/************************************************************************/ -/***************** CMovieInfo ********************************/ -/************************************************************************/ - - /* XML tags for xml file*/ -#define MI_XML_TAG_NEUTRINO "neutrino" -#define MI_XML_TAG_RECORD "record" - -#define MI_XML_TAG_CHANNELNAME "channelname" -#define MI_XML_TAG_EPGTITLE "epgtitle" -#define MI_XML_TAG_ID "id" -#define MI_XML_TAG_INFO1 "info1" -#define MI_XML_TAG_INFO2 "info2" -#define MI_XML_TAG_EPGID "epgid" -#define MI_XML_TAG_MODE "mode" -#define MI_XML_TAG_VIDEOPID "videopid" -#define MI_XML_TAG_VIDEOTYPE "videotype" -#define MI_XML_TAG_AUDIOPIDS "audiopids" -#define MI_XML_TAG_AUDIO "audio" -#define MI_XML_TAG_PID "pid" -#define MI_XML_TAG_NAME "name" -#define MI_XML_TAG_ATYPE "audiotype" -#define MI_XML_TAG_SELECTED "selected" -#define MI_XML_TAG_VTXTPID "vtxtpid" -#define MI_XML_TAG_GENRE_MAJOR "genremajor" -#define MI_XML_TAG_GENRE_MINOR "genreminor" -#define MI_XML_TAG_SERIE_NAME "seriename" -#define MI_XML_TAG_LENGTH "length" -#define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" -#define MI_XML_TAG_PRODUCT_DATE "productiondate" +#define MI_XML_TAG_NEUTRINO "neutrino" +#define MI_XML_TAG_RECORD "record" +#define MI_XML_TAG_CHANNELNAME "channelname" +#define MI_XML_TAG_EPGTITLE "epgtitle" +#define MI_XML_TAG_ID "id" +#define MI_XML_TAG_INFO1 "info1" +#define MI_XML_TAG_INFO2 "info2" +#define MI_XML_TAG_EPGID "epgid" +#define MI_XML_TAG_MODE "mode" +#define MI_XML_TAG_VIDEOPID "videopid" +#define MI_XML_TAG_VIDEOTYPE "videotype" +#define MI_XML_TAG_AUDIOPIDS "audiopids" +#define MI_XML_TAG_AUDIO "audio" +#define MI_XML_TAG_PID "pid" +#define MI_XML_TAG_NAME "name" +#define MI_XML_TAG_ATYPE "audiotype" +#define MI_XML_TAG_SELECTED "selected" +#define MI_XML_TAG_VTXTPID "vtxtpid" +#define MI_XML_TAG_GENRE_MAJOR "genremajor" +#define MI_XML_TAG_GENRE_MINOR "genreminor" +#define MI_XML_TAG_SERIE_NAME "seriename" +#define MI_XML_TAG_LENGTH "length" +#define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" +#define MI_XML_TAG_PRODUCT_DATE "productiondate" #define MI_XML_TAG_RATING "rating" -#define MI_XML_TAG_QUALITY "quality" -#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files +#define MI_XML_TAG_QUALITY "quality" +#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files #define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage" -#define MI_XML_TAG_BOOKMARK "bookmark" +#define MI_XML_TAG_BOOKMARK "bookmark" #define MI_XML_TAG_BOOKMARK_START "bookmarkstart" -#define MI_XML_TAG_BOOKMARK_END "bookmarkend" +#define MI_XML_TAG_BOOKMARK_END "bookmarkend" #define MI_XML_TAG_BOOKMARK_LAST "bookmarklast" #define MI_XML_TAG_BOOKMARK_USER "bookmarkuser" #define MI_XML_TAG_BOOKMARK_USER_POS "bookmarkuserpos" #define MI_XML_TAG_BOOKMARK_USER_TYPE "bookmarkusertype" #define MI_XML_TAG_BOOKMARK_USER_NAME "bookmarkusername" -#define MI_XML_TAG_DATE_OF_LAST_PLAY "dateoflastplay" +#define MI_XML_TAG_DATE_OF_LAST_PLAY "dateoflastplay" - -#define MI_MAX_AUDIO_PIDS 4 // just to avoid the buffer is filled endless, might be increased later on , but 4 audio pids might be enough -#define MI_MOVIE_BOOK_USER_MAX 20 // just to avoid the buffer is filled endless, might be increased later on. Make sure to increase the bookmark menu as well +#define MI_MAX_AUDIO_PIDS 4 // just to avoid the buffer is filled endless, might be increased later on , but 4 audio pids might be enough +#define MI_MOVIE_BOOK_USER_MAX 20 // just to avoid the buffer is filled endless, might be increased later on. Make sure to increase the bookmark menu as well typedef enum { - MI_PARENTAL_OVER0 = 0, - MI_PARENTAL_OVER6 = 6, - MI_PARENTAL_OVER12 = 12, - MI_PARENTAL_OVER16 = 16, - MI_PARENTAL_OVER18 = 18, - MI_PARENTAL_ALWAYS = 99, - MI_PARENTAL_MAX_NUMBER = 100 -}MI_PARENTAL_LOCKAGE; + MI_PARENTAL_OVER0 = 0, + MI_PARENTAL_OVER6 = 6, + MI_PARENTAL_OVER12 = 12, + MI_PARENTAL_OVER16 = 16, + MI_PARENTAL_OVER18 = 18, + MI_PARENTAL_ALWAYS = 99, + MI_PARENTAL_MAX_NUMBER = 100 +} MI_PARENTAL_LOCKAGE; typedef struct { - int pos; // position in seconds from file start - int length; // bookmark type, 0: just a bookmark, < 0 jump back (seconds), > 0 jump forward (seconds) - std::string name; // bookmark name to be displayed -}MI_BOOKMARK; + int pos; // position in seconds from file start + int length; // bookmark type, 0: just a bookmark, < 0 jump back (seconds), > 0 jump forward (seconds) + std::string name; // bookmark name to be displayed +} MI_BOOKMARK; typedef struct { - int start; // movie start in seconds from file start - int end; // movie end in seconds from file start + int start; // movie start in seconds from file start + int end; // movie end in seconds from file start int lastPlayStop; // position of last play stop in seconds from file start MI_BOOKMARK user[MI_MOVIE_BOOK_USER_MAX]; // other user defined bookmarks -}MI_MOVIE_BOOKMARKS; +} MI_MOVIE_BOOKMARKS; typedef struct { int atype; int selected; - int epgAudioPid; // epg audio pid nr, usually filled by VCR - std::string epgAudioPidName; // epg audio pid name, usually filled by VCR -}EPG_AUDIO_PIDS; + int epgAudioPid; // epg audio pid nr, usually filled by VCR + std::string epgAudioPidName; // epg audio pid name, usually filled by VCR +} EPG_AUDIO_PIDS; -/************************************************************************/ -/************************************************************************/ - -class MI_MOVIE_INFO +class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); { - public: - //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); - CFile file; // not stored in xml - std::string productionCountry; // user defined Country (not from EPG yet, but might be possible) - std::string epgTitle; // plain movie name, usually filled by EPG - std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG - std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string epgChannel; // Channel name, usually filled by EPG - std::string serieName; // user defines series name + public: + CFile file; // not stored in xml + std::string productionCountry; // user defined Country (not from EPG yet, but might be possible) + std::string epgTitle; // plain movie name, usually filled by EPG + std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG + std::string epgInfo2; // detailed movie content, usually filled by EPG + std::string epgChannel; // Channel name, usually filled by EPG + std::string serieName; // user defines series name - time_t dateOfLastPlay; // last play date of movie in seconds since 1970 - int dirItNr; // handle for quick directory path access only, this is not saved in xml, might be used by the owner of the movie info struct - int genreMajor; // see showEPG class for more info, usually filled by EPG - char genreMinor; // genreMinor not used so far - int length; // movie length in minutes, usually filled by EPG - int rating; // user rating (like IMDb rating; 75 means 7.5/10) - int quality; // user classification (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - int productionDate; // user defined Country (not from EPG yet, but might be possible) - int parentalLockAge; // used for age rating(0:never,6,12,16,18 years,99:always), usually filled by EPG (if available) - //char format; // currently not used - //char audio; // currently not used - MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie - std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] + time_t dateOfLastPlay; // last play date of movie in seconds since 1970 + int dirItNr; // handle for quick directory path access only, this is not saved in xml, might be used by the owner of the movie info struct + int genreMajor; // see showEPG class for more info, usually filled by EPG + char genreMinor; // genreMinor not used so far + int length; // movie length in minutes, usually filled by EPG + int rating; // user rating (like IMDb rating; 75 means 7.5/10) + int quality; // user classification (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) + int productionDate; // user defined Country (not from EPG yet, but might be possible) + int parentalLockAge; // used for age rating(0:never,6,12,16,18 years,99:always), usually filled by EPG (if available) + //char format; // currently not used + //char audio; // currently not used + MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie + std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] - uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed - uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed - int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed - int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed - int VideoType; - int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed - bool marked; - bool delAsk; - std::string tfile; // thumbnail/cover file name - std::string ytdate; // yt published - std::string ytid; // yt published - int ytitag; // youtube quality profile + uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed + int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed + int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed + int VideoType; + int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed - enum miSource { UNKNOWN = 0, YT, NK }; - miSource source; + bool marked; + bool delAsk; - void clear(void); - MI_MOVIE_INFO() { clear(); } + std::string tfile; // thumbnail/cover file name + + std::string ytdate; // youtube published + std::string ytid; // youtube published + int ytitag; // youtube quality profile + + enum miSource { + UNKNOWN = 0, + YT, + NK + }; + miSource source; + + void clear(void); + MI_MOVIE_INFO() { clear(); } }; typedef std::vector MI_MOVIE_LIST; @@ -198,23 +172,16 @@ class CMovieInfo public: // Functions CMovieInfo(); ~CMovieInfo(); - bool convertTs2XmlName(std::string& filename); // convert a ts file name in .xml file name - bool loadMovieInfo(MI_MOVIE_INFO* movie_info, CFile* file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead - bool encodeMovieInfoXml(std::string* extMessage, MI_MOVIE_INFO * movie_info); // encode the movie_info structure to xml string - bool saveMovieInfo(MI_MOVIE_INFO& movie_info, CFile* file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead -#if 0 - void showMovieInfo(MI_MOVIE_INFO& movie_info); // open a Hintbox and show the movie info -#endif - void printDebugMovieInfo(MI_MOVIE_INFO& movie_info); // print movie info on debug channel (RS232) - bool addNewBookmark(MI_MOVIE_INFO* movie_info,MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned - - private:// Functions - bool parseXmlTree (std::string &text, MI_MOVIE_INFO* movie_info); // this is the 'good' function, but it needs the xmllib which is not currently linked within neutrino. Might be to slow as well. If used, add bookmark parsing - bool parseXmlQuickFix(std::string &text, MI_MOVIE_INFO* movie_info); // OK, this is very quick an dirty. It does not waste execution time or flash (this is QUICK). But, do not play to much with the xml files (e.g. with MS Notepad) since small changes in the structure could cause the parser to fail (this it DIRTY). - bool loadFile(CFile& file, std::string &buffer); - bool saveFile(const CFile& file, std::string &buffer); - private:// variables + bool convertTs2XmlName(std::string &filename); // convert a ts file name in .xml file name + bool loadMovieInfo(MI_MOVIE_INFO *movie_info, CFile *file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead + bool encodeMovieInfoXml(std::string *extMessage, MI_MOVIE_INFO *movie_info); // encode the movie_info structure to xml string + bool saveMovieInfo(MI_MOVIE_INFO &movie_info, CFile *file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead + bool addNewBookmark(MI_MOVIE_INFO *movie_info, MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned + + private: // Functions + bool parseXmlTree(std::string &text, MI_MOVIE_INFO *movie_info); + bool loadFile(CFile &file, std::string &buffer); + bool saveFile(const CFile &file, std::string &buffer); }; #endif /*MOVIEINFO_H_*/ -// vim:ts=4 From 3aed41316b16eb001e3dfaa93cf9bc77226d1954 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 11 Aug 2016 12:29:16 +0200 Subject: [PATCH 452/690] movieinfo: more cleanup; use htmlEntityDecode from helpers.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/22fcc8fe4d2d9f8260ffb8ef40ceb03cd9e104fb Author: vanhofen Date: 2016-08-11 (Thu, 11 Aug 2016) Origin message was: ------------------ - movieinfo: more cleanup; use htmlEntityDecode from helpers.cpp --- src/gui/moviebrowser.cpp | 2 +- src/gui/movieinfo.cpp | 31 +++---------------------------- src/system/helpers.cpp | 2 ++ 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index f3be417db..711be53dc 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1871,7 +1871,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) std::string extension; extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); extension = "." + extension; - strReplace(fname, extension.c_str(), ".jpg"); + str_replace(extension, ".jpg", fname); printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 608a4789b..b29fb74cb 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -252,7 +252,7 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end while(_pos_ < bytes && _text_[_pos_] != '<' ) _pos_++;\ _dest_ = "";\ _dest_.append(&_text_[pos_prev],_pos_ - pos_prev );\ - _dest_ = decodeXmlSpecialChars(_dest_);\ + _dest_ = htmlEntityDecode(_dest_);\ _pos_ += sizeof(_tag_);\ continue;\ } @@ -276,31 +276,6 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end continue;\ } -void strReplace(std::string &orig, const char *fstr, const std::string &rstr) -{ - // replace all occurrence of fstr with rstr and returns a reference to itself - size_t index = 0; - size_t fstrlen = strlen(fstr); - size_t rstrlen = rstr.size(); - - while ((index = orig.find(fstr, index)) != std::string::npos) { - orig.replace(index, fstrlen, rstr); - index += rstrlen; - } -} - -std::string decodeXmlSpecialChars(std::string s) -{ - strReplace(s,"<","<"); - strReplace(s,">",">"); - strReplace(s,"&","&"); - strReplace(s,""","\""); - strReplace(s,"'","\'"); - strReplace(s," ","\n"); - strReplace(s," ","\n"); - return s; -} - bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) { int bookmark_nr = 0; @@ -408,7 +383,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) if (text[pos + pos3] == '\"') { audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = decodeXmlSpecialChars(audio_pids.epgAudioPidName); + audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName); } } } @@ -456,7 +431,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) if (text[pos + pos3] == '\"') { movie_info->bookmarks.user[bookmark_nr].name.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - movie_info->bookmarks.user[bookmark_nr].name = decodeXmlSpecialChars(movie_info->bookmarks.user[bookmark_nr].name); + movie_info->bookmarks.user[bookmark_nr].name = htmlEntityDecode(movie_info->bookmarks.user[bookmark_nr].name); } } } diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 70dd11838..d77efa230 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -487,6 +487,8 @@ std::string& htmlEntityDecode(std::string& text) }; decode_table dt[] = { + {"\n", " "}, + {"\n", " "}, {" ", " "}, {"&", "&"}, {"<", "<"}, From 02aa40a974d50ab5a801f06319634b5984dd1e83 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 12 Aug 2016 15:31:51 +0200 Subject: [PATCH 453/690] fb_window: add possibility to paint frame boxes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/220260c71845a8d17db7ef5285b0731e35a1359b Author: vanhofen Date: 2016-08-12 (Fri, 12 Aug 2016) Origin message was: ------------------ - fb_window: add possibility to paint frame boxes --- src/driver/fb_window.cpp | 5 +++++ src/driver/fb_window.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/driver/fb_window.cpp b/src/driver/fb_window.cpp index efe5dfdfa..19431f358 100644 --- a/src/driver/fb_window.cpp +++ b/src/driver/fb_window.cpp @@ -68,6 +68,11 @@ void CFBWindow::paintBoxRel(const int _x, const int _y, const int _dx, const int frameBuffer->paintBoxRel(x + _x, y + _y, _dx, _dy, _col, radius, type); } +void CFBWindow::paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius, int type) +{ + frameBuffer->paintBoxFrame(x + _x, y + _y, _dx, _dy, _px, _col, radius, type); +} + void CFBWindow::paintVLineRel(int _x, int _y, int _dy, const color_t _col) { frameBuffer->paintVLineRel(x + _x, y + _y, _dy, _col); diff --git a/src/driver/fb_window.h b/src/driver/fb_window.h index 3cad57c77..5d9efc0f7 100644 --- a/src/driver/fb_window.h +++ b/src/driver/fb_window.h @@ -43,6 +43,7 @@ class CFBWindow ~CFBWindow(); void paintBoxRel(const int _x, const int _y, const int _dx, const int _dy, const color_t _col, int radius = 0, int type = 0xF); + void paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius = 0, int type = 0xf); void paintVLineRel(int _x, int _y, int _dy, const color_t _col); void paintHLineRel(int _x, int _dx, int _y, const color_t _col); bool paintIcon(const char * const _filename, const int _x, const int _y, const int _h = 0, const color_t _offset = 1); From 099c59ee8beb61cc2fa11312e567990160694cc1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 12 Aug 2016 15:35:22 +0200 Subject: [PATCH 454/690] messagebox/msgbox: respect user colors for inactive buttons; ... paint buttons with shadow and small frame Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba9a54a0a91c05d46ec369181c2754073de0501b Author: vanhofen Date: 2016-08-12 (Fri, 12 Aug 2016) Origin message was: ------------------ - messagebox/msgbox: respect user colors for inactive buttons; ... paint buttons with shadow and small frame --- src/gui/widget/messagebox.cpp | 12 +++++++----- src/gui/widget/msgbox.cpp | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index f5d6aa117..5f09532c4 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -74,8 +74,8 @@ void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowB i_maxw = std::max(w, i_maxw); } fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - b_height = std::max(fh, ih) + 8 + (RADIUS_LARGE / 2); - m_bbheight = b_height + fh/2 + ButtonSpacing; + b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2); + m_bbheight = b_height + fh/2 + ButtonSpacing + SHADOW_OFFSET; result = Default; b_width = getButtonWidth(); if (ShowButtons & CMessageBox::mbBtnAlignCenter1) @@ -172,11 +172,13 @@ void CMessageBox::paintButtons() color = COL_MENUCONTENTSELECTED_TEXT; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); + m_window->paintBoxRel(xpos + SHADOW_OFFSET, ypos + SHADOW_OFFSET, b_width, b_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 4f9821ebe..6578437e6 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -356,10 +356,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); @@ -377,11 +379,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); @@ -399,11 +402,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color); From 65aed5191d6bc7c946e3a66893192247842d383a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 25 Jul 2016 23:55:20 +0200 Subject: [PATCH 455/690] CMenuWidget: use real paint mode of info box Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5788d744c69e56b89f1aa9a98634dc9cd7e07c55 Author: Thilo Graf Date: 2016-07-25 (Mon, 25 Jul 2016) --- src/gui/widget/menue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 607be4f60..a1898b661 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1429,7 +1429,7 @@ void CMenuWidget::paintHint(int pos) /* clear info box */ if ((info_box) && (pos < 0)) savescreen ? info_box->hide() : info_box->kill(); - hint_painted = false; + hint_painted = info_box->isPainted(); } if (pos < 0) return; @@ -1439,7 +1439,7 @@ void CMenuWidget::paintHint(int pos) if (!item->hintIcon && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { if (info_box) { savescreen ? info_box->hide() : info_box->kill(); - hint_painted = false; + hint_painted = info_box->isPainted(); } return; } From c203f9ab6bcb04d6497557129898c7f6cc369c38 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 31 Jul 2016 16:48:23 +0200 Subject: [PATCH 456/690] CCDraw: add comment Add comment where to find corner radius defines Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c317e4dbb4425225f5d19565ed27f070888ad5c0 Author: Thilo Graf Date: 2016-07-31 (Sun, 31 Jul 2016) --- src/gui/components/cc_draw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 9eb925937..08db89f5e 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -236,7 +236,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///set corner types ///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h) - ///Note: default values are given from settings + ///Note: default values are given from settings and corner radius sizes are predefined in /system/settings.h virtual void setCornerType(const int& type); ///set corner radius and type virtual void setCorner(const int& radius, const int& type = CORNER_ALL); From 65891222ab5b517c54476bf3be8b7e4465871c3d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 12 Aug 2016 19:19:24 +0200 Subject: [PATCH 457/690] src/system/helpers.cpp: Add cutString() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/71674d0f8aab183ad93d7220d5e6a8bfa6505588 Author: Michael Liebmann Date: 2016-08-12 (Fri, 12 Aug 2016) --- src/system/helpers.cpp | 21 +++++++++++++++++++++ src/system/helpers.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index d77efa230..a45fcfc48 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -438,6 +438,27 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } +std::string cutString(const std::string str, Font *msgFont, const int width) +{ + std::string ret = str; + ret = trim(ret); + int sw = msgFont->getRenderWidth(ret); + if (sw <= width) + return ret; + else { + std::string z = "..."; + int zw = msgFont->getRenderWidth(z); + if (width <= 2*zw) + return ret; + do { + ret = ret.substr(0, ret.length()-1); + sw = msgFont->getRenderWidth(ret); + } while (sw+zw > width); + ret = trim(ret) + z; + } + return ret; +} + std::string strftime(const char *format, const struct tm *tm) { char buf[4096]; diff --git a/src/system/helpers.h b/src/system/helpers.h index 486d1e8e6..5d9efa8d9 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -37,6 +37,8 @@ #include #include +#include + int my_system(const char * cmd); int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ @@ -67,6 +69,7 @@ std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); +std::string cutString(const std::string str, Font *msgFont, const int width); std::string strftime(const char *format, const struct tm *tm); std::string strftime(const char *format, time_t when, bool gm = false); time_t toEpoch(std::string &date); From 83d06179337bf6c34734951718f42c854b012097 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 12 Aug 2016 19:19:32 +0200 Subject: [PATCH 458/690] moviebrowser: Fix text display in message box when deleting a movie Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fd7808afd9191f8a8dab491cc9e6151dcc93198 Author: Michael Liebmann Date: 2016-08-12 (Fri, 12 Aug 2016) --- src/gui/moviebrowser.cpp | 80 ++++++++++++++++++++-------------------- src/gui/moviebrowser.h | 1 + 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 711be53dc..fe76b04af 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -2223,61 +2223,61 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) +std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth) { - //TRACE("[onDeleteFile] "); - bool result = false; -#if 0 - int test= movieinfo->file.Name.find(".ts", movieinfo->file.Name.length()-3); - if (test == -1) { - // not a TS file, return!!!!! - TRACE("show_ts_info: not a TS file "); - return; - } -#endif - size_t msgMax = 50; + int msgWidth = boxWidth - 20; std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); - msg += "\n "; + msg += "\n"; + if (!movieinfo->epgTitle.empty()) { - if ((movieinfo->epgTitle.length() + movieinfo->epgInfo1.length()) <= msgMax) { - msg += movieinfo->epgTitle; + int titleW = msgFont->getRenderWidth(movieinfo->epgTitle); + int infoW = 0; + int zW = 0; + if (!movieinfo->epgInfo1.empty()) { + infoW = msgFont->getRenderWidth(movieinfo->epgInfo1); + zW = msgFont->getRenderWidth(" ()"); + } + + if ((titleW+infoW+zW) <= msgWidth) { + /* one line */ + msg += trim(movieinfo->epgTitle); if (!movieinfo->epgInfo1.empty()) { msg += " ("; - msg += movieinfo->epgInfo1; + msg += trim(movieinfo->epgInfo1); msg += ")"; } } else { - if (movieinfo->epgTitle.length() > msgMax) { - msg += movieinfo->epgTitle.substr(0, msgMax); - msg += "..."; - } - else { - msg += movieinfo->epgTitle; - if (!movieinfo->epgInfo1.empty()) { - msg += "\n ("; - if (movieinfo->epgInfo1.length() > msgMax) { - msg = movieinfo->epgInfo1.substr(0, msgMax); - msg += "..."; - } - else - msg += movieinfo->epgInfo1; + /* two lines */ + msg += cutString(movieinfo->epgTitle, msgFont, msgWidth); + if (!movieinfo->epgInfo1.empty()) { + msg += "\n("; + msg += cutString(movieinfo->epgInfo1, msgFont, msgWidth); msg += ")"; - } } } } - else { - if (movieinfo->file.Name.length() > msgMax) { - msg += movieinfo->file.Name.substr(0, msgMax); - msg += "..."; - } - else - msg += movieinfo->file.Name; - } + else + msg += cutString(movieinfo->file.Name, msgFont, msgWidth); + msg += "\n"; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) + + return msg; +} + +bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) +{ + //TRACE("[onDeleteFile] "); + bool result = false; + + /* default font for ShowMsg */ + Font *msgFont = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; + /* default width for ShowMsg */ + int msgBoxWidth = 450; + + std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth); + if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo, NULL, msgBoxWidth)==CMessageBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); hintBox->paint(); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 2f662334f..01e3ca39a 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -428,6 +428,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); bool onDelete(bool cursor_only = false); + std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth = 450); bool onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); From caf790ff598cedf5c9a4bafc8f3f1188ce342c53 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 13 Aug 2016 14:13:52 +0200 Subject: [PATCH 459/690] src/gui/moviebrowser.cpp refreshMovieInfo after sort Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/485cc671bc21912832ad29136349b6dc4c1bf97e Author: Jacek Jendrzej Date: 2016-08-13 (Sat, 13 Aug 2016) --- src/gui/moviebrowser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index fe76b04af..f97c67263 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1937,6 +1937,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) TRACE("[mb]->new sorting %d,%s\n",m_settings.sorting.item,g_Locale->getText(m_localizedItemName[m_settings.sorting.item])); refreshBrowserList(); + refreshMovieInfo(); refreshFoot(); } } From 894e9cfa29d6622324a9ca7a0ed77aeec654d075 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 13 Aug 2016 15:58:06 +0200 Subject: [PATCH 460/690] Fix commit 65891222ab5b517c54476bf3be8b7e4465871c3d - Use indexes for font parameter in formatDeleteMsg() & cutString() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0d5edc29e62d693321ebf79ce846047a3ce99509 Author: Michael Liebmann Date: 2016-08-13 (Sat, 13 Aug 2016) --- src/system/helpers.cpp | 10 ++++++---- src/system/helpers.h | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index a45fcfc48..9a4b054f5 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -44,6 +44,7 @@ #include #include #include "debug.h" +#include #include #include using namespace std; @@ -438,21 +439,22 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } -std::string cutString(const std::string str, Font *msgFont, const int width) +std::string cutString(const std::string str, int msgFont, const int width) { + Font *msgFont_ = g_Font[msgFont]; std::string ret = str; ret = trim(ret); - int sw = msgFont->getRenderWidth(ret); + int sw = msgFont_->getRenderWidth(ret); if (sw <= width) return ret; else { std::string z = "..."; - int zw = msgFont->getRenderWidth(z); + int zw = msgFont_->getRenderWidth(z); if (width <= 2*zw) return ret; do { ret = ret.substr(0, ret.length()-1); - sw = msgFont->getRenderWidth(ret); + sw = msgFont_->getRenderWidth(ret); } while (sw+zw > width); ret = trim(ret) + z; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 5d9efa8d9..3b26a12a6 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -37,8 +37,6 @@ #include #include -#include - int my_system(const char * cmd); int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ @@ -69,7 +67,7 @@ std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); -std::string cutString(const std::string str, Font *msgFont, const int width); +std::string cutString(const std::string str, int msgFont, const int width); std::string strftime(const char *format, const struct tm *tm); std::string strftime(const char *format, time_t when, bool gm = false); time_t toEpoch(std::string &date); From c2dac69580beedb20dd059ab423c6c1e74197340 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 13 Aug 2016 15:58:13 +0200 Subject: [PATCH 461/690] Fix commit 83d06179337bf6c34734951718f42c854b012097 - Use indexes for font parameter in formatDeleteMsg() & cutString() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f898c081540122278e9224cc97b1a1de0e589e35 Author: Michael Liebmann Date: 2016-08-13 (Sat, 13 Aug 2016) --- src/gui/moviebrowser.cpp | 11 ++++++----- src/gui/moviebrowser.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index f97c67263..f79ba9083 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -2224,19 +2224,20 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth) +std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth) { + Font *msgFont_ = g_Font[msgFont]; int msgWidth = boxWidth - 20; std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); msg += "\n"; if (!movieinfo->epgTitle.empty()) { - int titleW = msgFont->getRenderWidth(movieinfo->epgTitle); + int titleW = msgFont_->getRenderWidth(movieinfo->epgTitle); int infoW = 0; int zW = 0; if (!movieinfo->epgInfo1.empty()) { - infoW = msgFont->getRenderWidth(movieinfo->epgInfo1); - zW = msgFont->getRenderWidth(" ()"); + infoW = msgFont_->getRenderWidth(movieinfo->epgInfo1); + zW = msgFont_->getRenderWidth(" ()"); } if ((titleW+infoW+zW) <= msgWidth) { @@ -2273,7 +2274,7 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) bool result = false; /* default font for ShowMsg */ - Font *msgFont = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; + int msgFont = SNeutrinoSettings::FONT_TYPE_MENU; /* default width for ShowMsg */ int msgBoxWidth = 450; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 01e3ca39a..55e3e8516 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -428,7 +428,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); bool onDelete(bool cursor_only = false); - std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth = 450); + std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth = 450); bool onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); From e6f2a6080aecd8239d7ce5bbd2329490adb8f20b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Aug 2016 20:56:41 +0200 Subject: [PATCH 462/690] cc_frm_button: don't use frames per default and align fontsize to familiar size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fa27f87bb13c99d989041b4a57e14f1ac925831d Author: vanhofen Date: 2016-08-14 (Sun, 14 Aug 2016) Origin message was: ------------------ - cc_frm_button: don't use frames per default and align fontsize to familiar size --- src/gui/components/cc_frm_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index ee7b4a23d..da7a575d8 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -110,7 +110,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; - fr_thickness = 3; //TODO: parts of the GUI still don't use framed buttons + fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons append_x_offset = 6; append_y_offset = 0; corner_rad = 0; @@ -192,7 +192,7 @@ void CComponentsButton::initCaption() x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; - int h_cap = height*85/100/* - 2*fr_thickness*/; + int h_cap = height*65/100 /*- 2*fr_thickness*/; /*NOTE: paint of centered text in y direction without y_offset From c9cd139228f18e2828b1d38be1cb254f81394691 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Aug 2016 20:59:29 +0200 Subject: [PATCH 463/690] bouqueteditor: reduce paintButtons calls to cc_frm_buttons default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe01996d2b16fb752cd211e7818d8a94a218d5d6 Author: vanhofen Date: 2016-08-14 (Sun, 14 Aug 2016) Origin message was: ------------------ - bouqueteditor: reduce paintButtons calls to cc_frm_buttons default --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 1853719f3..8326163df 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -147,7 +147,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-20); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 5a62215da..88ae91ab2 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -190,7 +190,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-20); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 4f3923de9..2888bab7a 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -252,7 +252,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); } std::string CBEChannelSelectWidget::getInfoText(int index) From 3a0e930e5a3e36b105c87dcadd07868df39c6f16 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Aug 2016 21:11:08 +0200 Subject: [PATCH 464/690] upnpbrowser: reduce paintButtons calls to cc_frm_buttons default remove obsolete setColorBody() call Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/55b79d26a35e376d263a199107c441040da84d26 Author: vanhofen Date: 2016-08-14 (Sun, 14 Aug 2016) Origin message was: ------------------ - upnpbrowser: reduce paintButtons calls to cc_frm_buttons default remove obsolete setColorBody() call --- src/gui/upnpbrowser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 73ee2a79e..12583e2ca 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -114,7 +114,6 @@ void CUpnpBrowserGui::Init() m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height - footer.setColorBody(COL_INFOBAR_SHADOW_PLUS_1); footer.setHeight(m_buttonHeight); m_x=getScreenStartX(m_width); @@ -975,7 +974,7 @@ void CUpnpBrowserGui::paintDevices() // Foot top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2); paintItem2DetailsLine (-1); // clear it } @@ -1153,7 +1152,7 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, // Foot buttons top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons, 0, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons); } void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) From 78230ead130f3f2937de79051b6b767c1dd8e7dc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Aug 2016 21:55:18 +0200 Subject: [PATCH 465/690] colors: some internal renamings * INFOBAR_SHADOW to SHADOW because it's not only used in infoviewer * INFOBAR_SHADOW_TEXT to MENUFOOT_TEXT because it's the proper name This is in preparation to make footer colors configurable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bc39d1e14e34f462336c2e61d05968f3e43baa77 Author: vanhofen Date: 2016-08-14 (Sun, 14 Aug 2016) Origin message was: ------------------ - colors: some internal renamings * INFOBAR_SHADOW to SHADOW because it's not only used in infoviewer * INFOBAR_SHADOW_TEXT to MENUFOOT_TEXT because it's the proper name This is in preparation to make footer colors configurable --- src/gui/audioplayer.cpp | 4 ++-- src/gui/bookmarkmanager.cpp | 4 ++-- src/gui/bouquetlist.cpp | 2 +- src/gui/color.h | 12 ++++++------ src/gui/components/cc_frm_button.cpp | 2 +- src/gui/components/cc_frm_button.h | 2 +- src/gui/components/cc_frm_footer.cpp | 2 +- src/gui/components/cc_frm_footer.h | 4 ++-- src/gui/components/cc_frm_window.cpp | 2 +- src/gui/epgview.cpp | 4 ++-- src/gui/eventlist.cpp | 2 +- src/gui/filebrowser.cpp | 4 ++-- src/gui/imageinfo.cpp | 2 +- src/gui/infoviewer.cpp | 16 ++++++++-------- src/gui/infoviewer_bb.cpp | 2 +- src/gui/lua/luainstance.cpp | 6 ++++-- src/gui/pictureviewer.cpp | 6 +++--- src/gui/upnpbrowser.cpp | 6 +++--- src/gui/widget/buttons.cpp | 8 ++++---- src/gui/widget/buttons.h | 2 +- src/gui/widget/hintbox.cpp | 8 ++++---- src/gui/widget/hintboxext.cpp | 2 +- src/gui/widget/menue.cpp | 2 +- src/gui/widget/messagebox.cpp | 4 ++-- src/gui/widget/msgbox.cpp | 16 ++++++++-------- src/system/setting_helpers.cpp | 4 ++-- 26 files changed, 65 insertions(+), 63 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 65510c4dc..4c8d68acf 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1650,8 +1650,8 @@ void CAudioPlayerGui::paintFoot() else top = m_y + (m_height - 2 * m_buttonHeight); - m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1); + m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_SHADOW_PLUS_1); int bwidth = m_width - (2*c_rad_mid); if (!m_playlist.empty()) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 94fe00bfb..3d49e4384 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -434,8 +434,8 @@ const struct button_label BookmarkmanagerButtons[2] = void CBookmarkManager::paintFoot() { int ButtonWidth = (width - 20) / 4; - frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1); - frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_SHADOW_PLUS_1); + frameBuffer->paintHLine(x, x+width, y, COL_SHADOW_PLUS_0); if (bookmarks.empty()) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 37320e3df..b388d96ac 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -703,7 +703,7 @@ void CBouquetList::paint() ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); #endif if (favonly) - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round else ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); diff --git a/src/gui/color.h b/src/gui/color.h index 5634a1e8e..402515acd 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -40,7 +40,7 @@ #define COL_INFOBAR_CASYSTEM 254-8*10 #define COL_COLORED_EVENTS_CHANNELLIST 254-8*9 #define COL_COLORED_EVENTS_INFOBAR 254-8*8 -#define COL_INFOBAR_SHADOW 254-8*7 +#define COL_SHADOW 254-8*7 #define COL_INFOBAR 254-8*6 #define COL_MENUHEAD 254-8*5 #define COL_MENUCONTENT 254-8*4 @@ -51,8 +51,8 @@ #define COL_BACKGROUND 255 #ifdef FB_USE_PALETTE -#define COL_INFOBAR_SHADOW_PLUS_0 (COL_INFOBAR_SHADOW + 0) -#define COL_INFOBAR_SHADOW_PLUS_1 (COL_INFOBAR_SHADOW + 1) +#define COL_SHADOW_PLUS_0 (COL_SHADOW + 0) +#define COL_SHADOW_PLUS_1 (COL_SHADOW + 1) #define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0) #define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1) #define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3) @@ -75,8 +75,8 @@ #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) #else -#define COL_INFOBAR_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_SHADOW + 0)]) -#define COL_INFOBAR_SHADOW_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_SHADOW + 1)]) +#define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)]) +#define COL_SHADOW_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 1)]) #define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)]) #define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)]) #define COL_INFOBAR_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 3)]) @@ -102,7 +102,7 @@ // text colors #define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)]) #define COL_INFOBAR_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 1)]) -#define COL_INFOBAR_SHADOW_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 2)]) +#define COL_MENUFOOT_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 2)]) #define COL_MENUHEAD_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 3)]) #define COL_MENUCONTENT_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 4)]) #define COL_MENUCONTENT_TEXT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 5)]) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index da7a575d8..a92617ebf 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -115,7 +115,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const append_y_offset = 0; corner_rad = 0; - cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_INFOBAR_SHADOW_TEXT; + cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; cc_btn_capt_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT; cc_btn_icon_obj = NULL; cc_btn_capt_obj = NULL; diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index d665ac6ce..25827263a 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -36,7 +36,7 @@ #include #include -#define COL_BUTTON_BODY COL_INFOBAR_SHADOW_PLUS_1 +#define COL_BUTTON_BODY COL_SHADOW_PLUS_1 #define COL_BUTTON_TEXT_ENABLED COL_BLACK #define COL_BUTTON_TEXT_DISABLED COL_LIGHT_GRAY diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index c5c8a890c..f5bf6905b 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -146,7 +146,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btn->enableFrame(btn_contour); - btn->setButtonTextColor(COL_INFOBAR_SHADOW_TEXT); + btn->setButtonTextColor(COL_MENUFOOT_TEXT); btn->setButtonEventMsg(content[i].btn_msg); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 9b30a7be8..45ec30b42 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -64,7 +64,7 @@ class CComponentsFooter : public CComponentsHeader CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_body = COL_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///show button frame and background, default false @@ -85,7 +85,7 @@ class CComponentsFooter : public CComponentsHeader CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_body = COL_SHADOW_PLUS_1, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 67b3657a2..269e724a7 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -155,7 +155,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_w_sidebar = 40; ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; - ccw_col_footer = COL_INFOBAR_SHADOW_PLUS_1; + ccw_col_footer = COL_SHADOW_PLUS_1; page_scroll_mode = PG_SCROLL_M_OFF; //permanent disabled here, only in body used! diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f3a0be051..dcbc2b9bf 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1529,9 +1529,9 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) if (!fscr) c--; // reduce blue button if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, w, c, EpgButtons[fscr ? 0 : 1], w, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + ::paintButtons(x, y, w, c, EpgButtons[fscr ? 0 : 1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 1); else - ::paintButtons(x, y, w, c, &EpgButtons[fscr ? 0 : 1][1], w, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); + ::paintButtons(x, y, w, c, &EpgButtons[fscr ? 0 : 1][1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 0); } } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index e347f54eb..505450779 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -272,7 +272,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna // Calculate iheight (we assume the red button is the largest one?) struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; - iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); + iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); // Calculate theight theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index c3a4be147..e811ce2bc 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1416,7 +1416,7 @@ int CFileBrowser::paintFoot(bool show) if (filelist.empty()) { - frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); return foheight; } if (playlistmode) @@ -1432,7 +1432,7 @@ void CFileBrowser::paintSMSKey() int skheight = fnt_small->getHeight(); //background - frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 82bb1e46c..a8b871128 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -189,7 +189,7 @@ void CImageInfo::ShowWindow() fb_pixel_t btn_col = /*g_settings.theme.Button_gradient ? COL_BUTTON_BODY :*/ footer->getColorBody(); //TODO: Button_gradient option btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, h_footer-h_footer/4, LOCALE_BUILDINFO_MENU, footer, false , true, false, footer->getColorBody(), btn_col); btn_red->doPaintBg(false); - btn_red->setButtonTextColor(COL_INFOBAR_SHADOW_TEXT); + btn_red->setButtonTextColor(COL_MENUFOOT_TEXT); btn_red->setColBodyGradient(CC_COLGRAD_OFF); } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 609c093d3..372710cde 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -400,10 +400,10 @@ void CInfoViewer::paintBackground(int col_NumBox) // shadow for channel name, epg data... frameBuffer->paintBox(BoxEndX - c_shadow_width, ChanNameY + SHADOW_OFFSET, BoxEndX + SHADOW_OFFSET, BoxEndInfoY + SHADOW_OFFSET, - COL_INFOBAR_SHADOW_PLUS_0, c_rad_large, CORNER_RIGHT); + COL_SHADOW_PLUS_0, c_rad_large, CORNER_RIGHT); frameBuffer->paintBox(ChanInfoX + SHADOW_OFFSET, BoxEndInfoY - c_shadow_width, BoxEndX - c_shadow_width, BoxEndInfoY + SHADOW_OFFSET, - COL_INFOBAR_SHADOW_PLUS_0, c_rad_large, CORNER_BOTTOM_LEFT); + COL_SHADOW_PLUS_0, c_rad_large, CORNER_BOTTOM_LEFT); #endif // background for channel name/logo and clock paintHead(); @@ -845,7 +845,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap if (g_settings.infobar_show_channellogo < 5 || !logo_ok) { if (ChannelLogoMode != 2) { //FIXME good color to display inactive for zap ? - //fb_pixel_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR_TEXT : COL_INFOBAR_SHADOW_TEXT; + //fb_pixel_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR_TEXT : COL_MENUFOOT_TEXT; fb_pixel_t color = COL_INFOBAR_TEXT; g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + header_height, @@ -1339,7 +1339,7 @@ void CInfoViewer::showRadiotext() sprintf(stext[0], g_Radiotext->RT_PTY == 0 ? "%s %s%s" : "%s (%s)%s", tr("Radiotext"), g_Radiotext->RT_PTY == 0 ? g_Radiotext->RDS_PTYN : g_Radiotext->ptynr2string(g_Radiotext->RT_PTY), ":"); // shadow - frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, rt_dx, rt_dy, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); + frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, rt_dx, rt_dy, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(rt_x, rt_y, rt_dx, rt_dy, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_TOP); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR_TEXT, 0, RTisIsUTF); } @@ -1368,7 +1368,7 @@ void CInfoViewer::showRadiotext() } // Body if (lines) { - frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+rt_dy+SHADOW_OFFSET, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+rt_dy+SHADOW_OFFSET, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); frameBuffer->paintBoxRel(rt_x, rt_y+rt_dy, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // RT-Text roundloop @@ -1718,9 +1718,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, int pb_w = 112; int pb_startx = BoxEndX - pb_w - SHADOW_OFFSET; int pb_starty = ChanNameY - (pb_h + 10); - int pb_shadow = COL_INFOBAR_SHADOW_PLUS_0; + int pb_shadow = COL_SHADOW_PLUS_0; timescale->enableShadow(!g_settings.infobar_progressbar); - int pb_color = (g_settings.progressbar_design == CProgressBar::PB_MONO) ? COL_INFOBAR_PLUS_0 : COL_INFOBAR_SHADOW_PLUS_0; + int pb_color = (g_settings.progressbar_design == CProgressBar::PB_MONO) ? COL_INFOBAR_PLUS_0 : COL_SHADOW_PLUS_0; if(g_settings.infobar_progressbar){ pb_startx = xStart; pb_w = BoxEndX - 10 - xStart; @@ -1922,7 +1922,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { //printf("CInfoViewer::show_Data: ************************************************* runningPercent %d\n", runningPercent); if (!calledFromEvent || (oldrunningPercent != runningPercent)) { - frameBuffer->paintBoxRel(BoxEndX - 104, posy + 6, 108, 14, COL_INFOBAR_SHADOW_PLUS_0, 1); + frameBuffer->paintBoxRel(BoxEndX - 104, posy + 6, 108, 14, COL_SHADOW_PLUS_0, 1); frameBuffer->paintBoxRel(BoxEndX - 108, posy + 2, 108, 14, COL_INFOBAR_PLUS_0, 1); oldrunningPercent = runningPercent; } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 9a68fe310..5def9e97e 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -65,7 +65,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern cVideo * videoDecoder; -#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_INFOBAR_SHADOW_PLUS_1) +#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_SHADOW_PLUS_1) CInfoViewerBB::CInfoViewerBB() { diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 62aca87c7..962ae171b 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -159,7 +159,8 @@ static void set_lua_variables(lua_State *L) { { "COLORED_EVENTS_CHANNELLIST", MAGIC_COLOR | (COL_COLORED_EVENTS_CHANNELLIST) }, { "COLORED_EVENTS_INFOBAR", MAGIC_COLOR | (COL_COLORED_EVENTS_INFOBAR) }, - { "INFOBAR_SHADOW", MAGIC_COLOR | (COL_INFOBAR_SHADOW) }, + { "SHADOW", MAGIC_COLOR | (COL_SHADOW) }, +/* obsolete */ { "INFOBAR_SHADOW", MAGIC_COLOR | (COL_SHADOW) }, // just here to stay backward compatible { "INFOBAR", MAGIC_COLOR | (COL_INFOBAR) }, { "MENUHEAD", MAGIC_COLOR | (COL_MENUHEAD) }, { "MENUCONTENT", MAGIC_COLOR | (COL_MENUCONTENT) }, @@ -182,7 +183,7 @@ static void set_lua_variables(lua_State *L) { "BLACK", MAGIC_COLOR | (COL_BLACK0) }, { "COLORED_EVENTS_TEXT", (lua_Unsigned) (COL_COLORED_EVENTS_TEXT) }, { "INFOBAR_TEXT", (lua_Unsigned) (COL_INFOBAR_TEXT) }, - { "INFOBAR_SHADOW_TEXT", (lua_Unsigned) (COL_INFOBAR_SHADOW_TEXT) }, +/* obsolete */ { "INFOBAR_SHADOW_TEXT", (lua_Unsigned) (COL_MENUFOOT_TEXT) }, // just here to stay backward compatible { "MENUHEAD_TEXT", (lua_Unsigned) (COL_MENUHEAD_TEXT) }, { "MENUCONTENT_TEXT", (lua_Unsigned) (COL_MENUCONTENT_TEXT) }, { "MENUCONTENT_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_TEXT_PLUS_1) }, @@ -195,6 +196,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTSELECTED_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_1) }, { "MENUCONTENTSELECTED_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_2) }, { "MENUCONTENTINACTIVE_TEXT", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_TEXT) }, + { "MENUFOOT_TEXT", (lua_Unsigned) (COL_MENUFOOT_TEXT) }, { "MENUHEAD_PLUS_0", (lua_Unsigned) (COL_MENUHEAD_PLUS_0) }, { "MENUCONTENT_PLUS_0", (lua_Unsigned) (COL_MENUCONTENT_PLUS_0) }, { "MENUCONTENT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_PLUS_1) }, diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 9adbf5555..5a3fc2cec 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -167,8 +167,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); //get footerHeight from paintButtons - buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); - buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); + buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); + buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footerHeight = buttons1Height + buttons2Height; listmaxshow = (height-theight-footerHeight)/(fheight); @@ -728,7 +728,7 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 12583e2ca..7f44bf0a8 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -87,19 +87,19 @@ void CUpnpBrowserGui::Init() topbox.setCorner(RADIUS_LARGE); topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); - topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Head_gradient_direction); + topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Head_gradient_direction); ibox.enableFrame(true, 2); ibox.setCorner(RADIUS_LARGE); ibox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); - ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); - timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index b054760cc..1b87c14ca 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -195,7 +195,7 @@ int paintButtons( const button_label_ext * const content, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline @@ -250,7 +250,7 @@ int paintButtons( const button_label_ext * const content, // paint icon and text frameBuffer->paintIcon(icon, x_button , y_base - iconh[j]/2); x_caption = x_button + iconw[j] + h_space; - font->RenderString(x_caption, y_caption, fwidth[j], caption, COL_INFOBAR_SHADOW_TEXT); + font->RenderString(x_caption, y_caption, fwidth[j], caption, COL_MENUFOOT_TEXT); /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, * for generating buttons without captions, @@ -284,7 +284,7 @@ int paintButtons( const button_label_ext * const content, * stuff below here was obviously not tested recently * vertical_paint optional, default value is false (horizontal) sets direction of painted buttons - * fcolor optional, default value is COL_INFOBAR_SHADOW_TEXT, use it to render font with other color + * fcolor optional, default value is COL_MENUFOOT_TEXT, use it to render font with other color * alt_buttontext optional, default NULL, overwrites button caption at definied buttonlabel id (see parameter alt_buttontext_id) with this text * alt_buttontext_id optional, default 0, means id from buttonlable struct which text you will change * show optional, default value is true (show button), if false, then no show and return the height of the button. @@ -392,7 +392,7 @@ int paintButtons( const int &x, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline diff --git a/src/gui/widget/buttons.h b/src/gui/widget/buttons.h index ad52669b2..2f1e75395 100644 --- a/src/gui/widget/buttons.h +++ b/src/gui/widget/buttons.h @@ -83,7 +83,7 @@ int paintButtons( const int &x, const int &footerheight = 0, std::string tmp = "", /* just to make sure compilation breaks */ bool vertical_paint = false, - const uint32_t fcolor = COL_INFOBAR_SHADOW_TEXT, + const uint32_t fcolor = COL_MENUFOOT_TEXT, const char * alt_buttontext = NULL, const uint &buttontext_id = 0, bool show = true, diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 9bc61d433..0f547dfe5 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -174,10 +174,10 @@ void CHintBox::refresh(void) return; } - //window->paintBoxRel(borderwidth, height, width, borderwidth, COL_INFOBAR_SHADOW_PLUS_0); - //window->paintBoxRel(width, borderwidth, borderwidth, height - borderwidth, COL_INFOBAR_SHADOW_PLUS_0); - window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right - window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom + //window->paintBoxRel(borderwidth, height, width, borderwidth, COL_SHADOW_PLUS_0); + //window->paintBoxRel(width, borderwidth, borderwidth, height - borderwidth, COL_SHADOW_PLUS_0); + window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right + window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom CComponentsHeader header(window->x, window->y, width, theight, caption, iconfile); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index ac4f881ab..dfc89946d 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -267,7 +267,7 @@ void CHintBoxExt::refresh(bool toround) if (!bgPainted) { // bottom, right shadow - m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); + m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); bgPainted = true; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a1898b661..268f49e37 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1484,7 +1484,7 @@ void CMenuWidget::paintHint(int pos) info_box->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); - info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color + info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_SHADOW_PLUS_1 is default footer color //paint result if (details_line) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 5f09532c4..87b1e5664 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -176,9 +176,9 @@ void CMessageBox::paintButtons() bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos + SHADOW_OFFSET, ypos + SHADOW_OFFSET, b_width, b_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_window->paintBoxRel(xpos + SHADOW_OFFSET, ypos + SHADOW_OFFSET, b_width, b_height, COL_SHADOW_PLUS_0, RADIUS_MID); m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 6578437e6..09ea4d5e6 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -359,9 +359,9 @@ void CMsgBox::refreshFoot(void) color = COL_MENUCONTENTINACTIVE_TEXT; bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); @@ -382,9 +382,9 @@ void CMsgBox::refreshFoot(void) color = COL_MENUCONTENTINACTIVE_TEXT; bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); @@ -405,9 +405,9 @@ void CMsgBox::refreshFoot(void) color = COL_MENUCONTENTINACTIVE_TEXT; bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color); @@ -484,7 +484,7 @@ void CMsgBox::refreshBorder(void) m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth+m_cBoxFrame.iY - RADIUS_LARGE, m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth - RADIUS_LARGE, m_nWindowFrameBorderWidth + RADIUS_LARGE, - COL_INFOBAR_SHADOW_PLUS_0, + COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_LEFT); //draw right shadow @@ -492,7 +492,7 @@ void CMsgBox::refreshBorder(void) m_nWindowFrameBorderWidth+m_cBoxFrame.iY, m_nWindowFrameBorderWidth + RADIUS_LARGE, m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth, - COL_INFOBAR_SHADOW_PLUS_0, + COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_RIGHT); } diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 9a0bd59e9..b87899c56 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -173,7 +173,7 @@ void CColorSetupNotifier::setPalette() convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); - frameBuffer->paletteGenFade(COL_INFOBAR_SHADOW, + frameBuffer->paletteGenFade(COL_SHADOW, convertSetupColor2RGB(int(t.infobar_red*0.4), int(t.infobar_green*0.4), int(t.infobar_blue*0.4)), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); @@ -204,7 +204,7 @@ void CColorSetupNotifier::setPalette() convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), convertSetupAlpha2Alpha(t.infobar_alpha)); - // COL_INFOBAR_SHADOW_TEXT + // COL_MENUFOOT_TEXT frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2, convertSetupColor2RGB(int(t.infobar_Text_red*0.6), int(t.infobar_Text_green*0.6), int(t.infobar_Text_blue*0.6)), convertSetupAlpha2Alpha(t.infobar_alpha)); From 9196e2208c616900fe4e15336879b15be2dc375a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 14 Aug 2016 22:17:59 +0200 Subject: [PATCH 466/690] cc_frm_footer: overload font option with old familiar font Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/13966c519b00367d611830be773f9a1f1502fe3e Author: vanhofen Date: 2016-08-14 (Sun, 14 Aug 2016) Origin message was: ------------------ - cc_frm_footer: overload font option with old familiar font --- src/gui/components/cc_frm_footer.cpp | 1 - src/gui/components/cc_frm_footer.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f5bf6905b..cf95d611b 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -25,7 +25,6 @@ #include #endif -#include #include #include "cc_frm_footer.h" #include diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 45ec30b42..e2076e3c7 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -26,6 +26,7 @@ #include "cc_frm_header.h" #include "cc_frm_button.h" +#include #include //for compatibility with 'button_label' type //for 'button_label' type with string @@ -135,7 +136,7 @@ class CComponentsFooter : public CComponentsHeader const struct button_label * const content, const int& label_width = 0, const int& context_buttons = 0, - Font* font = NULL, + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], bool do_save_bg = CC_SAVE_SCREEN_NO ); From 70abfb333964405a18fd4dd1c87ffd6e9d19c9b1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 00:14:47 +0200 Subject: [PATCH 467/690] colors: make footer background color configurable TODO: footer text color and maybe footer font Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc5258e6d5f6f74abea3015c9a14a720f5fa5405 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - colors: make footer background color configurable TODO: footer text color and maybe footer font --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/audioplayer.cpp | 4 ++-- src/gui/bookmarkmanager.cpp | 4 ++-- src/gui/bouquetlist.cpp | 2 +- src/gui/color.h | 7 +++++-- src/gui/components/cc_frm_button.h | 2 +- src/gui/components/cc_frm_footer.h | 4 ++-- src/gui/components/cc_frm_window.cpp | 2 +- src/gui/filebrowser.cpp | 6 +++--- src/gui/infoviewer_bb.cpp | 2 +- src/gui/lua/luainstance.cpp | 2 ++ src/gui/osd_setup.cpp | 8 ++++++++ src/gui/pictureviewer.cpp | 2 +- src/gui/themes.cpp | 8 ++++++++ src/gui/widget/buttons.cpp | 4 ++-- src/gui/widget/menue.cpp | 2 +- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/setting_helpers.cpp | 5 +++++ src/system/settings.h | 5 +++++ 21 files changed, 58 insertions(+), 19 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 438e61587..bff628d58 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -333,6 +333,7 @@ colormenu.timing Timeouts colormenusetup.menucontent Fensterinhalt colormenusetup.menucontent_inactive Fensterinhalt deaktiviert colormenusetup.menucontent_selected Fensterinhalt selektiert +colormenusetup.menufoot Fußleiste colormenusetup.menuhead Titelleiste colorstatusbar.text Infobar colorthememenu.head Theme auswählen @@ -1062,6 +1063,7 @@ menu.hint_hdd_noise Setzen Sie Parameter für das Automatic Acoustic Management. menu.hint_hdd_sleep Dieser Wert definiert, nach wieviel Minuten die Festplatte bei Inaktivität in den Sleep-Modus geschaltet wird menu.hint_hdd_statfs Legen Sie fest, wann die Aufnahmeverzeichnis-Füllstandsanzeige im InfoViewer (und ggf. am VFD-Display) aktualisiert werden darf menu.hint_hdd_tools Formatieren Sie die gefundenen Datenträger bzw. überprüfen Sie deren Dateisystem +menu.hint_foot_back Ändern Sie die Fußleisten-Hintergrundfarbe menu.hint_head_back Ändern Sie die Titel-Hintergrundfarbe menu.hint_head_textcolor Ändern Sie die Titel-Textfarbe menu.hint_imageinfo Informationen über die installierte Software diff --git a/data/locale/english.locale b/data/locale/english.locale index 67a634264..d306eb8ee 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -333,6 +333,7 @@ colormenu.timing Timeouts colormenusetup.menucontent Content colormenusetup.menucontent_inactive Content inactive colormenusetup.menucontent_selected Content selected +colormenusetup.menufoot Footer colormenusetup.menuhead Header colorstatusbar.text Infobar colorthememenu.head Select theme @@ -1062,6 +1063,7 @@ menu.hint_hdd_noise Set Automatic Acoustic Management\nnot all drives support th menu.hint_hdd_sleep Select time to stop hdd on inactivity menu.hint_hdd_statfs Specify when the recording directory fill level in infoviewer and, if available, on VFD, may be updated menu.hint_hdd_tools Initialize HDD, check filesystem +menu.hint_foot_back Change GUI footer background color menu.hint_head_back Change GUI title background color menu.hint_head_textcolor Change GUI window title text color menu.hint_imageinfo Information about installed software diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4c8d68acf..4175510c2 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1650,8 +1650,8 @@ void CAudioPlayerGui::paintFoot() else top = m_y + (m_height - 2 * m_buttonHeight); - m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_SHADOW_PLUS_1); + m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_MENUFOOT_PLUS_0, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_MENUFOOT_PLUS_0); int bwidth = m_width - (2*c_rad_mid); if (!m_playlist.empty()) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 3d49e4384..15c2335aa 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -434,8 +434,8 @@ const struct button_label BookmarkmanagerButtons[2] = void CBookmarkManager::paintFoot() { int ButtonWidth = (width - 20) / 4; - frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_SHADOW_PLUS_1); - frameBuffer->paintHLine(x, x+width, y, COL_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_MENUFOOT_PLUS_0); + frameBuffer->paintHLine(x, x+width, y, COL_MENUFOOT_PLUS_0); if (bookmarks.empty()) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index b388d96ac..223428107 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -703,7 +703,7 @@ void CBouquetList::paint() ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); #endif if (favonly) - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round else ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); diff --git a/src/gui/color.h b/src/gui/color.h index 402515acd..cc18af0b0 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -35,8 +35,9 @@ #include -#define COL_MAXFREE 254-8*12 - 1 -#define COL_NEUTRINO_TEXT 254-8*12 // 24 values +#define COL_MAXFREE 254-8*16 - 1 +#define COL_NEUTRINO_TEXT 254-8*16 // 32 values? +#define COL_MENUFOOT 254-8*11 #define COL_INFOBAR_CASYSTEM 254-8*10 #define COL_COLORED_EVENTS_CHANNELLIST 254-8*9 #define COL_COLORED_EVENTS_INFOBAR 254-8*8 @@ -73,6 +74,7 @@ #define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0) #define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2) #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) +#define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0) #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) #else #define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)]) @@ -97,6 +99,7 @@ #define COL_MENUCONTENTSELECTED_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 0)]) #define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)]) #define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)]) +#define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)]) #define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)]) // text colors diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 25827263a..ae0def4d3 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -36,7 +36,7 @@ #include #include -#define COL_BUTTON_BODY COL_SHADOW_PLUS_1 +#define COL_BUTTON_BODY COL_MENUFOOT_PLUS_0 #define COL_BUTTON_TEXT_ENABLED COL_BLACK #define COL_BUTTON_TEXT_DISABLED COL_LIGHT_GRAY diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index e2076e3c7..886cba39f 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -65,7 +65,7 @@ class CComponentsFooter : public CComponentsHeader CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_SHADOW_PLUS_1, + fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///show button frame and background, default false @@ -86,7 +86,7 @@ class CComponentsFooter : public CComponentsHeader CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_SHADOW_PLUS_1, + fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 269e724a7..c8db90c8e 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -155,7 +155,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_w_sidebar = 40; ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; - ccw_col_footer = COL_SHADOW_PLUS_1; + ccw_col_footer = COL_MENUFOOT_PLUS_0; page_scroll_mode = PG_SCROLL_M_OFF; //permanent disabled here, only in body used! diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index e811ce2bc..02257b140 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1416,7 +1416,7 @@ int CFileBrowser::paintFoot(bool show) if (filelist.empty()) { - frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM); return foheight; } if (playlistmode) @@ -1431,8 +1431,8 @@ void CFileBrowser::paintSMSKey() { int skheight = fnt_small->getHeight(); - //background - frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM_RIGHT); + //background - Why? Most of them is over-painted + frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 5def9e97e..1a50224f8 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -65,7 +65,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern cVideo * videoDecoder; -#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_SHADOW_PLUS_1) +#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_MENUFOOT_PLUS_0) CInfoViewerBB::CInfoViewerBB() { diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 962ae171b..934bfcfb0 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -167,6 +167,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTDARK", MAGIC_COLOR | (COL_MENUCONTENTDARK) }, { "MENUCONTENTSELECTED", MAGIC_COLOR | (COL_MENUCONTENTSELECTED) }, { "MENUCONTENTINACTIVE", MAGIC_COLOR | (COL_MENUCONTENTINACTIVE) }, + { "MENUFOOT", MAGIC_COLOR | (COL_MENUFOOT) }, { "BACKGROUND", MAGIC_COLOR | (COL_BACKGROUND) }, { "DARK_RED", MAGIC_COLOR | (COL_DARK_RED0) }, { "DARK_GREEN", MAGIC_COLOR | (COL_DARK_GREEN0) }, @@ -211,6 +212,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTSELECTED_PLUS_0", (lua_Unsigned) (COL_MENUCONTENTSELECTED_PLUS_0) }, { "MENUCONTENTSELECTED_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_PLUS_2) }, { "MENUCONTENTINACTIVE_PLUS_0", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_PLUS_0) }, + { "MENUFOOT_PLUS_0", (lua_Unsigned) (COL_MENUFOOT_PLUS_0) }, { NULL, 0 } }; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f723871ad..980979400 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -693,6 +693,8 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) &t.menu_Content_inactive_alpha, colorSetupNotifier); CColorChooser* chContentInactiveTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_inactive_Text_red, &t.menu_Content_inactive_Text_green, &t.menu_Content_inactive_Text_blue, NULL, colorSetupNotifier); + CColorChooser* chFootcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Foot_red, &t.menu_Foot_green, &t.menu_Foot_blue, + &t.menu_Foot_alpha, colorSetupNotifier); menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD)); @@ -752,6 +754,12 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) mf->setHint("", LOCALE_MENU_HINT_SELECTED_TEXT); menu_colors->addItem(mf); + // footer + menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUFOOT)); + mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chFootcolor ); + mf->setHint("", LOCALE_MENU_HINT_HEAD_BACK); + menu_colors->addItem(mf); + // hintbox color gradient menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORTHEMEMENU_MENU_HINTS)); oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &t.menu_Hint_gradient, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 5a3fc2cec..fc579577d 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -728,7 +728,7 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 33dd961ee..5fc483cab 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -274,6 +274,10 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "menu_Content_inactive_Text_red", t.menu_Content_inactive_Text_red ); configfile.setInt32( "menu_Content_inactive_Text_green", t.menu_Content_inactive_Text_green ); configfile.setInt32( "menu_Content_inactive_Text_blue", t.menu_Content_inactive_Text_blue ); + configfile.setInt32( "menu_Foot_alpha", t.menu_Foot_alpha ); + configfile.setInt32( "menu_Foot_red", t.menu_Foot_red ); + configfile.setInt32( "menu_Foot_green", t.menu_Foot_green ); + configfile.setInt32( "menu_Foot_blue", t.menu_Foot_blue ); configfile.setInt32( "menu_Hint_gradient" , t.menu_Hint_gradient); configfile.setInt32( "menu_Hint_gradient_direction" , t.menu_Hint_gradient_direction); @@ -352,6 +356,10 @@ void CThemes::getTheme(CConfigFile &configfile) t.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); t.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); t.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); + t.menu_Foot_alpha = configfile.getInt32( "menu_Foot_alpha", 0x08 ); + t.menu_Foot_red = configfile.getInt32( "menu_Foot_red", 0x10 ); + t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", 0x10 ); + t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", 0x10 ); t.menu_Hint_gradient = configfile.getInt32( "menu_Hint_gradient", CC_COLGRAD_OFF); t.menu_Hint_gradient_direction = configfile.getInt32( "menu_Hint_gradient_direction", CFrameBuffer::gradientVertical); diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 1b87c14ca..9143995fc 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -195,7 +195,7 @@ int paintButtons( const button_label_ext * const content, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline @@ -392,7 +392,7 @@ int paintButtons( const int &x, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 268f49e37..db00dff45 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1484,7 +1484,7 @@ void CMenuWidget::paintHint(int pos) info_box->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); - info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_SHADOW_PLUS_1 is default footer color + info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_MENUFOOT_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);// COL_MENUFOOT_PLUS_0 is default footer color //paint result if (details_line) diff --git a/src/system/locals.h b/src/system/locals.h index bda6f7548..dbaf210c5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -360,6 +360,7 @@ typedef enum LOCALE_COLORMENUSETUP_MENUCONTENT, LOCALE_COLORMENUSETUP_MENUCONTENT_INACTIVE, LOCALE_COLORMENUSETUP_MENUCONTENT_SELECTED, + LOCALE_COLORMENUSETUP_MENUFOOT, LOCALE_COLORMENUSETUP_MENUHEAD, LOCALE_COLORSTATUSBAR_TEXT, LOCALE_COLORTHEMEMENU_HEAD, @@ -1089,6 +1090,7 @@ typedef enum LOCALE_MENU_HINT_HDD_SLEEP, LOCALE_MENU_HINT_HDD_STATFS, LOCALE_MENU_HINT_HDD_TOOLS, + LOCALE_MENU_HINT_FOOT_BACK, LOCALE_MENU_HINT_HEAD_BACK, LOCALE_MENU_HINT_HEAD_TEXTCOLOR, LOCALE_MENU_HINT_IMAGEINFO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index cee08f36a..5e5512cf8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -360,6 +360,7 @@ const char * locale_real_names[] = "colormenusetup.menucontent", "colormenusetup.menucontent_inactive", "colormenusetup.menucontent_selected", + "colormenusetup.menufoot", "colormenusetup.menuhead", "colorstatusbar.text", "colorthememenu.head", @@ -1089,6 +1090,7 @@ const char * locale_real_names[] = "menu.hint_hdd_sleep", "menu.hint_hdd_statfs", "menu.hint_hdd_tools", + "menu.hint_foot_back", "menu.hint_head_back", "menu.hint_head_textcolor", "menu.hint_imageinfo", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b87899c56..eb35c3ad5 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -168,6 +168,11 @@ void CColorSetupNotifier::setPalette() convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue), 8, convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha) ); + frameBuffer->paletteGenFade(COL_MENUFOOT, + convertSetupColor2RGB(t.menu_Foot_red, t.menu_Foot_green, t.menu_Foot_blue), + convertSetupColor2RGB(int(t.infobar_Text_red*0.6), int(t.infobar_Text_green*0.6), int(t.infobar_Text_blue*0.6)), /*TODO: use own color*/ + 8, convertSetupAlpha2Alpha( t.menu_Foot_alpha ) ); + frameBuffer->paletteGenFade(COL_INFOBAR, convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), diff --git a/src/system/settings.h b/src/system/settings.h index 3c6eaf2bf..b6befee3a 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -94,6 +94,11 @@ struct SNeutrinoTheme unsigned char menu_Content_inactive_Text_green; unsigned char menu_Content_inactive_Text_blue; + unsigned char menu_Foot_alpha; + unsigned char menu_Foot_red; + unsigned char menu_Foot_green; + unsigned char menu_Foot_blue; + int menu_Hint_gradient; int menu_Hint_gradient_direction; int menu_ButtonBar_gradient; From 558f2265ee684db0d3bbbf7c8a3eb7f032854156 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 00:30:47 +0200 Subject: [PATCH 468/690] upnpbrowser: use COL_SHADOW_PLUS_0 instead of COL_SHADOW_PLUS_1 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1209485c6bc1e72c036d8960f20094ea31ece35a Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - upnpbrowser: use COL_SHADOW_PLUS_0 instead of COL_SHADOW_PLUS_1 --- src/gui/upnpbrowser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 7f44bf0a8..ddb257f9f 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -87,19 +87,19 @@ void CUpnpBrowserGui::Init() topbox.setCorner(RADIUS_LARGE); topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); - topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Head_gradient_direction); + topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction); ibox.enableFrame(true, 2); ibox.setCorner(RADIUS_LARGE); ibox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); - ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); - timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction); + timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); From 69e4dfd1b1c6b5befdd0077f4de626783a2ec3e2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 00:31:27 +0200 Subject: [PATCH 469/690] colors: remove obsolete COL_SHADOW_PLUS_1 we should use only one shadow color (COL_SHADOW_PLUS_0) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff044c92085139218e6f7f3335c78eb7c6cc83b2 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - colors: remove obsolete COL_SHADOW_PLUS_1 we should use only one shadow color (COL_SHADOW_PLUS_0) --- src/gui/color.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/color.h b/src/gui/color.h index cc18af0b0..f87bdd8f6 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -53,7 +53,6 @@ #ifdef FB_USE_PALETTE #define COL_SHADOW_PLUS_0 (COL_SHADOW + 0) -#define COL_SHADOW_PLUS_1 (COL_SHADOW + 1) #define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0) #define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1) #define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3) @@ -78,7 +77,6 @@ #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) #else #define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)]) -#define COL_SHADOW_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 1)]) #define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)]) #define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)]) #define COL_INFOBAR_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 3)]) From 832649cb4606653811271519d02dc91d310453fe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 00:32:57 +0200 Subject: [PATCH 470/690] luainstance: add missing entry for shadow color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a9446a084a97d69ad5ad33f300ba5e949dc0adc1 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - luainstance: add missing entry for shadow color --- src/gui/lua/luainstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 934bfcfb0..d5de296b6 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -198,6 +198,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTSELECTED_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_2) }, { "MENUCONTENTINACTIVE_TEXT", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_TEXT) }, { "MENUFOOT_TEXT", (lua_Unsigned) (COL_MENUFOOT_TEXT) }, + { "SHADOW_PLUS_0", (lua_Unsigned) (COL_SHADOW_PLUS_0) }, { "MENUHEAD_PLUS_0", (lua_Unsigned) (COL_MENUHEAD_PLUS_0) }, { "MENUCONTENT_PLUS_0", (lua_Unsigned) (COL_MENUCONTENT_PLUS_0) }, { "MENUCONTENT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_PLUS_1) }, From edda49e3359fdcfe734e8f86985035e1b4abe2b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 08:30:36 +0200 Subject: [PATCH 471/690] yWeb: enable trsp-key on remote controls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/47f11a0e11028d24bb7e738ece6b3b85a19f3931 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - yWeb: enable trsp-key on remote controls --- src/nhttpd/web/Y_Blocks.txt | 4 ++-- src/nhttpd/web/Y_Version.txt | 4 ++-- src/nhttpd/web/languages/Deutsch | 1 + src/nhttpd/web/languages/English | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 1e17bb252..a6fbc1c78 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -787,7 +787,7 @@ start-block~rc_cst_v5 page+ page- - + trsp @@ -824,7 +824,7 @@ start-block~rc_cst_v6 audio text - + trsp help diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index afdb04898..c4da80e3a 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.37 -date=07.06.2016 +version=2.9.0.38 +date=15.08.2016 type=Release info=Port CST diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index daf178033..e726ac538 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -615,6 +615,7 @@ rc.key_stop=Stop rc.key_record=Record rc.key_pause=Pause rc.key_games= +rc.key_trsp=Trsp rc.key_time= rc.key_picsize=Pic Size rc.key_picmode=Pic Mode diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index 96e5695ae..8ee0e178d 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -618,6 +618,7 @@ rc.key_stop=Stop rc.key_record=Record rc.key_pause=Pause rc.key_games= +rc.key_trsp=Trsp rc.key_time= rc.key_picsize=Pic Size rc.key_picmode=Pic Mode From db2e5a11d992fec0207e0ca8e9fd6c845c5f5e64 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 12:16:49 +0200 Subject: [PATCH 472/690] colors: make footer text color configurable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c7952011e37b117106db9291cd112780e8bbd48 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - colors: make footer text color configurable --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/osd_setup.cpp | 9 ++++++++- src/gui/themes.cpp | 8 ++++++++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/setting_helpers.cpp | 6 +++--- src/system/settings.h | 5 +++++ 8 files changed, 28 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bff628d58..21fcfa495 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1064,6 +1064,7 @@ menu.hint_hdd_sleep Dieser Wert definiert, nach wieviel Minuten die Festplatte b menu.hint_hdd_statfs Legen Sie fest, wann die Aufnahmeverzeichnis-Füllstandsanzeige im InfoViewer (und ggf. am VFD-Display) aktualisiert werden darf menu.hint_hdd_tools Formatieren Sie die gefundenen Datenträger bzw. überprüfen Sie deren Dateisystem menu.hint_foot_back Ändern Sie die Fußleisten-Hintergrundfarbe +menu.hint_foot_textcolor Ändern Sie die Fußleisten-Textfarbe menu.hint_head_back Ändern Sie die Titel-Hintergrundfarbe menu.hint_head_textcolor Ändern Sie die Titel-Textfarbe menu.hint_imageinfo Informationen über die installierte Software diff --git a/data/locale/english.locale b/data/locale/english.locale index d306eb8ee..d354679e3 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1064,6 +1064,7 @@ menu.hint_hdd_sleep Select time to stop hdd on inactivity menu.hint_hdd_statfs Specify when the recording directory fill level in infoviewer and, if available, on VFD, may be updated menu.hint_hdd_tools Initialize HDD, check filesystem menu.hint_foot_back Change GUI footer background color +menu.hint_foot_textcolor Change GUI window footer text color menu.hint_head_back Change GUI title background color menu.hint_head_textcolor Change GUI window title text color menu.hint_imageinfo Information about installed software diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 980979400..06065b2c0 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -695,6 +695,8 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) NULL, colorSetupNotifier); CColorChooser* chFootcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Foot_red, &t.menu_Foot_green, &t.menu_Foot_blue, &t.menu_Foot_alpha, colorSetupNotifier); + CColorChooser* chFootTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Foot_Text_red, &t.menu_Foot_Text_green, &t.menu_Foot_Text_blue, + NULL, colorSetupNotifier); menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD)); @@ -757,7 +759,12 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) // footer menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUFOOT)); mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chFootcolor ); - mf->setHint("", LOCALE_MENU_HINT_HEAD_BACK); + mf->setHint("", LOCALE_MENU_HINT_FOOT_BACK); + menu_colors->addItem(mf); + + // footer text + mf = new CMenuDForwarder(LOCALE_COLORMENU_TEXTCOLOR, true, NULL, chFootTextcolor ); + mf->setHint("", LOCALE_MENU_HINT_FOOT_TEXTCOLOR); menu_colors->addItem(mf); // hintbox color gradient diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 5fc483cab..4493b8e94 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -278,6 +278,10 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "menu_Foot_red", t.menu_Foot_red ); configfile.setInt32( "menu_Foot_green", t.menu_Foot_green ); configfile.setInt32( "menu_Foot_blue", t.menu_Foot_blue ); + configfile.setInt32( "menu_Foot_Text_alpha", t.menu_Foot_Text_alpha ); + configfile.setInt32( "menu_Foot_Text_red", t.menu_Foot_Text_red ); + configfile.setInt32( "menu_Foot_Text_green", t.menu_Foot_Text_green ); + configfile.setInt32( "menu_Foot_Text_blue", t.menu_Foot_Text_blue ); configfile.setInt32( "menu_Hint_gradient" , t.menu_Hint_gradient); configfile.setInt32( "menu_Hint_gradient_direction" , t.menu_Hint_gradient_direction); @@ -360,6 +364,10 @@ void CThemes::getTheme(CConfigFile &configfile) t.menu_Foot_red = configfile.getInt32( "menu_Foot_red", 0x10 ); t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", 0x10 ); t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", 0x10 ); + t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 ); + t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x28 ); + t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x28 ); + t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x28 ); t.menu_Hint_gradient = configfile.getInt32( "menu_Hint_gradient", CC_COLGRAD_OFF); t.menu_Hint_gradient_direction = configfile.getInt32( "menu_Hint_gradient_direction", CFrameBuffer::gradientVertical); diff --git a/src/system/locals.h b/src/system/locals.h index dbaf210c5..04cc34b25 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1091,6 +1091,7 @@ typedef enum LOCALE_MENU_HINT_HDD_STATFS, LOCALE_MENU_HINT_HDD_TOOLS, LOCALE_MENU_HINT_FOOT_BACK, + LOCALE_MENU_HINT_FOOT_TEXTCOLOR, LOCALE_MENU_HINT_HEAD_BACK, LOCALE_MENU_HINT_HEAD_TEXTCOLOR, LOCALE_MENU_HINT_IMAGEINFO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 5e5512cf8..59ebb6ffb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1091,6 +1091,7 @@ const char * locale_real_names[] = "menu.hint_hdd_statfs", "menu.hint_hdd_tools", "menu.hint_foot_back", + "menu.hint_foot_textcolor", "menu.hint_head_back", "menu.hint_head_textcolor", "menu.hint_imageinfo", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index eb35c3ad5..b27faff65 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -170,7 +170,7 @@ void CColorSetupNotifier::setPalette() frameBuffer->paletteGenFade(COL_MENUFOOT, convertSetupColor2RGB(t.menu_Foot_red, t.menu_Foot_green, t.menu_Foot_blue), - convertSetupColor2RGB(int(t.infobar_Text_red*0.6), int(t.infobar_Text_green*0.6), int(t.infobar_Text_blue*0.6)), /*TODO: use own color*/ + convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), 8, convertSetupAlpha2Alpha( t.menu_Foot_alpha ) ); frameBuffer->paletteGenFade(COL_INFOBAR, @@ -211,8 +211,8 @@ void CColorSetupNotifier::setPalette() // COL_MENUFOOT_TEXT frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2, - convertSetupColor2RGB(int(t.infobar_Text_red*0.6), int(t.infobar_Text_green*0.6), int(t.infobar_Text_blue*0.6)), - convertSetupAlpha2Alpha(t.infobar_alpha)); + convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), + convertSetupAlpha2Alpha(t.menu_Foot_alpha)); // COL_MENUHEAD_TEXT frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 3, diff --git a/src/system/settings.h b/src/system/settings.h index b6befee3a..8e2b794e1 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -99,6 +99,11 @@ struct SNeutrinoTheme unsigned char menu_Foot_green; unsigned char menu_Foot_blue; + unsigned char menu_Foot_Text_alpha; + unsigned char menu_Foot_Text_red; + unsigned char menu_Foot_Text_green; + unsigned char menu_Foot_Text_blue; + int menu_Hint_gradient; int menu_Hint_gradient_direction; int menu_ButtonBar_gradient; From e53de52f8c230629589c8d037e08393359f09936 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 12:29:23 +0200 Subject: [PATCH 473/690] infoviewer_bb: respecting user colors in buttonbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/02744715176c760fcd873a474849d3919c68d7bf Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - infoviewer_bb: respecting user colors in buttonbar --- src/gui/infoviewer_bb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 1a50224f8..8615fa811 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -432,7 +432,7 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, - bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT); + bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_MENUFOOT_TEXT); } } } From 9820ecd29bcb2e4b7df95e2aa2c7598a50b1adc9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 12:31:28 +0200 Subject: [PATCH 474/690] cc_frm_button: respecting user colors in buttons Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29c7d652ec6bd37578b4c40060d5cde426ac92a7 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - cc_frm_button: respecting user colors in buttons --- src/gui/components/cc_frm_button.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index ae0def4d3..9a079b427 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -37,8 +37,8 @@ #include #define COL_BUTTON_BODY COL_MENUFOOT_PLUS_0 -#define COL_BUTTON_TEXT_ENABLED COL_BLACK -#define COL_BUTTON_TEXT_DISABLED COL_LIGHT_GRAY +#define COL_BUTTON_TEXT_ENABLED COL_MENUCONTENTSELECTED_PLUS_0 +#define COL_BUTTON_TEXT_DISABLED COL_MENUCONTENTINACTIVE_PLUS_0 //! Sub class of CComponentsForm. /*! From 9171915e49275ac8a93376b365c23dfea4ec542f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 13:02:49 +0200 Subject: [PATCH 475/690] filebrowser: remove my stupid comment Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5610aa280e214786f2ddd75be22fd60885362ab5 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - filebrowser: remove my stupid comment --- src/gui/filebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 02257b140..05b0a8e58 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1431,7 +1431,7 @@ void CFileBrowser::paintSMSKey() { int skheight = fnt_small->getHeight(); - //background - Why? Most of them is over-painted + //background frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) From 95b3a4c88c7b756ab8281054013187555484ed06 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 15 Aug 2016 15:49:04 +0200 Subject: [PATCH 476/690] src/gui/widget/textbox.cpp try to fix paint sidebar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9b5470a470851679495a6dd1a5102ea8f4ddb24 Author: Jacek Jendrzej Date: 2016-08-15 (Mon, 15 Aug 2016) --- src/gui/widget/textbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 0fc38b141..1be42973e 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; + int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes From e512b98ff92592e03056e3570ae82b3169c2f534 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 15 Aug 2016 16:39:27 +0200 Subject: [PATCH 477/690] src/gui/moviebrowser.cpp m_movieSelectionHandler NULL pointer, try to fix use pointer after delete Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/080cda9716c5589b6e088f0a583039ba5c35f05f Author: Jacek Jendrzej Date: 2016-08-15 (Mon, 15 Aug 2016) --- src/gui/moviebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index f79ba9083..fa8dc16c2 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1191,7 +1191,7 @@ int CMovieBrowser::paint(void) //CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); Font* font = NULL; - + m_movieSelectionHandler = NULL; m_pcBrowser = new CListFrame(&m_browserListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE, &m_cBoxFrameBrowserList); m_pcLastPlay = new CListFrame(&m_playListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, From e49ee18fb33081d70dc94f22a25f89436ba99879 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 18:54:28 +0200 Subject: [PATCH 478/690] fonts: add and use own font for all footers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/54f2ac510f8529b8679a7e665b963ca5baaa45b5 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - fonts: add and use own font for all footers --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/audioplayer.cpp | 2 +- src/gui/bookmarkmanager.cpp | 6 +++--- src/gui/bouquetlist.cpp | 4 ++-- src/gui/channellist.cpp | 4 ++-- src/gui/components/cc_frm_footer.cpp | 2 +- src/gui/components/cc_frm_footer.h | 2 +- src/gui/components/cc_frm_window.cpp | 2 +- src/gui/epgplus.cpp | 4 ++-- src/gui/epgview.cpp | 5 +++-- src/gui/filebrowser.cpp | 14 +++++++------- src/gui/filebrowser.h | 2 +- src/gui/infoviewer_bb.cpp | 8 ++++---- src/gui/moviebrowser.cpp | 2 +- src/gui/osd_setup.cpp | 6 ++++-- src/gui/pictureviewer.cpp | 1 - src/gui/pictureviewer.h | 1 - src/gui/test_menu.cpp | 2 +- src/gui/widget/buttons.cpp | 4 ++-- src/gui/widget/messagebox.cpp | 6 +++--- src/gui/widget/msgbox.cpp | 2 +- src/gui/widget/stringinput.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 26 files changed, 46 insertions(+), 40 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 21fcfa495..1b36d22fb 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -731,6 +731,7 @@ fontsize.infobar_info Info fontsize.infobar_number Nummer fontsize.infobar_small Klein fontsize.menu Menütext +fontsize.menu_foot Fußleiste (in allen GUI-Elementen) fontsize.menu_hint Menü-Hilfe fontsize.menu_info Menüinfo fontsize.menu_title Menütitel diff --git a/data/locale/english.locale b/data/locale/english.locale index d354679e3..bbcc2522c 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -731,6 +731,7 @@ fontsize.infobar_info info fontsize.infobar_number Number fontsize.infobar_small Small fontsize.menu Menu text +fontsize.menu_foot Footer (in all GUI elements) fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Title diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4175510c2..4ec247957 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -254,7 +254,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); m_buttonHeight = std::max(25, m_sheight); m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 15c2335aa..bcbe278cb 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -226,7 +226,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) selected = 0; // Max width = 90; - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //initial height value for buttonbar + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //initial height value for buttonbar theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); x=getScreenStartX( width ); @@ -439,14 +439,14 @@ void CBookmarkManager::paintFoot() if (bookmarks.empty()) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } else { ::paintButtons(x + 10, y + height + 4, width, 2, BookmarkmanagerButtons, footerHeight, ButtonWidth); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 223428107..5a37aa10a 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -412,7 +412,7 @@ int CBouquetList::show(bool bShowChannelList) favonly = !bShowChannelList; for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ - int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); + int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); w_max_icon = std::max(w_max_icon, icol_w); @@ -426,7 +426,7 @@ int CBouquetList::show(bool bShowChannelList) width = w_max (need_width, 20); height = h_max (16 * fheight, 40); - footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8); + footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); listmaxshow = (height - theight - footerHeight)/fheight; height = theight + footerHeight + listmaxshow * fheight; // recalc height diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 428fdb19e..0fcb5da92 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -108,7 +108,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl vlist = _vlist; new_zap_mode = 0; selected_chid = 0; - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; //initial height value for buttonbar theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(); @@ -469,7 +469,7 @@ void CChannelList::calcSize() if (fheight == 0) fheight = 1; /* avoid div-by-zero crash on invalid font */ - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; pig_on_win = ( (g_settings.channellist_additional == 2) /* with miniTV */ && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index cf95d611b..de72490fd 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -68,7 +68,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const width = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init footer height - cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; height = max(h, cch_font->getHeight()); shadow = shadow_mode; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 886cba39f..bd41de717 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -136,7 +136,7 @@ class CComponentsFooter : public CComponentsHeader const struct button_label * const content, const int& label_width = 0, const int& context_buttons = 0, - Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], bool do_save_bg = CC_SAVE_SCREEN_NO ); diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index c8db90c8e..869acd530 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -144,7 +144,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_right_sidebar= NULL; ccw_body = NULL; ccw_footer = NULL; - ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; ccw_buttons = 0; //no header buttons ccw_show_footer = true; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index d3e4f691e..94ab4af35 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -434,7 +434,7 @@ EpgPlus::Footer::Footer (CFrameBuffer * pframeBuffer, int px, int py, int pwidth this->x = px; this->y = py; this->width = pwidth; - this->buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //TODO get height from buttons + this->buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons } EpgPlus::Footer::~Footer() @@ -695,7 +695,7 @@ void EpgPlus::init() // if(icol_h < h2) // icol_h = h2; - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ + int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ int footerHeight = Footer::getUsedHeight() + buttonHeight; this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - horGap1Height - horGap2Height - footerHeight) / this->entryHeight; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index dcbc2b9bf..14f1f26bc 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -142,7 +142,7 @@ void CEpgData::start() topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; - buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; + buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; if (buttonheight < 30) buttonheight = 30; // the buttons and icons need space oy-=buttonheight/2; @@ -1499,7 +1499,8 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) y = sy + oy; w = ox; - fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + // why we don't use buttonheight member? + fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); h = std::max(fh, icol_h+4); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 05b0a8e58..a763d136f 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -262,7 +262,7 @@ void CFileBrowser::fontInit() { fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]; - fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + fnt_foot = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); x = getScreenStartX(width); @@ -271,7 +271,7 @@ void CFileBrowser::fontInit() fheight = fnt_item->getHeight(); if (fheight == 0) fheight = 1; /* avoid div by zero on invalid font */ - //foheight = fnt_small->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar + //foheight = fnt_foot->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar foheight = paintFoot(false); skwidth = 26; @@ -1374,10 +1374,10 @@ int CFileBrowser::paintFoot(bool show) std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]); - int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); + int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); int len = 0; for (int i = 0; i < FILEBROWSER_NUMBER_OF_SORT_VARIANTS; i++) - len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(sortByNames[i]))); + len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(sortByNames[i]))); sort_text_len += len; @@ -1429,7 +1429,7 @@ int CFileBrowser::paintFoot(bool show) void CFileBrowser::paintSMSKey() { - int skheight = fnt_small->getHeight(); + int skheight = fnt_foot->getHeight(); //background frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); @@ -1438,8 +1438,8 @@ void CFileBrowser::paintSMSKey() { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); - int len = fnt_small->getRenderWidth(cKey); - fnt_small->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); + int len = fnt_foot->getRenderWidth(cKey); + fnt_foot->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); } } diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index b0f640821..16e13b916 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -147,7 +147,7 @@ class CFileBrowser CFrameBuffer *frameBuffer; Font *fnt_title; Font *fnt_item; - Font *fnt_small; + Font *fnt_foot; CFileList selected_filelist; bool readDir(const std::string & dirname, CFileList* flist); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 8615fa811..b1ca798e6 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -108,7 +108,7 @@ void CInfoViewerBB::Init() bbButtonInfo[i].x = -1; } - InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 5; + InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 5; initBBOffset(); changePB(); @@ -146,7 +146,7 @@ void CInfoViewerBB::getBBIconInfo() bbIconMaxH = 0; initBBOffset(); BBarY = g_InfoViewer->BoxEndY + bottom_bar_offset; - BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) / 2; /* center in buttonbar */ + BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()) / 2; /* center in buttonbar */ bbIconMinX = g_InfoViewer->BoxEndX - 8; //should be 10px, but 2px will be reduced for each icon CNeutrinoApp* neutrino = CNeutrinoApp::getInstance(); @@ -286,7 +286,7 @@ void CInfoViewerBB::getBBButtonInfo() if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) text = CMoviePlayerGui::getInstance(false).CurrentAudioName(); // use instance_mp } - bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(text) + w + 10; + bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(text) + w + 10; bbButtonInfo[i].cx = w + 5; bbButtonInfo[i].h = h; bbButtonInfo[i].text = text; @@ -431,7 +431,7 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) if (bbButtonInfo[i].active) { frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_MENUFOOT_TEXT); } } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index fa8dc16c2..99c376188 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -143,7 +143,7 @@ const CMenuOptionChooser::keyval MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS[MESSAGEBOX_ #define TITLE_FONT_COLOR COL_MENUHEAD_TEXT #define TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] -#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] +#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] #define INTER_FRAME_SPACE 4 // space between e.g. upper and lower window diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 06065b2c0..cd2576c42 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -134,11 +134,12 @@ const SNeutrinoSettings::FONT_TYPES epg_font_sizes[4] = SNeutrinoSettings::FONT_TYPE_EPG_DATE }; -const SNeutrinoSettings::FONT_TYPES menu_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES menu_font_sizes[5] = { SNeutrinoSettings::FONT_TYPE_MENU_TITLE, SNeutrinoSettings::FONT_TYPE_MENU, SNeutrinoSettings::FONT_TYPE_MENU_INFO, + SNeutrinoSettings::FONT_TYPE_MENU_FOOT, SNeutrinoSettings::FONT_TYPE_MENU_HINT }; const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = @@ -150,7 +151,7 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = #define FONT_GROUP_COUNT 6 font_sizes_groups font_sizes_groups[FONT_GROUP_COUNT] = { - {LOCALE_FONTMENU_MENU , 4, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, + {LOCALE_FONTMENU_MENU , 5, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, {LOCALE_FONTMENU_EVENTLIST , 5, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, @@ -163,6 +164,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_MENU , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_MENU_TITLE , 30, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_MENU_INFO , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MENU_FOOT , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EPG_TITLE , 25, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2}, {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index fc579577d..3f776af5e 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -162,7 +162,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); - sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 500635b0c..2d5410148 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -76,7 +76,6 @@ class CPictureViewerGui : public CMenuTarget unsigned int listmaxshow; int fheight; // Fonthoehe Playlist-Inhalt int theight; // Fonthoehe Playlist-Titel - int sheight; // Fonthoehe MP Info int footerHeight; int buttons1Height; int buttons2Height; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index b9116d6f2..2ad4e0734 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -550,7 +550,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (footer == NULL){ footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); //int start = 5, btnw =90, btnh = 37; - footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 9143995fc..a427be80a 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -97,7 +97,7 @@ int paintButtons( const button_label_ext * const content, int *wantedheight) { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; int cnt = count; int x_footer = x; int y_footer = y; @@ -306,7 +306,7 @@ int paintButtons( const int &x, const std::vector& /*all_buttontext_id*/) { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; uint cnt = count; int x_footer = x; int y_footer = y; diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 87b1e5664..f7e497846 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -73,7 +73,7 @@ void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowB ih = std::max(h, ih); i_maxw = std::max(w, i_maxw); } - fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2); m_bbheight = b_height + fh/2 + ButtonSpacing + SHADOW_OFFSET; result = Default; @@ -131,7 +131,7 @@ int CMessageBox::getButtonWidth() neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK}; int MaxButtonTextWidth = 0; for (int i = 0; i < localeMsgCount; i++) - MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); + MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2); } @@ -180,7 +180,7 @@ void CMessageBox::paintButtons() m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), + m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); xpos += b_width + ButtonDistance; } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 09ea4d5e6..503e79233 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -67,7 +67,7 @@ #define MIN_WINDOW_HEIGHT 40 #define DEFAULT_TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] -#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] +#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] ////////////////////////////////////////////////////////////////////// // Construction/Destruction diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index e6354805e..4651d33d1 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -108,7 +108,7 @@ void CStringInput::init() #endif hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; // init min buttonbar height input_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight() + 2; // font height + border input_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("M") + 2; // hack font width + border offset = 20; diff --git a/src/system/locals.h b/src/system/locals.h index 04cc34b25..2e832f0d9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -758,6 +758,7 @@ typedef enum LOCALE_FONTSIZE_INFOBAR_NUMBER, LOCALE_FONTSIZE_INFOBAR_SMALL, LOCALE_FONTSIZE_MENU, + LOCALE_FONTSIZE_MENU_FOOT, LOCALE_FONTSIZE_MENU_HINT, LOCALE_FONTSIZE_MENU_INFO, LOCALE_FONTSIZE_MENU_TITLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 59ebb6ffb..a195a53b2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -758,6 +758,7 @@ const char * locale_real_names[] = "fontsize.infobar_number", "fontsize.infobar_small", "fontsize.menu", + "fontsize.menu_foot", "fontsize.menu_hint", "fontsize.menu_info", "fontsize.menu_title", diff --git a/src/system/settings.h b/src/system/settings.h index 8e2b794e1..b6310ed1e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -647,6 +647,7 @@ struct SNeutrinoSettings FONT_TYPE_MENU = 0, FONT_TYPE_MENU_TITLE, FONT_TYPE_MENU_INFO, + FONT_TYPE_MENU_FOOT, FONT_TYPE_EPG_TITLE, FONT_TYPE_EPG_INFO1, FONT_TYPE_EPG_INFO2, From fc6d74af97125367b6b56f204e21d30b2b8f5d7a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 19:32:46 +0200 Subject: [PATCH 479/690] cc_item_text: avoid using INFOBAR_SMALL font; use MENU_INFO instead it's a small font too Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c35414bc56193c767c069c40e044c5ee1ac70f81 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - cc_item_text: avoid using INFOBAR_SMALL font; use MENU_INFO instead it's a small font too --- src/gui/components/cc_extra.h | 2 +- src/gui/components/cc_item_text.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_extra.h b/src/gui/components/cc_extra.h index f63b75a75..09e92d013 100644 --- a/src/gui/components/cc_extra.h +++ b/src/gui/components/cc_extra.h @@ -139,7 +139,7 @@ bool paintBoxRel0( const int& x, * @param[in] y position * @param[in] dx witdh * @param[in] dy height -* @param[in] *font pointer to font type object, default = NULL, sets g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] as default font +* @param[in] *font pointer to font type object, default = NULL, sets g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO] as default font * @param[in] color_body color of box, default = COL_MENUCONTENT_PLUS_0 * @param[in] font_style font style * @li CComponentsText::FONT_STYLE_REGULAR (default) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 90a59d3f1..c851a49fa 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -118,7 +118,7 @@ void CComponentsText::initCCText() { //set default font, if is no font definied if (ct_font == NULL) - ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; //define height from font size height = max(height, ct_font->getHeight()); From a5939c02ac6b4870067a17d2cd6b40a93e19a5fe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 19:35:02 +0200 Subject: [PATCH 480/690] upnpbrowser: fix calculation of upper info box height Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc13d0ff28a40b9a4c908634aa5804b9a744d7be Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - upnpbrowser: fix calculation of upper info box height --- src/gui/upnpbrowser.cpp | 4 ++-- src/gui/upnpbrowser.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index ddb257f9f..be3f60adf 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -104,12 +104,12 @@ void CUpnpBrowserGui::Init() m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + m_iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); m_buttonHeight = m_theight; m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); - m_title_height = m_mheight*2 + 20 + m_sheight + 4; + m_title_height = m_iheight*3 + 20; // 3 lines + offset m_info_height = m_mheight*2; m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 22870f406..c5ef41605 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -79,10 +79,10 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers unsigned int m_listmaxshow; unsigned int m_deviceliststart; unsigned int m_selecteddevice; - int m_fheight; // Fonthoehe Inhalt - int m_theight; // Fonthoehe Titel - int m_mheight; // Fonthoehe Info - int m_sheight; // Fonthoehe Status + int m_fheight; // items font height + int m_theight; // title font height + int m_mheight; // lower box font height + int m_iheight; // upper box font height int m_buttonHeight; int m_title_height; int m_info_height; From ca9a7e02eea5f1a197ab6a5ca6123e08b76dea6b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 19:50:23 +0200 Subject: [PATCH 481/690] upnpbrowser: use larger font for items; we have space, so let's use it Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/344101d50ae25a25bf87ac66a98cf7540be129a5 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - upnpbrowser: use larger font for items; we have space, so let's use it --- src/gui/upnpbrowser.cpp | 16 +++++++++------- src/gui/upnpbrowser.h | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index be3f60adf..b5c70a993 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -73,6 +73,8 @@ CUpnpBrowserGui::CUpnpBrowserGui() Init(); + font_item = SNeutrinoSettings::FONT_TYPE_MENU; + dline = NULL; image = NULL; @@ -108,7 +110,7 @@ void CUpnpBrowserGui::Init() m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); m_buttonHeight = m_theight; m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); + m_fheight = g_Font[font_item]->getHeight(); m_title_height = m_iheight*3 + 20; // 3 lines + offset m_info_height = m_mheight*2; m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); @@ -935,10 +937,10 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) std::string name = m_devices[pos].friendlyname; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(name) + 5; - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, + int w = g_Font[font_item]->getRenderWidth(name) + 5; + g_Font[font_item]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, num, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, + g_Font[font_item]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, w, name, color, m_fheight); } @@ -1036,7 +1038,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po std::string name = entry->title; char tmp_time[] = "00:00:00.0"; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); + int w = g_Font[font_item]->getRenderWidth(tmp_time); int icon_w = 0; int icon_h = 0; @@ -1047,8 +1049,8 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po icon_o = icon_w + 10; m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_fheight - icon_h) / 2); } - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_fheight, w, info, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 10 + icon_o, ypos + m_fheight, m_width - icon_o - 15 - 2*10 - w, name, color, m_fheight); + g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_fheight, w, info, color, m_fheight); + g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_fheight, m_width - icon_o - 15 - 2*10 - w, name, color, m_fheight); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index c5ef41605..cb30bf08c 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -83,6 +83,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers int m_theight; // title font height int m_mheight; // lower box font height int m_iheight; // upper box font height + int font_item; int m_buttonHeight; int m_title_height; int m_info_height; From 4d5891cde35ad41f20c9c574b8fd639d5bf37481 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 21:22:17 +0200 Subject: [PATCH 482/690] neutrinofonts: remove wrong name from signal_font struct Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c159fec182e9dfe6f05ae56327768b7fff8be17b Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - neutrinofonts: remove wrong name from signal_font struct --- src/driver/neutrinofonts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index ae69f117d..2f4a3722c 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -48,7 +48,7 @@ extern font_sizes_groups_struct font_sizes_groups[]; extern font_sizes_struct neutrino_font[]; extern const char * locale_real_names[]; /* #include */ -const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; +const font_sizes_struct signal_font = {NONEXISTANT_LOCALE, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; CNeutrinoFonts::CNeutrinoFonts() { From ec6570d7033271c6cf09889d8160f1ecdbed480b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 22:14:31 +0200 Subject: [PATCH 483/690] osd_setup: auto-calc size of font_size structs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74345ecaa29bc4eb16d581c000310204ff85cec6 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - osd_setup: auto-calc size of font_size structs --- src/gui/osd_setup.cpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index cd2576c42..9d44bd386 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -100,7 +100,7 @@ COsdSetup::~COsdSetup() } //font settings -const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_CHANNELLIST, SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR, @@ -108,8 +108,9 @@ const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT, SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP }; +size_t channellist_font_items = sizeof(channellist_font_sizes)/sizeof(channellist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE, SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE, @@ -117,24 +118,27 @@ const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME, SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT }; +size_t eventlist_font_items = sizeof(eventlist_font_sizes)/sizeof(eventlist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER, SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME, SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO, SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL }; +size_t infobar_font_items = sizeof(infobar_font_sizes)/sizeof(infobar_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES epg_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES epg_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EPG_TITLE, SNeutrinoSettings::FONT_TYPE_EPG_INFO1, SNeutrinoSettings::FONT_TYPE_EPG_INFO2, SNeutrinoSettings::FONT_TYPE_EPG_DATE }; +size_t epg_font_items = sizeof(epg_font_sizes)/sizeof(epg_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES menu_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_MENU_TITLE, SNeutrinoSettings::FONT_TYPE_MENU, @@ -142,22 +146,25 @@ const SNeutrinoSettings::FONT_TYPES menu_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_MENU_FOOT, SNeutrinoSettings::FONT_TYPE_MENU_HINT }; -const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = +size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); + +const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_SUBTITLES, SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM }; +size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]); -#define FONT_GROUP_COUNT 6 -font_sizes_groups font_sizes_groups[FONT_GROUP_COUNT] = +font_sizes_groups font_sizes_groups[] = { - {LOCALE_FONTMENU_MENU , 5, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, - {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, - {LOCALE_FONTMENU_EVENTLIST , 5, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, - {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, - {LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_OTHER , 2, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } + {LOCALE_FONTMENU_MENU , menu_font_items , menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, + {LOCALE_FONTMENU_CHANNELLIST, channellist_font_items, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, + {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, + {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, + {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, + {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; +#define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = { @@ -337,7 +344,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) { - for (int i = 0; i < FONT_GROUP_COUNT; i++) { + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { if (actionKey == font_sizes_groups[i].actionkey) { for (unsigned int j = 0; j < font_sizes_groups[i].count; j++) { SNeutrinoSettings::FONT_TYPES k = font_sizes_groups[i].content[j]; @@ -954,7 +961,7 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) //fontSettings->addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font")); mn_widget_id_t w_index = MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU; - for (int i = 0; i < FONT_GROUP_COUNT; i++) + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, w_index); From c06b4179cc51b7b7800919d08ef5b59d00fe8889 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 Aug 2016 08:32:13 +0200 Subject: [PATCH 484/690] themes: initialize foot_Text a little brighter Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba7545ce7a4ca3980bb5fc281a896fd2298dca77 Author: vanhofen Date: 2016-08-16 (Tue, 16 Aug 2016) Origin message was: ------------------ - themes: initialize foot_Text a little brighter --- src/gui/themes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 4493b8e94..58965f1f3 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -365,9 +365,9 @@ void CThemes::getTheme(CConfigFile &configfile) t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", 0x10 ); t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", 0x10 ); t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 ); - t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x28 ); - t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x28 ); - t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x28 ); + t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x40 ); + t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x40 ); + t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x40 ); t.menu_Hint_gradient = configfile.getInt32( "menu_Hint_gradient", CC_COLGRAD_OFF); t.menu_Hint_gradient_direction = configfile.getInt32( "menu_Hint_gradient_direction", CFrameBuffer::gradientVertical); From 29698685b6ac19bdf0683cfffa27093805db4af4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 Aug 2016 08:34:02 +0200 Subject: [PATCH 485/690] upnpbrowser: rework elements positions; avoid using FONT_EVENTLIST Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9bb55db72eea2251ed2451acd16df8d91007834 Author: vanhofen Date: 2016-08-16 (Tue, 16 Aug 2016) Origin message was: ------------------ - upnpbrowser: rework elements positions; avoid using FONT_EVENTLIST --- src/gui/upnpbrowser.cpp | 161 ++++++++++++++++++++++++---------------- src/gui/upnpbrowser.h | 21 ++++-- 2 files changed, 111 insertions(+), 71 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b5c70a993..5d5686795 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -83,6 +83,8 @@ CUpnpBrowserGui::CUpnpBrowserGui() CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit); } +#define INNER_OFFSET SHADOW_OFFSET + void CUpnpBrowserGui::Init() { topbox.enableFrame(true, 2); @@ -90,38 +92,68 @@ void CUpnpBrowserGui::Init() topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + //topbox.enableShadow(); - ibox.enableFrame(true, 2); - ibox.setCorner(RADIUS_LARGE); - ibox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); - ibox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); - ibox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); + infobox.enableFrame(true, 2); + infobox.setCorner(RADIUS_LARGE); + infobox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); + infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); + infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); + //infobox.enableShadow(); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); - timebox.setColorAll(ibox.getColorFrame(), ibox.getColorBody()); - timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + timebox.setColorAll(infobox.getColorFrame(), infobox.getColorBody()); + timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); + //timebox.enableShadow(); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); - m_iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - m_buttonHeight = m_theight; - m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_fheight = g_Font[font_item]->getHeight(); - m_title_height = m_iheight*3 + 20; // 3 lines + offset - m_info_height = m_mheight*2; - m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); - m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height + int _top_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); + int _title_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + int _info_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - footer.setHeight(m_buttonHeight); + m_item_height = g_Font[font_item]->getHeight(); + + m_header_height = _title_height; + m_footer_height = _title_height; + m_topbox_height = _top_height*3 + 10; // topbox: 3 lines + inner offset + shadow + m_infobox_height = _info_height*2 + 20; // infobox/timebox: 2 lines + inner offset + shadow + + /* From top to bottom we have: + * + * topbox (with shadow) + * INNER_OFFSET + * mainwindow (with shadow) + * - header + * - body (items*listshowmax) + * - footer + * INNER_OFFSET + * infobox/timebox (with shadow) + * + * Note: box shadows are disabled atm, so it looks like double offset between boxes + * box shadows seems buggy in ccomponents classes + */ + + m_listmaxshow = (m_height - m_topbox_height - SHADOW_OFFSET - INNER_OFFSET - m_header_height - m_footer_height - SHADOW_OFFSET - INNER_OFFSET - m_infobox_height - SHADOW_OFFSET) / (m_item_height); + + // recalc height + m_height = m_topbox_height + SHADOW_OFFSET + INNER_OFFSET + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + SHADOW_OFFSET + INNER_OFFSET + m_infobox_height + SHADOW_OFFSET; + + footer.setHeight(m_footer_height); m_x=getScreenStartX(m_width); - if (m_x < ConnectLineBox_Width) + if (m_x < ConnectLineBox_Width) // shouldn't happen m_x = ConnectLineBox_Width; m_y=getScreenStartY(m_height); + + // calc positions + m_header_y = m_y + m_topbox_height + SHADOW_OFFSET + INNER_OFFSET; + m_item_y = m_header_y + m_header_height; + m_footer_y = m_item_y + (m_listmaxshow * m_item_height); + m_infobox_y = m_footer_y + m_footer_height + SHADOW_OFFSET + INNER_OFFSET; } CUpnpBrowserGui::~CUpnpBrowserGui() @@ -903,14 +935,14 @@ void CUpnpBrowserGui::paintDeviceInfo() // third line tmp += m_devices[m_selecteddevice].modelurl; - topbox.setDimensionsAll(m_x, m_y, m_width, m_title_height-10); + topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) { - int ypos = m_y + m_title_height + m_theight + _pos*m_fheight; + int ypos = m_item_y + _pos*m_item_height; fb_pixel_t color; fb_pixel_t bgcolor; @@ -926,7 +958,7 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) color = COL_MENUCONTENT_TEXT; bgcolor = COL_MENUCONTENT_PLUS_0; } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); if (pos >= m_devices.size()) return; @@ -938,52 +970,53 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) std::string name = m_devices[pos].friendlyname; int w = g_Font[font_item]->getRenderWidth(name) + 5; - g_Font[font_item]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, - num, color, m_fheight); - g_Font[font_item]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, name, color, m_fheight); + g_Font[font_item]->RenderString(m_x + 10, ypos + m_item_height, m_width - 30 - w, + num, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - 15 - w, ypos + m_item_height, + w, name, color, m_item_height); } void CUpnpBrowserGui::paintDevices() { - int ypos, top; - // LCD CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); else header.removeContextButtons(); + //header.enableShadow(); header.paint(CC_SAVE_SCREEN_NO); // Items for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + int sb = m_item_height * m_listmaxshow; + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_MENUCONTENT_PLUS_1); unsigned int tmp_max = m_listmaxshow; if(!tmp_max) tmp_max = 1; int sbc = ((m_devices.size() - 1) / tmp_max) + 1; int sbs = ((m_selecteddevice) / tmp_max); - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + + //shadow + //m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0); // Foot - top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, 1, &RescanButton, m_width/2); + //footer.enableShadow(); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); paintItem2DetailsLine (-1); // clear it } void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int pos, unsigned int selected) { - int ypos = m_y + m_title_height + m_theight + pos*m_fheight; + int ypos = m_item_y + pos*m_item_height; fb_pixel_t color; fb_pixel_t bgcolor; @@ -997,7 +1030,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po color = COL_MENUCONTENT_TEXT; bgcolor = COL_MENUCONTENT_PLUS_0; } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); if (pos >= (*entries).size()) return; @@ -1047,10 +1080,10 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po if (icon_w && icon_h) { icon_o = icon_w + 10; - m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_fheight - icon_h) / 2); + m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_item_height - icon_h) / 2); } - g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_fheight, w, info, color, m_fheight); - g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_fheight, m_width - icon_o - 15 - 2*10 - w, name, color, m_fheight); + g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_item_height, w, info, color, m_item_height); + g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_item_height, m_width - icon_o - 15 - 2*10 - w, name, color, m_item_height); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) @@ -1093,8 +1126,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) if(lastname != entry->albumArtURI){ tmpname = lastname = entry->albumArtURI.c_str(); tmpname = g_PicViewer->DownloadImage(tmpname); - int h_image = ibox.getHeight()- SHADOW_OFFSET - ibox.getCornerRadius(); - int y_image = ibox.getYPos() + ibox.getHeight()/2 - h_image/2; + int h_image = infobox.getHeight() - INNER_OFFSET - infobox.getCornerRadius(); + int y_image = infobox.getYPos() + infobox.getHeight()/2 - h_image/2; if (!image){ image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0); image->doPaintBg(false); @@ -1102,7 +1135,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } image->setPicture(tmpname); image->setHeight(h_image, true); - int x_image = ibox.getXPos() + ibox.getWidth()- image->getWidth()- SHADOW_OFFSET - ibox.getCornerRadius(); + int x_image = infobox.getXPos() + infobox.getWidth() - image->getWidth() - INNER_OFFSET - infobox.getCornerRadius(); image->setXPos(x_image); } }else{ @@ -1117,8 +1150,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset) { -printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset); - int ypos, top; + printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset); //block infoclock CInfoClock::getInstance()->block(); @@ -1130,18 +1162,18 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, std::string name = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD); name += " : "; name += m_devices[m_selecteddevice].friendlyname; - CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, name, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, name, NEUTRINO_ICON_UPNP); if (CNeutrinoApp::getInstance()->isMuted()) header.setContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); + //header.enableShadow(); header.paint(CC_SAVE_SCREEN_NO); // Items for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + int sb = m_item_height * m_listmaxshow; + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_MENUCONTENT_PLUS_1); unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero int sbc = ((max + offset - 1) / tmp) + 1; int sbs = ((selected + offset) / tmp); @@ -1149,24 +1181,27 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, int sbh = 0; if ((sbc > 0) && (sbc > sb-4)) sbh = 2; - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_MENUCONTENT_PLUS_3); + m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_MENUCONTENT_PLUS_3); + + //shadow + //m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0); // Foot buttons - top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); - footer.paintButtons(m_x, top, m_width, m_buttonHeight, numbuttons, BrowseButtons, m_width/numbuttons); + //footer.enableShadow(); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, numbuttons, BrowseButtons, m_width/numbuttons); } void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) { // Foot info - int i_height = 2 * m_buttonHeight; - ibox.setDimensionsAll(m_x, footer.getYPos()+ footer.getHeight()+SHADOW_OFFSET, m_width-i_height-SHADOW_OFFSET, i_height); - timebox.setDimensionsAll(m_x + m_width - i_height, ibox.getYPos(), i_height, i_height); + int timebox_width = m_infobox_height; // maybe not enough + infobox.setDimensionsAll(m_x, m_infobox_y, m_width - SHADOW_OFFSET - INNER_OFFSET - timebox_width, m_infobox_height); + timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), m_infobox_height, timebox_width); printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); if ((!use_playing) && entry->isdir){ - ibox.kill(); + infobox.kill(); m_playing_entry_is_shown = false; }else{ string text = ""; @@ -1176,8 +1211,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text = m_playing_entry.title; text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : ""; text += "\n" + m_playing_entry.album; - ibox.setText(text, CTextBox::AUTO_WIDTH); - ibox.paint0(); + infobox.setText(text, CTextBox::AUTO_WIDTH); + infobox.paint0(); } }else{ if (!entry) @@ -1186,8 +1221,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text = entry->title; text += !entry->artist.empty() ? " - " + entry->artist : ""; text += "\n" + entry->album; - ibox.setText(text, CTextBox::AUTO_WIDTH); - ibox.paint0(); + infobox.setText(text, CTextBox::AUTO_WIDTH); + infobox.paint0(); } if (image) image->paint0(); @@ -1201,14 +1236,14 @@ void CUpnpBrowserGui::paintItem2DetailsLine (int pos) return; int xpos = m_x - ConnectLineBox_Width; - int ypos1 = m_y + m_title_height+0 + m_theight + pos*m_fheight; - int ypos2 = ibox.getYPos()+ ibox.getHeight()-ibox.getHeight()/2; + int ypos1 = m_item_y + pos*m_item_height; + int ypos2 = infobox.getYPos() + infobox.getHeight() - infobox.getHeight()/2; - int ypos1a = ypos1 + (m_fheight/2); + int ypos1a = ypos1 + (m_item_height/2); if (!dline) dline = new CComponentsDetailLine(); - dline->setDimensionsAll(xpos, ypos1a, ypos2, m_fheight/2, ibox.getHeight()-RADIUS_LARGE*3); + dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*3); dline->paint(); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index cb30bf08c..5c768d018 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -79,14 +79,19 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers unsigned int m_listmaxshow; unsigned int m_deviceliststart; unsigned int m_selecteddevice; - int m_fheight; // items font height - int m_theight; // title font height - int m_mheight; // lower box font height - int m_iheight; // upper box font height + int font_item; - int m_buttonHeight; - int m_title_height; - int m_info_height; + + int m_topbox_height; + int m_header_height; + int m_header_y; + int m_item_height; + int m_item_y; + int m_footer_height; + int m_footer_y; + int m_infobox_height; + int m_infobox_y; + bool m_folderplay; std::string m_playfolder; int m_playid; @@ -95,7 +100,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers time_t timeout; CComponentsDetailLine * dline; CComponentsFooter footer; - CComponentsInfoBox ibox, timebox, topbox; + CComponentsInfoBox topbox, infobox, timebox; CComponentsPicture *image; bool discoverDevices(); From 7a9e82e7ed1d649b007d4f40a5a814b310062309 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 Aug 2016 08:36:58 +0200 Subject: [PATCH 486/690] lua_cc_*: use COL_SHADOW for shadows Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1eab6a23ec3476c0c91ecfd9e5d8d3c913723b4 Author: vanhofen Date: 2016-08-16 (Tue, 16 Aug 2016) Origin message was: ------------------ - lua_cc_*: use COL_SHADOW for shadows --- src/gui/lua/lua_cc_header.cpp | 2 +- src/gui/lua/lua_cc_picture.cpp | 2 +- src/gui/lua/lua_cc_text.cpp | 2 +- src/gui/lua/lua_cc_window.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_cc_header.cpp b/src/gui/lua/lua_cc_header.cpp index c2273cde5..fa68852ee 100644 --- a/src/gui/lua/lua_cc_header.cpp +++ b/src/gui/lua/lua_cc_header.cpp @@ -76,7 +76,7 @@ int CLuaInstCCHeader::CCHeaderNew(lua_State *L) std::string caption, icon; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; tableLookup(L, "parent", (void**)&parent); tableLookup(L, "x", x); diff --git a/src/gui/lua/lua_cc_picture.cpp b/src/gui/lua/lua_cc_picture.cpp index 0e9c8bcbc..926bb520f 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -78,7 +78,7 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) lua_Integer alignment = 0; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; lua_Unsigned color_background = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; /* transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index a3717e76e..f7ed3a540 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -85,7 +85,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L) lua_Unsigned color_text = (lua_Unsigned)COL_MENUCONTENT_TEXT; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; tableLookup(L, "parent", (void**)&parent); tableLookup(L, "x", x); diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 969014378..9977bfa2b 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -74,7 +74,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) std::string name, icon = std::string(NEUTRINO_ICON_INFO); lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; std::string tmp1 = "false"; std::string btnRed = ""; std::string btnGreen = ""; From 9c8dabd7ba2865983958e88ee9b3241f3dc9b005 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 Aug 2016 08:37:38 +0200 Subject: [PATCH 487/690] ccomponents: use COL_SHADOW for shadows Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f60557e0bb5c1a2dae33380ba4455d71b251223 Author: vanhofen Date: 2016-08-16 (Tue, 16 Aug 2016) Origin message was: ------------------ - ccomponents: use COL_SHADOW for shadows --- src/gui/components/cc_detailsline.cpp | 2 +- src/gui/components/cc_detailsline.h | 2 +- src/gui/components/cc_draw.cpp | 2 +- src/gui/components/cc_extra.h | 16 ++++++++-------- src/gui/components/cc_frm.h | 2 +- src/gui/components/cc_frm_button.h | 24 ++++++++++++------------ src/gui/components/cc_frm_chain.h | 2 +- src/gui/components/cc_frm_clock.h | 2 +- src/gui/components/cc_frm_ext_text.h | 4 ++-- src/gui/components/cc_frm_footer.h | 4 ++-- src/gui/components/cc_frm_header.h | 6 +++--- src/gui/components/cc_frm_icons.h | 4 ++-- src/gui/components/cc_frm_scrollbar.h | 2 +- src/gui/components/cc_frm_slider.h | 2 +- src/gui/components/cc_frm_window.h | 10 +++++----- src/gui/components/cc_item.cpp | 2 +- src/gui/components/cc_item_infobox.h | 2 +- src/gui/components/cc_item_picture.h | 12 ++++++------ src/gui/components/cc_item_progressbar.h | 2 +- src/gui/components/cc_item_shapes.h | 4 ++-- src/gui/components/cc_item_text.h | 8 ++++---- src/gui/components/cc_item_tvpic.h | 2 +- 22 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 561f698a2..588a5e878 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -140,5 +140,5 @@ void CComponentsDetailLine::paint(bool do_save_bg) void CComponentsDetailLine::syncSysColors() { col_body = COL_MENUCONTENT_PLUS_6; - col_shadow = COL_MENUCONTENTDARK_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 d60d09c1d..37d01e4f0 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -57,7 +57,7 @@ class CComponentsDetailLine : public CComponents public: CComponentsDetailLine( 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_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsDetailLine(); ///set colors diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 8934d66e4..8893cc73c 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -38,7 +38,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) width = width_old = CC_WIDTH_MIN; col_body = col_body_old = COL_MENUCONTENT_PLUS_0; - col_shadow = col_shadow_old = COL_MENUCONTENTDARK_PLUS_0; + col_shadow = col_shadow_old = COL_SHADOW_PLUS_0; col_frame = col_frame_old = COL_MENUCONTENT_PLUS_6; col_frame_sel = col_frame_sel_old = COL_MENUCONTENTSELECTED_PLUS_0; diff --git a/src/gui/components/cc_extra.h b/src/gui/components/cc_extra.h index 09e92d013..d8311e67f 100644 --- a/src/gui/components/cc_extra.h +++ b/src/gui/components/cc_extra.h @@ -63,7 +63,7 @@ * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -88,7 +88,7 @@ bool paintBoxRel( const int& x, const int& w_frame = 0, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint a box on screen. * @param[in] x position @@ -110,7 +110,7 @@ bool paintBoxRel( const int& x, * @li CORNER_ALL * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -131,7 +131,7 @@ bool paintBoxRel0( const int& x, const int& w_frame = 0, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint a text box on screen. * @param[in] std::string& text @@ -175,7 +175,7 @@ bool paintBoxRel0( const int& x, * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -206,7 +206,7 @@ bool paintTextBoxRel( const std::string& text, const int& gradient_intensity = CColorGradient::normal, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint an image on screen. * @param[in] std::string& full path or filename @@ -250,7 +250,7 @@ bool paintTextBoxRel( const std::string& text, * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -272,5 +272,5 @@ bool paintImage( const std::string& image_name, const int& corner_type = CORNER_NONE, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); #endif diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 94c488350..3e678bfa7 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -68,7 +68,7 @@ class CComponentsForm : public CComponentsItem int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsForm(); ///paints current form on screen, for paint a page use paintPage() diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 9a079b427..eb754eef1 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;} @@ -204,7 +204,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -215,7 +215,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -235,7 +235,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -246,7 +246,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -266,7 +266,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -277,7 +277,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -297,7 +297,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; @@ -308,7 +308,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; diff --git a/src/gui/components/cc_frm_chain.h b/src/gui/components/cc_frm_chain.h index 2a13a14be..6b6e7b5c2 100644 --- a/src/gui/components/cc_frm_chain.h +++ b/src/gui/components/cc_frm_chain.h @@ -69,7 +69,7 @@ class CComponentsFrmChain : public CComponentsForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsFrmChain(); //inherited from CComponentsForm ///defines mode for arrangement direction of items, see also chn_direction diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index b91d2454b..74e859df9 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -104,7 +104,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int font_style = CNeutrinoFonts::FONT_STYLE_BOLD ); virtual ~CComponentsFrmClock(); diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 0bf45f508..6bf1a23db 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -84,7 +84,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen fb_pixel_t text_color = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsExtTextForm(); //inherited from CComponentsForm ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height @@ -145,7 +145,7 @@ class CComponentsExtTextFormLocalized : public CComponentsExtTextForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t text_color = COL_MENUCONTENT_TEXT, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index bd41de717..311afbc3e 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -66,7 +66,7 @@ class CComponentsFooter : public CComponentsHeader int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///show button frame and background, default false bool btn_contour; @@ -87,7 +87,7 @@ class CComponentsFooter : public CComponentsHeader int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + 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); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 45354ca2e..fda8f4835 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -48,7 +48,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); protected: ///object: icon object, see also setIcon() @@ -126,7 +126,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsHeader(); @@ -264,7 +264,7 @@ class CComponentsHeaderLocalized : public CComponentsHeader int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_frm_icons.h b/src/gui/components/cc_frm_icons.h index c48fdd3ca..16f162345 100644 --- a/src/gui/components/cc_frm_icons.h +++ b/src/gui/components/cc_frm_icons.h @@ -39,7 +39,7 @@ class CComponentsIconForm : public CComponentsFrmChain int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); public: CComponentsIconForm(CComponentsForm *parent = NULL); @@ -48,7 +48,7 @@ class CComponentsIconForm : public CComponentsFrmChain CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsIconForm(); //inherited from CComponentsForm void addIcon(const std::string& icon_name); diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index fdf26a308..068b78e58 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -65,7 +65,7 @@ class CComponentsScrollBar : public CComponentsFrmChain CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_3, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsScrollBar(); //inherited from CComponentsForm ///set marked segment, 1st = 0, 2nd = 1 ... diff --git a/src/gui/components/cc_frm_slider.h b/src/gui/components/cc_frm_slider.h index 97e5d7e98..a5e06dcd9 100644 --- a/src/gui/components/cc_frm_slider.h +++ b/src/gui/components/cc_frm_slider.h @@ -69,7 +69,7 @@ class CComponentsSlider : public CComponentsForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsSlider(); //inherited from CComponentsForm void setValuePos(const int& current_value); diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index b88187458..fe031b2d7 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -112,7 +112,7 @@ class CComponentsWindow : public CComponentsForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///initialize width and height void initWindowSize(); ///initialize position @@ -137,7 +137,7 @@ class CComponentsWindow : public CComponentsForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption from locales, x_pos or y_pos = 0 will center window CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -147,7 +147,7 @@ class CComponentsWindow : public CComponentsForm int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add item to body object, also usable is addCCItem() to add items to the windo object int addWindowItem(CComponentsItem* cc_Item); @@ -233,7 +233,7 @@ class CComponentsWindowMax : public CComponentsWindow int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "", @@ -241,7 +241,7 @@ class CComponentsWindowMax : public CComponentsWindow int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index a1f30fc16..e973996e1 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -145,7 +145,7 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const void CComponentsItem::syncSysColors() { col_body = COL_MENUCONTENT_PLUS_0; - col_shadow = COL_MENUCONTENTDARK_PLUS_0; + col_shadow = COL_SHADOW_PLUS_0; col_frame = COL_MENUCONTENT_PLUS_6; } diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h index 189dbb42c..19ea2dfa6 100644 --- a/src/gui/components/cc_item_infobox.h +++ b/src/gui/components/cc_item_infobox.h @@ -74,7 +74,7 @@ class CComponentsInfoBox : public CComponentsText fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsInfoBox(); diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index da8befa29..72605f058 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -114,7 +114,7 @@ class CComponentsPicture : public CComponentsItem int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE); /*! @@ -130,7 +130,7 @@ class CComponentsPicture : public CComponentsItem int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE); virtual~CComponentsPicture() { @@ -198,7 +198,7 @@ class CComponentsPictureScalable : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE) : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; }; @@ -233,7 +233,7 @@ class CComponentsChannelLogo : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK); /*! @@ -249,7 +249,7 @@ class CComponentsChannelLogo : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK); ///set channel id and/or channel name, NOTE: channel name is prefered @@ -282,7 +282,7 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK) : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; }; diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index c3bcb40b5..8c9c94129 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -100,7 +100,7 @@ class CProgressBar : public CComponentsItem const int h = -1, fb_pixel_t color_frame = 0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, const fb_pixel_t active_col = COL_INFOBAR_PLUS_7, const fb_pixel_t passive_col = COL_INFOBAR_PLUS_3, const int R = 40, diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h index 47e3ecf14..9b4c26df4 100644 --- a/src/gui/components/cc_item_shapes.h +++ b/src/gui/components/cc_item_shapes.h @@ -47,7 +47,7 @@ class CComponentsShapeCircle : public CComponentsItem CComponentsShapeCircle( const int x_pos, const int y_pos, const int diam, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set property: diam inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;}; @@ -64,7 +64,7 @@ class CComponentsShapeSquare : public CComponentsItem CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 48450de61..344f99b2a 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -109,7 +109,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox const int& font_style = CComponentsText::FONT_STYLE_REGULAR, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsText( CComponentsForm *parent, const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, @@ -118,7 +118,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox Font* font_text = NULL, const int& font_style = CComponentsText::FONT_STYLE_REGULAR, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsText(); @@ -134,7 +134,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox virtual void setTextColor(const fb_pixel_t& color_text); ///set all basic framebuffer element colors at once ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" - virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT) + virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT) { CCDraw::setColorAll(color_frame, color_body, color_shadow); setTextColor(color_text); @@ -256,7 +256,7 @@ class CComponentsLabel : public CComponentsText fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_LABEL; diff --git a/src/gui/components/cc_item_tvpic.h b/src/gui/components/cc_item_tvpic.h index 1ffc0ebe8..4f1e22e8b 100644 --- a/src/gui/components/cc_item_tvpic.h +++ b/src/gui/components/cc_item_tvpic.h @@ -54,7 +54,7 @@ class CComponentsPIP : public CComponentsItem CComponentsPIP( const int x_pos = 0, const int y_pos = 0, const int percent = 30, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_BLACK, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_BLACK, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsPIP(); ///set property: width of tv box in pixel From 317286e9ada67e8cd80cb12dd175e79164be8ab0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 15 Aug 2016 14:42:54 +0200 Subject: [PATCH 488/690] Sort locale Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be469d3549dd57552ff90b39e3fbc7f2de71ebb7 Author: Michael Liebmann Date: 2016-08-15 (Mon, 15 Aug 2016) --- data/locale/deutsch.locale | 4 ++-- data/locale/english.locale | 4 ++-- src/system/locals.h | 4 ++-- src/system/locals_intern.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1b36d22fb..a56632c3f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1054,6 +1054,8 @@ menu.hint_font_gui Wählen Sie die Schriftart für die Menüs menu.hint_font_scaling Legen Sie die vertikale und horizontale Skalierung der Menüschrift fest menu.hint_font_ttx Wählen Sie die Schriftart für den Teletext menu.hint_fonts Konfigurieren Sie die Schriftart und die Schriftgrößen für die Menüs +menu.hint_foot_back Ändern Sie die Fußleisten-Hintergrundfarbe +menu.hint_foot_textcolor Ändern Sie die Fußleisten-Textfarbe menu.hint_games Zeige Liste der installierten Spiele menu.hint_hdd Formatierung und Prüfung der Datenträger menu.hint_hdd_apply Die veränderten Einstellungen zum Sleep- und Akustik-Modus werden übernommen @@ -1064,8 +1066,6 @@ menu.hint_hdd_noise Setzen Sie Parameter für das Automatic Acoustic Management. menu.hint_hdd_sleep Dieser Wert definiert, nach wieviel Minuten die Festplatte bei Inaktivität in den Sleep-Modus geschaltet wird menu.hint_hdd_statfs Legen Sie fest, wann die Aufnahmeverzeichnis-Füllstandsanzeige im InfoViewer (und ggf. am VFD-Display) aktualisiert werden darf menu.hint_hdd_tools Formatieren Sie die gefundenen Datenträger bzw. überprüfen Sie deren Dateisystem -menu.hint_foot_back Ändern Sie die Fußleisten-Hintergrundfarbe -menu.hint_foot_textcolor Ändern Sie die Fußleisten-Textfarbe menu.hint_head_back Ändern Sie die Titel-Hintergrundfarbe menu.hint_head_textcolor Ändern Sie die Titel-Textfarbe menu.hint_imageinfo Informationen über die installierte Software diff --git a/data/locale/english.locale b/data/locale/english.locale index bbcc2522c..32d397b37 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1054,6 +1054,8 @@ menu.hint_font_gui Select font file to use for GUI menu.hint_font_scaling Set global vertical and horizontal\nGUI font scaling menu.hint_font_ttx Select font file to use for teletext menu.hint_fonts Configure GUI fonts and font sizes +menu.hint_foot_back Change GUI footer background color +menu.hint_foot_textcolor Change GUI window footer text color menu.hint_games Show list of installed games menu.hint_hdd Format / check data storage menu.hint_hdd_apply Apply sleep/noise parameters @@ -1064,8 +1066,6 @@ menu.hint_hdd_noise Set Automatic Acoustic Management\nnot all drives support th menu.hint_hdd_sleep Select time to stop hdd on inactivity menu.hint_hdd_statfs Specify when the recording directory fill level in infoviewer and, if available, on VFD, may be updated menu.hint_hdd_tools Initialize HDD, check filesystem -menu.hint_foot_back Change GUI footer background color -menu.hint_foot_textcolor Change GUI window footer text color menu.hint_head_back Change GUI title background color menu.hint_head_textcolor Change GUI window title text color menu.hint_imageinfo Information about installed software diff --git a/src/system/locals.h b/src/system/locals.h index 2e832f0d9..54ceee3fb 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1081,6 +1081,8 @@ typedef enum LOCALE_MENU_HINT_FONT_SCALING, LOCALE_MENU_HINT_FONT_TTX, LOCALE_MENU_HINT_FONTS, + LOCALE_MENU_HINT_FOOT_BACK, + LOCALE_MENU_HINT_FOOT_TEXTCOLOR, LOCALE_MENU_HINT_GAMES, LOCALE_MENU_HINT_HDD, LOCALE_MENU_HINT_HDD_APPLY, @@ -1091,8 +1093,6 @@ typedef enum LOCALE_MENU_HINT_HDD_SLEEP, LOCALE_MENU_HINT_HDD_STATFS, LOCALE_MENU_HINT_HDD_TOOLS, - LOCALE_MENU_HINT_FOOT_BACK, - LOCALE_MENU_HINT_FOOT_TEXTCOLOR, LOCALE_MENU_HINT_HEAD_BACK, LOCALE_MENU_HINT_HEAD_TEXTCOLOR, LOCALE_MENU_HINT_IMAGEINFO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a195a53b2..7c5c6e304 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1081,6 +1081,8 @@ const char * locale_real_names[] = "menu.hint_font_scaling", "menu.hint_font_ttx", "menu.hint_fonts", + "menu.hint_foot_back", + "menu.hint_foot_textcolor", "menu.hint_games", "menu.hint_hdd", "menu.hint_hdd_apply", @@ -1091,8 +1093,6 @@ const char * locale_real_names[] = "menu.hint_hdd_sleep", "menu.hint_hdd_statfs", "menu.hint_hdd_tools", - "menu.hint_foot_back", - "menu.hint_foot_textcolor", "menu.hint_head_back", "menu.hint_head_textcolor", "menu.hint_imageinfo", From 031b190d4c168ed140854396f54c558093868bad Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 16 Aug 2016 15:08:49 +0200 Subject: [PATCH 489/690] CUpnpBrowserGui: Fix segfault at neutrino start Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b015f65d4c0a9dc887f12660488ed7e93e6e006d Author: Michael Liebmann Date: 2016-08-16 (Tue, 16 Aug 2016) --- src/gui/upnpbrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 5d5686795..0afb9803c 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -73,8 +73,6 @@ CUpnpBrowserGui::CUpnpBrowserGui() Init(); - font_item = SNeutrinoSettings::FONT_TYPE_MENU; - dline = NULL; image = NULL; @@ -87,6 +85,8 @@ CUpnpBrowserGui::CUpnpBrowserGui() void CUpnpBrowserGui::Init() { + font_item = SNeutrinoSettings::FONT_TYPE_MENU; + topbox.enableFrame(true, 2); topbox.setCorner(RADIUS_LARGE); topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); From 0c1a472004b785a10d1bb2466d5ac310f16c0167 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 Aug 2016 23:35:56 +0200 Subject: [PATCH 490/690] themes: change footer colors defaults these colors historically depends on infobar colors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64bc3c5adc72037f16e13448310a9fd89a47f01d Author: vanhofen Date: 2016-08-16 (Tue, 16 Aug 2016) Origin message was: ------------------ - themes: change footer colors defaults these colors historically depends on infobar colors --- src/gui/themes.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 58965f1f3..c3d2da0d2 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -360,14 +360,6 @@ void CThemes::getTheme(CConfigFile &configfile) t.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); t.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); t.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); - t.menu_Foot_alpha = configfile.getInt32( "menu_Foot_alpha", 0x08 ); - t.menu_Foot_red = configfile.getInt32( "menu_Foot_red", 0x10 ); - t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", 0x10 ); - t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", 0x10 ); - t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 ); - t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", 0x40 ); - t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", 0x40 ); - t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", 0x40 ); t.menu_Hint_gradient = configfile.getInt32( "menu_Hint_gradient", CC_COLGRAD_OFF); t.menu_Hint_gradient_direction = configfile.getInt32( "menu_Hint_gradient_direction", CFrameBuffer::gradientVertical); @@ -379,6 +371,12 @@ void CThemes::getTheme(CConfigFile &configfile) t.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); t.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); + //t.menu_Foot default historically depends on t.infobar + t.menu_Foot_alpha = configfile.getInt32( "menu_Foot_alpha", t.infobar_alpha ); + t.menu_Foot_red = configfile.getInt32( "menu_Foot_red", int(t.infobar_red*0.4)+14 ); + t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", int(t.infobar_green*0.4)+14 ); + t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", int(t.infobar_blue*0.4)+14 ); + t.infobar_gradient_top = configfile.getInt32( "infobar_gradient_top", CC_COLGRAD_OFF ); t.infobar_gradient_top_direction = configfile.getInt32( "infobar_gradient_top_direction", CFrameBuffer::gradientVertical ); t.infobar_gradient_body = configfile.getInt32( "infobar_gradient_body", CC_COLGRAD_OFF); @@ -395,6 +393,12 @@ void CThemes::getTheme(CConfigFile &configfile) t.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); t.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); + //t.menu_Foot_Text default historically depends on t.infobar_Text + t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 ); + t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", int(t.infobar_Text_red*0.6) ); + t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", int(t.infobar_Text_green*0.6) ); + t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", int(t.infobar_Text_blue*0.6) ); + t.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); t.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); t.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); From a446ecdd3d1fac1ab101774e832668f0aff203b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Aug 2016 10:34:36 +0200 Subject: [PATCH 491/690] CUpnpBrowserGui: enable missing shadows Supplement for 29698685b6ac19bdf0683cfffa27093805db4af4 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6163c4f5ed4c46da7342241b628e34df12e4dc50 Author: Thilo Graf Date: 2016-08-17 (Wed, 17 Aug 2016) --- src/gui/upnpbrowser.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 0afb9803c..6ba43bc41 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -89,24 +89,24 @@ void CUpnpBrowserGui::Init() topbox.enableFrame(true, 2); topbox.setCorner(RADIUS_LARGE); - topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_MENUHEAD_TEXT); + topbox.setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0, COL_MENUHEAD_TEXT); topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - //topbox.enableShadow(); + topbox.enableShadow(CC_SHADOW_ON, -1, true); infobox.enableFrame(true, 2); infobox.setCorner(RADIUS_LARGE); infobox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); - //infobox.enableShadow(); + infobox.enableShadow(CC_SHADOW_ON, -1, true); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); timebox.setColorAll(infobox.getColorFrame(), infobox.getColorBody()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); - //timebox.enableShadow(); + timebox.enableShadow(CC_SHADOW_ON, -1, true); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); @@ -132,9 +132,6 @@ void CUpnpBrowserGui::Init() * - footer * INNER_OFFSET * infobox/timebox (with shadow) - * - * Note: box shadows are disabled atm, so it looks like double offset between boxes - * box shadows seems buggy in ccomponents classes */ m_listmaxshow = (m_height - m_topbox_height - SHADOW_OFFSET - INNER_OFFSET - m_header_height - m_footer_height - SHADOW_OFFSET - INNER_OFFSET - m_infobox_height - SHADOW_OFFSET) / (m_item_height); @@ -143,6 +140,7 @@ void CUpnpBrowserGui::Init() m_height = m_topbox_height + SHADOW_OFFSET + INNER_OFFSET + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + SHADOW_OFFSET + INNER_OFFSET + m_infobox_height + SHADOW_OFFSET; footer.setHeight(m_footer_height); + footer.enableShadow(CC_SHADOW_ON, -1, true); m_x=getScreenStartX(m_width); if (m_x < ConnectLineBox_Width) // shouldn't happen @@ -983,6 +981,7 @@ void CUpnpBrowserGui::paintDevices() // Head CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + header.enableShadow(CC_SHADOW_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); else @@ -1005,10 +1004,9 @@ void CUpnpBrowserGui::paintDevices() m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); //shadow - //m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0); // Foot - //footer.enableShadow(); footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); paintItem2DetailsLine (-1); // clear it @@ -1188,7 +1186,7 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel // Foot buttons size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); - //footer.enableShadow(); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, numbuttons, BrowseButtons, m_width/numbuttons); } From a742189d0e23e3cb9ba3c1d84ff760c7a439e84c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 Aug 2016 10:55:12 +0200 Subject: [PATCH 492/690] CMenuWidget: adopt shadow color to newer color macros Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1306a7c1a32c338b3c7f0003f51d19d433aba8a2 Author: Thilo Graf Date: 2016-08-17 (Wed, 17 Aug 2016) --- src/gui/widget/menue.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index db00dff45..2776f43d9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1244,14 +1244,13 @@ void CMenuWidget::paint() header->setOffset(10); } header->setColorBody(COL_MENUHEAD_PLUS_0); - header->setColorShadow(COL_MENUCONTENTDARK_PLUS_0); header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow - frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, width + sb_width, height - hheight + RADIUS_LARGE + (fbutton_count ? fbutton_height : 0), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, width + sb_width, height - hheight + RADIUS_LARGE + (fbutton_count ? fbutton_height : 0), COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // paint body background frameBuffer->paintBoxRel(x, y+hheight, width + sb_width, height-hheight + RADIUS_LARGE, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? CORNER_NONE : CORNER_BOTTOM)); @@ -1481,7 +1480,7 @@ void CMenuWidget::paintHint(int pos) info_box->removeLineBreaks(str); info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT], COL_MENUCONTENT_TEXT); info_box->setCorner(RADIUS_LARGE); - info_box->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + info_box->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0); info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_MENUFOOT_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);// COL_MENUFOOT_PLUS_0 is default footer color From 6a997dfeba5b7222de46fd6a71715f566b1f2f8e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 Aug 2016 17:23:08 +0200 Subject: [PATCH 493/690] src/gui/widget/menue.cpp check if pointer is not NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a29f433dedf281cc558bf27c9496b80bb91f949b Author: Jacek Jendrzej Date: 2016-08-17 (Wed, 17 Aug 2016) --- src/gui/widget/menue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 2776f43d9..5d6c73335 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1428,7 +1428,8 @@ void CMenuWidget::paintHint(int pos) /* clear info box */ if ((info_box) && (pos < 0)) savescreen ? info_box->hide() : info_box->kill(); - hint_painted = info_box->isPainted(); + if (info_box) + hint_painted = info_box->isPainted(); } if (pos < 0) return; From 5ac8d0085b86fd5b40bf772187548820adc1f277 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 19 Aug 2016 21:17:45 +0200 Subject: [PATCH 494/690] src/gui/lua/lua_cc_text.cpp if dx and dy is not set and text have parent use Height and Width size from parent Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a648daba757c9d9b27a23269ecc3881ac5a2ec62 Author: Jacek Jendrzej Date: 2016-08-19 (Fri, 19 Aug 2016) --- src/gui/lua/lua_cc_text.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index f7ed3a540..243aeaf3a 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -77,7 +77,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCCWindow* parent = NULL; - lua_Integer x=10, y=10, dx=100, dy=100; + lua_Integer x=10, y=10, dx=-1, dy=-1; std::string text = ""; std::string tmpMode = ""; lua_Integer mode = CTextBox::AUTO_WIDTH; @@ -139,6 +139,16 @@ int CLuaInstCCText::CCTextNew(lua_State *L) } CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; + if(pw){ + if(dx == -1) + dx = pw->getHeight(); + if(dy == -1) + dy = pw->getWidth(); + } + if(dx == -1) + dx = 100; + if(dy == -1) + dy = 100; CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *)); *udata = new CLuaCCText(); From 882bdf5b2d1a7098a0e2d012c9e250a135e9e6ec Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 09:54:12 +0200 Subject: [PATCH 495/690] supplement to 5ac8d0085b86fd5b40bf772187548820adc1f277 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/27ddf8935d36ff8a73ee9ac7aa24d41e53c31921 Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) --- src/gui/lua/lua_cc_text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 243aeaf3a..e4c8d637e 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -140,14 +140,14 @@ int CLuaInstCCText::CCTextNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; if(pw){ - if(dx == -1) + if(dx < 1) dx = pw->getHeight(); - if(dy == -1) + if(dy < 1) dy = pw->getWidth(); } - if(dx == -1) + if(dx < 1) dx = 100; - if(dy == -1) + if(dy < 1) dy = 100; CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *)); From f1912db7201099980f79f8ace316962b3c5ff99c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 13:59:15 +0200 Subject: [PATCH 496/690] 2:supplement to 5ac8d0085b86fd5b40bf772187548820adc1f277 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c37ef21912e77cf5673642c6fabfe46556541d2b Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) Origin message was: ------------------ 2:supplement to 5ac8d0085b86fd5b40bf772187548820adc1f277 --- src/gui/lua/lua_cc_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index e4c8d637e..60f23f78c 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -140,10 +140,10 @@ int CLuaInstCCText::CCTextNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; if(pw){ - if(dx < 1) - dx = pw->getHeight(); if(dy < 1) - dy = pw->getWidth(); + dy = pw->getHeight(); + if(dx < 1) + dx = pw->getWidth(); } if(dx < 1) dx = 100; From 46b77c77e6ceb85dd20b8f0e24d07989a46029a1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 16:20:16 +0200 Subject: [PATCH 497/690] src/gui/components/cc_frm_window.cpp dont paint over screen size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/912017621ba3c0a753514fd6c69ea1f3377e8af5 Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) --- src/gui/components/cc_frm_window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 869acd530..e808e28b1 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -170,8 +170,13 @@ void CComponentsWindow::initWindowSize() if (width == 0) width = frameBuffer->getScreenWidth(); + else if ((unsigned)width > frameBuffer->getScreenWidth()) + width = frameBuffer->getScreenWidth(); + if (height == 0) height = frameBuffer->getScreenHeight(); + else if((unsigned)height > frameBuffer->getScreenHeight()) + height = frameBuffer->getScreenHeight(); } void CComponentsWindow::initWindowPos() From 7e874ddf64a4255aa9c9792ab95bc7acce02447d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 21 Aug 2016 16:17:28 +0200 Subject: [PATCH 498/690] lua_cc_picture: add cpicture getHeight / getWidth option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5051a100fbc738f344749d30c51a47b6eb551df Author: Jacek Jendrzej Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/lua/lua_cc_picture.cpp | 22 ++++++++++++++++++++++ src/gui/lua/lua_cc_picture.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/gui/lua/lua_cc_picture.cpp b/src/gui/lua/lua_cc_picture.cpp index 926bb520f..b383bd79b 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -57,6 +57,8 @@ void CLuaInstCCPicture::CCPictureRegister(lua_State *L) { "hide", CLuaInstCCPicture::CCPictureHide }, { "setPicture", CLuaInstCCPicture::CCPictureSetPicture }, { "setCenterPos", CLuaInstCCPicture::CCPictureSetCenterPos }, + { "getHeight", CLuaInstCCPicture::CCPictureGetHeight }, + { "getWidth", CLuaInstCCPicture::CCPictureGetWidth }, { "__gc", CLuaInstCCPicture::CCPictureDelete }, { NULL, NULL } }; @@ -126,6 +128,26 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) return 1; } +int CLuaInstCCPicture::CCPictureGetHeight(lua_State *L) +{ + CLuaCCPicture *D = CCPictureCheck(L, 1); + if (!D) return 0; + + int h = D->cp->getHeight(); + lua_pushinteger(L, h); + return 1; +} + +int CLuaInstCCPicture::CCPictureGetWidth(lua_State *L) +{ + CLuaCCPicture *D = CCPictureCheck(L, 1); + if (!D) return 0; + + int w = D->cp->getWidth(); + lua_pushinteger(L, w); + return 1; +} + int CLuaInstCCPicture::CCPicturePaint(lua_State *L) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_picture.h b/src/gui/lua/lua_cc_picture.h index 2fb7c3e14..8bbc697ad 100644 --- a/src/gui/lua/lua_cc_picture.h +++ b/src/gui/lua/lua_cc_picture.h @@ -46,6 +46,8 @@ class CLuaInstCCPicture static int CCPictureHide(lua_State *L); static int CCPictureSetPicture(lua_State *L); static int CCPictureSetCenterPos(lua_State *L); + static int CCPictureGetHeight(lua_State *L); + static int CCPictureGetWidth(lua_State *L); static int CCPictureDelete(lua_State *L); }; From fcfb4c41e56721030fd6c326a26ba6622f6f4519 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 21 Aug 2016 18:29:10 +0200 Subject: [PATCH 499/690] lua_cc_window: add setDimensionsAll option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c26de095c29ce2e44243f196e8eac6b8b1b50eb Author: Jacek Jendrzej Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/lua/lua_cc_window.cpp | 23 +++++++++++++++++++++++ src/gui/lua/lua_cc_window.h | 1 + 2 files changed, 24 insertions(+) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 9977bfa2b..754a1c16d 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -56,6 +56,7 @@ void CLuaInstCCWindow::CCWindowRegister(lua_State *L) { "header_height", CLuaInstCCWindow::CCWindowGetHeaderHeight_dep }, /* function 'header_height' is deprecated */ { "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */ { "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos }, + { "setDimensionsAll", CLuaInstCCWindow::CCWindowSetDimensionsAll }, { "__gc", CLuaInstCCWindow::CCWindowDelete }, { NULL, NULL } }; @@ -295,6 +296,28 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L) return 1; } +int CLuaInstCCWindow::CCWindowSetDimensionsAll(lua_State *L) +{ + CLuaCCWindow *D = CCWindowCheck(L, 1); + if (!D) return 0; + lua_Integer x = luaL_checkint(L, 2); + lua_Integer y = luaL_checkint(L, 3); + lua_Integer w = luaL_checkint(L, 4); + lua_Integer h = luaL_checkint(L, 5); + if(x>-1 && y > -1 && w > 1 && h > 1){ + if (h > (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight()) + h = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight(); + if (w > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth()) + w = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(); + if(x > w) + x = 0; + if(y > h) + y = 0; + D->w->setDimensionsAll(x,y,w,h); + } + return 0; +} + int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_window.h b/src/gui/lua/lua_cc_window.h index 0e32bc386..98cd9ac86 100644 --- a/src/gui/lua/lua_cc_window.h +++ b/src/gui/lua/lua_cc_window.h @@ -51,6 +51,7 @@ class CLuaInstCCWindow static int CCWindowGetFooterHeight_dep(lua_State *L); // function 'footer_height' is deprecated static int CCWindowSetCenterPos(lua_State *L); static int CCWindowDelete(lua_State *L); + static int CCWindowSetDimensionsAll(lua_State *L); }; #endif //_LUACCWINDOW_H From c9f0b15a1ddeafef0ab2312f4fc31b540f97fc6c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 22 Aug 2016 04:25:33 +0200 Subject: [PATCH 500/690] Complete missing lua api versions: - colors: some internal renamings (78230ea) v1.40 - colors: make footer background color configurable (70abfb3) v1.41 - luainstance: add missing entry for shadow color (832649c) v1.42 - cc_text: if dx and dy is not set and text have parent use Height (5ac8d00) v1.43 - cc_window: dont paint over screen size (46b77c7) v1.44 - cpicture: Add getHeight/getWidth option (7e874dd) v1.45 - cpicture: Add setDimensionsAll option (fcfb4c4) v1.46 - Set Lua api version to 1.46 See also neutrino-hd wiki: https://wiki.neutrino-hd.de/wiki/Neutrino_HD_Lua_API#Changelog Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c990411575812689b988e3bb6418d64550b5f763 Author: Michael Liebmann Date: 2016-08-22 (Mon, 22 Aug 2016) Origin message was: ------------------ Complete missing lua api versions: - colors: some internal renamings (78230ea) v1.40 - colors: make footer background color configurable (70abfb3) v1.41 - luainstance: add missing entry for shadow color (832649c) v1.42 - cc_text: if dx and dy is not set and text have parent use Height (5ac8d00) v1.43 - cc_window: dont paint over screen size (46b77c7) v1.44 - cpicture: Add getHeight/getWidth option (7e874dd) v1.45 - cpicture: Add setDimensionsAll option (fcfb4c4) v1.46 - Set Lua api version to 1.46 See also neutrino-hd wiki: https://wiki.neutrino-hd.de/wiki/Neutrino_HD_Lua_API#Changelog --- src/gui/lua/lua_api_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index f95bdbc54..51f649f64 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 39 +#define LUA_API_VERSION_MINOR 46 From a8292eae0b922430aeebe9647e505764d3e48e49 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Aug 2016 20:59:06 +0200 Subject: [PATCH 501/690] src/gui/lua/lua_cc_window.cpp use setButtonLabels real window width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/52d16769f13ca14abd9d5cc72c368a6bb73b06fd Author: Jacek Jendrzej Date: 2016-08-22 (Mon, 22 Aug 2016) --- src/gui/lua/lua_cc_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 754a1c16d..03313ca22 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -161,7 +161,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) buttons.push_back(btnSblue); } if (!buttons.empty()) - footer->setButtonLabels(buttons, dx-20, (dx-20) / (buttons.size()+1)); + footer->setButtonLabels(buttons, (*udata)->w->getWidth()-20, ((*udata)->w->getWidth()-20) / (buttons.size()+1)); } } From cdd40d98b0407e2978affd6c89d7231d7e2ac099 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 20 Aug 2016 23:54:40 +0200 Subject: [PATCH 502/690] CComponentsFooter: use background color of footer inside chain object Ensure pass of bg color from parent into chain object and button objects. Required by embedded button objects. This prevents "holes" on screen. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a92757697f6f911fd36016e0a39c62ca4f2bf10d Author: Thilo Graf Date: 2016-08-20 (Sat, 20 Aug 2016) --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index de72490fd..7945d8a3c 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -117,7 +117,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //footer as primary container (in this context '=this') and the parent for the button label container (chain object), //button label container (chain object) itself is concurrent the parent object for button objects. if (chain == NULL){ - chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); + chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, col_body); chain->setCorner(this->corner_rad, this->corner_type); chain->doPaintBg(false); } From 27f527bb45de9ab3c6eaf4d6f60b28a08ce40b74 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Aug 2016 14:22:08 +0200 Subject: [PATCH 503/690] CComponentsWindow: simplify statements Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca5702acf4b3ccb52bf5944206e89c06abe64a72 Author: Thilo Graf Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/components/cc_frm_window.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index e808e28b1..a3a5ba43e 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -168,14 +168,10 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; - if (width == 0) - width = frameBuffer->getScreenWidth(); - else if ((unsigned)width > frameBuffer->getScreenWidth()) + if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); - if (height == 0) - height = frameBuffer->getScreenHeight(); - else if((unsigned)height > frameBuffer->getScreenHeight()) + if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } From 5e16a9f6b4f05bd9c829bdbe9a62cb1de18c52a6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Aug 2016 15:12:01 +0200 Subject: [PATCH 504/690] CComponentsButton: reduce shadow width buttons are mostly small elements, so these elements should have a reasonable shadow width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2cf409bc27a227adbdb2da76bc88dd677774d583 Author: Thilo Graf Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/components/cc_frm_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index a92617ebf..24b2d8917 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -100,7 +100,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const width = w; height = h; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = SHADOW_OFFSET/2; //buttons are mostly small elements, so these elements should have a reasonable shadow width cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); @@ -113,7 +113,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons append_x_offset = 6; append_y_offset = 0; - corner_rad = 0; + corner_rad = RADIUS_SMALL; cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; cc_btn_capt_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT; From d2c96fd9e7387721296a99632e6b9e8f0d95a251 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Aug 2016 20:45:12 +0200 Subject: [PATCH 505/690] CMenuWidget: assign all layer colors out of header init This fixes missing applying of possible changes of colour settings in color setup for frame. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/41ed6513bd28911ef0e7e1f62631939ef0aa6c9f Author: Thilo Graf Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 5d6c73335..21af5cd46 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1243,7 +1243,7 @@ void CMenuWidget::paint() header->enableShadow(CC_SHADOW_RIGHT); header->setOffset(10); } - header->setColorBody(COL_MENUHEAD_PLUS_0); + header->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); From e371ec33837897a9f1305fd68de66b073dc25615 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 22 Aug 2016 21:11:38 +0200 Subject: [PATCH 506/690] CComponentsWindow: fix possible holes between frame and footer One line was to much Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/90866b232a4780a9c8616f80ed75cb7320848169 Author: Thilo Graf Date: 2016-08-22 (Mon, 22 Aug 2016) --- src/gui/components/cc_frm_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index a3a5ba43e..682236278 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -219,7 +219,7 @@ void CComponentsWindow::initFooter() ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); ccw_footer->setWidth(width-2*fr_thickness); ccw_footer->enableShadow(false/*shadow*/); - ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); + ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); ccw_footer->doPaintBg(true); From 2891e335b1db61bbcec81978e2166cc60d08d1b5 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 23 Aug 2016 14:26:24 +0200 Subject: [PATCH 507/690] controlapi: add xmltv support Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bdde716c4a08f41c4497620c242581c451c65965 Author: TangoCash Date: 2016-08-23 (Tue, 23 Aug 2016) Origin message was: ------------------ - controlapi: add xmltv support --- src/nhttpd/tuxboxapi/controlapi.cpp | 123 ++++++++++++++++++++++++++++ src/nhttpd/tuxboxapi/controlapi.h | 2 + 2 files changed, 125 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 0134b523c..709791eb5 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -217,6 +217,9 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"renamebouquet", &CControlAPI::renameBouquetCGI, "text/plain"}, {"changebouquet", &CControlAPI::changeBouquetCGI, "text/plain"}, {"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"}, + // xmltv + {"xmltv.data", &CControlAPI::xmltvepgCGI, "+xml"}, + {"xmltv.m3u", &CControlAPI::xmltvm3uCGI, ""}, // utils {"build_live_url", &CControlAPI::build_live_url, ""}, {"get_logo", &CControlAPI::logoCGI, "text/plain"}, @@ -3028,6 +3031,126 @@ void CControlAPI::updateBouquetCGI(CyhookHandler *hh) NeutrinoAPI->UpdateBouquets(); hh->SendOk(); } +//----------------------------------------------------------------------------- +// details EPG Information in xmltv format from all user bouquets +//----------------------------------------------------------------------------- +void CControlAPI::xmltvepgCGI(CyhookHandler *hh) +{ + int mode = NeutrinoAPI->Zapit->getMode(); + hh->ParamList["format"] = "xml"; + TOutType outType = hh->outStart(); + + t_channel_id channel_id; + std::string result = ""; + std::string channelTag = "", channelData = ""; + std::string programmeTag = "", programmeData = ""; + + ZapitChannelList chanlist; + CChannelEventList eList; + CChannelEventList::iterator eventIterator; + + for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) + { + if (mode == CZapitClient::MODE_RADIO) + g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); + else + g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); + if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) + { + for(int j = 0; j < (int) chanlist.size(); j++) + { + CZapitChannel * channel = chanlist[j]; + channel_id = channel->getChannelID() & 0xFFFFFFFFFFFFULL; + channelTag = "channel id=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\""; + channelData = hh->outPair("display-name", hh->outValue(channel->getName()), true); + result += hh->outObject(channelTag, channelData); + + eList.clear(); + + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); + + if (eList.size() == 0) + continue; + + if (eList.size() > 50) + eList.erase(eList.begin()+50,eList.end()); + + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) + { + if (eventIterator->get_channel_id() == channel_id) + { + programmeTag = "programme "; + programmeTag += "channel=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\" "; + char zbuffer[25] = { 0 }; + struct tm *mtime = localtime(&eventIterator->startTime); + strftime(zbuffer, 21, "%Y%m%d%H%M%S +0200", mtime); + programmeTag += "start=\""+std::string(zbuffer)+"\" "; + long _stoptime = eventIterator->startTime + eventIterator->duration; + mtime = localtime(&_stoptime); + strftime(zbuffer, 21, "%Y%m%d%H%M%S +0200", mtime); + programmeTag += "stop=\""+std::string(zbuffer)+"\" "; + + programmeData = hh->outPair("title lang=\"de\"", hh->outValue(eventIterator->description), false); + programmeData += hh->outPair("desc lang=\"de\"", hh->outValue(eventIterator->text), true); + + result += hh->outArrayItem(programmeTag, programmeData, false); + } + } + } + } + } + + + result = hh->outObject("tv generator-info-name=\"Neutrino XMLTV Generator v1.0\"", result); + + result = "\n\n" + result; + + hh->SendResult(result); +} + +void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) +{ + + TOutType outType = hh->outStart(); + std::string result = ""; + + int mode = NeutrinoAPI->Zapit->getMode(); + // build url + std::string url = ""; + if(!hh->ParamList["host"].empty()) + url = "http://"+hh->ParamList["host"]; + else + url = "http://"+hh->HeaderList["Host"]; + /* strip off optional custom port */ + if (url.rfind(":") != 4) + url = url.substr(0, url.rfind(":")); + + url += ":31339/id="; + + result += "#EXTM3U\n"; + + for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) + { + ZapitChannelList chanlist; + if (mode == CZapitClient::MODE_RADIO) + g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); + else + g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); + if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) + { + for(int j = 0; j < (int) chanlist.size(); j++) + { + CZapitChannel * channel = chanlist[j]; + std::string bouq_name = g_bouquetManager->Bouquets[i]->Name; + std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL); + result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+chan_id_short+".png\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; + result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n"; + } + } + } + + hh->SendResult(result); +} //------------------------------------------------------------------------- // audio_no : (optional) audio channel // host : (optional) ip of dbox diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 05749b7f5..e80702b28 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -123,6 +123,8 @@ private: void renameBouquetCGI(CyhookHandler *hh); void changeBouquetCGI(CyhookHandler *hh); void updateBouquetCGI(CyhookHandler *hh); + void xmltvepgCGI(CyhookHandler *hh); + void xmltvm3uCGI(CyhookHandler *hh); void build_live_url(CyhookHandler *hh); void logoCGI(CyhookHandler *hh); void ConfigCGI(CyhookHandler *hh); From 765957f617ceebfe0147d27e1d60b79dd0a9be34 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Aug 2016 14:26:51 +0200 Subject: [PATCH 508/690] yhook: avoid parameters from xml closing tag Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/acf58551a8a426fc9b39432e996e374b14f43176 Author: vanhofen Date: 2016-08-23 (Tue, 23 Aug 2016) Origin message was: ------------------ - yhook: avoid parameters from xml closing tag --- src/nhttpd/yhttpd_core/yhook.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 56537c057..7838cefa9 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -444,10 +444,11 @@ std::string CyhookHandler::outSingle(std::string _content) { //----------------------------------------------------------------------------- std::string CyhookHandler::outPair(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: - result = outIndent() + "<" + _key + ">" + _content + ""; + result = outIndent() + "<" + _key + ">" + _content + ""; break; case json: result = outIndent() + "\"" + _key + "\": \"" + _content + "\""; @@ -466,11 +467,12 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool //----------------------------------------------------------------------------- std::string CyhookHandler::outArray(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: @@ -489,11 +491,12 @@ std::string CyhookHandler::outArray(std::string _key, std::string _content, bool //----------------------------------------------------------------------------- std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: @@ -511,11 +514,12 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, } //----------------------------------------------------------------------------- std::string CyhookHandler::outObject(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: From 6398975e24ceeb90b7066583c6539d531474033c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Aug 2016 15:39:09 +0200 Subject: [PATCH 509/690] controlapi: remove unused variable outType from xmltv functions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7c47b1a2a6138f33091eb0400fe8448a8248ba2d Author: vanhofen Date: 2016-08-23 (Tue, 23 Aug 2016) Origin message was: ------------------ - controlapi: remove unused variable outType from xmltv functions --- src/nhttpd/tuxboxapi/controlapi.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 709791eb5..ccf614601 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3038,7 +3038,7 @@ void CControlAPI::xmltvepgCGI(CyhookHandler *hh) { int mode = NeutrinoAPI->Zapit->getMode(); hh->ParamList["format"] = "xml"; - TOutType outType = hh->outStart(); + hh->outStart(); t_channel_id channel_id; std::string result = ""; @@ -3110,8 +3110,7 @@ void CControlAPI::xmltvepgCGI(CyhookHandler *hh) void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) { - - TOutType outType = hh->outStart(); + hh->outStart(); std::string result = ""; int mode = NeutrinoAPI->Zapit->getMode(); From 5a24dc1ce5c4d1ba64d76e1141549cebef27aac4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 23 Aug 2016 15:59:40 +0200 Subject: [PATCH 510/690] CComponentsFooter: don't use default parameters for privat member Passed init values are better to see here. This should fix wrong footer color too. See UPNP-Browser, color was not applied here. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b9a8d1a789020d43a36474c60d51453cbc6593d Author: Thilo Graf Date: 2016-08-23 (Tue, 23 Aug 2016) --- src/gui/components/cc_frm_footer.cpp | 2 +- src/gui/components/cc_frm_footer.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 7945d8a3c..a02d999b2 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -36,7 +36,7 @@ using namespace std; CComponentsFooter::CComponentsFooter(CComponentsForm* parent) { //CComponentsFooter - initVarFooter(1, 1, 0, 0, 0, parent); + initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 311afbc3e..b10ac8c8d 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -60,13 +60,13 @@ Missing parameters are filled with default values and must be assigned afterward class CComponentsFooter : public CComponentsHeader { private: - void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, + const int& buttons, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow ); ///show button frame and background, default false bool btn_contour; From de29fd97ebeacf18b296e7f6058f0932fba8b9b6 Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 11 Mar 2014 19:49:37 +0100 Subject: [PATCH 511/690] nhttpd/neutrinoapi: fix getLogoFile() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b66c1e9f0fd7a40f55f626f61f4c2716cdaa454d Author: martii Date: 2014-03-11 (Tue, 11 Mar 2014) --- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index f0a30f604..d0696069e 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ #include #include +extern CPictureViewer *g_PicViewer; extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; extern cVideo * videoDecoder; @@ -521,24 +523,11 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) +std::string CNeutrinoAPI::getLogoFile(std::string _logoURL __attribute__((unused)), t_channel_id channelId) { - std::string channelIdAsString = string_printf( PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS , channelId & 0xFFFFFFFFFFFFULL); std::string channelName = GetServiceName(channelId); -// replace(channelName, " ", "_"); - _logoURL+="/"; - if (access((_logoURL + channelName + ".png").c_str(), 4) == 0) - return _logoURL + channelName + ".png"; - else if (access((_logoURL + channelName + ".jpg").c_str(), 4) == 0) - return _logoURL + channelName + ".jpg"; - else if (access((_logoURL + channelName + ".gif").c_str(), 4) == 0) - return _logoURL + channelName + ".gif"; - else if(access((_logoURL + channelIdAsString + ".png").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".png"; - else if (access((_logoURL + channelIdAsString + ".jpg").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".jpg"; - else if (access((_logoURL + channelIdAsString + ".gif").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".gif"; - else - return ""; + std::string logoString; + if (g_PicViewer->GetLogoName(channelId, channelName, logoString, NULL, NULL)) + return logoString; + return ""; } From 796c4bf5ea75dc4306053e83cd66190abaa6aec0 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 25 Aug 2016 11:37:20 +0200 Subject: [PATCH 512/690] fix xmltv channellogos Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3f3ff32c8631d521ecd8d8f2df6c9911a207dece Author: TangoCash Date: 2016-08-25 (Thu, 25 Aug 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index ccf614601..22fc5fa2d 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3142,7 +3142,7 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) CZapitChannel * channel = chanlist[j]; std::string bouq_name = g_bouquetManager->Bouquets[i]->Name; std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL); - result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+chan_id_short+".png\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; + result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+NeutrinoAPI->getLogoFile("",channel->getChannelID())+"\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n"; } } From 55efa2e847b7e1017acac1e2f5dce1419df0ac74 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:00:14 +0200 Subject: [PATCH 513/690] neutrinoyparser: move search for channellogos to neutrinoyparser This is to respecting user's setting to use other channellogos for WebIf. Now WebIf tries Tuxbox.LogosURL from nhttpd.conf first. Controlapi ignores these setting and providing the default system channelogos using NeutrinoAPI->getLogoFile(). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ac0ed9093028276834dbfe6fbcd217318497676 Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - neutrinoyparser: move search for channellogos to neutrinoyparser This is to respecting user's setting to use other channellogos for WebIf. Now WebIf tries Tuxbox.LogosURL from nhttpd.conf first. Controlapi ignores these setting and providing the default system channelogos using NeutrinoAPI->getLogoFile(). --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 31 +++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 0b713d901..f2a1fb2ad 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -368,7 +368,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: yresult += ""; if (have_logos) { - std::string channel_logo = NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID()); + std::string channel_logo = func_get_logo_name(hh, string_printf(PRINTF_CHANNEL_ID_TYPE, channel->getChannelID())); std::string zaplink; if (channel_logo.empty()) zaplink = channel->getName().c_str(); @@ -575,14 +575,33 @@ std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler *, std:: } //------------------------------------------------------------------------- -// func: Get Logo Name +// func: Get logo name for Webif //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string channelId) { - if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") { - t_channel_id cid; - if (1 == sscanf(channelId.c_str(), "%" PRIx64, &cid)) - return NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid); + std::string LogosURL = hh->WebserverConfigList["Tuxbox.LogosURL"]; + if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" && !LogosURL.empty()) + { + std::string fileType[] = { ".png", ".jpg" , ".gif" }; + + std::string channelIdShort = channelId.substr(channelId.length() - 12); + channelIdShort = channelIdShort.erase(0, min(channelIdShort.find_first_not_of('0'), channelIdShort.size()-1)); + + std::string channelName = ""; + t_channel_id chId = 0; + if (sscanf(channelId.c_str(), "%" PRIx64, &chId) == 1) + channelName = NeutrinoAPI->GetServiceName(chId); + + for (size_t i = 0; i < (sizeof(fileType) / sizeof(fileType[0])); i++) + { + // first check Tuxbox.LogosURL from nhttpd.conf + if (access((LogosURL + "/" + channelName + fileType[i]).c_str(), R_OK) == 0) + return LogosURL + "/" + channelName + fileType[i]; + else if (access((LogosURL + "/" + channelIdShort + fileType[i]).c_str(), R_OK) == 0) + return LogosURL + "/" + channelIdShort + fileType[i]; + else // fallback to default logos + return NeutrinoAPI->getLogoFile("", chId); + } } return ""; } From 5223eb01dc326149f80fa834f8f159c9d023a50d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:14:09 +0200 Subject: [PATCH 514/690] tuxboxapi: remove obsolete Tuxbox.LogosURL from getLogoFile() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e283469dbd290c9c5e8a9f61782dd7ae7aa6bd5 Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - tuxboxapi: remove obsolete Tuxbox.LogosURL from getLogoFile() --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 +++--- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 2 +- src/nhttpd/tuxboxapi/neutrinoapi.h | 2 +- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 22fc5fa2d..d1bc6b106 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1114,7 +1114,7 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true); result += hh->outPair("name", hh->outValue(channel->getName()), true); - result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), false); + result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(channel->getChannelID())), false); if (bouquetNr > -1) { result += hh->outNext(); @@ -3142,7 +3142,7 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) CZapitChannel * channel = chanlist[j]; std::string bouq_name = g_bouquetManager->Bouquets[i]->Name; std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL); - result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+NeutrinoAPI->getLogoFile("",channel->getChannelID())+"\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; + result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+NeutrinoAPI->getLogoFile(channel->getChannelID())+"\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n"; } } @@ -3223,7 +3223,7 @@ void CControlAPI::logoCGI(CyhookHandler *hh) sscanf(hh->ParamList["1"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - hh->Write(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel_id)); + hh->Write(NeutrinoAPI->getLogoFile(channel_id)); } //------------------------------------------------------------------------- /** Get Config File or save values to given config file diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index d0696069e..baceef32d 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -523,7 +523,7 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL __attribute__((unused)), t_channel_id channelId) +std::string CNeutrinoAPI::getLogoFile(t_channel_id channelId) { std::string channelName = GetServiceName(channelId); std::string logoString; diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 1685d5874..82c9abbf3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -84,7 +84,7 @@ public: std::string getVideoFramerateAsString(void); std::string getAudioInfoAsString(void); std::string getCryptInfoAsString(void); - std::string getLogoFile(std::string _logoURL, t_channel_id channelId); + std::string getLogoFile(t_channel_id channelId); public: CNeutrinoAPI(); ~CNeutrinoAPI(void); diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index f2a1fb2ad..fbc620122 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -600,7 +600,7 @@ std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string else if (access((LogosURL + "/" + channelIdShort + fileType[i]).c_str(), R_OK) == 0) return LogosURL + "/" + channelIdShort + fileType[i]; else // fallback to default logos - return NeutrinoAPI->getLogoFile("", chId); + return NeutrinoAPI->getLogoFile(chId); } } return ""; From 79d0c2e5da4eb335310c52b3bd979124839d0c56 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:56:11 +0200 Subject: [PATCH 515/690] yWeb: depending display of logos in EPG plus from Tuxbox.DisplayLogos Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7d580b32967bdd61a34803fc3c12ba1a17c60a6a Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - yWeb: depending display of logos in EPG plus from Tuxbox.DisplayLogos --- src/nhttpd/web/Y_EPG.js | 8 ++++---- src/nhttpd/web/Y_EPG_Plus.yhtm | 2 +- src/nhttpd/web/Y_Version.txt | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js index 7a7f15368..f3d3ebd96 100644 --- a/src/nhttpd/web/Y_EPG.js +++ b/src/nhttpd/web/Y_EPG.js @@ -166,7 +166,7 @@ function get_timer(){ /* main */ var g_i = 0; var g_bouquet_list; -var g_logosURL=""; +var g_display_logos=""; function build_epg_plus(_bouquet, _starttime) { build_epg_clear(); @@ -200,7 +200,7 @@ function build_epg_plus_loop(_starttime, _stoptime) var ep = $("epg_plus_container"); var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); - var ch_name_with_logo= (g_logosURL!="")?"\""+__channel_name+"\"":__channel_name; + var ch_name_with_logo= (g_display_logos=="true")?"\""+__channel_name+"\"":__channel_name; $(__bname_div).style.cssText = "width:"+c_width_px_bouquet+"px;"; $(__bname_div).update(""+ch_name_with_logo+""); build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime, __logo); @@ -257,8 +257,8 @@ function build_time_list(_delta){ } } /*init call*/ -function epg_plus_init(_logosURL){ - g_logosURL = _logosURL; +function epg_plus_init(_display_logos){ + g_display_logos = _display_logos; window.onresize=epg_plus_calc_dimensions; build_time_list(0); } diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index b6888235c..a49808f9b 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -67,7 +67,7 @@ function epg_imdb(){ diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index c4da80e3a..89d2ca789 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.38 -date=15.08.2016 +version=2.9.0.39 +date=26.08.2016 type=Release info=Port CST From ab825c08da03b04a737f85a938aec37a2a37a05d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 Aug 2016 11:01:26 +0200 Subject: [PATCH 516/690] CComponentsHeader: don't use default parameters for privat member Unified adaptation related to child class ComponentsFooter. see: 5a24dc1ce5c4d1ba64d76e1141549cebef27aac4 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/731cb9c66d9de9ebfadfe86d81f3871002eff820 Author: Thilo Graf Date: 2016-08-30 (Tue, 30 Aug 2016) --- src/gui/components/cc_frm_header.cpp | 2 +- src/gui/components/cc_frm_header.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index cd9af8bfc..c1613516d 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -43,7 +43,7 @@ using namespace std; CComponentsHeader::CComponentsHeader(CComponentsForm* parent) { //CComponentsHeader - initVarHeader(1, 1, 0, 0, "", "", 0, parent); + initVarHeader(1, 1, 0, 0, "", "", 0, parent, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index fda8f4835..178520b42 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -40,15 +40,15 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen { private: ///member: init genaral variables, parameters for mostly used properties - void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const std::string& caption = "header", - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& icon_name, + const int& buttons, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); protected: ///object: icon object, see also setIcon() From 1134c80072728c1880a2a731130c758c0c97988c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 31 Aug 2016 10:03:52 +0200 Subject: [PATCH 517/690] CFrameBuffer: add debug warning if radius < 0 Radius < 0 causes for wrong rendering. paintBoxRel() gets confused. This will paint partial outside of renderbox. TODO: This should be fixed. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed0154a9739ab2c8832fb52336e0e7b454188331 Author: Thilo Graf Date: 2016-08-31 (Wed, 31 Aug 2016) --- src/driver/framebuffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index e7c7ad682..c1877bb2d 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -819,9 +819,11 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int return; if (dx == 0 || dy == 0) { - dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx, y+dy); + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); return; } + if (radius < 0) + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: WARNING! radius < 0 [%d] FIXME\n", __func__, __LINE__, radius); checkFbArea(x, y, dx, dy, true); From 53f05e6a734892fcd337a15ba6e9625074d9fd47 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Sep 2016 09:44:13 +0200 Subject: [PATCH 518/690] lua_menue: allow user definable return values This concerns: * CLuaMenuFilebrowser::exec() * CLuaMenuStringinput::exec() * CLuaMenuKeyboardinput::exec() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d014c6f7685a208dbf9eb975a7a3d01e1f18b3f Author: vanhofen Date: 2016-09-01 (Thu, 01 Sep 2016) Origin message was: ------------------ - lua_menue: allow user definable return values This concerns: * CLuaMenuFilebrowser::exec() * CLuaMenuStringinput::exec() * CLuaMenuKeyboardinput::exec() --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_menue.cpp | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 51f649f64..dd5ac6fa7 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 46 +#define LUA_API_VERSION_MINOR 47 diff --git a/src/gui/lua/lua_menue.cpp b/src/gui/lua/lua_menue.cpp index 100056ba5..b704b56c8 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -3,7 +3,7 @@ * * (C) 2014 by martii * (C) 2014-2015 M. Liebmann (micha-bbg) - * (C) 2014 Sven Hoefer (svenhoefer) + * (C) 2016 Sven Hoefer (svenhoefer) * (C) 2015 Jacek Jendrzej (SatBaby) * * This program is free software; you can redistribute it and/or @@ -162,6 +162,7 @@ void CLuaMenuFilebrowser::Init(std::string *_value, bool _dirMode) int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CFileBrowser fileBrowser; fileBrowser.Dir_Mode = dirMode; @@ -188,9 +189,11 @@ int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*acti fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 1); } - return menu_return::RETURN_REPAINT; + return res; } CLuaMenuStringinput::CLuaMenuStringinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms) : CLuaMenuForwarder(_L, _luaAction, _luaId) @@ -211,6 +214,7 @@ void CLuaMenuStringinput::Init(const char *_name, std::string *_value, int _size int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CStringInput *i; if (sms) i = new CStringInputSMS((char *)name, value, size, @@ -233,9 +237,11 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 2); } - return menu_return::RETURN_REPAINT; + return res; } CLuaMenuKeyboardinput::CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2) : CLuaMenuForwarder(_L, _luaAction, _luaId) @@ -256,6 +262,7 @@ void CLuaMenuKeyboardinput::Init(const char *_name, std::string *_value, int _si int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CKeyboardInput *i; i = new CKeyboardInput((char *)name, value, size, observ, icon, help, help2); i->exec(NULL, ""); @@ -273,9 +280,11 @@ int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*a fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 2); } - return menu_return::RETURN_REPAINT; + return res; } int CLuaInstMenu::MenuNew(lua_State *L) From 8a433a668db8fb771d91b555649f6db1715d31d7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Sep 2016 17:21:34 +0200 Subject: [PATCH 519/690] CLuaInstCCWindow::CCWindowNew: use setButtonLabels real footer width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c566466ff1330609de5fc651556ca6c25c914513 Author: Michael Liebmann Date: 2016-09-02 (Fri, 02 Sep 2016) --- src/gui/lua/lua_cc_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 03313ca22..df87bb815 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -161,7 +161,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) buttons.push_back(btnSblue); } if (!buttons.empty()) - footer->setButtonLabels(buttons, (*udata)->w->getWidth()-20, ((*udata)->w->getWidth()-20) / (buttons.size()+1)); + footer->setButtonLabels(buttons, footer->getWidth(), footer->getWidth() / buttons.size()); } } From fed4ac59688f08e971ab6c45d097b04248cb3968 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 3 Sep 2016 11:44:48 +0200 Subject: [PATCH 520/690] src/gui/lua: Add lua_filehelpers.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/295ca1f7c970038af84e81aedc0adab35667c844 Author: Michael Liebmann Date: 2016-09-03 (Sat, 03 Sep 2016) --- src/gui/lua/Makefile.am | 1 + src/gui/lua/lua_filehelpers.cpp | 83 +++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 45 +++++++++++++++++ src/gui/lua/luainstance.cpp | 2 + src/gui/lua/luainstance_helpers.h | 3 +- 5 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 src/gui/lua/lua_filehelpers.cpp create mode 100644 src/gui/lua/lua_filehelpers.h diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index e3861cb76..6b99ec4ce 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -32,6 +32,7 @@ libneutrino_gui_lua_a_SOURCES = \ lua_cc_window.cpp \ lua_configfile.cpp \ lua_curl.cpp \ + lua_filehelpers.cpp \ lua_hintbox.cpp \ lua_menue.cpp \ lua_messagebox.cpp \ diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp new file mode 100644 index 000000000..8abffb9c3 --- /dev/null +++ b/src/gui/lua/lua_filehelpers.cpp @@ -0,0 +1,83 @@ +/* + * lua file helpers functions + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "luainstance.h" +#include "lua_filehelpers.h" + +CLuaInstFileHelpers* CLuaInstFileHelpers::getInstance() +{ + static CLuaInstFileHelpers* LuaInstFileHelpers = NULL; + + if (!LuaInstFileHelpers) + LuaInstFileHelpers = new CLuaInstFileHelpers(); + return LuaInstFileHelpers; +} + +CLuaFileHelpers *CLuaInstFileHelpers::FileHelpersCheckData(lua_State *L, int n) +{ + return *(CLuaFileHelpers **) luaL_checkudata(L, n, LUA_FILEHELPER_CLASSNAME); +} + +void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "new", CLuaInstFileHelpers::FileHelpersNew }, + { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, + { NULL, NULL } + }; + + luaL_newmetatable(L, LUA_FILEHELPER_CLASSNAME); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, LUA_FILEHELPER_CLASSNAME); +} + +int CLuaInstFileHelpers::FileHelpersNew(lua_State *L) +{ + CLuaFileHelpers **udata = (CLuaFileHelpers **) lua_newuserdata(L, sizeof(CLuaFileHelpers *)); + *udata = new CLuaFileHelpers(); + luaL_getmetatable(L, LUA_FILEHELPER_CLASSNAME); + lua_setmetatable(L, -2); + return 1; +} + + + + + +int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + delete D; + return 0; +} diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h new file mode 100644 index 000000000..c086593bb --- /dev/null +++ b/src/gui/lua/lua_filehelpers.h @@ -0,0 +1,45 @@ +/* + * lua file helpers functions + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 _LUAFILEHELPERS_H +#define _LUAFILEHELPERS_H + +class CLuaFileHelpers +{ + public: + CLuaFileHelpers() {}; + ~CLuaFileHelpers() {}; +}; + +class CLuaInstFileHelpers +{ + public: + + CLuaInstFileHelpers() {}; + ~CLuaInstFileHelpers() {}; + static CLuaInstFileHelpers* getInstance(); + static void LuaFileHelpersRegister(lua_State *L); + + private: + static CLuaFileHelpers *FileHelpersCheckData(lua_State *L, int n); + static int FileHelpersNew(lua_State *L); + static int FileHelpersDelete(lua_State *L); +}; + +#endif //_LUAFILEHELPERS_H diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index d5de296b6..ad5ca34e8 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -44,6 +44,7 @@ #include "lua_cc_window.h" #include "lua_configfile.h" #include "lua_curl.h" +#include "lua_filehelpers.h" #include "lua_hintbox.h" #include "lua_menue.h" #include "lua_messagebox.h" @@ -621,6 +622,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) CLuaInstCCWindow::getInstance()->CCWindowRegister(L); CLuaInstConfigFile::getInstance()->LuaConfigFileRegister(L); CLuaInstCurl::getInstance()->LuaCurlRegister(L); + CLuaInstFileHelpers::getInstance()->LuaFileHelpersRegister(L); CLuaInstHintbox::getInstance()->HintboxRegister(L); CLuaInstMenu::getInstance()->MenuRegister(L); CLuaInstMessagebox::getInstance()->MessageboxRegister(L); diff --git a/src/gui/lua/luainstance_helpers.h b/src/gui/lua/luainstance_helpers.h index cf6b9ba30..fa54bb690 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -2,7 +2,7 @@ * lua instance helper functions * * (C) 2013 Stefan Seyfried (seife) - * (C) 2014-2015 M. Liebmann (micha-bbg) + * (C) 2014-2016 M. Liebmann (micha-bbg) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,6 +30,7 @@ #define LUA_MISC_CLASSNAME "misc" #define LUA_CURL_CLASSNAME "curl" #define LUA_HEADER_CLASSNAME "header" +#define LUA_FILEHELPER_CLASSNAME "filehelpers" #define LUA_WIKI "https://wiki.neutrino-hd.de/wiki" //#define LUA_WIKI "https://wiki.slknet.de/wiki" From cba27701a9cbfd5078a861814b65688cb401a2fb Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 3 Sep 2016 11:44:58 +0200 Subject: [PATCH 521/690] helpers.cpp: Add itoa() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/38470a8a80ed969eeb0e5f87ee353e71b0bb83a5 Author: Michael Liebmann Date: 2016-09-03 (Sat, 03 Sep 2016) --- src/system/helpers.cpp | 32 ++++++++++++++++++++++++++++++++ src/system/helpers.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 9a4b054f5..5a88ef0db 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -951,6 +951,38 @@ std::string to_string(unsigned long long i) return s.str(); } +/** + * C++ version 0.4 std::string style "itoa": + * Contributions from Stuart Lowe, Ray-Yuan Sheu, + + * Rodrigo de Salvo Braz, Luc Gallant, John Maloney + * and Brian Hunt + */ +std::string itoa(int value, int base) +{ + std::string buf; + + // check that the base if valid + if (base < 2 || base > 16) return buf; + + enum { kMaxDigits = 35 }; + buf.reserve( kMaxDigits ); // Pre-allocate enough space. + + int quotient = value; + + // Translating number to string with base: + do { + buf += "0123456789abcdef"[ std::abs( quotient % base ) ]; + quotient /= base; + } while ( quotient ); + + // Append the negative sign + if ( value < 0) buf += '-'; + + std::reverse( buf.begin(), buf.end() ); + return buf; +} + std::string getJFFS2MountPoint(int mtdPos) { FILE* fd = fopen("/proc/mounts", "r"); diff --git a/src/system/helpers.h b/src/system/helpers.h index 3b26a12a6..65146830e 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -105,6 +105,8 @@ std::string to_string(unsigned long); std::string to_string(long long); std::string to_string(unsigned long long); +std::string itoa(int value, int base); + inline int atoi(std::string &s) { return atoi(s.c_str()); } inline int atoi(const std::string &s) { return atoi(s.c_str()); } inline int access(std::string &s, int mode) { return access(s.c_str(), mode); } From c4d4a3abf6c19f4b71119caef3e914661e27e3d5 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 3 Sep 2016 11:45:02 +0200 Subject: [PATCH 522/690] CFileHelpers::copyFile: Rewrite mode handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64b5d36c5284fc111e20ef385025d113a8cc4db0 Author: Michael Liebmann Date: 2016-09-03 (Sat, 03 Sep 2016) --- src/system/helpers.cpp | 30 +++++++++++++++++++++++++++--- src/system/helpers.h | 2 +- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 5a88ef0db..3391b4e3d 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -554,12 +554,36 @@ CFileHelpers* CFileHelpers::getInstance() return FileHelpers; } -bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) +bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*=0*/) { doCopyFlag = true; - unlink(Dst); + + /* + set mode for Dst + ---------------- + when forceMode==0 (default) then + when Dst exists + mode = mode from Dst + else + mode = mode from Src + else + mode = forceMode + */ + mode_t mode = forceMode & 0x0FFF; + if (mode == 0) { + static struct stat FileInfo; + const char *f = Dst; + if (!file_exists(Dst)) + f = Src; + if (lstat(f, &FileInfo) == -1) + return false; + mode = FileInfo.st_mode & 0x0FFF; + } + if ((fd1 = open(Src, O_RDONLY)) < 0) return false; + if (file_exists(Dst)) + unlink(Dst); if ((fd2 = open(Dst, O_WRONLY | O_CREAT, mode)) < 0) { close(fd1); return false; @@ -692,7 +716,7 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) std::string save = ""; if (backupMode && (CExtUpdate::getInstance()->isBlacklistEntry(srcPath))) save = ".save"; - copyFile(srcPath, (dstPath + save).c_str(), FileInfo.st_mode & 0x0FFF); + copyFile(srcPath, (dstPath + save).c_str()); /* mode is set by copyFile */ } } } diff --git a/src/system/helpers.h b/src/system/helpers.h index 65146830e..716b2a0bc 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -87,7 +87,7 @@ class CFileHelpers static CFileHelpers* getInstance(); bool doCopyFlag; - bool copyFile(const char *Src, const char *Dst, mode_t mode); + bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0); bool copyDir(const char *Src, const char *Dst, bool backupMode=false); static bool createDir(std::string& Dir, mode_t mode = 755); static bool createDir(const char *Dir, mode_t mode = 755){std::string dir = std::string(Dir);return createDir(dir, mode);} From f1b6e6a33550d283ae28ce73b2107e620c26f89a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 3 Sep 2016 21:14:57 +0200 Subject: [PATCH 523/690] helpers.cpp: Add cp() function Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5198a13282dd7c907c92957d853589be9282ff2f Author: Michael Liebmann Date: 2016-09-03 (Sat, 03 Sep 2016) --- src/system/helpers.cpp | 110 +++++++++++++++++++++++++++++++++++++++++ src/system/helpers.h | 1 + 2 files changed, 111 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 3391b4e3d..3f3eb7c76 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -554,6 +554,116 @@ CFileHelpers* CFileHelpers::getInstance() return FileHelpers; } +bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/) +{ + if ((Src == NULL) || (Dst == NULL)) + return false; + + std::string src = Src; + src = trim(src); + if (src.find_first_of("/") != 0) + src = "./" + src; + size_t pos = src.find_last_of("/"); + if (pos == src.length()-1) + src = src.substr(0, pos); + + std::string dst = Dst; + dst = trim(dst); + if (dst.find_first_of("/") != 0) + dst = "./" + dst; + pos = dst.find_last_of("/"); + if (pos == dst.length()-1) + dst = dst.substr(0, pos); + + bool wildcards = (src.find("*") != std::string::npos); + bool recursive = ((strchr(Flags, 'r') != NULL) || (strchr(Flags, 'a') != NULL)); + bool no_dereference = ((strchr(Flags, 'd') != NULL) || (strchr(Flags, 'a') != NULL)); + + static struct stat FileInfo; + char buf[PATH_MAX]; + if (wildcards == false) { + if (!file_exists(src.c_str())) + return false; + if (lstat(src.c_str(), &FileInfo) == -1) + return false; + + pos = src.find_last_of("/"); + std::string fname = src.substr(pos); + + static struct stat FileInfo2; + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(src.c_str(), buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + if (!no_dereference) { /* copy */ + std::string buf_ = (std::string)buf; + char buf2[PATH_MAX + 1]; + if (buf[0] != '/') + buf_ = getPathName(src) + "/" + buf_; + buf_ = (std::string)realpath(buf_.c_str(), buf2); + //printf("\n>>>> RealPath: %s\n \n", buf_.c_str()); + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + copyFile(buf_.c_str(), (dst + fname).c_str()); + else { + unlink(dst.c_str()); + copyFile(buf_.c_str(), dst.c_str()); + } + } + else + copyFile(buf_.c_str(), dst.c_str()); + } + else { /* link */ + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + symlink(buf, (dst + fname).c_str()); + else { + unlink(dst.c_str()); + symlink(buf, dst.c_str()); + } + } + else + symlink(buf, dst.c_str()); + } + } + } + // is directory + else if (S_ISDIR(FileInfo.st_mode)) { + if (recursive) + copyDir(src.c_str(), dst.c_str()); + else { + printf("#### [%s:%d] 'recursive flag' must be set to copy dir.\n", __func__, __LINE__); + return false; + } + } + // is file + else if (S_ISREG(FileInfo.st_mode)) { + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + copyFile(src.c_str(), (dst + fname).c_str()); + else { + unlink(dst.c_str()); + copyFile(src.c_str(), dst.c_str()); + } + } + else + copyFile(src.c_str(), dst.c_str()); + } + else { + printf("#### [%s:%d] Currently unsupported st_mode.\n", __func__, __LINE__); + return false; + } + + } + else { + printf("#### [%s:%d] Wildcard feature not yet realized.\n", __func__, __LINE__); + return false; + } + + return true; +} + bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*=0*/) { doCopyFlag = true; diff --git a/src/system/helpers.h b/src/system/helpers.h index 716b2a0bc..74276b12e 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -87,6 +87,7 @@ class CFileHelpers static CFileHelpers* getInstance(); bool doCopyFlag; + bool cp(const char *Src, const char *Dst, const char *Flags=""); bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0); bool copyDir(const char *Src, const char *Dst, bool backupMode=false); static bool createDir(std::string& Dir, mode_t mode = 755); From f6b960e97e88bffb028f945690e84ebbfa67a41c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 3 Sep 2016 21:54:47 +0200 Subject: [PATCH 524/690] lua_filehelpers.cpp: Add lua script function 'cp()' - Set Lua api version to 1.48 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/270cd318ec0e32f4e2b138603bdbfc2b7c4fb206 Author: Michael Liebmann Date: 2016-09-03 (Sat, 03 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 45 +++++++++++++++++++++++++++++++-- src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index dd5ac6fa7..e2a052eab 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 47 +#define LUA_API_VERSION_MINOR 48 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 8abffb9c3..68bcaf76c 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -49,8 +49,9 @@ CLuaFileHelpers *CLuaInstFileHelpers::FileHelpersCheckData(lua_State *L, int n) void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { luaL_Reg meth[] = { - { "new", CLuaInstFileHelpers::FileHelpersNew }, - { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, + { "new", CLuaInstFileHelpers::FileHelpersNew }, + { "cp", CLuaInstFileHelpers::FileHelpersCp }, + { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -70,6 +71,46 @@ int CLuaInstFileHelpers::FileHelpersNew(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript cp: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + if (!lua_isstring(L, 2)) { + printf("luascript cp: argument 1 is not a string.\n"); + lua_pushboolean(L, false); + return 1; + } + const char *from = ""; + from = luaL_checkstring(L, 2); + + if (!lua_isstring(L, 3)) { + printf("luascript cp: argument 2 is not a string.\n"); + lua_pushboolean(L, false); + return 1; + } + const char *to = ""; + to = luaL_checkstring(L, 3); + + const char *flags = ""; + if (numargs > min_numargs) + flags = luaL_checkstring(L, 4); + + bool ret = false; + CFileHelpers fh; + ret = fh.cp(from, to, flags); + + lua_pushboolean(L, ret); + return 1; +} diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index c086593bb..7bdd8b642 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -39,6 +39,7 @@ class CLuaInstFileHelpers private: static CLuaFileHelpers *FileHelpersCheckData(lua_State *L, int n); static int FileHelpersNew(lua_State *L); + static int FileHelpersCp(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From bd039291bdedd62ff3e045ba88e54017ff7af216 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 12:00:15 +0200 Subject: [PATCH 525/690] Add alternative variant for the display of __FILE__ (__path_file__) - __path_file__ includes the relevant parts of source path Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/92a88906a594ac1e9ce540c31f59a79d91384a7c Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index b0651c6a8..cf1fc12ee 100644 --- a/configure.ac +++ b/configure.ac @@ -228,8 +228,10 @@ fi # hack to define a short filename also for out-of-tree build if test `dirname $0` = `pwd`; then HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__=__FILE__' else HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__="\"$(subst $(srcdir)/,,$(abspath $<))\""' + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__="\"$(subst $(top_srcdir)/,,$(abspath $<))\""' fi # # Check for libtdservicedb - the new one - for testing only From 9dc7398baa0c6f5a7c62d3230a2b1e0bb0f8a522 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 12:00:20 +0200 Subject: [PATCH 526/690] CFileHelpers: Add DebugInfo functions for displaying error messages.. ..in lua script functions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/83a902d524703117d5a8881c6e14d74d2fb4f1d1 Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/system/helpers.cpp | 32 ++++++++++++++++++++++++++++++++ src/system/helpers.h | 17 +++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 3f3eb7c76..9cfbab8c8 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -538,6 +538,8 @@ CFileHelpers::CFileHelpers() FileBufSize = 0xFFFF; FileBuf = new char[FileBufSize]; doCopyFlag = true; + ConsoleQuiet = false; + clearDebugInfo(); } CFileHelpers::~CFileHelpers() @@ -554,6 +556,36 @@ CFileHelpers* CFileHelpers::getInstance() return FileHelpers; } +void CFileHelpers::clearDebugInfo() +{ + DebugInfo.msg.clear(); + DebugInfo.file.clear(); + DebugInfo.func.clear(); + DebugInfo.line = 0; +} + +void CFileHelpers::setDebugInfo(const char* msg, const char* file, const char* func, int line) +{ + DebugInfo.msg = msg; + DebugInfo.file = file; + DebugInfo.func = func; + DebugInfo.line = line; +} + +void CFileHelpers::readDebugInfo(helpersDebugInfo* di) +{ + di->msg = DebugInfo.msg; + di->file = DebugInfo.file; + di->func = DebugInfo.func; + di->line = DebugInfo.line; +} + +void CFileHelpers::printDebugInfo() +{ + if (!ConsoleQuiet) + printf(">>>> [%s:%d] %s\n", DebugInfo.func.c_str(), DebugInfo.line, DebugInfo.msg.c_str()); +} + bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/) { if ((Src == NULL) || (Dst == NULL)) diff --git a/src/system/helpers.h b/src/system/helpers.h index 74276b12e..3f11909dd 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -74,6 +74,13 @@ time_t toEpoch(std::string &date); std::string& str_replace(const std::string &search, const std::string &replace, std::string &text); std::string& htmlEntityDecode(std::string& text); +struct helpersDebugInfo { + std::string msg; + std::string file; + std::string func; + int line; +}; + class CFileHelpers { private: @@ -81,12 +88,22 @@ class CFileHelpers char *FileBuf; int fd1, fd2; + bool ConsoleQuiet; + helpersDebugInfo DebugInfo; + void setDebugInfo(const char* msg, const char* file, const char* func, int line); + void printDebugInfo(); + public: CFileHelpers(); ~CFileHelpers(); static CFileHelpers* getInstance(); bool doCopyFlag; + void clearDebugInfo(); + void readDebugInfo(helpersDebugInfo* di); + void setConsoleQuiet(bool q) { ConsoleQuiet = q; }; + bool getConsoleQuiet() { return ConsoleQuiet; }; + bool cp(const char *Src, const char *Dst, const char *Flags=""); bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0); bool copyDir(const char *Src, const char *Dst, bool backupMode=false); From 0143837e949f14470f71f4e0fe9e480b922ef9cf Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 12:00:24 +0200 Subject: [PATCH 527/690] Use DebugInfo functions in CFileHelpers::cp / lua cp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/de07369d68a0d7c6cd474616682f56d39fea74cc Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_filehelpers.cpp | 10 ++++++++++ src/system/helpers.cpp | 26 +++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 68bcaf76c..4b11c3bdf 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -106,7 +106,17 @@ int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) bool ret = false; CFileHelpers fh; + fh.setConsoleQuiet(true); ret = fh.cp(from, to, flags); + if (ret == false) { + helpersDebugInfo di; + fh.readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } lua_pushboolean(L, ret); return 1; diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 9cfbab8c8..61cb77718 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -588,8 +588,12 @@ void CFileHelpers::printDebugInfo() bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/) { - if ((Src == NULL) || (Dst == NULL)) + clearDebugInfo(); + if ((Src == NULL) || (Dst == NULL)) { + setDebugInfo("One or more parameters are NULL", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; + } std::string src = Src; src = trim(src); @@ -614,10 +618,16 @@ bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/ static struct stat FileInfo; char buf[PATH_MAX]; if (wildcards == false) { - if (!file_exists(src.c_str())) + if (!file_exists(src.c_str())) { + setDebugInfo("Source file not exist", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; - if (lstat(src.c_str(), &FileInfo) == -1) + } + if (lstat(src.c_str(), &FileInfo) == -1) { + setDebugInfo("lstat error", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; + } pos = src.find_last_of("/"); std::string fname = src.substr(pos); @@ -665,7 +675,8 @@ bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/ if (recursive) copyDir(src.c_str(), dst.c_str()); else { - printf("#### [%s:%d] 'recursive flag' must be set to copy dir.\n", __func__, __LINE__); + setDebugInfo("'recursive flag' must be set to copy dir.", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; } } @@ -683,13 +694,14 @@ bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/ copyFile(src.c_str(), dst.c_str()); } else { - printf("#### [%s:%d] Currently unsupported st_mode.\n", __func__, __LINE__); + setDebugInfo("Currently unsupported st_mode.", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; } - } else { - printf("#### [%s:%d] Wildcard feature not yet realized.\n", __func__, __LINE__); + setDebugInfo("Wildcard feature not yet realized.", __path_file__, __func__, __LINE__); + printDebugInfo(); return false; } From 3bd7c3f7d9e812fcbb5fd536b36ca1268b0c0c29 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 18:54:45 +0200 Subject: [PATCH 528/690] lua_filehelpers.cpp: Add lua script function 'chmod()' - Set Lua api version to 1.49 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab7d90de3f20a22bb5f6f7af5972304a5b67a26c Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 39 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index e2a052eab..54b49c965 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 48 +#define LUA_API_VERSION_MINOR 49 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 4b11c3bdf..e27d46fc9 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) luaL_Reg meth[] = { { "new", CLuaInstFileHelpers::FileHelpersNew }, { "cp", CLuaInstFileHelpers::FileHelpersCp }, + { "chmod", CLuaInstFileHelpers::FileHelpersChmod }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -122,6 +124,43 @@ int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersChmod(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript chmod: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + const char *file = ""; + file = luaL_checkstring(L, 2); + + int mode_i = luaL_checkint(L, 3); + /* Hack for convert lua number to octal */ + std::string mode_s = itoa(mode_i, 10); + mode_t mode = (mode_t)(strtol(mode_s.c_str(), (char **)NULL, 8) & 0x0FFF); + //printf("\n##### [%s:%d] str: %s, okt: %o \n \n", __func__, __LINE__, mode_s.c_str(), (int)mode); + + bool ret = true; + if (chmod(file, mode) != 0) { + ret = false; + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + } + + lua_pushboolean(L, ret); + return 1; +} + diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index 7bdd8b642..72dc9c871 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -40,6 +40,7 @@ class CLuaInstFileHelpers static CLuaFileHelpers *FileHelpersCheckData(lua_State *L, int n); static int FileHelpersNew(lua_State *L); static int FileHelpersCp(lua_State *L); + static int FileHelpersChmod(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From a956b1c01fa1052dc68cc8cee9965dec4264e2d0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 18:54:50 +0200 Subject: [PATCH 529/690] lua_filehelpers.cpp: Add lua script function 'touch()' - Set Lua api version to 1.50 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab322416dc124cf1dc51170198e9f017c131fdee Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 64 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 54b49c965..26835c5c1 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 49 +#define LUA_API_VERSION_MINOR 50 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index e27d46fc9..5a5c5a31f 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "new", CLuaInstFileHelpers::FileHelpersNew }, { "cp", CLuaInstFileHelpers::FileHelpersCp }, { "chmod", CLuaInstFileHelpers::FileHelpersChmod }, + { "touch", CLuaInstFileHelpers::FileHelpersTouch }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -161,6 +163,68 @@ int CLuaInstFileHelpers::FileHelpersChmod(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersTouch(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript touch: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + const char *file = ""; + file = luaL_checkstring(L, 2); + + bool ret = true; + lua_Debug ar; + + if (!file_exists(file)) { + FILE *f = fopen(file, "w"); + if (f == NULL) { + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + lua_pushboolean(L, ret); + return 1; + } + fclose(f); + if (numargs == min_numargs) { + lua_pushboolean(L, ret); + return 1; + } + } + + time_t modTime; + if (numargs == min_numargs) + /* current time */ + modTime = time(NULL); + else + /* new time */ + modTime = (time_t)luaL_checkint(L, 3); + + utimbuf utb; + utb.actime = modTime; + utb.modtime = modTime; + if (utime(file, &utb) != 0) { + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + } + + lua_pushboolean(L, ret); + return 1; +} + diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index 72dc9c871..94dbff985 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -41,6 +41,7 @@ class CLuaInstFileHelpers static int FileHelpersNew(lua_State *L); static int FileHelpersCp(lua_State *L); static int FileHelpersChmod(lua_State *L); + static int FileHelpersTouch(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From 270d2d023b0254bc3166d78c6dcc6ecf7cd15486 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 20:56:06 +0200 Subject: [PATCH 530/690] src/system/helpers.h:createDir(): Set correct default for mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/689bc50a627a07e9df2f48d56e48325b695a9e34 Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/system/helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.h b/src/system/helpers.h index 3f11909dd..1d56fe743 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -107,8 +107,8 @@ class CFileHelpers bool cp(const char *Src, const char *Dst, const char *Flags=""); bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0); bool copyDir(const char *Src, const char *Dst, bool backupMode=false); - static bool createDir(std::string& Dir, mode_t mode = 755); - static bool createDir(const char *Dir, mode_t mode = 755){std::string dir = std::string(Dir);return createDir(dir, mode);} + static bool createDir(std::string& Dir, mode_t mode = 0755); + static bool createDir(const char *Dir, mode_t mode = 0755){std::string dir = std::string(Dir);return createDir(dir, mode);} static bool removeDir(const char *Dir); static uint64_t getDirSize(const char *dir); static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());}; From a262f1c85ab39f06e8065ecce8782d57df7ab2e2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 20:56:11 +0200 Subject: [PATCH 531/690] lua_filehelpers.cpp: Add lua script function 'rmdir()' - Set Lua api version to 1.51 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/631708f3803db8cce7e24d36a952dcda8a3c9849 Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 34 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + src/system/helpers.cpp | 5 ++++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 26835c5c1..22fc714af 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 50 +#define LUA_API_VERSION_MINOR 51 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 5a5c5a31f..0e472bfc9 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -55,6 +55,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "cp", CLuaInstFileHelpers::FileHelpersCp }, { "chmod", CLuaInstFileHelpers::FileHelpersChmod }, { "touch", CLuaInstFileHelpers::FileHelpersTouch }, + { "rmdir", CLuaInstFileHelpers::FileHelpersRmdir }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -225,6 +226,39 @@ int CLuaInstFileHelpers::FileHelpersTouch(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersRmdir(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript rmdir: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + const char *dir = ""; + dir = luaL_checkstring(L, 2); + + bool ret = false; + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->setConsoleQuiet(true); + ret = fh->removeDir(dir); + if (ret == false) { + helpersDebugInfo di; + fh->readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } + + lua_pushboolean(L, ret); + return 1; +} diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index 94dbff985..f9c5ebac4 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -42,6 +42,7 @@ class CLuaInstFileHelpers static int FileHelpersCp(lua_State *L); static int FileHelpersChmod(lua_State *L); static int FileHelpersTouch(lua_State *L); + static int FileHelpersRmdir(lua_State *L); static int FileHelpersDelete(lua_State *L); }; diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 61cb77718..e6cf04e64 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -910,13 +910,16 @@ bool CFileHelpers::createDir(string& Dir, mode_t mode) bool CFileHelpers::removeDir(const char *Dir) { + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->clearDebugInfo(); DIR *dir; struct dirent *entry; char path[PATH_MAX]; dir = opendir(Dir); if (dir == NULL) { - printf("Error opendir()\n"); + fh->setDebugInfo("Error opendir().", __path_file__, __func__, __LINE__); + fh->printDebugInfo(); return false; } while ((entry = readdir(dir)) != NULL) { From 389ef2d93cdcdc8f5793e33aa98aceaff6cdb8b3 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 20:56:15 +0200 Subject: [PATCH 532/690] lua_filehelpers.cpp: Add lua script function 'mkdir()' - Set Lua api version to 1.52 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/906e9a2156ede50f14940160d2bf4b2e6073036b Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 44 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + src/system/helpers.cpp | 9 ++++++- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 22fc714af..c02208fb6 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 51 +#define LUA_API_VERSION_MINOR 52 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 0e472bfc9..5ff80d118 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -56,6 +56,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "chmod", CLuaInstFileHelpers::FileHelpersChmod }, { "touch", CLuaInstFileHelpers::FileHelpersTouch }, { "rmdir", CLuaInstFileHelpers::FileHelpersRmdir }, + { "mkdir", CLuaInstFileHelpers::FileHelpersMkdir }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -260,6 +261,49 @@ int CLuaInstFileHelpers::FileHelpersRmdir(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersMkdir(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript mkdir: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + const char *dir = ""; + dir = luaL_checkstring(L, 2); + + mode_t mode = 0755; + if (numargs > min_numargs) { + int mode_i = luaL_checkint(L, 3); + /* Hack for convert lua number to octal */ + std::string mode_s = itoa(mode_i, 10); + mode = (mode_t)(strtol(mode_s.c_str(), (char **)NULL, 8) & 0x0FFF); + //printf("\n##### [%s:%d] str: %s, okt: %o \n \n", __func__, __LINE__, mode_s.c_str(), (int)mode); + } + + bool ret = false; + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->setConsoleQuiet(true); + ret = fh->createDir(dir, mode); + if (ret == false) { + helpersDebugInfo di; + fh->readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } + + lua_pushboolean(L, ret); + return 1; +} + int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index f9c5ebac4..78d03fea4 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -43,6 +43,7 @@ class CLuaInstFileHelpers static int FileHelpersChmod(lua_State *L); static int FileHelpersTouch(lua_State *L); static int FileHelpersRmdir(lua_State *L); + static int FileHelpersMkdir(lua_State *L); static int FileHelpersDelete(lua_State *L); }; diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index e6cf04e64..246831c56 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -882,6 +882,8 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) // false - errno is set bool CFileHelpers::createDir(string& Dir, mode_t mode) { + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->clearDebugInfo(); int res = 0; for(string::iterator iter = Dir.begin() ; iter != Dir.end();) { string::iterator newIter = find(iter, Dir.end(), '/' ); @@ -895,7 +897,12 @@ bool CFileHelpers::createDir(string& Dir, mode_t mode) // We can assume that if an error // occured, following will fail too, // so break here. - dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno)); + if (!fh->getConsoleQuiet()) + dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno)); + char buf[1024]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf)-1, "creating directory %s: %s", newPath.c_str(), strerror(errno)); + fh->setDebugInfo(buf, __path_file__, __func__, __LINE__); break; } } From 7ff676f0c0dcb510bcf839ad50870bb4dff8f57f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 4 Sep 2016 23:35:49 +0200 Subject: [PATCH 533/690] lua_filehelpers.cpp: Add lua script function 'readlink()' - Set Lua api version to 1.53 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b50886faca4002682d480f9e5f62f4f712a206d2 Author: Michael Liebmann Date: 2016-09-04 (Sun, 04 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 35 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index c02208fb6..6e1356615 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 52 +#define LUA_API_VERSION_MINOR 53 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 5ff80d118..0112a0c44 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -57,6 +57,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "touch", CLuaInstFileHelpers::FileHelpersTouch }, { "rmdir", CLuaInstFileHelpers::FileHelpersRmdir }, { "mkdir", CLuaInstFileHelpers::FileHelpersMkdir }, + { "readlink", CLuaInstFileHelpers::FileHelpersReadlink }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -304,6 +305,40 @@ int CLuaInstFileHelpers::FileHelpersMkdir(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersReadlink(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript readlink: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushnil(L); + return 1; + } + + const char *link = ""; + link = luaL_checkstring(L, 2); + + char buf[PATH_MAX]; + memset(buf, '\0', sizeof(buf)); + if (readlink(link, buf, sizeof(buf)-1) == -1) { + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + + lua_pushnil(L); + return 1; + } + + lua_pushstring(L, buf); + return 1; +} + int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index 78d03fea4..ea7fb6ee5 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -44,6 +44,7 @@ class CLuaInstFileHelpers static int FileHelpersTouch(lua_State *L); static int FileHelpersRmdir(lua_State *L); static int FileHelpersMkdir(lua_State *L); + static int FileHelpersReadlink(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From e217a03f2c971eea9ed1d269fa752b52ee56cdbd Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 5 Sep 2016 00:27:05 +0200 Subject: [PATCH 534/690] lua_filehelpers.cpp: Add lua script function 'ln()' - Set Lua api version to 1.54 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/95a078742b48e6c99751f3039bd18f5e05b62ef4 Author: Michael Liebmann Date: 2016-09-05 (Mon, 05 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 60 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 6e1356615..dd4987b95 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 53 +#define LUA_API_VERSION_MINOR 54 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 0112a0c44..2335d32f0 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -58,6 +58,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "rmdir", CLuaInstFileHelpers::FileHelpersRmdir }, { "mkdir", CLuaInstFileHelpers::FileHelpersMkdir }, { "readlink", CLuaInstFileHelpers::FileHelpersReadlink }, + { "ln", CLuaInstFileHelpers::FileHelpersLn }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -339,6 +340,65 @@ int CLuaInstFileHelpers::FileHelpersReadlink(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersLn(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript ln: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + const char *src = ""; + src = luaL_checkstring(L, 2); + const char *link = ""; + link = luaL_checkstring(L, 3); + + const char *flags = ""; + if (numargs > min_numargs) + flags = luaL_checkstring(L, 4); + + bool symlnk = (strchr(flags, 's') != NULL); + bool force = (strchr(flags, 'f') != NULL); + lua_Debug ar; + + if (!symlnk) { + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = "Currently only supports symlinks."; + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + lua_pushboolean(L, false); + return 1; + } + + bool ret = true; + if (symlink(src, link) != 0) { + if (force && (errno == EEXIST)) { + if (unlink(link) == 0) { + if (symlink(src, link) == 0) { + lua_pushboolean(L, ret); + return 1; + } + } + } + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + + } + + lua_pushboolean(L, ret); + return 1; +} + int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index ea7fb6ee5..23f8fbf08 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -45,6 +45,7 @@ class CLuaInstFileHelpers static int FileHelpersRmdir(lua_State *L); static int FileHelpersMkdir(lua_State *L); static int FileHelpersReadlink(lua_State *L); + static int FileHelpersLn(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From c8e4c6e0a57a9e7fc127268543e019b5b87941b4 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 5 Sep 2016 15:25:07 +0200 Subject: [PATCH 535/690] lua_filehelpers.cpp: Add lua script function 'exist()' - Set Lua api version to 1.55 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/52c489f211e1dec9f8af21a3c58c83f67ba2e720 Author: Michael Liebmann Date: 2016-09-05 (Mon, 05 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_filehelpers.cpp | 64 +++++++++++++++++++++++++++++++++ src/gui/lua/lua_filehelpers.h | 1 + 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index dd4987b95..5c47c47e2 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 54 +#define LUA_API_VERSION_MINOR 55 diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index 2335d32f0..c8d1cd252 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -59,6 +59,7 @@ void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) { "mkdir", CLuaInstFileHelpers::FileHelpersMkdir }, { "readlink", CLuaInstFileHelpers::FileHelpersReadlink }, { "ln", CLuaInstFileHelpers::FileHelpersLn }, + { "exist", CLuaInstFileHelpers::FileHelpersExist }, { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, { NULL, NULL } }; @@ -399,6 +400,69 @@ int CLuaInstFileHelpers::FileHelpersLn(lua_State *L) return 1; } +int CLuaInstFileHelpers::FileHelpersExist(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript exist: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushnil(L); + return 1; + } + + bool ret = false; + bool err = false; + int errLine = 0; + std::string errMsg = ""; + + const char *file = ""; + file = luaL_checkstring(L, 2); + const char *flag = ""; + flag = luaL_checkstring(L, 3); + + if (file_exists(file)) { + struct stat FileInfo; + if (lstat(file, &FileInfo) == -1) { + err = true; + errLine = __LINE__; + errMsg = (std::string)strerror(errno); + } + else if (strchr(flag, 'f') != NULL) { + if (S_ISREG(FileInfo.st_mode)) + ret = true; + } + else if (strchr(flag, 'l') != NULL) { + if (S_ISLNK(FileInfo.st_mode)) + ret = true; + } + else if (strchr(flag, 'd') != NULL) { + if (S_ISDIR(FileInfo.st_mode)) + ret = true; + } + else { + err = true; + errLine = __LINE__; + errMsg = (strlen(flag) == 0) ? "no" : "unknown"; + errMsg += " flag given."; + } + } + + if (err) { + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, errMsg.c_str(), __path_file__, errLine); + lua_pushnil(L); + return 1; + } + + lua_pushboolean(L, ret); + return 1; +} int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h index 23f8fbf08..853f9768e 100644 --- a/src/gui/lua/lua_filehelpers.h +++ b/src/gui/lua/lua_filehelpers.h @@ -46,6 +46,7 @@ class CLuaInstFileHelpers static int FileHelpersMkdir(lua_State *L); static int FileHelpersReadlink(lua_State *L); static int FileHelpersLn(lua_State *L); + static int FileHelpersExist(lua_State *L); static int FileHelpersDelete(lua_State *L); }; From fb44db9e19c69aeee41d3e346a2ee7d41fd26b2c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 5 Sep 2016 23:49:37 +0200 Subject: [PATCH 536/690] lua: add stand-alone stringinput; set lua api version to 1.56 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fa4486077296696849a9a201f5e81113ce370cb Author: vanhofen Date: 2016-09-05 (Mon, 05 Sep 2016) Origin message was: ------------------ - lua: add stand-alone stringinput; set lua api version to 1.56 --- src/gui/lua/Makefile.am | 1 + src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_stringinput.cpp | 106 ++++++++++++++++++++++++++++++++ src/gui/lua/lua_stringinput.h | 44 +++++++++++++ src/gui/lua/luainstance.cpp | 2 + 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 src/gui/lua/lua_stringinput.cpp create mode 100644 src/gui/lua/lua_stringinput.h diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index 6b99ec4ce..05a3b91a8 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -37,6 +37,7 @@ libneutrino_gui_lua_a_SOURCES = \ lua_menue.cpp \ lua_messagebox.cpp \ lua_misc.cpp \ + lua_stringinput.cpp \ lua_threads.cpp \ lua_threads_copy.cpp \ lua_threads_functions.cpp \ diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 5c47c47e2..b5e974561 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 55 +#define LUA_API_VERSION_MINOR 56 diff --git a/src/gui/lua/lua_stringinput.cpp b/src/gui/lua/lua_stringinput.cpp new file mode 100644 index 000000000..e61264b50 --- /dev/null +++ b/src/gui/lua/lua_stringinput.cpp @@ -0,0 +1,106 @@ +/* + * lua stringinput + * + * (C) 2016 Sven Hoefer (svenhoefer) + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 . + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "luainstance.h" +#include "lua_stringinput.h" + +CLuaInstStringInput* CLuaInstStringInput::getInstance() +{ + static CLuaInstStringInput* LuaInstStringInput = NULL; + + if (!LuaInstStringInput) + LuaInstStringInput = new CLuaInstStringInput(); + return LuaInstStringInput; +} + +void CLuaInstStringInput::StringInputRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "exec", CLuaInstStringInput::StringInputExec }, + { NULL, NULL } + }; + + luaL_newmetatable(L, "stringinput"); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, "stringinput"); +} + +/* + local return_value = stringinput.exec{ + caption="Title", + value="value", + icon="settings", + valid_chars="0123456789", + size=4 + } +*/ +int CLuaInstStringInput::StringInputExec(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + + std::string name; + tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); + + std::string value; + tableLookup(L, "value", value); + + lua_Integer size = 30; + tableLookup(L, "size", size); + + // TODO: Locales? + + std::string valid_chars = "abcdefghijklmnopqrstuvwxyz0123456789!\"$%&/()=?-.@,_: "; + tableLookup(L, "valid_chars", valid_chars); + + // TODO: CChangeObserver? + + std::string icon = std::string(NEUTRINO_ICON_INFO); + tableLookup(L, "icon", icon); + + lua_Integer sms = 0; + tableLookup(L, "sms", sms); + + CStringInput *i; + if (sms) + i = new CStringInputSMS(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); + else + i = new CStringInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); + i->exec(NULL, ""); + delete i; + + lua_pushstring(L, value.c_str()); + + return 1; +} diff --git a/src/gui/lua/lua_stringinput.h b/src/gui/lua/lua_stringinput.h new file mode 100644 index 000000000..c49ad7dc0 --- /dev/null +++ b/src/gui/lua/lua_stringinput.h @@ -0,0 +1,44 @@ +/* + * lua stringinput + * + * (C) 2016 Sven Hoefer (svenhoefer) + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 _LUASTRINGINPUT_H +#define _LUASTRINGINPUT_H + +class CLuaStringInput +{ + public: + CStringInput *b; + CLuaStringInput(); + ~CLuaStringInput(); +}; + +class CLuaInstStringInput +{ + public: + CLuaInstStringInput() {}; + ~CLuaInstStringInput() {}; + static CLuaInstStringInput* getInstance(); + static void StringInputRegister(lua_State *L); + + private: + static int StringInputExec(lua_State *L); +}; + +#endif //_LUASTRINGINPUT_H diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index ad5ca34e8..a21cac683 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -49,6 +49,7 @@ #include "lua_menue.h" #include "lua_messagebox.h" #include "lua_misc.h" +#include "lua_stringinput.h" #include "lua_threads.h" #include "lua_video.h" @@ -626,6 +627,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) CLuaInstHintbox::getInstance()->HintboxRegister(L); CLuaInstMenu::getInstance()->MenuRegister(L); CLuaInstMessagebox::getInstance()->MessageboxRegister(L); + CLuaInstStringInput::getInstance()->StringInputRegister(L); CLuaInstMisc::getInstance()->LuaMiscRegister(L); CLuaInstVideo::getInstance()->LuaVideoRegister(L); if (!fromThreads) From c53f300b4633579a93e1950b6cd6b8ac654fc419 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 6 Sep 2016 01:11:16 +0200 Subject: [PATCH 537/690] lua: add RC_timeout to keyname table; set lua api version to 1.57 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/84dfce8018a149d173b77b4365007ccc96936be4 Author: vanhofen Date: 2016-09-06 (Tue, 06 Sep 2016) Origin message was: ------------------ - lua: add RC_timeout to keyname table; set lua api version to 1.57 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/luainstance.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index b5e974561..86e7fdc8a 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 56 +#define LUA_API_VERSION_MINOR 57 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index a21cac683..203ef7d95 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -151,6 +151,7 @@ static void set_lua_variables(lua_State *L) { "prog3", CRCInput::RC_prog3 }, { "prog4", CRCInput::RC_prog4 }, #endif + { "timeout", (lua_Integer)CRCInput::RC_timeout }, /* to check if it is in our range */ { "MaxRC", CRCInput::RC_MaxRC }, { NULL, 0 } From b0c0c3bd053bb6f574e81a4ada1df5c198cecbfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 Aug 2016 16:34:00 +0200 Subject: [PATCH 538/690] Moviebrowser: start outsourcing moviebrowser code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64053c1758b1157d02b31a33db34ffa4943032bf Author: Thilo Graf Date: 2016-08-11 (Thu, 11 Aug 2016) --- configure.ac | 1 + src/Makefile.am | 1 + src/gui/Makefile.am | 3 +-- src/gui/epgplus.cpp | 2 +- src/gui/epgview.cpp | 2 +- src/gui/eventlist.cpp | 2 +- src/gui/mediaplayer_setup.cpp | 2 +- src/gui/moviebrowser/Makefile.am | 20 +++++++++++++++++++ .../{moviebrowser.cpp => moviebrowser/mb.cpp} | 8 ++++---- src/gui/{moviebrowser.h => moviebrowser/mb.h} | 12 ++++------- src/gui/movieplayer.h | 2 +- 11 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 src/gui/moviebrowser/Makefile.am rename src/gui/{moviebrowser.cpp => moviebrowser/mb.cpp} (99%) rename src/gui/{moviebrowser.h => moviebrowser/mb.h} (99%) diff --git a/configure.ac b/configure.ac index cf1fc12ee..e7b520033 100644 --- a/configure.ac +++ b/configure.ac @@ -297,6 +297,7 @@ src/gui/Makefile src/gui/bedit/Makefile src/gui/components/Makefile src/gui/lua/Makefile +src/gui/moviebrowser/Makefile src/gui/widget/Makefile src/system/Makefile src/system/mtdutils/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 1a30813fc..de465fc64 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -83,6 +83,7 @@ neutrino_LDADD = \ driver/pictureviewer/libneutrino_pictureviewer.a \ $(MTDUTILSLIBS) \ gui/movieinfo.o \ + gui/moviebrowser/mb.o \ gui/libneutrino_gui2.a \ gui/components/libneutrino_gui_components.a \ $(LUALIBS) \ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index f1d0c89b9..86a06903f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -14,7 +14,7 @@ version.h: noinst_HEADERS = version.h .PHONY: version.h -SUBDIRS = bedit components widget +SUBDIRS = bedit components moviebrowser widget if ENABLE_LUA SUBDIRS += lua @@ -68,7 +68,6 @@ libneutrino_gui_a_SOURCES = \ mediaplayer.cpp \ mediaplayer_setup.cpp \ miscsettings_menu.cpp \ - moviebrowser.cpp \ movieinfo.cpp \ movieplayer.cpp \ network_service.cpp \ diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 94ab4af35..c3d9981fa 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 14f1f26bc..c3878ed7b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 505450779..38e2d9662 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index c2894739d..bb18e8333 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include diff --git a/src/gui/moviebrowser/Makefile.am b/src/gui/moviebrowser/Makefile.am new file mode 100644 index 000000000..46379f2ca --- /dev/null +++ b/src/gui/moviebrowser/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS + +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/libeventserver \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/xmltree \ + @SIGC_CFLAGS@ \ + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libneutrino_gui_moviebrowser.a + + +libneutrino_gui_moviebrowser_a_SOURCES = \ + mb.cpp diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser/mb.cpp similarity index 99% rename from src/gui/moviebrowser.cpp rename to src/gui/moviebrowser/mb.cpp index 99c376188..89d7f0a8e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -27,7 +27,7 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried @@ -43,8 +43,8 @@ #include #include -#include "moviebrowser.h" -#include "filebrowser.h" +#include "mb.h" +#include #include #include #include @@ -1404,7 +1404,7 @@ void CMovieBrowser::refreshMovieInfo(void) int w_logo = ratio*CChannelLogo->getWidth()/100; CChannelLogo->setWidth(min(w_logo, logo_w_max)); } - + lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; CChannelLogo->setXPos(lx - pb_hdd_offset); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser/mb.h similarity index 99% rename from src/gui/moviebrowser.h rename to src/gui/moviebrowser/mb.h index 55e3e8516..0e14978db 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser/mb.h @@ -1,7 +1,7 @@ /*************************************************************************** Neutrino-GUI - DBoxII-Project - Homepage: http://dbox.cyberphoria.org/ + Homepage: http://dbox.cyberphoria.org/ $Id: moviebrowser.h,v 1.5 2006/09/11 21:11:35 guenther Exp $ @@ -37,7 +37,7 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' $Log: moviebrowser.h,v $ @@ -74,9 +74,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -385,7 +385,7 @@ class CMovieBrowser : public CMenuTarget void setMode(int mode) { if (show_mode != mode) m_file_info_stale = true; - show_mode = mode; + show_mode = mode; } bool gotMovie(const char *rec_title); @@ -651,7 +651,3 @@ const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = }; #endif /*MOVIEBROWSER_H_*/ - - - - diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index c2101cdf7..cbe1ed10a 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include From 85633abc0162061d46d214d34bc3eb19a98e1b89 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 Aug 2016 20:14:40 +0200 Subject: [PATCH 539/690] Movibrowser: types outsourced Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/71df2cab526095f1299764a20747be2d2da4c038 Author: Thilo Graf Date: 2016-08-11 (Thu, 11 Aug 2016) --- src/gui/moviebrowser/mb.h | 191 +----------------------------- src/gui/moviebrowser/mb_types.h | 198 ++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 186 deletions(-) create mode 100644 src/gui/moviebrowser/mb_types.h diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 0e14978db..6da94e076 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -69,12 +69,14 @@ #include #endif +#include "mb_types.h" + #include #include #include #include -#include + #include #include #include @@ -91,105 +93,9 @@ #define MAX_BROWSER_FRAME_HEIGHT 80 void strReplace(std::string& orig, const char* fstr, const std::string &rstr); -/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ -typedef enum -{ - MB_INFO_FILENAME = 0, - MB_INFO_FILEPATH = 1, - MB_INFO_TITLE = 2, - MB_INFO_SERIE = 3, - MB_INFO_INFO1 = 4, - MB_INFO_MAJOR_GENRE = 5, - MB_INFO_MINOR_GENRE = 6, - MB_INFO_INFO2 = 7, - MB_INFO_PARENTAL_LOCKAGE = 8, - MB_INFO_CHANNEL = 9, - MB_INFO_BOOKMARK = 10, - MB_INFO_QUALITY = 11, - MB_INFO_PREVPLAYDATE = 12, - MB_INFO_RECORDDATE = 13, - MB_INFO_PRODDATE = 14, - MB_INFO_COUNTRY = 15, - MB_INFO_GEOMETRIE = 16, - MB_INFO_AUDIO = 17, - MB_INFO_LENGTH = 18, - MB_INFO_SIZE = 19, - MB_INFO_RATING = 20, - MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list -}MB_INFO_ITEM; -typedef enum -{ - MB_DIRECTION_AUTO = 0, - MB_DIRECTION_UP = 1, - MB_DIRECTION_DOWN = 2, - MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_DIRECTION; - -typedef struct -{ - MB_INFO_ITEM item; - MB_DIRECTION direction; -}MB_SORTING; - -typedef enum -{ - MB_STORAGE_TYPE_UNDEFINED = 0, - MB_STORAGE_TYPE_NFS = 1, - MB_STORAGE_TYPE_VLC = 2, - MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_STORAGE_TYPE; - -typedef struct -{ - MB_INFO_ITEM item; - std::string optionString; - int optionVar; -}MB_FILTER; - -typedef enum -{ - MB_FOCUS_BROWSER = 0, - MB_FOCUS_LAST_PLAY = 1, - MB_FOCUS_LAST_RECORD = 2, - MB_FOCUS_MOVIE_INFO = 3, - MB_FOCUS_FILTER = 4, - MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_FOCUS; - -typedef enum -{ - MB_GUI_BROWSER_ONLY = 0, - MB_GUI_MOVIE_INFO = 1, - MB_GUI_LAST_PLAY = 2, - MB_GUI_LAST_RECORD = 3, - MB_GUI_FILTER = 4, - MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_GUI; - - -typedef enum -{ - MB_PARENTAL_LOCK_OFF = 0, - MB_PARENTAL_LOCK_ACTIVE = 1, - MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up - MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_PARENTAL_LOCK; - -typedef struct -{ - std::string name; - int* used; -}MB_DIR; - -typedef enum -{ - MB_SHOW_RECORDS, - MB_SHOW_FILES, - MB_SHOW_YT -} MB_SHOW_MODE; #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES @@ -540,14 +446,7 @@ class CFileChooser : public CMenuWidget int exec(CMenuTarget* parent, const std::string & actionKey); }; -typedef enum -{ - DIR_STATE_UNKNOWN = 0, - DIR_STATE_SERVER_DOWN = 1, - DIR_STATE_NOT_MOUNTED = 2, - DIR_STATE_MOUNTED = 3, - DIR_STATE_DISABLED = 4 -} DIR_STATE; + class CDirMenu : public CMenuWidget { @@ -568,86 +467,6 @@ class CDirMenu : public CMenuWidget }; -// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling -#define GENRE_ALL_COUNT 76 -const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = -{ - { 0x00, LOCALE_GENRE_UNKNOWN }, - { 0x10, LOCALE_GENRE_MOVIE_0 }, - { 0x11, LOCALE_GENRE_MOVIE_1 }, - { 0x12, LOCALE_GENRE_MOVIE_2 }, - { 0x13, LOCALE_GENRE_MOVIE_3 }, - { 0x14, LOCALE_GENRE_MOVIE_4 }, - { 0x15, LOCALE_GENRE_MOVIE_5 }, - { 0x16, LOCALE_GENRE_MOVIE_6 }, - { 0x17, LOCALE_GENRE_MOVIE_7 }, - { 0x18, LOCALE_GENRE_MOVIE_8 }, - { 0x20, LOCALE_GENRE_NEWS_0 }, - { 0x21, LOCALE_GENRE_NEWS_1 }, - { 0x22, LOCALE_GENRE_NEWS_2 }, - { 0x23, LOCALE_GENRE_NEWS_3 }, - { 0x24, LOCALE_GENRE_NEWS_4 }, - { 0x30, LOCALE_GENRE_SHOW_0 }, - { 0x31, LOCALE_GENRE_SHOW_1 }, - { 0x32, LOCALE_GENRE_SHOW_2 }, - { 0x33, LOCALE_GENRE_SHOW_3 }, - { 0x40, LOCALE_GENRE_SPORTS_0 }, - { 0x41, LOCALE_GENRE_SPORTS_1 }, - { 0x42, LOCALE_GENRE_SPORTS_2 }, - { 0x43, LOCALE_GENRE_SPORTS_3 }, - { 0x44, LOCALE_GENRE_SPORTS_4 }, - { 0x45, LOCALE_GENRE_SPORTS_5 }, - { 0x46, LOCALE_GENRE_SPORTS_6 }, - { 0x47, LOCALE_GENRE_SPORTS_7 }, - { 0x48, LOCALE_GENRE_SPORTS_8 }, - { 0x49, LOCALE_GENRE_SPORTS_9 }, - { 0x4A, LOCALE_GENRE_SPORTS_10 }, - { 0x4B, LOCALE_GENRE_SPORTS_11 }, - { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, - { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, - { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, - { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, - { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, - { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, - { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, - { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, - { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, - { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, - { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, - { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, - { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, - { 0x70, LOCALE_GENRE_ARTS_0 }, - { 0x71, LOCALE_GENRE_ARTS_1 }, - { 0x72, LOCALE_GENRE_ARTS_2 }, - { 0x73, LOCALE_GENRE_ARTS_3 }, - { 0x74, LOCALE_GENRE_ARTS_4 }, - { 0x75, LOCALE_GENRE_ARTS_5 }, - { 0x76, LOCALE_GENRE_ARTS_6 }, - { 0x77, LOCALE_GENRE_ARTS_7 }, - { 0x78, LOCALE_GENRE_ARTS_8 }, - { 0x79, LOCALE_GENRE_ARTS_9 }, - { 0x7A, LOCALE_GENRE_ARTS_10 }, - { 0x7B, LOCALE_GENRE_ARTS_11 }, - { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, - { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, - { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, - { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, - { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, - { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, - { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, - { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, - { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, - { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, - { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, - { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, - { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, - { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, - { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, - { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, - { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, - { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, - { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, - { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } -}; + #endif /*MOVIEBROWSER_H_*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h new file mode 100644 index 000000000..82a36e385 --- /dev/null +++ b/src/gui/moviebrowser/mb_types.h @@ -0,0 +1,198 @@ +#include + +#ifndef __MB_TYPES__ +#define __MB_TYPES__ + + + +/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ +typedef enum +{ + MB_INFO_FILENAME = 0, + MB_INFO_FILEPATH = 1, + MB_INFO_TITLE = 2, + MB_INFO_SERIE = 3, + MB_INFO_INFO1 = 4, + MB_INFO_MAJOR_GENRE = 5, + MB_INFO_MINOR_GENRE = 6, + MB_INFO_INFO2 = 7, + MB_INFO_PARENTAL_LOCKAGE = 8, + MB_INFO_CHANNEL = 9, + MB_INFO_BOOKMARK = 10, + MB_INFO_QUALITY = 11, + MB_INFO_PREVPLAYDATE = 12, + MB_INFO_RECORDDATE = 13, + MB_INFO_PRODDATE = 14, + MB_INFO_COUNTRY = 15, + MB_INFO_GEOMETRIE = 16, + MB_INFO_AUDIO = 17, + MB_INFO_LENGTH = 18, + MB_INFO_SIZE = 19, + MB_INFO_RATING = 20, + MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list +}MB_INFO_ITEM; + + +typedef enum +{ + MB_DIRECTION_AUTO = 0, + MB_DIRECTION_UP = 1, + MB_DIRECTION_DOWN = 2, + MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_DIRECTION; + +typedef struct +{ + MB_INFO_ITEM item; + MB_DIRECTION direction; +}MB_SORTING; + +typedef enum +{ + MB_STORAGE_TYPE_UNDEFINED = 0, + MB_STORAGE_TYPE_NFS = 1, + MB_STORAGE_TYPE_VLC = 2, + MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_STORAGE_TYPE; + +typedef struct +{ + MB_INFO_ITEM item; + std::string optionString; + int optionVar; +}MB_FILTER; + +typedef enum +{ + MB_FOCUS_BROWSER = 0, + MB_FOCUS_LAST_PLAY = 1, + MB_FOCUS_LAST_RECORD = 2, + MB_FOCUS_MOVIE_INFO = 3, + MB_FOCUS_FILTER = 4, + MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_FOCUS; + +typedef enum +{ + MB_GUI_BROWSER_ONLY = 0, + MB_GUI_MOVIE_INFO = 1, + MB_GUI_LAST_PLAY = 2, + MB_GUI_LAST_RECORD = 3, + MB_GUI_FILTER = 4, + MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_GUI; + + +typedef enum +{ + MB_PARENTAL_LOCK_OFF = 0, + MB_PARENTAL_LOCK_ACTIVE = 1, + MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up + MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_PARENTAL_LOCK; + +typedef struct +{ + std::string name; + int* used; +}MB_DIR; + +typedef enum +{ + MB_SHOW_RECORDS, + MB_SHOW_FILES, + MB_SHOW_YT +} MB_SHOW_MODE; + +typedef enum +{ + DIR_STATE_UNKNOWN = 0, + DIR_STATE_SERVER_DOWN = 1, + DIR_STATE_NOT_MOUNTED = 2, + DIR_STATE_MOUNTED = 3, + DIR_STATE_DISABLED = 4 +} DIR_STATE; + +// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling +#define GENRE_ALL_COUNT 76 +const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = +{ + { 0x00, LOCALE_GENRE_UNKNOWN }, + { 0x10, LOCALE_GENRE_MOVIE_0 }, + { 0x11, LOCALE_GENRE_MOVIE_1 }, + { 0x12, LOCALE_GENRE_MOVIE_2 }, + { 0x13, LOCALE_GENRE_MOVIE_3 }, + { 0x14, LOCALE_GENRE_MOVIE_4 }, + { 0x15, LOCALE_GENRE_MOVIE_5 }, + { 0x16, LOCALE_GENRE_MOVIE_6 }, + { 0x17, LOCALE_GENRE_MOVIE_7 }, + { 0x18, LOCALE_GENRE_MOVIE_8 }, + { 0x20, LOCALE_GENRE_NEWS_0 }, + { 0x21, LOCALE_GENRE_NEWS_1 }, + { 0x22, LOCALE_GENRE_NEWS_2 }, + { 0x23, LOCALE_GENRE_NEWS_3 }, + { 0x24, LOCALE_GENRE_NEWS_4 }, + { 0x30, LOCALE_GENRE_SHOW_0 }, + { 0x31, LOCALE_GENRE_SHOW_1 }, + { 0x32, LOCALE_GENRE_SHOW_2 }, + { 0x33, LOCALE_GENRE_SHOW_3 }, + { 0x40, LOCALE_GENRE_SPORTS_0 }, + { 0x41, LOCALE_GENRE_SPORTS_1 }, + { 0x42, LOCALE_GENRE_SPORTS_2 }, + { 0x43, LOCALE_GENRE_SPORTS_3 }, + { 0x44, LOCALE_GENRE_SPORTS_4 }, + { 0x45, LOCALE_GENRE_SPORTS_5 }, + { 0x46, LOCALE_GENRE_SPORTS_6 }, + { 0x47, LOCALE_GENRE_SPORTS_7 }, + { 0x48, LOCALE_GENRE_SPORTS_8 }, + { 0x49, LOCALE_GENRE_SPORTS_9 }, + { 0x4A, LOCALE_GENRE_SPORTS_10 }, + { 0x4B, LOCALE_GENRE_SPORTS_11 }, + { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, + { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, + { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, + { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, + { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, + { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, + { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, + { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, + { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, + { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, + { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, + { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, + { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, + { 0x70, LOCALE_GENRE_ARTS_0 }, + { 0x71, LOCALE_GENRE_ARTS_1 }, + { 0x72, LOCALE_GENRE_ARTS_2 }, + { 0x73, LOCALE_GENRE_ARTS_3 }, + { 0x74, LOCALE_GENRE_ARTS_4 }, + { 0x75, LOCALE_GENRE_ARTS_5 }, + { 0x76, LOCALE_GENRE_ARTS_6 }, + { 0x77, LOCALE_GENRE_ARTS_7 }, + { 0x78, LOCALE_GENRE_ARTS_8 }, + { 0x79, LOCALE_GENRE_ARTS_9 }, + { 0x7A, LOCALE_GENRE_ARTS_10 }, + { 0x7B, LOCALE_GENRE_ARTS_11 }, + { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, + { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, + { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, + { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, + { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, + { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, + { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, + { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, + { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, + { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, + { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, + { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, + { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, + { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, + { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, + { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, + { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, + { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, + { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, + { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } +}; + +#endif /*__MB_TYPES__*/ \ No newline at end of file From 3dec3ca94b4240bc96d00404f58b3896fcd9c790 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 12 Aug 2016 17:28:12 +0200 Subject: [PATCH 540/690] Moviebrowser: functions outsourced TODO: Classes and menus should follow someday. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a10755dca78f87dde7b7f123f4f5a26249c7b077 Author: Thilo Graf Date: 2016-08-12 (Fri, 12 Aug 2016) --- src/gui/moviebrowser/mb.cpp | 127 +------------------------ src/gui/moviebrowser/mb.h | 2 +- src/gui/moviebrowser/mb_functions.h | 138 ++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 123 deletions(-) create mode 100644 src/gui/moviebrowser/mb_functions.h diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 89d7f0a8e..ea1319fea 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -42,8 +42,9 @@ #include #include -#include +//#include #include "mb.h" +#include "mb_functions.h" #include #include #include @@ -62,12 +63,12 @@ #include // for statfs #include #include -#include +//#include #include #include #include #include -#include +//#include #include #include #include @@ -227,122 +228,7 @@ static MI_MOVIE_INFO* playing_info; //------------------------------------------------------------------------ #define FILEBROWSER_NUMBER_OF_SORT_VARIANTS 5 -bool sortDirection = 0; -bool compare_to_lower(const char a, const char b) -{ - return tolower(a) < tolower(b); -} - -// sort operators -bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Time > b->file.Time ; - else - return a->file.Time < b->file.Time ; -} -bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Size > b->file.Size; - else - return a->file.Size < b->file.Size; -} -bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->parentalLockAge > b->parentalLockAge; - else - return a->parentalLockAge < b->parentalLockAge; -} -bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->rating > b->rating; - else - return a->rating < b->rating; -} -bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->quality > b->quality; - else - return a->quality < b->quality; -} -bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dirItNr > b->dirItNr; - else - return a->dirItNr < b->dirItNr; -} - -bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dateOfLastPlay > b->dateOfLastPlay; - else - return a->dateOfLastPlay < b->dateOfLastPlay; -} - -bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = -{ - &sortByFileName, //MB_INFO_FILENAME = 0, - &sortByDir, //MB_INFO_FILEPATH = 1, - &sortByTitle, //MB_INFO_TITLE = 2, - NULL, //MB_INFO_SERIE = 3, - &sortByGenre, //MB_INFO_INFO1 = 4, - NULL, //MB_INFO_MAJOR_GENRE = 5, - NULL, //MB_INFO_MINOR_GENRE = 6, - NULL, //MB_INFO_INFO2 = 7, - &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, - &sortByChannel, //MB_INFO_CHANNEL = 9, - NULL, //MB_INFO_BOOKMARK = 10, - &sortByQuality, //MB_INFO_QUALITY = 11, - &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, - &sortByRecordDate, //MB_INFO_RECORDDATE = 13, - NULL, //MB_INFO_PRODDATE = 14, - NULL, //MB_INFO_COUNTRY = 15, - NULL, //MB_INFO_GEOMETRIE = 16, - NULL, //MB_INFO_AUDIO = 17, - NULL, //MB_INFO_LENGTH = 18, - &sortBySize, //MB_INFO_SIZE = 19, - &sortByRating, //MB_INFO_RATING = 20, - NULL //MB_INFO_MAX_NUMBER = 21 -}; CMovieBrowser::CMovieBrowser(): configfile ('\t') { @@ -2977,10 +2863,7 @@ void CMovieBrowser::showHelp(void) help.exec(NULL,NULL); } -static std::string rateFormat(int i) -{ - return to_string(i/10) + "," + to_string(i%10); -} + #define MAX_STRING 30 int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 6da94e076..512a165ff 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -73,7 +73,7 @@ #include -#include +//#include #include #include diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h new file mode 100644 index 000000000..4b0002ddc --- /dev/null +++ b/src/gui/moviebrowser/mb_functions.h @@ -0,0 +1,138 @@ + +#ifndef __MB_FUNCTIONS__ +#define __MB_FUNCTIONS__ + + +#include "mb_types.h" +#include + + + + +void strReplace(std::string& orig, const char* fstr, const std::string &rstr); + +static std::string rateFormat(int i) +{ + return to_string(i/10) + "," + to_string(i%10); +} + +bool sortDirection = 0; + +bool compare_to_lower(const char a, const char b) +{ + return tolower(a) < tolower(b); +} + +// sort operators +bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Time > b->file.Time ; + else + return a->file.Time < b->file.Time ; +} +bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Size > b->file.Size; + else + return a->file.Size < b->file.Size; +} +bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->parentalLockAge > b->parentalLockAge; + else + return a->parentalLockAge < b->parentalLockAge; +} +bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->rating > b->rating; + else + return a->rating < b->rating; +} +bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->quality > b->quality; + else + return a->quality < b->quality; +} +bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dirItNr > b->dirItNr; + else + return a->dirItNr < b->dirItNr; +} + +bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dateOfLastPlay > b->dateOfLastPlay; + else + return a->dateOfLastPlay < b->dateOfLastPlay; +} + +bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = +{ + &sortByFileName, //MB_INFO_FILENAME = 0, + &sortByDir, //MB_INFO_FILEPATH = 1, + &sortByTitle, //MB_INFO_TITLE = 2, + NULL, //MB_INFO_SERIE = 3, + &sortByGenre, //MB_INFO_INFO1 = 4, + NULL, //MB_INFO_MAJOR_GENRE = 5, + NULL, //MB_INFO_MINOR_GENRE = 6, + NULL, //MB_INFO_INFO2 = 7, + &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, + &sortByChannel, //MB_INFO_CHANNEL = 9, + NULL, //MB_INFO_BOOKMARK = 10, + &sortByQuality, //MB_INFO_QUALITY = 11, + &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, + &sortByRecordDate, //MB_INFO_RECORDDATE = 13, + NULL, //MB_INFO_PRODDATE = 14, + NULL, //MB_INFO_COUNTRY = 15, + NULL, //MB_INFO_GEOMETRIE = 16, + NULL, //MB_INFO_AUDIO = 17, + NULL, //MB_INFO_LENGTH = 18, + &sortBySize, //MB_INFO_SIZE = 19, + &sortByRating, //MB_INFO_RATING = 20, + NULL //MB_INFO_MAX_NUMBER = 21 +}; + + + +#endif /*__MB_FUNCTIONS__*/ From 640b0fca59472fe1f7c34c13f354300be07b1b92 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 6 Sep 2016 11:29:59 +0200 Subject: [PATCH 541/690] CFileHelpers::removeDir: Better error message - No error when directory does not exist Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff9a71cd36f7f535897156aceb7f3a0b8f1121fd Author: Michael Liebmann Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/system/helpers.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 246831c56..9a140cf52 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -925,8 +925,14 @@ bool CFileHelpers::removeDir(const char *Dir) dir = opendir(Dir); if (dir == NULL) { - fh->setDebugInfo("Error opendir().", __path_file__, __func__, __LINE__); - fh->printDebugInfo(); + if (errno == ENOENT) + return true; + if (!fh->getConsoleQuiet()) + dprintf(DEBUG_NORMAL, "[CFileHelpers %s] remove directory %s: %s\n", __func__, Dir, strerror(errno)); + char buf[1024]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf)-1, "remove directory %s: %s", Dir, strerror(errno)); + fh->setDebugInfo(buf, __path_file__, __func__, __LINE__); return false; } while ((entry = readdir(dir)) != NULL) { From daf201ae37eb052424299694f5099246e74b4845 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 6 Sep 2016 11:30:06 +0200 Subject: [PATCH 542/690] CFileHelpers: Rework FileBuf handling FileBuf: Reserve memory only when it is needed (copyFile) copyFile: Reserve for small files, only as much memory as is required Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a9c08ae900a38895724f53fab7a2fa71e3276cc Author: Michael Liebmann Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/system/helpers.cpp | 29 +++++++++++++++++++++++++---- src/system/helpers.h | 5 +++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 9a140cf52..009dd1249 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -535,8 +535,7 @@ std::string& htmlEntityDecode(std::string& text) CFileHelpers::CFileHelpers() { - FileBufSize = 0xFFFF; - FileBuf = new char[FileBufSize]; + FileBufMaxSize = 0xFFFF; doCopyFlag = true; ConsoleQuiet = false; clearDebugInfo(); @@ -544,8 +543,21 @@ CFileHelpers::CFileHelpers() CFileHelpers::~CFileHelpers() { - if (FileBuf != NULL) - delete [] FileBuf; +} + +char* CFileHelpers::initFileBuf(char* buf, uint32_t size) +{ + if (buf == NULL) + buf = new char[size]; + return buf; +} + +char* CFileHelpers::deleteFileBuf(char* buf) +{ + if (buf != NULL) + delete [] buf; + buf = NULL; + return buf; } CFileHelpers* CFileHelpers::getInstance() @@ -743,10 +755,13 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* return false; } + char* FileBuf = NULL; uint32_t block; off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); lseek64(fd1, 0, SEEK_SET); if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB + uint32_t FileBufSize = FileBufMaxSize; + FileBuf = initFileBuf(FileBuf, FileBufSize); off64_t fsize64 = fsizeSrc64; block = FileBufSize; //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64); @@ -765,12 +780,15 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (fsizeSrc64 != fsizeDst64){ close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return false; } } } else { // < 2GB off_t fsizeSrc = lseek(fd1, 0, SEEK_END); + uint32_t FileBufSize = (fsizeSrc < (off_t)FileBufMaxSize) ? fsizeSrc : FileBufMaxSize; + FileBuf = initFileBuf(FileBuf, FileBufSize); lseek(fd1, 0, SEEK_SET); off_t fsize = fsizeSrc; block = FileBufSize; @@ -790,6 +808,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (fsizeSrc != fsizeDst){ close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return false; } } @@ -800,9 +819,11 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (!doCopyFlag) { sync(); unlink(Dst); + FileBuf = deleteFileBuf(FileBuf); return false; } + FileBuf = deleteFileBuf(FileBuf); return true; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 1d56fe743..e9b860d04 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -84,10 +84,11 @@ struct helpersDebugInfo { class CFileHelpers { private: - unsigned long FileBufSize; - char *FileBuf; + uint32_t FileBufMaxSize; int fd1, fd2; + char* initFileBuf(char* buf, uint32_t size); + char* deleteFileBuf(char* buf); bool ConsoleQuiet; helpersDebugInfo DebugInfo; void setDebugInfo(const char* msg, const char* file, const char* func, int line); From 418d68a592e803fd535d095aaf45491496dffbf9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 7 Sep 2016 18:05:01 +0200 Subject: [PATCH 543/690] src/gui/lua/lua_filehelpers.cpp fix possible segfault if string argument is not a string (nil) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aab8c6d120e85546f919e901aa4511f7f51b9a3 Author: Jacek Jendrzej Date: 2016-09-07 (Wed, 07 Sep 2016) --- src/gui/lua/lua_filehelpers.cpp | 102 +++++++++++++++++++------------- 1 file changed, 62 insertions(+), 40 deletions(-) diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index c8d1cd252..c874087ac 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -93,26 +93,23 @@ int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) return 1; } - if (!lua_isstring(L, 2)) { - printf("luascript cp: argument 1 is not a string.\n"); + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); lua_pushboolean(L, false); return 1; } - const char *from = ""; - from = luaL_checkstring(L, 2); - - if (!lua_isstring(L, 3)) { - printf("luascript cp: argument 2 is not a string.\n"); - lua_pushboolean(L, false); - return 1; - } - const char *to = ""; - to = luaL_checkstring(L, 3); + const char *from = luaL_checkstring(L, 2); + const char *to = luaL_checkstring(L, 3); const char *flags = ""; - if (numargs > min_numargs) + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } flags = luaL_checkstring(L, 4); - + } bool ret = false; CFileHelpers fh; fh.setConsoleQuiet(true); @@ -143,9 +140,12 @@ int CLuaInstFileHelpers::FileHelpersChmod(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *file = ""; - file = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); int mode_i = luaL_checkint(L, 3); /* Hack for convert lua number to octal */ @@ -180,9 +180,12 @@ int CLuaInstFileHelpers::FileHelpersTouch(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *file = ""; - file = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); bool ret = true; lua_Debug ar; @@ -242,9 +245,12 @@ int CLuaInstFileHelpers::FileHelpersRmdir(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *dir = ""; - dir = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); bool ret = false; CFileHelpers* fh = CFileHelpers::getInstance(); @@ -276,9 +282,12 @@ int CLuaInstFileHelpers::FileHelpersMkdir(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *dir = ""; - dir = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); mode_t mode = 0755; if (numargs > min_numargs) { @@ -319,9 +328,12 @@ int CLuaInstFileHelpers::FileHelpersReadlink(lua_State *L) lua_pushnil(L); return 1; } - - const char *link = ""; - link = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *link = luaL_checkstring(L, 2); char buf[PATH_MAX]; memset(buf, '\0', sizeof(buf)); @@ -353,16 +365,23 @@ int CLuaInstFileHelpers::FileHelpersLn(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *src = ""; - src = luaL_checkstring(L, 2); - const char *link = ""; - link = luaL_checkstring(L, 3); + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *src = luaL_checkstring(L, 2); + const char *link = luaL_checkstring(L, 3); const char *flags = ""; - if (numargs > min_numargs) + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } flags = luaL_checkstring(L, 4); - + } bool symlnk = (strchr(flags, 's') != NULL); bool force = (strchr(flags, 'f') != NULL); lua_Debug ar; @@ -413,15 +432,18 @@ int CLuaInstFileHelpers::FileHelpersExist(lua_State *L) return 1; } + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } bool ret = false; bool err = false; int errLine = 0; std::string errMsg = ""; - const char *file = ""; - file = luaL_checkstring(L, 2); - const char *flag = ""; - flag = luaL_checkstring(L, 3); + const char *file = luaL_checkstring(L, 2); + const char *flag = luaL_checkstring(L, 3); if (file_exists(file)) { struct stat FileInfo; From 442d5b414d1f2806d0a66518095ea1721c8a1a42 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 7 Sep 2016 18:30:03 +0200 Subject: [PATCH 544/690] fix compil error: redundant redeclaration of 'void strReplace' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f101655e1959d7fe9d18a6f5281fbc039a9c24e1 Author: Jacek Jendrzej Date: 2016-09-07 (Wed, 07 Sep 2016) --- src/gui/moviebrowser/mb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 512a165ff..37c2e5b09 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -91,7 +91,7 @@ /* percent */ #define MIN_BROWSER_FRAME_HEIGHT 10 #define MAX_BROWSER_FRAME_HEIGHT 80 -void strReplace(std::string& orig, const char* fstr, const std::string &rstr); +// void strReplace(std::string& orig, const char* fstr, const std::string &rstr); From 74a6ac120f3e77439a1b1bb442a25eb8826a88b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 8 Sep 2016 00:09:52 +0200 Subject: [PATCH 545/690] lua: add pin-input; set lua api version to 1.58 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/80d1e9b6cfee78b956f3f900f19b8c15eef01828 Author: vanhofen Date: 2016-09-08 (Thu, 08 Sep 2016) Origin message was: ------------------ - lua: add pin-input; set lua api version to 1.58 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_stringinput.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 86e7fdc8a..8688d8b3e 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 57 +#define LUA_API_VERSION_MINOR 58 diff --git a/src/gui/lua/lua_stringinput.cpp b/src/gui/lua/lua_stringinput.cpp index e61264b50..90e3023ed 100644 --- a/src/gui/lua/lua_stringinput.cpp +++ b/src/gui/lua/lua_stringinput.cpp @@ -90,8 +90,17 @@ int CLuaInstStringInput::StringInputExec(lua_State *L) lua_Integer sms = 0; tableLookup(L, "sms", sms); + lua_Integer pin = 0; + tableLookup(L, "pin", pin); + + if (sms && pin) + dprintf(DEBUG_NORMAL, "[CLuaInstance][%s - %d]: 'sms' AND 'pin' is defined! 'pin' will be prefered.\n", __func__, __LINE__); + CStringInput *i; - if (sms) + if (pin) + i = new CPINInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL); + else if (sms) i = new CStringInputSMS(name, &value, size, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); else From 48f698f3726e8467f529537d3f3ee31213b68db7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 8 Sep 2016 08:42:41 +0200 Subject: [PATCH 546/690] Activate warnings for deprecated functions in CLuaInstMisc & CLuaInstVideo - Set Lua api version to 1.59 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1ab3e229092ac9a402c40cdca8d51c15c4c1b38 Author: Michael Liebmann Date: 2016-09-08 (Thu, 08 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_misc.cpp | 3 +-- src/gui/lua/lua_video.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 8688d8b3e..2de684548 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 58 +#define LUA_API_VERSION_MINOR 59 diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index c732c7d6d..9b965ae5d 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -367,8 +367,7 @@ int CLuaInstMisc::MiscDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define MISC_FUNC_DEPRECATED miscFunctionDeprecated -#define MISC_FUNC_DEPRECATED(...) +#define MISC_FUNC_DEPRECATED miscFunctionDeprecated void CLuaInstMisc::miscFunctionDeprecated(lua_State *L, std::string oldFunc) { diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index fd25aeda2..dfef5c7e5 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -352,8 +352,7 @@ int CLuaInstVideo::VideoDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated -#define VIDEO_FUNC_DEPRECATED(...) +#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated void CLuaInstVideo::videoFunctionDeprecated(lua_State *L, std::string oldFunc) { From fa2686a90e7fb997e992efb19637a1ac5f6e5c07 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 10:42:46 +0200 Subject: [PATCH 547/690] add listModeKey() function to simplify these calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2911e638c73c265275be81b2eb678982dc2cf776 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - add listModeKey() function to simplify these calls --- src/driver/rcinput.cpp | 3 ++- src/gui/bedit/bouqueteditor_bouquets.cpp | 5 +++-- src/gui/bedit/bouqueteditor_channels.cpp | 4 +++- src/gui/buildinfo.cpp | 2 +- src/gui/channellist.cpp | 6 ++++-- src/gui/dboxinfo.cpp | 2 +- src/gui/epgplus.cpp | 2 +- src/gui/epgview.cpp | 17 ++++++++--------- src/gui/eventlist.cpp | 5 +++-- src/gui/imageinfo.cpp | 2 +- src/gui/infoviewer.cpp | 2 +- src/gui/lua/lua_hintbox.cpp | 3 ++- src/gui/moviebrowser/mb.cpp | 4 ++-- src/gui/movieplayer.cpp | 4 ++-- src/gui/pictureviewer.cpp | 3 ++- src/gui/screensetup.cpp | 11 +++++------ src/gui/streaminfo2.cpp | 2 +- src/gui/timerlist.cpp | 3 +-- src/gui/widget/colorchooser.cpp | 12 +++++------- src/gui/widget/hintbox.cpp | 3 ++- src/gui/widget/keyboard_input.cpp | 3 ++- src/gui/widget/listbox.cpp | 4 ++-- src/gui/widget/menue.cpp | 12 +++++------- src/gui/widget/messagebox.cpp | 3 ++- src/gui/widget/msgbox.cpp | 3 ++- src/gui/widget/stringinput.cpp | 3 ++- src/gui/widget/stringinput_ext.cpp | 4 ++-- src/neutrino.cpp | 13 ++++++++++++- src/neutrino.h | 1 + 29 files changed, 80 insertions(+), 61 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 65856a9fe..16095b2cd 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -318,7 +318,8 @@ int CRCInput::messageLoop( bool anyKeyCancels, int timeout ) ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_ok ) ) doLoop = false; - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 8326163df..821c1ae3a 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -366,12 +366,13 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveBouquet(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } hide(); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 88ae91ab2..bce6cc269 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -447,7 +447,9 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveChannel(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index ca8a31e6d..aab25e95f 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -82,7 +82,7 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 0fcb5da92..23c169e48 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -709,8 +709,9 @@ int CChannelList::show() loop = false; } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { if (!edit_state) { + //FIXME: what about LIST_MODE_WEBTV? int newmode = msg == CRCInput::RC_sat ? LIST_MODE_SAT : LIST_MODE_FAV; CNeutrinoApp::getInstance()->SetChannelMode(newmode); res = CHANLIST_CHANGE_MODE; @@ -1318,7 +1319,8 @@ int CChannelList::numericZap(int key) doZap = true; break; } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_www || msg == CRCInput::RC_right) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || msg == CRCInput::RC_right) { + // do nothing } else if (CRCInput::isNumeric(msg)) { if (pos == 4) { diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index d9351a9c3..403220faf 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -138,7 +138,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; doLoop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; doLoop = false; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index c3d9981fa..3c6fa0828 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1132,7 +1132,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c3878ed7b..ce034413a 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1259,14 +1259,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else loop = false; break; - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - case CRCInput::RC_www: - if( !call_fromfollowlist){ - g_RCInput->postMsg (msg, 0); - loop = false; - } - break; default: if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { if(fader.StartFadeOut()) { @@ -1274,7 +1266,14 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start msg = 0; } else loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + if (!call_fromfollowlist) { + g_RCInput->postMsg (msg, 0); + loop = false; + } + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 38e2d9662..dfa836f53 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -652,11 +652,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index a8b871128..a5637052c 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -151,7 +151,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->kill(); btn_red->paint(false); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 372710cde..e65128d75 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1025,7 +1025,7 @@ void CInfoViewer::loop(bool show_dot) if (msg == (neutrino_msg_t) g_settings.key_screenshot) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 4cee2bbbb..cfa25f203 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -154,7 +154,8 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) D->b->scroll_up(); else D->b->scroll_down(); - } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == CRCInput::RC_mode) { break; } else if ((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index ea1319fea..2648480a3 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -990,8 +990,8 @@ int CMovieBrowser::exec(const char* path) { loop = false; } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { - //FIXME do nothing ? + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == NeutrinoMessages::STANDBY_ON || msg == NeutrinoMessages::LEAVE_ALL || diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ad2f7d611..1f878adcb 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1585,8 +1585,8 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { if (playstate == CMoviePlayerGui::PLAY && (position >= 300000 || (duration < 300000 && (position > (duration /2))))) makeScreenShot(true); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { - //FIXME do nothing ? + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); } else if (msg == CRCInput::RC_red || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow || msg == CRCInput::RC_blue ) { diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 3f776af5e..d6a102770 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -632,7 +632,8 @@ int CPictureViewerGui::show() loop = false; g_RCInput->postMsg(msg, data); } - else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 1906518ee..9b446f0cd 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -209,13 +209,12 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) } break; } - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - case CRCInput::RC_www: - break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 0856435e0..586fdcfd5 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -238,7 +238,7 @@ int CStreamInfo2::doSignalStrengthLoop () res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ec9cb5085..8af61afe6 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -623,9 +623,8 @@ int CTimerList::show() paint(); } } - // help key } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 92634eece..a1eef250c 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -229,18 +229,16 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) *value[VALUE_ALPHA] = a_alt; loop = false; break; - - case CRCInput::RC_sat: - case CRCInput::RC_favorites: - case CRCInput::RC_www: - break; case CRCInput::RC_timeout: case CRCInput::RC_ok: loop = false; break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 0f547dfe5..355efb877 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -290,7 +290,8 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt else hintBox->scroll_down(); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if(msg == CRCInput::RC_mode) { res = messages_return::handled; diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 4d459fefe..297e4e61b 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -610,8 +610,9 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) loop = false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 0ddf8d791..2dc01062f 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -223,13 +223,13 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { onBlueKeyPressed(); } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 21af5cd46..3a74dcbd9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -966,13 +966,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; case (CRCInput::RC_timeout): break; - - case (CRCInput::RC_sat): - case (CRCInput::RC_favorites): - case (CRCInput::RC_www): - g_RCInput->postMsg (msg, 0); - //close any menue on dbox-key case (CRCInput::RC_setup): + //close any menu on menu-key { msg = CRCInput::RC_timeout; retval = menu_return::RETURN_EXIT_ALL; @@ -989,7 +984,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + g_RCInput->postMsg (msg, 0); + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { retval = menu_return::RETURN_EXIT_ALL; msg = CRCInput::RC_timeout; } diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index f7e497846..7140d7569 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -273,8 +273,9 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || (msg == CRCInput::RC_spkr)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 503e79233..6e0067e4f 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -730,8 +730,9 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) { loop = false; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 4651d33d1..e776e1b6e 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -494,8 +494,9 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) loop=false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index d95d07681..2d04e833b 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -251,14 +251,14 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } } else { - //keine nderungen - beenden ok loop=false; if(cancel != NULL) *cancel = true; } } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b185cd004..31dc68ce0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2765,6 +2765,17 @@ void CNeutrinoApp::lockPlayBack(bool blank) videoDecoder->setBlank(true); } +bool CNeutrinoApp::listModeKey(const neutrino_msg_t msg) +{ + if ( + msg == CRCInput::RC_sat + || msg == CRCInput::RC_favorites + || msg == CRCInput::RC_www + ) + return true; + return false; +} + int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -2854,7 +2865,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && CNeutrinoApp::getInstance()->listModeKey(msg))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; diff --git a/src/neutrino.h b/src/neutrino.h index 61f616bfd..151aadd2b 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -189,6 +189,7 @@ public: // //onchange bool changeNotify(const neutrino_locale_t OptionName, void *); + bool listModeKey(const neutrino_msg_t msg); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); int getMode() { From 9a1f5390a1a6b03b0d795d940dc469981254cd95 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:42:14 +0200 Subject: [PATCH 548/690] movieinfo: internally rename epgMode -> mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c37abc0a060d1878f84699c508c08a4cec5137c Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgMode -> mode --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 0592347ff..9acbc98d9 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -615,7 +615,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; - recMovieInfo->epgMode = g_Zapit->getMode(); + recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->epgVideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index b29fb74cb..01e576a03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -112,7 +112,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); // %d + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { @@ -297,7 +297,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->epgMode) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) @@ -516,7 +516,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; - epgMode = 0; + mode = 0; epgVideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index eaa943d66..ab30bcb20 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -139,7 +139,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed - int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed + int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed From 15e649ebbe2f2db89bc37689c911f16c39154679 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:45:07 +0200 Subject: [PATCH 549/690] movieinfo: internally rename epgVideoPid -> VideoPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bb566eba5a65844b58e4f7b0c02ee4d77fb76de Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVideoPid -> VideoPid --- src/driver/record.cpp | 6 +++--- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 9acbc98d9..5111eb767 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -616,7 +616,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); - recMovieInfo->epgVideoPid = allpids.PIDs.vpid; + recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; EPG_AUDIO_PIDS audio_pids; @@ -1937,10 +1937,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { - recMovieInfo->epgVideoPid = st->id; + recMovieInfo->VideoPid = st->id; if (codec->codec_id == AV_CODEC_ID_H264) recMovieInfo->VideoType = 1; - printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->epgVideoPid); + printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->VideoPid); } } } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 01e576a03..4c3e6623c 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -113,7 +113,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { *extMessage += "\t\t<" MI_XML_TAG_AUDIOPIDS ">\n"; @@ -298,7 +298,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) @@ -517,7 +517,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; mode = 0; - epgVideoPid = 0; + VideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index ab30bcb20..899b9b87a 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -140,7 +140,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) - int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed + int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1f878adcb..cdeb50219 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -398,7 +398,7 @@ void CMoviePlayerGui::fillPids() if (p_movie_info == NULL) return; - vpid = p_movie_info->epgVideoPid; + vpid = p_movie_info->VideoPid; vtype = p_movie_info->VideoType; numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ From ea6cbecc6dce26a5087948cd8150aaa2d3348d05 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:50:18 +0200 Subject: [PATCH 550/690] movieinfo: internally rename epgVTXPID -> VtxtPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1feaad8fa5a1be1a7d287eeb8248f546624d840 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVTXPID -> VtxtPid --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5111eb767..64d892ac6 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -641,7 +641,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); } - recMovieInfo->epgVTXPID = allpids.PIDs.vtxtpid; + recMovieInfo->VtxtPid = allpids.PIDs.vtxtpid; } record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4c3e6623c..e300b2112 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -132,7 +132,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo } *extMessage += "\t\t\n"; } - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->VtxtPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); @@ -301,7 +301,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_SERIE_NAME, movie_info->serieName) @@ -519,7 +519,7 @@ void MI_MOVIE_INFO::clear(void) mode = 0; VideoPid = 0; VideoType = 0; - epgVTXPID = 0; + VtxtPid = 0; audioPids.clear(); diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 899b9b87a..71a78ca17 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -142,7 +142,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; - int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed + int VtxtPid; // currently not used, we just do not want to loose this info if movie info is saved backed bool marked; bool delAsk; From bde496cad22ae4c7c69832ad0cc2fc3ea0af9626 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:58:11 +0200 Subject: [PATCH 551/690] movieinfo: internally rename epgAudioPid -> AudioPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5dcb1c4f62e3fd5f2ce883e85fc5136ae0b5656 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgAudioPid -> AudioPid --- src/driver/record.cpp | 32 ++++++++++++++++---------------- src/gui/epgview.cpp | 2 +- src/gui/movieinfo.cpp | 18 +++++++++--------- src/gui/movieinfo.h | 8 ++++---- src/gui/movieplayer.cpp | 12 ++++++------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 64d892ac6..4068cea96 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -174,11 +174,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } } for (unsigned int i = 0; i < recMovieInfo->audioPids.size(); i++) { - apids[numpids++] = recMovieInfo->audioPids[i].epgAudioPid; + apids[numpids++] = recMovieInfo->audioPids[i].AudioPid; if(channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3){ - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); }else - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); if (numpids >= REC_MAX_APIDS) break; @@ -335,10 +335,10 @@ bool CRecordInstance::Update() record->AddPid(it->apid); for(unsigned int i = 0; i < allpids.APIDs.size(); i++) { if(allpids.APIDs[i].pid == it->apid) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 0; recMovieInfo->audioPids.push_back(audio_pids); @@ -619,15 +619,15 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; APIDList::iterator it; for(unsigned int i= 0; i< allpids.APIDs.size(); i++) { for(it = apid_list.begin(); it != apid_list.end(); ++it) { if(allpids.APIDs[i].pid == it->apid) { - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; - audio_pids.selected = (audio_pids.epgAudioPid == channel->getAudioPid()) ? 1 : 0; + audio_pids.selected = (audio_pids.AudioPid == channel->getAudioPid()) ? 1 : 0; recMovieInfo->audioPids.push_back(audio_pids); } } @@ -635,8 +635,8 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis /* FIXME sometimes no apid in xml ?? */ if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); @@ -1901,7 +1901,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li AVStream *st = ofcx->streams[i]; AVCodecContext * codec = st->codec; if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); AVDictionaryEntry *title = av_dict_get(st->metadata, "title", NULL, 0); @@ -1931,10 +1931,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li } audio_pids.selected = 0; - audio_pids.epgAudioPidName = desc; - audio_pids.epgAudioPid = st->id; + audio_pids.AudioPidName = desc; + audio_pids.AudioPid = st->id; recMovieInfo->audioPids.push_back(audio_pids); - printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); + printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.AudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { recMovieInfo->VideoPid = st->id; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ce034413a..c1cffffcd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -593,7 +593,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool { if (i) extMovieInfo += ", "; - extMovieInfo += mp_movie_info->audioPids[i].epgAudioPidName; + extMovieInfo += mp_movie_info->audioPids[i].AudioPidName; } extMovieInfo += "\n"; } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index e300b2112..197d79223 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -121,13 +121,13 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() { *extMessage += "\t\t\t<" MI_XML_TAG_AUDIO " " MI_XML_TAG_PID "=\""; - *extMessage += to_string(movie_info->audioPids[i].epgAudioPid); + *extMessage += to_string(movie_info->audioPids[i].AudioPid); *extMessage += "\" " MI_XML_TAG_ATYPE "=\""; *extMessage += to_string(movie_info->audioPids[i].atype); *extMessage += "\" " MI_XML_TAG_SELECTED "=\""; *extMessage += to_string(movie_info->audioPids[i].selected); *extMessage += "\" " MI_XML_TAG_NAME "=\""; - *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].epgAudioPidName.c_str()); + *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].AudioPidName.c_str()); *extMessage += "\"/>\n"; } *extMessage += "\t\t\n"; @@ -287,7 +287,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) int pos = 0; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; @@ -334,9 +334,9 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while (text[pos + pos2] != '\"' && text[pos + pos2] != 0 && text[pos + pos2] != '/') pos2++; if (text[pos + pos2] == '\"') - audio_pids.epgAudioPid = atoi(&text[pos + pos2 + 1]); + audio_pids.AudioPid = atoi(&text[pos + pos2 + 1]); } else - audio_pids.epgAudioPid = 0; + audio_pids.AudioPid = 0; audio_pids.atype = 0; pos2 = -1; @@ -366,7 +366,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) audio_pids.selected = atoi(&text[pos + pos2 + 1]); } - audio_pids.epgAudioPidName = ""; + audio_pids.AudioPidName = ""; //pos2 = strcspn(&text[pos],MI_XML_TAG_NAME); pos2 = -1; ptr = strstr(&text[pos], MI_XML_TAG_NAME); @@ -382,12 +382,12 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos3++; if (text[pos + pos3] == '\"') { - audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName); + audio_pids.AudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); + audio_pids.AudioPidName = htmlEntityDecode(audio_pids.AudioPidName); } } } - //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.epgAudioPid, audio_pids.atype, audio_pids.epgAudioPidName.c_str(), audio_pids.selected); + //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.AudioPid, audio_pids.atype, audio_pids.AudioPidName.c_str(), audio_pids.selected); movie_info->audioPids.push_back(audio_pids); } /* parse bookmarks */ diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 71a78ca17..6052b6fe4 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -108,9 +108,9 @@ typedef struct { int atype; int selected; - int epgAudioPid; // epg audio pid nr, usually filled by VCR - std::string epgAudioPidName; // epg audio pid name, usually filled by VCR -} EPG_AUDIO_PIDS; + int AudioPid; // audio pid nr, usually filled by VCR + std::string AudioPidName; // audio pid name, usually filled by VCR +} AUDIO_PIDS; class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); { @@ -135,7 +135,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); //char format; // currently not used //char audio; // currently not used MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie - std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] + std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index cdeb50219..0198657da 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -403,18 +403,18 @@ void CMoviePlayerGui::fillPids() numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ if (!p_movie_info->audioPids.empty()) { - currentapid = p_movie_info->audioPids[0].epgAudioPid; + currentapid = p_movie_info->audioPids[0].AudioPid; currentac3 = p_movie_info->audioPids[0].atype; } else if (!vpid) { is_file_player = true; return; } for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - apids[i] = p_movie_info->audioPids[i].epgAudioPid; + apids[i] = p_movie_info->audioPids[i].AudioPid; ac3flags[i] = p_movie_info->audioPids[i].atype; numpida++; if (p_movie_info->audioPids[i].selected) { - currentapid = p_movie_info->audioPids[i].epgAudioPid; + currentapid = p_movie_info->audioPids[i].AudioPid; currentac3 = p_movie_info->audioPids[i].atype; } } @@ -1715,8 +1715,8 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - if (p_movie_info->audioPids[i].epgAudioPid == apid && !p_movie_info->audioPids[i].epgAudioPidName.empty()) { - apidtitle = p_movie_info->audioPids[i].epgAudioPidName; + if (p_movie_info->audioPids[i].AudioPid == apid && !p_movie_info->audioPids[i].AudioPidName.empty()) { + apidtitle = p_movie_info->audioPids[i].AudioPidName; return true; } } @@ -1846,7 +1846,7 @@ void CMoviePlayerGui::selectAudioPid() CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); - APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].epgAudioPidName, + APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); } From 08e1339fcf977cd60860b54f7073d3c4a5f3aeb3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:33:04 +0200 Subject: [PATCH 552/690] movieinfo: internally rename epgChannel -> ChannelName Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a85d539bd03da86a3a8e3ed41af98768440f4b3e Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgChannel -> ChannelName --- src/driver/record.cpp | 4 ++-- src/gui/epgview.cpp | 4 ++-- src/gui/moviebrowser/mb.cpp | 12 ++++++------ src/gui/moviebrowser/mb_functions.h | 4 ++-- src/gui/movieinfo.cpp | 8 ++++---- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4068cea96..c2e527ab9 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -570,9 +570,9 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis std::string tmpstring = channel->getName(); if (tmpstring.empty()) - recMovieInfo->epgChannel = "unknown"; + recMovieInfo->channelName = "unknown"; else - recMovieInfo->epgChannel = tmpstring; + recMovieInfo->channelName = tmpstring; tmpstring = "not available"; if (epgid != 0) { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c1cffffcd..1da2879a9 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -551,12 +551,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool extMovieInfo += mp_movie_info->serieName; extMovieInfo += "\n"; } - if (!mp_movie_info->epgChannel.empty()) + if (!mp_movie_info->channelName.empty()) { extMovieInfo += "\n"; extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); extMovieInfo += ": "; - extMovieInfo += mp_movie_info->epgChannel; + extMovieInfo += mp_movie_info->channelName; extMovieInfo += "\n"; } if (mp_movie_info->rating != 0) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 2648480a3..b2b609c80 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1277,7 +1277,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item old_EpgId = m_movieSelectionHandler->epgEpgId >>16; } @@ -2547,7 +2547,7 @@ bool CMovieBrowser::addFile(CFile &file, int dirItNr) movieInfo.file = file; if(!m_movieInfo.loadMovieInfo(&movieInfo)) { - movieInfo.epgChannel = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); + movieInfo.channelName = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); movieInfo.epgTitle = file.getFileName(); } movieInfo.dirItNr = dirItNr; @@ -2947,7 +2947,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); - CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING); + CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->channelName, MAX_STRING); CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); @@ -2977,7 +2977,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput,NULL, CRCInput::RC_8)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput,NULL, CRCInput::RC_9)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->epgChannel, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL movieInfoMenu.addItem(GenericMenuSeparatorLine); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); //LOCALE_TIMERLIST_RECORDING_DIR movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE @@ -3352,7 +3352,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_CHANNEL: // = 9, - *item_string = movie_info.epgChannel; + *item_string = movie_info.channelName; break; case MB_INFO_BOOKMARK: // = 10, b = ""; @@ -3529,7 +3529,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) yt_video_list_t &ylist = ytparser.GetVideoList(); for (unsigned i = 0; i < ylist.size(); i++) { MI_MOVIE_INFO movieInfo; - movieInfo.epgChannel = ylist[i].author; + movieInfo.channelName = ylist[i].author; movieInfo.epgTitle = ylist[i].title; movieInfo.epgInfo1 = ylist[i].category; movieInfo.epgInfo2 = ylist[i].description; diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index 4b0002ddc..ddea6d9fc 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -42,9 +42,9 @@ bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) } bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) { - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(a->channelName.begin(), a->channelName.end(), b->channelName.begin(), b->channelName.end(), compare_to_lower)) return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(b->channelName.begin(), b->channelName.end(), a->channelName.begin(), a->channelName.end(), compare_to_lower)) return false; return sortByTitle(a,b); } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 197d79223..97d3ba914 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -106,7 +106,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\t<" MI_XML_TAG_RECORD " command=\"" "record" "\">\n"; - XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); + XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); @@ -291,7 +291,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) @@ -300,7 +300,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->channelName) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) @@ -527,7 +527,7 @@ void MI_MOVIE_INFO::clear(void) epgTitle = ""; epgInfo1 = ""; epgInfo2 = ""; - epgChannel = ""; + channelName = ""; serieName = ""; bookmarks.end = 0; bookmarks.start = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 6052b6fe4..24d03b558 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string epgChannel; // Channel name, usually filled by EPG + std::string channelName; // Channel name, usually filled by EPG std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0198657da..1e4762e31 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1028,7 +1028,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->cookie_header = cookie_header; instance_bg->movie_info.epgTitle = name; - instance_bg->movie_info.epgChannel = realUrl; + instance_bg->movie_info.channelName = realUrl; instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; @@ -1700,7 +1700,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 138af5fcaf66c8ee7d037c0f841115f9ec906faf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:43:00 +0200 Subject: [PATCH 553/690] movieinfo: internally rename epgId -> channelId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/625cbb6122237d16aec97032a4d0a2e8045bfdbd Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgId -> channelId --- src/driver/record.cpp | 2 +- src/gui/moviebrowser/mb.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 4 ++-- src/gui/movieplayer.cpp | 12 ++++++------ src/timerd/timermanager.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index c2e527ab9..29e5e140a 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -611,7 +611,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = epgTitle; } recMovieInfo->epgTitle = tmpstring; - recMovieInfo->epgId = channel->getChannelID(); + recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b2b609c80..d6c16d55d 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1260,7 +1260,7 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 97d3ba914..4fd89ca03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -108,7 +108,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\">\n"; XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu @@ -293,7 +293,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos++; GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) @@ -514,7 +514,7 @@ void MI_MOVIE_INFO::clear(void) //format = 0; //audio = 0; - epgId = 0; + channelId = 0; epgEpgId = 0; mode = 0; VideoPid = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 24d03b558..05f845839 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string channelName; // Channel name, usually filled by EPG + std::string channelName; // channel name, auto filled std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 @@ -137,7 +137,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] - uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t channelId; // channel id, auto filled uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1e4762e31..e41a916e1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -690,7 +690,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) int eof = 0, pos = 0; unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; - *(t_channel_id*)chid = mp->movie_info.epgId; + *(t_channel_id*)chid = mp->movie_info.channelId; bool started = mp->StartWebtv(); printf("%s: started: %d\n", __func__, started);fflush(stdout); @@ -1029,7 +1029,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->movie_info.epgTitle = name; instance_bg->movie_info.channelName = realUrl; - instance_bg->movie_info.epgId = chan; + instance_bg->movie_info.channelId = chan; instance_bg->p_movie_info = &movie_info; stopPlayBack(); @@ -1123,7 +1123,7 @@ bool CMoviePlayerGui::PlayFileStart(void) } duration = p_movie_info->length * 60 * 1000; - int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); + int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == 1); CZapit::getInstance()->SetVolumePercent(percent); } @@ -1153,7 +1153,7 @@ bool CMoviePlayerGui::PlayFileStart(void) int i; int towait = (timeshift == TSHIFT_MODE_ON) ? TIMESHIFT_SECONDS+1 : TIMESHIFT_SECONDS; int cnt = 500; - if (IS_WEBTV(movie_info.epgId)) { + if (IS_WEBTV(movie_info.channelId)) { videoDecoder->setBlank(false); cnt = 200; towait = 20; @@ -1842,10 +1842,10 @@ void CMoviePlayerGui::selectAudioPid() if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); - CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); + CVolume::getInstance()->SetCurrentChannel(p_movie_info->channelId); CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { - percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); + percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, apids[i], ac3flags[i]); APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 6d9c12f3e..1e3329800 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1240,7 +1240,7 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) //------------------------------------------------------------ void CTimerEvent_Record::Reschedule() { - // clear epgId on reschedule + // clear epgID on reschedule eventInfo.epgID = 0; eventInfo.epg_starttime = 0; epgTitle=""; From 49386530ec82a2fc036bf3fe6f98b9676dafa464 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 22:01:34 +0200 Subject: [PATCH 554/690] movieinfo: internally rename epgEpgId -> epgId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa8a3849f4449c08daea58c8f885d4a242094e30 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgEpgId -> epgId --- src/driver/record.cpp | 2 +- src/gui/epgview.cpp | 6 +++--- src/gui/moviebrowser/mb.cpp | 10 +++++----- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 29e5e140a..07887096c 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -614,7 +614,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; - recMovieInfo->epgEpgId = epgid; + recMovieInfo->epgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 1da2879a9..d05cc7e1c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -527,7 +527,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epgData.itemDescriptions.clear(); epgData.items.clear(); epgData.fsk = mp_movie_info->parentalLockAge; - epgData.table_id = mp_movie_info->epgEpgId; + epgData.table_id = mp_movie_info->epgId; #ifdef FULL_CONTENT_CLASSIFICATION epgData.contentClassification.clear(); #else @@ -655,7 +655,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epg_done = 100; //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); - res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); + res = show(mp_movie_info->epgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) { mp_movie_info->epgInfo2 = epgTextSwitch; @@ -1246,7 +1246,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } g_settings.bigFonts = bigFonts; if (mp_info) - show(mp_movie_info->epgEpgId >> 16, 0, 0, false, false, true); + show(mp_movie_info->epgId >> 16, 0, 0, false, false, true); else show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d6c16d55d..fd4aa42c4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1260,14 +1260,14 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; - if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgEpgId >>16)) { + if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgId >>16)) { if (newHeader) CChannelLogo->clearFbData(); // reset logo screen data else @@ -1275,10 +1275,10 @@ void CMovieBrowser::refreshMovieInfo(void) delete CChannelLogo; CChannelLogo = NULL; } - if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { + if (old_EpgId != m_movieSelectionHandler->epgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item - old_EpgId = m_movieSelectionHandler->epgEpgId >>16; + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item + old_EpgId = m_movieSelectionHandler->epgId >>16; } if (CChannelLogo && CChannelLogo->hasLogo()) { diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4fd89ca03..954c93cde 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -111,7 +111,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u @@ -296,7 +296,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) @@ -515,7 +515,7 @@ void MI_MOVIE_INFO::clear(void) //audio = 0; channelId = 0; - epgEpgId = 0; + epgId = 0; mode = 0; VideoPid = 0; VideoType = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 05f845839..8ce7e4426 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -138,7 +138,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t channelId; // channel id, auto filled - uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t epgId; // EPG id, usually filled by EPG int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e41a916e1..e244d798c 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1700,7 +1700,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 2a17c30cd4784ffb0a3f73158c3180cff294fc09 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 10 Sep 2016 18:58:43 +0200 Subject: [PATCH 555/690] lua: Fix segfault in messagebox.exec at 'align' and 'default' - Set default values for 'show_buttons' and 'default_button' to the correct value - Set Lua api version to 1.60 Signed-off-by: M. Liebmann Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/24dd6a8c225dbcdf9cdc4f1272ff60ad4e44e44d Author: TangoCash Date: 2016-09-10 (Sat, 10 Sep 2016) Origin message was: ------------------ lua: Fix segfault in messagebox.exec at 'align' and 'default' - Set default values for 'show_buttons' and 'default_button' to the correct value - Set Lua api version to 1.60 Signed-off-by: M. Liebmann --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_messagebox.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 2de684548..642456596 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 59 +#define LUA_API_VERSION_MINOR 60 diff --git a/src/gui/lua/lua_messagebox.cpp b/src/gui/lua/lua_messagebox.cpp index 5be190692..3d5760525 100644 --- a/src/gui/lua/lua_messagebox.cpp +++ b/src/gui/lua/lua_messagebox.cpp @@ -66,15 +66,13 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "text", text); tableLookup(L, "icon", icon); - lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = 0, default_button = 0; + lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = CMessageBox::mbAll, default_button = CMessageBox::mbrYes; tableLookup(L, "timeout", timeout); tableLookup(L, "width", width); tableLookup(L, "return_default_on_timeout", return_default_on_timeout); std::string tmp; if (tableLookup(L, "align", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); table_key mb[] = { { "center1", CMessageBox::mbBtnAlignCenter1 }, { "center2", CMessageBox::mbBtnAlignCenter2 }, @@ -82,8 +80,9 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { "right", CMessageBox::mbBtnAlignRight }, { NULL, 0 } }; + show_buttons = 0; for (int i = 0; mb[i].name; i++) - if (!strcmp(mb[i].name, val)) { + if (!strcmp(mb[i].name, tmp.c_str())) { show_buttons |= mb[i].code; break; } @@ -119,10 +118,9 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { NULL, 0 } }; if (tableLookup(L, "default", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); + default_button = 0; for (int i = 0; mbr[i].name; i++) - if (!strcmp(mbr[i].name, val)) { + if (!strcmp(mbr[i].name, tmp.c_str())) { default_button = mbr[i].code; break; } From f5076147b76ef9804ff66c1e0253889a8951371a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 Sep 2016 22:17:08 +0200 Subject: [PATCH 556/690] CThemes: try to fix possible artefacts after changed theme This ensures a clean screen before repaint after changed theme. In some constellations (eg. with color gradient) it was possible to see some old artefacts inside widget items, eg. in header. This should avoid this. Small disadvantage: screen needs complete repaint after changed theme, but this should be not a problem in this case. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bb216f975c55a6bde8c5957a8804ac7fbc76905a Author: Thilo Graf Date: 2016-09-11 (Sun, 11 Sep 2016) --- src/gui/themes.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index c3d2da0d2..cd611c9a0 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -150,6 +150,8 @@ int CThemes::Show() std::string file_name = ""; CMenuWidget themes (LOCALE_COLORMENU_MENUCOLORS, NEUTRINO_ICON_SETTINGS, width); + sigc::slot0 slot_repaint = sigc::mem_fun(themes, &CMenuWidget::hide); //we want to clean screen before repaint after changed Option + themes.OnBeforePaint.connect(slot_repaint); themes.addIntroItems(LOCALE_COLORTHEMEMENU_HEAD2); From e534457250b3b246c957db397772e841b43b9349 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 12 Sep 2016 12:10:19 +0200 Subject: [PATCH 557/690] cc_detailsline: fix positions/dimensions of detailsline Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9948649f55f2bba8ece636a17028159d11a3298b Author: vanhofen Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - cc_detailsline: fix positions/dimensions of detailsline --- src/gui/components/cc_detailsline.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 588a5e878..39f6143da 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -61,7 +61,8 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top shadow_w = 1; //CComponentsDetailLine - thickness = 4; + thickness = 4; /* MUST be an even value! */ + cc_body_gradient_enable = false; } @@ -95,11 +96,14 @@ void CComponentsDetailLine::paint(bool do_save_bg) if (v_fbdata.empty()){ - int y_mark_top = y-h_mark_top/2+thickness/2; - int y_mark_down = y_down-h_mark_down/2+thickness/2; - int sw = shadow_w; + // reduce two times the shadow width, to avoid shadow overlaps + h_mark_down -= 2*sw; + + int y_mark_top = y-h_mark_top/2; + int y_mark_down = y_down-h_mark_down/2; + cc_fbdata_t fbdata[] = { /*buffered bg full width and height */ @@ -111,16 +115,16 @@ void CComponentsDetailLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, From 6ad341fcf813de3ba998ca2b212908298b9e34c0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 12 Sep 2016 12:11:04 +0200 Subject: [PATCH 558/690] detailsline: remove unneeded position/dimension additions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/974ef11d5b418a2e44ea49d59d6927f759b0693d Author: vanhofen Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - detailsline: remove unneeded position/dimension additions --- src/gui/audioplayer.cpp | 6 +++--- src/gui/bedit/bouqueteditor_channels.cpp | 6 +++--- src/gui/bedit/bouqueteditor_chanselect.cpp | 6 +++--- src/gui/channellist.cpp | 6 +++--- src/gui/upnpbrowser.cpp | 2 +- src/gui/widget/menue.cpp | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4ec247957..3a04eac13 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1826,8 +1826,8 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) int xpos = m_x - ConnectLineBox_Width; int ypos1 = m_y + m_title_height + m_theight+ 0 + pos*m_fheight + INFO_BOX_Y_OFFSET; int ypos2 = m_y + (m_height - m_info_height) + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (m_fheight / 2) - 2; - int ypos2a = ypos2 + (m_info_height / 2) - 2; + int ypos1a = ypos1 + (m_fheight / 2); + int ypos2a = ypos2 + (m_info_height / 2); // clear details line if (dline != NULL) @@ -1838,7 +1838,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { //details line if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_fheight); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2, m_fheight); dline->setYPos(ypos1a); dline->paint(false); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index bce6cc269..8f8a9b1d1 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -229,8 +229,8 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -239,7 +239,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 2888bab7a..4ba413d75 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -291,8 +291,8 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -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+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 23c169e48..aba0ff042 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1654,13 +1654,13 @@ void CChannelList::paintItem2DetailsLine (int pos) return; int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight + pos*fheight + (fheight/2)-2; - int ypos2 = y + height + (info_height/2)-2; + int ypos1 = y + theight + pos*fheight + (fheight/2); + int ypos2 = y + height + (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+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); dline->paint(false); } } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 6ba43bc41..bc59507e2 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1241,7 +1241,7 @@ void CUpnpBrowserGui::paintItem2DetailsLine (int pos) if (!dline) dline = new CComponentsDetailLine(); - dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*3); + dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*2); dline->paint(); } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3a74dcbd9..412ccde7b 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1453,10 +1453,10 @@ void CMenuWidget::paintHint(int pos) //init details line and infobox dimensions int ypos1 = item->getYPosition(); - int ypos1a = ypos1 + (iheight/2)-2; - int ypos2a = ypos2 + (hint_height/2)-2; + int ypos1a = ypos1 + (iheight/2); + int ypos2a = ypos2 + (hint_height/2); int markh = hint_height > rad*2 ? hint_height - rad*2 : hint_height; - int imarkh = iheight/2+1; + int imarkh = iheight/2; //init details line if (details_line == NULL) From 6c5e3ab4aeb7fe42c338a5fd86390e7f1a35930d Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 12 Sep 2016 13:27:46 +0200 Subject: [PATCH 559/690] messagebox: fix navigation in buttons if just one button is present (thx dbo) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf770e9a6882bc679e225797cfb811bca85b5837 Author: TangoCash Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - messagebox: fix navigation in buttons if just one button is present (thx dbo) --- src/gui/widget/messagebox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 7140d7569..791bde242 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -233,7 +233,7 @@ int CMessageBox::exec(int timeout) result = mbrYes; loop = false; } - else if(msg==CRCInput::RC_right) + else if(msg==CRCInput::RC_right && ButtonCount > 1) { bool ok = false; while (!ok) @@ -257,7 +257,7 @@ int CMessageBox::exec(int timeout) paintButtons(); } } - else if(msg==CRCInput::RC_left) + else if(msg==CRCInput::RC_left && ButtonCount > 1) { bool ok = false; while (!ok) From 84b40fcffba8f7ee7b179e1d2e883816232ec4ff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 13 Sep 2016 09:02:30 +0200 Subject: [PATCH 560/690] CComponentsFooter: rename var for btn icon is more plausible Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2de3a167e5c95b2cd46cce46ae5136f6d294af91 Author: Thilo Graf Date: 2016-09-13 (Tue, 13 Sep 2016) --- src/gui/components/cc_frm_footer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index a02d999b2..a30fd2579 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -133,15 +133,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //generate and add button objects passed from button label content with default width to chain object. for (size_t i= 0; i< label_count; i++){ string txt = content[i].text; - string btn_name = string(content[i].button); + string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; - if (txt.empty() && btn_name.empty()){ + if (txt.empty() && icon_name.empty()){ dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] ignore item [%d], no icon and text defined!\n", __func__, __LINE__, i); continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, btn_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, icon_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btn->enableFrame(btn_contour); @@ -153,13 +153,13 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ fb_pixel_t f_col = btn->getColorFrame(); - if (btn_name == NEUTRINO_ICON_BUTTON_RED) + if (icon_name == NEUTRINO_ICON_BUTTON_RED) f_col = COL_DARK_RED; - if (btn_name == NEUTRINO_ICON_BUTTON_GREEN) + if (icon_name == NEUTRINO_ICON_BUTTON_GREEN) f_col = COL_DARK_GREEN; - if (btn_name == NEUTRINO_ICON_BUTTON_YELLOW) + if (icon_name == NEUTRINO_ICON_BUTTON_YELLOW) f_col = COL_OLIVE; - if (btn_name == NEUTRINO_ICON_BUTTON_BLUE) + if (icon_name == NEUTRINO_ICON_BUTTON_BLUE) f_col = COL_DARK_BLUE; btn->setColorFrame(f_col); } From d75b4dea831a657df4038b02380255cdc43bbcbb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 Sep 2016 08:27:14 +0200 Subject: [PATCH 561/690] CFrameBuffer: add debug warning if radius < 0 Radius < 0 causes for wrong rendering. paintBoxFrame() gets confused. This will paint partial outside of frame area. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0eca61b71e190b80221cb687b6d01bb2d8dec41c Author: Thilo Graf Date: 2016-09-01 (Thu, 01 Sep 2016) --- src/driver/framebuffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index c1877bb2d..c12d6a703 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1381,9 +1381,11 @@ void CFrameBuffer::paintBoxFrame(const int x, const int y, const int dx, const i return; if (dx == 0 || dy == 0) { - printf("paintBoxFrame: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); return; } + if (radius < 0) + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: WARNING! radius < 0 [%d] FIXIT\n", __func__, __LINE__, radius); setCornerFlags(type); int rad_tl = 0, rad_tr = 0, rad_bl = 0, rad_br = 0; From 85a8f0e8969b174dc4caa41ff98137d5365f99ff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 6 Sep 2016 20:19:20 +0200 Subject: [PATCH 562/690] CCDraw: add member to get current shadow width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1caa54d6abba97071985671630d692e551a34c00 Author: Thilo Graf Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/gui/components/cc_draw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 08db89f5e..ae5557d42 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -254,6 +254,8 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false); ///switch shadow off virtual void disableShadow(){enableShadow(CC_SHADOW_OFF);} + ///return current schadow width + int getShadowWidth(){return shadow_w;} ///paint caching for body and shadow, see also cc_paint_cache NOTE: has no effect if paint_bg = false virtual void enablePaintCache(bool enable = true); From e07fe7d1fabf90ada2a7b9b0a22726479f8b3f6b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 14 Sep 2016 00:23:23 +0200 Subject: [PATCH 563/690] pzapit: fix change video mode; tell neutrino about the new value Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d1710bb07f01944e261df13e4dd9a90d5bce2e1 Author: vanhofen Date: 2016-09-14 (Wed, 14 Sep 2016) Origin message was: ------------------ - pzapit: fix change video mode; tell neutrino about the new value --- src/neutrino.h | 2 ++ src/zapit/src/zapit.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/neutrino.h b/src/neutrino.h index 151aadd2b..1b15140ea 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -242,6 +242,8 @@ public: sigc::signal OnBeforeRestart; sigc::signal OnAfterSetupFonts; void channelRezap(); + + void g_settings_video_Mode(int value) { g_settings.video_Mode = value; } }; #endif diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 6cf7d90d5..432e19e00 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -75,6 +75,8 @@ #include #include +#include + /* globals */ int sig_delay = 2; // seconds between signal check @@ -1653,14 +1655,13 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) } break; } -#if 0 case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } -#endif #if 0 case CZapitMessages::CMD_SET_NTSC: { videoDecoder->SetVideoSystem(8); From 664538e32ab2e8a2825418bc67f3c57e32bfe725 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 21 Sep 2016 08:17:14 +0200 Subject: [PATCH 564/690] CLuaInstMessagebox::MessageboxExec: Fix 'show_buttons' handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f7ee35f241d85cc01c5d50208aedd1993060b0b Author: Michael Liebmann Date: 2016-09-21 (Wed, 21 Sep 2016) --- src/gui/lua/lua_messagebox.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_messagebox.cpp b/src/gui/lua/lua_messagebox.cpp index 3d5760525..303db0541 100644 --- a/src/gui/lua/lua_messagebox.cpp +++ b/src/gui/lua/lua_messagebox.cpp @@ -66,7 +66,7 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "text", text); tableLookup(L, "icon", icon); - lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = CMessageBox::mbAll, default_button = CMessageBox::mbrYes; + lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = 0, default_button = 0; tableLookup(L, "timeout", timeout); tableLookup(L, "width", width); tableLookup(L, "return_default_on_timeout", return_default_on_timeout); @@ -80,13 +80,13 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { "right", CMessageBox::mbBtnAlignRight }, { NULL, 0 } }; - show_buttons = 0; for (int i = 0; mb[i].name; i++) if (!strcmp(mb[i].name, tmp.c_str())) { show_buttons |= mb[i].code; break; } } + lua_pushstring(L, "buttons"); lua_gettable(L, -2); for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 2)) { @@ -108,6 +108,8 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) } } lua_pop(L, 1); + if ((show_buttons & 0xFF) == 0) + show_buttons |= CMessageBox::mbAll; table_key mbr[] = { { "yes", CMessageBox::mbrYes }, @@ -118,7 +120,6 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { NULL, 0 } }; if (tableLookup(L, "default", tmp)) { - default_button = 0; for (int i = 0; mbr[i].name; i++) if (!strcmp(mbr[i].name, tmp.c_str())) { default_button = mbr[i].code; From e1c928520d931f2e7c1b47da34da9bc0be792876 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Sep 2016 01:08:08 +0200 Subject: [PATCH 565/690] CComponentsFooter: remove defined font from footer cch_font has nothing to do with button font and is already inherited and defined from header class and can be redefined with setCaptionFont() methode if required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3af698701ba59705a045e43fe851958bf7f32863 Author: Thilo Graf Date: 2016-09-24 (Sat, 24 Sep 2016) --- src/gui/components/cc_frm_footer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index a30fd2579..c895c45da 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -68,7 +68,6 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const width = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init footer height - cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; height = max(h, cch_font->getHeight()); shadow = shadow_mode; From 3f514865acbed6ff1f303728542b79e154743528 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Sep 2016 00:14:35 +0200 Subject: [PATCH 566/690] CComponentsHeader: ensure clean object on reinit Items were destroyed with simple call of delete but not removed from item collection. removeCCItem() does this and destroys item objects too. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b205b0c8d02f85c9caf3151690cc93c438f57886 Author: Thilo Graf Date: 2016-09-24 (Sat, 24 Sep 2016) --- src/gui/components/cc_frm_header.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index c1613516d..aad2e97d8 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -86,6 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_FRM_HEADER; + clear(); cc_txt_save_screen = false; x = x_old = x_pos; y = y_old = y_pos; @@ -194,7 +195,7 @@ void CComponentsHeader::setIcon(const char* icon_name) void CComponentsHeader::setIcon(const std::string& icon_name) { - cch_icon_name = icon_name; + cch_icon_name = icon_name; initIcon(); } @@ -203,10 +204,8 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj){ - delete cch_icon_obj; - cch_icon_obj = NULL; - } + if (cch_icon_obj) + removeCCItem(cch_icon_obj); return; } From a1f3b5d041586f1f07273a5b5600cf2ac068f7c6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Sep 2016 00:16:56 +0200 Subject: [PATCH 567/690] CComponentsButton: use passed shadow parameter Shadow was always enabled. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7c4e1c20b80514434a12d884019bef29f05aadf7 Author: Thilo Graf Date: 2016-09-24 (Sat, 24 Sep 2016) --- src/gui/components/cc_frm_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 24b2d8917..e67bd73b6 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -100,7 +100,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const width = w; height = h; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET/2; //buttons are mostly small elements, so these elements should have a reasonable shadow width + shadow_w = shadow ? SHADOW_OFFSET/2 : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); @@ -127,8 +127,8 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_btn_result = -1; cc_btn_alias = -1; - initParent(parent); initCCBtnItems(); + initParent(parent); } void CComponentsButton::initIcon() From 0f4503704ce830d2c5a49c9c9455f277954163b7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Sep 2016 20:58:22 +0200 Subject: [PATCH 568/690] CMenuItem: use reasonable radius In some views the large radius looks too chunky. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/264366c792b0b494dceedbcc7a465802a9cd439f Author: Thilo Graf Date: 2016-09-24 (Sat, 24 Sep 2016) --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 412ccde7b..ef47e2f33 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -261,7 +261,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text } CComponentsShapeSquare col(stringstartposOption, y + 2, dx - stringstartposOption + x - 2, item_height - 4, NULL, false, right_frame_col, right_bg_col); col.setFrameThickness(3); - col.setCorner(RADIUS_LARGE); + col.setCorner(RADIUS_SMALL); col.paint(false); } if (*right_text) { From a5afc7df3c66a0bde5e74c696561b611a6e50f4d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Sep 2016 13:04:47 +0200 Subject: [PATCH 569/690] src/zapit/src/Makefile.am: add @FREETYPE_CFLAGS@ to avoid build fails Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9a36f6f1e6f028d77254737fb7f00fb3e336ddee Author: vanhofen Date: 2016-09-26 (Mon, 26 Sep 2016) Origin message was: ------------------ - src/zapit/src/Makefile.am: add @FREETYPE_CFLAGS@ to avoid build fails --- src/zapit/src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index 9ece8df27..a1dac17bc 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -10,6 +10,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/xmltree \ + @FREETYPE_CFLAGS@ \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a From 6836ea5d78747ddc8ee232e97ac9f8231f4aff11 Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:04:48 +0200 Subject: [PATCH 570/690] timerd: adjust recording timers to epg Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c07b0f0b6c82bac3e98f9d1ccd541ee35d7acc55 Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) --- lib/timerdclient/timerdclient.cpp | 1 + lib/timerdclient/timerdclient.h | 4 ++- lib/timerdclient/timerdtypes.h | 4 +++ src/gui/epgview.cpp | 4 +-- src/gui/followscreenings.cpp | 2 +- src/gui/timerlist.cpp | 2 ++ src/timerd/timerd.cpp | 6 ++-- src/timerd/timermanager.cpp | 49 ++++++++++++++++++++++++++++++- src/timerd/timermanager.h | 6 +++- 9 files changed, 70 insertions(+), 8 deletions(-) diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index f25f8ffcf..abd65735e 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -330,6 +330,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, tri.epg_starttime = ri->epg_starttime; tri.epgID = ri->epgID; tri.recordingSafety = ri->recordingSafety; + tri.autoAdjustToEPG = ri->autoAdjustToEPG; strncpy(tri.recordingDir, ri->recordingDir, RECORD_DIR_MAXLEN-1); length = sizeof( CTimerd::TransferRecordingInfo); data = &tri; diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 212f94cfa..94ae1b483 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -111,7 +111,7 @@ class CTimerdClient:private CBasicClient // adds new record timer event int addRecordTimerEvent(const t_channel_id channel_id, time_t alarmtime, time_t stoptime, uint64_t epgID=0, time_t epg_starttime=0, time_t announcetime = 0, - unsigned char apids=TIMERD_APIDS_STD, bool safety=false,std::string recDir="", bool forceAdd=true) + unsigned char apids=TIMERD_APIDS_STD, bool safety=false,bool autoAdjust=false, std::string recDir="", bool forceAdd=true) { CTimerd::RecordingInfo eventInfo; eventInfo.channel_id = channel_id; @@ -119,6 +119,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = safety; + eventInfo.autoAdjustToEPG = autoAdjust; strncpy(eventInfo.recordingDir, recDir.c_str(), RECORD_DIR_MAXLEN); return addTimerEvent(CTimerd::TIMER_RECORD, &eventInfo, announcetime, alarmtime, stoptime,CTimerd::TIMERREPEAT_ONCE, 0,forceAdd); }; @@ -132,6 +133,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = false; + eventInfo.autoAdjustToEPG = false; return addTimerEvent(CTimerd::TIMER_IMMEDIATE_RECORD, &eventInfo, 0, alarmtime, stoptime); }; diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index 7e5146771..4e0c5001f 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -87,6 +87,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; }; struct TransferEventInfo @@ -96,6 +97,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; }; struct TransferRecordingInfo : TransferEventInfo @@ -116,6 +118,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; }; RecordingInfo& operator = (EventInfo& e) { @@ -124,6 +127,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; return *this; } unsigned char apids; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d05cc7e1c..e9343a52d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1121,7 +1121,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,false) == -1) + TIMERD_APIDS_CONF, true, true, recDir, false) == -1) { if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120), epgData.epg_times.startzeit + epgData.epg_times.dauer)) @@ -1131,7 +1131,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,true); + TIMERD_APIDS_CONF, true, true, recDir, true); ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index cb1933d6e..1d5e80bff 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -105,7 +105,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK } if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, - e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, recDir, true) == -1) { + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, true, recDir, true) == -1) { //FIXME -- no error handling, but this shouldn't happen ... } else { #if 0 diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 8af61afe6..ebdfb6d66 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -316,6 +316,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) eventinfo.channel_id=timerNew.channel_id; eventinfo.apids = TIMERD_APIDS_CONF; eventinfo.recordingSafety = false; + eventinfo.autoAdjustToEPG = true; timerNew.standby_on = (timerNew_standby_on == 1); void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) @@ -333,6 +334,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) recinfo.channel_id=timerNew.channel_id; recinfo.apids=TIMERD_APIDS_CONF; recinfo.recordingSafety = false; + recinfo.autoAdjustToEPG = true; // FIXME -- add GUI option? timerNew.announceTime-= 120; // 2 more mins for rec timer strncpy(recinfo.recordingDir,timerNew.recordingDir,sizeof(recinfo.recordingDir)-1); diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 5f79230a0..6589e62c0 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -303,7 +303,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CTimerd::TransferRecordingInfo recInfo; CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); - if(recInfo.recordingSafety) + if(recInfo.recordingSafety) { int pre,post; CTimerManager::getInstance()->getRecordingSafety(pre,post); @@ -321,7 +321,9 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) recInfo.apids, msgAddTimer.eventRepeat, msgAddTimer.repeatCount, - recInfo.recordingDir); + recInfo.recordingDir, + recInfo.recordingSafety, + recInfo.autoAdjustToEPG); rspAddTimer.eventID = CTimerManager::getInstance()->addEvent(event); break; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 1e3329800..f117cfc8e 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1132,7 +1132,8 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, event_id_t epgID, time_t epg_starttime, unsigned char apids, CTimerd::CTimerEventRepeat evrepeat, - uint32_t repeatcount, const std::string &recDir) : + uint32_t repeatcount, const std::string &recDir, + bool _recordingSafety, bool _autoAdjustToEPG) : CTimerEvent(getEventType(), announce_Time, alarm_Time, stop_Time, evrepeat, repeatcount) { eventInfo.epgID = epgID; @@ -1141,6 +1142,8 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, eventInfo.apids = apids; recordingDir = recDir; epgTitle=""; + autoAdjustToEPG = _autoAdjustToEPG; + recordingSafety = _recordingSafety; CShortEPGData epgdata; if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) epgTitle=epgdata.title; @@ -1170,10 +1173,18 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): epgTitle = config->getString("EPG_TITLE_"+id); dprintf("read EPG_TITLE_%s %s (%p)\n",id.c_str(),epgTitle.c_str(),&epgTitle); + + recordingSafety = config->getInt32("RECORDING_SAFETY_"+id, true); + dprintf("read RECORDING_SAFETY_%s %d\n",id.c_str(), recordingSafety); + + autoAdjustToEPG = config->getInt32("EPG_AUTO_ADJUST_"+id, true); + dprintf("read EPG_AUTO_ADJUST_TO_EPG_%s %d\n",id.c_str(), autoAdjustToEPG); } //------------------------------------------------------------ void CTimerEvent_Record::fireEvent() { + if (adjustToCurrentEPG()) + return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; @@ -1188,6 +1199,8 @@ void CTimerEvent_Record::fireEvent() //------------------------------------------------------------ void CTimerEvent_Record::announceEvent() { + if (adjustToCurrentEPG()) + return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; @@ -1236,6 +1249,12 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) config->setString("EPG_TITLE_"+id,epgTitle); dprintf("set EPG_TITLE_%s to %s (%p)\n",id.c_str(),epgTitle.c_str(), &epgTitle); + + config->setInt32("RECORDING_SAFETY_"+id, recordingSafety); + dprintf("set RECORDING_SAFETY_%s to %d\n",id.c_str(), recordingSafety); + + config->setInt32("EPG_AUTO_ADJUST_"+id, autoAdjustToEPG); + dprintf("set EPG_AUTO_ADJUST_TO_EPG_%s to %d\n",id.c_str(), autoAdjustToEPG); } //------------------------------------------------------------ void CTimerEvent_Record::Reschedule() @@ -1277,6 +1296,34 @@ void CTimerEvent_Record::Refresh() if (eventInfo.epgID == 0) getEpgId(); } +//------------------------------------------------------------ +bool CTimerEvent_Record::adjustToCurrentEPG() +{ + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); + + time_t now = time(NULL); + CChannelEventList::iterator first = evtlist.end(); + for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) + { + if (e->startTime < now) + continue; + if (first == evtlist.end() || first->startTime > e->startTime) + first = e; + if (alarmTime <= e->startTime && e->startTime + (int)e->duration <= stopTime) + return false; + } + if (first == evtlist.end()) + return false; + + CTimerEvent_Record *event= new CTimerEvent_Record(first->startTime - (alarmTime - announceTime), first->startTime, first->startTime + first->duration, + eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, + CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG); + CTimerManager::getInstance()->addEvent(event,false); + setState(CTimerd::TIMERSTATE_HASFINISHED); + + return true; +} //============================================================= // Zapto Event //============================================================= diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h index 7d9a18b22..188751e45 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -117,13 +117,16 @@ class CTimerEvent_Record : public CTimerEvent CTimerd::EventInfo eventInfo; std::string recordingDir; std::string epgTitle; + bool recordingSafety; + bool autoAdjustToEPG; CTimerEvent_Record(time_t announceTime, time_t alarmTime, time_t stopTime, t_channel_id channel_id, event_id_t epgID = 0, time_t epg_starttime = 0, unsigned char apids = TIMERD_APIDS_STD, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE, - uint32_t repeatcount = 1, const std::string &recDir = ""); + uint32_t repeatcount = 1, const std::string &recDir = "", + bool _recordingSafety = true, bool _autoAdjustToEPG = true); CTimerEvent_Record(CConfigFile *config, int iId); virtual ~CTimerEvent_Record(){}; virtual CTimerd::CTimerEventTypes getEventType(void) const { return CTimerd::TIMER_RECORD; }; @@ -134,6 +137,7 @@ class CTimerEvent_Record : public CTimerEvent virtual void Reschedule(); virtual void getEpgId(); virtual void Refresh(); + virtual bool adjustToCurrentEPG(); }; class CTimerEvent_Zapto : public CTimerEvent_Record From 9aae39eab874d199614f9aee88d153c3642280e4 Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:04:48 +0200 Subject: [PATCH 571/690] timerd/timermanager: fix EPG auto-adjustment of recordings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2cebd62aee251c54d143fc0e87a2b7c30add2bcd Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/gui/epgview.cpp | 4 ++-- src/gui/followscreenings.cpp | 2 +- src/timerd/timermanager.cpp | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index e9343a52d..f56574e1b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1121,7 +1121,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, true, recDir, false) == -1) + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, false) == -1) { if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120), epgData.epg_times.startzeit + epgData.epg_times.dauer)) @@ -1131,7 +1131,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, true, recDir, true); + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, true); ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index 1d5e80bff..292878930 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -105,7 +105,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK } if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, - e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, true, recDir, true) == -1) { + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, e->startTime - (ANNOUNCETIME + 120) > time(NULL), recDir, true) == -1) { //FIXME -- no error handling, but this shouldn't happen ... } else { #if 0 diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index f117cfc8e..b0a5b5439 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1299,6 +1299,9 @@ void CTimerEvent_Record::Refresh() //------------------------------------------------------------ bool CTimerEvent_Record::adjustToCurrentEPG() { + if (!autoAdjustToEPG) + return false; + CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); From 257f0403151dc733d1690bed00cf91e35353f4a7 Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:04:48 +0200 Subject: [PATCH 572/690] gui/timerlist: don't auto-adjust manually-added timer to EPG (untested) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/250926daff2ccaa3b597f8cadc05d797c7913e5a Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/gui/timerlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ebdfb6d66..e899611e5 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -316,7 +316,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) eventinfo.channel_id=timerNew.channel_id; eventinfo.apids = TIMERD_APIDS_CONF; eventinfo.recordingSafety = false; - eventinfo.autoAdjustToEPG = true; + eventinfo.autoAdjustToEPG = false; timerNew.standby_on = (timerNew_standby_on == 1); void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) @@ -334,7 +334,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) recinfo.channel_id=timerNew.channel_id; recinfo.apids=TIMERD_APIDS_CONF; recinfo.recordingSafety = false; - recinfo.autoAdjustToEPG = true; // FIXME -- add GUI option? + recinfo.autoAdjustToEPG = false; // FIXME -- add GUI option? timerNew.announceTime-= 120; // 2 more mins for rec timer strncpy(recinfo.recordingDir,timerNew.recordingDir,sizeof(recinfo.recordingDir)-1); From 05e98f85b94f429eb47bdb826083e0543ac82cfb Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 26 Sep 2016 13:04:48 +0200 Subject: [PATCH 573/690] add autoAdjustToEPG to webif API Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3f323506453f5f1d59e32ec55e6ee30f8c9cf899 Author: TangoCash Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/nhttpd/tuxboxapi/controlapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index d1bc6b106..b63c8199d 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2804,7 +2804,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) eventinfo.epgID = 0; eventinfo.epg_starttime = 0; eventinfo.apids = TIMERD_APIDS_CONF; - eventinfo.recordingSafety = (hh->ParamList["rs"] == "1"); + eventinfo.recordingSafety = (hh->ParamList["rs"] == "1") || (hh->ParamList["rs"] == "on"); + eventinfo.autoAdjustToEPG = (hh->ParamList["aj"] == "1") || (hh->ParamList["aj"] == "on"); // channel by Id or name if(!hh->ParamList["channel_id"].empty()) From a2d979e1ab96c2942df094a281f7008952d0e93a Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 26 Sep 2016 13:04:48 +0200 Subject: [PATCH 574/690] always refresh EPG for timer recordings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e86b28a50e367872628254e318ae029c2e57ea38 Author: TangoCash Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index b0a5b5439..d374e1140 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1185,7 +1185,7 @@ void CTimerEvent_Record::fireEvent() { if (adjustToCurrentEPG()) return; - Refresh(); + getEpgId(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; strcpy(ri.recordingDir, recordingDir.substr(0,sizeof(ri.recordingDir)-1).c_str()); From 3c544ff0667b745c769f16c6c05e0a305612610d Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:57:34 +0200 Subject: [PATCH 575/690] timerd: honor recording safety when modifying timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/67a375f4daf555083dd6e5416bb70ce73c30be4d Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/timerd/timermanager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index d374e1140..7a5572c01 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1319,7 +1319,18 @@ bool CTimerEvent_Record::adjustToCurrentEPG() if (first == evtlist.end()) return false; - CTimerEvent_Record *event= new CTimerEvent_Record(first->startTime - (alarmTime - announceTime), first->startTime, first->startTime + first->duration, + time_t _announceTime = first->startTime - (alarmTime - announceTime); + time_t _alarmTime = first->startTime; + time_t _stopTime = first->startTime + first->duration; + if (recordingSafety) { + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + _announceTime -= pre; + _alarmTime -= pre; + _stopTime += post; + } + + CTimerEvent_Record *event= new CTimerEvent_Record(_announceTime, _alarmTime, _stopTime, eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG); CTimerManager::getInstance()->addEvent(event,false); From f53433c98ac436dd425b0e512167f2ee3bffb0c5 Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:57:34 +0200 Subject: [PATCH 576/690] timerd: honor recording safety when modifying timers (fix) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aaaa9745a7e07428498a3043cfa793b8f9592d08 Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) --- src/timerd/timermanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 7a5572c01..d9a54e36a 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1325,7 +1325,6 @@ bool CTimerEvent_Record::adjustToCurrentEPG() if (recordingSafety) { int pre, post; CTimerManager::getInstance()->getRecordingSafety(pre, post); - _announceTime -= pre; _alarmTime -= pre; _stopTime += post; } From 7eb33a8baec05de52f4e4b95941933f7bd71cb0c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Sep 2016 21:12:32 +0200 Subject: [PATCH 577/690] Revert "CSignalBox: Set current tuner as the default frontend" This reverts commit 128047f61fcee046f4ab8fd0380fa3893cf1a1da. Conflicts: src/gui/components/cc_frm_signalbars.h Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59ac9e57e107eae188bc1cdab6a3e8988fe49513 Author: vanhofen Date: 2016-09-28 (Wed, 28 Sep 2016) --- src/gui/components/cc_frm_signalbars.cpp | 3 +-- src/gui/components/cc_frm_signalbars.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index ed43f3ade..703c5e67c 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -29,7 +29,6 @@ #include #include -#include #include "cc_frm_signalbars.h" #include @@ -256,7 +255,7 @@ CSignalBox::CSignalBox(const int& xpos, const int& ypos, const int& w, const int initVarSigBox(); vertical = vert; - sbx_frontend = (frontend_ref == NULL) ? CFEManager::getInstance()->getLiveFE() : frontend_ref; + sbx_frontend = frontend_ref; x = xpos; y = ypos; width = w; diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index be9ade31c..110060b66 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -291,7 +291,7 @@ class CSignalBox : public CComponentsForm, public CCTextScreen public: ///class constructor for signal noise ratio. - CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref = NULL, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" ); + CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" ); ///returns the signal object, type = CSignalBar* CSignalBar* getScaleObject(){return sbar;}; From c8f5eeea3152e5bfabb9ee29293d757f6d0b35c4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 28 Sep 2016 21:12:32 +0200 Subject: [PATCH 578/690] CSignalBox: add missing member to set frontend Remove double init of sig items; Will be done already by paintScale(). Ensure reset of last sig value on fe change. Prevent possible segfault if fe is not defined. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f68fd5ac19a4eda74a3bf2535a119a679a4d7371 Author: Thilo Graf Date: 2016-09-28 (Wed, 28 Sep 2016) --- src/gui/components/cc_frm_signalbars.cpp | 12 +++++++----- src/gui/components/cc_frm_signalbars.h | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 703c5e67c..4dc677e93 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -192,7 +192,9 @@ void CSignalBar::initSBarName() void CSignalBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalStrength(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalStrength(); //reinit items with current values initSBItems(); @@ -242,7 +244,9 @@ void CSignalBar::paint(bool do_save_bg) void CSignalNoiseRatioBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalNoiseRatio(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalNoiseRatio(); //reinit items with current values initSBItems(); @@ -338,10 +342,8 @@ void CSignalBox::paintScale() void CSignalBox::paint(bool do_save_bg) { //paint frame and body - if (!is_painted){ - initSignalItems(); + if (!is_painted) paintForm(do_save_bg); - } //paint current signal value paintScale(); diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 110060b66..b69516a6c 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -116,7 +116,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG", CComponentsForm *parent = NULL); ///assigns the current used frontend, simplified a tuner object, see frontend_c.h - virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;}; + virtual void setFrontEnd(CFrontend *frontend_ref){if (sb_frontend != frontend_ref) {sb_lastsig = 0; sb_frontend = frontend_ref;}} ///assigns font for caption virtual void setTextFont(Font* font_text){sb_font = font_text;}; ///sets the caption color, see also property 'sb_caption_color' @@ -298,6 +298,9 @@ class CSignalBox : public CComponentsForm, public CCTextScreen ///returns the signal noise ratio object, type = CSignalNoiseRatioBar* CSignalNoiseRatioBar* getLabelObject(){return snrbar;}; + ///assigns the current used frontend, simplified a tuner object, see frontend_c.h + void setFrontEnd(CFrontend *frontend_ref){sbx_frontend = frontend_ref;} + ///sets the caption color of signalbars, see also property 'sbx_caption_color' void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;}; ///get caption color of signalbars, see also property 'sbx_caption_color' From 5a54632b1b2fe22b2cc1d9f706328d2b6b8f19be Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 28 Sep 2016 21:12:32 +0200 Subject: [PATCH 579/690] CInfoViewer: allow fe change without new sigbox object Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ad189f180da464086d0e3b6333dc0f7e38d973bf Author: Thilo Graf Date: 2016-09-28 (Wed, 28 Sep 2016) --- src/gui/infoviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e65128d75..2fed5ce3c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1658,12 +1658,13 @@ void CInfoViewer::showSNR () } if (sigbox == NULL){ int sigbox_offset = ChanWidth *10/100; - sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); + sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, NULL, true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); sigbox->setColorBody(numbox->getColorBody()); sigbox->doPaintBg(false); sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode()); } + sigbox->setFrontEnd(CFEManager::getInstance()->getLiveFE()); sigbox->paint(CC_SAVE_SCREEN_NO); } if(showButtonBar) From eb33a53af979b5b8bb6f50078bb3d382041dd539 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 28 Sep 2016 21:12:32 +0200 Subject: [PATCH 580/690] channellist: paint events in additional box in a separated thread Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d35cf3cd55988dc86ff7fc5ac63ce127d91ca428 Author: TangoCash Date: 2016-09-28 (Wed, 28 Sep 2016) Origin message was: ------------------ - channellist: paint events in additional box in a separated thread --- src/gui/channellist.cpp | 80 +++++++++++++++++++++++++++++++++++++---- src/gui/channellist.h | 13 +++++-- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index aba0ff042..82518bc4c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -126,6 +127,8 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl move_state = beDefault; edit_state = false; channelsChanged = false; + + paint_events_index = -2; } CChannelList::~CChannelList() @@ -157,6 +160,8 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) return; size_t chanlist_size = to - from; + if (chanlist_size <= 0) // WTF??? + return; CChannelEventList events; if (displayNext) { @@ -184,16 +189,18 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) for (uint32_t count = 0; count < chanlist_size; count++) p_requested_channels[count] = (*chanlist)[count + from]->getEpgID(); - CEitManager::getInstance()->getChannelEvents(events, p_requested_channels, chanlist_size); + CChannelEventList levents; + CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size); for (uint32_t count=0; count < chanlist_size; count++) { (*chanlist)[count + from]->currentEvent = CChannelEvent(); - for (CChannelEventList::iterator e = events.begin(); e != events.end(); ++e) { + for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { if (((*chanlist)[count + from]->getEpgID()&0xFFFFFFFFFFFFULL) == e->get_channel_id()) { (*chanlist)[count + from]->currentEvent = *e; break; } } } + levents.clear(); delete[] p_requested_channels; } } @@ -919,6 +926,8 @@ int CChannelList::show() } } + paint_events(-2); // cancel paint_events thread + if (move_state == beMoving) cancelMoveChannel(); if (edit_state) @@ -2269,9 +2278,70 @@ void CChannelList::paintPig (int _x, int _y, int w, int h) } void CChannelList::paint_events(int index) +{ + if (index == -2 && paint_events_index > -2) { + pthread_mutex_lock(&paint_events_mutex); + paint_events_index = index; + sem_post(&paint_events_sem); + pthread_join(paint_events_thr, NULL); + sem_destroy(&paint_events_sem); + pthread_mutex_unlock(&paint_events_mutex); + } else if (paint_events_index == -2) { + if (index == -2) + return; + // First paint_event. No need to lock. + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP); + pthread_mutex_init(&paint_events_mutex, &attr); + + sem_init(&paint_events_sem, 0, 0); + paint_events_index = index; + if (!pthread_create(&paint_events_thr, NULL, paint_events, (void *) this)) + sem_post(&paint_events_sem); + else + paint_events_index = -2; + } else { + pthread_mutex_lock(&paint_events_mutex); + paint_events_index = index; + pthread_mutex_unlock(&paint_events_mutex); + sem_post(&paint_events_sem); + } +} + +void *CChannelList::paint_events(void *arg) +{ + CChannelList *me = (CChannelList *) arg; + me->paint_events(); + pthread_exit(NULL); +} + +void CChannelList::paint_events() +{ + set_threadname(__func__); + + while (paint_events_index != -2) { + sem_wait(&paint_events_sem); + if (paint_events_index < 0) + continue; + while(!sem_trywait(&paint_events_sem)); + int current_index = paint_events_index; + + CChannelEventList evtlist; + readEvents((*chanlist)[current_index]->getChannelID(), evtlist); + if (current_index == paint_events_index) { + pthread_mutex_lock(&paint_events_mutex); + if (current_index == paint_events_index) + paint_events_index = -1; + pthread_mutex_unlock(&paint_events_mutex); + paint_events(evtlist); + } + } +} + +void CChannelList::paint_events(CChannelEventList &evtlist) { ffheight = g_Font[eventFont]->getHeight(); - readEvents((*chanlist)[index]->getEpgID()); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; @@ -2333,8 +2403,6 @@ void CChannelList::paint_events(int index) } i++; } - if ( !evtlist.empty() ) - evtlist.clear(); } static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) @@ -2342,7 +2410,7 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) return a.startTime < b.startTime; } -void CChannelList::readEvents(const t_channel_id channel_id) +void CChannelList::readEvents(const t_channel_id channel_id, CChannelEventList &evtlist) { CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index d1bd179e4..49d057105 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -46,6 +46,8 @@ #include #include +#include +#include enum { LIST_MODE_FAV, @@ -117,6 +119,11 @@ private: int infozone_height; int previous_channellist_additional; + int paint_events_index; + sem_t paint_events_sem; + pthread_t paint_events_thr; + pthread_mutex_t paint_events_mutex; + const char * unit_short_minute; CEPGData epgData; @@ -147,9 +154,11 @@ private: void calcSize(); std::string MaxChanNr(); void paintPig(int x, int y, int w, int h); + void paint_events(); void paint_events(int index); - CChannelEventList evtlist; - void readEvents(const t_channel_id channel_id); + void paint_events(CChannelEventList &evtlist); + static void *paint_events(void *arg); + void readEvents(const t_channel_id channel_id, CChannelEventList &evtlist); void showdescription(int index); typedef std::pair epg_pair; std::vector epgText; From 43477d076ab1de47099c9b236faaa329ef9c4c5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 29 Sep 2016 10:18:45 +0200 Subject: [PATCH 581/690] CComponentsItem: prevent reinit of already initialized parent form Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a4b2e25bf21e760549618fa0ab91b288147d76dc Author: Thilo Graf Date: 2016-09-29 (Thu, 29 Sep 2016) --- src/gui/components/cc_item.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index e973996e1..4b6e56e9c 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -55,6 +55,8 @@ CComponentsItem::CComponentsItem(CComponentsForm* parent) void CComponentsItem::initParent(CComponentsForm* parent) { + if (cc_parent == parent) + return; cc_parent = parent; if (cc_parent) cc_parent->addCCItem(this); From 41be0e256e08124ba3e00b601375c6a735b2c145 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Sep 2016 09:08:15 +0200 Subject: [PATCH 582/690] movieplayer: fix -Wformat warning Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/256b0965baab5a137d0682ce096d52a2c9709ddb Author: vanhofen Date: 2016-09-29 (Thu, 29 Sep 2016) Origin message was: ------------------ - movieplayer: fix -Wformat warning --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e244d798c..800ce266b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1380,7 +1380,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == (neutrino_msg_t) g_settings.key_quickzap_up || msg == (neutrino_msg_t) g_settings.key_quickzap_down) { quickZap(msg); } else if (fromInfoviewer && msg == CRCInput::RC_ok && !filelist.empty()) { - printf("CMoviePlayerGui::%s: start playlist movie #%d\n", __func__, vzap_it - filelist.begin()); + printf("CMoviePlayerGui::%s: start playlist movie #%ld\n", __func__, vzap_it - filelist.begin()); fromInfoviewer = false; playstate = CMoviePlayerGui::STOPPED; filelist_it = vzap_it; From 9fec447ce713f6cc289bbcfb3897731210de7ec7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Sep 2016 09:32:56 +0200 Subject: [PATCH 583/690] streamts: fix -Wformat warning Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f45d4d2bd5ad7b0e554625d06f4247cee24d9fdd Author: vanhofen Date: 2016-09-29 (Thu, 29 Sep 2016) Origin message was: ------------------ - streamts: fix -Wformat warning --- src/driver/streamts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 74379e4be..a917d2352 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -176,7 +176,7 @@ bool CStreamInstance::Open() void CStreamInstance::run() { - printf("CStreamInstance::run: %llx\n", channel_id); + printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); From 2eb76baa35627e80dbb729e7efcfbd4f16755203 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Sep 2016 10:08:54 +0200 Subject: [PATCH 584/690] neutrinofonts: fix -Wnarrowing warning in osd_setup Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9934cde5374794bd248d5d557a52a60f46a6fa6 Author: vanhofen Date: 2016-09-29 (Thu, 29 Sep 2016) Origin message was: ------------------ - neutrinofonts: fix -Wnarrowing warning in osd_setup --- src/driver/neutrinofonts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/neutrinofonts.h b/src/driver/neutrinofonts.h index 965b89f8f..9be5cff4f 100644 --- a/src/driver/neutrinofonts.h +++ b/src/driver/neutrinofonts.h @@ -44,7 +44,7 @@ typedef struct font_sizes { typedef struct font_sizes_groups { const neutrino_locale_t groupname; - const unsigned int count; + const size_t count; const SNeutrinoSettings::FONT_TYPES *const content; const char * const actionkey; const neutrino_locale_t hint; From 3f2a0b299cfcb2229717d5e0190eebcfb6f1d2c1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Sep 2016 18:06:58 +0200 Subject: [PATCH 585/690] movieplayer: fix -Wformat warning; Vol. 2 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/49b0ec3319985caeeaded168717affbb0a6a78d2 Author: vanhofen Date: 2016-09-29 (Thu, 29 Sep 2016) Origin message was: ------------------ - movieplayer: fix -Wformat warning; Vol. 2 --- src/gui/movieplayer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 800ce266b..db641841e 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1380,7 +1380,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == (neutrino_msg_t) g_settings.key_quickzap_up || msg == (neutrino_msg_t) g_settings.key_quickzap_down) { quickZap(msg); } else if (fromInfoviewer && msg == CRCInput::RC_ok && !filelist.empty()) { - printf("CMoviePlayerGui::%s: start playlist movie #%ld\n", __func__, vzap_it - filelist.begin()); + printf("CMoviePlayerGui::%s: start playlist movie #%d\n", __func__, (int)(vzap_it - filelist.begin())); fromInfoviewer = false; playstate = CMoviePlayerGui::STOPPED; filelist_it = vzap_it; @@ -1657,7 +1657,7 @@ void CMoviePlayerGui::PlayFileEnd(bool restore) void CMoviePlayerGui::set_vzap_it(bool up) { - //printf("CMoviePlayerGui::%s: vzap_it: %d count %s\n", __func__, vzap_it - filelist.begin(), up ? "up" : "down"); + //printf("CMoviePlayerGui::%s: vzap_it: %d count %s\n", __func__, (int)(vzap_it - filelist.begin()), up ? "up" : "down"); if (up) { if (vzap_it < (filelist.end() - 1)) @@ -1668,7 +1668,7 @@ void CMoviePlayerGui::set_vzap_it(bool up) if (vzap_it > filelist.begin()) --vzap_it; } - //printf("CMoviePlayerGui::%s: vzap_it: %d\n", __func__, vzap_it - filelist.begin()); + //printf("CMoviePlayerGui::%s: vzap_it: %d\n", __func__, (int)(vzap_it - filelist.begin())); } void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) From 1734d4e3ef386c5ce2d5a67ada298c2fe5a89f5f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Sep 2016 23:58:18 +0200 Subject: [PATCH 586/690] fade: fix flickering on HD2 hardware; ported from TangoCash's repo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/934ad685202e7b4aaa05f547d0c059d8ca8a543e Author: vanhofen Date: 2016-09-29 (Thu, 29 Sep 2016) Origin message was: ------------------ - fade: fix flickering on HD2 hardware; ported from TangoCash's repo --- src/driver/fade.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index 92a5fbe40..ae0fffd58 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -28,7 +28,7 @@ #include #include -#ifdef HAVE_COOL_HARDWARE +#if HAVE_COOL_HARDWARE #include #endif @@ -61,6 +61,9 @@ void COSDFader::StartFadeIn() #endif frameBuffer->setBlendLevel(fadeValue); +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); +#endif fadeTimer = g_RCInput->addTimer( FADE_TIME, false ); } @@ -90,10 +93,12 @@ void COSDFader::StopFade() if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); #ifdef BOXMODEL_APOLLO - usleep(40000); frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha #else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); +#endif #endif fadeIn = fadeOut = false; } @@ -122,6 +127,9 @@ bool COSDFader::FadeDone() frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha #else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); +#endif #endif } else frameBuffer->setBlendLevel(fadeValue); From 51e872dab98fca3c7d811210519719298f039c02 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 30 Sep 2016 00:02:01 +0200 Subject: [PATCH 587/690] streaminfo2: allow fade in/out Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6cff0d23ce26e62c4c215d61cbc0399066d0ce56 Author: vanhofen Date: 2016-09-30 (Fri, 30 Sep 2016) Origin message was: ------------------ - streaminfo2: allow fade in/out --- src/gui/streaminfo2.cpp | 42 ++++++++++++++++++++++++++++++++++++----- src/gui/streaminfo2.h | 2 ++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 586fdcfd5..dacb6fdd1 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -55,7 +56,7 @@ extern cAudio * audioDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ -CStreamInfo2::CStreamInfo2 () +CStreamInfo2::CStreamInfo2() : fader(g_settings.theme.menu_Content_alpha) { frameBuffer = CFrameBuffer::getInstance (); pip = NULL; @@ -121,9 +122,11 @@ int CStreamInfo2::exec (CMenuTarget * parent, const std::string &) frontend = CFEManager::getInstance()->getLiveFE(); + fader.StartFadeIn(); paint (paint_mode); int res = doSignalStrengthLoop (); hide (); + fader.StopFade(); return res; } @@ -133,7 +136,9 @@ int CStreamInfo2::doSignalStrengthLoop () #define BAR_HEIGHT 12 int res = menu_return::RETURN_REPAINT; + bool fadeout = false; neutrino_msg_t msg; + neutrino_msg_t postmsg = 0; uint64_t maxb, minb, lastb, tmp_rate; unsigned int current_pmt_version= pmt_version; int cnt = 0; @@ -150,6 +155,27 @@ int CStreamInfo2::doSignalStrengthLoop () uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS (100); g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); + if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) + { + if (fader.FadeDone()) + { + break; + } + continue; + } + if (fadeout && msg == CRCInput::RC_timeout) + { + if (fader.StartFadeOut()) + { + msg = 0; + continue; + } + else + { + break; + } + } + if (!mp) { signal.sig = frontend->getSignalStrength() & 0xFFFF; signal.snr = frontend->getSignalNoiseRatio() & 0xFFFF; @@ -236,12 +262,12 @@ int CStreamInfo2::doSignalStrengthLoop () } else if(msg == CRCInput::RC_setup) { res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { - g_RCInput->postMsg (msg, 0); + postmsg = msg; res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { CNeutrinoApp::getInstance ()->handleMsg (msg, data); @@ -250,7 +276,7 @@ int CStreamInfo2::doSignalStrengthLoop () // -- any key --> abort if (msg <= CRCInput::RC_MaxRC) - break; + fadeout = true; // -- push other events if (msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout) @@ -259,6 +285,12 @@ int CStreamInfo2::doSignalStrengthLoop () delete signalbox; signalbox = NULL; ts_close (); + + if (postmsg) + { + g_RCInput->postMsg(postmsg, 0); + } + return res; } diff --git a/src/gui/streaminfo2.h b/src/gui/streaminfo2.h index f0808e9d1..ca7019659 100644 --- a/src/gui/streaminfo2.h +++ b/src/gui/streaminfo2.h @@ -31,6 +31,7 @@ #include +class COSDFader; class CStreamInfo2 : public CMenuTarget { private: @@ -39,6 +40,7 @@ class CStreamInfo2 : public CMenuTarget CFrontend *frontend; CComponentsPIP * pip; CMoviePlayerGui *mp; + COSDFader fader; int x; int y; int width; From bdb6d1c9986c61dfc61a65043b8e7c062c0b1d35 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 30 Sep 2016 05:54:17 +0200 Subject: [PATCH 588/690] Move definitions for '*_VAR' directories to configure Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/281930c35db1996a8165a732f3cab5caaed1b9fa Author: Michael Liebmann Date: 2016-09-30 (Fri, 30 Sep 2016) --- acinclude.m4 | 41 ++++++++++++++++++++++++++++------------- src/global.h | 6 ------ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 0e7958dfa..38323b1d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -123,43 +123,58 @@ if test "$TARGET" = "cdk"; then fi TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config, - [--with-configdir=PATH ],[where to find the config files]) + [--with-configdir=PATH ],[where to find the config files]) TUXBOX_APPS_DIRECTORY_ONE(datadir,DATADIR,datadir,/share,/tuxbox, - [--with-datadir=PATH ],[where to find data]) + [--with-datadir=PATH ],[where to find data]) TUXBOX_APPS_DIRECTORY_ONE(fontdir,FONTDIR,datadir,/share,/fonts, - [--with-fontdir=PATH ],[where to find the fonts]) + [--with-fontdir=PATH ],[where to find the fonts]) TUXBOX_APPS_DIRECTORY_ONE(gamesdir,GAMESDIR,localstatedir,/var,/tuxbox/games, - [--with-gamesdir=PATH ],[where games data is stored]) + [--with-gamesdir=PATH ],[where games data is stored]) TUXBOX_APPS_DIRECTORY_ONE(libdir,LIBDIR,libdir,/lib,/tuxbox, - [--with-libdir=PATH ],[where to find the internal libs]) + [--with-libdir=PATH ],[where to find the internal libs]) TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, - [--with-plugindir=PATH ],[where to find the plugins]) + [--with-plugindir=PATH ],[where to find the plugins]) + +TUXBOX_APPS_DIRECTORY_ONE(plugindir_var,PLUGINDIR_VAR,localstatedir,/var,/tuxbox/plugins, + [--with-plugindir_var=PATH ],[where to find the plugins in /var]) + +TUXBOX_APPS_DIRECTORY_ONE(plugindir_mnt,PLUGINDIR_MNT,mntdir,/mnt,/plugins, + [--with-plugindir_mnt=PATH ],[where to find the the extern plugins]) TUXBOX_APPS_DIRECTORY_ONE(luaplugindir,LUAPLUGINDIR,libdir,/lib,/tuxbox/luaplugins, - [--with-luaplugindir=PATH ],[where to find Lua plugins]) + [--with-luaplugindir=PATH ],[where to find Lua plugins]) TUXBOX_APPS_DIRECTORY_ONE(localedir,LOCALEDIR,datadir,/share, /tuxbox/neutrino/locale, - [--with-localedir=PATH ],[where to find the locale]) + [--with-localedir=PATH ],[where to find the locale]) + +TUXBOX_APPS_DIRECTORY_ONE(localedir_var,LOCALEDIR_VAR,localstatedir,/var,/tuxbox/locale, + [--with-localedir_var=PATH ],[where to find the locale in /var]) TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share, /tuxbox/neutrino/themes, - [--with-themesdir=PATH ],[where to find the themes]) + [--with-themesdir=PATH ],[where to find the themes]) + +TUXBOX_APPS_DIRECTORY_ONE(themesdir_var,THEMESDIR_VAR,localstatedir,/var,/tuxbox/themes, + [--with-themesdir_var=PATH ],[where to find the themes in /var]) TUXBOX_APPS_DIRECTORY_ONE(iconsdir,ICONSDIR,datadir,/share, /tuxbox/neutrino/icons, - [--with-iconsdir=PATH ],[where to find the icons]) + [--with-iconsdir=PATH ],[where to find the icons]) + +TUXBOX_APPS_DIRECTORY_ONE(iconsdir_var,ICONSDIR_VAR,localstatedir,/var,/tuxbox/icons, + [--with-iconsdir_var=PATH ],[where to find the icons in /var]) TUXBOX_APPS_DIRECTORY_ONE(private_httpddir,PRIVATE_HTTPDDIR,datadir,/share,/tuxbox/neutrino/httpd, - [--with-private_httpddir=PATH ],[where to find the the private httpd files]) + [--with-private_httpddir=PATH ],[where to find the the private httpd files]) TUXBOX_APPS_DIRECTORY_ONE(public_httpddir,PUBLIC_HTTPDDIR,localstatedir,/var,/httpd, - [--with-public_httpddir=PATH ],[where to find the the public httpd files]) + [--with-public_httpddir=PATH ],[where to find the the public httpd files]) TUXBOX_APPS_DIRECTORY_ONE(hosted_httpddir,HOSTED_HTTPDDIR,mntdir,/mnt,/hosted, - [--with-hosted_httpddir=PATH ],[where to find the the hosted files]) + [--with-hosted_httpddir=PATH ],[where to find the the hosted files]) ]) dnl automake <= 1.6 needs this specifications diff --git a/src/global.h b/src/global.h index 94e5a781c..269169ab8 100644 --- a/src/global.h +++ b/src/global.h @@ -46,12 +46,6 @@ #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" -#define ICONSDIR_VAR "/var/tuxbox/icons/" -#define LOCALEDIR_VAR "/var/tuxbox/locale" -#define THEMESDIR_VAR "/var/tuxbox/themes" -#define PLUGINDIR_VAR "/var/tuxbox/plugins" -#define PLUGINDIR_MNT "/mnt/plugins" - #define LOGODIR ICONSDIR "/logo" #define LOGODIR_VAR ICONSDIR_VAR "/logo" From 32668ed67a2df8134fb08018bf09640fbd1745c1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 30 Sep 2016 08:53:30 +0200 Subject: [PATCH 589/690] moviebrowser: undock display of filling level from infobar setting Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc5f7767802bbbdda50cc4a8945021213031e3e4 Author: vanhofen Date: 2016-09-30 (Fri, 30 Sep 2016) Origin message was: ------------------ - moviebrowser: undock display of filling level from infobar setting --- src/gui/moviebrowser/mb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index fd4aa42c4..c227d5902 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1263,7 +1263,7 @@ void CMovieBrowser::refreshMovieInfo(void) //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; - short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; + short pb_hdd_offset = 104; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; @@ -1339,7 +1339,7 @@ void CMovieBrowser::refreshMovieInfo(void) void CMovieBrowser::info_hdd_level(bool paint_hdd) { - if (show_mode == MB_SHOW_YT || !g_settings.infobar_show_sysfs_hdd) + if (show_mode == MB_SHOW_YT) return; struct statfs s; From 3507c534e4c10407fd4e22b7ff70a91f570bd1d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 1 Oct 2016 11:06:11 +0200 Subject: [PATCH 590/690] yWeb: add hack to Makefile to replace %(FAKE_VARIABLES) after install Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61b56cdf5830509ac20a8e57acb9535b0b755470 Author: vanhofen Date: 2016-10-01 (Sat, 01 Oct 2016) Origin message was: ------------------ - yWeb: add hack to Makefile to replace %(FAKE_VARIABLES) after install --- src/nhttpd/web/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nhttpd/web/Makefile.am b/src/nhttpd/web/Makefile.am index 51994c542..41b470401 100644 --- a/src/nhttpd/web/Makefile.am +++ b/src/nhttpd/web/Makefile.am @@ -99,3 +99,11 @@ install_DATA += accordion.js \ Y_Filemgr.yhtm \ Y_Filemgr_Edit.yhtm \ Y_Filemgr_blocks.txt + +install-data-hook: + @# Badass hack, I know. If anyone knows a better way -- please send patch! + find $(DESTDIR)$(PRIVATE_HTTPDDIR)/ -type f -print0 | xargs --no-run-if-empty -0 \ + sed -i \ + -e 's|%(CONFIGDIR)|$(CONFIGDIR)|g' \ + ; + From b05330225a78f2b361783b2d9e85cb204cf28b56 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 1 Oct 2016 11:06:11 +0200 Subject: [PATCH 591/690] yWeb: replace hardcoded paths (/var/tuxbox/config -> %(CONFIGDIR)) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f60578680bed90311c806179e2001e9d795e163f Author: vanhofen Date: 2016-10-01 (Sat, 01 Oct 2016) Origin message was: ------------------ - yWeb: replace hardcoded paths (/var/tuxbox/config -> %(CONFIGDIR)) --- src/nhttpd/web/Y_About.yhtm | 2 +- src/nhttpd/web/Y_Blocks.txt | 262 ++++++------ src/nhttpd/web/Y_Boxcontrol_Menue.yhtm | 4 +- src/nhttpd/web/Y_EPG_Plus.yhtm | 2 +- src/nhttpd/web/Y_Ext_Menue.yhtm | 4 +- src/nhttpd/web/Y_Ext_Settings.yhtm | 2 +- src/nhttpd/web/Y_Ext_Update.js | 2 +- src/nhttpd/web/Y_Info_Menue.yhtm | 2 +- src/nhttpd/web/Y_Live.yhtm | 8 +- src/nhttpd/web/Y_Live_DoubleView.yhtm | 4 +- src/nhttpd/web/Y_Live_Menue.yhtm | 2 +- src/nhttpd/web/Y_Live_Record.yhtm | 2 +- src/nhttpd/web/Y_Menue.yhtm | 6 +- src/nhttpd/web/Y_Settings_Live.yhtm | 12 +- src/nhttpd/web/Y_Settings_Menue.yhtm | 2 +- src/nhttpd/web/Y_Settings_Timer.yhtm | 10 +- src/nhttpd/web/Y_Settings_VNC.yhtm | 8 +- src/nhttpd/web/Y_Settings_buttons.yhtm | 38 +- src/nhttpd/web/Y_Settings_lcd.yhtm | 18 +- src/nhttpd/web/Y_Settings_mount.yhtm | 20 +- src/nhttpd/web/Y_Settings_nhttpd.yhtm | 26 +- src/nhttpd/web/Y_Settings_personalize.yhtm | 78 ++-- src/nhttpd/web/Y_Settings_video_audio.yhtm | 24 +- src/nhttpd/web/Y_Settings_wol.yhtm | 12 +- src/nhttpd/web/Y_Settings_yWeb.yhtm | 26 +- src/nhttpd/web/Y_Settings_zapit.yhtm | 8 +- src/nhttpd/web/Y_Tools_Check_Install.yhtm | 14 +- src/nhttpd/web/Y_Tools_Menue.yhtm | 2 +- src/nhttpd/web/Y_Tools_Timer_Sync.yhtm | 8 +- src/nhttpd/web/Y_neutrino_Blocks.txt | 400 +++++++++--------- src/nhttpd/web/extentions/boxinfo/install.sh | 2 +- .../web/extentions/boxinfo/uninstall.sh | 2 +- src/nhttpd/web/extentions/hddtools/install.sh | 2 +- .../web/extentions/hddtools/uninstall.sh | 2 +- src/nhttpd/web/scripts/Y_NAS.sh | 2 +- src/nhttpd/web/scripts/Y_Tools.sh | 2 +- src/nhttpd/web/scripts/_Y_Globals.sh | 10 +- src/nhttpd/web/scripts/api.sh | 2 +- 38 files changed, 515 insertions(+), 517 deletions(-) diff --git a/src/nhttpd/web/Y_About.yhtm b/src/nhttpd/web/Y_About.yhtm index ad022b42c..f782c3ce6 100644 --- a/src/nhttpd/web/Y_About.yhtm +++ b/src/nhttpd/web/Y_About.yhtm @@ -1,7 +1,7 @@ {=var-set:cancache=yPConf=} {=include-block:Y_Blocks.txt;head=} -{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:alt_httpd={=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} {=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=}
    diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index a6fbc1c78..3c9f2dea5 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -20,166 +20,166 @@ end-block~build_live_url # ------- yWeb save Settings start-block~yWeb_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip;{=managementIP=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip2;{=managementIP2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_1;{=wol_mac_1=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_2;{=wol_mac_2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_3;{=wol_mac_3=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_1;{=wol_desc_1=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_2;{=wol_desc_2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_3;{=wol_desc_3=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;fb;{=fb=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;start_page;{=start_page=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;style;{=style=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_name;{=yweb_box_name=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~save=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;management_ip;{=managementIP=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;management_ip2;{=managementIP2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_1;{=wol_mac_1=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_2;{=wol_mac_2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_3;{=wol_mac_3=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_1;{=wol_desc_1=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_2;{=wol_desc_2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_3;{=wol_desc_3=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;fb;{=fb=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;start_page;{=start_page=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;style;{=style=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;yweb_box_name;{=yweb_box_name=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~save=} end-block~yWeb_save_settings # ------- Live save Settings start-block~Live_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;slavebox;{=slavebox=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace;{=deinterlace=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace_filter;{=v=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;udp;{=udp=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;http_caching;{=http_caching=}~save=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;slavebox;{=slavebox=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;deinterlace;{=deinterlace=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;deinterlace_filter;{=v=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;udp;{=udp=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;http_caching;{=http_caching=}~save=} end-block~Live_save_settings # ------- nhttpd save Settings start-block~nhttpd_save_settings -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.username;{=authuser=}~open=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.password;{=authpassword=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client;{=noauthclient=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;{=authenticate=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;webserver.threading;{=threading=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;server.no_keep-alive_ips;{=no_keep_alive_ips=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.hosted_directory;{=hosted_directory=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;{=override_directory=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.username;{=authuser=}~open=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.password;{=authpassword=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.no_auth_client;{=noauthclient=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.authenticate;{=authenticate=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;webserver.threading;{=threading=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;server.no_keep-alive_ips;{=no_keep_alive_ips=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.hosted_directory;{=hosted_directory=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;{=override_directory=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Language.selected;{=language=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=} {=func:do_reload_httpd_config=} end-block~nhttpd_save_settings # ------- Video / Audio save Settings start-block~video_audio_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;video_Format;{=video_Format=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;video_backgroundFormat;{=video_backgroundFormat=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;video_csync;{=h_video_csync=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;{=vcr_AutoSwitch=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;{=audio_AnalogMode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;{=audiochannel_up_down_enable=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;{=audio_left_right_selectable=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_avs_Control;{=h_audio_avs_Control=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;{=audio_DolbyDigital=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_step;{=audio_step=}~save=} -{=ini-set:/var/tuxbox/config/controld.conf;vcroutput;{=h_vcroutput=}~open=} -{=ini-set:/var/tuxbox/config/controld.conf;videooutput;{=h_videooutput=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_Format;{=video_Format=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_backgroundFormat;{=video_backgroundFormat=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_csync;{=h_video_csync=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;vcr_AutoSwitch;{=vcr_AutoSwitch=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_AnalogMode;{=audio_AnalogMode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audiochannel_up_down_enable;{=audiochannel_up_down_enable=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_left_right_selectable;{=audio_left_right_selectable=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_avs_Control;{=h_audio_avs_Control=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_DolbyDigital;{=audio_DolbyDigital=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_step;{=audio_step=}~save=} +{=ini-set:%(CONFIGDIR)/controld.conf;vcroutput;{=h_vcroutput=}~open=} +{=ini-set:%(CONFIGDIR)/controld.conf;videooutput;{=h_videooutput=}~save=} end-block~video_audio_save_settings # ------- LCD save Settings start-block~lcd_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_power;{=lcd_power=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_inverse;{=lcd_inverse=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_time;{=lcd_dim_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;{=lcd_dim_brightness=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_epgmode;{=lcd_epgmode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_show_volume;{=lcd_show_volume=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_contrast;{=lcd_contrast=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_brightness;{=lcd_brightness=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;{=lcd_standbybrightness=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_power;{=lcd_power=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_inverse;{=lcd_inverse=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_dim_time;{=lcd_dim_time=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_dim_brightness;{=lcd_dim_brightness=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_epgmode;{=lcd_epgmode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_show_volume;{=lcd_show_volume=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_contrast;{=lcd_contrast=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_brightness;{=lcd_brightness=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_standbybrightness;{=lcd_standbybrightness=}~save=} end-block~lcd_save_settings # ------- Buttons save Settings start-block~buttons_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;{=bouquetlist_mode=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_down;{=key_bouquet_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_up;{=key_bouquet_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;{=key_channelList_addrecord=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;{=key_channelList_addremind=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;{=key_channelList_cancel=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;{=key_channelList_pagedown=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;{=key_channelList_pageup=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_reload;{=key_channelList_reload=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_search;{=key_channelList_search=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_sort;{=key_channelList_sort=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_lastchannel;{=key_lastchannel=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_down;{=key_quickzap_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_up;{=key_quickzap_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_down;{=key_subchannel_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;{=key_subchannel_toggle=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_up;{=key_subchannel_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;{=key_tvradio_mode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_zaphistory;{=key_zaphistory=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;bouquetlist_mode;{=bouquetlist_mode=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_bouquet_down;{=key_bouquet_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_bouquet_up;{=key_bouquet_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_addrecord;{=key_channelList_addrecord=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_addremind;{=key_channelList_addremind=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_cancel;{=key_channelList_cancel=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_pagedown;{=key_channelList_pagedown=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_pageup;{=key_channelList_pageup=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_reload;{=key_channelList_reload=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_search;{=key_channelList_search=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_sort;{=key_channelList_sort=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_lastchannel;{=key_lastchannel=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_quickzap_down;{=key_quickzap_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_quickzap_up;{=key_quickzap_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_down;{=key_subchannel_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_toggle;{=key_subchannel_toggle=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_up;{=key_subchannel_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_tvradio_mode;{=key_tvradio_mode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_zaphistory;{=key_zaphistory=}~save=} end-block~buttons_save_settings # ------- Personalize save Settings start-block~personalize_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_tvmode;{=p_tv=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_radiomode;{=p_radio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scartmode;{=p_scart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_games;{=p_games=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;{=p_upnp=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;{=p_sleeptimer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reboot;{=p_reboot=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_shutdown;{=p_shutdown=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_settings;{=p_settings=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_video;{=p_video=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audio;{=p_audio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_youth;{=p_youth=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_network;{=p_network=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_recording;{=p_recording=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_language;{=p_language=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_colors;{=p_colors=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_lcd;{=p_lcd=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_keybinding;{=p_keybinding=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;{=p_mediaplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_driver;{=p_driver=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_misc;{=p_misc=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_service;{=p_service=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;{=p_bouqueteditor=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scants;{=p_scants=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reload;{=p_reload=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_getplugins;{=p_getplugins=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_restart;{=p_restart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;{=p_epgrestart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;{=p_chan_epg_stat=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;{=p_imageinfo=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_update;{=p_update=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;{=p_bluebutton=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_redbutton;{=p_redbutton=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_tvmode;{=p_tv=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_radiomode;{=p_radio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_scartmode;{=p_scart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_games;{=p_games=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_upnpbrowser;{=p_upnp=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_sleeptimer;{=p_sleeptimer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_reboot;{=p_reboot=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_shutdown;{=p_shutdown=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_settings;{=p_settings=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_video;{=p_video=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_audio;{=p_audio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_youth;{=p_youth=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_network;{=p_network=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_recording;{=p_recording=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_language;{=p_language=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_colors;{=p_colors=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_lcd;{=p_lcd=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_keybinding;{=p_keybinding=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_mediaplayer;{=p_mediaplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_driver;{=p_driver=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_misc;{=p_misc=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_service;{=p_service=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_bouqueteditor;{=p_bouqueteditor=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_scants;{=p_scants=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_reload;{=p_reload=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_getplugins;{=p_getplugins=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_restart;{=p_restart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_epgrestart;{=p_epgrestart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_chan_epg_stat;{=p_chan_epg_stat=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_imageinfo;{=p_imageinfo=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_update;{=p_update=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_bluebutton;{=p_bluebutton=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_redbutton;{=p_redbutton=}~save=} end-block~personalize_save_settings # ------- VNC save Settings start-block~vnc_save_settings -{=ini-set:/var/tuxbox/config/vnc.conf;server;{=server=}~open=} -{=ini-set:/var/tuxbox/config/vnc.conf;port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/vnc.conf;passwd;{=password=}~cache=} -{=ini-set:/var/tuxbox/config/vnc.conf;scale;{=scale=}~save=} +{=ini-set:%(CONFIGDIR)/vnc.conf;server;{=server=}~open=} +{=ini-set:%(CONFIGDIR)/vnc.conf;port;{=port=}~cache=} +{=ini-set:%(CONFIGDIR)/vnc.conf;passwd;{=password=}~cache=} +{=ini-set:%(CONFIGDIR)/vnc.conf;scale;{=scale=}~save=} end-block~vnc_save_settings # ------- Timer save Settings start-block~timer_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_username;{=tvinfo_username=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_password;{=tvinfo_password=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;klack_url;{=klack_url=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;klack_securitycode;{=klack_securitycode=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_w;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_w;384=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_h;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_h;288=}=} -{=file-action:/var/tuxbox/config/channels.txt;add;{=channels=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;tvinfo_username;{=tvinfo_username=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;tvinfo_password;{=tvinfo_password=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;klack_url;{=klack_url=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;klack_securitycode;{=klack_securitycode=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;live_resolution_w;{=ini-get:%(CONFIGDIR)/Y-Web.conf;live_resolution_w;384=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;live_resolution_h;{=ini-get:%(CONFIGDIR)/Y-Web.conf;live_resolution_h;288=}=} +{=file-action:%(CONFIGDIR)/channels.txt;add;{=channels=}=} end-block~timer_save_settings # ------- Ext save Settings start-block~ext_save_settings -{=file-action:/var/tuxbox/config/extentions.txt;add;{=extentions=}=} +{=file-action:%(CONFIGDIR)/extentions.txt;add;{=extentions=}=} end-block~ext_save_settings # ------- No Managemant Error @@ -198,7 +198,7 @@ end-block~no_management # ------- Managemant Check : insert at Top of Page start-block~management_check_top -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=if-empty:{=var-get:management=} ~ {=include-block:Y_Blocks.txt;no_management=} @@ -330,9 +330,9 @@ end-block~frame_iso_head # ------- nhttpd save Settings start-block~start_wizard_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;start_page;{=start_page=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;startup;true~save=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;start_page;{=start_page=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;startup;true~save=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Language.selected;{=language=}=} {=func:do_reload_httpd_config=} end-block~start_wizard_save_settings @@ -390,7 +390,7 @@ end-block~start_wizard_page # ------- Lay-Frame MAIN start-block~frame_main -{=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;startup=}~ +{=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;startup=}~ {=include-block:Y_Blocks.txt;start_wizard_page=} ~ {=include-block:Y_Blocks.txt;frame_head=} @@ -438,7 +438,7 @@ end-block~frame_secondary # ------- Lay-Frame Boxcontrol-Menu start-block~frame_boxcontrol {=var-set:sec_menu=Y_Boxcontrol_Menue.yhtm=} -{=var-set:startpage={=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets=}=} +{=var-set:startpage={=ini-get:%(CONFIGDIR)/Y-Web.conf;start_page;bouquets=}=} {=var-set:work= {=if-equal:{=var-get:startpage=}~bouquets~Y_Boxcontrol_Bouquets.yhtm ~ @@ -508,8 +508,8 @@ end-block~frame_live_epg # ------- Remote start-block~remote -{=var-set:nfbtype={=ini-get:/var/tuxbox/config/neutrino.conf;remote_control_hardware=}=} -{=var-set:yfbtype={=ini-get:/var/tuxbox/config/Y-Web.conf;fb;0=}=} +{=var-set:nfbtype={=ini-get:%(CONFIGDIR)/neutrino.conf;remote_control_hardware=}=} +{=var-set:yfbtype={=ini-get:%(CONFIGDIR)/Y-Web.conf;fb;0=}=} {=var-set:boxtype={=func:get_boxtype=}=} {=if-equal:{=var-get:yfbtype=}~0~ {=if-equal:{=var-get:nfbtype=}~2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~ diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 62038a3a8..e4e603b87 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -232,14 +232,14 @@ function get_data(){
    -{=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~~ +{=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;slavebox=}~~

    Switch to

    diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index a49808f9b..4a4eb7c2e 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -67,7 +67,7 @@ function epg_imdb(){
    diff --git a/src/nhttpd/web/Y_Ext_Menue.yhtm b/src/nhttpd/web/Y_Ext_Menue.yhtm index 678e4ea5c..4f48fefd2 100644 --- a/src/nhttpd/web/Y_Ext_Menue.yhtm +++ b/src/nhttpd/web/Y_Ext_Menue.yhtm @@ -1,5 +1,5 @@ -{=var-set:extension={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd/extentions.txt=}=}=} -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:extension={=if-file-exists:%(CONFIGDIR)/extentions.txt~%(CONFIGDIR)/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd/extentions.txt=}=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head=} diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index ae3d6a290..c013bb0a6 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -23,7 +23,7 @@ function do_submit(){
    \n\n"; if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) { diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index b392f10e3..085b8d1c2 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -860,6 +860,10 @@ a:hover.clistsmall font-size:10pt; padding-left: 10px; } +.cslider_cell +{ + width: 35px; +} .cslider { height: 10px; @@ -884,6 +888,10 @@ a:hover.clistsmall { background-color: #FAFAFF; } +.title_table +{ + width: 100%; +} /*EPG*/ .epg { diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index f50d6df12..c933d7fa9 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.33 -date=03.03.2016 +version=2.9.0.34 +date=14.03.2016 type=Release info=Port CST From 7ae7016f2c74b3ae158fd491408a334ef1bab68e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Mar 2016 13:12:58 +0100 Subject: [PATCH 275/690] yWeb: smoother icons in channellist; thx to fred_feuerstein Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e72021e2689b468b980726faf2fe5ed3acfeb6fb Author: vanhofen Date: 2016-03-14 (Mon, 14 Mar 2016) Origin message was: ------------------ - yWeb: smoother icons in channellist; thx to fred_feuerstein --- src/nhttpd/web/images/elist.png | Bin 240 -> 495 bytes src/nhttpd/web/images/streaminfo.png | Bin 513 -> 778 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/nhttpd/web/images/elist.png b/src/nhttpd/web/images/elist.png index 253521aa538ce51a1724ede22d3244a56f4e1fcd..bd307726b050a16028c84e383277ca083ecaedf2 100644 GIT binary patch literal 495 zcmV8Cqbl;!=lDQJM4ebF12=ND~L@fh5 z3=o{VqZ=yHp@gld2xJ98UeVyQpu)SPKsHx|%xeLjvl2XI^7MRDc*_Lfff12`aThgY zi$CO&EhcK{+hhPTZ4N+&0UEZd>ohK?3?wOR%}E-(0a;@XvQ|*n zv&I0v$xB-W+}2n{$Oa~I39Ag?89)057|a&(E|Vg002ovPDHLkV1lzs$E*MV literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^!a&T!!3HE7F0?fPDeV&1h!W?b)Wnj^{5*w_%-mE4 z-%JG~Qw6uwBn2Y_LsJDq6DuPFD^o)SZ39CC1G)1~UxC`#OFVsD+3zz+@`_2+JAV8N z6yhxKh%9DckWm0(#BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@ zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@ zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*WdKcSATl)|MrC3kGB7bUATcyLG%`9fG9W83F)%O%2uqOw000McNliru z-vSv8Gb<=!Knwr?010qNS#tmY9>D+r9>D>_X;f1H000DMK}|sb0I`n?{9y$E00CJ^ zL_t(|+MSX;OT%y&#G`|YpbjdCi;IF*>IV>f>EI%`Iq0HaK+rlkIoLL&r8Vi$7b-Rc zX+ztDq$!3DrD?y}={?edIMu*~%khb6pSyous zinKLNGInIha-+M*ZN7)e7!&x{=zvfRkW>4$wZ?i%t=d_?=v zM*1=>qG!gA4B6>d9YrJb{2tu83-j7Ub|VXQSrySUV@HPUbT~PmpdFx+sGxRULr@At z^p(?!9L1k=oCHx6A^Z$62nVokEfGC4cE5-J{N=s?By*arH_B*Y00000NkvXXu0mjf DoF3FW From 09a15e59724f9b82278362064451ad0c06a45837 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Mar 2016 13:14:41 +0100 Subject: [PATCH 276/690] yWeb: add stream icon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc7ed73e9705039f0878d361a2de60d36897a584 Author: vanhofen Date: 2016-03-14 (Mon, 14 Mar 2016) Origin message was: ------------------ - yWeb: add stream icon --- src/nhttpd/web/images/Makefile.am | 1 + src/nhttpd/web/images/stream.png | Bin 0 -> 830 bytes 2 files changed, 1 insertion(+) create mode 100644 src/nhttpd/web/images/stream.png diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am index 8d8e32a4a..b5b1af3aa 100644 --- a/src/nhttpd/web/images/Makefile.am +++ b/src/nhttpd/web/images/Makefile.am @@ -64,6 +64,7 @@ install_DATA = accept.png \ smallwait.gif \ snapshot.png \ stop.png \ + stream.png \ streaminfo.png \ time_add.png \ time_down.png \ diff --git a/src/nhttpd/web/images/stream.png b/src/nhttpd/web/images/stream.png new file mode 100644 index 0000000000000000000000000000000000000000..0f24e86e4028717876f6650558d2451ec644bd4e GIT binary patch literal 830 zcmV-E1Ht@>P)eQoKk~sHiA| zy6GknK~N$Di6V+pM#z)~t~qt4t~PV$oSpR?5enUb-^F>~=l_46=Y8InX>V^2D~jSG z7J7SoD^TDI27})uNve=#`TNk&(C+{DG$i!oa=918m8Pbqd?5o8t8^15H}7dk$P;JC zU9z=w%S9{?QO-kDfL7aml<9%y8}BtFt|h8A8?YptARZEtkJ`sVMo0;4u~o7C+z3$g3Wm`ywrg46(2578e}zzE>{|?IQQR=7K4GtbjwyzWa%4Ap;|E+HSYk4Bw0wm;p;Ih?Q!L8e7QV7cmfxMrH4vfqeo^LCOIl4YbAj2s`x* z4h23>Qk8=g7u;e%?mF5iC%6yUPV7M=bW?HImnZPWX2zR^X&8-0eL9`4s;{rF?Ca~x zClZO}cs$-24u>CbZnwKb6%)MSXsR^vb_9pDMqIpb4o;^N2Gb7EJux^O4p%4?5d32QMl4!Ru*;t~bnPGpGe5lS$Bf`J>Tj&QeIm zWHRxp0coWtI-TxW?A;nT_m6dhvD>SRA~ERd>Ox6L$@*F*lL5=JJXO=L{! Date: Mon, 14 Mar 2016 15:29:34 +0100 Subject: [PATCH 277/690] yWeb: add link to get stream to channellist; thx to dasda Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5f613b0b30c0bdd42921aa845805e00da4a5bda9 Author: vanhofen Date: 2016-03-14 (Mon, 14 Mar 2016) Origin message was: ------------------ - yWeb: add link to get stream to channellist; thx to dasda --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 7 ++++++ src/nhttpd/web/Y_Baselib.js | 24 ++++++++++++++++++++ src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm | 9 ++++++++ src/nhttpd/web/Y_Version.txt | 2 +- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 60dbac08a..b50ab79d1 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -460,6 +460,13 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: ); } + yresult += string_printf("" + "\"Stream\"" + "\n" + , channel->getChannelID() + , channel->getName().c_str() + ); + yresult += "
    \n" + yresult += string_printf("\n\n"); + yresult += string_printf("" + "%d. %s%s" + "\n" + , channel->getChannelID() + , channel->number + , channel->getName().c_str() + , (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "" + ); + + yresult += "\n"; + + /* buttons */ + yresult += "
    \n" "\t" "" "" @@ -424,27 +423,44 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: ); } - /* channel name and buttons */ - yresult += string_printf("
    \n%s %d. %s%s %s\n", - ((channel->getChannelID() == current_channel) ? "" : " "), - channel->getChannelID(), - channel->number /* num + j */, - channel->getName().c_str(), - (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", - channel->getChannelID(), - channel->getChannelID() & 0xFFFFFFFFFFFFULL, - (event.eventID ? "\"Program" : "")); + /* channel name */ + yresult += "\n"; if (channel->getChannelID() == current_channel) - yresult += string_printf("\n  \"Streaminfo\""); + yresult += "\n"; - yresult += string_printf("
    \n
    \n"; + + if (channel->getChannelID() == current_channel) + { + yresult += ""; + yresult += "\"Streaminfo\""; + yresult += "\n"; + } + + if (event.eventID) + { + yresult += string_printf("" + "\"Program" + "\n" + , channel->getChannelID() + , channel->getChannelID() & 0xFFFFFFFFFFFFULL + ); + } + + yresult += "
    \n
    \n
    Senderlogos auflisten http://box_ip/control/logolist
    Neutrino-Ordner auflisten + http://box_ip/control/getdir
       
    - +
     

    diff --git a/src/nhttpd/web/Y_Ext_Update.js b/src/nhttpd/web/Y_Ext_Update.js index 0a212f0e3..7f4c6edf4 100644 --- a/src/nhttpd/web/Y_Ext_Update.js +++ b/src/nhttpd/web/Y_Ext_Update.js @@ -236,7 +236,7 @@ function uninstall_build_list2(){ /*build_list*/ i=0; ext.installed_extensions.sortBy(function(e){return e.get('tag');}).each(function(e){ - res=loadSyncURL("/y/cgi?execute=if-file-exists:/var/tuxbox/config/ext/"+e.get('tag')+"_uninstall.inc~1~0"); + res=loadSyncURL("/y/cgi?execute=if-file-exists:%(CONFIGDIR)/ext/"+e.get('tag')+"_uninstall.inc~1~0"); uninstall_list_addRow(update_body,++i,e,res=="1"); }); $('statusline').hide(); diff --git a/src/nhttpd/web/Y_Info_Menue.yhtm b/src/nhttpd/web/Y_Info_Menue.yhtm index 3ea5dab60..7a104ca8c 100644 --- a/src/nhttpd/web/Y_Info_Menue.yhtm +++ b/src/nhttpd/web/Y_Info_Menue.yhtm @@ -9,7 +9,7 @@ function init(){ } -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:main.info=}

    diff --git a/src/nhttpd/web/Y_Live.yhtm b/src/nhttpd/web/Y_Live.yhtm index c258faf7b..bd06b4e13 100644 --- a/src/nhttpd/web/Y_Live.yhtm +++ b/src/nhttpd/web/Y_Live.yhtm @@ -1,4 +1,4 @@ -{=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head_no_charset=} @@ -151,13 +151,13 @@ function view_transcode_mode(){ -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:live.heading=}

    diff --git a/src/nhttpd/web/Y_Live_Record.yhtm b/src/nhttpd/web/Y_Live_Record.yhtm index bbc3d837d..ee437b68b 100644 --- a/src/nhttpd/web/Y_Live_Record.yhtm +++ b/src/nhttpd/web/Y_Live_Record.yhtm @@ -156,7 +156,7 @@ function doRecord()
    {=L:live.rec.record_mode=}
    {=L:live.rec.filename=}:
    diff --git a/src/nhttpd/web/Y_Menue.yhtm b/src/nhttpd/web/Y_Menue.yhtm index fe461bf6b..55b7479b7 100644 --- a/src/nhttpd/web/Y_Menue.yhtm +++ b/src/nhttpd/web/Y_Menue.yhtm @@ -80,7 +80,7 @@ function vlc() { } -{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:alt_httpd={=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} {=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=}
    @@ -119,8 +119,8 @@ function vlc() {
      - - {=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=} + + {=ini-get:%(CONFIGDIR)/Y-Web.conf;yweb_box_name=} 00:00
    {=L:live.set.http_caching=}
    {=L:live.set.udp_defaul=}
    {=L:live.set.slavebox_ip=}
    {=L:live.set.vlc_rec_dir=}
    @@ -57,12 +57,12 @@ function do_refresh_liveview() // -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:main.settings=}

    diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index 772812db3..942534ede 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -25,11 +25,11 @@ function do_submit() {
    {=L:set.timer.username=}
    {=L:set.timer.password=}
     

    diff --git a/src/nhttpd/web/Y_Settings_VNC.yhtm b/src/nhttpd/web/Y_Settings_VNC.yhtm index e99eaa92b..dc0d394d2 100644 --- a/src/nhttpd/web/Y_Settings_VNC.yhtm +++ b/src/nhttpd/web/Y_Settings_VNC.yhtm @@ -4,7 +4,7 @@ //
    Server
    Port
    Passwort
    Skalierung
    IP
    Verzeichnis
    Lokales Verzeichnis
    MAC
    Optionen 1
    Optionen 2
    Automount
    Benutzername
    Passwort

    diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index f78f667b6..ffb48b292 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -5,10 +5,10 @@ //
    {=L:set.nhttpd.authentication=}
    {=L:user=}
    {=L:password=}
    {=L:set.nhttpd.client_without_authentication=}
    {=L:set.nhttpd.authentication=}
    {=L:set.nhttpd.port=} {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.alternate_web_folder=} -  {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.hosted_folder=} -  {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.allowed_file_extensions=}
    {=L:set.nhttpd.allow_all_file_extensions=}
    {=L:set.nhttpd.url_of_logos=}
    {=L:set.nhttpd.server=}
    {=L:set.nhttpd.ips_without_keep_alive=}
    {=L:set.nhttpd.ips_without_keep_alive_desc=}
    +
    PIN Code  
    Farbtasten
    Taste Blau (Features)
    {=L:set.yweb.management_IPs=}
    IP 1
    IP 2
    {=L:set.yweb.wake_on_lan=}
    MAC 1 {=L:set.yweb.description=}
    MAC 2 {=L:set.yweb.description=}
    MAC 3 {=L:set.yweb.description=}
    {=L:set.yweb.box_tag=}
    {=L:set.yweb.box_tag=}
    {=L:set.yweb.box_color=}
    {=L:others=}
    - bouquets.xml
    - services.xml
    - ubouquets.xml
    - myservices.xml
    + bouquets.xml
    + services.xml
    + ubouquets.xml
    + myservices.xml
    diff --git a/src/nhttpd/web/Y_Tools_Check_Install.yhtm b/src/nhttpd/web/Y_Tools_Check_Install.yhtm index e5dc275e6..b99f2749a 100644 --- a/src/nhttpd/web/Y_Tools_Check_Install.yhtm +++ b/src/nhttpd/web/Y_Tools_Check_Install.yhtm @@ -57,22 +57,22 @@ function do_check(){ else sLog_addRow(sLog_body, "green", "WebServer: version is "+nhttpd_version, "ok"); - {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}~false~~ + {=if-equal:{=ini-get:%(CONFIGDIR)/nhttpd.conf;mod_auth.authenticate;false=}~false~~ sLog_addRow(sLog_body, "yellow", "WebServer: Authentication is on. ", "notice"); =} - {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=}~80~~ + {=if-equal:{=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;80=}~80~~ sLog_addRow(sLog_body, "yellow", - "WebServer: not set to Standard-Port. Actual: {=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=} "+wiki_url("Neutrino:yWeb#Webserver"), "notice"); + "WebServer: not set to Standard-Port. Actual: {=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;80=} "+wiki_url("Neutrino:yWeb#Webserver"), "notice"); =} /*settings*/ - {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~~ + {=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=}~~ sLog_addRow(sLog_body, "yellow", - "Settings: Management IP(1) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=} ! Your IP is {=func:get_request_data client_addr=}. " + "Settings: Management IP(1) is set to {=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=} ! Your IP is {=func:get_request_data client_addr=}. " +wiki_url("Help-Settings-yWeb"), "notice"); =} - {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~~ + {=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~~ sLog_addRow(sLog_body, "yellow", - "Settings: Management IP(2) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=} ! Your IP is {=func:get_request_data client_addr=}. " + "Settings: Management IP(2) is set to {=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=} ! Your IP is {=func:get_request_data client_addr=}. " +wiki_url("Neutrino:yWeb#yWeb"), "notice"); =} diff --git a/src/nhttpd/web/Y_Tools_Menue.yhtm b/src/nhttpd/web/Y_Tools_Menue.yhtm index 006aa241e..3fcdf0c3a 100644 --- a/src/nhttpd/web/Y_Tools_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Menue.yhtm @@ -13,7 +13,7 @@ function init(){ } -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=var-set:automount={=find-exec:automount=}=} {=var-set:ether-wake={=find-exec:ether-wake=}=} diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm index 5b75bedd3..bee1ec1b4 100644 --- a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm @@ -14,8 +14,8 @@
    - TVInfo
    -   + TVInfo
    +