From 8c23e7cc90b49f45cfcf5de1a1840304cc59f666 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 01/39] CComponentsFrmClock: add members to control segment refreshing on interval Refreshing of segments is now enabled on default. In certain conditions this should be better. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/511486c404d79d1517232664fd5ed2e59ad25ec3 Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 5 ++++- src/gui/components/cc_frm_clock.h | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 0f4329ea3..a13193e09 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -87,6 +87,9 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, //set default text background behavior cc_txt_save_screen = false; + //enable refresh of all segments on each interval as default + cl_force_repaint = true; + //set default running clock properties cl_interval = interval_seconds; cl_timer = NULL; @@ -255,7 +258,7 @@ void CComponentsFrmClock::initCCLockItems() //set size, text, color of current item lbl->setDimensionsAll(x_tmp, y_tmp, w_tmp, h_tmp); lbl->setColorAll(col_frame, col_body, col_shadow); - lbl->forceTextPaint(false); + lbl->forceTextPaint(cl_force_repaint); lbl->setText(stmp, CTextBox::CENTER, cl_font, cl_col_text, cl_font_style); //init background behavior of segment diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 23eb726ce..4595edd58 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -70,6 +70,9 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///text color int cl_col_text; + ///refresh mode + bool cl_force_repaint; + ///current time format std::string cl_format; ///primary time format @@ -151,7 +154,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///returns true, if clock is running virtual bool isRun() const {return cl_timer ? true : false;}; ///set refresh interval in seconds, default value=1 (=1 sec) - virtual void setClockInterval(const int& seconds){cl_interval = seconds;}; + virtual void setClockInterval(const int& seconds){cl_interval = seconds;} ///show clock on screen virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); @@ -163,6 +166,11 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///reinitialize clock contents virtual void refresh() { initCCLockItems(); } + ///enables force to repaint of all segments on each interval, Note: repaint of all segemts is default enabled. + void enableForceSegmentPaint(bool enable = true){cl_force_repaint = enable;} + ///disables repaint of all segments on each interval, repaint happens only on changed segment value + void disableForceSegmentPaint(){enableForceSegmentPaint(false);} + /**Member to modify background behavior of embeded segment objects * @param[in] mode * @li bool, default = true From 6c68701abf070f4a8bd76300c4c9054c3480a9a2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 02/39] CCDraw: fix wrong intit values for corners and position Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6d45fbb4eb103e30ed516682d4d8b753d056e196 Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 4 ++-- src/gui/components/cc_item_shapes.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 5c4d8448b..dff34aad1 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -49,7 +49,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) fr_thickness = fr_thickness_old = 0; - corner_type = corner_type_old = CORNER_ALL; + corner_type = corner_type_old = CORNER_NONE; corner_rad = corner_rad_old = 0; shadow = CC_SHADOW_OFF; @@ -552,7 +552,7 @@ void CCDraw::paintFbItems(bool do_save_bg) } if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BACKGROUND){ - frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy); + frameBuffer->paintBackgroundBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); v_fbdata[i].is_painted = true; } } diff --git a/src/gui/components/cc_item_shapes.cpp b/src/gui/components/cc_item_shapes.cpp index dffaca928..9b55d0580 100644 --- a/src/gui/components/cc_item_shapes.cpp +++ b/src/gui/components/cc_item_shapes.cpp @@ -74,6 +74,9 @@ CComponentsShapeCircle::CComponentsShapeCircle( int x_pos, int y_pos, int diam, //CComponents x = x_pos; y = y_pos; + + corner_type = corner_type_old = CORNER_ALL; + //width = height = d = diam; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; From 239d33c1fc3b94dd3adad1b2416be8ea2a4f8dba Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 03/39] CComponentsButton: remove unused member Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9152beada992e2a2ea977f57de6edf77a088398 Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 92bf474f8..1e36bd826 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -72,8 +72,6 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen ///property: container for all assigned event message values, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKey(), hasButtonDirectKey() std::vectorcc_directKeys; - ///property: assigned an alternate event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKeyAlt(), hasButtonDirectKeyAlt() - neutrino_msg_t cc_directKeyAlt; ///property: assigned return value, see also setButtonResult(), getButtonResult(), default value = -1 (not defined) int cc_btn_result; ///property: assigned alias value, see also setButtonAlias(), getButtonAlias(), default value = -1 (not defined) From 0b5e8114ad12677e11ce89ae1cf25abb7884671b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 04/39] CComponentsItem: fix possible artefacts if fb box is smaller the radius If box height/2 is smaller than corner radius it is possible we have artefacts after killed or hided fb box. This effect only I have seen with full hd resolution, in hd ready mode it was ok. Sideeffects with this changes I have not seen, but I can't exclude. Must be watched. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bad5f02c06ed04ea41a94abe466f8de5698b1b9c Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 4a6f49faf..a0f914f0a 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -89,11 +89,16 @@ void CComponentsItem::paintInit(bool do_save_bg) //set current needed corner main box radius int box_rad = corner_type ? corner_rad : 0; - //and ensure max main box radius < dimensions - if (2*box_rad > dy) - box_rad -= max(0, 2*box_rad-dy); - if (2*box_rad > dx) - box_rad -= max(0, 2*box_rad-dy); + //and ensure max main box radius < dimensions, avoids possible fb artefacts on screen + int box_rad2 = box_rad/2; + if(box_rad2 > dy || box_rad2 > dx){ + int tmp_rad = box_rad; + if (box_rad2 > dx) + tmp_rad = (box_rad2-dx)*2; + if (box_rad2 > dy) + tmp_rad = (box_rad2-dy)*2; + box_rad = tmp_rad; + } //Workaround: ensure radius values >= 0, framebuffer methode paintBoxRel() gets confused box_rad = max(box_rad, 0); @@ -113,13 +118,12 @@ void CComponentsItem::paintInit(bool do_save_bg) int sh_cdy = box_rad+sw+th; //height //adapt shadow corner dimensions if body dimensions are too small, use an offset if required - int /*sh_cdx_size_offset,*/ sh_cdy_size_offset = 0; + int sh_cdx_size_offset, sh_cdy_size_offset = 0; if (sh_cdy*2 > dy) sh_cdy_size_offset = sh_cdy*2-dy; -#if 0 if (sh_cdx*2 > dx) sh_cdx_size_offset = sh_cdx*2-dx; -#endif + //handle shadow positions //...corner bottom right int sh_cbr_x = ix+dx-sh_cdx+sw; From 30006a4d5a94bfd83de46e71853247b6cbda8a1a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 05/39] CCDraw: remove some debug lines, and override comparisons This should reduce some effort in this method. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/62a2a29a123c07357e550c4fdf8b12fa3a1d325b Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index dff34aad1..dbca41d93 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -497,16 +497,6 @@ void CCDraw::paintFbItems(bool do_save_bg) break; } - dprintf(DEBUG_DEBUG, "[CCDraw]\n\t[%s - %d] firstPaint->save screen: %d, fbdata_type: %d\n\tx = %d\n\ty = %d\n\tdx = %d\n\tdy = %d\n", - __func__, - __LINE__, - firstPaint, - v_fbdata[i].fbdata_type, - v_fbdata[i].x, - v_fbdata[i].y, - v_fbdata[i].dx, - v_fbdata[i].dy); - /* Here we save the background of current box before paint. * Only the reserved fbdata type CC_FBDATA_TYPE_BGSCREEN is here required and is used for this. * This pixel buffer is required for the hide() method that will @@ -524,20 +514,15 @@ void CCDraw::paintFbItems(bool do_save_bg) for(size_t i=0; i< v_fbdata.size(); i++){ cc_fbdata_t& fbdata = v_fbdata[i]; - // Don't paint on dimension or position error dx or dy are 0. - if (!CheckFbData(fbdata, __func__, __LINE__)){ - continue; - } int fbtype = fbdata.fbdata_type; - dprintf(DEBUG_DEBUG, "[CCDraw]\n\t[%s - %d], fbdata_[%d]\n\tx = %d\n\ty = %d\n\tdx = %d\n\tdy = %d\n", - __func__, - __LINE__, - (int)i, - fbdata.x, - fbdata.y, - fbdata.dx, - fbdata.dy); + //ignore bg screen layer + if (fbtype == CC_FBDATA_TYPE_BGSCREEN) + continue; + + // Don't paint on dimension or position error dx or dy are 0. + if (!CheckFbData(fbdata, __func__, __LINE__)) + continue; /* Paint all fb relevant basic parts (shadow, frame and body) * with all specified properties, paint_bg must be enabled. @@ -548,12 +533,14 @@ void CCDraw::paintFbItems(bool do_save_bg) frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); v_fbdata[i].is_painted = true; } + continue; } } if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BACKGROUND){ frameBuffer->paintBackgroundBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); v_fbdata[i].is_painted = true; + continue; } } if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { @@ -575,6 +562,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); fbdata.is_painted = true; } + continue; } } if (paint_bg){ From ae01284ad5bf020ada88f4222d9e5b58c9a6ce1a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 06/39] CComponentsHeader: add methode initRepaintSlot() and considered parent Required in sub classes. Considering of parent ensures usage of required background color in sub classes. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e342a7661562312fb4677a35268f4f7190913ed Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 12 ++++++++---- src/gui/components/cc_frm_header.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f66b7a387..acdee9363 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -136,13 +136,17 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; - //init slot before re paint of header, paint() is already done - sl_form_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::kill), col_body, -1, CC_FBDATA_TYPES, false); - OnBeforeRePaint.connect(sl_form_repaint); - addContextButton(buttons); initCCItems(); initParent(parent); + + //init repaint slot before re paint of body, if paint() is already done + initRepaintSlot(); +} + +void CComponentsHeader::initRepaintSlot(){ + sl_form_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::kill), cc_parent ? col_body : 0, -1, CC_FBDATA_TYPES, false); + OnBeforeRePaint.connect(sl_form_repaint); } CComponentsHeader::~CComponentsHeader() diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 7f75f2fd7..eb4a6d607 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -112,6 +112,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen void initButtons(); ///sub: init clock object void initClock(); + ///int repaint slot + void initRepaintSlot(); public: enum From aff38bfe4bb5503b08af63056d695762941cef5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH 07/39] CComponentsFooter: add missing member inits Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/47fceca1886e907382e0279f3f3c2778426ee6b7 Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 63c9f4cf9..853b4465a 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -63,11 +63,11 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const { cc_item_type = CC_ITEMTYPE_FOOTER; - x = x_pos; - y = y_pos; + x = x_old = x_pos; + y = y_old = y_pos; //init footer width - width = w == 0 ? frameBuffer->getScreenWidth(true) : w; + width = width_old = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init default fonts initDefaultFonts(); @@ -77,15 +77,15 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const //init footer height initCaptionFont(); - height = max(h, cch_font->getHeight()); + height = height_old = max(h, cch_font->getHeight()); shadow = shadow_mode; ccf_enable_button_shadow = false ; ccf_button_shadow_width = shadow ? OFFSET_SHADOW/2 : 0; ccf_button_shadow_force_paint = false; - col_frame = color_frame; - col_body = color_body; - col_shadow = color_shadow; + col_frame = col_frame_old = color_frame; + col_body = col_body_old = color_body; + col_shadow = col_shadow_old = color_shadow; cc_body_gradient_enable = cc_body_gradient_enable_old = CC_COLGRAD_OFF/*g_settings.theme.menu_ButtonBar_gradient*/; //TODO: not complete implemented at the moment cc_body_gradient_direction = CFrameBuffer::gradientVertical; cc_body_gradient_mode = CColorGradient::gradientDark2Light; @@ -100,6 +100,9 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const addContextButton(buttons); initCCItems(); initParent(parent); + + //init repaint slot before re paint of body, if paint() is already done + initRepaintSlot(); } void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) From 16480e20bd026ff358baa953be5f65d4e269a0db Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 8 Apr 2017 08:24:41 +0200 Subject: [PATCH 08/39] CComponentsItem: disable unused variable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6135a827da54b5a8d2c470b2122ef8de44c8d755 Author: Thilo Graf Date: 2017-04-08 (Sat, 08 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index a0f914f0a..b783f82d8 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -118,11 +118,11 @@ void CComponentsItem::paintInit(bool do_save_bg) int sh_cdy = box_rad+sw+th; //height //adapt shadow corner dimensions if body dimensions are too small, use an offset if required - int sh_cdx_size_offset, sh_cdy_size_offset = 0; + int /*sh_cdx_size_offset = 0,*/ sh_cdy_size_offset = 0; if (sh_cdy*2 > dy) sh_cdy_size_offset = sh_cdy*2-dy; - if (sh_cdx*2 > dx) - sh_cdx_size_offset = sh_cdx*2-dx; +// if (sh_cdx*2 > dx) +// sh_cdx_size_offset = sh_cdx*2-dx; //handle shadow positions //...corner bottom right From b0231efacfe759d68f846e5d13e7226b8e32fe58 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 09/39] epgplus.h: reformat; no binary changes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/491efb3a05d83be40856cb87dd8018c9acc54187 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus.h: reformat; no binary changes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.h | 888 ++++++++++++++++++++++------------------------ 1 file changed, 431 insertions(+), 457 deletions(-) diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 0dd02bca7..4d2c097fc 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -1,37 +1,29 @@ /* - Neutrino-GUI - DBoxII-Project + Neutrino-GUI - DBoxII-Project - Copyright (C) 2001 Steffen Hehn 'McClean' - Copyright (C) 2004 Martin Griep 'vivamiga' + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2004 Martin Griep 'vivamiga' + Copyright (C) 2017 Sven Hoefer - Kommentar: + License: GPL - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + 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. - 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef __EPGPLUS_HPP__ -#define __EPGPLUS_HPP__ +#ifndef __epgplus__ +#define __epgplus__ #include "widget/menue.h" @@ -45,506 +37,488 @@ struct button_label; class EpgPlus { -//// types, inner classes -public: - enum FontSettingID - { - EPGPlus_header_font = 0, - EPGPlus_timeline_fonttime, - EPGPlus_timeline_fontdate, - EPGPlus_channelentry_font, - EPGPlus_channelevententry_font, - EPGPlus_footer_fontbouquetchannelname, - EPGPlus_footer_fonteventdescription, - EPGPlus_footer_fonteventshortdescription, - EPGPlus_footer_fontbuttons, - NumberOfFontSettings - }; - - enum SizeSettingID - { - EPGPlus_channelentry_width = 0, - EPGPlus_channelentry_separationlineheight, - EPGPlus_slider_width, - EPGPlus_horgap1_height, - EPGPlus_horgap2_height, - EPGPlus_vergap1_width, - EPGPlus_vergap2_width, - NumberOfSizeSettings - }; - - struct FontSetting - { - FontSettingID settingID; - const char* style; - int size; - }; - - struct SizeSetting - { - SizeSettingID settingID; - int size; - }; - - - enum TViewMode - { - ViewMode_Stretch, - ViewMode_Scroll - }; - - enum TSwapMode - { - SwapMode_ByPage, - SwapMode_ByBouquet - }; - - class Footer; - - class Header - { - //// construction / destruction - public: - Header ( CFrameBuffer* frameBuffer , int x , int y , int width); - - ~Header(); - - //// methods - public: - static void init(); - - void paint(const char * Name = NULL); - - static int getUsedHeight(); - - //// attributes - public: - CFrameBuffer* frameBuffer; - - int x; - int y; - int width; - - static Font* font; - }; - - - class TimeLine - { - //// construction / destruction - public: - TimeLine ( CFrameBuffer* frameBuffer , int x , int y , int width , int startX , int durationX); - - ~TimeLine(); - - //// methods - public: - static void init(); - - void paint ( time_t startTime , int duration); - - void paintMark ( time_t startTime , int duration , int x , int width); - - void paintGrid(); - - void clearMark(); - - static int getUsedHeight(); - - //// attributes - public: - CFrameBuffer* frameBuffer; - - int currentDuration; - - int x; - int y; - int width; - - static Font* fontTime; - static Font* fontDate; - - int startX; - int durationX; - }; + //// types, inner classes + public: + enum FontSettingID + { + EPGPlus_header_font = 0, + EPGPlus_timeline_fonttime, + EPGPlus_timeline_fontdate, + EPGPlus_channelentry_font, + EPGPlus_channelevententry_font, + EPGPlus_footer_fontbouquetchannelname, + EPGPlus_footer_fonteventdescription, + EPGPlus_footer_fonteventshortdescription, + EPGPlus_footer_fontbuttons, + NumberOfFontSettings + }; + + enum SizeSettingID + { + EPGPlus_channelentry_width = 0, + EPGPlus_channelentry_separationlineheight, + EPGPlus_slider_width, + EPGPlus_horgap1_height, + EPGPlus_horgap2_height, + EPGPlus_vergap1_width, + EPGPlus_vergap2_width, + NumberOfSizeSettings + }; + + struct FontSetting + { + FontSettingID settingID; + const char* style; + int size; + }; + + struct SizeSetting + { + SizeSettingID settingID; + int size; + }; + + enum TViewMode + { + ViewMode_Stretch, + ViewMode_Scroll + }; + + enum TSwapMode + { + SwapMode_ByPage, + SwapMode_ByBouquet + }; + + class Footer; + + class Header + { + //// construction / destruction + public: + Header(CFrameBuffer* frameBuffer, + int x, + int y, + int width); + + ~Header(); + + //// methods + public: + static void init(); + + void paint(const char * Name = NULL); + + static int getUsedHeight(); + + //// attributes + public: + CFrameBuffer* frameBuffer; + + int x; + int y; + int width; + + static Font* font; + }; + + + class TimeLine + { + //// construction / destruction + public: + TimeLine(CFrameBuffer* frameBuffer, + int x, + int y, + int width, + int startX, + int durationX); + + ~TimeLine(); + + //// methods + public: + static void init(); + + void paint(time_t startTime, int duration); + + void paintMark(time_t startTime, int duration, int x, int width); + + void paintGrid(); + + void clearMark(); + + static int getUsedHeight(); + + //// attributes + public: + CFrameBuffer* frameBuffer; - class ChannelEventEntry - { - //// construction / destruction - public: - ChannelEventEntry - ( const CChannelEvent* channelEvent - , CFrameBuffer* frameBuffer - , TimeLine* timeLine - , Footer* footer - , int x - , int y - , int width - ); + int currentDuration; - ~ChannelEventEntry(); + int x; + int y; + int width; - //// methods - public: - static void init(); + static Font* fontTime; + static Font* fontDate; - bool isSelected - ( time_t selectedTime - ) const; + int startX; + int durationX; + }; - void paint - ( bool isSelected - , bool toggleColor - ); + class ChannelEventEntry + { + //// construction / destruction + public: + ChannelEventEntry(const CChannelEvent* channelEvent, + CFrameBuffer* frameBuffer, + TimeLine* timeLine, + Footer* footer, + int x, + int y, + int width); - static int getUsedHeight(); + ~ChannelEventEntry(); - //// attributes - public: - CChannelEvent channelEvent; + //// methods + public: + static void init(); - CFrameBuffer* frameBuffer; - TimeLine* timeLine; - Footer* footer; + bool isSelected(time_t selectedTime) const; - int x; - int y; - int width; - static int separationLineHeight; + void paint(bool isSelected, bool toggleColor); - static Font* font; - }; + static int getUsedHeight(); - typedef std::vector TCChannelEventEntries; + //// attributes + public: + CChannelEvent channelEvent; - class ChannelEntry - { - //// construction / destruction - public: - ChannelEntry - ( const CZapitChannel* channel - , int index - , CFrameBuffer* frameBuffer - , Footer* footer - , CBouquetList* bouquetList - , int x - , int y - , int width - ); + CFrameBuffer* frameBuffer; + TimeLine* timeLine; + Footer* footer; - ~ChannelEntry(); + int x; + int y; + int width; + static int separationLineHeight; - //// methods - public: - static void init(); + static Font* font; + }; - void paint - ( bool isSelected - , time_t selectedTime - ); + typedef std::vector TCChannelEventEntries; - static int getUsedHeight(); + class ChannelEntry + { + //// construction / destruction + public: + ChannelEntry(const CZapitChannel* channel, + int index, + CFrameBuffer* frameBuffer, + Footer* footer, + CBouquetList* bouquetList, + int x, + int y, + int width); - //// attributes - public: - const CZapitChannel * channel; - std::string displayName; - int index; - - CFrameBuffer* frameBuffer; - Footer* footer; - CBouquetList* bouquetList; - - int x; - int y; - int width; - static int separationLineHeight; - - static Font* font; - - TCChannelEventEntries channelEventEntries; - }; - - typedef std::vector TChannelEntries; - - class Footer - { - //// construction / destruction - public: - Footer - ( CFrameBuffer* frameBuffer - , int x - , int y - , int width - , int height - ); + ~ChannelEntry(); - ~Footer(); + //// methods + public: + static void init(); - //// methods - public: - static void init(); + void paint(bool isSelected, time_t selectedTime); - void setBouquetChannelName - ( const std::string& newBouquetName - , const std::string& newChannelName - ); + static int getUsedHeight(); - void paintEventDetails - ( const std::string& description - , const std::string& shortDescription - ); + //// attributes + public: + const CZapitChannel * channel; + std::string displayName; + int index; - void paintButtons - ( button_label* buttonLabels - , int numberOfButtons - ); + CFrameBuffer* frameBuffer; + Footer* footer; + CBouquetList* bouquetList; - static int getUsedHeight(); + int x; + int y; + int width; + static int separationLineHeight; - //// attributes - public: - CFrameBuffer* frameBuffer; + static Font* font; - int x; - int y; - int width; - int buttonHeight; + TCChannelEventEntries channelEventEntries; + }; - static Font* fontBouquetChannelName; - static Font* fontEventDescription; - static Font* fontEventShortDescription; - static Font* fontButtons; + typedef std::vector TChannelEntries; - static int color; + class Footer + { + //// construction / destruction + public: + Footer(CFrameBuffer* frameBuffer, + int x, + int y, + int width, + int height); - std::string currentBouquetName; - std::string currentChannelName; - }; + ~Footer(); + //// methods + public: + static void init(); - class MenuTargetAddReminder : public CMenuTarget - { - public: - MenuTargetAddReminder ( EpgPlus* epgPlus); + void setBouquetChannelName(const std::string& newBouquetName, const std::string& newChannelName); - public: - int exec ( CMenuTarget* parent , const std::string& actionKey); + void paintEventDetails(const std::string& description, const std::string& shortDescription); - private: - EpgPlus* epgPlus; + void paintButtons(button_label* buttonLabels, int numberOfButtons); - }; + static int getUsedHeight(); - class MenuTargetAddRecordTimer : public CMenuTarget - { - public: - MenuTargetAddRecordTimer ( EpgPlus* epgPlus); + //// attributes + public: + CFrameBuffer* frameBuffer; - public: - int exec ( CMenuTarget* parent , const std::string& actionKey); + int x; + int y; + int width; + int buttonHeight; - private: - EpgPlus* epgPlus; + static Font* fontBouquetChannelName; + static Font* fontEventDescription; + static Font* fontEventShortDescription; + static Font* fontButtons; - }; + static int color; - class MenuTargetRefreshEpg : public CMenuTarget - { - public: - MenuTargetRefreshEpg ( EpgPlus* epgPlus); + std::string currentBouquetName; + std::string currentChannelName; + }; - public: - int exec ( CMenuTarget* parent , const std::string& actionKey); + class MenuTargetAddReminder : public CMenuTarget + { + public: + MenuTargetAddReminder(EpgPlus* epgPlus); - private: - EpgPlus* epgPlus; + public: + int exec(CMenuTarget* parent, const std::string& actionKey); - }; + private: + EpgPlus* epgPlus; - class MenuOptionChooserSwitchSwapMode : public CMenuOptionChooser - { - public: - MenuOptionChooserSwitchSwapMode ( EpgPlus* epgPlus); + }; - virtual ~MenuOptionChooserSwitchSwapMode(); + class MenuTargetAddRecordTimer : public CMenuTarget + { + public: + MenuTargetAddRecordTimer(EpgPlus* epgPlus); - public: - int exec - ( CMenuTarget* parent); + public: + int exec(CMenuTarget* parent, const std::string& actionKey); - private: - int oldTimingMenuSettings; - TSwapMode oldSwapMode; - EpgPlus* epgPlus; - }; + private: + EpgPlus* epgPlus; - class MenuOptionChooserSwitchViewMode : public CMenuOptionChooser - { - public: - MenuOptionChooserSwitchViewMode ( EpgPlus* epgPlus); + }; - virtual ~MenuOptionChooserSwitchViewMode(); + class MenuTargetRefreshEpg : public CMenuTarget + { + public: + MenuTargetRefreshEpg(EpgPlus* epgPlus); - public: - int exec ( CMenuTarget* parent); + public: + int exec(CMenuTarget* parent, const std::string& actionKey); - private: - int oldTimingMenuSettings; - }; + private: + EpgPlus* epgPlus; - class MenuTargetSettings : public CMenuTarget - { - public: - MenuTargetSettings ( EpgPlus* epgPlus); + }; - public: - int exec ( CMenuTarget* parent , const std::string& actionKey); + class MenuOptionChooserSwitchSwapMode : public CMenuOptionChooser + { + public: + MenuOptionChooserSwitchSwapMode(EpgPlus* epgPlus); - private: - EpgPlus* epgPlus; - }; + virtual ~MenuOptionChooserSwitchSwapMode(); - typedef time_t DurationSetting; + public: + int exec(CMenuTarget* parent); -/* - struct Settings - { - Settings ( bool doInit = true); + private: + EpgPlus* epgPlus; + int oldTimingMenuSettings; + TSwapMode oldSwapMode; + }; - virtual ~Settings(); + class MenuOptionChooserSwitchViewMode : public CMenuOptionChooser + { + public: + MenuOptionChooserSwitchViewMode(EpgPlus* epgPlus); - FontSetting* fontSettings; - SizeSetting* sizeSettings; - DurationSetting durationSetting; - }; - typedef std::map Fonts; - typedef std::map Sizes; - static Font * fonts[NumberOfFontSettings]; - static int sizes[NumberOfSizeSettings]; -*/ + virtual ~MenuOptionChooserSwitchViewMode(); - friend class EpgPlus::MenuOptionChooserSwitchSwapMode; - friend class EpgPlus::MenuOptionChooserSwitchViewMode; - friend class EpgPlus::ChannelEntry; - friend class EpgPlus::ChannelEventEntry; + public: + int exec(CMenuTarget* parent); -//// construction / destruction -public: - EpgPlus(); - ~EpgPlus(); + private: + int oldTimingMenuSettings; + }; -//// methods -public: - void init(); - void free(); + class MenuTargetSettings : public CMenuTarget + { + public: + MenuTargetSettings(EpgPlus* epgPlus); - int exec ( CChannelList* channelList , int selectedChannelIndex , CBouquetList* bouquetList); + public: + int exec(CMenuTarget* parent, const std::string& actionKey); -private: - static std::string getTimeString ( const time_t& time , const std::string& format); + private: + EpgPlus* epgPlus; + }; - TCChannelEventEntries::const_iterator getSelectedEvent() const; + typedef time_t DurationSetting; - void createChannelEntries ( int selectedChannelEntryIndex); - void paint(); - void paintChannelEntry ( int position); - void hide(); - -//// properties -private: - CFrameBuffer* frameBuffer; - - TChannelEntries displayedChannelEntries; + /* + struct Settings + { + Settings(bool doInit = true); - Header* header; - TimeLine* timeLine; - - CChannelList* channelList; - CBouquetList* bouquetList; - - Footer* footer; - - ChannelEntry* selectedChannelEntry; - time_t selectedTime; - - int channelListStartIndex; - int maxNumberOfDisplayableEntries; // maximal number of displayable entrys - - time_t startTime; - time_t firstStartTime; - static time_t duration; - - int entryHeight; - - TViewMode currentViewMode; - TSwapMode currentSwapMode; - - int headerX; - int headerY; - int headerWidth; - - int usableScreenWidth; - int usableScreenHeight; - int usableScreenX; - int usableScreenY; - - int timeLineX; - int timeLineY; - int timeLineWidth; - - int channelsTableX; - int channelsTableY; - static int channelsTableWidth; - int channelsTableHeight; - - int eventsTableX; - int eventsTableY; - int eventsTableWidth; - int eventsTableHeight; - - int sliderX; - int sliderY; - static int sliderWidth; - int sliderHeight; - static int sliderBackColor; - static int sliderKnobColor; - - int footerX; - int footerY; - int footerWidth; - - int horGap1X; - int horGap1Y; - int horGap1Width; - int horGap2X; - int horGap2Y; - int horGap2Width; - int verGap1X; - int verGap1Y; - int verGap1Height; - int verGap2X; - int verGap2Y; - int verGap2Height; - - static int horGap1Height; - static int horGap2Height; - static int verGap1Width; - static int verGap2Width; - - static int horGap1Color; - static int horGap2Color; - static int verGap1Color; - static int verGap2Color; + virtual ~Settings(); - bool refreshAll; - bool refreshFooterButtons; + FontSetting* fontSettings; + SizeSetting* sizeSettings; + DurationSetting durationSetting; + }; + typedef std::map Fonts; + typedef std::map Sizes; + static Font * fonts[NumberOfFontSettings]; + static int sizes[NumberOfSizeSettings]; + */ + + friend class EpgPlus::ChannelEventEntry; + friend class EpgPlus::ChannelEntry; + friend class EpgPlus::MenuOptionChooserSwitchSwapMode; + friend class EpgPlus::MenuOptionChooserSwitchViewMode; + + //// construction / destruction + public: + EpgPlus(); + ~EpgPlus(); + + //// methods + public: + void init(); + void free(); + + int exec(CChannelList* channelList, int selectedChannelIndex, CBouquetList* bouquetList); + + private: + static std::string getTimeString(const time_t& time, const std::string& format); + + TCChannelEventEntries::const_iterator getSelectedEvent() const; + + void createChannelEntries(int selectedChannelEntryIndex); + void paint(); + void paintChannelEntry(int position); + void hide(); + + //// properties + private: + CFrameBuffer* frameBuffer; + + TChannelEntries displayedChannelEntries; + + Header* header; + TimeLine* timeLine; + + CChannelList* channelList; + CBouquetList* bouquetList; + + Footer* footer; + + ChannelEntry* selectedChannelEntry; + time_t selectedTime; + + int channelListStartIndex; + int maxNumberOfDisplayableEntries; // maximal number of displayable entrys + + time_t startTime; + time_t firstStartTime; + static time_t duration; + + int entryHeight; + + TViewMode currentViewMode; + TSwapMode currentSwapMode; + + int headerX; + int headerY; + int headerWidth; + + int usableScreenWidth; + int usableScreenHeight; + int usableScreenX; + int usableScreenY; + + int timeLineX; + int timeLineY; + int timeLineWidth; + + int channelsTableX; + int channelsTableY; + static int channelsTableWidth; + int channelsTableHeight; + + int eventsTableX; + int eventsTableY; + int eventsTableWidth; + int eventsTableHeight; + + int sliderX; + int sliderY; + static int sliderWidth; + int sliderHeight; + static int sliderBackColor; + static int sliderKnobColor; + + int footerX; + int footerY; + int footerWidth; + + int horGap1X; + int horGap1Y; + int horGap1Width; + int horGap2X; + int horGap2Y; + int horGap2Width; + int verGap1X; + int verGap1Y; + int verGap1Height; + int verGap2X; + int verGap2Y; + int verGap2Height; + + static int horGap1Height; + static int horGap2Height; + static int verGap1Width; + static int verGap2Width; + + static int horGap1Color; + static int horGap2Color; + static int verGap1Color; + static int verGap2Color; + + bool refreshAll; + bool refreshFooterButtons; }; class CEPGplusHandler : public CMenuTarget { public: - int exec( CMenuTarget* parent, const std::string &actionKey); + int exec(CMenuTarget* parent, const std::string &actionKey); }; -#endif +#endif // __epgplus__ From 73303317411a6a4f384f0261824590a2d1f4b2ca Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 10/39] epgplus.cpp: reformat; no binary changes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/895624b87841951a606e14279eedd3691eb18daa Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus.cpp: reformat; no binary changes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 880 +++++++++++++++++++++++++------------------- 1 file changed, 508 insertions(+), 372 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index a5e075a91..46b4cc261 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -4,6 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2004 Martin Griep 'vivamiga' Copyright (C) 2009-2014 Stefan Seyfried + Copyright (C) 2017 Sven Hoefer License: GPL @@ -59,8 +60,8 @@ #include #include -#define COL_MENUCONTENT_P1 COL_MENUCONTENT_TEXT_PLUS_1 -#define COL_MENUCONTENT_P2 COL_MENUCONTENT_TEXT_PLUS_2 +#define COL_MENUCONTENT_P1 COL_MENUCONTENT_TEXT_PLUS_1 +#define COL_MENUCONTENT_P2 COL_MENUCONTENT_TEXT_PLUS_2 extern CBouquetList *bouquetList; Font * fonts[EpgPlus::NumberOfFontSettings]; @@ -81,7 +82,8 @@ int EpgPlus::verGap2Color = 0; int EpgPlus::sliderWidth = 0; int EpgPlus::channelsTableWidth = 0; -static EpgPlus::FontSetting fontSettingTable[] = { +static EpgPlus::FontSetting fontSettingTable[] = +{ { EpgPlus::EPGPlus_header_font, "Regular", 27 }, { EpgPlus::EPGPlus_timeline_fonttime, "Bold", 16 }, { EpgPlus::EPGPlus_timeline_fontdate, "Bold", 14 }, @@ -94,7 +96,8 @@ static EpgPlus::FontSetting fontSettingTable[] = { }; /* negative size means "screen width in percent" */ -static EpgPlus::SizeSetting sizeSettingTable[] = { +static EpgPlus::SizeSetting sizeSettingTable[] = +{ {EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ {EpgPlus::EPGPlus_channelentry_separationlineheight, 2}, {EpgPlus::EPGPlus_slider_width, 15}, @@ -109,7 +112,7 @@ static int current_bouquet; Font *EpgPlus::Header::font = NULL; -EpgPlus::Header::Header (CFrameBuffer * pframeBuffer, int px, int py, int pwidth) +EpgPlus::Header::Header(CFrameBuffer * pframeBuffer, int px, int py, int pwidth) { this->frameBuffer = pframeBuffer; this->x = px; @@ -128,7 +131,7 @@ void EpgPlus::Header::init() void EpgPlus::Header::paint(const char * Name) { - std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); + std::string head = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD); CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight()+4, head); _header.paint(CC_SAVE_SCREEN_NO); @@ -142,7 +145,7 @@ int EpgPlus::Header::getUsedHeight() Font *EpgPlus::TimeLine::fontTime = NULL; Font *EpgPlus::TimeLine::fontDate = NULL; -EpgPlus::TimeLine::TimeLine (CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX) +EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX) { this->frameBuffer = pframeBuffer; this->x = px; @@ -162,7 +165,7 @@ EpgPlus::TimeLine::~TimeLine() { } -void EpgPlus::TimeLine::paint (time_t _startTime, int pduration) +void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) { this->clearMark(); @@ -175,32 +178,33 @@ void EpgPlus::TimeLine::paint (time_t _startTime, int pduration) bool toggleColor = false; // display date of begin - this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->fontTime->getHeight() - , toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->fontTime->getHeight(), + toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); - this->fontDate->RenderString (this->x + 4, this->y + this->fontDate->getHeight() - , this->width, EpgPlus::getTimeString (_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); + this->fontDate->RenderString(this->x + 4, this->y + this->fontDate->getHeight(), + this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks - for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) { + for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) + { int xWidth = tickDist; if (xPos + xWidth > this->x + width) xWidth = this->x + width - xPos; - this->frameBuffer->paintBoxRel (xPos, this->y, xWidth, this->fontTime->getHeight() - , toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2); + this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->fontTime->getHeight(), + toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2); - std::string timeStr = EpgPlus::getTimeString (tickTime, "%H"); + std::string timeStr = EpgPlus::getTimeString(tickTime, "%H"); - int textWidth = this->fontTime->getRenderWidth (timeStr); + int textWidth = this->fontTime->getRenderWidth(timeStr); - this->fontTime->RenderString (xPos - textWidth - 4, this->y + this->fontTime->getHeight() - , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); + this->fontTime->RenderString(xPos - textWidth - 4, this->y + this->fontTime->getHeight(), + textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); - timeStr = EpgPlus::getTimeString (tickTime, "%M"); - textWidth = this->fontTime->getRenderWidth (timeStr); - this->fontTime->RenderString (xPos + 4, this->y + this->fontTime->getHeight() - , textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); + timeStr = EpgPlus::getTimeString(tickTime, "%M"); + textWidth = this->fontTime->getRenderWidth(timeStr); + this->fontTime->RenderString(xPos + 4, this->y + this->fontTime->getHeight(), + textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); toggleColor = !toggleColor; } @@ -212,57 +216,60 @@ void EpgPlus::TimeLine::paintGrid() int numberOfTicks = this->currentDuration / (60 * 60) * 2; int tickDist = (this->durationX) / numberOfTicks; // paint ticks - for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist) { + for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist) + { // display a line for the tick - this->frameBuffer->paintVLineRel (xPos, this->y, this->fontTime->getHeight(), COL_MENUCONTENT_PLUS_5); + this->frameBuffer->paintVLineRel(xPos, this->y, this->fontTime->getHeight(), COL_MENUCONTENT_PLUS_5); } } -void EpgPlus::TimeLine::paintMark (time_t _startTime, int pduration, int px, int pwidth) +void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int pwidth) { // clear old mark this->clearMark(); // paint new mark - this->frameBuffer->paintBoxRel (px, this->y + this->fontTime->getHeight() - , pwidth, this->fontTime->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); + this->frameBuffer->paintBoxRel(px, this->y + this->fontTime->getHeight(), + pwidth, this->fontTime->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); // display start time before mark - std::string timeStr = EpgPlus::getTimeString (_startTime, "%H:%M"); - int textWidth = this->fontTime->getRenderWidth (timeStr); + std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M"); + int textWidth = this->fontTime->getRenderWidth(timeStr); - this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENT_TEXT); + this->fontTime->RenderString(px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark - timeStr = EpgPlus::getTimeString (_startTime + pduration, "%H:%M"); - textWidth = fontTime->getRenderWidth (timeStr); + timeStr = EpgPlus::getTimeString(_startTime + pduration, "%H:%M"); + textWidth = fontTime->getRenderWidth(timeStr); - if (px + pwidth + textWidth < this->x + this->width) { - this->fontTime->RenderString (px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENT_TEXT); - } else if (textWidth < pwidth - 10) { - this->fontTime->RenderString (px + pwidth - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() - , textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); + if (px + pwidth + textWidth < this->x + this->width) + { + this->fontTime->RenderString(px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + textWidth, timeStr, COL_MENUCONTENT_TEXT); + } + else if (textWidth < pwidth - 10) + { + this->fontTime->RenderString(px + pwidth - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); } } void EpgPlus::TimeLine::clearMark() { - this->frameBuffer->paintBoxRel (this->x, this->y + this->fontTime->getHeight() - , this->width, this->fontTime->getHeight() , COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, this->y + this->fontTime->getHeight(), + this->width, this->fontTime->getHeight() , COL_MENUCONTENT_PLUS_0); } int EpgPlus::TimeLine::getUsedHeight() { - return std::max (fontDate->getHeight(), fontTime->getHeight()) - + fontTime->getHeight(); + return std::max(fontDate->getHeight(), fontTime->getHeight()) + fontTime->getHeight(); } Font *EpgPlus::ChannelEventEntry::font = NULL; int EpgPlus::ChannelEventEntry::separationLineHeight = 0; -EpgPlus::ChannelEventEntry::ChannelEventEntry (const CChannelEvent * pchannelEvent, CFrameBuffer * pframeBuffer, TimeLine * ptimeLine, Footer * pfooter, int px, int py, int pwidth) +EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEvent, CFrameBuffer * pframeBuffer, TimeLine * ptimeLine, Footer * pfooter, int px, int py, int pwidth) { // copy neccessary? if (pchannelEvent != NULL) @@ -286,36 +293,40 @@ EpgPlus::ChannelEventEntry::~ChannelEventEntry() { } -bool EpgPlus::ChannelEventEntry::isSelected (time_t _selectedTime) const +bool EpgPlus::ChannelEventEntry::isSelected(time_t _selectedTime) const { return (_selectedTime >= this->channelEvent.startTime) && (_selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); } -void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) +void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) { - this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight() - , this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), + this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); - this->font->RenderString (this->x + 2, this->y + this->font->getHeight() - , this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)); + this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), + this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)); // paint the separation line - if (separationLineHeight > 0) { - this->frameBuffer->paintBoxRel (this->x, this->y + this->font->getHeight() - , this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); + if (separationLineHeight > 0) + { + this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), + this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); } if (pisSelected) { - if (this->channelEvent.description.empty()) { // dummy channel event + if (this->channelEvent.description.empty()) + { // dummy channel event this->timeLine->clearMark(); - } else { - this->timeLine->paintMark (this->channelEvent.startTime, this->channelEvent.duration, this->x, this->width); + } + else + { + this->timeLine->paintMark(this->channelEvent.startTime, this->channelEvent.duration, this->x, this->width); } CShortEPGData shortEpgData; bool ret = CEitManager::getInstance()->getEPGidShort(this->channelEvent.eventID, &shortEpgData); - this->footer->paintEventDetails (this->channelEvent.description, ret ? shortEpgData.info1 : ""); + this->footer->paintEventDetails(this->channelEvent.description, ret ? shortEpgData.info1 : ""); this->timeLine->paintGrid(); } @@ -329,11 +340,12 @@ int EpgPlus::ChannelEventEntry::getUsedHeight() Font *EpgPlus::ChannelEntry::font = NULL; int EpgPlus::ChannelEntry::separationLineHeight = 0; -EpgPlus::ChannelEntry::ChannelEntry (const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) +EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) { this->channel = pchannel; - if (pchannel != NULL) { + if (pchannel != NULL) + { std::stringstream pdisplayName; //pdisplayName << pindex + 1 << " " << pchannel->getName(); pdisplayName << pchannel->number << " " << pchannel->getName(); @@ -361,30 +373,34 @@ void EpgPlus::ChannelEntry::init() EpgPlus::ChannelEntry::~ChannelEntry() { for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin(); - It != this->channelEventEntries.end(); ++It) { + It != this->channelEventEntries.end(); + ++It) + { delete *It; } this->channelEventEntries.clear(); } -void EpgPlus::ChannelEntry::paint (bool isSelected, time_t _selectedTime) +void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) { - this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight(), - isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), + isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); - this->font->RenderString (this->x + 2, this->y + this->font->getHeight(), - this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), + this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); - if (isSelected) { + if (isSelected) + { #if 0 - for (uint32_t i = 0; i < this->bouquetList->Bouquets.size(); ++i) { + for (uint32_t i = 0; i < this->bouquetList->Bouquets.size(); ++i) + { CBouquet *bouquet = this->bouquetList->Bouquets[i]; - for (int j = 0; j < bouquet->channelList->getSize(); ++j) { + for (int j = 0; j < bouquet->channelList->getSize(); ++j) + { - if ((*bouquet->channelList)[j]->number == this->channel->number) { - this->footer->setBouquetChannelName (bouquet->channelList->getName() - , this->channel->getName() - ); + if ((*bouquet->channelList)[j]->number == this->channel->number) + { + this->footer->setBouquetChannelName(bouquet->channelList->getName(), this->channel->getName()); bouquet = NULL; break; @@ -394,25 +410,28 @@ void EpgPlus::ChannelEntry::paint (bool isSelected, time_t _selectedTime) break; } #endif - if(this->channel->pname) { + if (this->channel->pname) + { this->footer->setBouquetChannelName(this->channel->pname, this->channel->getName()); - } else { - this->footer->setBouquetChannelName( - CServiceManager::getInstance()->GetSatelliteName(this->channel->getSatellitePosition()), - this->channel->getName()); + } + else + { + this->footer->setBouquetChannelName(CServiceManager::getInstance()->GetSatelliteName(this->channel->getSatellitePosition()), this->channel->getName()); } } // paint the separation line - if (separationLineHeight > 0) { - this->frameBuffer->paintBoxRel (this->x, this->y + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); + if (separationLineHeight > 0) + { + this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), + this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); } bool toggleColor = false; for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin(); It != this->channelEventEntries.end(); - ++It) { - (*It)->paint (isSelected && (*It)->isSelected (_selectedTime), toggleColor); + ++It) + { + (*It)->paint(isSelected && (*It)->isSelected(_selectedTime), toggleColor); toggleColor = !toggleColor; } @@ -429,7 +448,7 @@ Font *EpgPlus::Footer::fontEventShortDescription = NULL; Font *EpgPlus::Footer::fontButtons = NULL; int EpgPlus::Footer::color = 0; -EpgPlus::Footer::Footer (CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) +EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) { this->frameBuffer = pframeBuffer; this->x = px; @@ -450,7 +469,7 @@ void EpgPlus::Footer::init() fontButtons = fonts[EPGPlus_footer_fontbuttons]; } -void EpgPlus::Footer::setBouquetChannelName (const std::string & newBouquetName, const std::string & newChannelName) +void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, const std::string & newChannelName) { this->currentBouquetName = newBouquetName; this->currentChannelName = newChannelName; @@ -458,46 +477,46 @@ void EpgPlus::Footer::setBouquetChannelName (const std::string & newBouquetName, int EpgPlus::Footer::getUsedHeight() { - return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() - + fontEventShortDescription->getHeight() /* + fontButtons->getHeight()*/; + return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventShortDescription->getHeight() /* + fontButtons->getHeight()*/; } -void EpgPlus::Footer::paintEventDetails (const std::string & description, const std::string & shortDescription) +void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & shortDescription) { int yPos = this->y; int height = this->fontBouquetChannelName->getHeight(); // clear the region - this->frameBuffer->paintBoxRel (this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); yPos += height; // display new text - this->fontBouquetChannelName->RenderString (this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT); + this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT); height = this->fontEventDescription->getHeight(); // clear the region - this->frameBuffer->paintBoxRel (this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); yPos += height; // display new text - this->fontEventDescription->RenderString (this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT); + this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT); height = this->fontEventShortDescription->getHeight(); // clear the region - this->frameBuffer->paintBoxRel (this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); yPos += height; // display new text - this->fontEventShortDescription->RenderString (this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT); + this->fontEventShortDescription->RenderString(this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT); } -struct button_label buttonLabels[] = { +struct button_label buttonLabels[] = +{ {NEUTRINO_ICON_BUTTON_RED, LOCALE_EPGPLUS_ACTIONS}, {NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EPGPLUS_PREV_BOUQUET /*LOCALE_EPGPLUS_PAGE_UP*/}, {NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_EPGPLUS_NEXT_BOUQUET /*LOCALE_EPGPLUS_PAGE_DOWN*/}, @@ -505,11 +524,11 @@ struct button_label buttonLabels[] = { {NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_EPGMENU_EVENTINFO} }; -void EpgPlus::Footer::paintButtons (button_label * pbuttonLabels, int numberOfButtons) +void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); int yPos = this->y + this->getUsedHeight(); - ::paintButtons (this->x, yPos, buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); + ::paintButtons(this->x, yPos, buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); } EpgPlus::EpgPlus() @@ -523,78 +542,102 @@ EpgPlus::~EpgPlus() this->free(); } -void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) +void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) { for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); - It != this->displayedChannelEntries.end(); ++It) { + It != this->displayedChannelEntries.end(); + ++It) + { delete *It; } this->displayedChannelEntries.clear(); this->selectedChannelEntry = NULL; - if (selectedChannelEntryIndex < this->channelList->getSize()) { - for (;;) { - if (selectedChannelEntryIndex < this->channelListStartIndex) { + if (selectedChannelEntryIndex < this->channelList->getSize()) + { + for (;;) + { + if (selectedChannelEntryIndex < this->channelListStartIndex) + { this->channelListStartIndex -= this->maxNumberOfDisplayableEntries; if (this->channelListStartIndex < 0) this->channelListStartIndex = 0; - } else if (selectedChannelEntryIndex >= this->channelListStartIndex + this->maxNumberOfDisplayableEntries) { + } + else if (selectedChannelEntryIndex >= this->channelListStartIndex + this->maxNumberOfDisplayableEntries) + { this->channelListStartIndex += this->maxNumberOfDisplayableEntries; - } else + } + else break; } int yPosChannelEntry = this->channelsTableY; int yPosEventEntry = this->eventsTableY; - for (int i = this->channelListStartIndex; (i < this->channelListStartIndex + this->maxNumberOfDisplayableEntries) - && (i < this->channelList->getSize()); - ++i, yPosChannelEntry += this->entryHeight, yPosEventEntry += this->entryHeight) { + for (int i = this->channelListStartIndex; + (i < this->channelListStartIndex + this->maxNumberOfDisplayableEntries) && (i < this->channelList->getSize()); + ++i, yPosChannelEntry += this->entryHeight, yPosEventEntry += this->entryHeight) + { CZapitChannel * channel = (*this->channelList)[i]; - ChannelEntry *channelEntry = new ChannelEntry (channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX + 2, yPosChannelEntry, this->channelsTableWidth); -//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); + ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX + 2, yPosChannelEntry, this->channelsTableWidth); + //printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); CChannelEventList channelEventList; CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); -//printf("channelEventList size %d\n", channelEventList.size()); + //printf("channelEventList size %d\n", channelEventList.size()); int widthEventEntry = 0; time_t lastEndTime = this->startTime; - CChannelEventList::const_iterator lastIt (channelEventList.end()); + CChannelEventList::const_iterator lastIt(channelEventList.end()); //for (CChannelEventList::const_iterator It = channelEventList.begin(); (It != channelEventList.end()) && (It->startTime < (this->startTime + this->duration)); ++It) for (CChannelEventList::const_iterator It = channelEventList.begin(); It != channelEventList.end(); ++It) { -//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration)); + //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration)); if (!(It->startTime < (this->startTime + this->duration)) ) continue; if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime)) { int startTimeDiff = It->startTime - this->startTime; int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration); -//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str()); - if ((startTimeDiff >= 0) && (endTimeDiff >= 0)) { + //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str()); + if ((startTimeDiff >= 0) && (endTimeDiff >= 0)) + { // channel event fits completely in the visible part of time line startTimeDiff = 0; endTimeDiff = 0; - } else if ((startTimeDiff < 0) && (endTimeDiff < 0)) { + } + else if ((startTimeDiff < 0) && (endTimeDiff < 0)) + { // channel event starts and ends outside visible part of the time line but covers complete visible part - } else if ((startTimeDiff < 0) && (endTimeDiff < this->duration)) { + } + else if ((startTimeDiff < 0) && (endTimeDiff < this->duration)) + { // channel event starts before visible part of the time line but ends in the visible part endTimeDiff = 0; - } else if ((endTimeDiff < 0) && (startTimeDiff < this->duration)) { + } + else if ((endTimeDiff < 0) && (startTimeDiff < this->duration)) + { // channel event ends after visible part of the time line but starts in the visible part startTimeDiff = 0; - } else if (startTimeDiff > 0) { // channel event starts and ends after visible part of the time line => break the loop -//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n"); + } + else if (startTimeDiff > 0) + { + // channel event starts and ends after visible part of the time line => break the loop + //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n"); break; - } else { // channel event starts and ends after visible part of the time line => ignore the channel event -//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff); + } + else + { + // channel event starts and ends after visible part of the time line => ignore the channel event + //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff); continue; } - if (lastEndTime < It->startTime) { // there is a gap between last end time and new start time => fill it with a new event entry + if (lastEndTime < It->startTime) + { + // there is a gap between last end time and new start time => fill it with a new event entry CChannelEvent channelEvent; channelEvent.startTime = lastEndTime; @@ -615,24 +658,25 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) if (xPosEventEntry + widthEventEntry > this->eventsTableX + this->eventsTableWidth) widthEventEntry = this->eventsTableX + this->eventsTableWidth - xPosEventEntry; - ChannelEventEntry *channelEventEntry = new ChannelEventEntry (&(*It) , this->frameBuffer, this->timeLine, this->footer, xPosEventEntry, yPosEventEntry, widthEventEntry); + ChannelEventEntry *channelEventEntry = new ChannelEventEntry(&(*It) , this->frameBuffer, this->timeLine, this->footer, xPosEventEntry, yPosEventEntry, widthEventEntry); - channelEntry->channelEventEntries.push_back (channelEventEntry); + channelEntry->channelEventEntries.push_back(channelEventEntry); lastEndTime = It->startTime + It->duration; } lastIt = It; } - if (lastEndTime < this->startTime + time_t (this->duration)) { // there is a gap between last end time and end of the timeline => fill it with a new event entry - + if (lastEndTime < this->startTime + time_t (this->duration)) + { + // there is a gap between last end time and end of the timeline => fill it with a new event entry CChannelEvent channelEvent; channelEvent.startTime = lastEndTime; channelEvent.duration = this->startTime + this->duration - channelEvent.startTime; - ChannelEventEntry *channelEventEntry = new ChannelEventEntry (&channelEvent, this->frameBuffer, this->timeLine, this->footer, this->eventsTableX + ((channelEvent.startTime - this->startTime) * this->eventsTableWidth) / this->duration, yPosEventEntry, (channelEvent.duration * this->eventsTableWidth) / this->duration + 1); - channelEntry->channelEventEntries.push_back (channelEventEntry); + ChannelEventEntry *channelEventEntry = new ChannelEventEntry(&channelEvent, this->frameBuffer, this->timeLine, this->footer, this->eventsTableX + ((channelEvent.startTime - this->startTime) * this->eventsTableWidth) / this->duration, yPosEventEntry, (channelEvent.duration * this->eventsTableWidth) / this->duration + 1); + channelEntry->channelEventEntries.push_back(channelEventEntry); } - this->displayedChannelEntries.push_back (channelEntry); + this->displayedChannelEntries.push_back(channelEntry); } this->selectedChannelEntry = this->displayedChannelEntries[selectedChannelEntryIndex - this->channelListStartIndex]; @@ -649,13 +693,15 @@ void EpgPlus::init() usableScreenWidth = frameBuffer->getScreenWidthRel(); usableScreenHeight = frameBuffer->getScreenHeightRel(); std::string FileName = std::string (g_settings.font_file); - for (size_t i = 0; i < NumberOfFontSettings; ++i) { + for (size_t i = 0; i < NumberOfFontSettings; ++i) + { int size = fontSettingTable[i].size; if (bigfont && (fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelentry_font || - fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelevententry_font)) { + fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelevententry_font)) + { size = size * 3 / 2; /* increase font size for channel name and event title */ } - std::string family = g_fontRenderer->getFamily (FileName.c_str()); + std::string family = g_fontRenderer->getFamily(FileName.c_str()); Font *font = g_fontRenderer->getFont(family.c_str(), fontSettingTable[i].style, size); if (font == NULL) @@ -664,7 +710,8 @@ void EpgPlus::init() fonts[i] = font; } - for (size_t i = 0; i < NumberOfSizeSettings; ++i) { + for (size_t i = 0; i < NumberOfSizeSettings; ++i) + { int size = sizeSettingTable[i].size; if (size < 0) /* size < 0 == width in percent x -1 */ size = usableScreenWidth * size / -100; @@ -689,14 +736,14 @@ void EpgPlus::init() int timeLineHeight = TimeLine::getUsedHeight(); this->entryHeight = ChannelEntry::getUsedHeight(); - int icol_w, icol_h, h2; + int icol_w, icol_h, h2; - CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &h2); -// if(icol_h < h2) -// icol_h = h2; + //if (icol_h < h2) + // icol_h = h2; - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ + int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max(icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ int footerHeight = Footer::getUsedHeight() + buttonHeight; this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - horGap1Height - horGap2Height - footerHeight) / this->entryHeight; @@ -754,11 +801,11 @@ void EpgPlus::init() this->currentViewMode = ViewMode_Scroll; this->currentSwapMode = SwapMode_ByBouquet; //SwapMode_ByPage; - this->header = new Header (this->frameBuffer, this->headerX, this->headerY, this->headerWidth); + this->header = new Header(this->frameBuffer, this->headerX, this->headerY, this->headerWidth); - this->timeLine = new TimeLine (this->frameBuffer, this->timeLineX, this->timeLineY, this->timeLineWidth, this->eventsTableX, this->eventsTableWidth); + this->timeLine = new TimeLine(this->frameBuffer, this->timeLineX, this->timeLineY, this->timeLineWidth, this->eventsTableX, this->eventsTableWidth); - this->footer = new Footer (this->frameBuffer, this->footerX, this->footerY, this->footerWidth, buttonHeight); + this->footer = new Footer(this->frameBuffer, this->footerX, this->footerY, this->footerWidth, buttonHeight); } void EpgPlus::free() @@ -767,12 +814,13 @@ void EpgPlus::free() delete this->timeLine; delete this->footer; int i; - for (i = 0; i < NumberOfFontSettings; ++i) { + for (i = 0; i < NumberOfFontSettings; ++i) + { delete fonts[i]; } } -int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouquetList *pbouquetList) +int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouquetList *pbouquetList) { this->channelList = pchannelList; this->channelListStartIndex = int (selectedChannelIndex / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries; @@ -781,59 +829,67 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu int res = menu_return::RETURN_REPAINT; COSDFader fader(g_settings.theme.menu_Content_alpha); - do { + do + { this->refreshFooterButtons = false; - time_t currentTime = time (NULL); - tm tmStartTime = *localtime (¤tTime); + time_t currentTime = time(NULL); + tm tmStartTime = *localtime(¤tTime); tmStartTime.tm_sec = 0; tmStartTime.tm_min = int (tmStartTime.tm_min / 15) * 15; - this->startTime = mktime (&tmStartTime); + this->startTime = mktime(&tmStartTime); this->selectedTime = this->startTime; this->firstStartTime = this->startTime; - if (this->selectedChannelEntry != NULL) { + if (this->selectedChannelEntry != NULL) + { selectedChannelIndex = this->selectedChannelEntry->index; } neutrino_msg_t msg; neutrino_msg_data_t data; - this->createChannelEntries (selectedChannelIndex); + this->createChannelEntries(selectedChannelIndex); - if(!this->refreshAll) + if (!this->refreshAll) fader.StartFadeIn(); this->refreshAll = false; this->header->paint(this->channelList->getName()); - this->footer->paintButtons (buttonLabels, sizeof (buttonLabels) / sizeof (button_label)); + this->footer->paintButtons(buttonLabels, sizeof(buttonLabels) / sizeof(button_label)); this->paint(); - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); bool loop = true; - while (loop) { - g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); if (msg <= CRCInput::RC_MaxRC) - timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { - if(fader.FadeDone()) + if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) + { + if (fader.FadeDone()) loop = false; } - else if ((msg == CRCInput::RC_timeout) || (msg == (neutrino_msg_t) g_settings.key_channelList_cancel)) { - if(fader.StartFadeOut()) { + else if ((msg == CRCInput::RC_timeout) || (msg == (neutrino_msg_t) g_settings.key_channelList_cancel)) + { + if (fader.StartFadeOut()) + { timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); msg = 0; - } else + } + else loop = false; } - else if (msg == CRCInput::RC_epg) { + else if (msg == CRCInput::RC_epg) + { //fprintf(stderr, "RC_Epg, bigfont = %d\n", bigfont); hide(); bigfont = !bigfont; @@ -842,15 +898,17 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu refreshAll = true; break; } - else if (msg == CRCInput::RC_page_down) { + else if (msg == CRCInput::RC_page_down) + { int selected = this->selectedChannelEntry->index; int prev_selected = selected; int step = this->maxNumberOfDisplayableEntries; int listSize = this->channelList->getSize(); selected += step; - if(selected >= listSize) { - if((listSize - step -1 < prev_selected) && (prev_selected != (listSize - 1))) + if (selected >= listSize) + { + if ((listSize - step -1 < prev_selected) && (prev_selected != (listSize - 1))) selected = listSize - 1; else if (((listSize / step) + 1) * step == listSize + step) // last page has full entries selected = 0; @@ -858,44 +916,52 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu selected = ((selected < (((listSize / step)+1) * step))) ? (listSize - 1) : 0; } - this->createChannelEntries (selected); + this->createChannelEntries(selected); this->paint(); } - else if (msg == CRCInput::RC_page_up) { + else if (msg == CRCInput::RC_page_up) + { int selected = this->selectedChannelEntry->index; int prev_selected = selected; int step = this->maxNumberOfDisplayableEntries; selected -= step; - if((prev_selected-step) < 0) { - if(prev_selected != 0 && step != 1) + if ((prev_selected-step) < 0) + { + if (prev_selected != 0 && step != 1) selected = 0; else selected = this->channelList->getSize() - 1; } - this->createChannelEntries (selected); + this->createChannelEntries(selected); this->paint(); } - if (msg == CRCInput::RC_yellow) { - if (!bouquetList->Bouquets.empty()) { + if (msg == CRCInput::RC_yellow) + { + if (!bouquetList->Bouquets.empty()) + { bool found = true; uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); -//printf("**************************** EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext); - if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { + //printf("EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext); + if (bouquetList->Bouquets[nNext]->channelList->isEmpty()) + { found = false; nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0; - for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) { - if(!bouquetList->Bouquets[i]->channelList->isEmpty() ) { + for (uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) + { + if (!bouquetList->Bouquets[i]->channelList->isEmpty()) + { found = true; nNext = i; break; } } } -//printf("**************************** EpgPlus::exec found %d new %d\n", found, nNext); - if(found) { - pbouquetList->activateBouquet (nNext, false); + //printf("EpgPlus::exec found %d new %d\n", found, nNext); + if (found) + { + pbouquetList->activateBouquet(nNext, false); this->channelList = bouquetList->Bouquets[nNext]->channelList; this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries; this->createChannelEntries (channelList->getSelectedChannelIndex()); @@ -904,23 +970,29 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_green) { - if (!bouquetList->Bouquets.empty()) { + else if (msg == CRCInput::RC_green) + { + if (!bouquetList->Bouquets.empty()) + { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->isEmpty()) { + if (bouquetList->Bouquets[nNext]->channelList->isEmpty()) + { found = false; nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1; - for(int i = nNext; i > 0; i--) { - if(!bouquetList->Bouquets[i]->channelList->isEmpty()) { + for (int i = nNext; i > 0; i--) + { + if (!bouquetList->Bouquets[i]->channelList->isEmpty()) + { found = true; nNext = i; break; } } } - if(found) { - pbouquetList->activateBouquet (nNext, false); + if (found) + { + pbouquetList->activateBouquet(nNext, false); this->channelList = bouquetList->Bouquets[nNext]->channelList; this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries; this->createChannelEntries (channelList->getSelectedChannelIndex()); @@ -929,37 +1001,42 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_ok) { + else if (msg == CRCInput::RC_ok) + { if (selectedChannelEntry) CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->getChannelID()); current_bouquet = bouquetList->getActiveBouquetNumber(); } - else if (CRCInput::isNumeric (msg)) { + else if (CRCInput::isNumeric(msg)) + { this->hide(); - CNeutrinoApp::getInstance()->channelList->numericZap (msg); -//printf("numericZap: prev bouquet %d new %d\n", current_bouquet, bouquetList->getActiveBouquetNumber()); + CNeutrinoApp::getInstance()->channelList->numericZap(msg); + //printf("numericZap: prev bouquet %d new %d\n", current_bouquet, bouquetList->getActiveBouquetNumber()); current_bouquet = bouquetList->getActiveBouquetNumber(); this->channelList = bouquetList->Bouquets[current_bouquet]->channelList; this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries; g_InfoViewer->killTitle(); int selectedChannelEntryIndex = this->channelList->getSelectedChannelIndex(); - if (selectedChannelEntryIndex < this->channelList->getSize()) { + if (selectedChannelEntryIndex < this->channelList->getSize()) + { this->hide(); - this->createChannelEntries (selectedChannelEntryIndex); + this->createChannelEntries(selectedChannelEntryIndex); this->header->paint(this->channelList->getName()); - this->footer->paintButtons (buttonLabels, sizeof (buttonLabels) / sizeof (button_label)); + this->footer->paintButtons(buttonLabels, sizeof(buttonLabels) / sizeof(button_label)); this->paint(); } } - else if (msg == CRCInput::RC_up) { + else if (msg == CRCInput::RC_up) + { int selectedChannelEntryIndex = this->selectedChannelEntry->index; int prevSelectedChannelEntryIndex = selectedChannelEntryIndex; --selectedChannelEntryIndex; - if (selectedChannelEntryIndex < 0) { + if (selectedChannelEntryIndex < 0) + { selectedChannelEntryIndex = this->channelList->getSize() - 1; } @@ -968,16 +1045,20 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu this->channelListStartIndex = (selectedChannelEntryIndex / this->maxNumberOfDisplayableEntries) * this->maxNumberOfDisplayableEntries; - if (oldChannelListStartIndex != this->channelListStartIndex) { - this->createChannelEntries (selectedChannelEntryIndex); + if (oldChannelListStartIndex != this->channelListStartIndex) + { + this->createChannelEntries(selectedChannelEntryIndex); this->paint(); - } else { + } + else + { this->selectedChannelEntry = this->displayedChannelEntries[selectedChannelEntryIndex - this->channelListStartIndex]; - this->paintChannelEntry (prevSelectedChannelEntryIndex - this->channelListStartIndex); - this->paintChannelEntry (selectedChannelEntryIndex - this->channelListStartIndex); + this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex); + this->paintChannelEntry(selectedChannelEntryIndex - this->channelListStartIndex); } } - else if (msg == CRCInput::RC_down) { + else if (msg == CRCInput::RC_down) + { int selectedChannelEntryIndex = this->selectedChannelEntry->index; int prevSelectedChannelEntryIndex = this->selectedChannelEntry->index; @@ -987,163 +1068,194 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu int oldChannelListStartIndex = this->channelListStartIndex; this->channelListStartIndex = (selectedChannelEntryIndex / this->maxNumberOfDisplayableEntries) * this->maxNumberOfDisplayableEntries; - if (oldChannelListStartIndex != this->channelListStartIndex) { - this->createChannelEntries (selectedChannelEntryIndex); + if (oldChannelListStartIndex != this->channelListStartIndex) + { + this->createChannelEntries(selectedChannelEntryIndex); this->paint(); - } else { + } + else + { this->selectedChannelEntry = this->displayedChannelEntries[selectedChannelEntryIndex - this->channelListStartIndex]; - this->paintChannelEntry (prevSelectedChannelEntryIndex - this->channelListStartIndex); - this->paintChannelEntry (this->selectedChannelEntry->index - this->channelListStartIndex); + this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex); + this->paintChannelEntry(this->selectedChannelEntry->index - this->channelListStartIndex); } } - else if (msg == (neutrino_msg_t) CRCInput::RC_red) { + else if (msg == (neutrino_msg_t) CRCInput::RC_red) + { CMenuWidget menuWidgetActions(LOCALE_EPGPLUS_ACTIONS, NEUTRINO_ICON_FEATURES); menuWidgetActions.enableFade(false); MenuTargetAddRecordTimer record(this); MenuTargetRefreshEpg refresh(this); MenuTargetAddReminder remind(this); if (!g_settings.minimode) - menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_RECORD, true, NULL, &record, NULL, CRCInput::RC_red), false); - menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REFRESH_EPG, true, NULL, &refresh, NULL, CRCInput::RC_green), false); - menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REMIND, true, NULL, &remind, NULL, CRCInput::RC_yellow), false); + menuWidgetActions.addItem(new CMenuForwarder(LOCALE_EPGPLUS_RECORD, true, NULL, &record, NULL, CRCInput::RC_red), false); + menuWidgetActions.addItem(new CMenuForwarder(LOCALE_EPGPLUS_REFRESH_EPG, true, NULL, &refresh, NULL, CRCInput::RC_green), false); + menuWidgetActions.addItem(new CMenuForwarder(LOCALE_EPGPLUS_REMIND, true, NULL, &remind, NULL, CRCInput::RC_yellow), false); if (selectedChannelEntry) - menuWidgetActions.exec (NULL, ""); + menuWidgetActions.exec(NULL, ""); this->refreshAll = true; } - else if (msg == (neutrino_msg_t) CRCInput::RC_blue) { - + else if (msg == (neutrino_msg_t) CRCInput::RC_blue) + { CMenuWidget menuWidgetOptions(LOCALE_EPGPLUS_OPTIONS, NEUTRINO_ICON_FEATURES); menuWidgetOptions.enableFade(false); - //menuWidgetOptions.addItem (new MenuOptionChooserSwitchSwapMode (this)); - menuWidgetOptions.addItem (new MenuOptionChooserSwitchViewMode (this)); + //menuWidgetOptions.addItem(new MenuOptionChooserSwitchSwapMode(this)); + menuWidgetOptions.addItem(new MenuOptionChooserSwitchViewMode(this)); - int result = menuWidgetOptions.exec (NULL, ""); - if (result == menu_return::RETURN_REPAINT) { + int result = menuWidgetOptions.exec(NULL, ""); + if (result == menu_return::RETURN_REPAINT) + { this->refreshAll = true; - } else if (result == menu_return::RETURN_EXIT_ALL) { + } + else if (result == menu_return::RETURN_EXIT_ALL) + { this->refreshAll = true; } } - else if (msg == CRCInput::RC_left) { - switch (this->currentViewMode) { + else if (msg == CRCInput::RC_left) + { + switch (this->currentViewMode) + { case ViewMode_Stretch: + { + if (this->duration - 30 * 60 > 30 * 60) { - if (this->duration - 30 * 60 > 30 * 60) { - this->duration -= 30 * 60; - this->hide(); - this->refreshAll = true; - } + this->duration -= 30 * 60; + this->hide(); + this->refreshAll = true; } break; + } case ViewMode_Scroll: + { + TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); + + if ((It != this->selectedChannelEntry->channelEventEntries.begin()) + && (It != this->selectedChannelEntry->channelEventEntries.end())) { - TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); - - if ((It != this->selectedChannelEntry->channelEventEntries.begin()) - && (It != this->selectedChannelEntry->channelEventEntries.end()) - ) { - --It; - this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2; - if (this->selectedTime < this->startTime) - this->selectedTime = this->startTime; - - this->selectedChannelEntry->paint (true, this->selectedTime); - } else { - if (this->startTime != this->firstStartTime) { - - if (this->startTime - this->duration > this->firstStartTime) { - this->startTime -= this->duration; - } else { - this->startTime = this->firstStartTime; - } - - this->selectedTime = this->startTime + this->duration - 1; // select last event - this->createChannelEntries (this->selectedChannelEntry->index); - - this->paint(); - } - } - } - break; - } - } - else if (msg == CRCInput::RC_right) { - switch (this->currentViewMode) { - case ViewMode_Stretch: - { - if (this->duration + 30 * 60 < 4 * 60 * 60) { - this->duration += 60 * 60; - this->hide(); - this->refreshAll = true; - } - } - break; - - case ViewMode_Scroll: - { - TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); - - if ((It != this->selectedChannelEntry->channelEventEntries.end() - 1) - && (It != this->selectedChannelEntry->channelEventEntries.end())) { - ++It; - - this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2; - - if (this->selectedTime > this->startTime + time_t (this->duration)) - this->selectedTime = this->startTime + this->duration; - - this->selectedChannelEntry->paint (true, this->selectedTime); - } else { - this->startTime += this->duration; + --It; + this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2; + if (this->selectedTime < this->startTime) this->selectedTime = this->startTime; - this->createChannelEntries (this->selectedChannelEntry->index); + + this->selectedChannelEntry->paint(true, this->selectedTime); + } + else + { + if (this->startTime != this->firstStartTime) + { + if (this->startTime - this->duration > this->firstStartTime) + { + this->startTime -= this->duration; + } + else + { + this->startTime = this->firstStartTime; + } + + this->selectedTime = this->startTime + this->duration - 1; // select last event + this->createChannelEntries(this->selectedChannelEntry->index); this->paint(); } } break; + } } } - else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + else if (msg == CRCInput::RC_right) + { + switch (this->currentViewMode) + { + case ViewMode_Stretch: + { + if (this->duration + 30 * 60 < 4 * 60 * 60) + { + this->duration += 60 * 60; + this->hide(); + this->refreshAll = true; + } + break; + } + case ViewMode_Scroll: + { + TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); + + if ((It != this->selectedChannelEntry->channelEventEntries.end() - 1) + && (It != this->selectedChannelEntry->channelEventEntries.end())) + { + ++It; + + this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2; + + if (this->selectedTime > this->startTime + time_t (this->duration)) + this->selectedTime = this->startTime + this->duration; + + this->selectedChannelEntry->paint(true, this->selectedTime); + } + else + { + this->startTime += this->duration; + this->selectedTime = this->startTime; + this->createChannelEntries(this->selectedChannelEntry->index); + + this->paint(); + } + break; + } + } + } + else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) + { TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); - if (It != this->selectedChannelEntry->channelEventEntries.end()) { - - if ((*It)->channelEvent.eventID != 0) { + if (It != this->selectedChannelEntry->channelEventEntries.end()) + { + if ((*It)->channelEvent.eventID != 0) + { this->hide(); time_t startTime2 = (*It)->channelEvent.startTime; - res = g_EpgData->show (this->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.eventID, &startTime2); + res = g_EpgData->show(this->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.eventID, &startTime2); - if (res == menu_return::RETURN_EXIT_ALL) { + if (res == menu_return::RETURN_EXIT_ALL) + { loop = false; - } else { - g_RCInput->getMsg (&msg, &data, 0); + } + else + { + g_RCInput->getMsg(&msg, &data, 0); - if ((msg != CRCInput::RC_red) && (msg != CRCInput::RC_timeout)) { + if ((msg != CRCInput::RC_red) && (msg != CRCInput::RC_timeout)) + { // RC_red schlucken - g_RCInput->postMsg (msg, data); + g_RCInput->postMsg(msg, data); } this->header->paint(this->channelList->getName()); - this->footer->paintButtons (buttonLabels, sizeof (buttonLabels) / sizeof (button_label)); + this->footer->paintButtons(buttonLabels, sizeof(buttonLabels) / sizeof(button_label)); this->paint(); } } } } - else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { - g_RCInput->postMsg (msg, 0); + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + g_RCInput->postMsg(msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) + { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; } - else { - if (CNeutrinoApp::getInstance()->handleMsg (msg, data) & messages_return::cancel_all) { + else + { + if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) + { loop = false; res = menu_return::RETURN_EXIT_ALL; } @@ -1152,7 +1264,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu if (this->refreshAll) loop = false; else if (this->refreshFooterButtons) - this->footer->paintButtons (buttonLabels, sizeof (buttonLabels) / sizeof (button_label)); + this->footer->paintButtons(buttonLabels, sizeof(buttonLabels) / sizeof(button_label)); } this->hide(); @@ -1160,15 +1272,20 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu fader.StopFade(); #if 0 for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); - It != this->displayedChannelEntries.end(); It++) { + It != this->displayedChannelEntries.end(); + It++) + { delete *It; } this->displayedChannelEntries.clear(); #endif } while (this->refreshAll); + for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); - It != this->displayedChannelEntries.end(); ++It) { + It != this->displayedChannelEntries.end(); + ++It) + { delete *It; } this->displayedChannelEntries.clear(); @@ -1180,8 +1297,10 @@ EpgPlus::TCChannelEventEntries::const_iterator EpgPlus::getSelectedEvent() const { for (TCChannelEventEntries::const_iterator It = this->selectedChannelEntry->channelEventEntries.begin(); It != this->selectedChannelEntry->channelEventEntries.end(); - ++It) { - if ((*It)->isSelected (this->selectedTime)) { + ++It) + { + if ((*It)->isSelected(this->selectedTime)) + { return It; } } @@ -1190,68 +1309,70 @@ EpgPlus::TCChannelEventEntries::const_iterator EpgPlus::getSelectedEvent() const void EpgPlus::hide() { - this->frameBuffer->paintBackgroundBoxRel (this->usableScreenX, this->usableScreenY, this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth, this->usableScreenHeight); } -void EpgPlus::paintChannelEntry (int position) +void EpgPlus::paintChannelEntry(int position) { ChannelEntry *channelEntry = this->displayedChannelEntries[position]; bool currentChannelIsSelected = false; - if (this->channelListStartIndex + position == this->selectedChannelEntry->index) { + if (this->channelListStartIndex + position == this->selectedChannelEntry->index) + { currentChannelIsSelected = true; } - channelEntry->paint (currentChannelIsSelected, this->selectedTime); + channelEntry->paint(currentChannelIsSelected, this->selectedTime); } -std::string EpgPlus::getTimeString (const time_t & time, const std::string & format) +std::string EpgPlus::getTimeString(const time_t & time, const std::string & format) { char tmpstr[256]; - struct tm *tmStartTime = localtime (&time); + struct tm *tmStartTime = localtime(&time); - strftime (tmpstr, sizeof (tmpstr), format.c_str(), tmStartTime); + strftime(tmpstr, sizeof(tmpstr), format.c_str(), tmStartTime); return tmpstr; } void EpgPlus::paint() { // clear - //this->frameBuffer->paintBackgroundBoxRel (this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight); - this->frameBuffer->paintBoxRel (this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight, COL_MENUCONTENT_PLUS_0); + //this->frameBuffer->paintBackgroundBoxRel(this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight); + this->frameBuffer->paintBoxRel(this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight, COL_MENUCONTENT_PLUS_0); // paint the gaps - this->frameBuffer->paintBoxRel (this->horGap1X, this->horGap1Y, this->horGap1Width, horGap1Height, horGap1Color); - this->frameBuffer->paintBoxRel (this->horGap2X, this->horGap2Y, this->horGap2Width, horGap2Height, horGap2Color); - this->frameBuffer->paintBoxRel (this->verGap1X, this->verGap1Y, verGap1Width, this->verGap1Height, verGap1Color); - this->frameBuffer->paintBoxRel (this->verGap2X, this->verGap2Y, verGap2Width, this->verGap2Height, verGap2Color); + this->frameBuffer->paintBoxRel(this->horGap1X, this->horGap1Y, this->horGap1Width, horGap1Height, horGap1Color); + this->frameBuffer->paintBoxRel(this->horGap2X, this->horGap2Y, this->horGap2Width, horGap2Height, horGap2Color); + this->frameBuffer->paintBoxRel(this->verGap1X, this->verGap1Y, verGap1Width, this->verGap1Height, verGap1Color); + this->frameBuffer->paintBoxRel(this->verGap2X, this->verGap2Y, verGap2Width, this->verGap2Height, verGap2Color); // paint the time line - timeLine->paint (this->startTime, this->duration); + timeLine->paint(this->startTime, this->duration); // paint the channel entries - for (int i = 0; i < (int) this->displayedChannelEntries.size(); ++i) { - this->paintChannelEntry (i); + for (int i = 0; i < (int) this->displayedChannelEntries.size(); ++i) + { + this->paintChannelEntry(i); } // paint the time line grid this->timeLine->paintGrid(); // paint slider - this->frameBuffer->paintBoxRel (this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, COL_MENUCONTENT_PLUS_0); int tmp = ((this->channelList->getSize() - 1) / this->maxNumberOfDisplayableEntries) + 1; float sliderKnobHeight = float((sliderHeight - 4) / tmp); int sliderKnobPosition = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries); - this->frameBuffer->paintBoxRel (this->sliderX + 2, this->sliderY + (int(sliderKnobPosition * sliderKnobHeight)) - , this->sliderWidth - 4, int (sliderKnobHeight) , COL_SCROLLBAR_ACTIVE_PLUS_0); + this->frameBuffer->paintBoxRel(this->sliderX + 2, this->sliderY + (int(sliderKnobPosition * sliderKnobHeight)), + this->sliderWidth - 4, int (sliderKnobHeight) , COL_SCROLLBAR_ACTIVE_PLUS_0); } -// -- EPG+ Menue Handler Class -// -- to be used for calls from Menue -// -- (2004-03-05 rasc) +// -- EPG+ Menue Handler Class +// -- to be used for calls from Menue +// -- (2004-03-05 rasc) -int CEPGplusHandler::exec (CMenuTarget * parent, const std::string & /*actionKey*/) +int CEPGplusHandler::exec(CMenuTarget * parent, const std::string & /*actionKey*/) { int res = menu_return::RETURN_EXIT_ALL; EpgPlus *e; @@ -1265,58 +1386,62 @@ int CEPGplusHandler::exec (CMenuTarget * parent, const std::string & /*actionKey //channelList = CNeutrinoApp::getInstance()->channelList; int bnum = bouquetList->getActiveBouquetNumber(); current_bouquet = bnum; - if(!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty() ) + if (!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty()) channelList = bouquetList->Bouquets[bnum]->channelList; else channelList = CNeutrinoApp::getInstance()->channelList; - e->exec (channelList, channelList->getSelectedChannelIndex(), bouquetList); + e->exec(channelList, channelList->getSelectedChannelIndex(), bouquetList); delete e; -//FIXME -//printf("CEPGplusHandler::exec old bouquet %d new %d current %d\n", bnum, bouquetList->getActiveBouquetNumber(), current_bouquet); + // FIXME + //printf("CEPGplusHandler::exec old bouquet %d new %d current %d\n", bnum, bouquetList->getActiveBouquetNumber(), current_bouquet); bouquetList->activateBouquet(current_bouquet, false); return res; } -EpgPlus::MenuTargetAddReminder::MenuTargetAddReminder (EpgPlus * pepgPlus) { +EpgPlus::MenuTargetAddReminder::MenuTargetAddReminder(EpgPlus * pepgPlus) +{ this->epgPlus = pepgPlus; } -int EpgPlus::MenuTargetAddReminder::exec (CMenuTarget * /*parent*/, const std::string & /*actionKey*/) +int EpgPlus::MenuTargetAddReminder::exec(CMenuTarget * /*parent*/, const std::string & /*actionKey*/) { TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent(); if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end()) - && (!(*It)->channelEvent.description.empty()) - ) { - if (g_Timerd->isTimerdAvailable()) { - g_Timerd->addZaptoTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); + && (!(*It)->channelEvent.description.empty())) + { + if (g_Timerd->isTimerdAvailable()) + { + g_Timerd->addZaptoTimerEvent(this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); - ShowMsg (LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTTIMED_MSG) - , CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 - } else - printf ("timerd not available\n"); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText(LOCALE_TIMER_EVENTTIMED_MSG), + CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); + } + else + printf("timerd not available\n"); } return menu_return::RETURN_EXIT_ALL; } -EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer (EpgPlus * pepgPlus) { +EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer(EpgPlus * pepgPlus) +{ this->epgPlus = pepgPlus; } -static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +static bool sortByDateTime(const CChannelEvent& a, const CChannelEvent& b) { return a.startTime < b.startTime; } -int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std::string & /*actionKey*/) +int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget * /*parent*/, const std::string & /*actionKey*/) { TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent(); if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end()) - && (!(*It)->channelEvent.description.empty()) - ) { + && (!(*It)->channelEvent.description.empty())) + { bool doRecord = true; if (g_settings.recording_already_found_check) { @@ -1344,30 +1469,33 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.description, (*It)->channelEvent.eventID, TIMERD_APIDS_CONF, true, "", &evtlist); m.exec(NULL, ""); - } else - printf ("timerd not available\n"); + } + else + printf("timerd not available\n"); } return menu_return::RETURN_EXIT_ALL; } -EpgPlus::MenuTargetRefreshEpg::MenuTargetRefreshEpg (EpgPlus * pepgPlus) { +EpgPlus::MenuTargetRefreshEpg::MenuTargetRefreshEpg(EpgPlus * pepgPlus) +{ this->epgPlus = pepgPlus; } -int EpgPlus::MenuTargetRefreshEpg::exec (CMenuTarget * /*parent*/, const std::string & /*actionKey*/) +int EpgPlus::MenuTargetRefreshEpg::exec(CMenuTarget * /*parent*/, const std::string & /*actionKey*/) { this->epgPlus->refreshAll = true; return menu_return::RETURN_EXIT_ALL; } -struct CMenuOptionChooser::keyval menuOptionChooserSwitchSwapModes[] = { +struct CMenuOptionChooser::keyval menuOptionChooserSwitchSwapModes[] = +{ { EpgPlus::SwapMode_ByPage, LOCALE_EPGPLUS_BYPAGE_MODE }, { EpgPlus::SwapMode_ByBouquet, LOCALE_EPGPLUS_BYBOUQUET_MODE } }; -EpgPlus::MenuOptionChooserSwitchSwapMode::MenuOptionChooserSwitchSwapMode (EpgPlus * pepgPlus) - :CMenuOptionChooser (LOCALE_EPGPLUS_SWAP_MODE, (int *) &pepgPlus->currentSwapMode, menuOptionChooserSwitchSwapModes, sizeof (menuOptionChooserSwitchSwapModes) / sizeof (CMenuOptionChooser::keyval) - , true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW,0) +EpgPlus::MenuOptionChooserSwitchSwapMode::MenuOptionChooserSwitchSwapMode(EpgPlus * pepgPlus) + : CMenuOptionChooser(LOCALE_EPGPLUS_SWAP_MODE, (int *) &pepgPlus->currentSwapMode, menuOptionChooserSwitchSwapModes, sizeof(menuOptionChooserSwitchSwapModes) / sizeof(CMenuOptionChooser::keyval), + true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW, 0) { this->epgPlus = pepgPlus; this->oldSwapMode = epgPlus->currentSwapMode; @@ -1378,39 +1506,47 @@ EpgPlus::MenuOptionChooserSwitchSwapMode::~MenuOptionChooserSwitchSwapMode() { g_settings.timing[SNeutrinoSettings::TIMING_MENU] = this->oldTimingMenuSettings; - if (this->epgPlus->currentSwapMode != this->oldSwapMode) { - switch (this->epgPlus->currentSwapMode) { - case SwapMode_ByPage: - buttonLabels[1].locale = LOCALE_EPGPLUS_PAGE_DOWN; - buttonLabels[2].locale = LOCALE_EPGPLUS_PAGE_UP; - break; - case SwapMode_ByBouquet: - buttonLabels[1].locale = LOCALE_EPGPLUS_PREV_BOUQUET; - buttonLabels[2].locale = LOCALE_EPGPLUS_NEXT_BOUQUET; - break; + if (this->epgPlus->currentSwapMode != this->oldSwapMode) + { + switch (this->epgPlus->currentSwapMode) + { + case SwapMode_ByPage: + { + buttonLabels[1].locale = LOCALE_EPGPLUS_PAGE_DOWN; + buttonLabels[2].locale = LOCALE_EPGPLUS_PAGE_UP; + break; + } + case SwapMode_ByBouquet: + { + buttonLabels[1].locale = LOCALE_EPGPLUS_PREV_BOUQUET; + buttonLabels[2].locale = LOCALE_EPGPLUS_NEXT_BOUQUET; + break; + } } this->epgPlus->refreshAll = true; } } -int EpgPlus::MenuOptionChooserSwitchSwapMode::exec (CMenuTarget * parent) +int EpgPlus::MenuOptionChooserSwitchSwapMode::exec(CMenuTarget * parent) { // change time out settings temporary g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1; - CMenuOptionChooser::exec (parent); + CMenuOptionChooser::exec(parent); return menu_return::RETURN_REPAINT; } -struct CMenuOptionChooser::keyval menuOptionChooserSwitchViewModes[] = { +struct CMenuOptionChooser::keyval menuOptionChooserSwitchViewModes[] = +{ { EpgPlus::ViewMode_Scroll, LOCALE_EPGPLUS_STRETCH_MODE }, { EpgPlus::ViewMode_Stretch, LOCALE_EPGPLUS_SCROLL_MODE } }; -EpgPlus::MenuOptionChooserSwitchViewMode::MenuOptionChooserSwitchViewMode (EpgPlus * epgPlus) - :CMenuOptionChooser (LOCALE_EPGPLUS_VIEW_MODE, (int *) &epgPlus->currentViewMode, menuOptionChooserSwitchViewModes, sizeof (menuOptionChooserSwitchViewModes) / sizeof (CMenuOptionChooser::keyval) - , true, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE) { +EpgPlus::MenuOptionChooserSwitchViewMode::MenuOptionChooserSwitchViewMode(EpgPlus * epgPlus) + : CMenuOptionChooser(LOCALE_EPGPLUS_VIEW_MODE, (int *) &epgPlus->currentViewMode, menuOptionChooserSwitchViewModes, sizeof(menuOptionChooserSwitchViewModes) / sizeof(CMenuOptionChooser::keyval), + true, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE) +{ this->oldTimingMenuSettings = g_settings.timing[SNeutrinoSettings::TIMING_MENU]; } @@ -1419,12 +1555,12 @@ EpgPlus::MenuOptionChooserSwitchViewMode::~MenuOptionChooserSwitchViewMode() g_settings.timing[SNeutrinoSettings::TIMING_MENU] = this->oldTimingMenuSettings; } -int EpgPlus::MenuOptionChooserSwitchViewMode::exec (CMenuTarget * parent) +int EpgPlus::MenuOptionChooserSwitchViewMode::exec(CMenuTarget * parent) { // change time out settings temporary g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1; - CMenuOptionChooser::exec (parent); + CMenuOptionChooser::exec(parent); return menu_return::RETURN_REPAINT; } From 95b8665a76b557ee81d1ff62f03ea3c1f1abb368 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 11/39] epgplus: do not toggle text colors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ebc7734ad2f3da8d02ea139d0f0c91192346bd62 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: do not toggle text colors ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 46b4cc261..77ebd93e6 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -60,8 +60,6 @@ #include #include -#define COL_MENUCONTENT_P1 COL_MENUCONTENT_TEXT_PLUS_1 -#define COL_MENUCONTENT_P2 COL_MENUCONTENT_TEXT_PLUS_2 extern CBouquetList *bouquetList; Font * fonts[EpgPlus::NumberOfFontSettings]; @@ -199,12 +197,12 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) int textWidth = this->fontTime->getRenderWidth(timeStr); this->fontTime->RenderString(xPos - textWidth - 4, this->y + this->fontTime->getHeight(), - textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); + textWidth, timeStr, COL_MENUCONTENT_TEXT); timeStr = EpgPlus::getTimeString(tickTime, "%M"); textWidth = this->fontTime->getRenderWidth(timeStr); this->fontTime->RenderString(xPos + 4, this->y + this->fontTime->getHeight(), - textWidth, timeStr, toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2); + textWidth, timeStr, COL_MENUCONTENT_TEXT); toggleColor = !toggleColor; } @@ -304,7 +302,7 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), - this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)); + this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); // paint the separation line if (separationLineHeight > 0) From b63887379945d17701d69bb450f98f672a43c32c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 12/39] epgplus: remove annoying gaps Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0eefb083e8990f5efa70cd5c8e000014a597ef84 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: remove annoying gaps ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 54 +++++---------------------------------------- src/gui/epgplus.h | 27 ----------------------- 2 files changed, 6 insertions(+), 75 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 77ebd93e6..981280284 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -67,16 +67,6 @@ int sizes[EpgPlus::NumberOfSizeSettings]; time_t EpgPlus::duration = 0; -int EpgPlus::horGap1Height = 0; -int EpgPlus::horGap2Height = 0; -int EpgPlus::verGap1Width = 0; -int EpgPlus::verGap2Width = 0; - -int EpgPlus::horGap1Color = 0; -int EpgPlus::horGap2Color = 0; -int EpgPlus::verGap1Color = 0; -int EpgPlus::verGap2Color = 0; - int EpgPlus::sliderWidth = 0; int EpgPlus::channelsTableWidth = 0; @@ -98,11 +88,7 @@ static EpgPlus::SizeSetting sizeSettingTable[] = { {EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ {EpgPlus::EPGPlus_channelentry_separationlineheight, 2}, - {EpgPlus::EPGPlus_slider_width, 15}, - {EpgPlus::EPGPlus_horgap1_height, 4}, - {EpgPlus::EPGPlus_horgap2_height, 4}, - {EpgPlus::EPGPlus_vergap1_width, 4}, - {EpgPlus::EPGPlus_vergap2_width, 4}, + {EpgPlus::EPGPlus_slider_width, 15} }; static bool bigfont = false; @@ -636,7 +622,6 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) if (lastEndTime < It->startTime) { // there is a gap between last end time and new start time => fill it with a new event entry - CChannelEvent channelEvent; channelEvent.startTime = lastEndTime; channelEvent.duration = It->startTime - channelEvent.startTime; @@ -725,11 +710,6 @@ void EpgPlus::init() channelsTableWidth = sizes[EPGPlus_channelentry_width]; sliderWidth = sizes[EPGPlus_slider_width]; - horGap1Height = sizes[EPGPlus_horgap1_height]; - horGap2Height = sizes[EPGPlus_horgap2_height]; - verGap1Width = sizes[EPGPlus_vergap1_width]; - verGap2Width = sizes[EPGPlus_vergap2_width]; - int headerHeight = Header::getUsedHeight(); int timeLineHeight = TimeLine::getUsedHeight(); this->entryHeight = ChannelEntry::getUsedHeight(); @@ -744,9 +724,9 @@ void EpgPlus::init() int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max(icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ int footerHeight = Footer::getUsedHeight() + buttonHeight; - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - horGap1Height - horGap2Height - footerHeight) / this->entryHeight; + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - footerHeight) / this->entryHeight; - this->usableScreenHeight = headerHeight + timeLineHeight + horGap1Height + this->maxNumberOfDisplayableEntries * this->entryHeight + horGap2Height + footerHeight; // recalc deltaY + this->usableScreenHeight = headerHeight + timeLineHeight + this->maxNumberOfDisplayableEntries * this->entryHeight + footerHeight; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); this->usableScreenY = getScreenStartY(this->usableScreenHeight); @@ -758,39 +738,23 @@ void EpgPlus::init() this->timeLineY = this->usableScreenY + headerHeight; this->timeLineWidth = this->usableScreenWidth; - this->horGap1X = this->usableScreenX; - this->horGap1Y = this->timeLineY + timeLineHeight; - this->horGap1Width = this->usableScreenWidth; - this->footerX = usableScreenX; this->footerY = this->usableScreenY + this->usableScreenHeight - footerHeight; this->footerWidth = this->usableScreenWidth; - this->horGap2X = this->usableScreenX; - this->horGap2Y = this->footerY - horGap2Height; - this->horGap2Width = this->usableScreenWidth; - this->channelsTableX = this->usableScreenX; - this->channelsTableY = this->timeLineY + timeLineHeight + horGap1Height; + this->channelsTableY = this->timeLineY + timeLineHeight; this->channelsTableHeight = this->maxNumberOfDisplayableEntries * entryHeight; - this->verGap1X = this->channelsTableX + channelsTableWidth; - this->verGap1Y = this->channelsTableY; - this->verGap1Height = this->channelsTableHeight; - - this->eventsTableX = this->channelsTableX + channelsTableWidth + verGap1Width; + this->eventsTableX = this->channelsTableX + channelsTableWidth; this->eventsTableY = this->channelsTableY; - this->eventsTableWidth = this->usableScreenWidth - this->channelsTableWidth - this->sliderWidth - verGap1Width - verGap2Width; + this->eventsTableWidth = this->usableScreenWidth - this->channelsTableWidth - this->sliderWidth; this->eventsTableHeight = this->channelsTableHeight; this->sliderX = this->usableScreenX + this->usableScreenWidth - this->sliderWidth; this->sliderY = this->eventsTableY; this->sliderHeight = this->channelsTableHeight; - this->verGap2X = this->sliderX - verGap2Width; - this->verGap2Y = this->channelsTableY; - this->verGap2Height = this->channelsTableHeight; - this->channelListStartIndex = 0; this->startTime = 0; this->duration = 2 * 60 * 60; @@ -1337,12 +1301,6 @@ void EpgPlus::paint() //this->frameBuffer->paintBackgroundBoxRel(this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight); this->frameBuffer->paintBoxRel(this->channelsTableX, this->channelsTableY, this->usableScreenWidth, this->channelsTableHeight, COL_MENUCONTENT_PLUS_0); - // paint the gaps - this->frameBuffer->paintBoxRel(this->horGap1X, this->horGap1Y, this->horGap1Width, horGap1Height, horGap1Color); - this->frameBuffer->paintBoxRel(this->horGap2X, this->horGap2Y, this->horGap2Width, horGap2Height, horGap2Color); - this->frameBuffer->paintBoxRel(this->verGap1X, this->verGap1Y, verGap1Width, this->verGap1Height, verGap1Color); - this->frameBuffer->paintBoxRel(this->verGap2X, this->verGap2Y, verGap2Width, this->verGap2Height, verGap2Color); - // paint the time line timeLine->paint(this->startTime, this->duration); diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 4d2c097fc..7e515d027 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -58,10 +58,6 @@ class EpgPlus EPGPlus_channelentry_width = 0, EPGPlus_channelentry_separationlineheight, EPGPlus_slider_width, - EPGPlus_horgap1_height, - EPGPlus_horgap2_height, - EPGPlus_vergap1_width, - EPGPlus_vergap2_width, NumberOfSizeSettings }; @@ -488,29 +484,6 @@ class EpgPlus int footerY; int footerWidth; - int horGap1X; - int horGap1Y; - int horGap1Width; - int horGap2X; - int horGap2Y; - int horGap2Width; - int verGap1X; - int verGap1Y; - int verGap1Height; - int verGap2X; - int verGap2Y; - int verGap2Height; - - static int horGap1Height; - static int horGap2Height; - static int verGap1Width; - static int verGap2Width; - - static int horGap1Color; - static int horGap2Color; - static int verGap1Color; - static int verGap2Color; - bool refreshAll; bool refreshFooterButtons; }; From 1bb1c5707ed7d8c611423ffd91a6c7497f2686d9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 13/39] epgplus: use global header font Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d10dbeca5bd11abe0e17f7fa13e0a2638339c35f Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use global header font ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 7 +++---- src/gui/epgplus.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 981280284..470a219f2 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -72,7 +72,6 @@ int EpgPlus::channelsTableWidth = 0; static EpgPlus::FontSetting fontSettingTable[] = { - { EpgPlus::EPGPlus_header_font, "Regular", 27 }, { EpgPlus::EPGPlus_timeline_fonttime, "Bold", 16 }, { EpgPlus::EPGPlus_timeline_fontdate, "Bold", 14 }, { EpgPlus::EPGPlus_channelentry_font, "Bold", 16 }, @@ -110,20 +109,20 @@ EpgPlus::Header::~Header() void EpgPlus::Header::init() { - font = fonts[EPGPlus_header_font]; + font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; } void EpgPlus::Header::paint(const char * Name) { std::string head = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD); - CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight()+4, head); + CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight(), head); _header.paint(CC_SAVE_SCREEN_NO); } int EpgPlus::Header::getUsedHeight() { - return font->getHeight() + 8 ; + return font->getHeight(); } Font *EpgPlus::TimeLine::fontTime = NULL; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 7e515d027..ddf7385a6 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -41,8 +41,7 @@ class EpgPlus public: enum FontSettingID { - EPGPlus_header_font = 0, - EPGPlus_timeline_fonttime, + EPGPlus_timeline_fonttime = 0, EPGPlus_timeline_fontdate, EPGPlus_channelentry_font, EPGPlus_channelevententry_font, From 6841ef6ce79c4fb837405fa5089c510293c141df Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 14/39] epgplus: remove unused buttons font Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f62ccfc1abc4ee8ff5db91fa51c7475f972f29d Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: remove unused buttons font ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 12 ++++-------- src/gui/epgplus.h | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 470a219f2..6f1e179af 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -78,8 +78,7 @@ static EpgPlus::FontSetting fontSettingTable[] = { EpgPlus::EPGPlus_channelevententry_font, "Regular", 16 }, { EpgPlus::EPGPlus_footer_fontbouquetchannelname, "Bold", 24 }, { EpgPlus::EPGPlus_footer_fonteventdescription, "Regular", 16 }, - { EpgPlus::EPGPlus_footer_fonteventshortdescription, "Regular", 16 }, - { EpgPlus::EPGPlus_footer_fontbuttons, "Regular", 16 }, + { EpgPlus::EPGPlus_footer_fonteventshortdescription, "Regular", 16 } }; /* negative size means "screen width in percent" */ @@ -428,7 +427,6 @@ int EpgPlus::ChannelEntry::getUsedHeight() Font *EpgPlus::Footer::fontBouquetChannelName = NULL; Font *EpgPlus::Footer::fontEventDescription = NULL; Font *EpgPlus::Footer::fontEventShortDescription = NULL; -Font *EpgPlus::Footer::fontButtons = NULL; int EpgPlus::Footer::color = 0; EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) @@ -449,7 +447,6 @@ void EpgPlus::Footer::init() fontBouquetChannelName = fonts[EPGPlus_footer_fontbouquetchannelname]; fontEventDescription = fonts[EPGPlus_footer_fonteventdescription]; fontEventShortDescription = fonts[EPGPlus_footer_fonteventshortdescription]; - fontButtons = fonts[EPGPlus_footer_fontbuttons]; } void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, const std::string & newChannelName) @@ -460,7 +457,7 @@ void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, int EpgPlus::Footer::getUsedHeight() { - return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventShortDescription->getHeight() /* + fontButtons->getHeight()*/; + return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventShortDescription->getHeight(); } void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & shortDescription) @@ -510,8 +507,7 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - int yPos = this->y + this->getUsedHeight(); - ::paintButtons(this->x, yPos, buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); + ::paintButtons(this->x, this->y + this->getUsedHeight(), buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); } EpgPlus::EpgPlus() @@ -720,7 +716,7 @@ void EpgPlus::init() //if (icol_h < h2) // icol_h = h2; - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max(icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ + int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons int footerHeight = Footer::getUsedHeight() + buttonHeight; this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - footerHeight) / this->entryHeight; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index ddf7385a6..0a14b22f8 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -48,7 +48,6 @@ class EpgPlus EPGPlus_footer_fontbouquetchannelname, EPGPlus_footer_fonteventdescription, EPGPlus_footer_fonteventshortdescription, - EPGPlus_footer_fontbuttons, NumberOfFontSettings }; From c4e5d9a2a3bd937760f1381487996b5c4bb21eb0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 15/39] epgplus: replace timeline fonts with FONT_TYPE_EPG_DATE Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/13b957204f383f2ef127ce3ff7fee5d5311586fa Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: replace timeline fonts with FONT_TYPE_EPG_DATE ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 44 ++++++++++++++++++++------------------------ src/gui/epgplus.h | 7 ++----- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 6f1e179af..765a18bce 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -72,8 +72,6 @@ int EpgPlus::channelsTableWidth = 0; static EpgPlus::FontSetting fontSettingTable[] = { - { EpgPlus::EPGPlus_timeline_fonttime, "Bold", 16 }, - { EpgPlus::EPGPlus_timeline_fontdate, "Bold", 14 }, { EpgPlus::EPGPlus_channelentry_font, "Bold", 16 }, { EpgPlus::EPGPlus_channelevententry_font, "Regular", 16 }, { EpgPlus::EPGPlus_footer_fontbouquetchannelname, "Bold", 24 }, @@ -124,8 +122,7 @@ int EpgPlus::Header::getUsedHeight() return font->getHeight(); } -Font *EpgPlus::TimeLine::fontTime = NULL; -Font *EpgPlus::TimeLine::fontDate = NULL; +Font *EpgPlus::TimeLine::font = NULL; EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX) { @@ -139,8 +136,7 @@ EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwi void EpgPlus::TimeLine::init() { - fontTime = fonts[EPGPlus_timeline_fonttime]; - fontDate = fonts[EPGPlus_timeline_fontdate]; + font = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]; } EpgPlus::TimeLine::~TimeLine() @@ -160,10 +156,10 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) bool toggleColor = false; // display date of begin - this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->fontTime->getHeight(), + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); - this->fontDate->RenderString(this->x + 4, this->y + this->fontDate->getHeight(), + this->font->RenderString(this->x + 4, this->y + this->font->getHeight(), this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks @@ -173,19 +169,19 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) if (xPos + xWidth > this->x + width) xWidth = this->x + width - xPos; - this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->fontTime->getHeight(), + this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->font->getHeight(), toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2); std::string timeStr = EpgPlus::getTimeString(tickTime, "%H"); - int textWidth = this->fontTime->getRenderWidth(timeStr); + int textWidth = this->font->getRenderWidth(timeStr); - this->fontTime->RenderString(xPos - textWidth - 4, this->y + this->fontTime->getHeight(), + this->font->RenderString(xPos - textWidth - 4, this->y + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); timeStr = EpgPlus::getTimeString(tickTime, "%M"); - textWidth = this->fontTime->getRenderWidth(timeStr); - this->fontTime->RenderString(xPos + 4, this->y + this->fontTime->getHeight(), + textWidth = this->font->getRenderWidth(timeStr); + this->font->RenderString(xPos + 4, this->y + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); toggleColor = !toggleColor; @@ -201,7 +197,7 @@ void EpgPlus::TimeLine::paintGrid() for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist) { // display a line for the tick - this->frameBuffer->paintVLineRel(xPos, this->y, this->fontTime->getHeight(), COL_MENUCONTENT_PLUS_5); + this->frameBuffer->paintVLineRel(xPos, this->y, this->font->getHeight(), COL_MENUCONTENT_PLUS_5); } } @@ -211,41 +207,41 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int this->clearMark(); // paint new mark - this->frameBuffer->paintBoxRel(px, this->y + this->fontTime->getHeight(), - pwidth, this->fontTime->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); + this->frameBuffer->paintBoxRel(px, this->y + this->font->getHeight(), + pwidth, this->font->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); // display start time before mark std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M"); - int textWidth = this->fontTime->getRenderWidth(timeStr); + int textWidth = this->font->getRenderWidth(timeStr); - this->fontTime->RenderString(px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + this->font->RenderString(px - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark timeStr = EpgPlus::getTimeString(_startTime + pduration, "%H:%M"); - textWidth = fontTime->getRenderWidth(timeStr); + textWidth = font->getRenderWidth(timeStr); if (px + pwidth + textWidth < this->x + this->width) { - this->fontTime->RenderString(px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + this->font->RenderString(px + pwidth, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); } else if (textWidth < pwidth - 10) { - this->fontTime->RenderString(px + pwidth - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight(), + this->font->RenderString(px + pwidth - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); } } void EpgPlus::TimeLine::clearMark() { - this->frameBuffer->paintBoxRel(this->x, this->y + this->fontTime->getHeight(), - this->width, this->fontTime->getHeight() , COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), + this->width, this->font->getHeight() , COL_MENUCONTENT_PLUS_0); } int EpgPlus::TimeLine::getUsedHeight() { - return std::max(fontDate->getHeight(), fontTime->getHeight()) + fontTime->getHeight(); + return 2*font->getHeight(); } Font *EpgPlus::ChannelEventEntry::font = NULL; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 0a14b22f8..40dd9038c 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -41,9 +41,7 @@ class EpgPlus public: enum FontSettingID { - EPGPlus_timeline_fonttime = 0, - EPGPlus_timeline_fontdate, - EPGPlus_channelentry_font, + EPGPlus_channelentry_font = 0, EPGPlus_channelevententry_font, EPGPlus_footer_fontbouquetchannelname, EPGPlus_footer_fonteventdescription, @@ -154,8 +152,7 @@ class EpgPlus int y; int width; - static Font* fontTime; - static Font* fontDate; + static Font* font; int startX; int durationX; From 4af57c7a2e4c2c8568a294a9edd296e85431b963 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 16/39] epgplus: replace footer fonts with FONT_TYPE_EVENTLIST fonts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42e47b040b8b280fbdb5e1d5e7a1c2615307ff67 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: replace footer fonts with FONT_TYPE_EVENTLIST fonts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 23 ++++++++++------------- src/gui/epgplus.h | 6 +----- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 765a18bce..0fc4930d1 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -73,10 +73,7 @@ int EpgPlus::channelsTableWidth = 0; static EpgPlus::FontSetting fontSettingTable[] = { { EpgPlus::EPGPlus_channelentry_font, "Bold", 16 }, - { EpgPlus::EPGPlus_channelevententry_font, "Regular", 16 }, - { EpgPlus::EPGPlus_footer_fontbouquetchannelname, "Bold", 24 }, - { EpgPlus::EPGPlus_footer_fonteventdescription, "Regular", 16 }, - { EpgPlus::EPGPlus_footer_fonteventshortdescription, "Regular", 16 } + { EpgPlus::EPGPlus_channelevententry_font, "Regular", 16 } }; /* negative size means "screen width in percent" */ @@ -422,7 +419,7 @@ int EpgPlus::ChannelEntry::getUsedHeight() Font *EpgPlus::Footer::fontBouquetChannelName = NULL; Font *EpgPlus::Footer::fontEventDescription = NULL; -Font *EpgPlus::Footer::fontEventShortDescription = NULL; +Font *EpgPlus::Footer::fontEventInfo1 = NULL; int EpgPlus::Footer::color = 0; EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) @@ -440,9 +437,9 @@ EpgPlus::Footer::~Footer() void EpgPlus::Footer::init() { - fontBouquetChannelName = fonts[EPGPlus_footer_fontbouquetchannelname]; - fontEventDescription = fonts[EPGPlus_footer_fonteventdescription]; - fontEventShortDescription = fonts[EPGPlus_footer_fonteventshortdescription]; + fontBouquetChannelName = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]; + fontEventDescription = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]; + fontEventInfo1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]; } void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, const std::string & newChannelName) @@ -453,10 +450,10 @@ void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, int EpgPlus::Footer::getUsedHeight() { - return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventShortDescription->getHeight(); + return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventInfo1->getHeight(); } -void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & shortDescription) +void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & info1) { int yPos = this->y; @@ -468,7 +465,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // display new text - this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT); + this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUHEAD_TEXT); height = this->fontEventDescription->getHeight(); @@ -480,7 +477,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s // display new text this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT); - height = this->fontEventShortDescription->getHeight(); + height = this->fontEventInfo1->getHeight(); // clear the region this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); @@ -488,7 +485,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // display new text - this->fontEventShortDescription->RenderString(this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT); + this->fontEventInfo1->RenderString(this->x + 10, yPos, this->width - 20, info1, COL_MENUHEAD_TEXT); } struct button_label buttonLabels[] = diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 40dd9038c..a66ccf6af 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -43,9 +43,6 @@ class EpgPlus { EPGPlus_channelentry_font = 0, EPGPlus_channelevententry_font, - EPGPlus_footer_fontbouquetchannelname, - EPGPlus_footer_fonteventdescription, - EPGPlus_footer_fonteventshortdescription, NumberOfFontSettings }; @@ -280,8 +277,7 @@ class EpgPlus static Font* fontBouquetChannelName; static Font* fontEventDescription; - static Font* fontEventShortDescription; - static Font* fontButtons; + static Font* fontEventInfo1; static int color; From 7294a68cfd4e4411ab7e475d75d9eeac4d547cd5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 17/39] epgview: move BIGFONT_FACTOR to settings.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddd803d8a347a6d1baf7ac445522792f84326288 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgview: move BIGFONT_FACTOR to settings.h ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 28 ++++++++++++++-------------- src/gui/epgview.h | 3 --- src/system/settings.h | 2 ++ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index a75a29a26..078da34ae 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -692,8 +692,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (doLoop) { if (!bigFonts && g_settings.bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIGFONT_FACTOR)); } bigFonts = g_settings.bigFonts; start(); @@ -1066,8 +1066,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else doRecord = false; if (!bigFonts && g_settings.bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIGFONT_FACTOR)); } bigFonts = g_settings.bigFonts; show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false); @@ -1082,8 +1082,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); recDirs.exec(NULL,""); if (!bigFonts && g_settings.bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIGFONT_FACTOR)); } bigFonts = g_settings.bigFonts; show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false); @@ -1225,8 +1225,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start loop = false; else { if (!bigFonts && g_settings.bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIGFONT_FACTOR)); } bigFonts = g_settings.bigFonts; show(channel_id,tmp_eID,&tmp_sZeit,false); @@ -1244,12 +1244,12 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start //printf("bigFonts %d\n", bigFonts); if (bigFonts) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIGFONT_FACTOR)); } else { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIGFONT_FACTOR)); } g_settings.bigFonts = bigFonts; if (mp_info) @@ -1310,8 +1310,8 @@ void CEpgData::hide() // 2004-09-10 rasc (bugfix, scale large font settings back to normal) if (bigFonts) { bigFonts = false; - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIG_FONT_FAKTOR)); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIGFONT_FACTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIGFONT_FACTOR)); } frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index f776f5be7..c7ec15b80 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -42,9 +42,6 @@ #include #include - -#define BIG_FONT_FAKTOR 1.5 - class CFrameBuffer; class CEpgData { diff --git a/src/system/settings.h b/src/system/settings.h index 6b81674f6..9fac3784c 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -923,6 +923,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DETAILSLINE_WIDTH 16 // TODO: scale2Res() ? +#define BIGFONT_FACTOR 1.5 + struct SglobalInfo { hw_caps_t *hw_caps; From 9d4cad2a50d077892a1616e95f9ab14720c3ebcb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 18/39] epgplus: use BIGFONT_FACTOT to calculate big fonts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4394b7752b28cffd4b8436798455a91341038b0a Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use BIGFONT_FACTOT to calculate big fonts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 0fc4930d1..bf10520c7 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -670,7 +670,7 @@ void EpgPlus::init() if (bigfont && (fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelentry_font || fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelevententry_font)) { - size = size * 3 / 2; /* increase font size for channel name and event title */ + size = (int)(size * BIGFONT_FACTOR); /* increase font size for channel name and event title */ } std::string family = g_fontRenderer->getFamily(FileName.c_str()); Font *font = g_fontRenderer->getFont(family.c_str(), fontSettingTable[i].style, size); From 3e00456c3635a8584007251955cc4f36ffd9caed Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 19/39] epgplus: use RC_help to switch bigfonts; ... This is same key as used in epgview.cpp to switch bigfonts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e154f9efc303501ff706650f0ef04cb42aa3316 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use RC_help to switch bigfonts; ... This is same key as used in epgview.cpp to switch bigfonts ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bf10520c7..9f7e5adc7 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -838,9 +838,9 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque else loop = false; } - else if (msg == CRCInput::RC_epg) + else if (msg == CRCInput::RC_help) { - //fprintf(stderr, "RC_Epg, bigfont = %d\n", bigfont); + //fprintf(stderr, "RC_help, bigfont = %d\n", bigfont); hide(); bigfont = !bigfont; free(); @@ -1156,7 +1156,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque } } } - else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) + else if (msg == CRCInput::RC_info) { TCChannelEventEntries::const_iterator It = this->getSelectedEvent(); From f93ddf3232e4cf545baee7f31c4890dce283044e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 20/39] epgplus: use RC_epg to exit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f60cffc63d5055c51f01116b7512bcbe25139902 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use RC_epg to exit ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9f7e5adc7..f413408af 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -838,6 +838,10 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque else loop = false; } + else if (msg == CRCInput::RC_epg) + { + loop = false; + } else if (msg == CRCInput::RC_help) { //fprintf(stderr, "RC_help, bigfont = %d\n", bigfont); From a503d6a57380de3eb5f4b6b8cc2119b3c4b1f275 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 21/39] epgplus: remove obsolete casts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b9554b40c8021ed2de6f98ac3f2928a23ba81d20 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: remove obsolete casts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f413408af..6924204a7 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1034,7 +1034,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque this->paintChannelEntry(this->selectedChannelEntry->index - this->channelListStartIndex); } } - else if (msg == (neutrino_msg_t) CRCInput::RC_red) + else if (msg == CRCInput::RC_red) { CMenuWidget menuWidgetActions(LOCALE_EPGPLUS_ACTIONS, NEUTRINO_ICON_FEATURES); menuWidgetActions.enableFade(false); @@ -1050,7 +1050,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque this->refreshAll = true; } - else if (msg == (neutrino_msg_t) CRCInput::RC_blue) + else if (msg == CRCInput::RC_blue) { CMenuWidget menuWidgetOptions(LOCALE_EPGPLUS_OPTIONS, NEUTRINO_ICON_FEATURES); menuWidgetOptions.enableFade(false); From 5a89d96c6969f9e0fbac188aa10f0afddb66d3b0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 22/39] epgplus: use global paintScrollBar function to paint scrollbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b38237cbddefdf4180b1bd1be94417391ab490c1 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use global paintScrollBar function to paint scrollbar ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 15 +++++---------- src/gui/epgplus.h | 1 - 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 6924204a7..60f614de6 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -80,8 +80,7 @@ static EpgPlus::FontSetting fontSettingTable[] = static EpgPlus::SizeSetting sizeSettingTable[] = { {EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ - {EpgPlus::EPGPlus_channelentry_separationlineheight, 2}, - {EpgPlus::EPGPlus_slider_width, 15} + {EpgPlus::EPGPlus_channelentry_separationlineheight, 2} }; static bool bigfont = false; @@ -696,7 +695,7 @@ void EpgPlus::init() Footer::init(); channelsTableWidth = sizes[EPGPlus_channelentry_width]; - sliderWidth = sizes[EPGPlus_slider_width]; + sliderWidth = SCROLLBAR_WIDTH; int headerHeight = Header::getUsedHeight(); int timeLineHeight = TimeLine::getUsedHeight(); @@ -1306,14 +1305,10 @@ void EpgPlus::paint() this->timeLine->paintGrid(); // paint slider - this->frameBuffer->paintBoxRel(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, COL_MENUCONTENT_PLUS_0); + int total_pages = ((this->channelList->getSize() - 1) / this->maxNumberOfDisplayableEntries) + 1; + int current_page = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries); - int tmp = ((this->channelList->getSize() - 1) / this->maxNumberOfDisplayableEntries) + 1; - float sliderKnobHeight = float((sliderHeight - 4) / tmp); - int sliderKnobPosition = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries); - - this->frameBuffer->paintBoxRel(this->sliderX + 2, this->sliderY + (int(sliderKnobPosition * sliderKnobHeight)), - this->sliderWidth - 4, int (sliderKnobHeight) , COL_SCROLLBAR_ACTIVE_PLUS_0); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); } // -- EPG+ Menue Handler Class diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index a66ccf6af..fa774ac97 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -50,7 +50,6 @@ class EpgPlus { EPGPlus_channelentry_width = 0, EPGPlus_channelentry_separationlineheight, - EPGPlus_slider_width, NumberOfSizeSettings }; From c692420744df1cda123e1ddaef6053994484fa1a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:27 +0200 Subject: [PATCH 23/39] epgplus: enlarge channel/event font; scale font to osd-resolution Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6185f8714e3a5b96e898f9ae652b68cc09bd5d73 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: enlarge channel/event font; scale font to osd-resolution ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 60f614de6..f259b58d0 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -72,8 +72,8 @@ int EpgPlus::channelsTableWidth = 0; static EpgPlus::FontSetting fontSettingTable[] = { - { EpgPlus::EPGPlus_channelentry_font, "Bold", 16 }, - { EpgPlus::EPGPlus_channelevententry_font, "Regular", 16 } + { EpgPlus::EPGPlus_channelentry_font, "Bold", 18 }, + { EpgPlus::EPGPlus_channelevententry_font, "Regular", 18 } }; /* negative size means "screen width in percent" */ @@ -662,7 +662,7 @@ void EpgPlus::init() #endif usableScreenWidth = frameBuffer->getScreenWidthRel(); usableScreenHeight = frameBuffer->getScreenHeightRel(); - std::string FileName = std::string (g_settings.font_file); + std::string font_file = g_settings.font_file; for (size_t i = 0; i < NumberOfFontSettings; ++i) { int size = fontSettingTable[i].size; @@ -671,7 +671,9 @@ void EpgPlus::init() { size = (int)(size * BIGFONT_FACTOR); /* increase font size for channel name and event title */ } - std::string family = g_fontRenderer->getFamily(FileName.c_str()); + /* Activate next line when pu/fb-setmode branch is merged to master */ + //size = frameBuffer->scale2Res(size); + std::string family = g_fontRenderer->getFamily(font_file.c_str()); Font *font = g_fontRenderer->getFont(family.c_str(), fontSettingTable[i].style, size); if (font == NULL) From 3919ec9c7aa8f7348a79ecf66c106447c7d03a44 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 24/39] epgplus: change colors in footer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a702399c1211f3f9e80f0ef72c26ae489a203509 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: change colors in footer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 13 ++++++------- src/gui/epgplus.h | 4 ---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f259b58d0..8c3058686 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -419,7 +419,6 @@ int EpgPlus::ChannelEntry::getUsedHeight() Font *EpgPlus::Footer::fontBouquetChannelName = NULL; Font *EpgPlus::Footer::fontEventDescription = NULL; Font *EpgPlus::Footer::fontEventInfo1 = NULL; -int EpgPlus::Footer::color = 0; EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) { @@ -459,32 +458,32 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int height = this->fontBouquetChannelName->getHeight(); // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); yPos += height; // display new text - this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUHEAD_TEXT); + this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT); height = this->fontEventDescription->getHeight(); // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); yPos += height; // display new text - this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT); + this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUCONTENT_TEXT); height = this->fontEventInfo1->getHeight(); // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENT_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); yPos += height; // display new text - this->fontEventInfo1->RenderString(this->x + 10, yPos, this->width - 20, info1, COL_MENUHEAD_TEXT); + this->fontEventInfo1->RenderString(this->x + 10, yPos, this->width - 20, info1, COL_MENUCONTENT_TEXT); } struct button_label buttonLabels[] = diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index fa774ac97..3fc139771 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -278,8 +278,6 @@ class EpgPlus static Font* fontEventDescription; static Font* fontEventInfo1; - static int color; - std::string currentBouquetName; std::string currentChannelName; }; @@ -467,8 +465,6 @@ class EpgPlus int sliderY; static int sliderWidth; int sliderHeight; - static int sliderBackColor; - static int sliderKnobColor; int footerX; int footerY; From f4ce797576cfd4254904875eb8e911b5df6644d3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 25/39] epgplus: use a small dark separation line Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bfc94ed1bd697dfde997c4fe846a3139bd923844 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use a small dark separation line ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 8c3058686..e7a7c68bf 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -79,8 +79,8 @@ static EpgPlus::FontSetting fontSettingTable[] = /* negative size means "screen width in percent" */ static EpgPlus::SizeSetting sizeSettingTable[] = { - {EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ - {EpgPlus::EPGPlus_channelentry_separationlineheight, 2} + { EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ + { EpgPlus::EPGPlus_channelentry_separationlineheight, 1 } }; static bool bigfont = false; @@ -193,7 +193,7 @@ void EpgPlus::TimeLine::paintGrid() for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist) { // display a line for the tick - this->frameBuffer->paintVLineRel(xPos, this->y, this->font->getHeight(), COL_MENUCONTENT_PLUS_5); + this->frameBuffer->paintVLineRel(xPos, this->y, this->font->getHeight(), COL_MENUCONTENTDARK_PLUS_0); } } @@ -284,7 +284,7 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) if (separationLineHeight > 0) { this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); + this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); } if (pisSelected) { @@ -397,7 +397,7 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) if (separationLineHeight > 0) { this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENT_PLUS_5); + this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); } bool toggleColor = false; From ef31d89c99cd826c4c033d45675883aacb27de30 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 26/39] epgplus: add separationline to timeline Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a026813ad3f6393bdc33309c1ecfbfc83874cbd1 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: add separationline to timeline ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 17 +++++++++++++---- src/gui/epgplus.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index e7a7c68bf..63016dc10 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -80,7 +80,7 @@ static EpgPlus::FontSetting fontSettingTable[] = static EpgPlus::SizeSetting sizeSettingTable[] = { { EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ - { EpgPlus::EPGPlus_channelentry_separationlineheight, 1 } + { EpgPlus::EPGPlus_separationline_height, 1 } }; static bool bigfont = false; @@ -119,6 +119,7 @@ int EpgPlus::Header::getUsedHeight() } Font *EpgPlus::TimeLine::font = NULL; +int EpgPlus::TimeLine::separationLineHeight = 0; EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX) { @@ -133,6 +134,7 @@ EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwi void EpgPlus::TimeLine::init() { font = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]; + separationLineHeight = sizes[EPGPlus_separationline_height]; } EpgPlus::TimeLine::~TimeLine() @@ -227,6 +229,13 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int this->font->RenderString(px + pwidth - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); } + + // paint the separation line + if (separationLineHeight > 0) + { + this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(), + this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); + } } void EpgPlus::TimeLine::clearMark() @@ -237,7 +246,7 @@ void EpgPlus::TimeLine::clearMark() int EpgPlus::TimeLine::getUsedHeight() { - return 2*font->getHeight(); + return 2*font->getHeight() + separationLineHeight; } Font *EpgPlus::ChannelEventEntry::font = NULL; @@ -260,7 +269,7 @@ EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEven void EpgPlus::ChannelEventEntry::init() { font = fonts[EPGPlus_channelevententry_font]; - separationLineHeight = sizes[EPGPlus_channelentry_separationlineheight]; + separationLineHeight = sizes[EPGPlus_separationline_height]; } EpgPlus::ChannelEventEntry::~ChannelEventEntry() @@ -341,7 +350,7 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, void EpgPlus::ChannelEntry::init() { font = fonts[EPGPlus_channelentry_font]; - separationLineHeight = sizes[EPGPlus_channelentry_separationlineheight]; + separationLineHeight = sizes[EPGPlus_separationline_height]; } EpgPlus::ChannelEntry::~ChannelEntry() diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 3fc139771..91506569a 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -49,7 +49,7 @@ class EpgPlus enum SizeSettingID { EPGPlus_channelentry_width = 0, - EPGPlus_channelentry_separationlineheight, + EPGPlus_separationline_height, NumberOfSizeSettings }; @@ -147,6 +147,7 @@ class EpgPlus int x; int y; int width; + static int separationLineHeight; static Font* font; From a1c9ac3b45f556a3dda91fe8f0e50a106f3cd9c3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 27/39] epgplus: use OFFSET defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2371ce0d0145169b2bfd99a9282ce2bec3f91221 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use OFFSET defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 63016dc10..784928c65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -157,7 +157,7 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); - this->font->RenderString(this->x + 4, this->y + this->font->getHeight(), + this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks @@ -174,12 +174,12 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) int textWidth = this->font->getRenderWidth(timeStr); - this->font->RenderString(xPos - textWidth - 4, this->y + this->font->getHeight(), + this->font->RenderString(xPos - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); timeStr = EpgPlus::getTimeString(tickTime, "%M"); textWidth = this->font->getRenderWidth(timeStr); - this->font->RenderString(xPos + 4, this->y + this->font->getHeight(), + this->font->RenderString(xPos + OFFSET_INNER_MIN, this->y + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); toggleColor = !toggleColor; @@ -212,7 +212,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M"); int textWidth = this->font->getRenderWidth(timeStr); - this->font->RenderString(px - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), + this->font->RenderString(px - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark @@ -221,12 +221,12 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int if (px + pwidth + textWidth < this->x + this->width) { - this->font->RenderString(px + pwidth, this->y + this->font->getHeight() + this->font->getHeight(), + this->font->RenderString(px + pwidth + OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); } - else if (textWidth < pwidth - 10) + else if (textWidth < pwidth - OFFSET_INNER_MID) { - this->font->RenderString(px + pwidth - textWidth, this->y + this->font->getHeight() + this->font->getHeight(), + this->font->RenderString(px + pwidth - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); } @@ -286,8 +286,8 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); - this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), - this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(), + this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_MIN : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); // paint the separation line if (separationLineHeight > 0) @@ -369,8 +369,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); - this->font->RenderString(this->x + 2, this->y + this->font->getHeight(), - this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), + this->width - 2*OFFSET_INNER_MID, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); if (isSelected) { @@ -472,7 +472,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // display new text - this->fontBouquetChannelName->RenderString(this->x + 10, yPos, this->width - 20, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT); + this->fontBouquetChannelName->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT); height = this->fontEventDescription->getHeight(); @@ -482,7 +482,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // display new text - this->fontEventDescription->RenderString(this->x + 10, yPos, this->width - 20, description, COL_MENUCONTENT_TEXT); + this->fontEventDescription->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, description, COL_MENUCONTENT_TEXT); height = this->fontEventInfo1->getHeight(); @@ -492,7 +492,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s yPos += height; // display new text - this->fontEventInfo1->RenderString(this->x + 10, yPos, this->width - 20, info1, COL_MENUCONTENT_TEXT); + this->fontEventInfo1->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, info1, COL_MENUCONTENT_TEXT); } struct button_label buttonLabels[] = From 268bb32b3080725535941d9bd8bb5f90e5e6e766 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 28/39] epgplus: change toggle colors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a09c7a83f9360f0db0770bfa226ac8071f9e757 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: change toggle colors ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 784928c65..387dbcb5c 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -155,10 +155,10 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) // display date of begin this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), - toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); + COL_MENUCONTENT_PLUS_0); this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), - this->width, EpgPlus::getTimeString(_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); + this->width, EpgPlus::getTimeString(_startTime, "%d-%b"), COL_MENUCONTENT_TEXT); // paint ticks for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) @@ -168,7 +168,7 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) xWidth = this->x + width - xPos; this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->font->getHeight(), - toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2); + toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1); std::string timeStr = EpgPlus::getTimeString(tickTime, "%H"); @@ -284,7 +284,7 @@ bool EpgPlus::ChannelEventEntry::isSelected(time_t _selectedTime) const void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) { this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), - this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2))); + this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1))); this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(), this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_MIN : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); From f05b336d908418ebb8ba76145d27cb95379005f0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 29/39] epgplus: remove obsolete icon calculation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca20473787931866872663f107426be5b23459f9 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: remove obsolete icon calculation ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 387dbcb5c..f05083eac 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -711,13 +711,6 @@ void EpgPlus::init() int timeLineHeight = TimeLine::getUsedHeight(); this->entryHeight = ChannelEntry::getUsedHeight(); - int icol_w, icol_h, h2; - - CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); - CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &h2); - //if (icol_h < h2) - // icol_h = h2; - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons int footerHeight = Footer::getUsedHeight() + buttonHeight; From abac099187c5740deb5be2e853a6cef084b0fa65 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 30/39] epgplus: move footer-box to bottom of screen Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3cc850a08cceabeb0db8d895f6649726bd946c5 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: move footer-box to bottom of screen ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 25 +++++++++++++++---------- src/gui/epgplus.h | 4 ++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f05083eac..4a505c1e4 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -429,13 +429,15 @@ Font *EpgPlus::Footer::fontBouquetChannelName = NULL; Font *EpgPlus::Footer::fontEventDescription = NULL; Font *EpgPlus::Footer::fontEventInfo1 = NULL; -EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int /*height*/) +EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pbuttonHeight) { this->frameBuffer = pframeBuffer; this->x = px; this->y = py; this->width = pwidth; - this->buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons + + this->buttonHeight = pbuttonHeight; + this->buttonY = this->y - OFFSET_INTER - this->buttonHeight; } EpgPlus::Footer::~Footer() @@ -507,7 +509,7 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - ::paintButtons(this->x, this->y + this->getUsedHeight(), buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); + ::paintButtons(this->x, this->buttonY, buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); } EpgPlus::EpgPlus() @@ -670,6 +672,7 @@ void EpgPlus::init() #endif usableScreenWidth = frameBuffer->getScreenWidthRel(); usableScreenHeight = frameBuffer->getScreenHeightRel(); + std::string font_file = g_settings.font_file; for (size_t i = 0; i < NumberOfFontSettings; ++i) { @@ -711,12 +714,14 @@ void EpgPlus::init() int timeLineHeight = TimeLine::getUsedHeight(); this->entryHeight = ChannelEntry::getUsedHeight(); - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons - int footerHeight = Footer::getUsedHeight() + buttonHeight; + int buttonHeight = ::paintButtons(0, 0, 0, sizeof(buttonLabels)/sizeof(button_label), buttonLabels, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - footerHeight) / this->entryHeight; + int footerHeight = Footer::getUsedHeight(); - this->usableScreenHeight = headerHeight + timeLineHeight + this->maxNumberOfDisplayableEntries * this->entryHeight + footerHeight; // recalc deltaY + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_INTER - footerHeight) / this->entryHeight; + this->bodyHeight = this->maxNumberOfDisplayableEntries * entryHeight; + + this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); this->usableScreenY = getScreenStartY(this->usableScreenHeight); @@ -734,16 +739,16 @@ void EpgPlus::init() this->channelsTableX = this->usableScreenX; this->channelsTableY = this->timeLineY + timeLineHeight; - this->channelsTableHeight = this->maxNumberOfDisplayableEntries * entryHeight; + this->channelsTableHeight = this->bodyHeight; this->eventsTableX = this->channelsTableX + channelsTableWidth; this->eventsTableY = this->channelsTableY; this->eventsTableWidth = this->usableScreenWidth - this->channelsTableWidth - this->sliderWidth; - this->eventsTableHeight = this->channelsTableHeight; + this->eventsTableHeight = this->bodyHeight; this->sliderX = this->usableScreenX + this->usableScreenWidth - this->sliderWidth; this->sliderY = this->eventsTableY; - this->sliderHeight = this->channelsTableHeight; + this->sliderHeight = this->bodyHeight; this->channelListStartIndex = 0; this->startTime = 0; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 91506569a..8cad4cb53 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -273,6 +273,8 @@ class EpgPlus int x; int y; int width; + + int buttonY; int buttonHeight; static Font* fontBouquetChannelName; @@ -452,6 +454,8 @@ class EpgPlus int timeLineY; int timeLineWidth; + int bodyHeight; + int channelsTableX; int channelsTableY; static int channelsTableWidth; From 6c9da30dc659817a64167b34d958d4c1adfc1098 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 31/39] epgplus: add an inner small offset and a small frame to footer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/45139536070cbec3956c5e5e647411778fe778aa Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: add an inner small offset and a small frame to footer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 4a505c1e4..779d3098f 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -459,41 +459,28 @@ void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, int EpgPlus::Footer::getUsedHeight() { - return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventInfo1->getHeight(); + return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventInfo1->getHeight() + 2*OFFSET_INNER_SMALL; } void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & info1) { int yPos = this->y; + int frame_thickness = 2; - int height = this->fontBouquetChannelName->getHeight(); + // clear the whole footer + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0); + this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0); - // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); - - yPos += height; - - // display new text + // display bouquet and channel name + yPos += OFFSET_INNER_SMALL + this->fontBouquetChannelName->getHeight(); this->fontBouquetChannelName->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT); - height = this->fontEventDescription->getHeight(); - - // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); - - yPos += height; - - // display new text + // display event's descrition + yPos += this->fontEventDescription->getHeight(); this->fontEventDescription->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, description, COL_MENUCONTENT_TEXT); - height = this->fontEventInfo1->getHeight(); - - // clear the region - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, height, COL_MENUCONTENTDARK_PLUS_0); - - yPos += height; - - // display new text + // display event's info1 + yPos += this->fontEventInfo1->getHeight(); this->fontEventInfo1->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, info1, COL_MENUCONTENT_TEXT); } From 0199ae91ad5c4b35ca652dd98faf938e3825acfc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 32/39] epgplus: add missing round corners to footer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c3c6332fd27fa177cc7691a3fc06dfb1236ee3d Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: add missing round corners to footer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 779d3098f..96d0dd218 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -468,8 +468,8 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int frame_thickness = 2; // clear the whole footer - this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0); - this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0); + this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); + this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0, RADIUS_LARGE); // display bouquet and channel name yPos += OFFSET_INNER_SMALL + this->fontBouquetChannelName->getHeight(); From 16b87936388faee0e51dfb6ca7d6bc0482ed9744 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 33/39] epgplus: add detailsline Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b24d55413d2eaa2ca1dd3071c69805fdcd64c386 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: add detailsline ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 31 ++++++++++++++++++++++++++++++- src/gui/epgplus.h | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 96d0dd218..2666ad096 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -345,6 +344,8 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, this->x = px; this->y = py; this->width = pwidth; + + this->detailsLine = NULL; } void EpgPlus::ChannelEntry::init() @@ -362,6 +363,12 @@ EpgPlus::ChannelEntry::~ChannelEntry() delete *It; } this->channelEventEntries.clear(); + + if (this->detailsLine) + { + delete this->detailsLine; + this->detailsLine = NULL; + } } void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) @@ -418,6 +425,28 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) toggleColor = !toggleColor; } + + // kill detailsline + if (detailsLine) + { + detailsLine->kill(); + delete detailsLine; + detailsLine = NULL; + } + + // paint detailsline + if (isSelected) + { + int xPos = this->x - DETAILSLINE_WIDTH; + int yPosTop = this->y + this->font->getHeight()/2; + int yPosBottom = this->footer->y + this->footer->getUsedHeight()/2; + + if (detailsLine == NULL) + { + detailsLine = new CComponentsDetailsLine(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2); + } + detailsLine->paint(false); + } } int EpgPlus::ChannelEntry::getUsedHeight() diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 8cad4cb53..03ab5e295 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -25,6 +25,7 @@ #ifndef __epgplus__ #define __epgplus__ +#include #include "widget/menue.h" #include @@ -238,6 +239,7 @@ class EpgPlus static Font* font; TCChannelEventEntries channelEventEntries; + CComponentsDetailsLine *detailsLine; }; typedef std::vector TChannelEntries; From 4df1b65ec0739531778c496c43105d44d33455da Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 34/39] osd_setup: add new epgplus font Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b7430969aa594bf38206b7a913cb6bdb3aef5e5 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - osd_setup: add new epgplus font ------------------ 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/osd_setup.cpp | 4 +++- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7a3fc72ca..d8739fca7 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -730,6 +730,7 @@ fontsize.epg_date EPG Datum fontsize.epg_info1 EPG Info 1 fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Titel +fontsize.epgplus_item EPG-Plus Listeneintrag fontsize.eventlist_datetime Datum/Zeit fontsize.eventlist_event Event Info fontsize.eventlist_itemlarge Groß diff --git a/data/locale/english.locale b/data/locale/english.locale index b45a5c01b..7d71de370 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -730,6 +730,7 @@ fontsize.epg_date EPG Date fontsize.epg_info1 EPG Info 1 fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Title +fontsize.epgplus_item EPG-Plus item fontsize.eventlist_datetime Date and time fontsize.eventlist_event Event Info fontsize.eventlist_itemlarge Large diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8a31cf3c2..d36a1e7df 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -137,7 +137,8 @@ const SNeutrinoSettings::FONT_TYPES epg_font_sizes[] = SNeutrinoSettings::FONT_TYPE_EPG_TITLE, SNeutrinoSettings::FONT_TYPE_EPG_INFO1, SNeutrinoSettings::FONT_TYPE_EPG_INFO2, - SNeutrinoSettings::FONT_TYPE_EPG_DATE + SNeutrinoSettings::FONT_TYPE_EPG_DATE, + SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM }; size_t epg_font_items = sizeof(epg_font_sizes)/sizeof(epg_font_sizes[0]); @@ -197,6 +198,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2}, {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EPG_DATE , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_EPGPLUS_ITEM , 18, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EVENTLIST_TITLE , 30, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, diff --git a/src/system/locals.h b/src/system/locals.h index ffa9f4f9b..965508c82 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -757,6 +757,7 @@ typedef enum LOCALE_FONTSIZE_EPG_INFO1, LOCALE_FONTSIZE_EPG_INFO2, LOCALE_FONTSIZE_EPG_TITLE, + LOCALE_FONTSIZE_EPGPLUS_ITEM, LOCALE_FONTSIZE_EVENTLIST_DATETIME, LOCALE_FONTSIZE_EVENTLIST_EVENT, LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 41ca230ce..0a256f41c 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -757,6 +757,7 @@ const char * locale_real_names[] = "fontsize.epg_info1", "fontsize.epg_info2", "fontsize.epg_title", + "fontsize.epgplus_item", "fontsize.eventlist_datetime", "fontsize.eventlist_event", "fontsize.eventlist_itemlarge", diff --git a/src/system/settings.h b/src/system/settings.h index 9fac3784c..520ae7809 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -665,6 +665,7 @@ struct SNeutrinoSettings FONT_TYPE_EPG_INFO1, FONT_TYPE_EPG_INFO2, FONT_TYPE_EPG_DATE, + FONT_TYPE_EPGPLUS_ITEM, FONT_TYPE_EVENTLIST_TITLE, FONT_TYPE_EVENTLIST_ITEMLARGE, FONT_TYPE_EVENTLIST_ITEMSMALL, From 158ea7a8f69a4639abaa3689436da0124b6f2c22 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 35/39] epgplus: use new FONT_TYPE_EPGPLUS_ITEM font; ... TODO: re-implement bigfont handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/21b25fb1fe5c53138a175991708c90f8b0e6215f Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use new FONT_TYPE_EPGPLUS_ITEM font; ... TODO: re-implement bigfont handling ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 38 ++++---------------------------------- src/gui/epgplus.h | 14 -------------- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 2666ad096..1d360bc0f 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -61,7 +61,6 @@ extern CBouquetList *bouquetList; -Font * fonts[EpgPlus::NumberOfFontSettings]; int sizes[EpgPlus::NumberOfSizeSettings]; time_t EpgPlus::duration = 0; @@ -69,12 +68,6 @@ time_t EpgPlus::duration = 0; int EpgPlus::sliderWidth = 0; int EpgPlus::channelsTableWidth = 0; -static EpgPlus::FontSetting fontSettingTable[] = -{ - { EpgPlus::EPGPlus_channelentry_font, "Bold", 18 }, - { EpgPlus::EPGPlus_channelevententry_font, "Regular", 18 } -}; - /* negative size means "screen width in percent" */ static EpgPlus::SizeSetting sizeSettingTable[] = { @@ -267,7 +260,8 @@ EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEven void EpgPlus::ChannelEventEntry::init() { - font = fonts[EPGPlus_channelevententry_font]; + //TODO: re-implement bigfont handling + font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; separationLineHeight = sizes[EPGPlus_separationline_height]; } @@ -350,7 +344,8 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, void EpgPlus::ChannelEntry::init() { - font = fonts[EPGPlus_channelentry_font]; + //TODO: re-implement bigfont handling + font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; separationLineHeight = sizes[EPGPlus_separationline_height]; } @@ -689,26 +684,6 @@ void EpgPlus::init() usableScreenWidth = frameBuffer->getScreenWidthRel(); usableScreenHeight = frameBuffer->getScreenHeightRel(); - std::string font_file = g_settings.font_file; - for (size_t i = 0; i < NumberOfFontSettings; ++i) - { - int size = fontSettingTable[i].size; - if (bigfont && (fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelentry_font || - fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelevententry_font)) - { - size = (int)(size * BIGFONT_FACTOR); /* increase font size for channel name and event title */ - } - /* Activate next line when pu/fb-setmode branch is merged to master */ - //size = frameBuffer->scale2Res(size); - std::string family = g_fontRenderer->getFamily(font_file.c_str()); - Font *font = g_fontRenderer->getFont(family.c_str(), fontSettingTable[i].style, size); - - if (font == NULL) - font = g_fontRenderer->getFont(family.c_str(), "Regular", size); - - fonts[i] = font; - } - for (size_t i = 0; i < NumberOfSizeSettings; ++i) { int size = sizeSettingTable[i].size; @@ -786,11 +761,6 @@ void EpgPlus::free() delete this->header; delete this->timeLine; delete this->footer; - int i; - for (i = 0; i < NumberOfFontSettings; ++i) - { - delete fonts[i]; - } } int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouquetList *pbouquetList) diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 03ab5e295..d66759614 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -40,13 +40,6 @@ class EpgPlus { //// types, inner classes public: - enum FontSettingID - { - EPGPlus_channelentry_font = 0, - EPGPlus_channelevententry_font, - NumberOfFontSettings - }; - enum SizeSettingID { EPGPlus_channelentry_width = 0, @@ -54,13 +47,6 @@ class EpgPlus NumberOfSizeSettings }; - struct FontSetting - { - FontSettingID settingID; - const char* style; - int size; - }; - struct SizeSetting { SizeSettingID settingID; From 3c98b77418eeae848675c4f3ab14d7bac4f7467f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 36/39] epgplus: add separationline to event's left side Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df49551258c7519d42c6767533f824934b13bf24 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: add separationline to event's left side ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 41 +++++++++++++++++++++++------------------ src/gui/epgplus.h | 8 ++++---- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 1d360bc0f..f7f6dfd7a 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -72,7 +72,7 @@ int EpgPlus::channelsTableWidth = 0; static EpgPlus::SizeSetting sizeSettingTable[] = { { EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ - { EpgPlus::EPGPlus_separationline_height, 1 } + { EpgPlus::EPGPlus_separationline_thickness, 1 } }; static bool bigfont = false; @@ -111,7 +111,7 @@ int EpgPlus::Header::getUsedHeight() } Font *EpgPlus::TimeLine::font = NULL; -int EpgPlus::TimeLine::separationLineHeight = 0; +int EpgPlus::TimeLine::separationLineThickness = 0; EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX) { @@ -126,7 +126,7 @@ EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwi void EpgPlus::TimeLine::init() { font = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]; - separationLineHeight = sizes[EPGPlus_separationline_height]; + separationLineThickness = sizes[EPGPlus_separationline_thickness]; } EpgPlus::TimeLine::~TimeLine() @@ -223,10 +223,10 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int } // paint the separation line - if (separationLineHeight > 0) + if (separationLineThickness > 0) { this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); + this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0); } } @@ -238,11 +238,11 @@ void EpgPlus::TimeLine::clearMark() int EpgPlus::TimeLine::getUsedHeight() { - return 2*font->getHeight() + separationLineHeight; + return 2*font->getHeight() + separationLineThickness; } Font *EpgPlus::ChannelEventEntry::font = NULL; -int EpgPlus::ChannelEventEntry::separationLineHeight = 0; +int EpgPlus::ChannelEventEntry::separationLineThickness = 0; EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEvent, CFrameBuffer * pframeBuffer, TimeLine * ptimeLine, Footer * pfooter, int px, int py, int pwidth) { @@ -262,7 +262,7 @@ void EpgPlus::ChannelEventEntry::init() { //TODO: re-implement bigfont handling font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; - separationLineHeight = sizes[EPGPlus_separationline_height]; + separationLineThickness = sizes[EPGPlus_separationline_thickness]; } EpgPlus::ChannelEventEntry::~ChannelEventEntry() @@ -280,13 +280,18 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1))); this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(), - this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_MIN : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_SMALL : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); - // paint the separation line - if (separationLineHeight > 0) + // paint the separation lines + if (separationLineThickness > 0) { + // left side + this->frameBuffer->paintBoxRel(this->x, this->y, + this->separationLineThickness, this->font->getHeight(), COL_MENUCONTENTDARK_PLUS_0); + + // bottom this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); + this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0); } if (pisSelected) { @@ -310,11 +315,11 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) int EpgPlus::ChannelEventEntry::getUsedHeight() { - return font->getHeight() + separationLineHeight; + return font->getHeight() + separationLineThickness; } Font *EpgPlus::ChannelEntry::font = NULL; -int EpgPlus::ChannelEntry::separationLineHeight = 0; +int EpgPlus::ChannelEntry::separationLineThickness = 0; EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) { @@ -346,7 +351,7 @@ void EpgPlus::ChannelEntry::init() { //TODO: re-implement bigfont handling font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; - separationLineHeight = sizes[EPGPlus_separationline_height]; + separationLineThickness = sizes[EPGPlus_separationline_thickness]; } EpgPlus::ChannelEntry::~ChannelEntry() @@ -405,10 +410,10 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) } } // paint the separation line - if (separationLineHeight > 0) + if (separationLineThickness > 0) { this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), - this->width, this->separationLineHeight, COL_MENUCONTENTDARK_PLUS_0); + this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0); } bool toggleColor = false; @@ -446,7 +451,7 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) int EpgPlus::ChannelEntry::getUsedHeight() { - return font->getHeight() + separationLineHeight; + return font->getHeight() + separationLineThickness; } Font *EpgPlus::Footer::fontBouquetChannelName = NULL; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index d66759614..d3a46f9c9 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -43,7 +43,7 @@ class EpgPlus enum SizeSettingID { EPGPlus_channelentry_width = 0, - EPGPlus_separationline_height, + EPGPlus_separationline_thickness, NumberOfSizeSettings }; @@ -134,7 +134,7 @@ class EpgPlus int x; int y; int width; - static int separationLineHeight; + static int separationLineThickness; static Font* font; @@ -177,7 +177,7 @@ class EpgPlus int x; int y; int width; - static int separationLineHeight; + static int separationLineThickness; static Font* font; }; @@ -220,7 +220,7 @@ class EpgPlus int x; int y; int width; - static int separationLineHeight; + static int separationLineThickness; static Font* font; From 19eefe791426758d5f54fa96be4637fb70220b8f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 37/39] epgplus: use CComponenentsFooter to paint buttonbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0ee10f1516027731900a41034d6231b004904cc6 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: use CComponenentsFooter to paint buttonbar ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f7f6dfd7a..4878e5b0c 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -515,17 +515,18 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s struct button_label buttonLabels[] = { - {NEUTRINO_ICON_BUTTON_RED, LOCALE_EPGPLUS_ACTIONS}, - {NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EPGPLUS_PREV_BOUQUET /*LOCALE_EPGPLUS_PAGE_UP*/}, - {NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_EPGPLUS_NEXT_BOUQUET /*LOCALE_EPGPLUS_PAGE_DOWN*/}, - {NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGPLUS_OPTIONS}, - {NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_EPGMENU_EVENTINFO} + { NEUTRINO_ICON_BUTTON_RED, LOCALE_EPGPLUS_ACTIONS }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EPGPLUS_PREV_BOUQUET }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_EPGPLUS_NEXT_BOUQUET }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGPLUS_OPTIONS }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL,LOCALE_EPGMENU_EVENTINFO } }; void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - ::paintButtons(this->x, this->buttonY, buttonWidth, numberOfButtons, pbuttonLabels, buttonWidth, buttonHeight); + CComponentsFooter _footer; + _footer.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); } EpgPlus::EpgPlus() @@ -710,7 +711,7 @@ void EpgPlus::init() int timeLineHeight = TimeLine::getUsedHeight(); this->entryHeight = ChannelEntry::getUsedHeight(); - int buttonHeight = ::paintButtons(0, 0, 0, sizeof(buttonLabels)/sizeof(button_label), buttonLabels, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); + int buttonHeight = headerHeight; int footerHeight = Footer::getUsedHeight(); From 502e9ca3d655290c998bedec05a68376ed10e4be Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 38/39] epgplus: re-implement bigfont handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3e49887ded5f0ea5e607eee154b49c1d06e16f1 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: re-implement bigfont handling ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 15 +++++++++++++-- src/gui/epgplus.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 4878e5b0c..1c5564aff 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -67,6 +67,7 @@ time_t EpgPlus::duration = 0; int EpgPlus::sliderWidth = 0; int EpgPlus::channelsTableWidth = 0; +int EpgPlus::entryFontSize = 0; /* negative size means "screen width in percent" */ static EpgPlus::SizeSetting sizeSettingTable[] = @@ -260,7 +261,6 @@ EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEven void EpgPlus::ChannelEventEntry::init() { - //TODO: re-implement bigfont handling font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; separationLineThickness = sizes[EPGPlus_separationline_thickness]; } @@ -349,7 +349,6 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, void EpgPlus::ChannelEntry::init() { - //TODO: re-implement bigfont handling font = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]; separationLineThickness = sizes[EPGPlus_separationline_thickness]; } @@ -698,6 +697,15 @@ void EpgPlus::init() sizes[i] = size; } + if (entryFontSize == 0) + entryFontSize = g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]->getSize(); + + // reset possible bigfont + g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]->setSize(entryFontSize); + + if (bigfont) + g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]->setSize((int)(entryFontSize * BIGFONT_FACTOR)); + Header::init(); TimeLine::init(); ChannelEntry::init(); @@ -1243,6 +1251,9 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque } this->displayedChannelEntries.clear(); + // reset possible bigfont + g_Font[SNeutrinoSettings::FONT_TYPE_EPGPLUS_ITEM]->setSize(entryFontSize); + return res; } diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index d3a46f9c9..9efaef825 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -425,6 +425,7 @@ class EpgPlus static time_t duration; int entryHeight; + static int entryFontSize; TViewMode currentViewMode; TSwapMode currentSwapMode; From f907bfd12f9735a60e10677c0b68ea3fdbf7d516 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Apr 2017 14:11:28 +0200 Subject: [PATCH 39/39] epgplus: simplify detailsline handling; fix coords in hide() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/01e0ae3696ae98332bf1e97858b4f5e7ed752980 Author: vanhofen Date: 2017-04-08 (Sat, 08 Apr 2017) Origin message was: ------------------ - epgplus: simplify detailsline handling; fix coords in hide() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 1c5564aff..5c84e62df 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -425,14 +425,6 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) toggleColor = !toggleColor; } - // kill detailsline - if (detailsLine) - { - detailsLine->kill(); - delete detailsLine; - detailsLine = NULL; - } - // paint detailsline if (isSelected) { @@ -441,9 +433,9 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) int yPosBottom = this->footer->y + this->footer->getUsedHeight()/2; if (detailsLine == NULL) - { - detailsLine = new CComponentsDetailsLine(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2); - } + detailsLine = new CComponentsDetailsLine(); + + detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2); detailsLine->paint(false); } } @@ -1273,7 +1265,7 @@ EpgPlus::TCChannelEventEntries::const_iterator EpgPlus::getSelectedEvent() const void EpgPlus::hide() { - this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); } void EpgPlus::paintChannelEntry(int position)