From 51a20d00c7fe4c5fa3771328546f8e463858d0db Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Jun 2017 17:18:06 +0200 Subject: [PATCH 1/8] settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 834e9e3843e306ffc5a72a180e72ef584efa0582) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a7ac6c0b0293660e2be11dc23439d76467b9296 Author: vanhofen Date: 2017-06-29 (Thu, 29 Jun 2017) Origin message was: ------------------ - settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 834e9e3843e306ffc5a72a180e72ef584efa0582) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h --- src/gui/audioplayer.cpp | 2 +- src/system/settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 34e022b86..6596d959b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1722,7 +1722,7 @@ void CAudioPlayerGui::paintTitleBox() if (!m_titlebox) { m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); - m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->enableFrame(true, FRAME_WIDTH_MIN); m_titlebox->setCorner(RADIUS_LARGE); } m_titlebox->paint(false); diff --git a/src/system/settings.h b/src/system/settings.h index fd72578b2..7950a6fa3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -938,7 +938,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) -#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2) +#define FRAME_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(2) #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) From c44fcd296b8914b36215656c12ec5a43ab961d57 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Jun 2017 19:04:10 +0200 Subject: [PATCH 2/8] src/gui/moviebrowser/mb.cpp fix segfault if m_movieSelectionHandler is NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc5ba460a55a68c7db94365f97c858bc5a3cfece Author: Jacek Jendrzej Date: 2017-06-29 (Thu, 29 Jun 2017) --- src/gui/moviebrowser/mb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9d3a3e27f..76161a8f7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3449,7 +3449,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + if (m_movieSelectionHandler){ + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + } mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); From 6f6530291126491de8bc5e508a363bbecea18c6f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:40:19 +0200 Subject: [PATCH 3/8] src/gui/movieplayer.cpp show FileTimeOSD only if setSpeed work Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f095b96c92dd94cdbcaf9439314e8e89faeb30c Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) --- src/gui/movieplayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5ecc32a27..d90f10e64 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1534,7 +1534,8 @@ void CMoviePlayerGui::PlayFileLoop(void) makeScreenShot(); } else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || (msg == (neutrino_msg_t) g_settings.mpkey_forward)) { - int newspeed; + int newspeed = 0; + bool setSpeed = false; if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) { newspeed = (speed >= 0) ? -1 : speed - 1; } else { @@ -1547,9 +1548,10 @@ void CMoviePlayerGui::PlayFileLoop(void) if (playstate != CMoviePlayerGui::PAUSE) playstate = msg == (neutrino_msg_t) g_settings.mpkey_rewind ? CMoviePlayerGui::REW : CMoviePlayerGui::FF; updateLcd(); + setSpeed = true; } - if (!FileTimeOSD->IsVisible() && !time_forced) { + if (!FileTimeOSD->IsVisible() && !time_forced && setSpeed) { FileTimeOSD->switchMode(position, duration); time_forced = true; } From 82099d9faadd22e1a6c9eb709748b8ed63d928f3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:42:09 +0200 Subject: [PATCH 4/8] src/gui/movieplayer.cpp fix play icon after pause->seek Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4318615a606b426e926b7e2b395c2a253caf1304 Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) --- src/gui/movieplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d90f10e64..b087fee10 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1253,6 +1253,11 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute) { clearSubtitle(); bool res = playback->SetPosition(pos, absolute); + if(is_file_player && res && speed == 0 && playstate == CMoviePlayerGui::PAUSE){ + playstate = CMoviePlayerGui::PLAY; + speed = 1; + playback->SetSpeed(speed); + } return res; } From 32187594646cb7ec443d47c7846e499724ec1c3e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 29 Jun 2017 22:13:17 +0200 Subject: [PATCH 5/8] CBouquetList: fix scrollbar shadow Footer is painted as first item and scrollbar as last, so shadow overpaint footer body. Either paint scrollbar as first or use matching shadow parameter. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/acb5b7e292e60cbfd6234d102e462af94a77a09d Author: Thilo Graf Date: 2017-06-29 (Thu, 29 Jun 2017) --- src/gui/bouquetlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 73eb025dc..d031f4bc8 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -740,5 +740,5 @@ void CBouquetList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } From 70130c8cff39d4f37c79ad6e3c6d04c6c4a3933d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 1 Jul 2017 10:26:33 +0200 Subject: [PATCH 6/8] src/gui/opkg_manager.cpp fix esource leak; supplement to 0e522bb6e641963dc7bded006e615b8270986844 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/18e1ec060f4c6582142ce5a6f55d90ba6f03c575 Author: Jacek Jendrzej Date: 2017-07-01 (Sat, 01 Jul 2017) --- src/gui/opkg_manager.cpp | 5 +++-- src/gui/timerlist.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index f9970b7ec..5276bbc76 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -674,9 +674,10 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc) fseek(fd, 0, SEEK_END); fgetpos(fd, &fz); fseek(fd, 0, SEEK_SET); - if (fz.__pos == 0) + if (fz.__pos == 0){ + fclose(fd); return pkgDesc; - + } char buf[512]; string package, version, description; while (fgets(buf, sizeof(buf), fd)) { diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 23f6d734a..c54dbf792 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1817,7 +1817,7 @@ int CTimerList::newTimer() bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_name) { CTimerd::TimerList overlappingTimers; - int pre,post; + int pre = 0,post = 0; Timer->getRecordingSafety(pre,post); for (CTimerd::TimerList::iterator it = timerlist.begin(); it != timerlist.end();++it) From 07964c4a824872d0377e486d4460b96fba7de1c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 1 Jul 2017 20:40:20 +0200 Subject: [PATCH 7/8] CUpnpBrowserGui: fix dline paint during directory selection Dline was not removed on directory selection. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/baf441b5d074b60c17b1fd829ea86504aa340dd6 Author: Thilo Graf Date: 2017-07-01 (Sat, 01 Jul 2017) --- 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 dbfcf8aa7..d343191ba 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1226,8 +1226,11 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) void CUpnpBrowserGui::paintItem2DetailsLine(int pos) { - if (pos < 0) + if (pos < 0){ + if (dline) + dline->kill(); return; + } int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_item_y + pos*m_item_height; From 0cba28602c98a9aba2b240302f015f793ef40adf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 1 Jul 2017 22:01:11 +0200 Subject: [PATCH 8/8] CUpnpBrowserGui: try to reduce flicker effects on scroll Some parts on screen should be painted only if changed. This should help to reduce some flicker effects. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3213999198c227b66ceb4d3306a9a912f4302e0a Author: Thilo Graf Date: 2017-07-01 (Sat, 01 Jul 2017) --- src/gui/upnpbrowser.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index d343191ba..55c4ce3bc 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -93,7 +93,7 @@ void CUpnpBrowserGui::Init() topbox.setColorAll(COL_FRAME_PLUS_0, 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(CC_SHADOW_ON, -1, true); + topbox.enableShadow(CC_SHADOW_ON); infobox.enableFrame(true, 2); infobox.setCorner(RADIUS_LARGE); @@ -101,7 +101,7 @@ void CUpnpBrowserGui::Init() infobox.setTextColor(COL_MENUCONTENTDARK_TEXT); 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(CC_SHADOW_ON, -1, true); + infobox.enableShadow(CC_SHADOW_ON); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); @@ -109,7 +109,7 @@ void CUpnpBrowserGui::Init() timebox.setTextColor(infobox.getTextColor()); 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(CC_SHADOW_ON, -1, true); + timebox.enableShadow(CC_SHADOW_ON); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); @@ -193,7 +193,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ stopAudio(); m_frameBuffer->stopFrame(); - m_frameBuffer->Clear(); + topbox.kill(); CZapit::getInstance()->EnablePlayback(true); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , m_LastMode); @@ -916,7 +916,6 @@ bool CUpnpBrowserGui::selectItem(std::string id) delete entries; timeout = 0; - m_frameBuffer->Clear(); return endall; } @@ -942,8 +941,8 @@ void CUpnpBrowserGui::paintDeviceInfo() topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); - topbox.paint0(); + if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER)) + topbox.paint0(); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) @@ -1144,8 +1143,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); - topbox.paint0(); + if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER)) + topbox.paint0(); } void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset) @@ -1205,8 +1204,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; - infobox.setText(text, CTextBox::AUTO_WIDTH); - infobox.paint0(); + if (infobox.setText(text, CTextBox::AUTO_WIDTH)) + infobox.paint0(); } }else{ if (!entry) @@ -1215,8 +1214,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text = entry->title; text += !entry->artist.empty() ? " - " + entry->artist : ""; text += "\n" + entry->album; - infobox.setText(text, CTextBox::AUTO_WIDTH); - infobox.paint0(); + if (infobox.setText(text, CTextBox::AUTO_WIDTH)) + infobox.paint0(); } if (image) image->paint0();