From 9481b6cdc567fd01fb4594b089cd804a5fb32a94 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Aug 2017 19:11:27 +0200 Subject: [PATCH 01/26] CComponentsScrollBar: fix possible too small type size Possible segment count could be more than 265. Was a remnant from scrollbar test phase. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/379d1ffa7667e0003a80bebf16e23f461d43f200 Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 2e59a630f..769733cf1 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -178,7 +178,7 @@ void CComponentsScrollBar::initSegments() fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(u_int8_t i=0; i Date: Wed, 9 Aug 2017 20:28:08 +0200 Subject: [PATCH 02/26] CComponentsScrollBar: fix possible build error with -Werror=sign-compare Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/431cfadcc237c909ce663403da4bdb45168303ca Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) --- src/gui/components/cc_frm_scrollbar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 8bd1c0568..75746371f 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -49,7 +49,7 @@ class CComponentsScrollBar : public CComponentsFrmChain fb_pixel_t sb_segment_col, sb_segment_col_sel; ///count of segments - int sb_segments_count; + u_int32_t sb_segments_count; ///mark id int sb_mark_id; From f23adc700740d4a9b87173a63620f0b2c5bc8186 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Aug 2017 21:34:20 +0200 Subject: [PATCH 03/26] CComponentsScrollBar: use matching type names Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b863f874b0cde8eb24bffc4bc8826e3c72d2f7d6 Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- src/gui/components/cc_frm_scrollbar.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 769733cf1..44c820311 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -178,7 +178,7 @@ void CComponentsScrollBar::initSegments() fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(u_int32_t i=0; i Date: Fri, 11 Aug 2017 19:29:10 +0200 Subject: [PATCH 04/26] infoviewer.cpp: handle timeout of mode upnp like mode ts Signed-off-by: Thilo Graf Infobar timeout in the upnp mode is fixed to 6 sec. Because it's acting about streams, so we should use the same timeout such as with playing a movie file. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0225b043db882011b6ce258bb3da648d32a45f4d Author: GetAway Date: 2017-08-11 (Fri, 11 Aug 2017) --- src/gui/infoviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 693f543c4..1629d4451 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -932,6 +932,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] + timeout_ext); break; case NeutrinoMessages::mode_ts: + case NeutrinoMessages::mode_upnp: timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] + timeout_ext); break; default: From 630c1bb8804ec3bc4ba8ef576ca097ea7678dc9c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 11 Aug 2017 18:36:15 +0200 Subject: [PATCH 05/26] CComponentsScrollBar: try to fix handling with very much segment count In some cases, eg. with very much pages in channellist, the effort to handle with all count of scrollbar segments was too much. Result: long waiting times during page scrolling and slider was not visible. This should be fixed now. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/71f5779a40ce9ee9165bb31094344b1b19bf279e Author: Thilo Graf Date: 2017-08-11 (Fri, 11 Aug 2017) --- src/gui/components/cc_frm_scrollbar.cpp | 41 +++++++++++++++---------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 44c820311..13006e722 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -147,14 +147,10 @@ void CComponentsScrollBar::initBottomNaviIcon() void CComponentsScrollBar::initSegments() { //init dimensions for segments - int w_seg = width - 2*fr_thickness - 2*append_x_offset; - if (w_seg < 0) - w_seg = 0; + int w_seg = max(0, width - 2*fr_thickness - 2*append_x_offset); //calculate height of segment container - int h_seg_obj = height - 2*fr_thickness - 2*sb_up_obj->getHeight() - 2*append_y_offset; - if (h_seg_obj < 0) - h_seg_obj = 0; + int h_seg_obj = max(0, height - 2*fr_thickness - 2*sb_up_obj->getHeight() - 2*append_y_offset); //init segment container if (sb_segments_obj == NULL){ @@ -169,30 +165,41 @@ void CComponentsScrollBar::initSegments() //clean up segment container before add new segments sb_segments_obj->clear(); + //hold segment count in this scope + uint32_t tmp_segments = sb_segments_count; + //set y position of 1st segment and set height of segments int y_seg = append_y_offset; - int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; - if (h_seg < 0) - h_seg = 0; + int h_seg = max(0, int(sb_segments_obj->getHeight()/tmp_segments - append_y_offset)); + + //reduce required segment count and create a moderate segment height for better visibility of slider if we have very much segments. + uint32_t tmp_quot = 1; + if (h_seg == 0){ + h_seg = w_seg - append_y_offset; + tmp_segments = max(1, sb_segments_obj->getHeight() / (h_seg+append_y_offset)); + tmp_quot = uint32_t((float)sb_segments_count/(float)tmp_segments + 0.5); + } fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(uint32_t i=0; igetCCItemId(item); //set color for marked id - if (sb_mark_id == id){ + if ((tmp_segments == sb_segments_count && sb_mark_id == id) || (tmp_segments != sb_segments_count && int(sb_mark_id/tmp_quot) == id)) + { item->setColorBody(sb_segment_col_sel); #if 0 item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B); item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal); #endif } - else{ + else + { item->setColorBody(passive_col); #if 0 item->disableColBodyGradient(); @@ -203,19 +210,19 @@ void CComponentsScrollBar::initSegments() if (passive_col == col_body){ item->setCorner(RADIUS_MIN, CORNER_ALL); continue; - }else if (sb_segments_count == 1){ + }else if (tmp_segments == 1){ item->setCorner(RADIUS_MIN, CORNER_ALL); break; }else if(i == 0){ item->setCorner(RADIUS_MIN, CORNER_TOP); continue; - }else if(i == sb_segments_count - 1){ + }else if(i == tmp_segments - 1){ item->setCorner(RADIUS_MIN, CORNER_BOTTOM); break; - }else if((i > 0 && i < sb_segments_count - 1)){ - item->setCorner(RADIUS_MIN, CORNER_NONE); + }else if((i > 0 && i < tmp_segments - 1)){ + item->setCorner(RADIUS_NONE, CORNER_NONE); }else{ - item->setCorner(RADIUS_MIN, CORNER_NONE); + item->setCorner(RADIUS_NONE, CORNER_NONE); } } } From 79068935526e07e15cbb7b153608e0d8fe0b7e01 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 09:28:17 +0200 Subject: [PATCH 06/26] netfs_setup: write correct filenames into fstab and auto.net Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/19189cc09d6b0c9bafbf9b21aeb6c38fd50ed636 Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) Origin message was: ------------------ - netfs_setup: write correct filenames into fstab and auto.net --- src/gui/netfs_setup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/netfs_setup.cpp b/src/gui/netfs_setup.cpp index 37ef77e8c..830e7c410 100644 --- a/src/gui/netfs_setup.cpp +++ b/src/gui/netfs_setup.cpp @@ -264,7 +264,7 @@ int CNETFSMountGui::write_config(int mt) { if(mt == SNeutrinoSettings::FSTAB) { - config_file << "# /etc/fstab: static file system information (generated from NetFS setup).\n" + config_file << "# " << fstabPath << ": static file system information (generated from NetFS setup).\n" << "#\n" << "# \n"; @@ -306,7 +306,7 @@ int CNETFSMountGui::write_config(int mt) } else { - config_file << "# /etc/auto.net: dynamic file system information (generated from NetFS setup).\n" + config_file << "# " << autoPath << ": dynamic file system information (generated from NetFS setup).\n" << "#\n" << "# Every single mount point below will be available in /mnt/autofs during start\n" << "# or possibly even later if you request it.\n" From bb3910fc955a8827002076740fd1054688073a78 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 12 Aug 2017 11:27:55 +0200 Subject: [PATCH 07/26] Revert "infoviewer.cpp: handle timeout of mode upnp like mode ts" This reverts commit 673305f91378b22f4904636a0d58f8eac68b0dca. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/40fee475236ceb16be3ba055eccab4aee85b902d Author: Thilo Graf Date: 2017-08-12 (Sat, 12 Aug 2017) --- src/gui/infoviewer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 1629d4451..693f543c4 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -932,7 +932,6 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] + timeout_ext); break; case NeutrinoMessages::mode_ts: - case NeutrinoMessages::mode_upnp: timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] + timeout_ext); break; default: From 4d0a512b6ee5873f9a494ecb0ac53f5186df9f3f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:47:33 +0200 Subject: [PATCH 08/26] Revert "neutrino: disable some menus in upnp & ts mode" This reverts commit 552e7c87779ec02fdbda455dde55a536c152ebda. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e04d34a9c4dea891879a2d787e839c299e2e7e3 Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) --- src/gui/user_menue.cpp | 13 ++++++------- src/gui/widget/menue.cpp | 8 +------- src/gui/widget/menue.h | 3 --- src/neutrino_menue.cpp | 18 +++--------------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 2e3b71ab4..7496cd9ed 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -193,7 +193,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu->addItem(GenericMenuSeparator); bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; - bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp; bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); @@ -259,7 +258,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIO_SELECT: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon); + menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -295,7 +294,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (g_settings.recording_type == RECORDING_OFF) break; keyhelper.get(&key,&icon,CRCInput::RC_green); - menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); break; } @@ -441,14 +440,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_YOUTUBE: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); break; } case SNeutrinoSettings::ITEM_FILEPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY); break; } @@ -484,14 +483,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIOPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); break; } case SNeutrinoSettings::ITEM_INETPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); break; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index af464e210..90cfeb631 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -137,13 +137,7 @@ bool CMenuItem::initModeCondition(const int& stb_mode) void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition) { int stb_mode = CNeutrinoApp::getInstance()->getMode(); -#if ENABLE_UPNP - if (condition & DCOND_MODE_UPNP){ - if (stb_mode == CNeutrinoApp::mode_upnp) - if (initModeCondition(stb_mode)) - return; - } -#endif + if (condition & DCOND_MODE_TS){ if (stb_mode == CNeutrinoApp::mode_ts) if (initModeCondition(stb_mode)) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 3f1d4d6fe..6c89f878e 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -78,9 +78,6 @@ enum DCOND_MODE_TV = 2, DCOND_MODE_RADIO = 4, DCOND_MODE_TS = 8 -#if ENABLE_UPNP - ,DCOND_MODE_UPNP = 16 -#endif }/*menu_item_disable_cond_t*/; class CChangeObserver diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index f56917831..a01fa8476 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -166,29 +166,17 @@ void CNeutrinoApp::InitMenuMain() //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); - personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed } //timer From 9e31b649c72f962f97ed5df76419bd38d1fa85f1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:48:17 +0200 Subject: [PATCH 09/26] upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e66f8802c4267c7b7be10ff4a582ffab90d5b91 Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) Origin message was: ------------------ - upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() --- 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 40866f171..1d207a401 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1317,10 +1317,10 @@ void CUpnpBrowserGui::showPicture(std::string name) void CUpnpBrowserGui::playVideo(std::string name, std::string url) { - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); - stopAudio(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); From 9a69091b0d1f39514d68ba35ae284a6eaf4e3a2b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 13:51:00 +0200 Subject: [PATCH 10/26] themes: add new shadow-color to our material themes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/88d34a3e0dba865a710336c3024823629e89fc8c Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) Origin message was: ------------------ - themes: add new shadow-color to our material themes --- data/themes/Material_Blue-Grey.theme | 5 +++++ data/themes/Material_Grey_(Dark).theme | 5 +++++ data/themes/Material_Grey_(Light).theme | 5 +++++ data/themes/Material_Grey_(Medium).theme | 5 +++++ src/gui/themes.cpp | 8 ++++---- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/data/themes/Material_Blue-Grey.theme b/data/themes/Material_Blue-Grey.theme index 4a46c32c1..c8854f610 100644 --- a/data/themes/Material_Blue-Grey.theme +++ b/data/themes/Material_Blue-Grey.theme @@ -131,3 +131,8 @@ progressbar_active_blue=77 progressbar_passive_red=38 progressbar_passive_green=49 progressbar_passive_blue=55 + +shadow_red=0 +shadow_green=0 +shadow_blue=0 +shadow_alpha=25 diff --git a/data/themes/Material_Grey_(Dark).theme b/data/themes/Material_Grey_(Dark).theme index d1f905421..5f0e7674e 100644 --- a/data/themes/Material_Grey_(Dark).theme +++ b/data/themes/Material_Grey_(Dark).theme @@ -131,3 +131,8 @@ progressbar_active_blue=62 progressbar_passive_red=26 progressbar_passive_green=26 progressbar_passive_blue=26 + +shadow_red=0 +shadow_green=0 +shadow_blue=0 +shadow_alpha=25 diff --git a/data/themes/Material_Grey_(Light).theme b/data/themes/Material_Grey_(Light).theme index 756695081..7e9897d0f 100644 --- a/data/themes/Material_Grey_(Light).theme +++ b/data/themes/Material_Grey_(Light).theme @@ -132,3 +132,8 @@ progressbar_active_blue=74 progressbar_passive_red=46 progressbar_passive_green=46 progressbar_passive_blue=46 + +shadow_red=0 +shadow_green=0 +shadow_blue=0 +shadow_alpha=25 diff --git a/data/themes/Material_Grey_(Medium).theme b/data/themes/Material_Grey_(Medium).theme index 441debf27..cdc2b29d3 100644 --- a/data/themes/Material_Grey_(Medium).theme +++ b/data/themes/Material_Grey_(Medium).theme @@ -131,3 +131,8 @@ progressbar_active_blue=62 progressbar_passive_red=38 progressbar_passive_green=38 progressbar_passive_blue=38 + +shadow_red=0 +shadow_green=0 +shadow_blue=0 +shadow_alpha=25 diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 8c93d3f65..58f8d2c7d 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -442,10 +442,10 @@ void CThemes::getTheme(CConfigFile &configfile) t.progressbar_timescale_yellow = configfile.getInt32("progressbar_timescale_yellow", 70); t.progressbar_timescale_invert = configfile.getInt32("progressbar_timescale_invert", 0); - t.shadow_alpha = configfile.getInt32( "shadow_alpha", 0 ); - t.shadow_red = configfile.getInt32( "shadow_red", 8 ); - t.shadow_green = configfile.getInt32( "shadow_green", 8); - t.shadow_blue = configfile.getInt32( "shadow_blue", 8 ); + t.shadow_alpha = configfile.getInt32( "shadow_alpha", 25 ); + t.shadow_red = configfile.getInt32( "shadow_red", 0 ); + t.shadow_green = configfile.getInt32( "shadow_green", 0 ); + t.shadow_blue = configfile.getInt32( "shadow_blue", 0 ); //NI t.progressbar_active_red = configfile.getInt32( "progressbar_active_red", 62 ); From d36efaeac5b613f58279a415d01e4d57426f3c72 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:47:33 +0200 Subject: [PATCH 11/26] Revert "neutrino: disable some menus in upnp & ts mode" This reverts commit 552e7c87779ec02fdbda455dde55a536c152ebda. Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/944ad7cb63bfdb8d3d4424a06d8e61596a184a3e Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) --- src/gui/user_menue.cpp | 13 ++++++------- src/gui/widget/menue.cpp | 8 +------- src/gui/widget/menue.h | 3 --- src/neutrino_menue.cpp | 18 +++--------------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 657956f86..a7d77530d 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -184,7 +184,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu->addItem(GenericMenuSeparator); bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; - bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp; bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); @@ -250,7 +249,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIO_SELECT: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon); + menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -286,7 +285,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (g_settings.recording_type == RECORDING_OFF) break; keyhelper.get(&key,&icon,CRCInput::RC_green); - menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); break; } @@ -408,14 +407,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_YOUTUBE: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); break; } case SNeutrinoSettings::ITEM_FILEPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY); break; } @@ -443,14 +442,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIOPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); break; } case SNeutrinoSettings::ITEM_INETPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); break; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d246b1936..6fe122746 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -131,13 +131,7 @@ bool CMenuItem::initModeCondition(const int& stb_mode) void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition) { int stb_mode = CNeutrinoApp::getInstance()->getMode(); -#if ENABLE_UPNP - if (condition & DCOND_MODE_UPNP){ - if (stb_mode == CNeutrinoApp::mode_upnp) - if (initModeCondition(stb_mode)) - return; - } -#endif + if (condition & DCOND_MODE_TS){ if (stb_mode == CNeutrinoApp::mode_ts) if (initModeCondition(stb_mode)) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 4aa5797ca..3b47f51de 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -78,9 +78,6 @@ enum DCOND_MODE_TV = 2, DCOND_MODE_RADIO = 4, DCOND_MODE_TS = 8 -#if ENABLE_UPNP - ,DCOND_MODE_UPNP = 16 -#endif }/*menu_item_disable_cond_t*/; class CChangeObserver diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 3b281fcae..fc673329b 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -164,29 +164,17 @@ void CNeutrinoApp::InitMenuMain() //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); - personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed } //timer From 5ce4d5eb257bcc64ed5148353b110027fec1a8be Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:48:17 +0200 Subject: [PATCH 12/26] upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6659dbb6f3152abcc9858088266bb7e67bff29da Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) Origin message was: ------------------ - upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() Signed-off-by: Thilo Graf --- 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 55c4ce3bc..1f4c67b17 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1311,10 +1311,10 @@ void CUpnpBrowserGui::showPicture(std::string name) void CUpnpBrowserGui::playVideo(std::string name, std::string url) { - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); - stopAudio(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); From c8aeed6eeb80a0c9517420c210f296086dcf1043 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Aug 2017 09:56:23 +0200 Subject: [PATCH 13/26] Revert "- neutrino: fix hw_caps init; it must be initialized after zapit start" This reverts commit 2d4130dab898a8b98bb68111d2481ab4950100c8 in preparation for following changes. Conflicts: src/neutrino.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/affcf191a929c0d91dde6ab312c3f3d1e735f553 Author: vanhofen Date: 2017-08-14 (Mon, 14 Aug 2017) --- src/neutrino.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bfb332717..ef218a9ce 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -500,22 +500,14 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_wakeup_msg = configfile.getInt32( "hdd_wakeup_msg", 1); //NI g_settings.hdd_allow_set_recdir = configfile.getInt32( "hdd_allow_set_recdir", 1); //NI - /* - hw_caps needs CFEManager and CFEManager needs g_settings. - So loadSetup() cannot use hw_caps to init g_settings. - - For this reason we need this workaround. - */ - bool can_shutdown = (cs_get_revision() > 7); - g_settings.shutdown_real = false; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 000); //NI g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2292,9 +2284,8 @@ TIMER_START(); cs_new_auto_videosystem(); #endif -#if !HAVE_COOL_HARDWARE g_info.hw_caps = get_hwcaps(); -#endif + g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2395,11 +2386,6 @@ TIMER_START(); CheckFastScan(); -#if HAVE_COOL_HARDWARE - // init hw_caps *after* zapit start! - g_info.hw_caps = get_hwcaps(); -#endif - //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From c2095e1759f02bdb0a60a1263c01a4cf23eefd5c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Aug 2017 10:56:45 +0200 Subject: [PATCH 14/26] hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/382181e289ac990fa1bc69ec528b8c25be6c6537 Author: vanhofen Date: 2017-08-14 (Mon, 14 Aug 2017) Origin message was: ------------------ - hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start --- lib/hardware/coolstream/Makefile.am | 7 ------- lib/hardware/coolstream/hardware_caps.cpp | 13 ++----------- src/neutrino.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index 82f3ab83c..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,13 +1,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/lib/libconfigfile \ - -I$(top_srcdir)/lib/libeventserver \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libhwcaps.a diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 139825c32..0922eb655 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -11,8 +11,6 @@ #include #include "hardware_caps.h" -#include - static int initialized = 0; static hw_caps_t caps; @@ -21,7 +19,7 @@ hw_caps_t *get_hwcaps(void) { return ∩︀ int rev = cs_get_revision(); int chip = cs_get_chip_type(); - caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan + caps.has_fan = (rev < 8); // see dirty part of hw_caps in neutrino.cpp caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -44,14 +42,7 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 8: - if (CFEManager::getInstance()->getFrontendCount() < 2) - { - strcpy(caps.boxname, "Neo"); - } - else - { - strcpy(caps.boxname, "Neo Twin"); - } + strcpy(caps.boxname, "Neo"); // see dirty part of hw_caps in neutrino.cpp strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ef218a9ce..068edaec6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2386,6 +2386,20 @@ TIMER_START(); CheckFastScan(); + // dirty part of hw_caps - specify some details after zapit start + if (strcmp(g_info.hw_caps->boxname, "HD1") == 0) + { + // only SAT-HD1 has fan + if (!CFEManager::getInstance()->getFE(0)->hasSat()) + g_info.hw_caps->has_fan = 0; + } + if (strcmp(g_info.hw_caps->boxname, "Neo") == 0) + { + // detecting Neo Twin by counting frontends + if (CFEManager::getInstance()->getFrontendCount() > 1) + strcpy(g_info.hw_caps->boxname, "Neo Twin"); + } + //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From 378dfeeda6ba632724cb8d898c382844478aa358 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Aug 2017 21:13:19 +0200 Subject: [PATCH 15/26] audioplayer. add streamripper control to record current stream Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/24affa8a8b598edea57da399c063237652f4fe4c Author: vanhofen Date: 2017-08-17 (Thu, 17 Aug 2017) Origin message was: ------------------ - audioplayer. add streamripper control to record current stream --- data/locale/deutsch.locale | 4 +++ data/locale/english.locale | 4 +++ src/gui/audioplayer.cpp | 52 +++++++++++++++++++++++++++++++++-- src/gui/audioplayer.h | 2 ++ src/gui/audioplayer_setup.cpp | 13 +++++++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 4 +++ src/system/locals_intern.h | 4 +++ src/system/settings.h | 1 + 9 files changed, 84 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5321cd305..ff8291b2f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -198,6 +198,9 @@ audioplayer.select_title_by_name Titelsuche nach Name (SMS) audioplayer.show_playlist Playlist anzeigen audioplayer.shuffle Zufällig audioplayer.spectrum LCD Skala +audioplayer.streamripper_dir Streamripper-Verzeichnis +audioplayer.streamripper_start Streamripper starten +audioplayer.streamripper_stop Streamripper stoppen audioplayer.stop Stopp audioplayer.title_artist Titel, Interpret blank_screen Blanker Bildschirm @@ -1123,6 +1126,7 @@ menu.hint_audioplayer_order Ändern der Sortierreihenfolge der Wiedergabeliste menu.hint_audioplayer_playlist Aktiviert die Anzeige der Titel in der Wiedergabeliste menu.hint_audioplayer_repeat Aktiviert das Wiederholen der Wiedergabeliste, wenn das Ende erreicht ist menu.hint_audioplayer_sc_metadata Aktiviert das Anzeigen der Audio-Metadaten +menu.hint_audioplayer_streamripper_dir Wählen Sie das Aufnahmeverzeichnis für den Streamripper menu.hint_audioplayer_title Aktivieren Sie die Titelsuche (SMS-Stil) in der Playliste menu.hint_auto_lang Wählen Sie, ob automatisch ihre bevorzugte Tonspur ausgewählt wird, wenn sie vorhanden ist menu.hint_auto_subs Automatische Anzeige der Untertitel in Ihrer bevorzugten Sprache diff --git a/data/locale/english.locale b/data/locale/english.locale index 4479fa8a1..cfd5524be 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -198,6 +198,9 @@ audioplayer.select_title_by_name Search title by name (SMS) audioplayer.show_playlist Show playlist audioplayer.shuffle Shuffle audioplayer.spectrum LCD spectrum +audioplayer.streamripper_dir Streamripper directory +audioplayer.streamripper_start Start streamripper +audioplayer.streamripper_stop Stop streamripper audioplayer.stop Stop audioplayer.title_artist Title, artist blank_screen Blank screen @@ -1123,6 +1126,7 @@ menu.hint_audioplayer_order Change playlist sort order menu.hint_audioplayer_playlist Show playlist items menu.hint_audioplayer_repeat Enable playlist repeat when end of list reached menu.hint_audioplayer_sc_metadata Enable streaming audio metadata parsing +menu.hint_audioplayer_streamripper_dir Default streamripper target directory menu.hint_audioplayer_title Enable SMS-style title search in playlist menu.hint_auto_lang Auto-switch audio to preferred language menu.hint_auto_subs Auto-start subtitles for preferred language diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index a8e91e4a1..580f6aec7 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -216,7 +216,7 @@ CAudioPlayerGui::~CAudioPlayerGui() delete m_titlebox; } -const struct button_label AudioPlayerButtons[][4] = +/*const*/ struct button_label AudioPlayerButtons[][4] = { { { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, @@ -249,6 +249,7 @@ const struct button_label AudioPlayerButtons[][4] = { { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, + { NEUTRINO_ICON_BUTTON_RECORD_ACTIVE, LOCALE_AUDIOPLAYER_STREAMRIPPER_START }, }, { { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, @@ -321,6 +322,9 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_idletime = time(NULL); m_screensaver = false; + m_streamripper_available = !find_executable("streamripper").empty() && !find_executable("streamripper.sh").empty(); + m_streamripper_active = false; + if (parent) parent->hide(); @@ -838,6 +842,32 @@ int CAudioPlayerGui::show() update = true; } } + else if (msg == (neutrino_msg_t) g_settings.key_record) + { + if (m_key_level == 1) + { + if (m_curr_audiofile.FileType == CFile::STREAM_AUDIO && m_streamripper_available) + { + if (m_streamripper_active) + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2); + my_system(2, "streamripper.sh", "stop"); + m_streamripper_active = false; + } + else + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_START, HINTBOX_MIN_WIDTH, 2); + printf("streamripper.sh start \"%s\"\n", m_playlist[m_current].MetaData.url.c_str()); + puts("[audioplayer.cpp] executing streamripper"); + if (my_system(3, "streamripper.sh", "start", m_playlist[m_current].MetaData.url.c_str()) != 0) + perror("[audioplayer.cpp]: streamripper.sh failed\n"); + else + m_streamripper_active = true; + } + update = true; + } + } + } else if (CRCInput::isNumeric(msg) && !(m_playlist.empty())) { //numeric zap or SMS zap if (m_select_title_by_name) @@ -1730,7 +1760,18 @@ void CAudioPlayerGui::paintFoot() if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[0], button_width, m_button_height); else - ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[6], button_width, m_button_height); + { + int b = 2; + if (m_streamripper_available) + { + b = 3; + if (m_streamripper_active) + AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP; + else + AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_START; + } + ::paintButtons(button_x, button_y, button_width, b, AudioPlayerButtons[6], button_width, m_button_height); + } } else // key_level == 2 { @@ -2028,6 +2069,13 @@ void CAudioPlayerGui::stop() if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) CAudioPlayer::getInstance()->stop(); + + if (m_streamripper_active) + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2); + my_system(2, "streamripper.sh", "stop"); + m_streamripper_active = false; + } } void CAudioPlayerGui::pause() diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 068a412eb..ff464b09a 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -109,6 +109,8 @@ class CAudioPlayerGui : public CMenuTarget bool m_select_title_by_name; bool m_show_playlist; bool m_playlistHasChanged; + bool m_streamripper_available; + bool m_streamripper_active; CAudioPlayList m_playlist; CAudioPlayList m_radiolist; diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index c55bd75d6..dcee5ab15 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -80,6 +80,15 @@ int CAudioPlayerSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } + if(actionKey == "streamripperdir") + { + CFileBrowser b; + b.Dir_Mode=true; + if (b.exec(g_settings.network_nfs_streamripperdir.c_str())) + g_settings.network_nfs_streamripperdir = b.getSelectedFile()->Name; + return res; + } + res = showAudioPlayerSetup(); return res; @@ -136,6 +145,10 @@ int CAudioPlayerSetup::showAudioPlayerSetup() mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_DEFDIR); audioplayerSetup->addItem(mf); + mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, true, g_settings.network_nfs_streamripperdir, this, "streamripperdir"); + mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR); + audioplayerSetup->addItem(mf); + mc = new CMenuOptionChooser(LOCALE_AUDIOPLAYER_ENABLE_SC_METADATA, &g_settings.audioplayer_enable_sc_metadata, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SC_METADATA); audioplayerSetup->addItem(mc); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 068edaec6..ce45c54eb 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -654,6 +654,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.network_nfs[i].mac = configfile.getString("network_nfs_mac_" + i_str, "11:22:33:44:55:66"); } g_settings.network_nfs_audioplayerdir = configfile.getString( "network_nfs_audioplayerdir", "/media/sda1/music" ); + g_settings.network_nfs_streamripperdir = configfile.getString( "network_nfs_streamripperdir", "/media/sda1/music/streamripper" ); g_settings.network_nfs_picturedir = configfile.getString( "network_nfs_picturedir", "/media/sda1/pictures" ); g_settings.network_nfs_moviedir = configfile.getString( "network_nfs_moviedir", "/media/sda1/movies" ); g_settings.network_nfs_recordingdir = configfile.getString( "network_nfs_recordingdir", "/media/sda1/movies" ); @@ -1412,6 +1413,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString(cfg_key, g_settings.network_nfs[i].mac); } configfile.setString( "network_nfs_audioplayerdir", g_settings.network_nfs_audioplayerdir); + configfile.setString( "network_nfs_streamripperdir", g_settings.network_nfs_streamripperdir); configfile.setString( "network_nfs_picturedir", g_settings.network_nfs_picturedir); configfile.setString( "network_nfs_moviedir", g_settings.network_nfs_moviedir); configfile.setString( "network_nfs_recordingdir", g_settings.network_nfs_recordingdir); diff --git a/src/system/locals.h b/src/system/locals.h index 83a40bd06..27a396d62 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -225,6 +225,9 @@ typedef enum LOCALE_AUDIOPLAYER_SHOW_PLAYLIST, LOCALE_AUDIOPLAYER_SHUFFLE, LOCALE_AUDIOPLAYER_SPECTRUM, + LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, + LOCALE_AUDIOPLAYER_STREAMRIPPER_START, + LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, LOCALE_AUDIOPLAYER_STOP, LOCALE_AUDIOPLAYER_TITLE_ARTIST, LOCALE_BLANK_SCREEN, @@ -1150,6 +1153,7 @@ typedef enum LOCALE_MENU_HINT_AUDIOPLAYER_PLAYLIST, LOCALE_MENU_HINT_AUDIOPLAYER_REPEAT, LOCALE_MENU_HINT_AUDIOPLAYER_SC_METADATA, + LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR, LOCALE_MENU_HINT_AUDIOPLAYER_TITLE, LOCALE_MENU_HINT_AUTO_LANG, LOCALE_MENU_HINT_AUTO_SUBS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ae019c62e..501f422ed 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -225,6 +225,9 @@ const char * locale_real_names[] = "audioplayer.show_playlist", "audioplayer.shuffle", "audioplayer.spectrum", + "audioplayer.streamripper_dir", + "audioplayer.streamripper_start", + "audioplayer.streamripper_stop", "audioplayer.stop", "audioplayer.title_artist", "blank_screen", @@ -1150,6 +1153,7 @@ const char * locale_real_names[] = "menu.hint_audioplayer_playlist", "menu.hint_audioplayer_repeat", "menu.hint_audioplayer_sc_metadata", + "menu.hint_audioplayer_streamripper_dir", "menu.hint_audioplayer_title", "menu.hint_auto_lang", "menu.hint_auto_subs", diff --git a/src/system/settings.h b/src/system/settings.h index d05e295d3..782a50d2a 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -462,6 +462,7 @@ struct SNeutrinoSettings std::string password; } network_nfs[NETWORK_NFS_NR_OF_ENTRIES]; std::string network_nfs_audioplayerdir; + std::string network_nfs_streamripperdir; std::string network_nfs_picturedir; std::string network_nfs_moviedir; std::string network_nfs_recordingdir; From baa5b61294c111b0863da17f956eb4cda63dafbf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Aug 2017 21:16:17 +0200 Subject: [PATCH 16/26] audioplayer-setup: re-align some items Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c9c310def9d16b3275fea788f413422f4bbcde2 Author: vanhofen Date: 2017-08-17 (Thu, 17 Aug 2017) Origin message was: ------------------ - audioplayer-setup: re-align some items --- src/gui/audioplayer_setup.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index dcee5ab15..6c9b8bc8a 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -145,21 +145,20 @@ int CAudioPlayerSetup::showAudioPlayerSetup() mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_DEFDIR); audioplayerSetup->addItem(mf); - mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, true, g_settings.network_nfs_streamripperdir, this, "streamripperdir"); - mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR); - audioplayerSetup->addItem(mf); + audioplayerSetup->addItem(GenericMenuSeparatorLine); + + // internetradio autostart first entry from favorites + mc = new CMenuOptionChooser(LOCALE_INETRADIO_AUTOSTART, &g_settings.inetradio_autostart, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL); + mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_INETRADIO_AUTOSTART); + audioplayerSetup->addItem(mc); mc = new CMenuOptionChooser(LOCALE_AUDIOPLAYER_ENABLE_SC_METADATA, &g_settings.audioplayer_enable_sc_metadata, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SC_METADATA); audioplayerSetup->addItem(mc); - //NI - audioplayerSetup->addItem(GenericMenuSeparator); - - //NI internetradio autostart first entry from favorites - mc = new CMenuOptionChooser(LOCALE_INETRADIO_AUTOSTART, &g_settings.inetradio_autostart, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL); - mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_INETRADIO_AUTOSTART); - audioplayerSetup->addItem(mc); + mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, true, g_settings.network_nfs_streamripperdir, this, "streamripperdir"); + mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR); + audioplayerSetup->addItem(mf); int res = audioplayerSetup->exec (NULL, ""); delete audioplayerSetup; From 144f0754e02cc26e819cb60de1b5d1de4d4bf56a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Aug 2017 21:49:43 +0200 Subject: [PATCH 17/26] clearify headers for ausioplayer/internetradio setup Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8314675161e40b30f8b067f720b329b540aaeb60 Author: vanhofen Date: 2017-08-17 (Thu, 17 Aug 2017) Origin message was: ------------------ - clearify headers for ausioplayer/internetradio setup --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/audioplayer_setup.cpp | 2 +- src/gui/mediaplayer_setup.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ff8291b2f..985072652 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -203,6 +203,7 @@ audioplayer.streamripper_start Streamripper starten audioplayer.streamripper_stop Streamripper stoppen audioplayer.stop Stopp audioplayer.title_artist Titel, Interpret +audioplayer_internetradio.name Audioplayer und Internetradio blank_screen Blanker Bildschirm bookmarkmanager.delete Löschen bookmarkmanager.name Bookmarks diff --git a/data/locale/english.locale b/data/locale/english.locale index cfd5524be..e2b07d52d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -203,6 +203,7 @@ audioplayer.streamripper_start Start streamripper audioplayer.streamripper_stop Stop streamripper audioplayer.stop Stop audioplayer.title_artist Title, artist +audioplayer_internetradio.name Audioplayer and Internetradio blank_screen Blank screen bookmarkmanager.delete delete bookmarkmanager.name bookmarks diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index 6c9b8bc8a..8afcce06d 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -111,7 +111,7 @@ int CAudioPlayerSetup::showAudioPlayerSetup() CMenuWidget* audioplayerSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_AUDIOSETUP); - audioplayerSetup->addIntroItems(LOCALE_AUDIOPLAYER_NAME); + audioplayerSetup->addIntroItems(LOCALE_AUDIOPLAYER_INTERNETRADIO_NAME); // display order mc = new CMenuOptionChooser(LOCALE_AUDIOPLAYER_DISPLAY_ORDER, &g_settings.audioplayer_display, AUDIOPLAYER_DISPLAY_ORDER_OPTIONS, AUDIOPLAYER_DISPLAY_ORDER_OPTION_COUNT, true); diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index bb18e8333..a2c5726d9 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -87,7 +87,7 @@ int CMediaPlayerSetup::showMediaPlayerSetup() CMenuForwarder *mf; CAudioPlayerSetup asetup; - mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, &asetup, "", CRCInput::RC_red); + mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_INTERNETRADIO_NAME, true, NULL, &asetup, "", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP); mediaSetup->addItem(mf); diff --git a/src/system/locals.h b/src/system/locals.h index 27a396d62..c0669e26e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -230,6 +230,7 @@ typedef enum LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, LOCALE_AUDIOPLAYER_STOP, LOCALE_AUDIOPLAYER_TITLE_ARTIST, + LOCALE_AUDIOPLAYER_INTERNETRADIO_NAME, LOCALE_BLANK_SCREEN, LOCALE_BOOKMARKMANAGER_DELETE, LOCALE_BOOKMARKMANAGER_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 501f422ed..40a9cb971 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -230,6 +230,7 @@ const char * locale_real_names[] = "audioplayer.streamripper_stop", "audioplayer.stop", "audioplayer.title_artist", + "audioplayer_internetradio.name", "blank_screen", "bookmarkmanager.delete", "bookmarkmanager.name", From b63172033cc1b67042e7594f028a31f216a193f4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 18 Aug 2017 08:21:01 +0200 Subject: [PATCH 18/26] re-sort locals Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fddd6bbd5f6cb2b71ae11c6e6c149bb508a74070 Author: vanhofen Date: 2017-08-18 (Fri, 18 Aug 2017) Origin message was: ------------------ - re-sort locals --- 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 985072652..c4dcdd44c 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -198,10 +198,10 @@ audioplayer.select_title_by_name Titelsuche nach Name (SMS) audioplayer.show_playlist Playlist anzeigen audioplayer.shuffle Zufällig audioplayer.spectrum LCD Skala +audioplayer.stop Stopp audioplayer.streamripper_dir Streamripper-Verzeichnis audioplayer.streamripper_start Streamripper starten audioplayer.streamripper_stop Streamripper stoppen -audioplayer.stop Stopp audioplayer.title_artist Titel, Interpret audioplayer_internetradio.name Audioplayer und Internetradio blank_screen Blanker Bildschirm diff --git a/data/locale/english.locale b/data/locale/english.locale index e2b07d52d..a06fd154d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -198,10 +198,10 @@ audioplayer.select_title_by_name Search title by name (SMS) audioplayer.show_playlist Show playlist audioplayer.shuffle Shuffle audioplayer.spectrum LCD spectrum +audioplayer.stop Stop audioplayer.streamripper_dir Streamripper directory audioplayer.streamripper_start Start streamripper audioplayer.streamripper_stop Stop streamripper -audioplayer.stop Stop audioplayer.title_artist Title, artist audioplayer_internetradio.name Audioplayer and Internetradio blank_screen Blank screen diff --git a/src/system/locals.h b/src/system/locals.h index c0669e26e..596726afe 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -225,10 +225,10 @@ typedef enum LOCALE_AUDIOPLAYER_SHOW_PLAYLIST, LOCALE_AUDIOPLAYER_SHUFFLE, LOCALE_AUDIOPLAYER_SPECTRUM, + LOCALE_AUDIOPLAYER_STOP, LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, LOCALE_AUDIOPLAYER_STREAMRIPPER_START, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, - LOCALE_AUDIOPLAYER_STOP, LOCALE_AUDIOPLAYER_TITLE_ARTIST, LOCALE_AUDIOPLAYER_INTERNETRADIO_NAME, LOCALE_BLANK_SCREEN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 40a9cb971..74bd00449 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -225,10 +225,10 @@ const char * locale_real_names[] = "audioplayer.show_playlist", "audioplayer.shuffle", "audioplayer.spectrum", + "audioplayer.stop", "audioplayer.streamripper_dir", "audioplayer.streamripper_start", "audioplayer.streamripper_stop", - "audioplayer.stop", "audioplayer.title_artist", "audioplayer_internetradio.name", "blank_screen", From 1e4ded8ce9f6835e3fafd1bf1335e564b6fa3add Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 18 Aug 2017 13:16:40 +0200 Subject: [PATCH 19/26] audioplayer: update gui if streamripper has stopped or crashed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a5843ca020348ae586fd6feb46a92e8814e3eaf Author: vanhofen Date: 2017-08-18 (Fri, 18 Aug 2017) Origin message was: ------------------ - audioplayer: update gui if streamripper has stopped or crashed --- src/gui/audioplayer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 580f6aec7..2a21764d8 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -422,6 +422,13 @@ int CAudioPlayerGui::show() playNext(); } + if (m_streamripper_active && !getpidof("streamripper")) + { + printf("streamripper should but doesn't work.\n"); + m_streamripper_active = false; + update = true; + } + if (update) { if (clear_before_update) From d5966753c11ed65bbc56995558aa4b3307f53e1c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 12:53:05 +0200 Subject: [PATCH 20/26] Revert "- neutrino: fix hw_caps init; it must be initialized after zapit start" This reverts commit 2d4130dab898a8b98bb68111d2481ab4950100c8. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c8ae9595c331f5c2540289d6b552c81b9a93072 Author: Jacek Jendrzej Date: 2017-08-21 (Mon, 21 Aug 2017) --- src/neutrino.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 519ebdfda..99c17645d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -456,22 +456,14 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); - /* - hw_caps needs CFEManager and CFEManager needs g_settings. - So loadSetup() cannot use hw_caps to init g_settings. - - For this reason we need this workaround. - */ - bool can_shutdown = (cs_get_revision() > 7); - g_settings.shutdown_real = false; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2158,6 +2150,8 @@ TIMER_START(); cs_new_auto_videosystem(); #endif + g_info.hw_caps = get_hwcaps(); + g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2245,9 +2239,6 @@ TIMER_START(); CheckFastScan(); - // init hw_caps *after* zapit start! - g_info.hw_caps = get_hwcaps(); - //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From cce5365b590b9fc957885b89f9525acd46b923ad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Aug 2017 10:56:45 +0200 Subject: [PATCH 21/26] hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c307ed5b36178f97f75060147c3c16183f6ee816 Author: vanhofen Date: 2017-08-14 (Mon, 14 Aug 2017) Origin message was: ------------------ - hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start --- lib/hardware/coolstream/Makefile.am | 7 ------- lib/hardware/coolstream/hardware_caps.cpp | 13 ++----------- src/neutrino.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index 82f3ab83c..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,13 +1,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/lib/libconfigfile \ - -I$(top_srcdir)/lib/libeventserver \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libhwcaps.a diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 139825c32..0922eb655 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -11,8 +11,6 @@ #include #include "hardware_caps.h" -#include - static int initialized = 0; static hw_caps_t caps; @@ -21,7 +19,7 @@ hw_caps_t *get_hwcaps(void) { return ∩︀ int rev = cs_get_revision(); int chip = cs_get_chip_type(); - caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan + caps.has_fan = (rev < 8); // see dirty part of hw_caps in neutrino.cpp caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -44,14 +42,7 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 8: - if (CFEManager::getInstance()->getFrontendCount() < 2) - { - strcpy(caps.boxname, "Neo"); - } - else - { - strcpy(caps.boxname, "Neo Twin"); - } + strcpy(caps.boxname, "Neo"); // see dirty part of hw_caps in neutrino.cpp strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 99c17645d..080a31d07 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2239,6 +2239,20 @@ TIMER_START(); CheckFastScan(); + // dirty part of hw_caps - specify some details after zapit start + if (strcmp(g_info.hw_caps->boxname, "HD1") == 0) + { + // only SAT-HD1 has fan + if (!CFEManager::getInstance()->getFE(0)->hasSat()) + g_info.hw_caps->has_fan = 0; + } + if (strcmp(g_info.hw_caps->boxname, "Neo") == 0) + { + // detecting Neo Twin by counting frontends + if (CFEManager::getInstance()->getFrontendCount() > 1) + strcpy(g_info.hw_caps->boxname, "Neo Twin"); + } + //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From 973b9ebe5488550b914b6ddfcbe1aaf6a6bb7adc Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 14:42:24 +0200 Subject: [PATCH 22/26] some inits warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c99486520e02c9ce45442c180fd150aafdee3eca Author: Jacek Jendrzej Date: 2017-08-21 (Mon, 21 Aug 2017) --- src/driver/radiotext.cpp | 2 +- src/gui/infoviewer.cpp | 3 ++- src/gui/movieplayer.cpp | 2 +- src/gui/streaminfo2.cpp | 2 +- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 8 ++++---- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 28f1c8186..b74aa9ef0 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -836,7 +836,7 @@ void CRadioText::RassDecode(unsigned char *mtext, int len) slidenumr = Rass_SlideFoto; } // - char *filepath; + char *filepath = asprintf(&filepath, "%s/Rass_%d.error", DataDir, slidenumr); (filetype == 2) ? asprintf(&filepath, "%s/Rass_%d.def", DataDir, slidenumr) : asprintf(&filepath, "%s/Rass_%d.mpg", DataDir, slidenumr); if ((fd = fopen(filepath, "wb")) != NULL) { diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 693f543c4..68b29cadc 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -951,7 +951,7 @@ bool CInfoViewer::showLivestreamInfo() CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1); if (!(videoDecoder->getBlank())) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string tmp2; videoDecoder->getPictureInfo(xres, yres, framerate); switch (framerate) { @@ -980,6 +980,7 @@ bool CInfoViewer::showLivestreamInfo() tmp2 = "60fps"; break; default: + framerate = 0; tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN); break; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b087fee10..786a340cd 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2298,7 +2298,7 @@ void CMoviePlayerGui::selectChapter() playback->GetChapters(positions, titles); std::vector playlists; std::vector ptitles; - int current; + int current = 0; playback->GetTitles(playlists, ptitles, current); if (positions.empty() && playlists.empty()) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index b799c4c3f..f4ddae10b 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -649,7 +649,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; /* audioDecoder->getAudioInfo() seems broken in libcoolstream2. ddmode is always 1 ("CH1/CH2"). diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index e067a7f4a..ba9c40ad3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -466,7 +466,7 @@ int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoResolutionAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; videoDecoder->getPictureInfo(xres, yres, framerate); std::stringstream out; out << xres << "x" << yres; @@ -476,7 +476,7 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoFramerateAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string sframerate = "{=L:unknown=}"; videoDecoder->getPictureInfo(xres, yres, framerate); switch(framerate){ @@ -491,7 +491,7 @@ std::string CNeutrinoAPI::getVideoFramerateAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getAudioInfoAsString(void) { - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); std::stringstream out; if(type == 0) @@ -557,7 +557,7 @@ void CNeutrinoAPI::SendAllTimers(std::string url, bool force) Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); - int pre,post; + int pre = 0,post = 0; Timerd->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; From 96edd2f2c12736ad534316515d63a641af3fba05 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 12:58:26 +0200 Subject: [PATCH 23/26] some inits and never read var Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba600f0e5ce176a88d369a8bec16edf048242753 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) --- lib/libmd5sum/md5.c | 2 +- lib/libtuxtxt/tuxtxt_common.h | 3 ++- src/gui/eventlist.cpp | 3 +-- src/gui/infoviewer.cpp | 1 - src/gui/movieplayer.cpp | 2 -- src/gui/opkg_manager.cpp | 1 + src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 4 ++++ src/zapit/src/frontend.cpp | 1 + 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libmd5sum/md5.c b/lib/libmd5sum/md5.c index e433782e8..aece50d10 100644 --- a/lib/libmd5sum/md5.c +++ b/lib/libmd5sum/md5.c @@ -132,7 +132,7 @@ md5_stream (stream, resblock) /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; + char buffer[BLOCKSIZE + 72] = {0}; size_t sum; /* Initialize the computation context. */ diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 52f9d419e..c6e6c7bd8 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -704,8 +704,9 @@ void *tuxtxt_CacheThread(void * /*arg*/) tuxtxt_cache.current_subpage[magazine] = -1; continue; } - +#if 0 /* ? */ b1 &= 3; +#endif b3 &= 7; if (tuxtxt_is_dec(tuxtxt_cache.page_receiving)) /* ignore other subpage bits for hex pages */ diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 76c7d5cdf..7f17c199d 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -265,7 +265,6 @@ void CEventList::readEvents(const t_channel_id channel_id) void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) { t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp = channel_id; const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); if(channel_nr < 2){ channel_id = 0; @@ -274,7 +273,7 @@ void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_ unsigned int tmp_channel = 0; for(unsigned int channel = 0; channel < channel_nr; channel++) { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + t_channel_id channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); if(channel_id_tmp == channel_id){ if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { channel = (channel+1) %channel_nr; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 68b29cadc..323084f09 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1073,7 +1073,6 @@ void CInfoViewer::loop(bool show_dot) //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); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 786a340cd..a18773a4b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1472,7 +1472,6 @@ void CMoviePlayerGui::PlayFileLoop(void) disableOsdElements(MUTE); CFileBrowser *playlist = new CFileBrowser(); CFile *pfile = NULL; - pfile = &(*filelist_it); int selected = std::distance( filelist.begin(), filelist_it ); filelist_it = filelist.end(); if (playlist->playlist_manager(filelist, selected)) @@ -2451,7 +2450,6 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) else { memset(buf + (len - olen), 0, olen); text = buf; - ret = true; } free(buf); diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 5276bbc76..be5029a3b 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -671,6 +671,7 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc) return pkgDesc; fpos_t fz; + fz.__pos = 0; fseek(fd, 0, SEEK_END); fgetpos(fd, &fz); fseek(fd, 0, SEEK_SET); diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 04dd13a4f..50f14c4b9 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -1023,6 +1023,10 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin unsigned timerId=0; std::string cmd, stimerid; CTimerd::responseGetTimer timer; // Timer + timer.alarmTime = 0; + timer.stopTime = 0; + timer.apids = 0; + timer.eventType = CTimerd::__TIMER_NEXTPROGRAM;//nothing time_t now_t = time(NULL); ySplitString(para, " ", cmd, stimerid); if(cmd != "new") diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 215a58ea2..26482d2b1 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -603,6 +603,7 @@ uint32_t CFrontend::getRate() const fe_status_t CFrontend::getStatus(void) const { struct dvb_frontend_event event; + event.status = FE_REINIT; fop(ioctl, FE_READ_STATUS, &event.status); return (fe_status_t) (event.status & FE_HAS_LOCK); } From d1c3f8a15753f1a8d8fe0870be6789815514d883 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:00:24 +0200 Subject: [PATCH 24/26] fxi possible buffer overflow Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e58e72635b5b04c82ef39fea1b30931e634dc6d3 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) --- src/gui/widget/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 9c5a7995e..6ee70f32a 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -205,7 +205,7 @@ int paintButtons( const button_label_ext * const content, fprintf(stderr, "PB: sp %d mw %d w_t %d w_i %d w_s %d c_i %d\n", spacing, maxwidth, w_text, w_icons, w_space, count_items); #endif - if (fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ + if (cnt > 0 && fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ count_labels++; /* side effect: we don't try to divide by 0 :-) */ if (maximize) { From 1e1d5ed1379bdab68d3fc777ccf11c99689874cd Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:03:34 +0200 Subject: [PATCH 25/26] null pointer check Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/527c0de33a36617ef810109df26e487b68751133 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) --- src/gui/widget/helpbox.cpp | 14 ++++++++------ src/gui/widget/listframe.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index fc8989efc..d4fd87b76 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -99,16 +99,18 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in if (!text.empty()){ int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0); CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, 0, text, text_mode, font); - txt->doPaintBg(false); - txt->forceTextPaint(); + if(txt){ + txt->doPaintBg(false); + txt->forceTextPaint(); #if 0 //"contrast agent", if you want to see where the text items are drawn. txt->setColorBody(COL_RED); #endif - int lines = txt->getCTextBoxObject()->getLines(); - txt_height = std::max(lines*font->getHeight(), h_line); - txt->setHeight(txt_height); + int lines = txt->getCTextBoxObject()->getLines(); + txt_height = std::max(lines*font->getHeight(), h_line); + txt->setHeight(txt_height); - line->addCCItem(txt); + line->addCCItem(txt); + } } if (txt_height > line->getHeight()) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 2ed9085ec..de9a1bf1b 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -58,10 +58,10 @@ #include #include -#define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) -#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) +#define MAX_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() - 40:0) +#define MAX_WINDOW_HEIGHT (frameBuffer ? frameBuffer->getScreenHeight() - 40:0) -#define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1) +#define MIN_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() >> 1:0) #define MIN_WINDOW_HEIGHT 40 #define TITLE_BACKGROUND_COLOR COL_MENUHEAD_PLUS_0 @@ -206,7 +206,7 @@ void CListFrame::reSizeMainFrameWidth(int textWidth) int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*OFFSET_INNER_MID; - if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; + if(iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if((unsigned int) iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; m_cFrame.iWidth = iNewWindowWidth; From 142d17c8b080c8ea89ae9cbb4ffbfb1dc4623f5d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:05:57 +0200 Subject: [PATCH 26/26] fix possible out of bound memory access Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/350a73ce08dee05dfc80e5f35bffb38bbeec877f Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) --- src/gui/widget/stringinput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index f325cedb1..a0c789a86 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -278,12 +278,17 @@ void CStringInput::keyDownPressed() { int npos = 0; std::string tmp_value = *valueString; - for(int count=0;count<(int)strlen(validchars);count++) + const int validchar_len = (int)strlen(validchars); + for(int count=0;countat(selected)==validchars[count]) npos = count; npos--; - if(npos<0) - npos = strlen(validchars)-1; + if(npos<0){ + if(validchar_len > 0) + npos = validchar_len-1; + else + npos = 0; + } valueString->at(selected)=validchars[npos]; int current_value = atoi(*valueString);