From af1670252d8008a2c8be1a4b4fa40c3d370d8acc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 29 Oct 2016 10:00:25 +0200 Subject: [PATCH 01/24] textbox: add member to get background-radius Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3f28e50c843d437039baffbdf5916ae300793bd0 Author: vanhofen Date: 2016-10-29 (Sat, 29 Oct 2016) Origin message was: ------------------ - textbox: add member to get background-radius ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index cb5f26a24..d2213db78 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -204,6 +204,7 @@ class CTextBox : public sigc::trackable inline int getLines(void) {return(m_nNrOfLines);}; inline int getLinesPerPage(void) {return m_nLinesPerPage;}; inline int getPages(void) {return(m_nNrOfPages);}; + inline int getBackGroundRadius(void) {return(m_nBgRadius);}; inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;}; int getFontTextHeight(); inline int getTextMode() {return m_nMode;}; From ced4fd201e6b7c59ef05b37114d2ec52688cfec7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 29 Oct 2016 10:01:24 +0200 Subject: [PATCH 02/24] listframe: add some needed get-members Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7f76b0dd98580af7bf810565f2c4f5d2080bbfc Author: vanhofen Date: 2016-10-29 (Sat, 29 Oct 2016) Origin message was: ------------------ - listframe: add some needed get-members ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/listframe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index 95c3b53e3..97fc72ca9 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -152,6 +152,9 @@ class CListFrame inline CBox getWindowsPos(void) {return(m_cFrame);}; inline int getSelectedLine(void) {return(m_nSelectedLine);}; +inline int getSelectedLineRel(void) {return(m_nSelectedLine - m_nLinesPerPage*m_nCurrentPage);}; +inline int getTitleHeight(void) {return(m_cFrameTitleRel.iHeight);}; +inline int getHeaderListHeight(void) {return(m_cFrameHeaderListRel.iHeight);}; inline int getLines(void) {return(m_nNrOfLines);}; inline int getPages(void) {return(m_nNrOfPages);}; inline void showSelection(bool show) {m_showSelection = show;refreshLine(m_nSelectedLine);}; From dded0065cb18491b6991973b9be0aad07507cbd3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 29 Oct 2016 10:02:07 +0200 Subject: [PATCH 03/24] moviebrowser: allow channellist-design in moviebrowser Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/142ae901b0b44ac062c84e47d120888d72752068 Author: vanhofen Date: 2016-10-29 (Sat, 29 Oct 2016) Origin message was: ------------------ - moviebrowser: allow channellist-design in moviebrowser ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 542 +++++++++++++++++++++++--------- src/gui/moviebrowser/mb.h | 28 +- src/gui/moviebrowser/mb_types.h | 7 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 7 files changed, 415 insertions(+), 166 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cac819112..c873db44a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1634,6 +1634,7 @@ moviebrowser.book_position Position: moviebrowser.book_type Sprung (<0 zurück, >0 vor): moviebrowser.book_type_backward Wiederholung moviebrowser.book_type_forward Überspringen +moviebrowser.browser_additional Zusätzliche Informationen moviebrowser.browser_frame_high Anzeigehöhe oberes Fenster [%] moviebrowser.browser_row_head Spalten Einstellungen moviebrowser.browser_row_item Spalteninfo diff --git a/data/locale/english.locale b/data/locale/english.locale index c2b581deb..9fc0c5efb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1634,6 +1634,7 @@ moviebrowser.book_position Position: moviebrowser.book_type Jump (<0 back , >0 for): moviebrowser.book_type_backward Repeat moviebrowser.book_type_forward jump over +moviebrowser.browser_additional Additional informations moviebrowser.browser_frame_high Browser height [%] moviebrowser.browser_row_head Row settings moviebrowser.browser_row_item Row item diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 452463f25..06592472f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -255,11 +255,14 @@ CMovieBrowser::~CMovieBrowser() clearListLines(); - if (CChannelLogo) - delete CChannelLogo; + if (m_detailsLine) + delete m_detailsLine; - if (pic) - delete pic; + if (m_channelLogo) + delete m_channelLogo; + + if (m_movieCover) + delete m_movieCover; } void CMovieBrowser::clearListLines() @@ -324,9 +327,9 @@ void CMovieBrowser::init(void) m_pcBrowser = NULL; m_pcLastPlay = NULL; m_pcLastRecord = NULL; - m_pcInfo = NULL; + m_pcInfo1 = NULL; + m_pcInfo2 = NULL; m_pcFilter = NULL; - pic = NULL; m_windowFocus = MB_FOCUS_BROWSER; m_textTitle = g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD); @@ -406,7 +409,10 @@ void CMovieBrowser::init(void) filelist_it = filelist.end(); movielist.clear(); - CChannelLogo = NULL; + m_detailsLine = NULL; + m_channelLogo = NULL; + m_movieCover = NULL; + old_EpgId = 0; m_doRefresh = false; m_doLoadMovies = false; @@ -470,6 +476,8 @@ void CMovieBrowser::initGlobalSettings(void) m_settings.browserRowWidth[7] = m_defaultRowWidth[m_settings.browserRowItem[7]]; m_settings.browserRowWidth[8] = m_defaultRowWidth[m_settings.browserRowItem[8]]; + m_settings.browserAdditional = 0; + m_settings.ts_only = 1; m_settings.ytmode = cYTFeedParser::MOST_POPULAR; m_settings.ytorderby = cYTFeedParser::ORDERBY_PUBLISHED; @@ -503,33 +511,42 @@ void CMovieBrowser::initFrames(void) m_cBoxFrameBrowserList.iX = m_cBoxFrame.iX; m_cBoxFrameBrowserList.iY = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iHeight; - m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth; + if (m_settings.browserAdditional) + m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth / 3 * 2; + else + m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth; m_cBoxFrameBrowserList.iHeight = m_cBoxFrame.iHeight * m_settings.browserFrameHeight / 100; - m_cBoxFrameFootRel.iX = 0; + + m_cBoxFrameFootRel.iX = m_cBoxFrameBrowserList.iX; m_cBoxFrameFootRel.iHeight = refreshFoot(false); - m_cBoxFrameFootRel.iY = m_cBoxFrame.iHeight - m_cBoxFrameFootRel.iHeight; - m_cBoxFrameFootRel.iWidth = m_cBoxFrameBrowserList.iWidth; + m_cBoxFrameFootRel.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight; + m_cBoxFrameFootRel.iWidth = m_cBoxFrame.iWidth; m_cBoxFrameLastPlayList.iX = m_cBoxFrameBrowserList.iX; m_cBoxFrameLastPlayList.iY = m_cBoxFrameBrowserList.iY ; - m_cBoxFrameLastPlayList.iWidth = (m_cBoxFrameBrowserList.iWidth>>1) - (OFFSET_INTER>>1); + m_cBoxFrameLastPlayList.iWidth = m_cBoxFrame.iWidth / 2; m_cBoxFrameLastPlayList.iHeight = m_cBoxFrameBrowserList.iHeight; - m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth + OFFSET_INTER; + m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth; m_cBoxFrameLastRecordList.iY = m_cBoxFrameLastPlayList.iY; - m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth - OFFSET_INTER; + m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth; m_cBoxFrameLastRecordList.iHeight = m_cBoxFrameLastPlayList.iHeight; - m_cBoxFrameInfo.iX = m_cBoxFrameBrowserList.iX; - m_cBoxFrameInfo.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight + OFFSET_INTER; - m_cBoxFrameInfo.iWidth = m_cBoxFrameBrowserList.iWidth; - m_cBoxFrameInfo.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - OFFSET_INTER - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight; + m_cBoxFrameInfo1.iX = m_cBoxFrameBrowserList.iX; + m_cBoxFrameInfo1.iY = m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + OFFSET_INTER; + m_cBoxFrameInfo1.iWidth = m_cBoxFrame.iWidth; + m_cBoxFrameInfo1.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - OFFSET_INTER - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight; - m_cBoxFrameFilter.iX = m_cBoxFrameInfo.iX; - m_cBoxFrameFilter.iY = m_cBoxFrameInfo.iY; - m_cBoxFrameFilter.iWidth = m_cBoxFrameInfo.iWidth; - m_cBoxFrameFilter.iHeight = m_cBoxFrameInfo.iHeight; + m_cBoxFrameInfo2.iX = m_cBoxFrameBrowserList.iX + m_cBoxFrameBrowserList.iWidth; + m_cBoxFrameInfo2.iY = m_cBoxFrameBrowserList.iY; + m_cBoxFrameInfo2.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameBrowserList.iWidth; + m_cBoxFrameInfo2.iHeight = m_cBoxFrameBrowserList.iHeight; + + m_cBoxFrameFilter.iX = m_cBoxFrameBrowserList.iX; + m_cBoxFrameFilter.iY = m_cBoxFrameBrowserList.iY; + m_cBoxFrameFilter.iWidth = m_cBoxFrameBrowserList.iWidth; + m_cBoxFrameFilter.iHeight = m_cBoxFrameBrowserList.iHeight; } void CMovieBrowser::initRows(void) @@ -614,6 +631,8 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) settings->browserRowItem[i] = (MB_INFO_ITEM)configfile.getInt32("mb_browserRowItem_" + to_string(i), MB_INFO_MAX_NUMBER); settings->browserRowWidth[i] = configfile.getInt32("mb_browserRowWidth_" + to_string(i), 50); } + settings->browserAdditional = configfile.getInt32("mb_browserAdditional", 0); + settings->ytmode = configfile.getInt32("mb_ytmode", cYTFeedParser::MOST_POPULAR); settings->ytorderby = configfile.getInt32("mb_ytorderby", cYTFeedParser::ORDERBY_PUBLISHED); settings->ytresults = configfile.getInt32("mb_ytresults", 10); @@ -679,6 +698,8 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings) configfile.setInt32("mb_browserRowItem_" + to_string(i), settings->browserRowItem[i]); configfile.setInt32("mb_browserRowWidth_" + to_string(i), settings->browserRowWidth[i]); } + configfile.setInt32("mb_browserAdditional", settings->browserAdditional); + configfile.setInt32("mb_ytmode", settings->ytmode); configfile.setInt32("mb_ytorderby", settings->ytorderby); configfile.setInt32("mb_ytresults", settings->ytresults); @@ -1049,9 +1070,10 @@ int CMovieBrowser::exec(const char* path) void CMovieBrowser::hide(void) { //TRACE("[mb]->%s\n", __func__); - if (CChannelLogo){ - delete CChannelLogo; - CChannelLogo = NULL; + if (m_channelLogo) + { + delete m_channelLogo; + m_channelLogo = NULL; } old_EpgId = 0; framebuffer->paintBackground(); @@ -1078,8 +1100,10 @@ void CMovieBrowser::hide(void) delete m_pcLastRecord; m_pcLastRecord = NULL; - delete m_pcInfo; - m_pcInfo = NULL; + delete m_pcInfo1; + m_pcInfo1 = NULL; + delete m_pcInfo2; + m_pcInfo2 = NULL; } int CMovieBrowser::paint(void) @@ -1103,20 +1127,23 @@ int CMovieBrowser::paint(void) m_pcFilter = new CListFrame(&m_FilterLines, font, CListFrame::SCROLL | CListFrame::TITLE, &m_cBoxFrameFilter, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_FILTER), g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); - m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); + m_pcInfo1 = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo1); + m_pcInfo2 = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo2); if (m_pcBrowser == NULL || m_pcLastPlay == NULL || - m_pcLastRecord == NULL || m_pcInfo == NULL || m_pcFilter == NULL) + m_pcLastRecord == NULL || m_pcInfo1 == NULL || m_pcInfo2 == NULL || m_pcFilter == NULL) { TRACE("[mb] paint, ERROR: not enought memory to allocate windows"); if (m_pcFilter != NULL)delete m_pcFilter; if (m_pcBrowser != NULL)delete m_pcBrowser; if (m_pcLastPlay != NULL) delete m_pcLastPlay; if (m_pcLastRecord != NULL)delete m_pcLastRecord; - if (m_pcInfo != NULL) delete m_pcInfo; + if (m_pcInfo1 != NULL) delete m_pcInfo1; + if (m_pcInfo2 != NULL) delete m_pcInfo2; - m_pcInfo = NULL; + m_pcInfo1 = NULL; + m_pcInfo2 = NULL; m_pcLastPlay = NULL; m_pcLastRecord = NULL; m_pcBrowser = NULL; @@ -1125,6 +1152,12 @@ int CMovieBrowser::paint(void) return (false); } + m_pcInfo1->setBackGroundColor(COL_MENUCONTENTDARK_PLUS_0); + m_pcInfo1->setTextColor(COL_MENUCONTENTDARK_TEXT); + m_pcInfo1->setBackGroundRadius(RADIUS_LARGE); + //m_pcInfo1->setTextBorderWidth(OFFSET_INNER_MID, OFFSET_INNER_SMALL); + m_pcInfo2->setTextBorderWidth(OFFSET_INNER_MID, OFFSET_INNER_SMALL); + clearSelection(); if (m_file_info_stale == true) { loadMovies(); @@ -1170,7 +1203,7 @@ void CMovieBrowser::refresh(void) m_pcLastPlay->refresh(); if (m_pcLastRecord != NULL && m_showLastRecordFiles == true) m_pcLastRecord->refresh(); - if (m_pcInfo != NULL && m_showMovieInfo == true) + if (m_pcInfo1 != NULL && m_pcInfo2 != NULL && m_showMovieInfo == true) refreshMovieInfo(); if (m_pcFilter != NULL && m_showFilter == true) m_pcFilter->refresh(); @@ -1242,113 +1275,261 @@ std::string CMovieBrowser::getScreenshotName(std::string movie, bool is_dir) return ""; } +void CMovieBrowser::refreshChannelLogo(void) +{ + TRACE("[mb]->%s:%d\n", __func__, __LINE__); + + int w_logo_max = m_cBoxFrameTitleRel.iWidth / 4; + short pb_hdd_offset = 100 + OFFSET_INNER_MID; + + if (show_mode == MB_SHOW_YT) + pb_hdd_offset = 0; + + if (m_channelLogo && (old_EpgId != m_movieSelectionHandler->epgId >> 16)) + { + if (newHeader) + m_channelLogo->clearFbData(); // reset logo screen data + else + m_channelLogo->hide(); + delete m_channelLogo; + m_channelLogo = NULL; + } + + if (old_EpgId != m_movieSelectionHandler->epgId >> 16) + { + if (m_channelLogo == NULL) + m_channelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item + old_EpgId = m_movieSelectionHandler->epgId >> 16; + } + + if (m_channelLogo && m_channelLogo->hasLogo()) + { + // scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object + int h_logo = m_channelLogo->getHeight(); + if (h_logo > m_cBoxFrameTitleRel.iHeight) + { + uint8_t ratio = m_cBoxFrameTitleRel.iHeight*100/h_logo; + m_channelLogo->setHeight(m_cBoxFrameTitleRel.iHeight); + int w_logo = ratio*m_channelLogo->getWidth()/100; + m_channelLogo->setWidth(min(w_logo, w_logo_max)); + } + + int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; + int y = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + (m_cBoxFrameTitleRel.iHeight - m_channelLogo->getHeight())/2; + m_channelLogo->setXPos(x - pb_hdd_offset); + m_channelLogo->setYPos(y); + m_channelLogo->hide(); + m_channelLogo->paint(); + newHeader = false; + } +} + +void CMovieBrowser::initMovieCover(void) +{ + TRACE("[mb]->%s:%d\n", __func__, __LINE__); + + CBox movieCoverBox; + + int cover_w = 0; + int cover_h = 0; + + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + { + movieCoverBox = m_cBoxFrameInfo2; + + // we have to align cover to box width + cover_w = movieCoverBox.iWidth - 2*OFFSET_INNER_MID - OFFSET_SHADOW; + + TRACE("[mb]->%s:%d m_windowFocus == MB_FOCUS_BROWSER\n", __func__, __LINE__); + + } + else + { + movieCoverBox = m_cBoxFrameInfo1; + + // we have to align cover to box height + cover_h = movieCoverBox.iHeight - 2*OFFSET_INNER_MID - OFFSET_SHADOW; + + TRACE("[mb]->%s:%d m_windowFocus != MB_FOCUS_BROWSER\n", __func__, __LINE__); + + } + + std::string cover_file; + if (show_mode == MB_SHOW_YT) + { + cover_file = m_movieSelectionHandler->tfile; + } + else + { + cover_file = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if ((cover_file.empty()) && (m_movieSelectionHandler->file.Name.length() > 18)) + { + std::string cover = m_movieSelectionHandler->file.Name; + cover.replace((cover.length()-18), 15, ""); //covername without yyyymmdd_hhmmss + cover_file = getScreenshotName(cover); + } + } + + bool got_cover = !cover_file.empty(); + + if (m_movieCover) + { + if (m_movieCover->getPictureName() != cover_file || !got_cover) + { + delete m_movieCover; + m_movieCover = NULL; + } + } + + if (m_settings.gui != MB_GUI_FILTER && got_cover) + { + if (m_movieCover == NULL) + { + m_movieCover = new CComponentsPicture(0, 0, cover_file, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); + + m_movieCover->enableFrame(true, 1); + m_movieCover->doPaintBg(false); + } + +TRACE("[mb]->%s:%d m_windowFocus: %d\n", __func__, __LINE__, m_windowFocus); + + // always align positions and dimensions + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + { + if (m_movieCover->getWidth() < m_movieCover->getHeight()) + cover_w /= 2; // cover is upright, so we use just half width first + + m_movieCover->setHeight(0); // force recalculation + m_movieCover->setWidth(cover_w, true); + if (m_movieCover->getHeight() > movieCoverBox.iHeight/3) + m_movieCover->setHeight(movieCoverBox.iHeight/3, true); // use maximal one third of box height + + m_movieCover->setXPos(movieCoverBox.iX + (movieCoverBox.iWidth - m_movieCover->getWidth())/2); + m_movieCover->setYPos(movieCoverBox.iY + OFFSET_INNER_MID); + } + else + { + m_movieCover->setWidth(0); // force recalculation +TRACE("[mb]->%s:%d m_movieCover->getWidth(): %d\n", __func__, __LINE__, m_movieCover->getWidth()); + m_movieCover->setHeight(cover_h, true); + + m_movieCover->setXPos(movieCoverBox.iX + movieCoverBox.iWidth - m_movieCover->getWidth() - 2*OFFSET_INNER_MID - OFFSET_SHADOW); + m_movieCover->setYPos(movieCoverBox.iY + (movieCoverBox.iHeight - m_movieCover->getHeight())/2); + } + + if (!m_movieSelectionHandler->epgInfo2.empty()) + { + if (m_pcInfo1->OnAfterScrollPage.empty()) + { + //m_movieCover->enableCache(); + m_pcInfo1->OnAfterScrollPage.connect(sigc::mem_fun(m_movieCover, &CComponentsPicture::paint0)); + } + } + } +} + +void CMovieBrowser::refreshMovieCover(void) +{ + TRACE("[mb]->%s:%d\n", __func__, __LINE__); + + if (m_movieCover) + m_movieCover->paint(CC_SAVE_SCREEN_NO); +} + void CMovieBrowser::refreshMovieInfo(void) { TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, m_vMovieInfo.size()); - //reset text before new init, m_pcInfo must be clean + + hideDetailsLine(); + + //reset text before new init, m_pcInfo1 must be clean std::string emptytext = " "; - m_pcInfo->setText(&emptytext); + m_pcInfo1->setText(&emptytext); + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + { + m_pcInfo1->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]); + + m_pcInfo2->setWindowMaxDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); + m_pcInfo2->setWindowMinDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); + m_pcInfo2->movePosition(m_cBoxFrameInfo2.iX, m_cBoxFrameInfo2.iY); + m_pcInfo2->setText(&emptytext); + } + else + m_pcInfo1->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO]); + if (m_vMovieInfo.empty() || m_movieSelectionHandler == NULL) return; - std::string fname; - if (show_mode == MB_SHOW_YT) { - fname = m_movieSelectionHandler->tfile; - } else { - fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if ((fname.empty()) && (m_movieSelectionHandler->file.Name.length() > 18)) { - std::string cover = m_movieSelectionHandler->file.Name; - cover.replace((cover.length()-18),15,""); //covername without yyyymmdd_hhmmss - fname = getScreenshotName(cover); - } - } - bool logo_ok = (!fname.empty()); - int flogo_w = 0, flogo_h = 0; - if (logo_ok) { - flogo_w = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); - flogo_h = m_cBoxFrameInfo.iHeight*90/100; + refreshChannelLogo(); + + initMovieCover(); + int cover_x_offset = 0; + int cover_y_offset = 0; + if (m_movieCover) + { + cover_x_offset = m_movieCover->getWidth(); + cover_y_offset = m_movieCover->getHeight(); + if (cover_x_offset) + cover_x_offset += 2*OFFSET_INNER_MID; + if (cover_y_offset) + cover_y_offset += 2*OFFSET_INNER_MID; } -// static int logo_w = 0; -// static int logo_h = 0; - int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); - int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; - int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; - short pb_hdd_offset = 104; - if (show_mode == MB_SHOW_YT) - pb_hdd_offset = 0; - - if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgId >>16)) { - if (newHeader) - CChannelLogo->clearFbData(); // reset logo screen data - else - CChannelLogo->hide(); - delete CChannelLogo; - CChannelLogo = NULL; + std::string pcInfo_content; + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + { + m_pcInfo2->setWindowMaxDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight - cover_y_offset); + m_pcInfo2->setWindowMinDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight - cover_y_offset); + m_pcInfo2->movePosition(m_cBoxFrameInfo2.iX, m_cBoxFrameInfo2.iY + cover_y_offset); + m_pcInfo2->setText(&m_movieSelectionHandler->epgInfo2); + pcInfo_content = m_movieSelectionHandler->epgInfo1; + pcInfo_content += "\n"; + pcInfo_content += m_movieSelectionHandler->channelName; } - if (old_EpgId != m_movieSelectionHandler->epgId >>16) { - if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item - old_EpgId = m_movieSelectionHandler->epgId >>16; + else + { + pcInfo_content = m_movieSelectionHandler->epgInfo2; + } + m_pcInfo1->setText(&pcInfo_content, m_cBoxFrameInfo1.iWidth - cover_x_offset); + + updateInfoSelection(); + + refreshMovieCover(); + + if (m_windowFocus == MB_FOCUS_BROWSER) + refreshDetailsLine(m_pcBrowser->getSelectedLineRel()); +} + +void CMovieBrowser::hideDetailsLine() +{ + refreshDetailsLine(-1); +} + +void CMovieBrowser::refreshDetailsLine(int pos) +{ + if (m_detailsLine) + { + m_detailsLine->kill(); + delete m_detailsLine; + m_detailsLine = NULL; } - if (CChannelLogo && CChannelLogo->hasLogo()) { - //scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object - int h_logo = CChannelLogo->getHeight(); - if (h_logo > m_cBoxFrameTitleRel.iHeight){ - uint8_t ratio = m_cBoxFrameTitleRel.iHeight*100/h_logo; - CChannelLogo->setHeight(m_cBoxFrameTitleRel.iHeight); - int w_logo = ratio*CChannelLogo->getWidth()/100; - CChannelLogo->setWidth(min(w_logo, logo_w_max)); - } + if (pos >= 0) + { + int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]->getHeight(); + int hheight = m_pcBrowser->getHeaderListHeight(); + int theight = m_pcBrowser->getTitleHeight(); + int bheight = 8 /*TEXT_BORDER_WIDTH*/; - lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; - ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; - CChannelLogo->setXPos(lx - pb_hdd_offset); - CChannelLogo->setYPos(ly); - CChannelLogo->hide(); - CChannelLogo->paint(); - newHeader = false; + int xpos = m_cBoxFrameBrowserList.iX - ConnectLineBox_Width; + int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + bheight + pos*fheight + (fheight/2); + int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); + + if (m_detailsLine == NULL) + m_detailsLine = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, m_cBoxFrameInfo1.iHeight-2*RADIUS_LARGE); + m_detailsLine->paint(false); } - - if (pic){ - if (pic->getPictureName() != fname || !logo_ok){ - delete pic; pic = NULL; - } - } - - if (m_settings.gui != MB_GUI_FILTER && logo_ok) { - lx = m_cBoxFrameInfo.iX + m_cBoxFrameBrowserList.iWidth - flogo_w -14; - ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; - if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio HD 16/9 - pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); - if (pic->getHeight() < flogo_h/2){ - flogo_h = flogo_h/2; - pic->setYPos(m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2); - } - pic->setHeight(flogo_h, true); - pic->enableFrame(true, 2); - pic->doPaintBg(false); - flogo_w = pic->getWidth(); - pic->setXPos(m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w - 24); - } - - if (!m_movieSelectionHandler->epgInfo2.empty()){ - if (m_pcInfo->OnAfterScrollPage.empty()){ - pic->enableCache(); - m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); - } - } - - } - if (pic) - flogo_w = pic->getWidth(); - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - (flogo_w ? 24 : 0)); - if (pic) - pic->paint(CC_SAVE_SCREEN_NO); } void CMovieBrowser::info_hdd_level(bool paint_hdd) @@ -1694,7 +1875,7 @@ int CMovieBrowser::refreshFoot(bool show) int cnt = sizeof(footerButtons) / sizeof(button_label_ext); if (show) - return paintButtons(footerButtons + offset, cnt - offset, m_cBoxFrame.iX+m_cBoxFrameFootRel.iX, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iWidth, m_cBoxFrameFootRel.iHeight, m_cBoxFrameFootRel.iWidth); + return paintButtons(footerButtons + offset, cnt - offset, m_cBoxFrameFootRel.iX, m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iWidth, m_cBoxFrameFootRel.iHeight, m_cBoxFrameFootRel.iWidth); else return paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } @@ -1712,7 +1893,7 @@ bool CMovieBrowser::onButtonPress(neutrino_msg_t msg) result = onButtonPressLastPlayList(msg); else if (m_windowFocus == MB_FOCUS_LAST_RECORD) result = onButtonPressLastRecordList(msg); - else if (m_windowFocus == MB_FOCUS_MOVIE_INFO) + else if (m_windowFocus == MB_FOCUS_MOVIE_INFO1 || m_windowFocus == MB_FOCUS_MOVIE_INFO2) result = onButtonPressMovieInfoList(msg); else if (m_windowFocus == MB_FOCUS_FILTER) result = onButtonPressFilterList(msg); @@ -1751,32 +1932,32 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { if (m_movieSelectionHandler != NULL) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) + std::string cover_file = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!cover_file.empty()) { //delete Cover if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - unlink(fname.c_str()); + unlink(cover_file.c_str()); refresh(); } } else if (g_settings.tmdb_enabled) { //add TMDB Cover - fname = m_movieSelectionHandler->file.Name.c_str(); + cover_file = m_movieSelectionHandler->file.Name.c_str(); int ext_pos = 0; - ext_pos = fname.rfind('.'); + ext_pos = cover_file.rfind('.'); if( ext_pos > 0) { std::string extension; - extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = cover_file.substr(ext_pos + 1, cover_file.length() - ext_pos); extension = "." + extension; - str_replace(extension, ".jpg", fname); - printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + str_replace(extension, ".jpg", cover_file); + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),cover_file.c_str()); cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { - if (!fname.empty()) - if (tmdb->getSmallCover(fname)) + if (!cover_file.empty()) + if (tmdb->getSmallCover(cover_file)) refresh(); } if (tmdb) @@ -1794,12 +1975,16 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_left) { - if (show_mode != MB_SHOW_YT) + if (m_windowFocus == MB_FOCUS_MOVIE_INFO2 && m_settings.browserAdditional) + onSetFocusNext(); + else if (show_mode != MB_SHOW_YT) onSetGUIWindowPrev(); } else if (msg == CRCInput::RC_right) { - if (show_mode != MB_SHOW_YT) + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + onSetFocusNext(); + else if (show_mode != MB_SHOW_YT) onSetGUIWindowNext(); } else if (msg == CRCInput::RC_green) @@ -2115,12 +2300,20 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) bool result = true; if (msg == CRCInput::RC_up) - m_pcInfo->scrollPageUp(1); + if (m_windowFocus == MB_FOCUS_MOVIE_INFO2 && m_settings.browserAdditional) + m_pcInfo2->scrollPageUp(1); + else + m_pcInfo1->scrollPageUp(1); else if (msg == CRCInput::RC_down) - m_pcInfo->scrollPageDown(1); + if (m_windowFocus == MB_FOCUS_MOVIE_INFO2 && m_settings.browserAdditional) + m_pcInfo2->scrollPageDown(1); + else + m_pcInfo1->scrollPageDown(1); else result = false; + updateInfoSelection(); + return (result); } @@ -2185,9 +2378,9 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) hintBox->paint(); delFile(movieinfo->file); - std::string fname = getScreenshotName(movieinfo->file.Name, S_ISDIR(movieinfo->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); + std::string cover_file = getScreenshotName(movieinfo->file.Name, S_ISDIR(movieinfo->file.Mode)); + if (!cover_file.empty()) + unlink(cover_file.c_str()); CFile file_xml = movieinfo->file; if (m_movieInfo.convertTs2XmlName(file_xml.Name)) @@ -2313,6 +2506,7 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) m_pcBrowser->hide(); m_pcFilter->hide(); + m_pcInfo2->hide(); m_pcLastRecord->paint(); m_pcLastPlay->paint(); @@ -2328,6 +2522,7 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) m_pcBrowser->hide(); m_pcFilter->hide(); + m_pcInfo2->hide(); m_pcLastRecord->paint(); m_pcLastPlay->paint(); @@ -2337,13 +2532,16 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) m_showMovieInfo = false; - m_pcInfo->hide(); + m_pcInfo1->hide(); + m_pcInfo2->hide(); m_pcFilter->paint(); onSetFocus(MB_FOCUS_FILTER); } if (m_showMovieInfo) { - m_pcInfo->paint(); + m_pcInfo1->paint(); + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + m_pcInfo2->paint(); refreshMovieInfo(); } } @@ -2389,6 +2587,7 @@ void CMovieBrowser::onSetFocus(MB_FOCUS new_focus) m_pcFilter->showSelection(true); updateMovieSelection(); + updateInfoSelection(); refreshFoot(); } @@ -2406,23 +2605,26 @@ void CMovieBrowser::onSetFocusNext(void) else if (m_settings.gui == MB_GUI_MOVIE_INFO) { if (m_windowFocus == MB_FOCUS_BROWSER) - onSetFocus(MB_FOCUS_MOVIE_INFO); + if (m_settings.browserAdditional) + onSetFocus(MB_FOCUS_MOVIE_INFO2); + else + onSetFocus(MB_FOCUS_MOVIE_INFO1); else onSetFocus(MB_FOCUS_BROWSER); } else if (m_settings.gui == MB_GUI_LAST_PLAY) { - if (m_windowFocus == MB_FOCUS_MOVIE_INFO) + if (m_windowFocus == MB_FOCUS_MOVIE_INFO1 || m_windowFocus == MB_FOCUS_MOVIE_INFO2) onSetFocus(MB_FOCUS_LAST_PLAY); else if (m_windowFocus == MB_FOCUS_LAST_PLAY) - onSetFocus(MB_FOCUS_MOVIE_INFO); + onSetFocus(MB_FOCUS_MOVIE_INFO1); } else if (m_settings.gui == MB_GUI_LAST_RECORD) { - if (m_windowFocus == MB_FOCUS_MOVIE_INFO) + if (m_windowFocus == MB_FOCUS_MOVIE_INFO1 || m_windowFocus == MB_FOCUS_MOVIE_INFO2) onSetFocus(MB_FOCUS_LAST_RECORD); else if (m_windowFocus == MB_FOCUS_LAST_RECORD) - onSetFocus(MB_FOCUS_MOVIE_INFO); + onSetFocus(MB_FOCUS_MOVIE_INFO1); } } @@ -2760,6 +2962,25 @@ void CMovieBrowser::updateMovieSelection(void) //TRACE("\n"); } +void CMovieBrowser::updateInfoSelection(void) +{ + int col_frame; + int thickness = 2; + int radius = m_pcInfo1->getBackGroundRadius(); + + /* + Maybe we should change background of box + instead of changing frame color. + */ + if (m_windowFocus == MB_FOCUS_MOVIE_INFO1) + col_frame = COL_MENUCONTENTSELECTED_PLUS_2; + else + col_frame = COL_FRAME_PLUS_0; + + // CTextBox can't paint frames, so let's do it "manually" + framebuffer->paintBoxFrame(m_cBoxFrameInfo1.iX, m_cBoxFrameInfo1.iY, m_cBoxFrameInfo1.iWidth, m_cBoxFrameInfo1.iHeight, thickness, col_frame, radius); +} + void CMovieBrowser::updateFilterSelection(void) { //TRACE("[mb]->updateFilterSelection \n"); @@ -3086,6 +3307,7 @@ bool CMovieBrowser::showMenu(bool calledExternally) /** optionsMenuBrowser **************************************************/ int oldRowNr = m_settings.browserRowNr; int oldFrameHeight = m_settings.browserFrameHeight; + int oldAdditional = m_settings.browserAdditional; CIntInput playMaxUserIntInput(LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, (int *)&m_settings.lastPlayMaxItems, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput recMaxUserIntInput(LOCALE_MOVIEBROWSER_LAST_RECORD_MAX_ITEMS, (int *)&m_settings.lastRecordMaxItems, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput browserFrameUserIntInput(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, (int *)&m_settings.browserFrameHeight, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); @@ -3096,6 +3318,7 @@ bool CMovieBrowser::showMenu(bool calledExternally) optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, true, playMaxUserIntInput.getValue(), &playMaxUserIntInput)); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_LAST_RECORD_MAX_ITEMS, true, recMaxUserIntInput.getValue(), &recMaxUserIntInput)); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, true, browserFrameUserIntInput.getValue(), &browserFrameUserIntInput)); + optionsMenuBrowser.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, (int*)(&m_settings.browserAdditional), MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true)); optionsMenuBrowser.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MOVIEBROWSER_BROWSER_ROW_HEAD)); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, true, browserRowNrIntInput.getValue(), &browserRowNrIntInput)); optionsMenuBrowser.addItem(GenericMenuSeparator); @@ -3179,7 +3402,24 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (ts_only != m_settings.ts_only || dirMenu.isChanged()) loadMovies(false); - if (oldRowNr != m_settings.browserRowNr || oldFrameHeight != m_settings.browserFrameHeight) { + bool reInitFrames = ( + m_settings.browserRowNr != oldRowNr + || m_settings.browserFrameHeight != oldFrameHeight + || m_settings.browserAdditional != oldAdditional + ); + + if (reInitFrames) { +#if 1 + if (m_settings.browserAdditional && oldAdditional != m_settings.browserAdditional) + { + /* + Bad 'hack' to force a smaller m_pcInfo1 box. + This can be reconfigured by user later. + It's just to align view to channellist's view. + */ + m_settings.browserFrameHeight = 75; + } +#endif initFrames(); hide(); paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index aefffc146..d996f0d7c 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -96,6 +96,7 @@ typedef struct int browserRowNr; MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; + int browserAdditional; // to be added to config later int lastPlayMaxItems; @@ -144,23 +145,29 @@ class CMovieBrowser : public CMenuTarget private: // Variables CFrameBuffer * framebuffer; - CComponentsPicture *pic; + CListFrame* m_pcBrowser; CListFrame* m_pcLastPlay; CListFrame* m_pcLastRecord; - CTextBox* m_pcInfo; + CTextBox* m_pcInfo1; // bottom box + CTextBox* m_pcInfo2; // right box CListFrame* m_pcFilter; CBox m_cBoxFrame; CBox m_cBoxFrameLastPlayList; CBox m_cBoxFrameLastRecordList; CBox m_cBoxFrameBrowserList; - CBox m_cBoxFrameInfo; + CBox m_cBoxFrameInfo1; + CBox m_cBoxFrameInfo2; CBox m_cBoxFrameBookmarkList; CBox m_cBoxFrameFilter; CBox m_cBoxFrameFootRel; CBox m_cBoxFrameTitleRel; + CComponentsDetailLine *m_detailsLine; + CComponentsChannelLogo *m_channelLogo; + CComponentsPicture *m_movieCover; + LF_LINES m_browserListLines; LF_LINES m_recordListLines; LF_LINES m_playListLines; @@ -214,7 +221,6 @@ class CMovieBrowser : public CMenuTarget CFileList::iterator filelist_it; P_MI_MOVIE_LIST movielist; - CComponentsChannelLogo* CChannelLogo; uint64_t old_EpgId; int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly; @@ -284,10 +290,15 @@ class CMovieBrowser : public CMenuTarget void refreshBrowserList(void); //P1 void refreshFilterList(void); //P1 void refreshMovieInfo(void); //P1 + void refreshChannelLogo(void); //P1 + void initMovieCover(void); //P1 + void refreshMovieCover(void); //P1 int refreshFoot(bool show = true); //P2 void refreshTitle(void); //P2 void refreshInfo(void); // P2 void refreshLCD(void); // P2 + void refreshDetailsLine(int pos); + void hideDetailsLine(); ///// Events /////////////////////////// bool onButtonPress(neutrino_msg_t msg); // P1 @@ -339,6 +350,7 @@ class CMovieBrowser : public CMenuTarget bool isParentalLock(MI_MOVIE_INFO& movie_info); bool getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM item, std::string* item_string); void updateMovieSelection(void); + void updateInfoSelection(void); void updateFilterSelection(void); void updateSerienames(void); void autoFindSerie(void); @@ -352,7 +364,6 @@ class CMovieBrowser : public CMenuTarget bool addFile(CFile &file, int dirItNr); }; - // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. //Might be replaced by somebody who is familiar with this stuff . @@ -365,7 +376,6 @@ class CSelectedMenu : public CMenuTarget inline int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/){selected = true; return menu_return::RETURN_EXIT;}; }; - // This Class creates a menue item, which writes its caption to an given string (or an given int value to an given variable). // The programm could use this class to verify, what menu was selected. // A good listbox class might do the same. There might be better ways to do so. @@ -397,7 +407,6 @@ class CMenuWidgetSelection : public CMenuWidget int getSelectedLine(void){return exit_pressed ? -1 : selected;}; }; - class CFileChooser : public CMenuWidget { private: @@ -408,8 +417,6 @@ class CFileChooser : public CMenuWidget int exec(CMenuTarget* parent, const std::string & actionKey); }; - - class CDirMenu : public CMenuWidget { private: @@ -428,7 +435,4 @@ class CDirMenu : public CMenuWidget bool isChanged(){return changed;}; }; - - - #endif /*MOVIEBROWSER_H_*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h index b260d0ec7..30ba01b93 100644 --- a/src/gui/moviebrowser/mb_types.h +++ b/src/gui/moviebrowser/mb_types.h @@ -104,9 +104,10 @@ typedef enum MB_FOCUS_BROWSER = 0, MB_FOCUS_LAST_PLAY = 1, MB_FOCUS_LAST_RECORD = 2, - MB_FOCUS_MOVIE_INFO = 3, - MB_FOCUS_FILTER = 4, - MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list + MB_FOCUS_MOVIE_INFO1 = 3, + MB_FOCUS_MOVIE_INFO2 = 4, + MB_FOCUS_FILTER = 5, + MB_FOCUS_MAX_NUMBER = 6 // MUST be allways the last item in the list }MB_FOCUS; typedef enum diff --git a/src/system/locals.h b/src/system/locals.h index b705a9f65..7e3f48afa 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1661,6 +1661,7 @@ typedef enum LOCALE_MOVIEBROWSER_BOOK_TYPE, LOCALE_MOVIEBROWSER_BOOK_TYPE_BACKWARD, LOCALE_MOVIEBROWSER_BOOK_TYPE_FORWARD, + LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, LOCALE_MOVIEBROWSER_BROWSER_ROW_HEAD, LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b0e4ade50..66660b194 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1661,6 +1661,7 @@ const char * locale_real_names[] = "moviebrowser.book_type", "moviebrowser.book_type_backward", "moviebrowser.book_type_forward", + "moviebrowser.browser_additional", "moviebrowser.browser_frame_high", "moviebrowser.browser_row_head", "moviebrowser.browser_row_item", From def8aa2a8239edf54482a36f3de9917b1dc631cf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 31 Oct 2016 23:06:47 +0100 Subject: [PATCH 04/24] textbox: add clear() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0b504f8c60b453c5546291c19467525545f68bb4 Author: vanhofen Date: 2016-10-31 (Mon, 31 Oct 2016) Origin message was: ------------------ - textbox: add clear() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 ++++++++++ src/gui/widget/textbox.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 7120b7a16..10e04b023 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -836,6 +836,16 @@ void CTextBox::hide (void) frameBuffer = NULL; } +void CTextBox::clear(void) +{ + //TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__); + if (frameBuffer == NULL) + return; + + std::string clear(" "); + setText(&clear); +} + bool CTextBox::clearScreenBuffer() { if(m_bgpixbuf){ diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index d2213db78..c062b62e7 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -210,6 +210,7 @@ class CTextBox : public sigc::trackable inline int getTextMode() {return m_nMode;}; void paint (void); void hide (void); + void clear(void); bool clearScreenBuffer(); sigc::signal OnAfterRefresh; sigc::signal OnAfterScrollPage; From 6c4a1dee2306e3ffbb5c5b4c8f37547c5e6f884e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 31 Oct 2016 23:07:27 +0100 Subject: [PATCH 05/24] moviebrowser: fix filter selection Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc6e8fbbcaa83744a4db6b28f0a495af2d75e064 Author: vanhofen Date: 2016-10-31 (Mon, 31 Oct 2016) Origin message was: ------------------ - moviebrowser: fix filter selection ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 74 ++++++++++++++++++++----------------- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 06592472f..c901f9587 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -543,10 +543,10 @@ void CMovieBrowser::initFrames(void) m_cBoxFrameInfo2.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameBrowserList.iWidth; m_cBoxFrameInfo2.iHeight = m_cBoxFrameBrowserList.iHeight; - m_cBoxFrameFilter.iX = m_cBoxFrameBrowserList.iX; - m_cBoxFrameFilter.iY = m_cBoxFrameBrowserList.iY; - m_cBoxFrameFilter.iWidth = m_cBoxFrameBrowserList.iWidth; - m_cBoxFrameFilter.iHeight = m_cBoxFrameBrowserList.iHeight; + m_cBoxFrameFilter.iX = m_cBoxFrameInfo1.iX; + m_cBoxFrameFilter.iY = m_cBoxFrameInfo1.iY; + m_cBoxFrameFilter.iWidth = m_cBoxFrameInfo1.iWidth; + m_cBoxFrameFilter.iHeight = m_cBoxFrameInfo1.iHeight; } void CMovieBrowser::initRows(void) @@ -1124,7 +1124,7 @@ int CMovieBrowser::paint(void) m_pcLastRecord = new CListFrame(&m_recordListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastRecordList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_RECORDLIST), g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); - m_pcFilter = new CListFrame(&m_FilterLines, font, CListFrame::SCROLL | CListFrame::TITLE, + m_pcFilter = new CListFrame(&m_FilterLines, g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CListFrame::SCROLL | CListFrame::TITLE, &m_cBoxFrameFilter, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_FILTER), g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcInfo1 = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo1); @@ -1339,9 +1339,6 @@ void CMovieBrowser::initMovieCover(void) // we have to align cover to box width cover_w = movieCoverBox.iWidth - 2*OFFSET_INNER_MID - OFFSET_SHADOW; - - TRACE("[mb]->%s:%d m_windowFocus == MB_FOCUS_BROWSER\n", __func__, __LINE__); - } else { @@ -1349,9 +1346,6 @@ void CMovieBrowser::initMovieCover(void) // we have to align cover to box height cover_h = movieCoverBox.iHeight - 2*OFFSET_INNER_MID - OFFSET_SHADOW; - - TRACE("[mb]->%s:%d m_windowFocus != MB_FOCUS_BROWSER\n", __func__, __LINE__); - } std::string cover_file; @@ -1391,8 +1385,6 @@ void CMovieBrowser::initMovieCover(void) m_movieCover->doPaintBg(false); } -TRACE("[mb]->%s:%d m_windowFocus: %d\n", __func__, __LINE__, m_windowFocus); - // always align positions and dimensions if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) { @@ -1400,6 +1392,7 @@ TRACE("[mb]->%s:%d m_windowFocus: %d\n", __func__, __LINE__, m_windowFocus); cover_w /= 2; // cover is upright, so we use just half width first m_movieCover->setHeight(0); // force recalculation +TRACE("[mb]->%s:%d m_movieCover->getHeight(): %d\n", __func__, __LINE__, m_movieCover->getHeight()); m_movieCover->setWidth(cover_w, true); if (m_movieCover->getHeight() > movieCoverBox.iHeight/3) m_movieCover->setHeight(movieCoverBox.iHeight/3, true); // use maximal one third of box height @@ -1433,7 +1426,15 @@ void CMovieBrowser::refreshMovieCover(void) TRACE("[mb]->%s:%d\n", __func__, __LINE__); if (m_movieCover) - m_movieCover->paint(CC_SAVE_SCREEN_NO); + m_movieCover->paint(CC_SAVE_SCREEN_YES); +} + +void CMovieBrowser::hideMovieCover(void) +{ + TRACE("[mb]->%s:%d\n", __func__, __LINE__); + + if (m_movieCover) + m_movieCover->hide(); } void CMovieBrowser::refreshMovieInfo(void) @@ -1442,22 +1443,20 @@ void CMovieBrowser::refreshMovieInfo(void) hideDetailsLine(); - //reset text before new init, m_pcInfo1 must be clean - std::string emptytext = " "; - m_pcInfo1->setText(&emptytext); - if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) - { - m_pcInfo1->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]); + // clear m_pcInfo1 text before new init + m_pcInfo1->clear(); - m_pcInfo2->setWindowMaxDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); - m_pcInfo2->setWindowMinDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); - m_pcInfo2->movePosition(m_cBoxFrameInfo2.iX, m_cBoxFrameInfo2.iY); - m_pcInfo2->setText(&emptytext); - } + // clear m_pcInfo2 text, reset position and dimensions before new init + m_pcInfo2->movePosition(m_cBoxFrameInfo2.iX, m_cBoxFrameInfo2.iY); + m_pcInfo2->setWindowMaxDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); + m_pcInfo2->setWindowMinDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight); + m_pcInfo2->clear(); + + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + m_pcInfo1->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]); else m_pcInfo1->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO]); - if (m_vMovieInfo.empty() || m_movieSelectionHandler == NULL) return; @@ -1476,22 +1475,23 @@ void CMovieBrowser::refreshMovieInfo(void) cover_y_offset += 2*OFFSET_INNER_MID; } - std::string pcInfo_content; + std::string pcInfo1_content = " "; if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) { m_pcInfo2->setWindowMaxDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight - cover_y_offset); m_pcInfo2->setWindowMinDimensions(m_cBoxFrameInfo2.iWidth, m_cBoxFrameInfo2.iHeight - cover_y_offset); m_pcInfo2->movePosition(m_cBoxFrameInfo2.iX, m_cBoxFrameInfo2.iY + cover_y_offset); m_pcInfo2->setText(&m_movieSelectionHandler->epgInfo2); - pcInfo_content = m_movieSelectionHandler->epgInfo1; - pcInfo_content += "\n"; - pcInfo_content += m_movieSelectionHandler->channelName; + + pcInfo1_content = m_movieSelectionHandler->epgInfo1; + pcInfo1_content += "\n"; + pcInfo1_content += m_movieSelectionHandler->channelName; } else { - pcInfo_content = m_movieSelectionHandler->epgInfo2; + pcInfo1_content = m_movieSelectionHandler->epgInfo2; } - m_pcInfo1->setText(&pcInfo_content, m_cBoxFrameInfo1.iWidth - cover_x_offset); + m_pcInfo1->setText(&pcInfo1_content, m_cBoxFrameInfo1.iWidth - cover_x_offset); updateInfoSelection(); @@ -2533,7 +2533,12 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) m_showMovieInfo = false; m_pcInfo1->hide(); - m_pcInfo2->hide(); + if (m_windowFocus == MB_FOCUS_BROWSER && m_settings.browserAdditional) + { + hideMovieCover(); + m_pcInfo2->clear(); + } + hideDetailsLine(); m_pcFilter->paint(); onSetFocus(MB_FOCUS_FILTER); @@ -2587,7 +2592,8 @@ void CMovieBrowser::onSetFocus(MB_FOCUS new_focus) m_pcFilter->showSelection(true); updateMovieSelection(); - updateInfoSelection(); + if (m_windowFocus != MB_FOCUS_FILTER) + updateInfoSelection(); refreshFoot(); } diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index d996f0d7c..3bd73fa17 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -293,6 +293,7 @@ class CMovieBrowser : public CMenuTarget void refreshChannelLogo(void); //P1 void initMovieCover(void); //P1 void refreshMovieCover(void); //P1 + void hideMovieCover(void); //P1 int refreshFoot(bool show = true); //P2 void refreshTitle(void); //P2 void refreshInfo(void); // P2 From fde04323f81750131baf6f76245b25f62971546a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 2 Nov 2016 08:27:21 +0100 Subject: [PATCH 06/24] moviebrowser: smaller locales for footer; clearify "filter off" mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d2661a1d8545add0af97c54e3d535a15716d756 Author: vanhofen Date: 2016-11-02 (Wed, 02 Nov 2016) Origin message was: ------------------ - moviebrowser: smaller locales for footer; clearify "filter off" mode ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 ++++--- data/locale/english.locale | 3 ++- src/gui/moviebrowser/mb.cpp | 14 ++++++++------ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bf75a93c6..eb1469ee6 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1663,11 +1663,12 @@ moviebrowser.edit_book_type_info1 Neue Sprunglänge (s) moviebrowser.edit_book_type_info2 <0 zurück , >0 vor, 0: kein moviebrowser.edit_serie Name der Serie moviebrowser.error_no_movies Keine Filme gefunden +moviebrowser.filter_off Filter aus moviebrowser.foot_filter Filter: -moviebrowser.foot_focus Fenster umschalten +moviebrowser.foot_focus Fenster wechseln moviebrowser.foot_options Optionen -moviebrowser.foot_play Film starten -moviebrowser.foot_refresh Liste neu laden +moviebrowser.foot_play Wiedergabe +moviebrowser.foot_refresh Neu laden moviebrowser.foot_sort Sortieren: moviebrowser.head Meine Aufnahmen moviebrowser.head_filter Filme nach Kategorie filtern: diff --git a/data/locale/english.locale b/data/locale/english.locale index 2a7eff1ff..cc29d58f4 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1663,10 +1663,11 @@ moviebrowser.edit_book_type_info1 Enter new jump length (s) moviebrowser.edit_book_type_info2 <0 back , >0 for, 0: none moviebrowser.edit_serie Enter name of serie moviebrowser.error_no_movies No movies found +moviebrowser.filter_off Filter off moviebrowser.foot_filter Filter: moviebrowser.foot_focus Switch window moviebrowser.foot_options Options -moviebrowser.foot_play Start movie +moviebrowser.foot_play Playback moviebrowser.foot_refresh Refresh list moviebrowser.foot_sort Sort: moviebrowser.head My recordings diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c901f9587..251beb1c7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -434,7 +434,7 @@ void CMovieBrowser::initGlobalSettings(void) m_settings.sorting.direction = MB_DIRECTION_DOWN; m_settings.filter.item = MB_INFO_MAX_NUMBER; - m_settings.filter.optionString = ""; + m_settings.filter.optionString = g_Locale->getText(LOCALE_OPTIONS_OFF); m_settings.filter.optionVar = 0; m_settings.parentalLockAge = MI_PARENTAL_OVER18; @@ -1594,7 +1594,7 @@ void CMovieBrowser::refreshFilterList(void) } else { - std::string tmp = g_Locale->getText(LOCALE_MENU_BACK); + std::string tmp = g_Locale->getText(LOCALE_MOVIEBROWSER_FILTER_OFF); m_FilterLines.lineArray[0].push_back(tmp); if (m_settings.filter.item == MB_INFO_FILEPATH) @@ -1853,17 +1853,19 @@ int CMovieBrowser::refreshFoot(bool show) int ok_loc_len = std::max(FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), true), FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY), true)); std::string filter_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FILTER); + filter_text += " "; filter_text += m_settings.filter.optionString; std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); - sort_text += g_Locale->getText(m_localizedItemName[m_settings.sorting.item]); - int sort_text_len = FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT), true); + sort_text += " "; + int sort_text_len = FOOT_FONT->getRenderWidth(sort_text, true); int len = 0; for (int i = 0; m_localizedItemName[i] != NONEXISTANT_LOCALE; i++) len = std::max(len, FOOT_FONT->getRenderWidth(g_Locale->getText(m_localizedItemName[i]), true)); sort_text_len += len; + sort_text += g_Locale->getText(m_localizedItemName[m_settings.sorting.item]); button_label_ext footerButtons[] = { - { NEUTRINO_ICON_BUTTON_RED, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, + { NEUTRINO_ICON_BUTTON_RED, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, { NEUTRINO_ICON_BUTTON_GREEN, NONEXISTANT_LOCALE, filter_text.c_str(), 0, true }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_MOVIEBROWSER_FOOT_FOCUS, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_MOVIEBROWSER_FOOT_REFRESH, NULL, 0, false }, @@ -2270,7 +2272,7 @@ bool CMovieBrowser::onButtonPressFilterList(neutrino_msg_t msg) if (selected_line == 0) { m_settings.filter.item = MB_INFO_MAX_NUMBER; - m_settings.filter.optionString = ""; + m_settings.filter.optionString = g_Locale->getText(LOCALE_OPTIONS_OFF); m_settings.filter.optionVar = 0; refreshFilterList(); m_pcFilter->setSelectedLine(0); diff --git a/src/system/locals.h b/src/system/locals.h index 8a20d4e61..cf4336a52 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1690,6 +1690,7 @@ typedef enum LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO2, LOCALE_MOVIEBROWSER_EDIT_SERIE, LOCALE_MOVIEBROWSER_ERROR_NO_MOVIES, + LOCALE_MOVIEBROWSER_FILTER_OFF, LOCALE_MOVIEBROWSER_FOOT_FILTER, LOCALE_MOVIEBROWSER_FOOT_FOCUS, LOCALE_MOVIEBROWSER_FOOT_OPTIONS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8ed3606a2..da28b20bd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1690,6 +1690,7 @@ const char * locale_real_names[] = "moviebrowser.edit_book_type_info2", "moviebrowser.edit_serie", "moviebrowser.error_no_movies", + "moviebrowser.filter_off", "moviebrowser.foot_filter", "moviebrowser.foot_focus", "moviebrowser.foot_options", From 20f02fb9544f17a4b838d50b00d69010622d0900 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 2 Nov 2016 09:55:45 +0100 Subject: [PATCH 07/24] textbox: fix compilation for generic hardware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: declaration of ‘clear’ shadows a member of 'this' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f5aa730338969e043feff2140cd453aaec5d466 Author: vanhofen Date: 2016-11-02 (Wed, 02 Nov 2016) Origin message was: ------------------ - textbox: fix compilation for generic hardware error: declaration of ‘clear’ shadows a member of 'this' ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 10e04b023..bbddf0fb4 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -842,8 +842,8 @@ void CTextBox::clear(void) if (frameBuffer == NULL) return; - std::string clear(" "); - setText(&clear); + std::string empty(" "); + setText(&empty); } bool CTextBox::clearScreenBuffer() From ea127a5d370537b92150f39e594b8d7bb14a46b7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 4 Nov 2016 16:46:47 +0100 Subject: [PATCH 08/24] cablex.xml: update Unitymedia; thx to klauser Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b94f35421adba78adf167940bfa8aa0d8759666c Author: vanhofen Date: 2016-11-04 (Fri, 04 Nov 2016) Origin message was: ------------------ - cablex.xml: update Unitymedia; thx to klauser ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/cables.xml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/data/cables.xml b/data/cables.xml index debbe767f..4970d600c 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -220,11 +220,10 @@ - - - - - + + + + @@ -245,32 +244,27 @@ + + + + - - - - - - - - - - - - - - + + - + + + + From 008d9e17aaef6f0a9f5288356325661e29074dd9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 13:45:55 +0100 Subject: [PATCH 09/24] listframe: allow round borders Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c7942adb8f0c74f409a0f99063170ba75bfb0ba7 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - listframe: allow round borders ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/listframe.cpp | 51 ++++++++++++++++++++---------------- src/gui/widget/listframe.h | 7 +++++ 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 01cbcd52c..b2a0028d4 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -190,9 +190,11 @@ void CListFrame::initVar(void) m_nCurrentPage = 0; m_nSelectedLine = 0; + m_nBgRadius = RADIUS_NONE; + m_cFrame.iX = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - MIN_WINDOW_WIDTH) >>1); - m_cFrame.iWidth = MIN_WINDOW_WIDTH; m_cFrame.iY = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - MIN_WINDOW_HEIGHT) >>1); + m_cFrame.iWidth = MIN_WINDOW_WIDTH; m_cFrame.iHeight = MIN_WINDOW_HEIGHT; m_nMaxHeight = MAX_WINDOW_HEIGHT; @@ -236,8 +238,8 @@ void CListFrame::initFramesRel(void) if(m_nMode & TITLE) { - m_cFrameTitleRel.iX = 0; - m_cFrameTitleRel.iY = 0; + m_cFrameTitleRel.iX = 0; + m_cFrameTitleRel.iY = 0; m_cFrameTitleRel.iHeight = m_nFontTitleHeight +2 ; m_cFrameTitleRel.iWidth = m_cFrame.iWidth ; } @@ -245,44 +247,44 @@ void CListFrame::initFramesRel(void) { m_cFrameTitleRel.iX = 0; m_cFrameTitleRel.iY = 0; - m_cFrameTitleRel.iHeight= 0; - m_cFrameTitleRel.iWidth = 0; + m_cFrameTitleRel.iHeight = 0; + m_cFrameTitleRel.iWidth = 0; } if(m_nMode & HEADER_LINE) { - m_cFrameHeaderListRel.iX = 0; - m_cFrameHeaderListRel.iY = 0 + m_cFrameTitleRel.iHeight; + m_cFrameHeaderListRel.iX = 0; + m_cFrameHeaderListRel.iY = 0 + m_cFrameTitleRel.iHeight; m_cFrameHeaderListRel.iHeight = m_nFontHeaderListHeight ; } else { - m_cFrameHeaderListRel.iX = 0; - m_cFrameHeaderListRel.iY = 0; + m_cFrameHeaderListRel.iX = 0; + m_cFrameHeaderListRel.iY = 0; m_cFrameHeaderListRel.iHeight = 0; m_cFrameHeaderListRel.iWidth = 0; } m_cFrameListRel.iX = 0; m_cFrameListRel.iY = m_cFrameHeaderListRel.iHeight + m_cFrameTitleRel.iHeight; - m_cFrameListRel.iHeight = m_cFrame.iHeight - m_cFrameHeaderListRel.iHeight - m_cFrameTitleRel.iHeight; + m_cFrameListRel.iHeight = m_cFrame.iHeight - m_cFrameHeaderListRel.iHeight - m_cFrameTitleRel.iHeight; if(m_nMode & SCROLL) { m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH; m_cFrameScrollRel.iY = m_cFrameTitleRel.iHeight; m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iHeight = m_cFrameListRel.iHeight + m_cFrameHeaderListRel.iHeight; + m_cFrameScrollRel.iHeight = m_cFrameHeaderListRel.iHeight + m_cFrameListRel.iHeight - m_nBgRadius; } else { m_cFrameScrollRel.iX = 0; m_cFrameScrollRel.iY = 0; - m_cFrameScrollRel.iHeight = 0; m_cFrameScrollRel.iWidth = 0; + m_cFrameScrollRel.iHeight = 0; } - m_cFrameListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; + m_cFrameListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; if(m_nMode & HEADER_LINE) { @@ -354,7 +356,8 @@ void CListFrame::refreshTitle(void) if( frameBuffer == NULL) return; frameBuffer->paintBoxRel(m_cFrameTitleRel.iX+m_cFrame.iX, m_cFrameTitleRel.iY+m_cFrame.iY, - m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, TITLE_BACKGROUND_COLOR); + m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, TITLE_BACKGROUND_COLOR, + m_nBgRadius, CORNER_TOP); m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX, m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY, @@ -376,7 +379,8 @@ void CListFrame::refreshScroll(void) if (1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_0); + m_cFrameScrollRel.iWidth, m_cFrameHeaderListRel.iHeight + m_cFrameListRel.iHeight, COL_MENUCONTENT_PLUS_0, + m_nBgRadius, CORNER_BOTTOM_RIGHT); } if (m_nNrOfPages > 1) @@ -408,16 +412,17 @@ int CListFrame::paintListIcon(int x, int y, int line) void CListFrame::refreshList(void) { //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); - if( frameBuffer == NULL) return; - frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY, - m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, COL_MENUCONTENT_PLUS_0); - - if( m_nNrOfLines <= 0) + if (frameBuffer == NULL) return; - for(int line = m_nCurrentLine; - line < m_nNrOfLines && line < m_nCurrentLine + m_nLinesPerPage; - line++) + frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY, + m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, COL_MENUCONTENT_PLUS_0, + m_nBgRadius, CORNER_BOTTOM_LEFT); + + if (m_nNrOfLines <= 0) + return; + + for (int line = m_nCurrentLine; line < m_nNrOfLines && line < m_nCurrentLine + m_nLinesPerPage; line++) { refreshLine(line); } diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index 97fc72ca9..35332b4c9 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -104,6 +104,8 @@ class CListFrame int m_nCurrentPage; int m_nSelectedLine; + int m_nBgRadius; + bool m_showSelection; Font* m_pcFontTitle; @@ -141,6 +143,11 @@ class CListFrame bool setTitle(char* title); bool setSelectedLine(int selection); void setSelectedMarked(bool enable); + void setBackGroundRadius(const int radius) + { + m_nBgRadius = radius; + initFramesRel(); + }; void clearMarked() { if (m_pLines) From b64f151731f18bfa2eff7222439e92e25907ae19 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 13:45:55 +0100 Subject: [PATCH 10/24] moviebrowser: allow round borders in filter selection Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ca710ed4b11d0ba56f78c106eb2d512044f6e94 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - moviebrowser: allow round borders in filter selection ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 251beb1c7..3b53d0511 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1152,6 +1152,8 @@ int CMovieBrowser::paint(void) return (false); } + m_pcFilter->setBackGroundRadius(RADIUS_LARGE); + m_pcInfo1->setBackGroundColor(COL_MENUCONTENTDARK_PLUS_0); m_pcInfo1->setTextColor(COL_MENUCONTENTDARK_TEXT); m_pcInfo1->setBackGroundRadius(RADIUS_LARGE); From 4bdef16c586a6e3c517fd1138e51d2911b7f02ac Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 14:50:50 +0100 Subject: [PATCH 11/24] moviebrowser: increase default browserFrameHeight Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/16dfc2d5e8643add1607aa7083a6235fc8da5b55 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - moviebrowser: increase default browserFrameHeight ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 3b53d0511..81ef69643 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -453,7 +453,7 @@ void CMovieBrowser::initGlobalSettings(void) } /***** Browser List **************/ - m_settings.browserFrameHeight = 50; /* percent */ + m_settings.browserFrameHeight = 65; /* percent */ m_settings.browserRowNr = 6; m_settings.browserRowItem[0] = MB_INFO_CHANNEL; @@ -466,12 +466,12 @@ void CMovieBrowser::initGlobalSettings(void) m_settings.browserRowItem[7] = MB_INFO_MAX_NUMBER; m_settings.browserRowItem[8] = MB_INFO_MAX_NUMBER; - m_settings.browserRowWidth[0] = m_defaultRowWidth[m_settings.browserRowItem[0]]; //300; - m_settings.browserRowWidth[1] = m_defaultRowWidth[m_settings.browserRowItem[1]]; //100; - m_settings.browserRowWidth[2] = m_defaultRowWidth[m_settings.browserRowItem[2]]; //80; - m_settings.browserRowWidth[3] = m_defaultRowWidth[m_settings.browserRowItem[3]]; //50; - m_settings.browserRowWidth[4] = m_defaultRowWidth[m_settings.browserRowItem[4]]; //30; - m_settings.browserRowWidth[5] = m_defaultRowWidth[m_settings.browserRowItem[5]]; //30; + m_settings.browserRowWidth[0] = m_defaultRowWidth[m_settings.browserRowItem[0]]; + m_settings.browserRowWidth[1] = m_defaultRowWidth[m_settings.browserRowItem[1]]; + m_settings.browserRowWidth[2] = m_defaultRowWidth[m_settings.browserRowItem[2]]; + m_settings.browserRowWidth[3] = m_defaultRowWidth[m_settings.browserRowItem[3]]; + m_settings.browserRowWidth[4] = m_defaultRowWidth[m_settings.browserRowItem[4]]; + m_settings.browserRowWidth[5] = m_defaultRowWidth[m_settings.browserRowItem[5]]; m_settings.browserRowWidth[6] = m_defaultRowWidth[m_settings.browserRowItem[6]]; m_settings.browserRowWidth[7] = m_defaultRowWidth[m_settings.browserRowItem[7]]; m_settings.browserRowWidth[8] = m_defaultRowWidth[m_settings.browserRowItem[8]]; From f1160e84c0d1d638fe4145a712ee10955a2165fe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 21:08:51 +0100 Subject: [PATCH 12/24] cc_frm_header: use OFFSET define Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/15e24a3e6629f3afc086a1feaa3cdd282f010d42 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - cc_frm_header: use OFFSET define ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 69d88a173..c9c29c075 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -121,7 +121,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_col_text = COL_MENUHEAD_TEXT; cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; cch_items_y = CC_CENTERED; - cch_offset = 8; + cch_offset = OFFSET_INNER_MID; cch_icon_x = cch_offset; cch_icon_w = 0; cch_clock_w = 0; From 16245bdc76437eaf12bb2b09c3a9b964843521b5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 21:09:45 +0100 Subject: [PATCH 13/24] settings.h: add OFFSET_INNER_MIN define Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11383271adcfaa26c175d225266ecc08f546adaf Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - settings.h: add OFFSET_INNER_MIN define ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/settings.h b/src/system/settings.h index 60f322cbf..bf67d66fc 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -903,7 +903,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define OFFSET_INNER_LARGE 20 #define OFFSET_INNER_MID 10 #define OFFSET_INNER_SMALL 5 - +#define OFFSET_INNER_MIN 2 struct SglobalInfo { From c5a2d47f51fb975b091750b37979f912f11d3378 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 21:10:21 +0100 Subject: [PATCH 14/24] listbox/moviebrowser: replace internal offsets with global defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b24ec63577a9a8a3c6658e9bde10e1800c90ceb8 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - listbox/moviebrowser: replace internal offsets with global defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 5 ++-- src/gui/widget/listframe.cpp | 47 +++++++++++++++++------------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 81ef69643..8fa87ef58 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1522,10 +1522,9 @@ void CMovieBrowser::refreshDetailsLine(int pos) int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]->getHeight(); int hheight = m_pcBrowser->getHeaderListHeight(); int theight = m_pcBrowser->getTitleHeight(); - int bheight = 8 /*TEXT_BORDER_WIDTH*/; int xpos = m_cBoxFrameBrowserList.iX - ConnectLineBox_Width; - int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + bheight + pos*fheight + (fheight/2); + int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + OFFSET_INNER_MID + pos*fheight + (fheight/2); int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); if (m_detailsLine == NULL) @@ -1558,8 +1557,8 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) pb.setValues(blocks_percent_used, 100); pb.paint(false); } - } + void CMovieBrowser::refreshLCD(void) { if (m_vMovieInfo.empty() || m_movieSelectionHandler == NULL) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index b2a0028d4..4b9495fba 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -55,10 +55,7 @@ #include "listframe.h" #include -#define TEXT_BORDER_WIDTH 8 -#define ROW_BORDER_WIDTH 4 -#define SCROLL_FRAME_WIDTH 10 -#define SCROLL_MARKER_BORDER 2 +#define SCROLL_FRAME_WIDTH 10 #define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) #define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) @@ -206,7 +203,7 @@ void CListFrame::reSizeMainFrameWidth(int textWidth) { //TRACE("[CListFrame]->ReSizeMainFrameWidth: %d, current: %d\r\n",textWidth,m_cFrameListRel.iWidth); - int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*TEXT_BORDER_WIDTH; + int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*OFFSET_INNER_MID; if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if((unsigned int) iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; @@ -221,7 +218,7 @@ void CListFrame::reSizeMainFrameHeight(int textHeight) { //TRACE("[CListFrame]->ReSizeMainFrameHeight: %d, current: %d\r\n",textHeight,m_cFrameListRel.iHeight); - int iNewWindowHeight = textHeight + 2*TEXT_BORDER_WIDTH; + int iNewWindowHeight = textHeight + 2*OFFSET_INNER_MID; if( iNewWindowHeight > m_nMaxHeight) iNewWindowHeight = m_nMaxHeight; if( iNewWindowHeight < MIN_WINDOW_HEIGHT) iNewWindowHeight = MIN_WINDOW_HEIGHT; @@ -291,7 +288,7 @@ void CListFrame::initFramesRel(void) m_cFrameHeaderListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; } - m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontListHeight; + m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*OFFSET_INNER_MID)) / m_nFontListHeight; } void CListFrame::onNewLineArray(void) @@ -313,7 +310,7 @@ void CListFrame::onNewLineArray(void) { reSizeMainFrameHeight(m_nNrOfLines * m_nFontListHeight); } - m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontListHeight; + m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*OFFSET_INNER_MID)) / m_nFontListHeight; if(m_nLinesPerPage <= 0) m_nLinesPerPage = 1; @@ -359,9 +356,9 @@ void CListFrame::refreshTitle(void) m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, TITLE_BACKGROUND_COLOR, m_nBgRadius, CORNER_TOP); - m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX, + m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + OFFSET_INNER_MID + m_cFrame.iX, m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY, - m_cFrameTitleRel.iWidth - (TEXT_BORDER_WIDTH << 1), + m_cFrameTitleRel.iWidth - (OFFSET_INNER_MID << 1), m_textTitle.c_str(), TITLE_FONT_COLOR); } @@ -387,10 +384,10 @@ void CListFrame::refreshScroll(void) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); - unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size +m_cFrame.iY, - m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*OFFSET_INNER_MIN) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + OFFSET_INNER_MIN+m_cFrame.iX, + m_cFrameScrollRel.iY + OFFSET_INNER_MIN + m_nCurrentPage * marker_size +m_cFrame.iY, + m_cFrameScrollRel.iWidth - (2*OFFSET_INNER_MIN), marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); } } @@ -403,7 +400,7 @@ int CListFrame::paintListIcon(int x, int y, int line) frameBuffer->getIconSize(m_pLines->Icon[line].c_str(), &icol_w, &icol_h); if ((icol_w > 0) && (icol_h > 0)) { frameBuffer->paintIcon(m_pLines->Icon[line], x+m_cFrame.iX, y+m_cFrame.iY-m_nFontListHeight, m_nFontListHeight); - xDiff = icol_w + TEXT_BORDER_WIDTH; + xDiff = icol_w + OFFSET_INNER_MID; } } return xDiff; @@ -439,7 +436,7 @@ void CListFrame::refreshLine(int line) fb_pixel_t color, bgcolor; int rel_line = line - m_nCurrentLine; - int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH + (rel_line*m_nFontListHeight); + int y = m_cFrameListRel.iY + OFFSET_INNER_MID + (rel_line*m_nFontListHeight); int radius = 0; bool selected = (line == m_nSelectedLine && m_showSelection == true); @@ -454,22 +451,22 @@ void CListFrame::refreshLine(int line) m_cFrameListRel.iWidth, m_nFontListHeight, bgcolor, radius); int width; - int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; + int x = m_cFrameListRel.iX + OFFSET_INNER_MID; y += m_nFontListHeight; int xDiff = paintListIcon(x, y, line); - int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); + int net_width = m_cFrameListRel.iWidth - OFFSET_INNER_SMALL * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { width = std::min(m_pLines->rowWidth[row] * net_width / 100, - m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH); + m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - OFFSET_INNER_MID); if (row > 0) xDiff = 0; m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, width-xDiff, m_pLines->lineArray[row][line].c_str(), color); - x += width + ROW_BORDER_WIDTH; + x += width + OFFSET_INNER_SMALL; } } @@ -483,23 +480,23 @@ void CListFrame::refreshHeaderList(void) m_cFrameHeaderListRel.iWidth, m_cFrameHeaderListRel.iHeight, HEADER_LIST_BACKGROUND_COLOR); int width; - int x = m_cFrameHeaderListRel.iX + TEXT_BORDER_WIDTH; + int x = m_cFrameHeaderListRel.iX + OFFSET_INNER_MID; int y = m_cFrameHeaderListRel.iY + m_nFontHeaderListHeight + 2; - int net_width = m_cFrameHeaderListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); + int net_width = m_cFrameHeaderListRel.iWidth - OFFSET_INNER_SMALL * (m_pLines->rows - 1); bool loop = true; for(int row = 0; row < m_pLines->rows && loop == true; row++) { width = m_pLines->rowWidth[row] * net_width / 100; - if (width > m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - TEXT_BORDER_WIDTH) + if (width > m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - OFFSET_INNER_MID) { - width = m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - TEXT_BORDER_WIDTH; + width = m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - OFFSET_INNER_MID; //TRACE(" normalize width to %d , x:%d \r\n",width,x); loop = false; } m_pcFontHeaderList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, width, m_pLines->lineHeader[row].c_str(), HEADER_LIST_FONT_COLOR); - x += width + ROW_BORDER_WIDTH; + x += width + OFFSET_INNER_SMALL; } } From de058820850fad05cd5196a6144360b1620ce7ff Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Nov 2016 21:11:13 +0100 Subject: [PATCH 15/24] moviebrowser: use small offset in header to display channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b79662575b57616f1cf2a4fd43c6c5513b3e6e5 Author: vanhofen Date: 2016-11-07 (Mon, 07 Nov 2016) Origin message was: ------------------ - moviebrowser: use small offset in header to display channellogo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 8fa87ef58..b7226229f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1282,6 +1282,7 @@ void CMovieBrowser::refreshChannelLogo(void) TRACE("[mb]->%s:%d\n", __func__, __LINE__); int w_logo_max = m_cBoxFrameTitleRel.iWidth / 4; + int h_logo_max = m_cBoxFrameTitleRel.iHeight - 2*OFFSET_INNER_MIN; short pb_hdd_offset = 100 + OFFSET_INNER_MID; if (show_mode == MB_SHOW_YT) @@ -1308,12 +1309,10 @@ void CMovieBrowser::refreshChannelLogo(void) { // scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object int h_logo = m_channelLogo->getHeight(); - if (h_logo > m_cBoxFrameTitleRel.iHeight) + if (h_logo > h_logo_max) { - uint8_t ratio = m_cBoxFrameTitleRel.iHeight*100/h_logo; - m_channelLogo->setHeight(m_cBoxFrameTitleRel.iHeight); - int w_logo = ratio*m_channelLogo->getWidth()/100; - m_channelLogo->setWidth(min(w_logo, w_logo_max)); + m_channelLogo->setWidth(0); // force recalculation + m_channelLogo->setHeight(h_logo_max, true); } int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; From ebc3ccba125eb1b45add5783c36eaec7e96ad498 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:00:08 +0100 Subject: [PATCH 16/24] moviebrowser: simplify channellogo scaling code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1590f4a276fdb7bf7ba430e34dc0e6a87e4c0422 Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - moviebrowser: simplify channellogo scaling code ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b7226229f..fca906cde 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1307,13 +1307,10 @@ void CMovieBrowser::refreshChannelLogo(void) if (m_channelLogo && m_channelLogo->hasLogo()) { - // scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object - int h_logo = m_channelLogo->getHeight(); - if (h_logo > h_logo_max) - { - m_channelLogo->setWidth(0); // force recalculation + // TODO: move into an own handler, eg. header, so channel logo should be paint in header object + m_channelLogo->setWidth(min(m_channelLogo->getWidth(), w_logo_max), true); + if (m_channelLogo->getHeight() > h_logo_max) m_channelLogo->setHeight(h_logo_max, true); - } int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; int y = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + (m_cBoxFrameTitleRel.iHeight - m_channelLogo->getHeight())/2; From 5390a845045ec0be94d2e49c6dff353edc57ea31 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:00:51 +0100 Subject: [PATCH 17/24] channellist: use small vertical offset around channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8f625c3d272ac1ab654230a81e9c43ab2e0df747 Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - channellist: use small vertical offset around channellogo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 55437a472..d3653cd80 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1696,6 +1696,7 @@ void CChannelList::showChannelLogo() //TODO: move into an own handler, eg. heade return; if(g_settings.channellist_show_channellogo){ int logo_w_max = full_width / 4; + int logo_h_max = theight - 2*OFFSET_INNER_MIN; if (CChannelLogo) { if (headerNew) CChannelLogo->clearSavedScreen(); @@ -1707,8 +1708,8 @@ void CChannelList::showChannelLogo() //TODO: move into an own handler, eg. heade if (CChannelLogo->hasLogo()){ CChannelLogo->setWidth(min(CChannelLogo->getWidth(), logo_w_max), true); - if (CChannelLogo->getHeight() > theight) //scale image if required - CChannelLogo->setHeight(theight, true); + if (CChannelLogo->getHeight() > logo_h_max) + CChannelLogo->setHeight(logo_h_max, true); CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth()); CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2); CChannelLogo->paint(); From 16d1168a2825f40d11821afed4ad41c5265adca7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:02:08 +0100 Subject: [PATCH 18/24] eventlist: use small vertical offset around channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9be160f204c70289803c04496cd690377a7a341 Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - eventlist: use small vertical offset around channellogo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 1fcb9fab6..c6f879092 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -855,28 +855,23 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s } header->clear(); - int x_off = 10; + int x_off = OFFSET_INNER_MID; int mid_width = full_width * 40 / 100; // 40% + int max_height = theight - 2*OFFSET_INNER_MIN; int side_width = ((full_width - mid_width) / 2) - (2 * x_off); //create an logo object CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header); - if (midLogo->hasLogo()) { - //if logo object has found a logo and was ititialized, the hand it's size - int w_logo = midLogo->getWidth(); + if (midLogo->hasLogo()) + { + midLogo->setWidth(min(midLogo->getWidth(), mid_width), true); + if (midLogo->getHeight() > max_height) + midLogo->setHeight(max_height, true); - //scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object - int h_logo = midLogo->getHeight(); - if (h_logo > theight){ - uint8_t h_ratio = uint8_t(theight*100/h_logo); - midLogo->setHeight(theight); - w_logo = h_ratio*w_logo/100; - midLogo->setWidth(w_logo); - } midLogo->setPos(CC_CENTERED, CC_CENTERED); // recalc widths - side_width = ((full_width - w_logo) / 2) - (4 * x_off); + side_width = ((full_width - midLogo->getWidth()) / 2) - (4 * x_off); } else { header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available From 92f79c9f1578a02ce3334c23d0db0f138598b984 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:02:57 +0100 Subject: [PATCH 19/24] infoviewer: use small vertical offset around channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/21b2fbd03c971188c4c771939d4cb6007650f2f0 Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - infoviewer: use small vertical offset around channellogo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 31003bad9..985a3f2ff 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -2255,7 +2255,7 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id, const int c else if (g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6) // paint logo in place of channel name { // check logo dimensions - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, chan_w, header_height); + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, chan_w, header_height - 2*OFFSET_INNER_MIN); // hide channel name // this is too ugly... ChannelName = ""; // calculate logo position @@ -2271,7 +2271,7 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id, const int c { // check logo dimensions int Logo_max_width = chan_w - logo_w - 10; - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, Logo_max_width, header_height); + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, Logo_max_width, header_height - 2*OFFSET_INNER_MIN); // calculate logo position y_mid = ChanNameY + header_height / 2; logo_x = start_x + 10; From 2149135c85cbe4a2eb84d61b45b0113ce56de88a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:03:44 +0100 Subject: [PATCH 20/24] epgview: use small vertical offset around channellogo; ... more intensive use of offset defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7d7a924d06b3991e0e42878c5775ca7f30bd0c1a Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - epgview: use small vertical offset around channellogo; ... more intensive use of offset defines ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 52 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 33af8c90b..bcbb693cb 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -195,7 +195,7 @@ void CEpgData::processTextToArray(std::string text, int screening, bool has_cove // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (has_cover? ((ox/4)+10) :0))) + if ((aktWordWidth+aktWidth)<(ox - 2*OFFSET_INNER_MID - 15 - (has_cover ? ((ox/4)+OFFSET_INNER_MID) : 0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -238,7 +238,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) std::string cover = "/tmp/tmdb.jpg"; //todo: maybe add a getCover()-function to tmdb class int cover_max_width = ox/4; //25% - int cover_max_height = sb-(2*10); + int cover_max_height = sb-(2*OFFSET_INNER_MID); int cover_width = 0; int cover_height = 0; int cover_offset = 0; @@ -249,7 +249,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) if (cover_width && cover_height) { g_PicViewer->rescaleImageDimensions(&cover_width, &cover_height, cover_max_width, cover_max_height); - cover_offset = cover_width + 10; + cover_offset = cover_width + OFFSET_INNER_MID; } } @@ -269,7 +269,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box if (has_cover) { - if (!g_PicViewer->DisplayImage(cover ,sx+10 ,y+10+((sb-cover_height)/2), cover_width, cover_height, CFrameBuffer::TM_NONE)) { + if (!g_PicViewer->DisplayImage(cover ,sx+OFFSET_INNER_MID ,y+OFFSET_INNER_MID+((sb-cover_height)/2), cover_width, cover_height, CFrameBuffer::TM_NONE)) { cover_offset = 0; frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box } @@ -280,8 +280,8 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) if (tmdb_active && startPos == 0) { frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, y+(medlineheight-icon_h)/2); - logo_offset = icon_w + 10; + frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+OFFSET_INNER_MID+cover_offset, y+(medlineheight-icon_h)/2); + logo_offset = icon_w + OFFSET_INNER_MID; } if (stars > 0 && startPos == 0) { @@ -308,7 +308,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) offset += digi; break; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT); count++; pos1 = epgText[i].first.find_first_not_of(tok, pos2); pos2 = epgText[i].first.find_first_of(tok, pos1); @@ -317,7 +317,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox-15-15-cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+cover_offset, y+medlineheight, ox-15-15-cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); } } @@ -707,12 +707,17 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); return res; } + + const int pic_h = 39; + toph = std::max(toph, pic_h); + // 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; + int logo_h_max = toph - 2*OFFSET_INNER_MIN; std::string channel_name; if (mp_info) channel_name = mp_movie_info->channelName; @@ -720,36 +725,31 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start channel_name = g_Zapit->getChannelName(channel_id); if (g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel_name, 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; + if ((logo_h > logo_h_max) || (logo_w > logo_w_max)) + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, logo_h_max); + pic_offx = logo_w + OFFSET_INNER_MID; } int pos; std::string text1 = epgData.title; std::string text2 = ""; - if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18) + if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID) { 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)); + } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID)); if (epgData.title.length() > text1.length()) // shold never be false in this place text2 = epgData.title.substr(text1.length()+ 1, uint(-1) ); } - const int pic_h = 39; - if(!topboxheight) + if (!topboxheight) start(); if (!text2.empty()) toph = 2 * topboxheight; - else - toph = topboxheight; - - toph = std::max(toph, pic_h); sb = oy - toph - botboxheight; @@ -881,11 +881,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos if (pic_offx > 0) { - headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); + headerPic = new CComponentsPicture(sx + OFFSET_INNER_MID, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - CComponentsText headerText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + CComponentsText headerText(sx + OFFSET_INNER_MID + pic_offx, sy, ox - 2*OFFSET_INNER_MID - 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); @@ -905,23 +905,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (!iw && !ih) frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); if (!io && iw) - io = iw + 10; + io = iw + OFFSET_INNER_MID; std::string fromto = epg_start + " - " + epg_end; int widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+10+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+OFFSET_INNER_MID+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); int widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-10-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-OFFSET_INNER_MID-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); if (!call_fromfollowlist) { int iy = sy + oy - botboxheight + (botboxheight - iw)/2; if (prev_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 10, iy); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + OFFSET_INNER_MID, iy); if (next_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - OFFSET_INNER_MID, iy); } } showProgressBar(); From efad07c007c37c1ce375295bfbd4c0cda1428c92 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 9 Nov 2016 11:55:44 +0100 Subject: [PATCH 21/24] controlapi: add epg_id to several outputs; add /control/getepgid * /control/getepgid[?format=plain|json|xml] Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3150d9edac45744df0a92a3e647ffb1c08dae595 Author: vanhofen Date: 2016-11-09 (Wed, 09 Nov 2016) Origin message was: ------------------ - controlapi: add epg_id to several outputs; add /control/getepgid * /control/getepgid[?format=plain|json|xml] ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 129 ++++++++++++++++++++++------ src/nhttpd/tuxboxapi/controlapi.h | 1 + 2 files changed, 105 insertions(+), 25 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index e3c56761d..e20891282 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -174,6 +174,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, {"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"}, {"getchannelid", &CControlAPI::GetChannelIDCGI, ""}, + {"getepgid", &CControlAPI::GetEpgIDCGI, ""}, {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system {"standby", &CControlAPI::StandbyCGI, "text/plain"}, @@ -698,6 +699,45 @@ void CControlAPI::GetChannelIDCGI(CyhookHandler *hh) hh->SendResult(result); } +//------------------------------------------------------------------------- +/** Display epg id's + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getepgid[?format=plain|json|xml] + * @endcode + * + * @par output (xml) + * @code + * /control/getepgid?format=xml + * @endcode + * + * @code + * + * 361d03f300012b66 + * 3f300012b66 + * + * @endcode + */ +//----------------------------------------------------------------------------- +// get actual epg_id +void CControlAPI::GetEpgIDCGI(CyhookHandler *hh) +{ + t_channel_id channel_id = CZapit::getInstance()->GetCurrentChannelID(); + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + + hh->outStart(); + std::string result = ""; + result = hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id), true); + result += hh->outPair("short_epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id & 0xFFFFFFFFFFFFULL), false); + result = hh->outObject("epg_id", result); + hh->SendResult(result); +} + //----------------------------------------------------------------------------- void CControlAPI::GetTPChannel_IDCGI(CyhookHandler *hh) { @@ -1112,7 +1152,9 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * if (channelNr > -1) result += hh->outPair("number", string_printf("%u", channelNr), true); result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); - result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true); + result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), true); + result += hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getEpgID()), true); + result += hh->outPair("short_epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getEpgID() & 0xFFFFFFFFFFFFULL), true); result += hh->outPair("name", hh->outValue(channel->getName()), true); result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(channel->getChannelID())), false); if (bouquetNr > -1) @@ -1169,11 +1211,33 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * /control/getbouquet?bouquet=2&format=json * @endcode * @code - * {"success": "true", "data":{"channels": [ {"number": "1", "id": "12ea043100016e3d", "short_id": "43100016e3d", "name": "ARD-TEST-1", "logo": "", "bouquetnr": "1"}, - * {"number": "2", "id": "4792041b00017034", "short_id": "41b00017034", "name": "arte", "logo": "", "bouquetnr": "1"}, + * {"success": "true", + * "data": { + * "channels": [ + * { + * "number": "1", + * "id": "12ea043100016e3d", + * "short_id": "43100016e3d", + * "epg_id": "12ea043100016e3d", + * "short_epg_id": "43100016e3d", + * "name": "ARD-TEST-1", + * "logo": "", + * "bouquetnr": "1" + * }, * [...snip...] - * {"number": "26", "id": "11aa044d00016dcf", "short_id": "44d00016dcf", "name": "WDR Köln", "logo": "", "bouquetnr": "1"}] - * }} + * { + * "number": "1376", + * "id": "ffffffffa8aae742", + * "short_id": "ffffa8aae742", + * "epg_id": "6e5d040f00012887", + * "short_epg_id": "40f00012887", + * "name": "Tagesschau24 (WebTV)", + * "logo": "/share/tuxbox/neutrino/icons/logo/ffffa8aae742.png", + * "bouquetnr": "1" + * } + * ] + * } + * } * @endcode * * @par output (plain) output only (channel number, channel id, channel name) @@ -1182,10 +1246,8 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * @endcode * @code * 1 12ea043100016e3d ARD-TEST-1 - * 2 4792041b00017034 arte * [...snip...] - * 25 4792041b00017036 Test-R - * 26 11aa044d00016dcf WDR Köln + * 1376 ffffffffa8aae742 Tagesschau24 (WebTV) * @endcode * * @par output (xml) @@ -1196,21 +1258,25 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * * * 1 - * 1 * 12ea043100016e3d * 43100016e3d + * 12ea043100016e3d + * 43100016e3d * * + * 1 * * [...snip...] * - * 26 + * 1376 + * ffffffffa8aae742 + * ffffa8aae742 + * 6e5d040f00012887 + * 40f00012887 + * + * * 1 - * 11aa044d00016dcf - * 44d00016dcf - * - * - * + * * * @endcode */ @@ -1314,7 +1380,9 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) * { * "id": "361d03f300012b66", * "short_id": "3f300012b66", - * "name": "ZDFHD", + * "epg_id": "361d03f300012b66", + * "short_epg_id": "3f300012b66", + * "name": "ZDF HD", * "logo": "/share/tuxbox/neutrino/icons/logo/3f300012b66.png" * } * ] @@ -1481,9 +1549,17 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ { std::string result = ""; std::string channelData = ""; + + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), true); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); - channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); + channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); + channelData += hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id), true); + channelData += hh->outPair("short_epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); if (bouquetnr > -1) channelData += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), false); if (hh->outType == json) @@ -1492,11 +1568,6 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ CChannelEventList::iterator eventIterator; bool isFirstLine = true; - t_channel_id epg_id = channel_id; - CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); - if (ch) - epg_id = ch->getEpgID(); - CChannelEventList eList; CEitManager::getInstance()->getEventsServiceKey(epg_id, eList); @@ -1509,6 +1580,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ prog += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), true); prog += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + prog += hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id), true); prog += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), true); prog += hh->outPair("eventid_hex", string_printf("%llx", eventIterator->eventID), true); prog += hh->outPair("start_sec", string_printf("%ld", eventIterator->startTime), true); @@ -1748,11 +1820,17 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if( (eventIterator->startTime+eventIterator->duration) < u_azeit) continue; + t_channel_id channel_id = eventIterator->channelID; + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + struct tm *tmStartZeit = localtime(&eventIterator->startTime); item.clear(); if (hh->outType == json || hh->outType == xml) { - item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); + item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(channel_id), true); item += hh->outPair("epgtitle", hh->outValue(epg.title), true); if (return_epginfo) { item += hh->outPair("info1", hh->outValue(epg.info1), true); @@ -1776,7 +1854,8 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); item += hh->outPair("time", tmpstr, true); item += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); - item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); + item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + item += hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id), true); item += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), false); result += hh->outArrayItem("item", item, got_next); @@ -1794,7 +1873,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) datetimer_str += tmpstr; result += hh->outSingle(datetimer_str); - result += hh->outSingle(NeutrinoAPI->GetServiceName(eventIterator->channelID)); + result += hh->outSingle(NeutrinoAPI->GetServiceName(channel_id)); result += hh->outSingle(epg.title); if (return_epginfo) { if(!epg.info1.empty()) diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index e80702b28..36873b8fc 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -85,6 +85,7 @@ private: void GetBouquetsxmlCGI(CyhookHandler *hh); void GetUBouquetsxmlCGI(CyhookHandler *hh); void GetChannelIDCGI(CyhookHandler *hh); + void GetEpgIDCGI(CyhookHandler *hh); void GetTPChannel_IDCGI(CyhookHandler *hh); void MessageCGI(CyhookHandler *hh); void InfoCGI(CyhookHandler *hh); From 7ee31ecf632f90dd0972cacc0ebdfce1963dd038 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 9 Nov 2016 17:13:43 +0100 Subject: [PATCH 22/24] controlapi: fix compiler warning error: declaration of 'channel_id' shadows a previous local Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/703caef3f6a1e97d82ecd043f06ee4fda78a5723 Author: vanhofen Date: 2016-11-09 (Wed, 09 Nov 2016) Origin message was: ------------------ - controlapi: fix compiler warning error: declaration of 'channel_id' shadows a previous local ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index e20891282..a228f09b9 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1820,9 +1820,9 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) if( (eventIterator->startTime+eventIterator->duration) < u_azeit) continue; - t_channel_id channel_id = eventIterator->channelID; - t_channel_id epg_id = channel_id; - CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + t_channel_id chan_id = eventIterator->channelID; + t_channel_id epg_id = chan_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(chan_id); if (ch) epg_id = ch->getEpgID(); @@ -1830,7 +1830,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) item.clear(); if (hh->outType == json || hh->outType == xml) { - item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(channel_id), true); + item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(chan_id), true); item += hh->outPair("epgtitle", hh->outValue(epg.title), true); if (return_epginfo) { item += hh->outPair("info1", hh->outValue(epg.info1), true); @@ -1854,7 +1854,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); item += hh->outPair("time", tmpstr, true); item += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); - item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, chan_id), true); item += hh->outPair("epg_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, epg_id), true); item += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), false); @@ -1873,7 +1873,7 @@ void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) datetimer_str += tmpstr; result += hh->outSingle(datetimer_str); - result += hh->outSingle(NeutrinoAPI->GetServiceName(channel_id)); + result += hh->outSingle(NeutrinoAPI->GetServiceName(chan_id)); result += hh->outSingle(epg.title); if (return_epginfo) { if(!epg.info1.empty()) From 2d44820ae3db512f0ba4ca6fbe1664aace50af3f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Nov 2016 00:43:01 +0100 Subject: [PATCH 23/24] CTimerList: add menu context button to header Not to see that we have a possible submenu. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9eb9158c2f722538bfe22bc36ec15c7fcb20d8fd Author: Thilo Graf Date: 2016-11-09 (Wed, 09 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 40628f122..cb1f9d49b 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1372,8 +1372,8 @@ void CTimerList::paintItem(int pos) void CTimerList::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, "%d.%m.%Y %H:%M"); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header.enableClock(true, "%d.%m.%Y %H:%M"); header.paint(CC_SAVE_SCREEN_NO); } From c4bbe9d2c2a4ee4c38e6a03f931ffcdabb4c3629 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 10 Nov 2016 09:08:47 +0100 Subject: [PATCH 24/24] CMenuTarget: outsource CMenuTarget-class It's required for some inheritations into other classes if include of menue.h is not wanted Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/098905e8e18f955e6a0c863d791e6f9ad18ef23f Author: Thilo Graf Date: 2016-11-10 (Thu, 10 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/widget/menue.h | 14 +----------- src/gui/widget/menue_target.h | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 src/gui/widget/menue_target.h diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 104078179..bc527ed68 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -47,6 +47,7 @@ #include #include #include +#include "menue_target.h" extern "C" { #include #include @@ -100,19 +101,6 @@ class CActivateObserver virtual void activateNotify(const neutrino_locale_t /*OptionName*/) {} }; -class CMenuTarget -{ - protected: - std::string *valueString; - std::string valueStringTmp; - public: - CMenuTarget(){ valueString = &valueStringTmp; } - virtual ~CMenuTarget(){} - virtual void hide(){} - virtual int exec(CMenuTarget* parent, const std::string & actionKey) = 0; - virtual std::string &getValue(void) { return *valueString; } - virtual fb_pixel_t getColor(void) { return 0; } -}; class CMenuItem : public CComponentsSignals { diff --git a/src/gui/widget/menue_target.h b/src/gui/widget/menue_target.h new file mode 100644 index 000000000..772831033 --- /dev/null +++ b/src/gui/widget/menue_target.h @@ -0,0 +1,42 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifndef __MENU_TARGET__ +#define __MENU_TARGET__ + + + +class CMenuTarget +{ + protected: + std::string *valueString; + std::string valueStringTmp; + public: + CMenuTarget(){ valueString = &valueStringTmp; } + virtual ~CMenuTarget(){} + virtual void hide(){} + virtual int exec(CMenuTarget* parent, const std::string & actionKey) = 0; + virtual std::string &getValue(void) { return *valueString; } + virtual fb_pixel_t getColor(void) { return 0; } +}; + + +#endif /*__MENU_TARGET__*/