From ffd6e7fc7a3af65313f32497a327a8290d8350f2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Jul 2016 15:38:34 +0200 Subject: [PATCH 01/11] src/gui/widget/menue.cpp fix possible heap-buffer-overflow Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5be8af9890a0c6e368203a9ede976518ea29674e Author: Jacek Jendrzej Date: 2016-07-21 (Thu, 21 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 4935cf5bf..607be4f60 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1311,9 +1311,9 @@ void CMenuWidget::paintItems() //Item not currently on screen if (selected >= 0) { - while (selected < page_start[current_page]) + while (current_page > 0 && selected < page_start[current_page]) current_page--; - while (selected >= page_start[current_page + 1]) + while (current_page+1 < page_start.size() && selected >= page_start[current_page + 1]) current_page++; } From 748e7298fec986f59d5c430fb88d2a2165e460ec Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 22 Jul 2016 17:24:39 +0200 Subject: [PATCH 02/11] src/gui/lua/lua_video.cpp fix possible segfault if argument is not a string (nil) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/021db3ab04ec9964dc2a95b3990f2658f8ce97e1 Author: Jacek Jendrzej Date: 2016-07-22 (Fri, 22 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_video.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index c7df7912d..fd25aeda2 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -153,6 +153,23 @@ int CLuaInstVideo::PlayFile(lua_State *L) printf("CLuaInstVideo::%s: not enough arguments (%d, expected 3)\n", __func__, numargs); return 0; } + const char *errmsg = "is not a string."; + if(!lua_isstring(L,2)){ + printf("CLuaInstVideo::%s: argument 1 %s\n", __func__, errmsg); + return 0; + } + if(!lua_isstring(L,3)){ + printf("CLuaInstVideo::%s: argument 2 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 3 && !lua_isstring(L,4)){ + printf("CLuaInstVideo::%s: argument 3 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 4 && !lua_isstring(L,5)){ + printf("CLuaInstVideo::%s: argument 4 %s\n", __func__, errmsg); + return 0; + } bool sp = false; if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) From 9d5a5204655aea5349742afde0ef7819f648d84c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 27 Jul 2016 21:37:58 +0200 Subject: [PATCH 03/11] CMsgBox: ensure repaint of background This fixes "transparent holes", because textbox object is responsible for text. The problem here is that the message box has a fixed width and text box width is not really considered. This should be fixed, but CMsgBox class is used only by CMovieinfo class and this should be enough for the moment. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab7c67d2b05e555ae10495668a935b06f1543727 Author: Thilo Graf Date: 2016-07-27 (Wed, 27 Jul 2016) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 45cffebf6..4f9821ebe 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -619,6 +619,13 @@ void CMsgBox::refresh(void) refreshTitle(); refreshFoot(); + //draw body + m_pcWindow->paintBoxRel( m_cBoxFrameText.iX, + m_cBoxFrameText.iY, + m_cBoxFrameText.iWidth, + m_cBoxFrameText.iHeight, + COL_MENUCONTENT_PLUS_0); + // rep-draw textbox if there is one if(m_pcTextBox != NULL) { @@ -750,7 +757,6 @@ bool CMsgBox::setText(const std::string* newText) // update text in textbox if there is one if(m_pcTextBox != NULL && newText != NULL) { - lresult = m_pcTextBox->setText(newText); if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH) { /* window might changed in size ...*/ @@ -768,6 +774,8 @@ bool CMsgBox::setText(const std::string* newText) m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>1); } } + + lresult = m_pcTextBox->setText(newText); } return(lresult); From d4cb71e80b54acb715bfb7a691b5c91cc0ffcf0e Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 7 Mar 2016 22:56:14 +0100 Subject: [PATCH 04/11] adding Live-TV look alike EPG-Infos in Movieplayer incl. TMDB Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/44ca60eb172e7d02a7849143d2d6022dbc11d0a7 Author: TangoCash Date: 2016-03-07 (Mon, 07 Mar 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 307 ++++++++++++++++++++++++++++++++++++++++ src/gui/epgview.h | 2 + src/gui/infoviewer.cpp | 7 + src/gui/movieplayer.cpp | 6 + 4 files changed, 322 insertions(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 7047ea590..4e80b49cd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -487,6 +487,313 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } +int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_duration, bool doLoop) +{ + int res = menu_return::RETURN_REPAINT; + static uint64_t channel_id = 0; + + if (mp_movie_info == NULL) + return res; + + channel_id = mp_movie_info->epgEpgId >>16; + + epgText.clear(); + + start(); + + tmdbtoggle = false; + stars = 0; + + CComponentsHeader* header = NULL; + CComponentsPicture* headerPic = NULL; + CComponentsText* headerText = NULL; + + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + + if (mp_movie_info->epgTitle.empty()) /* no epg info found */ + { + ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 + hide(); + return res; + } + // Calculate offset for the title when logo appears. + int pic_offx = 0; + std::string lname; + int logo_w = 0; + int logo_h = 0; + int logo_w_max = ox / 4; + if(channel_id) { + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, mp_movie_info->epgChannel, lname, &logo_w, &logo_h)) { + if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); + } + pic_offx = logo_w + 10; + } + } + + int pos; + std::string text1 = mp_movie_info->epgTitle; + std::string text2 = ""; + if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18) + { + do + { + pos = text1.find_last_of("[ .]+"); + if (pos != -1) + text1 = text1.substr(0, pos); + } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18)); + if (mp_movie_info->epgTitle.length() > text1.length()) // shold never be false in this place + text2 = mp_movie_info->epgTitle.substr(text1.length()+ 1, uint(-1) ); + } + + const int pic_h = 39; + + if (!text2.empty()) + toph = 2 * topboxheight; + else + toph = topboxheight; + + toph = std::max(toph, pic_h); + + sb = oy - toph ; + + // 21.07.2005 - rainerk + // Only show info1 if it's not included in info2! + std::string strEpisode = ""; // Episode title in case info1 gets stripped + if (!mp_movie_info->epgInfo1.empty()) { + bool bHide = false; + if (false == mp_movie_info->epgInfo2.empty()) { + // Look for the first . in info1, usually this is the title of an episode. + std::string::size_type nPosDot = mp_movie_info->epgInfo1.find('.'); + if (std::string::npos != nPosDot) { + nPosDot += 2; // Skip dot and first blank + if (nPosDot < mp_movie_info->epgInfo2.length() && nPosDot < mp_movie_info->epgInfo1.length()) { // Make sure we don't overrun the buffer + + // Check if the stuff after the dot equals the beginning of info2 + if (0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1.substr(nPosDot, mp_movie_info->epgInfo1.length() - nPosDot))) { + strEpisode = mp_movie_info->epgInfo1.substr(0, nPosDot) + "\n"; + bHide = true; + } + } + } + // Compare strings normally if not positively found to be equal before + if (false == bHide && 0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1)) { + bHide = true; + } + } + if (false == bHide) { + processTextToArray(mp_movie_info->epgInfo1); + } + } + + info1_lines = epgText.size(); + + //scan epg-data - sort to list + if ((mp_movie_info->epgInfo2.empty()) && (info1_lines == 0)) + processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8 + else + processTextToArray(strEpisode + mp_movie_info->epgInfo2); + + // Add a blank line + processTextToArray(""); + + // Show FSK information + if (mp_movie_info->parentalLockAge > 0) + { + char fskInfo[4]; + sprintf(fskInfo, "%d", mp_movie_info->parentalLockAge); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AGE_RATING)) + ": " + fskInfo); // UTF-8 + } + + // Show length information + char lengthInfo[11]; + sprintf(lengthInfo, "%d", mp_movie_info->length); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 + + // Show audio information + std::string audioInfo = ""; + std::vector tags = mp_movie_info->audioPids; + if (tags.size()) + { + for (unsigned int i = 0; i < tags.size(); i++) + if (!tags[i].epgAudioPidName.empty()) + audioInfo += tags[i].epgAudioPidName + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } + } + + // Show genre information +#ifdef FULL_CONTENT_CLASSIFICATION + if (!mp_movie_info->genreMajor.empty()) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor[0])); // UTF-8 +// processTextToArray( epgData.userClassification.c_str() ); +#else + if (mp_movie_info->genreMajor) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor)); // UTF-8 +#endif + + COSDFader fader(g_settings.theme.menu_Content_alpha); + fader.StartFadeIn(); + + //show the epg + // header + logo + int header_h = std::max(toph, logo_h); + header = new CComponentsHeader(sx, sy, ox, header_h); + if (pic_offx > 0) { + headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); + headerPic->doPaintBg(false); + } + std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; + headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + headerText->doPaintBg(false); + headerText->setTextColor(COL_MENUHEAD_TEXT); + header->paint(CC_SAVE_SCREEN_NO); + headerText->paint(CC_SAVE_SCREEN_NO); + if (headerPic) + headerPic->paint(CC_SAVE_SCREEN_NO); + + int showPos = 0; + textCount = epgText.size(); + showText(showPos, sy + toph); + + // show Button + const struct button_label Button[] = + { + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } + }; + int icol_w, icol_h; + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + int h = std::max(fh, icol_h+4); + int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + ::paintButtons(sx + 10, sy+oy, 0, 1, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + +#if 0 + //show progressbar + epg_done = mp_position/mp_duration*100; + if ( epg_done > 0 ) + { + int pbx = sx + 10 /*+ widthl */+ 10 + ((ox-104/*-widthr-widthl*/-10-10-20)>>1); + CProgressBar pb(pbx, sy+oy-height, 104, height-6); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } +#endif + + frameBuffer->blit(); + if ( doLoop ) + { + neutrino_msg_t msg = 0; + neutrino_msg_data_t data = 0; + + int scrollCount = 0; + + bool loop = true; + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + scrollCount = medlinecount; + + switch ( msg ) + { + case CRCInput::RC_down: + if (showPos+scrollCountepgTitle); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; + } else { + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); + } + break; + } + + case CRCInput::RC_help: + case CRCInput::RC_ok: + case CRCInput::RC_timeout: + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + break; + + default: + // konfigurierbare Keys handlen... + if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + } + else + { + if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + { + loop = false; + res = menu_return::RETURN_EXIT_ALL; + } + } + } + frameBuffer->blit(); + } + hide(); + fader.StopFade(); + } + if (headerPic) + delete headerPic; + if (headerText) + delete headerText; + if (header) + delete header; + + return res; +} + int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 4375eebc5..e7fcc1aad 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -39,6 +39,7 @@ #include #include +#include #include "widget/menue.h" #include @@ -99,6 +100,7 @@ class CEpgData ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); + int show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position = 1, int mp_duration = 1, bool doLoop = true); void hide(); }; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f0f52151c..b65d2293b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1029,6 +1029,13 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fileplay) + { + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f6576ed0e..a254e4e0b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1527,6 +1527,12 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fromInfoviewer) + { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else callInfoViewer(); update_lcd = true; clearSubtitle(); From dc320bae792c546ef448332cca4c1fa5b6038af4 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 8 Mar 2016 20:58:33 +0100 Subject: [PATCH 05/11] urgent fix for last commit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/98640e1b1f63838fe8233f9f08fc5f827ad4a212 Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4e80b49cd..4ee53b58e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -708,6 +708,14 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura switch ( msg ) { + case NeutrinoMessages::EVT_TIMER: + if(data == fader.GetFadeTimer()) { + if(fader.FadeDone()) + loop = false; + } + else + CNeutrinoApp::getInstance()->handleMsg(msg, data); + break; case CRCInput::RC_down: if (showPos+scrollCount Date: Tue, 8 Mar 2016 23:45:33 +0100 Subject: [PATCH 06/11] add option to replace EPG Info with tmdb Info - be careful Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7aa3656b1496d01cdbeeb3d6160df0c8bb777aa5 Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 15 +++++++++++++-- src/gui/tmdb.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4ee53b58e..aaca3e69e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -491,6 +491,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura { int res = menu_return::RETURN_REPAINT; static uint64_t channel_id = 0; + std::string tmdb_str = ""; if (mp_movie_info == NULL) return res; @@ -503,6 +504,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura tmdbtoggle = false; stars = 0; + tmdb_str = mp_movie_info->epgInfo2; CComponentsHeader* header = NULL; CComponentsPicture* headerPic = NULL; @@ -663,6 +665,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura // show Button const struct button_label Button[] = { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } }; int icol_w, icol_h; @@ -671,7 +674,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura int h = std::max(fh, icol_h+4); int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(sx + 10, sy+oy, 0, 1, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 //show progressbar @@ -741,6 +744,9 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura epgText_saved = epgText; epgText.clear(); tmdbtoggle = !tmdbtoggle; + tmdb_str = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); textCount = epgText.size(); stars = tmdb->getStars(); @@ -758,7 +764,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura } break; } - + case CRCInput::RC_red: + { + if (tmdbtoggle) { + mp_movie_info->epgInfo2 = tmdb_str; + } + } case CRCInput::RC_help: case CRCInput::RC_ok: case CRCInput::RC_timeout: diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index 0c4a45448..d9f8929d6 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -74,6 +74,7 @@ class cTmdb std::string getReleaseDate() { return minfo.release_date;} std::string getDescription() { return minfo.overview;} std::string getVote() { return minfo.vote_average;} + std::string getCast() { return minfo.cast;} bool hasCover() { return !minfo.poster_path.empty();} bool getBigCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w342" + minfo.poster_path, cover);} bool getSmallCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w185" + minfo.poster_path, cover);} From e6db442ed0f6cdf2cb8fc6f1db04f3e739de7f7d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 28 Jul 2016 15:17:01 +0200 Subject: [PATCH 07/11] fix compil warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e681ca2b044fbd86b0ae8a0eef60d57ce219f339 Author: Jacek Jendrzej Date: 2016-07-28 (Thu, 28 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index aaca3e69e..885f97380 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -487,7 +487,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } -int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_duration, bool doLoop) +int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*mp_duration*/, bool doLoop) { int res = menu_return::RETURN_REPAINT; static uint64_t channel_id = 0; @@ -506,12 +506,10 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura stars = 0; tmdb_str = mp_movie_info->epgInfo2; - CComponentsHeader* header = NULL; + CComponentsHeader* _header = NULL; CComponentsPicture* headerPic = NULL; CComponentsText* headerText = NULL; - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); - if (mp_movie_info->epgTitle.empty()) /* no epg info found */ { ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 @@ -644,7 +642,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura //show the epg // header + logo int header_h = std::max(toph, logo_h); - header = new CComponentsHeader(sx, sy, ox, header_h); + _header = new CComponentsHeader(sx, sy, ox, header_h); if (pic_offx > 0) { headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); @@ -653,7 +651,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); headerText->setTextColor(COL_MENUHEAD_TEXT); - header->paint(CC_SAVE_SCREEN_NO); + _header->paint(CC_SAVE_SCREEN_NO); headerText->paint(CC_SAVE_SCREEN_NO); if (headerPic) headerPic->paint(CC_SAVE_SCREEN_NO); @@ -677,6 +675,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); //show progressbar epg_done = mp_position/mp_duration*100; if ( epg_done > 0 ) @@ -807,8 +806,8 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position, int mp_dura delete headerPic; if (headerText) delete headerText; - if (header) - delete header; + if (_header) + delete _header; return res; } From 461791aaddf440144501a36ec34c51e4b724dbc1 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 8 Mar 2016 23:02:03 +0100 Subject: [PATCH 08/11] fix bigfonts in last commits Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3d91b7040ecf95a5b611377574a1a3daf04c04d Author: TangoCash Date: 2016-03-08 (Tue, 08 Mar 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 885f97380..36847150c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -500,7 +500,15 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m epgText.clear(); - start(); + if (doLoop) + { + if (!bigFonts && g_settings.bigFonts) { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + } + bigFonts = g_settings.bigFonts; + start(); + } tmdbtoggle = false; stars = 0; From 225dc86b489cfdfc0ae6ed9575bd79d33987ad4f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 28 Jul 2016 18:07:10 +0200 Subject: [PATCH 09/11] show epg/tmdb in moviebrowse info modus (yellow->info) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2afb0155c16772b2aea3c31c1860f2ac32220ce Author: Jacek Jendrzej Date: 2016-07-28 (Thu, 28 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 4610e4979..efa8b0f28 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -46,6 +46,7 @@ #include "moviebrowser.h" #include "filebrowser.h" #include +#include #include #include #include @@ -1922,7 +1923,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_movieInfo.showMovieInfo(*m_movieSelectionHandler); + if (m_settings.gui == MB_GUI_MOVIE_INFO && m_windowFocus == MB_FOCUS_MOVIE_INFO) + g_EpgData->show_mp(m_movieSelectionHandler,0,0); + else + m_movieInfo.showMovieInfo(*m_movieSelectionHandler); refresh(); } } From 27ef7161f586fac730ccce464596670108eac9ac Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jul 2016 15:34:41 +0200 Subject: [PATCH 10/11] src/gui/moviebrowser.cpp use one key for delete cover or add tmdb cover Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/51bf5c21952b99d068238ce462b5ed0467f6225b Author: Jacek Jendrzej Date: 2016-07-29 (Fri, 29 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 72 +++++++++++++++------------------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index efa8b0f28..862d68763 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1849,11 +1849,33 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()){ + //delete Cover + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + unlink(fname.c_str()); + refresh(); + } + }else { + //add TMDB Cover + fname = m_movieSelectionHandler->file.Name.c_str(); + int ext_pos = 0; + ext_pos = fname.rfind('.'); + if( ext_pos > 0) { + std::string extension; + extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = "." + extension; + strReplace(fname, extension.c_str(), ".jpg"); + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); + if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { + if (!fname.empty()) + if (tmdb->getSmallCover(fname)) + refresh(); + } + if (tmdb) + delete tmdb; + } } } } @@ -2006,46 +2028,6 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } - else if (msg == CRCInput::RC_favorites) - { - if (m_movieSelectionHandler != NULL) { -#if 0 - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } -#else - std::string fname = m_movieSelectionHandler->file.Name.c_str(); - int ext_pos = 0; - ext_pos = fname.rfind('.'); - if( ext_pos > 0) { - std::string extension; - extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); - extension = "." + extension; - strReplace(fname, extension.c_str(), ".jpg"); - } - printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); - if (!access(fname, F_OK)) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } - } else { - cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); - if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { - if (!fname.empty()) - if (tmdb->getSmallCover(fname)) - refresh(); - } - if (tmdb) - delete tmdb; - } -#endif - } - } else { //TRACE("[mb]->onButtonPressMainFrame none\n"); From b1998476ba301cc55c7966008e5662e709f00fe4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jul 2016 17:00:29 +0200 Subject: [PATCH 11/11] dont use tmdb if api key not defined Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86cea031aded11db1bb00f1baf958409b49e6b77 Author: Jacek Jendrzej Date: 2016-07-29 (Fri, 29 Jul 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 93 +++++++++++++++++++++------------------- src/gui/moviebrowser.cpp | 2 +- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 36847150c..409b8a766 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -680,7 +680,8 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m int h = std::max(fh, icol_h+4); int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); #if 0 int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); @@ -744,36 +745,40 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m case CRCInput::RC_info: { - showPos = 0; - if (!tmdbtoggle) { - cTmdb* tmdb = new cTmdb(mp_movie_info->epgTitle); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - tmdb_str = tmdb->getDescription(); - if (!tmdb->getCast().empty()) - tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + showPos = 0; + if (!tmdbtoggle) { + cTmdb* tmdb = new cTmdb(mp_movie_info->epgTitle); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + tmdb_str = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); } break; } case CRCInput::RC_red: { - if (tmdbtoggle) { + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + break; + else if (tmdbtoggle) { mp_movie_info->epgInfo2 = tmdb_str; } } @@ -1291,27 +1296,29 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_info: { - showPos = 0; - if (!tmdbtoggle) { - cTmdb* tmdb = new cTmdb(epgData.title); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + showPos = 0; + if (!tmdbtoggle) { + cTmdb* tmdb = new cTmdb(epgData.title); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); } break; } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 862d68763..2c6356133 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1856,7 +1856,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) unlink(fname.c_str()); refresh(); } - }else { + }else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ //add TMDB Cover fname = m_movieSelectionHandler->file.Name.c_str(); int ext_pos = 0;