From 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 23:08:22 +0200 Subject: [PATCH 1/9] settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f77c2b897c269810c15a1780ae4918a7a0deec3d Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/system/settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 303c5e672..80d243633 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1823,7 +1823,7 @@ void CAudioPlayerGui::paintTitleBox() if (!m_titlebox) { m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); - m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->enableFrame(true, FRAME_WIDTH_MIN); m_titlebox->setCorner(RADIUS_LARGE); } m_titlebox->paint(false); diff --git a/src/system/settings.h b/src/system/settings.h index a0d994ac0..d0a1e0951 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -1004,7 +1004,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) -#define FRAME_MIN_WIDTH 1 +#define FRAME_WIDTH_MIN 1 #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) From 8d1a669301e16544f42d7e88ffe2cef94a3d2261 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 29 Jun 2017 15:03:16 +0200 Subject: [PATCH 2/9] lib-libtuxtxt-tuxtxt.cpp avoid segfault, supplement to 6771de1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6344b352790fe63bb4c84c2d4a5fc3ab5a05029 Author: Michael Liebmann Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d5d093a6a..102efd4c1 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -47,6 +47,9 @@ static int cfg_national_subset; static int screen_x, screen_y, screen_w, screen_h; +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor=false); +void FillBorder(fb_pixel_t color, bool modeFullColor=false); + fb_pixel_t *getFBp(int *y) { if (*y < (int)var_screeninfo.yres) @@ -56,34 +59,31 @@ fb_pixel_t *getFBp(int *y) return lbb; } -void FillRect(int x, int y, int w, int h, int color) +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor/*=false*/) { - if(color < 0 || SIZECOLTABLE < color){ - printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); - return; - } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; - if (w > 0) + if (w > 0) { + fb_pixel_t col = (modeFullColor) ? color : bgra[color]; for (int count = 0; count < h; count++) { fb_pixel_t *dest0 = p; for (int i = 0; i < w; i++) - *(dest0++) = bgra[color]; + *(dest0++) = col; p += stride; } + } } - -void FillBorder(int color) +void FillBorder(fb_pixel_t color, bool modeFullColor/*=false*/) { int ys = (var_screeninfo.yres-var_screeninfo.yoffset); - FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color); - FillRect(StartX, ys ,displaywidth,StartY ,color); - FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color); + FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color, modeFullColor); + FillRect(StartX, ys ,displaywidth,StartY ,color, modeFullColor); + FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color, modeFullColor); if (screenmode == 0 ) - FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color); + FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color, modeFullColor); } int getIndexOfPageInHotlist() @@ -258,7 +258,7 @@ void RenderClearMenuLineBB(char *p, tstPageAttr *attrcol, tstPageAttr *attr) memset(p-TOPMENUCHARS, ' ', TOPMENUCHARS); /* init with spaces */ } -void ClearBB(int color) +void ClearBB(fb_pixel_t color) { FillRect(0, (var_screeninfo.yres - var_screeninfo.yoffset), var_screeninfo.xres, var_screeninfo.yres, color); } @@ -270,7 +270,7 @@ void ClearFB(int /*color*/) } #if 0 //never used -void ClearB(int color) +void ClearB(fb_pixel_t color) { FillRect(0, 0, var_screeninfo.xres, var_screeninfo.yres, color); /* framebuffer */ FillRect(0, var_screeninfo.yres, var_screeninfo.xres, var_screeninfo.yres, color); /* backbuffer */ @@ -841,7 +841,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, { *pAPy = RowAddress2Row(iAddress); /* new Active Row */ - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0 + *pAPy; int maxrow; #if TUXTXT_DEBUG @@ -892,7 +892,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, *pAPx = *pAPy = 0; /* new Active Position 0,0 */ if (*endcol == 40) /* active object */ { - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0; // + *pAPy; int maxrow; @@ -4096,7 +4096,7 @@ void RenderDRCS( //FIX ME } -void DrawVLine(int x, int y, int l, int color) +void DrawVLine(int x, int y, int l, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, 0, l); @@ -4109,7 +4109,7 @@ void DrawVLine(int x, int y, int l, int color) } } -void DrawHLine(int x, int y, int l, int color) +void DrawHLine(int x, int y, int l, fb_pixel_t color) { int ltmp; fb_pixel_t *p = getFBp(&y); @@ -4130,7 +4130,7 @@ void FillRectMosaicSeparated(int x, int y, int w, int h, int fgcolor, int bgcolo } } -void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, int color) +void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y0); MARK_FB(x0, y0, l0, h); @@ -4789,7 +4789,7 @@ void RenderChar(int Char, tstPageAttr *Attribute, int zoom, int yoffset) { for (Bit = 0x80; Bit; Bit >>= 1) { - int color; + fb_pixel_t color; if (--pixtodo < 0) break; @@ -5559,7 +5559,7 @@ void CopyBB2FB() /* adapt background of backbuffer if changed */ if (StartX > 0 && *lfb != *lbb) { - FillBorder(*lbb); + FillBorder(*lbb, true); // ClearBB(*(lfb + var_screeninfo.xres * var_screeninfo.yoffset)); } From 82f30b454dc471e8f31ae3326dc656c834e251bf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Jun 2017 17:18:06 +0200 Subject: [PATCH 3/9] settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a7ac6c0b0293660e2be11dc23439d76467b9296 Author: vanhofen Date: 2017-06-29 (Thu, 29 Jun 2017) Origin message was: ------------------ - settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/system/settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 34e022b86..6596d959b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1722,7 +1722,7 @@ void CAudioPlayerGui::paintTitleBox() if (!m_titlebox) { m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); - m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->enableFrame(true, FRAME_WIDTH_MIN); m_titlebox->setCorner(RADIUS_LARGE); } m_titlebox->paint(false); diff --git a/src/system/settings.h b/src/system/settings.h index fd72578b2..7950a6fa3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -938,7 +938,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) -#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2) +#define FRAME_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(2) #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) From 0dda6b79793300130dae484925c7be344bc3d92e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Jun 2017 19:04:10 +0200 Subject: [PATCH 4/9] src/gui/moviebrowser/mb.cpp fix segfault if m_movieSelectionHandler is NULL Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc5ba460a55a68c7db94365f97c858bc5a3cfece Author: Jacek Jendrzej Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9d3a3e27f..76161a8f7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3449,7 +3449,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + if (m_movieSelectionHandler){ + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + } mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); From 5925d73b0d973f4d051c038d1559e345a88d32bd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Jun 2017 21:35:51 +0200 Subject: [PATCH 5/9] bouquetlist: fix footer; CComponentsFooter doesn't like 0 buttons as it seems Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b3be66a93a969cfb8746c9b91c69b6c68b4629b Author: vanhofen Date: 2017-06-29 (Thu, 29 Jun 2017) Origin message was: ------------------ - bouquetlist: fix footer; CComponentsFooter doesn't like 0 buttons as it seems ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 420c5ffc7..2f9c0e07e 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -735,9 +735,19 @@ void CBouquetList::paint() // no buttons in favonly mode int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); + // FIXME: CComponentsFooter crashes again with 0 buttons as it seems + if (favonly) + { + // show an empty footer + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footer_height + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + } + else + { CComponentsFooter footer; footer.enableShadow(CC_SHADOW_ON, -1, true); footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); + } if (!Bouquets.empty()) { From 6655f0c124cef9ff7d01130e27d1b4d3b272ec29 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 30 Jun 2017 10:41:24 +0200 Subject: [PATCH 6/9] cc_frm_footer: avoid division by 0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7a95bd3acb72eca9528fb8cfe2392d641bb916d Author: vanhofen Date: 2017-06-30 (Fri, 30 Jun 2017) Origin message was: ------------------ - cc_frm_footer: avoid division by 0 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 140b74510..af86fb728 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -333,10 +333,14 @@ void CComponentsFooter::paintButtons(const int& x_pos, Font* font, bool do_save_bg) { + int lw = label_width; + if (label_count > 0 && label_width == 0) + lw = (w/label_count) - 2*cch_offset; + this->setDimensionsAll(x_pos, y_pos, w, h); this->setButtonFont(font); this->setContextButton(context_buttons); - this->setButtonLabels(content, label_count, 0, label_width ? label_width : (w/label_count) - 2*cch_offset); + this->setButtonLabels(content, label_count, 0, lw); this->paint(do_save_bg); } From defb581a0d5e3cf429f13f70e40ee9ac2a5ea153 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 30 Jun 2017 10:43:06 +0200 Subject: [PATCH 7/9] Revert "- bouquetlist: fix footer; CComponentsFooter doesn't like 0 buttons as it seems" This reverts commit 5925d73b0d973f4d051c038d1559e345a88d32bd. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/768bb1330b04638925686a69250a6f0d65acd231 Author: vanhofen Date: 2017-06-30 (Fri, 30 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 2f9c0e07e..420c5ffc7 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -735,19 +735,9 @@ void CBouquetList::paint() // no buttons in favonly mode int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - // FIXME: CComponentsFooter crashes again with 0 buttons as it seems - if (favonly) - { - // show an empty footer - frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footer_height + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - } - else - { CComponentsFooter footer; footer.enableShadow(CC_SHADOW_ON, -1, true); footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); - } if (!Bouquets.empty()) { From d5b0ebf8f18f41306196d7ff1c68a8333a8ff463 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:40:19 +0200 Subject: [PATCH 8/9] src/gui/movieplayer.cpp show FileTimeOSD only if setSpeed work Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f095b96c92dd94cdbcaf9439314e8e89faeb30c Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5ecc32a27..d90f10e64 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1534,7 +1534,8 @@ void CMoviePlayerGui::PlayFileLoop(void) makeScreenShot(); } else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || (msg == (neutrino_msg_t) g_settings.mpkey_forward)) { - int newspeed; + int newspeed = 0; + bool setSpeed = false; if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) { newspeed = (speed >= 0) ? -1 : speed - 1; } else { @@ -1547,9 +1548,10 @@ void CMoviePlayerGui::PlayFileLoop(void) if (playstate != CMoviePlayerGui::PAUSE) playstate = msg == (neutrino_msg_t) g_settings.mpkey_rewind ? CMoviePlayerGui::REW : CMoviePlayerGui::FF; updateLcd(); + setSpeed = true; } - if (!FileTimeOSD->IsVisible() && !time_forced) { + if (!FileTimeOSD->IsVisible() && !time_forced && setSpeed) { FileTimeOSD->switchMode(position, duration); time_forced = true; } From 5d38764dc896c0a815acfa5cce01785c7be68574 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:42:09 +0200 Subject: [PATCH 9/9] src/gui/movieplayer.cpp fix play icon after pause->seek Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4318615a606b426e926b7e2b395c2a253caf1304 Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d90f10e64..b087fee10 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1253,6 +1253,11 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute) { clearSubtitle(); bool res = playback->SetPosition(pos, absolute); + if(is_file_player && res && speed == 0 && playstate == CMoviePlayerGui::PAUSE){ + playstate = CMoviePlayerGui::PLAY; + speed = 1; + playback->SetSpeed(speed); + } return res; }