From ff3e6fd94982de4d191d68f222f2328af0bf32e8 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 2 Jul 2017 19:11:27 +0200 Subject: [PATCH 1/5] 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 ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7e196c58ad5d1906fcb2edceba5c740a0d676a5 Author: TangoCash Date: 2017-07-02 (Sun, 02 Jul 2017) ------------------ This commit was generated by Migit --- 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 54da8c572fb9deee6b824d7eac57ffdf87d5e674 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Jul 2017 10:50:20 +0200 Subject: [PATCH 2/5] 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 ------------------ Branch: ni/coolstream 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(). ------------------ This commit was generated by Migit --- 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 05d63ab5bc1c0f22b030764426af49e25bffd873 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 12:07:33 +0200 Subject: [PATCH 3/5] audioplayer: don't scale covers to quadrat-dimensions Signed-off-by: Thilo Graf # Conflicts: # src/gui/audioplayer.cpp Origin commit data ------------------ Branch: ni/coolstream 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 ------------------ This commit was generated by Migit --- 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 3533a3bb8acc86845017b286c9d29dd45ca763b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2017 22:02:50 +0200 Subject: [PATCH 4/5] moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream 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 ------------------ This commit was generated by Migit --- 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 5820d8a8a00521ae523b1c43f3ae65dcc7693855 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 11:07:30 +0200 Subject: [PATCH 5/5] 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 ------------------ Branch: ni/coolstream 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 ------------------ This commit was generated by Migit --- 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;