From be193b9eae740f1adaa6ceaa5de53918d0ad60e4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 13 Apr 2017 17:32:24 +0200 Subject: [PATCH 01/18] fix init cl_force_repaint Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b4bb9ef5eafb32ac903f0c82cd97ff3143b54b4c Author: Jacek Jendrzej Date: 2017-04-13 (Thu, 13 Apr 2017) --- src/gui/components/cc_frm_clock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index a13193e09..f11a27f18 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -74,6 +74,9 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, setClockFormat(prformat_str, secformat_str); cl_col_text = COL_MENUCONTENT_TEXT; + //enable refresh of all segments on each interval as default + cl_force_repaint = true; + //init default font cl_font = font; cl_font_style = font_style; @@ -87,9 +90,6 @@ 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; From 90531ed90beec10387f9a6439925de3537fdace7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Apr 2017 23:28:35 +0200 Subject: [PATCH 02/18] CComponentsFooter: avoid crash because possible divisions by 0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb0dc47e35c06a790109b5c59094170ed7ee3e0b Author: Thilo Graf Date: 2017-04-13 (Thu, 13 Apr 2017) --- src/gui/components/cc_frm_footer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 853b4465a..3532e05f3 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -111,6 +111,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con if (chain) chain->clear(); + if (label_count == 0) + return; + /* set general available full basic space for button chain, * in this case this is footer width */ @@ -372,7 +375,6 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setButtonFont(font); this->setContextButton(context_buttons); this->setButtonLabels(content, label_count, 0, label_width); - this->paint(do_save_bg); } From fe82b8acb881951c9eb844976bd65a656011fb70 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 11 Apr 2017 07:16:54 +0200 Subject: [PATCH 03/18] CComponentsTimer: use sleep() instead mySleep() Had some problems with mySleep() related to select() which was used inside mySleep() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dbc4a487e4f81d1a702d5816c3b69d80ddac52bf Author: Thilo Graf Date: 2017-04-11 (Tue, 11 Apr 2017) --- src/gui/components/cc_timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index a7b7e13ca..ab6523840 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -64,7 +64,7 @@ void CComponentsTimer::runSharedTimerAction() tm_mutex.lock(); OnTimer(); if (!tm_enable_nano) - mySleep(tm_interval); + sleep(tm_interval); else usleep((useconds_t)tm_interval); tm_mutex.unlock(); From 302fd7bc860a420ac5a3e101ea41dd452216646f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 04/18] CComponentsChannelLogo: add missing type Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4762f78a5ed11ee4156e811393836698bf959d8 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) --- src/gui/components/cc_item_picture.cpp | 1 + src/gui/components/cc_types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 1870092af..2900ceb3a 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -385,6 +385,7 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& channelName, bool allow_scale) { + cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO; channel_name = ""; channel_id = 0; alt_pic_name = ""; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 83b22f8d3..297cc5b66 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -41,6 +41,7 @@ typedef enum CC_ITEMTYPE_GENERIC, CC_ITEMTYPE_ITEM, CC_ITEMTYPE_PICTURE, + CC_ITEMTYPE_CHANNEL_LOGO, CC_ITEMTYPE_TEXT, CC_ITEMTYPE_TEXT_INFOBOX, CC_ITEMTYPE_SHAPE_SQUARE, From f00b4d78cbba0b9b65a0ad71f280c0db92ad1eab Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 05/18] CComponentsChannelLogo: use separat var for pic name inside setChannel() picname is a class attribut and should not be touched here till new content exists. Btw. setChannel() is eqiuvalent to setPicture() from base class, so it makes sense to use setPicture() inside setChannel() after picname is known. Explicit call of initCCTitem() is not required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29a01bd2d8975b56017caf342c3e651e3fde9417 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) --- src/gui/components/cc_item_picture.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 2900ceb3a..257586e3c 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -416,6 +416,8 @@ void CComponentsChannelLogo::setAltLogo(const char* picture_name) void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { need_init = true; + string image = pic_name; + if (channelId || !channelName.empty()){ if ((channel_id == channelId) && (channel_name == channelName)) need_init = false; @@ -426,16 +428,16 @@ void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::st int dummy; - has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &dummy, &dummy); + has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, image, &dummy, &dummy); if (!has_logo)//no logo was found, use altrenate icon or logo - pic_name = alt_pic_name; + image = alt_pic_name; //if logo or alternate image still not available, set has logo to false - has_logo = !pic_name.empty(); + has_logo = !image.empty(); //refresh object - initCCItem(); + setPicture(image); //set has_logo to false if no dimensions were detected if (width && height) From a0f75e05e5a59d14c2c5dade5897287b2c57651d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 06/18] CComponentsPicture: init missing vars for old dimension dimensions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f499d3d38723e57f1e777c66f5c41e1cde3b5ea3 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) --- src/gui/components/cc_item_picture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 257586e3c..1826431d7 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -74,8 +74,8 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, //CComponents x = x_old = x_pos; y = y_old = y_pos; - width = dx = dxc = w; - height = dy = dyc = h; + width = width_old = dx = dxc = w; + height = height_old = dy = dyc = h; pic_name = pic_name_old = image_name; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; From c6f91f5b672ab909a24300008df5dcf32ce9342d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 07/18] CComponentsItem: add missing methodes for position setters Parent items were not considered for position calculation. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/069379930a6b5d7f25016513580fefedb02fc6c7 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) --- src/gui/components/cc_item.cpp | 14 ++++++++++++++ src/gui/components/cc_item.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index b783f82d8..54c335c9a 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -261,6 +261,20 @@ bool CComponentsItem::isAdded() return false; } +void CComponentsItem::setXPos(const int& xpos) +{ + CCDraw::setXPos(xpos); + if (cc_parent) + cc_xr = cc_parent->getXPos() + x; +} + +void CComponentsItem::setYPos(const int& ypos) +{ + CCDraw::setYPos(ypos); + if (cc_parent) + cc_yr = cc_parent->getYPos() + y; +} + void CComponentsItem::setXPosP(const uint8_t& xpos_percent) { int x_tmp = cc_parent ? xpos_percent*cc_parent->getWidth() : xpos_percent*frameBuffer->getScreenWidth(); diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 4f5f42da5..37677a813 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -134,6 +134,11 @@ class CComponentsItem : public CComponents ///returns current number of page location of current item, see: cc_page_number virtual u_int8_t getPageNumber(){return cc_page_number;}; + ///set screen x-position, parameter as int + virtual void setXPos(const int& xpos); + ///set screen y-position, parameter as int + virtual void setYPos(const int& ypos); + ///set screen x-position, parameter as uint8_t, percent x value related to current width of parent form or screen virtual void setXPosP(const uint8_t& xpos_percent); ///set screen y-position, parameter as uint8_t, percent y value related to current height of parent form or screen From eca35b1bcbfc6f64c5b94a5c49573799b60d3dca Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 08/18] CComponentsPicture: add explicit methodes to set image position Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5361296ff48b4517eac502688d28479df69c1923 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) --- src/gui/components/cc_item_picture.cpp | 18 ++++++++++++++++++ src/gui/components/cc_item_picture.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 1826431d7..4bcbc14a1 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -148,6 +148,24 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) initCCItem(); } +void CComponentsPicture::setXPos(const int& xpos) +{ + CComponentsItem::setXPos(xpos); + if (xpos == x) + return; + need_init = true; + initCCItem(); +} + +void CComponentsPicture::setYPos(const int& ypos) +{ + CComponentsItem::setYPos(ypos); + if (ypos == y) + return; + need_init = true; + initCCItem(); +} + void CComponentsPicture::initCCItem() { if (pic_name.empty() || !need_init){ diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 0781b446e..7bf8953d0 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -162,6 +162,11 @@ class CComponentsPicture : public CComponentsItem ///set height of object and image related to current screen size, see also CComponentsItem::setHeightP(), parameter as uint8_t virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; need_init = hasChanges(); initCCItem();} + ///set screen x-position, parameter as int + virtual void setXPos(const int& xpos); + ///set screen y-position, parameter as int + virtual void setYPos(const int& ypos); + ///return paint mode of internal image, true=image was painted, please do not to confuse with isPainted()! isPainted() is related to item itself. virtual inline bool isPicPainted(){return is_image_painted;}; From 589cf00f6f112ce1018f3ad14d35e7b76047cd59 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:04:34 +0200 Subject: [PATCH 09/18] CComponentsForm: try to fix fit items inside forms Some items had offsets on screen. Was seen eg. in message windows. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ac706b86c875556da906305d3307e086dc84186 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index d124f3395..87cb5f66d 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -375,6 +375,7 @@ void CComponentsForm::paintCCItems() if (cc_parent){ this_x = auto_x = cc_xr; this_y = auto_y = cc_yr; + w_parent_frame = cc_parent->getFrameThickness(); } //init and handle scrollbar @@ -482,7 +483,7 @@ void CComponentsForm::paintCCItems() //Is it too wide or too high, it will be shortened and displayed in the log. //This should be avoid! //checkwidth and adapt if required - int right_frm = (cc_parent ? cc_xr : x) + this_w - 2*fr_thickness; + int right_frm = (cc_parent ? cc_xr : x) + this_w/* - 2*fr_thickness*/; int right_item = cc_item->getRealXPos() + w_item; int w_diff = right_item - right_frm; int new_w = w_item - w_diff; From 7af9377262f4d9408cd865f5a66216d925f27689 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:07:56 +0200 Subject: [PATCH 10/18] CComponentsWindow: try to fix header and footer arrangement Header and footer were placed too much on left side. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e1f51050b213c823919b6ad40773e4d7ce3ca94f Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 80455a5ad..acf06e1b4 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -201,7 +201,7 @@ void CComponentsWindow::initHeader() //set header properties //TODO: assigned properties with internal header objekt have no effect! if (ccw_head){ ccw_head->setWidth(width-2*fr_thickness); - ccw_head->setPos(0, 0); + ccw_head->setPos(fr_thickness, fr_thickness); ccw_head->setIcon(ccw_icon_name); ccw_head->setCaption(ccw_caption, ccw_align_mode, ccw_col_head_text); ccw_head->setContextButton(ccw_buttons); @@ -219,8 +219,8 @@ void CComponentsWindow::initFooter() if (ccw_footer){ if (ccw_h_footer) ccw_footer->setHeight(ccw_h_footer); - ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); - ccw_footer->setWidth(width-2*fr_thickness); + ccw_footer->setPos(cc_xr + fr_thickness, cc_yr + height - ccw_footer->getHeight()- fr_thickness); + ccw_footer->setWidth(width/*-2*fr_thickness*/); ccw_footer->enableShadow(false/*shadow*/); ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); From 87ecc7a58dff65153010863bceda6e72679fd8ab Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:51:54 +0200 Subject: [PATCH 11/18] CComponentsHeader: Reduce offset between clock and right border. Was too large Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/42db55e61de803e8dc610e754ded097e8d31b02a Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index acdee9363..351b6cc3e 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -475,7 +475,7 @@ void CComponentsHeader::initCaption() int clock_w = cch_cl_enable ? cch_cl_obj->getWidth() : 0; //set x position of clock - cch_cl_obj->setXPos(width - buttons_w - clock_w - cch_offset); + cch_cl_obj->setXPos(width - buttons_w - clock_w); //set required width of caption object cc_text_w -= (clock_w + cch_offset); From 191bb586b6ba019d49bf889e5afdf6d0c722a029 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:36:02 +0200 Subject: [PATCH 12/18] CComponentsFrmClock: remove unnecessary call of cch_cl_obj->setYPos() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cbba7b78f46ded09a80940579cc203dbeeb3ee96 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_header.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 351b6cc3e..f8a1038cd 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -413,7 +413,6 @@ void CComponentsHeader::initClock() //set clock form properties if (cch_cl_obj){ - cch_cl_obj->setYPos(cch_items_y); cch_cl_obj->setHeight(height); //disallow paint of clock, if disabled and exit method From b44e362f3dc1a09fd44a935d5c0d9a8d1b48245a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:42:24 +0200 Subject: [PATCH 13/18] CComponentsFrmClock: use correct setHeight() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/04f9468ddb4eca0c3b8b2787d9016b06554638af Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_clock.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index f11a27f18..297406e9f 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -59,8 +59,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, { cc_item_type = CC_ITEMTYPE_FRM_CLOCK; - x = x_pos; - y = y_pos; + x = cc_xr = x_old = x_pos; + y = cc_yr = y_old = y_pos; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; @@ -84,8 +84,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, initClockFont(0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); //init general clock dimensions - height = cl_font->getHeight(); - width = cl_font->getRenderWidth(cl_format_str); + height = height_old= cl_font->getHeight(); + width = width_old = cl_font->getRenderWidth(cl_format_str); //set default text background behavior cc_txt_save_screen = false; @@ -429,9 +429,9 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); - CCDraw::setHeight(f_height); + CComponentsItem::setHeight(f_height); }else - CCDraw::setHeight(h); + CComponentsItem::setHeight(h); initCCLockItems(); } @@ -443,9 +443,9 @@ void CComponentsFrmClock::setWidth(const int& w) int f_width = cl_font->getRenderWidth(cl_format_str); if (w != f_width){ dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font width is different than current width [%d], using [%d] ...\033[0m\n", __func__, __LINE__, w, f_width); - CCDraw::setWidth(f_width); + CComponentsItem::setWidth(f_width); }else - CCDraw::setWidth(w); + CComponentsItem::setWidth(w); initCCLockItems(); } From fc8969cece8225b83d3f784aa27dc722308033af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:56:42 +0200 Subject: [PATCH 14/18] CSignalBar: use global offsets for init of min height Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8822803d9d59a95b8d54dbb10108ee623af61c3 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_signalbars.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 018ad066f..6ffd03c40 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -34,7 +34,7 @@ #include #include -#define SB_MIN_HEIGHT 12 +#define SB_MIN_HEIGHT OFFSET_INNER_MID #define REF_PERCENT_TXT "100% " using namespace std; @@ -55,8 +55,8 @@ void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, c corner_rad = 0; corner_type = 0; - append_x_offset = 2; - append_y_offset = 2; + append_x_offset = OFFSET_INNER_MIN; + append_y_offset = OFFSET_INNER_MIN; sb_scale_height = -1; dy_font = CNeutrinoFonts::getInstance(); From 2e471317fc2a63022452cfff6629627e64b4cf87 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:00:48 +0200 Subject: [PATCH 15/18] CComponentsForm: use global default width for scrollbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0e94c6830b25e91337e560eeacf82176af157881 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 87cb5f66d..c202c6742 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -68,7 +68,7 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, page_count = 1; cur_page = 0; sb = NULL; - w_sb = 15; + w_sb = SCROLLBAR_WIDTH; page_scroll_mode = PG_SCROLL_M_UP_DOWN_KEY; From e9f7c0159dc3cce7314d15b31e82821b65773445 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:41:34 +0200 Subject: [PATCH 16/18] CSignalBox: remove CC_APPEND flag Should be gradually removed in all affected classes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f74724ceb655b6f04a7b029ab58fa526423bbfd6 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) --- src/gui/components/cc_frm_signalbars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 6ffd03c40..1ef19cbd4 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -330,7 +330,7 @@ void CSignalBox::initSignalItems() sbar->setScaleHeight(scale_h); sbar->enableTboxSaveScreen(cc_txt_save_screen); - snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); + snrbar->setDimensionsAll(vertical ? sbar_x : sbar->getXPos() + sbar->getWidth() + append_x_offset, vertical ? sbar->getYPos() + sbar->getHeight() + append_y_offset : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); snrbar->setTextColor(sbx_caption_color); snrbar->setActiveColor(sbx_active_color); From 6d87909523f8e385d5d7b4642b39ffefe51db26c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 18 Apr 2017 19:09:32 +0200 Subject: [PATCH 17/18] fix download pic from ssl url Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f6482eb04260945b6d75a3cc62b25b1909adb989 Author: Jacek Jendrzej Date: 2017-04-18 (Tue, 18 Apr 2017) --- src/driver/pictureviewer/pictureviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 8b22b68aa..f93779996 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -123,6 +123,7 @@ std::string CPictureViewer::DownloadImage(std::string url) curl_easy_setopt(ch, CURLOPT_URL, url.c_str()); curl_easy_setopt(ch, CURLOPT_CONNECTTIMEOUT, 3); curl_easy_setopt(ch, CURLOPT_TIMEOUT, 4); + curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L); CURLcode res = curl_easy_perform(ch); if (res != CURLE_OK){ printf("[%s] curl_easy_perform() failed:%s\n",__func__, curl_easy_strerror(res)); From 582e42e25e9c76823f08c761c6437e8b571675de Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 19 Apr 2017 17:19:43 +0200 Subject: [PATCH 18/18] try to fix version check for avformat codecpar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3bf23d9c90996fc414df4a057304ab8abc1b236 Author: Jacek Jendrzej Date: 2017-04-19 (Wed, 19 Apr 2017) --- src/driver/audiodec/ffmpegdec.cpp | 8 ++++---- src/driver/record.cpp | 6 +++--- src/driver/streamts.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 695f67d89..dc49aea02 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -223,7 +223,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *c = avc->streams[best_stream]->codec; #else AVCodecContext *c = avcodec_alloc_context3(codec); @@ -460,7 +460,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) #else if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) @@ -481,7 +481,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; @@ -511,7 +511,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; #else diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 0c234cbe6..ace7de81e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1943,7 +1943,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * codec = st->codec; #else AVCodecParameters * codec = st->codecpar; @@ -2176,7 +2176,7 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -2232,7 +2232,7 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index d2f4a2d3c..9d23e25fc 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -846,7 +846,7 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -919,7 +919,7 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar;