From 766c4fd9c85f21787c06881f5087c1bfaff743a6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 9 Aug 2016 14:13:19 +0200 Subject: [PATCH] - epgview: add extended movie info; code from movieinfo.cpp comment out unused showMovieInfo() in movieinfo.cpp --- src/gui/epgview.cpp | 152 +++++++++++++++++++++++++++++++++++---- src/gui/epgview.h | 1 + src/gui/moviebrowser.cpp | 6 +- src/gui/movieinfo.cpp | 3 +- src/gui/movieinfo.h | 2 + src/gui/movieplayer.cpp | 2 +- 6 files changed, 145 insertions(+), 21 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9d8f6deb7..df2818164 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -529,7 +529,121 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*m #else epgData.contentClassification = 0; #endif - epgData.epg_times.dauer = mp_movie_info->length; + epgData.epg_times.dauer = mp_movie_info->length * 60; // we need the seconds + + extMovieInfo.clear(); + if ( !mp_movie_info->productionCountry.empty() || mp_movie_info->productionDate != 0) + { + extMovieInfo += mp_movie_info->productionCountry; + extMovieInfo += to_string(mp_movie_info->productionDate + 1900); + extMovieInfo += "\n"; + } + if (!mp_movie_info->serieName.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SERIE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->serieName; + extMovieInfo += "\n"; + } + if (!mp_movie_info->epgChannel.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->epgChannel; + extMovieInfo += "\n"; + } + if (mp_movie_info->rating != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RATING); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->rating / 10); + extMovieInfo += ","; + extMovieInfo += to_string(mp_movie_info->rating % 10); + extMovieInfo += "/10"; + extMovieInfo += "\n"; + } + if (mp_movie_info->quality != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->quality); + extMovieInfo += "\n"; + } + if (mp_movie_info->parentalLockAge != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->parentalLockAge); + extMovieInfo += " "; + extMovieInfo += g_Locale->getText(LOCALE_UNIT_LONG_YEARS); + extMovieInfo += "\n"; + } + if (!mp_movie_info->audioPids.empty()) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); + extMovieInfo += ": "; + for (unsigned int i = 0; i < mp_movie_info->audioPids.size(); i++) + { + if (i) + extMovieInfo += ", "; + extMovieInfo += mp_movie_info->audioPids[i].epgAudioPidName; + } + extMovieInfo += "\n"; + } + if (mp_movie_info->genreMajor != 0) + { + neutrino_locale_t locale_genre; + unsigned char i = (mp_movie_info->genreMajor & 0x0F0); + if (i >= 0x010 && i < 0x0B0) + { + i >>= 4; + i--; + locale_genre = genre_sub_classes_list[i][((mp_movie_info->genreMajor & 0x0F) < genre_sub_classes[i]) ? (mp_movie_info->genreMajor & 0x0F) : 0]; + } + else + locale_genre = LOCALE_GENRE_UNKNOWN; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); + extMovieInfo += ": "; + extMovieInfo += g_Locale->getText(locale_genre); + extMovieInfo += "\n"; + } + + extMovieInfo += "\n"; + + tm *date_tm = localtime(&mp_movie_info->dateOfLastPlay); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + date_tm = localtime(&mp_movie_info->file.Time); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RECORDDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + extMovieInfo += "\n"; + + if (mp_movie_info->file.Size != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->file.Size >> 20); + extMovieInfo += "\n"; + } + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PATH); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getPath(); + extMovieInfo += "\n"; + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_FILE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getFileName(); + extMovieInfo += "\n"; + res = show(mp_movie_info->epgEpgId >>16, 0, 0, doLoop, false,true ); if(!epgTextSwitch.empty()) mp_movie_info->epgInfo2 = epgTextSwitch; @@ -559,6 +673,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start GetEPGData(epg_id, id, &startzeit); epgTextSwitch.clear(); + if (!mp_info) + extMovieInfo.clear(); if (doLoop) { if (!bigFonts && g_settings.bigFonts) { @@ -664,7 +780,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // Add a blank line processTextToArray(""); - // 21.07.2005 - rainerk // Show extended information if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { @@ -690,20 +805,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start sprintf(lengthInfo, "%d", epgData.epg_times.dauer / 60); processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 - // Show audio information - std::string audioInfo = ""; - CSectionsdClient::ComponentTagList tags; - bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); - if (hasComponentTags) + if (!mp_info) { - for (unsigned int i = 0; i < tags.size(); i++) - if (tags[i].streamContent == 2 && !tags[i].component.empty()) - audioInfo += tags[i].component + ", "; - - if (!audioInfo.empty()) + // Show audio information + std::string audioInfo = ""; + CSectionsdClient::ComponentTagList tags; + bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); + if (hasComponentTags) { - audioInfo.erase(audioInfo.size()-2); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + for (unsigned int i = 0; i < tags.size(); i++) + if (tags[i].streamContent == 2 && !tags[i].component.empty()) + audioInfo += tags[i].component + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } } } @@ -720,13 +838,17 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // -- display more screenings on the same channel // -- 2002-05-03 rasc has_follow_screenings = false; - if (hasFollowScreenings(channel_id, epgData.title)) { + if (!mp_info && hasFollowScreenings(channel_id, epgData.title)) { processTextToArray(""); // UTF-8 processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_MORE_SCREENINGS)) + ':'); // UTF-8 FollowScreenings(channel_id, epgData.title); has_follow_screenings = true; } + // show extended movie info + if (mp_info && !extMovieInfo.empty()) + processTextToArray(extMovieInfo); + COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 1b23af3f3..17b423ffe 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -81,6 +81,7 @@ class CEpgData std::vector epgText; std::vector epgText_saved; std::string epgTextSwitch; + std::string extMovieInfo; int topheight,topboxheight; int buttonheight,botboxheight; int medlineheight,medlinecount; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index b83284a7d..052ceceae 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1949,10 +1949,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - 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); + framebuffer->paintBackground(); //clear whole screen + g_EpgData->show_mp(m_movieSelectionHandler, 0, 0); refresh(); } } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 7b104ba5e..47cb242da 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -395,6 +395,7 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) /************************************************************************ ************************************************************************/ +#if 0 void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) { std::string print_buffer = movie_info.epgInfo1; @@ -818,7 +819,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info #endif return (false); } - +#endif /************************************************************************ ************************************************************************/ diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index c3dfc4040..312557fae 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -202,7 +202,9 @@ class CMovieInfo bool loadMovieInfo(MI_MOVIE_INFO* movie_info, CFile* file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead bool encodeMovieInfoXml(std::string* extMessage, MI_MOVIE_INFO * movie_info); // encode the movie_info structure to xml string bool saveMovieInfo(MI_MOVIE_INFO& movie_info, CFile* file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead +#if 0 void showMovieInfo(MI_MOVIE_INFO& movie_info); // open a Hintbox and show the movie info +#endif void printDebugMovieInfo(MI_MOVIE_INFO& movie_info); // print movie info on debug channel (RS232) bool addNewBookmark(MI_MOVIE_INFO* movie_info,MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 42d127be8..b72b52559 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2160,7 +2160,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); } else if (p_movie_info) - cMovieInfo.showMovieInfo(*p_movie_info); + g_EpgData->show_mp(p_movie_info,0,0); CInfoClock::getInstance()->enableInfoClock(true); if (restore) {