From 32187594646cb7ec443d47c7846e499724ec1c3e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 29 Jun 2017 22:13:17 +0200 Subject: [PATCH 01/14] 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 02/14] 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 03/14] 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 04/14] 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(); From 4cc14d335bbbcf1f2eb2c9134f81d517df2234b1 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 2 Jul 2017 19:11:27 +0200 Subject: [PATCH 05/14] fix epgplus detailsline hide bug (thx dbo) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eecc1b6af366e4863989f89a726d2d0ee90865b1 Author: TangoCash Date: 2017-07-02 (Sun, 02 Jul 2017) --- src/gui/epgplus.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 05768c541..d1f6b3d5d 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1393,6 +1393,13 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } + + if (this->selectedChannelEntry->detailsLine) { + this->selectedChannelEntry->detailsLine->kill(); + delete this->selectedChannelEntry->detailsLine; + this->selectedChannelEntry->detailsLine = NULL; + } + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } From d47de206b469d8354029a539870957f004cd6dbe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2017 22:02:50 +0200 Subject: [PATCH 06/14] audioplayer: don't scale covers to quadrat-dimensions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/99a6c9e1ee6ac043e929928ed48cfc1ea51b44b0 Author: vanhofen Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ - audioplayer: don't scale covers to quadrat-dimensions --- src/gui/audioplayer.cpp | 32 +++++++++++++++++++++----------- src/gui/audioplayer.h | 1 + 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 80d243633..501e01171 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -306,6 +306,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_meta_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_title_height = 3*OFFSET_INNER_SMALL + 2*m_item_height + m_meta_height; + m_cover_width = 0; m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); @@ -1790,7 +1791,19 @@ void CAudioPlayerGui::paintCover() if (access(cover.c_str(), F_OK) == 0) { - g_PicViewer->DisplayImage(cover, m_x + OFFSET_INNER_MID, m_y + OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_frameBuffer->TM_NONE); + int cover_x = m_x + OFFSET_INNER_MID; + int cover_y = m_y + OFFSET_INNER_SMALL; + m_cover_width = 0; + CComponentsPicture *cover_object = new CComponentsPicture(cover_x, cover_y, cover); + if (cover_object) + { + cover_object->doPaintBg(false); + cover_object->SetTransparent(CFrameBuffer::TM_BLACK); + cover_object->setHeight(m_title_height - 2*OFFSET_INNER_SMALL, true); + cover_object->paint(); + + m_cover_width = cover_object->getWidth() + OFFSET_INNER_MID; + } /* Some guys use this covers for the screensaver. @@ -1843,13 +1856,11 @@ void CAudioPlayerGui::paintTitleBox() tmp += sNr ; } - // FIXME - there's no cover-check; so we maybe paint over the cover - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); int xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //caption "current track" + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //caption "current track" // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1872,9 +1883,9 @@ void CAudioPlayerGui::paintTitleBox() } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //artist - title + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //artist - title // reset so fields get painted always m_metainfo.clear(); @@ -2224,8 +2235,7 @@ void CAudioPlayerGui::updateMetaData() if (updateMeta || updateScreen) { - int cover_width = m_title_height + 2*OFFSET_INNER_MID; - m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, m_titlebox->getColorBody()); + m_frameBuffer->paintBoxRel(m_x + OFFSET_INNER_MID + m_cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - 2*OFFSET_INNER_MID - m_cover_width, m_meta_height, m_titlebox->getColorBody()); int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo); int xstart = (m_width - w)/2; diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 03544b51e..068a412eb 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -98,6 +98,7 @@ class CAudioPlayerGui : public CMenuTarget int m_meta_height; int m_button_height; int m_title_height; + int m_cover_width; int m_info_height; int m_key_level; bool m_visible; From a6f3cf3e94bed51291e70e9269339f5509287bdc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2017 22:02:50 +0200 Subject: [PATCH 07/14] moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/14c137b8ac47a16950a123f79b9d4e7104d45cfd Author: vanhofen Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ - moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens --- src/gui/moviebrowser/mb.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f4fb03b52..64d4ecfc6 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1344,8 +1344,8 @@ bool CMovieBrowser::getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist) { flist.clear(); mlist.clear(); - P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; + P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; if (m_windowFocus == MB_FOCUS_LAST_PLAY) handle_list = &m_vHandlePlayList; if (m_windowFocus == MB_FOCUS_LAST_RECORD) @@ -2584,18 +2584,26 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; + getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); + if (cursor_only || (filelist.empty() || movielist.empty())) { + printf("CMovieBrowser::onDelete(%s) clearing the lists\n", cursor_only ? "true" : "false"); + filelist.clear(); movielist.clear(); + printf("CMovieBrowser::onDelete(%s) add the m_movieSelectionHandler\n", cursor_only ? "true" : "false"); + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); - } - else - { - getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); } MI_MOVIE_LIST dellist; From fe6f8eb2b2f603a3d22081c551ecb2dc653ca31a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 11:07:30 +0200 Subject: [PATCH 08/14] epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/36a1a146fc4972537f0485e10a9ca007446baaef Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. --- src/driver/rcinput.cpp | 4 ++-- src/driver/scanepg.cpp | 5 +++-- src/neutrino.cpp | 2 ++ src/system/settings.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 657a2a244..cbaab0987 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -469,7 +469,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) _newtimer.correct_time = correct_time; -//printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); +printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); std::vector::iterator e; for ( e= timers.begin(); e!= timers.end(); ++e ) @@ -482,7 +482,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) void CRCInput::killTimer(uint32_t &id) { -//printf("killing timer %d\n", id); +printf("killing timer %d\n", id); if(id == 0) return; diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index f2bbf6811..40c646468 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -39,7 +39,7 @@ #include #include -#define EPG_RESCAN_TIME (24*60*60) +//#define EPG_RESCAN_TIME (24*60*60) extern CBouquetList * bouquetList; extern CBouquetList * TVfavList; @@ -322,8 +322,9 @@ int CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) void CEpgScan::AddTimer() { if (rescan_timer == 0) - rescan_timer = g_RCInput->addTimer(EPG_RESCAN_TIME*1000ULL*1000ULL, true); + rescan_timer = g_RCInput->addTimer((g_settings.epg_scan_rescan*60*60)*1000ULL*1000ULL, true); INFO("rescan timer id %d", rescan_timer); + INFO("rescan time is %d*60*60", g_settings.epg_scan_rescan); } void CEpgScan::EnterStandby() diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e36301450..7339be97c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -632,6 +632,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_scan = CEpgScan::SCAN_CURRENT; g_settings.epg_scan_mode = CEpgScan::MODE_OFF; } + g_settings.epg_scan_rescan = configfile.getInt32("epg_scan_rescan", 24); g_settings.epg_save_mode = configfile.getInt32("epg_save_mode", 0); //widget settings g_settings.widget_fade = false; @@ -1369,6 +1370,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); + configfile.setInt32("epg_scan_rescan", g_settings.epg_scan_rescan); configfile.setInt32("epg_save_mode", g_settings.epg_save_mode); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache ); configfile.setInt32("epg_extendedcache_time" ,g_settings.epg_extendedcache); diff --git a/src/system/settings.h b/src/system/settings.h index d0a1e0951..41165e531 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -305,6 +305,7 @@ struct SNeutrinoSettings std::string epg_dir; int epg_scan; int epg_scan_mode; + int epg_scan_rescan; int epg_save_mode; int epg_search_history_size; From dac472f809abbb2df798dcaa61cf63a0eced7938 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 2 Jul 2017 19:11:27 +0200 Subject: [PATCH 09/14] fix epgplus detailsline hide bug (thx dbo) Signed-off-by: Thilo Graf dline was not removed after called epg info. btw. Small request: It would be nice if a short brief justification would be included. That would be make some things easier to track and saves unnecessary questions. Thx! Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7e196c58ad5d1906fcb2edceba5c740a0d676a5 Author: TangoCash Date: 2017-07-02 (Sun, 02 Jul 2017) --- src/gui/epgplus.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bcece667b..9bdc9c69b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1393,6 +1393,13 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } + + if (this->selectedChannelEntry->detailsLine) { + this->selectedChannelEntry->detailsLine->kill(); + delete this->selectedChannelEntry->detailsLine; + this->selectedChannelEntry->detailsLine = NULL; + } + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } From e9fbf6c816cb7740ecdd63a47492baf10f03e49f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Jul 2017 10:50:20 +0200 Subject: [PATCH 10/14] CLocaleManager: add casted version of getText() function Allows easier handling with strings instead const char for usage as string source. Separate casts are not requiered. Overload of getText() was not possible but, name getTextAsString() is keeping namespace of base function getText(). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aa66b84c1346c32832b1b4bd17e48eb6880c15e Author: Thilo Graf Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ CLocaleManager: add casted version of getText() function Allows easier handling with strings instead const char for usage as string source. Separate casts are not requiered. Overload of getText() was not possible but, name getTextAsString() is keeping namespace of base function getText(). --- src/system/localize.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system/localize.h b/src/system/localize.h index b12b430fd..0794ff499 100644 --- a/src/system/localize.h +++ b/src/system/localize.h @@ -69,6 +69,7 @@ class CLocaleManager loadLocale_ret_t loadLocale(const char * const locale, bool asdefault = false); const char * getText(const neutrino_locale_t keyName) const; + std::string getTextAsString(const neutrino_locale_t keyName) const {return (static_cast(getText(keyName)));} static neutrino_locale_t getMonth (const struct tm * struct_tm_p); static neutrino_locale_t getMonth (const int mon); From 59842a764e4908436327ea683e53df2e4980df41 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 12:07:33 +0200 Subject: [PATCH 11/14] audioplayer: don't scale covers to quadrat-dimensions Signed-off-by: Thilo Graf # Conflicts: # src/gui/audioplayer.cpp Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dd193140009b5683b479d68d5ce184f887d1a30d Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - audioplayer: don't scale covers to quadrat-dimensions Signed-off-by: Thilo Graf # Conflicts: # src/gui/audioplayer.cpp --- src/gui/audioplayer.cpp | 34 +++++++++++++++++++++++----------- src/gui/audioplayer.h | 1 + 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 6596d959b..03edd14c6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -296,6 +296,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_meta_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_title_height = 3*OFFSET_INNER_SMALL + 2*m_item_height + m_meta_height; + m_cover_width = 0; m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); @@ -1700,7 +1701,21 @@ void CAudioPlayerGui::paintCover() cover = meta.cover; if (access(cover.c_str(), F_OK) == 0) - g_PicViewer->DisplayImage(cover, m_x + OFFSET_INNER_MID, m_y + OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_frameBuffer->TM_NONE); + { + int cover_x = m_x + OFFSET_INNER_MID; + int cover_y = m_y + OFFSET_INNER_SMALL; + m_cover_width = 0; + CComponentsPicture *cover_object = new CComponentsPicture(cover_x, cover_y, cover); + if (cover_object) + { + cover_object->doPaintBg(false); + cover_object->SetTransparent(CFrameBuffer::TM_BLACK); + cover_object->setHeight(m_title_height - 2*OFFSET_INNER_SMALL, true); + cover_object->paint(); + + m_cover_width = cover_object->getWidth() + OFFSET_INNER_MID; + } + } } void CAudioPlayerGui::paintTitleBox() @@ -1742,13 +1757,11 @@ void CAudioPlayerGui::paintTitleBox() tmp += sNr ; } - // FIXME - there's no cover-check; so we maybe paint over the cover - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); int xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //caption "current track" + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //caption "current track" // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1771,9 +1784,9 @@ void CAudioPlayerGui::paintTitleBox() } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //artist - title + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //artist - title // reset so fields get painted always m_metainfo.clear(); @@ -2112,8 +2125,7 @@ void CAudioPlayerGui::updateMetaData() if (updateMeta || updateScreen) { - int cover_width = m_title_height + 2*OFFSET_INNER_MID; - m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, m_titlebox->getColorBody()); + m_frameBuffer->paintBoxRel(m_x + OFFSET_INNER_MID + m_cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - 2*OFFSET_INNER_MID - m_cover_width, m_meta_height, m_titlebox->getColorBody()); int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo); int xstart = (m_width - w)/2; diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 8cb914a12..86810d109 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -98,6 +98,7 @@ class CAudioPlayerGui : public CMenuTarget int m_meta_height; int m_button_height; int m_title_height; + int m_cover_width; int m_info_height; int m_key_level; bool m_visible; From 4b9d497a9c70af0b62946664d83ca8e0d6cd4efc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2017 22:02:50 +0200 Subject: [PATCH 12/14] moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f191f0730fa2f347b2f3a38cf84127acb084ce51 Author: vanhofen Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ - moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Signed-off-by: Thilo Graf --- src/gui/moviebrowser/mb.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 76161a8f7..86f7d5e51 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1252,8 +1252,8 @@ bool CMovieBrowser::getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist) { flist.clear(); mlist.clear(); - P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; + P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; if (m_windowFocus == MB_FOCUS_LAST_PLAY) handle_list = &m_vHandlePlayList; if (m_windowFocus == MB_FOCUS_LAST_RECORD) @@ -2480,18 +2480,26 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; + getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); + if (cursor_only || (filelist.empty() || movielist.empty())) { + printf("CMovieBrowser::onDelete(%s) clearing the lists\n", cursor_only ? "true" : "false"); + filelist.clear(); movielist.clear(); + printf("CMovieBrowser::onDelete(%s) add the m_movieSelectionHandler\n", cursor_only ? "true" : "false"); + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); - } - else - { - getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); } MI_MOVIE_LIST dellist; From a828c8a32a1b93955ac1771022e30d2936341e14 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 11:07:30 +0200 Subject: [PATCH 13/14] epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/761a2b2e739daec2340f8d0d5a005d4fea699e4a Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. Signed-off-by: Thilo Graf --- src/driver/rcinput.cpp | 4 ++-- src/driver/scanepg.cpp | 5 +++-- src/neutrino.cpp | 2 ++ src/system/settings.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 657a2a244..cbaab0987 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -469,7 +469,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) _newtimer.correct_time = correct_time; -//printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); +printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); std::vector::iterator e; for ( e= timers.begin(); e!= timers.end(); ++e ) @@ -482,7 +482,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) void CRCInput::killTimer(uint32_t &id) { -//printf("killing timer %d\n", id); +printf("killing timer %d\n", id); if(id == 0) return; diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index 586c9023a..7a659feff 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -39,7 +39,7 @@ #include #include -#define EPG_RESCAN_TIME (24*60*60) +//#define EPG_RESCAN_TIME (24*60*60) extern CBouquetList * bouquetList; extern CBouquetList * TVfavList; @@ -322,8 +322,9 @@ int CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) void CEpgScan::AddTimer() { if (rescan_timer == 0) - rescan_timer = g_RCInput->addTimer(EPG_RESCAN_TIME*1000ULL*1000ULL, true); + rescan_timer = g_RCInput->addTimer((g_settings.epg_scan_rescan*60*60)*1000ULL*1000ULL, true); INFO("rescan timer id %d", rescan_timer); + INFO("rescan time is %d*60*60", g_settings.epg_scan_rescan); } void CEpgScan::EnterStandby() diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 10f96a1db..24ed037d0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -579,6 +579,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_scan = CEpgScan::SCAN_CURRENT; g_settings.epg_scan_mode = CEpgScan::MODE_OFF; } + g_settings.epg_scan_rescan = configfile.getInt32("epg_scan_rescan", 24); g_settings.epg_save_mode = configfile.getInt32("epg_save_mode", 0); //widget settings g_settings.widget_fade = false; @@ -1246,6 +1247,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); + configfile.setInt32("epg_scan_rescan", g_settings.epg_scan_rescan); configfile.setInt32("epg_save_mode", g_settings.epg_save_mode); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache ); configfile.setInt32("epg_extendedcache_time" ,g_settings.epg_extendedcache); diff --git a/src/system/settings.h b/src/system/settings.h index 7950a6fa3..9ca4e21d6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -293,6 +293,7 @@ struct SNeutrinoSettings std::string epg_dir; int epg_scan; int epg_scan_mode; + int epg_scan_rescan; int epg_save_mode; int epg_search_history_size; From 6e80613adfac60ea407461a87102c397f22a6ed7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 13:46:45 +0200 Subject: [PATCH 14/14] audioplayer: remove wrong transparency from cover Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb2153d482f40e634d03cb26220d756574834681 Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - audioplayer: remove wrong transparency from cover --- src/gui/audioplayer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 501e01171..4d947b974 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1798,7 +1798,6 @@ void CAudioPlayerGui::paintCover() if (cover_object) { cover_object->doPaintBg(false); - cover_object->SetTransparent(CFrameBuffer::TM_BLACK); cover_object->setHeight(m_title_height - 2*OFFSET_INNER_SMALL, true); cover_object->paint();