From 3e3a327ac7a8a58862d4d491b5514eea02865375 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 10:03:52 +0200 Subject: [PATCH 01/23] Revert "- neutrino: fix hw_caps init; it must be initialized after zapit start" This reverts commit 4ded8abb1220f909f344e6511da2e50dda241881. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/491e51beeb97ced2951942755bbf12a23382a10f Author: Jacek Jendrzej Date: 2017-08-21 (Mon, 21 Aug 2017) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 5096e75d9..be0782f00 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -485,16 +485,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); - /* - hw_caps needs CFEManager and CFEManager needs g_settings. - So loadSetup() cannot use hw_caps to init g_settings. - - For this reason we need this workaround. - */ - bool can_shutdown = (cs_get_revision() > 7); - g_settings.shutdown_real = false; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); @@ -2294,9 +2286,6 @@ TIMER_START(); CheckFastScan(); - // init hw_caps *after* zapit start! - g_info.hw_caps = get_hwcaps(); - //timer start long timerd_signal = 0; timer_wakeup = false;//init From 8ad638b6b06ea3499e140573a63dc8718c16817e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 10 Apr 2017 18:27:28 +0200 Subject: [PATCH 02/23] coolstream: disable uncoolinit build it does not build right now for undefined fb_pixel_t, and it is unused anyway after a workaround in zapit code has been introduced Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee031801e453ac0d32ee8131c920d8123fcb72ec Author: Stefan Seyfried Date: 2017-04-10 (Mon, 10 Apr 2017) ------------------ This commit was generated by Migit --- src/Makefile.am | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 9f3ff1363..8ea9e536e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -196,15 +196,15 @@ endif if BOXTYPE_COOL bin_PROGRAMS += uncooloff uncooloff_SOURCES = uncooloff.c -if BOXMODEL_CS_HD2 -else -noinst_PROGRAMS = uncoolinit -uncoolinit_SOURCES = uncoolinit.cpp -uncoolinit_LDADD = \ - @AVFORMAT_LIBS@ \ - @AVCODEC_LIBS@ \ - @BLURAY_LIBS@ \ - -lcoolstream-mt -lca-sc -lnxp \ - -lOpenThreads -lrt -endif +# if BOXMODEL_CS_HD2 +# else +# noinst_PROGRAMS = uncoolinit +# uncoolinit_SOURCES = uncoolinit.cpp +# uncoolinit_LDADD = \ +# @AVFORMAT_LIBS@ \ +# @AVCODEC_LIBS@ \ +# @BLURAY_LIBS@ \ +# -lcoolstream-mt -lca-sc -lnxp \ +# -lOpenThreads -lrt +# endif endif From 069ea0b8d4d915b83c1b72afa0608025c4afb504 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 19 Aug 2017 21:43:54 +0200 Subject: [PATCH 03/23] fb_accel_sti: reorder blit_mutex locking This seems to help spurious deadlocks in the STI framebuffer blit code. Not 100% sure why, butthis helps, but I have not seen lockups with this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/223d1d709f34eb6b53f47d6865ff9eb4178ba69b Author: Stefan Seyfried Date: 2017-08-19 (Sat, 19 Aug 2017) ------------------ This commit was generated by Migit --- src/driver/fb_accel_sti.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_accel_sti.cpp b/src/driver/fb_accel_sti.cpp index dfe0ac5c3..17e342faf 100644 --- a/src/driver/fb_accel_sti.cpp +++ b/src/driver/fb_accel_sti.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -333,10 +334,12 @@ void CFbAccelSTi::run() time_t last_blit = 0; blit_pending = false; blit_thread = true; - blit_mutex.lock(); set_threadname("stifb::autoblit"); while (blit_thread) { + blit_mutex.lock(); blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX); + blit_mutex.unlock(); + time_t now = time_monotonic_ms(); if (now - last_blit < BLIT_INTERVAL_MIN) { @@ -346,20 +349,22 @@ void CFbAccelSTi::run() else { blit_pending = false; - blit_mutex.unlock(); _blit(); - blit_mutex.lock(); last_blit = now; } } - blit_mutex.unlock(); printf(LOGTAG "::run end\n"); } void CFbAccelSTi::blit() { //printf(LOGTAG "::blit\n"); - blit_mutex.lock(); + int status = blit_mutex.trylock(); + if (status) { + printf(LOGTAG "::blit trylock failed: %d (%s)\n", status, + (status > 0) ? strerror(status) : strerror(errno)); + return; + } blit_cond.signal(); blit_mutex.unlock(); } From 97c92523bce956f1f885e304037fd02eede89648 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:30:57 +0200 Subject: [PATCH 04/23] CKeyChooserItemNoKey: fix type cast Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a1a596501772cd975ddf06c07803b168bad58c12 Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/keychooser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/keychooser.h b/src/gui/widget/keychooser.h index 8c89140c7..b2cdbeb64 100644 --- a/src/gui/widget/keychooser.h +++ b/src/gui/widget/keychooser.h @@ -96,7 +96,7 @@ class CKeyChooserItemNoKey : public CMenuTarget int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { - *key=(int)CRCInput::RC_nokey; + *key=(unsigned int)CRCInput::RC_nokey; return menu_return::RETURN_REPAINT; } From 559fd22ab29b624707a53d876dd73c68fd0b2999 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:44:01 +0200 Subject: [PATCH 05/23] rcinput: fix getKeyName for RC_none case Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4978ed7675ba671db546ce3f16e464e5f2f4a7c8 Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index abc4595a6..0554597ce 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1678,9 +1678,14 @@ const char * CRCInput::getSpecialKeyName(const unsigned int key) std::string CRCInput::getKeyName(const unsigned int key) { - std::string res(getKeyNameC(key & ~RC_Repeat)); - if ((key & RC_Repeat) && res != "unknown") - res += " (long)"; + std::string res; + if (key > RC_MaxRC) + res = getKeyNameC(key); /* will only resolve RC_nokey or "unknown" */ + else { + res = (getKeyNameC(key & ~RC_Repeat)); + if ((key & RC_Repeat) && res != "unknown") + res += " (long)"; + } return res; } From e2f6639bbb83cb5c167b6c63f9214f71fb4e9315 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:44:57 +0200 Subject: [PATCH 06/23] zapit: trivial azbox compile fix Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fd4a3516e5db7c94813fb699b35493e8689bc5be Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 98bedaf5d..0c790ce10 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2266,7 +2266,7 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) #if HAVE_AZBOX_HARDWARE /* new (> 20130917) AZbox drivers switch to radio mode if audio is started first */ /* start video */ - if (have_video) { + if (video_pid) { videoDecoder->Start(0, thisChannel->getPcrPid(), thisChannel->getVideoPid()); videoDemux->Start(); } From ff37fec9a80c28e8cfc3e04762d2cfd2467964cc Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:52:04 +0200 Subject: [PATCH 07/23] rcinput: add two more keys in the ugly azbox translate() table Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d0a21abd9faa630573a429131ef99d29c7338d75 Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 0554597ce..7379b2764 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1718,6 +1718,10 @@ int CRCInput::translate(int code) return RC_record; case KEY_PLAY: return RC_pause; + case KEY_CHANNELUP: + return RC_page_up; + case KEY_CHANNELDOWN: + return RC_page_down; #endif default: break; From fe7c56581be606680a9dfba5abb2eb4f70c459b5 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 16:19:57 +0200 Subject: [PATCH 08/23] Revert "- hardware_caps: fix has_fan and add detection of Neo Twin" This reverts commit 2770d07beab4ba7dfc279d1202eda7d0a993cc75. This leads to a segfault at start and the upstream solution is not yet ready for primetime, so revert this for now. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e2db5907974464f7053bddc16b2e39efac67454f Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ This commit was generated by Migit --- lib/hardware/coolstream/Makefile.am | 7 ------- lib/hardware/coolstream/hardware_caps.cpp | 19 ++++--------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index 82f3ab83c..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,13 +1,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/lib/libconfigfile \ - -I$(top_srcdir)/lib/libeventserver \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libhwcaps.a diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 139825c32..19ca74af6 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -11,8 +11,6 @@ #include #include "hardware_caps.h" -#include - static int initialized = 0; static hw_caps_t caps; @@ -21,7 +19,7 @@ hw_caps_t *get_hwcaps(void) { return ∩︀ int rev = cs_get_revision(); int chip = cs_get_chip_type(); - caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan + caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -36,23 +34,15 @@ hw_caps_t *get_hwcaps(void) { caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); + strcpy(caps.boxarch, "Nevis"); switch (rev) { case 6: case 7: // Black Stallion Edition strcpy(caps.boxname, "HD1"); - strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; - case 8: - if (CFEManager::getInstance()->getFrontendCount() < 2) - { - strcpy(caps.boxname, "Neo"); - } - else - { - strcpy(caps.boxname, "Neo Twin"); - } - strcpy(caps.boxarch, "Nevis"); + case 8: // TODO: Neo2 - Twin + strcpy(caps.boxname, "Neo"); caps.force_tuner_2G = 1; break; case 9: @@ -61,7 +51,6 @@ hw_caps_t *get_hwcaps(void) { break; case 10: strcpy(caps.boxname, "Zee"); - strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; case 11: From 1f09810ff14bd2f3c97867a842b6649ad85bf817 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 10:57:18 +0200 Subject: [PATCH 09/23] part from ceab6aafbbe55220247341fd181d1b789249e11b Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0238049dafa927ea4b2ce6f3efb7a6a50ce78eb3 Author: Jacek Jendrzej Date: 2017-08-21 (Mon, 21 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 5 ++--- src/neutrino.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 19ca74af6..065906448 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -19,7 +19,7 @@ hw_caps_t *get_hwcaps(void) { return ∩︀ int rev = cs_get_revision(); int chip = cs_get_chip_type(); - caps.has_fan = (rev < 8); + caps.has_fan = (rev < 8); // see dirty part of hw_caps in neutrino.cpp caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -41,8 +41,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "HD1"); caps.force_tuner_2G = 1; break; - case 8: // TODO: Neo2 - Twin - strcpy(caps.boxname, "Neo"); + strcpy(caps.boxname, "Neo"); // see dirty part of hw_caps in neutrino.cpp caps.force_tuner_2G = 1; break; case 9: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index be0782f00..aa45d5d64 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2286,6 +2286,20 @@ TIMER_START(); CheckFastScan(); + // dirty part of hw_caps - specify some details after zapit start + if (strcmp(g_info.hw_caps->boxname, "HD1") == 0) + { + // only SAT-HD1 has fan + if (!CFEManager::getInstance()->getFE(0)->hasSat()) + g_info.hw_caps->has_fan = 0; + } + if (strcmp(g_info.hw_caps->boxname, "Neo") == 0) + { + // detecting Neo Twin by counting frontends + if (CFEManager::getInstance()->getFrontendCount() > 1) + strcpy(g_info.hw_caps->boxname, "Neo Twin"); + } + //timer start long timerd_signal = 0; timer_wakeup = false;//init From 9569be0ff158e88a1d93fbf075cca8d8f0c61603 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 10/23] CComponentsFrmClock: fix wrong initialization of w_tmp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/758081a0acef768d2126c485bea0303a0238440a Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 1beb3d70f..d49276dfd 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -248,7 +248,7 @@ void CComponentsFrmClock::initCCLockItems() //extract timestring segment (char) string stmp = s_time.substr(i, 1); - int w_tmp = minSepWidth; + int w_tmp = 0; //get width of current segment if (isdigit(stmp.at(0)) ) //check for digits, if true, we use digit width w_tmp = cl_font->getMaxDigitWidth(); From 08eb91b084ab888a28c000627e1062a53f3e503c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 11/23] cc_frm.cpp, cc_frm_button.cpp: remove unread stored variables Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe6a24351b927000ea64ea42861cebe87d1980f6 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 6 +++--- src/gui/components/cc_frm_button.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index defe1433c..1a2f7d1be 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -378,7 +378,7 @@ void CComponentsForm::paintCCItems() size_t items_count = v_cc_items.size(); //using of real x/y values to paint items if this text object is bound in a parent form - int this_x = x, auto_x = x, this_y = y, auto_y = y, this_w = width; + int this_x = x, auto_x = x, this_y = y, auto_y = y, this_w = 0; int w_parent_frame = 0; if (cc_parent){ this_x = auto_x = cc_xr; @@ -441,7 +441,7 @@ void CComponentsForm::paintCCItems() } //move item x-position, if we have a frame on parent, TODO: other constellations not considered at the moment - w_parent_frame = xpos <= fr_thickness ? fr_thickness : 0; + w_parent_frame = xpos <= fr_thickness ? fr_thickness : w_parent_frame; //set required x-position to item: //append vertical @@ -461,7 +461,7 @@ void CComponentsForm::paintCCItems() } //move item y-position, if we have a frame on parent, TODO: other constellations not considered at the moment - w_parent_frame = ypos <= fr_thickness ? fr_thickness : 0; + w_parent_frame = ypos <= fr_thickness ? fr_thickness : w_parent_frame; //set required y-position to item //append hor diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c0c0039b0..47b9feafa 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -147,14 +147,15 @@ void CComponentsButton::initIcon() if (pos == string::npos) cc_btn_icon = frameBuffer->getIconPath(cc_btn_icon); + int y_icon = 0; + int h_icon = 0; if (cc_btn_icon_obj == NULL){ cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, 0, cc_btn_icon, this); cc_btn_icon_obj->SetTransparent(CFrameBuffer::TM_BLACK); cc_btn_icon_obj->doPaintBg(false); } - int y_icon = cc_btn_icon_obj->getYPos(); - int h_icon = cc_btn_icon_obj->getHeight(); + h_icon = cc_btn_icon_obj->getHeight(); //get required icon height int h_max = height-2*fr_thickness; From ce38d562735a780c24d384b314218550ddb03ed2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 12/23] CComponentsFooter: fix possible conversion warning For platform compatibility. eg. with neutrino-pc on it is possible that size_t is long unsigned ini, for others unsinged int Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/27995b19fa1d301b0f7a90c53fa4f88d330071bf Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 913de581e..d8bc9df87 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -223,7 +223,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con btn->setButtonFont(NULL); } - dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] button %s [%u] btn->getWidth() = %d w_btn = %d, (chain->getWidth() = %d)\n", __func__, __LINE__, txt.c_str(), i, btn->getWidth(), w_btn, btn_container->getWidth()); + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] button %s [%u] btn->getWidth() = %d w_btn = %d, (chain->getWidth() = %d)\n", __func__, __LINE__, txt.c_str(), (uint32_t)i, btn->getWidth(), w_btn, btn_container->getWidth()); } /* add generated button objects to chain object. From 08cb6991755ae21b106f385c0f0f7de7a146bd54 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 13/23] CComponentsFooter: fix possible error with non-POD element type affected is struct type 'button_label_cc' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/16dac64ed20173cda69df7c2fc809473fae828c8 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index d8bc9df87..e7e9da36e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -251,7 +251,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width) { //conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h - button_label_cc buttons[label_count]; + button_label_cc *buttons = new button_label_cc[label_count]; for (size_t i = 0; i< label_count; i++){ buttons[i].button = content[i].button; buttons[i].locale = content[i].locale; @@ -262,12 +262,13 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten buttons[i].btn_alias = -1; } setButtonLabels(buttons, label_count, chain_width, label_width); + delete[] buttons; } void CComponentsFooter::setButtonLabels(const vector &v_content, const int& chain_width, const int& label_width) { size_t label_count = v_content.size(); - button_label_cc buttons[label_count]; + button_label_cc *buttons = new button_label_cc[label_count]; for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; @@ -277,8 +278,8 @@ void CComponentsFooter::setButtonLabels(const vector &v_content buttons[i].btn_result = v_content[i].btn_result; buttons[i].btn_alias = v_content[i].btn_alias; } - setButtonLabels(buttons, label_count, chain_width, label_width); + delete[] buttons; } void CComponentsFooter::setButtonLabel( const char *button_icon, From 4c6d63035ed9e672e1e1ae957ea91f96898f626a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 14/23] CComponentsPicture: remove benchmark lines Was only for debugging. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f07a27825d62e45421bb95351d94e13fd0ee97e1 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_picture.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c776dfcb6..63eb85bfc 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -299,10 +299,6 @@ int CComponentsPicture::getHeight() void CComponentsPicture::paintPicture() { - struct timeval t1, t2; - if (debug) - gettimeofday(&t1, NULL); - is_image_painted = false; //initialize image position int x_pic = x; @@ -337,14 +333,6 @@ void CComponentsPicture::paintPicture() frameBuffer->RestoreScreen(x_pic, y_pic, dxc, dyc, image_cache); } } - - //benchmark - if (debug){ - gettimeofday(&t2, NULL); - uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL; - if (duration) - fprintf(stderr, "\033[33m[CComponentsPicture] %s: %" PRIu64 " ms to paint image \033[0m\n", __func__, duration); - } } void CComponentsPicture::paint(bool do_save_bg) From bf5722ee3af4c2f3b82c90169ba9fd97f03c85dd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 15/23] CProgressBarCache: remove benchmark lines Was only for debugging. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d42389b1671aab7f2b4f638b0ee9c58fed22d6e0 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_progressbar.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index d3ea4831f..543d71a8e 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -432,10 +432,6 @@ void CProgressBarCache::pbcApplyGradient(fb_pixel_t *b) void CProgressBar::paintProgress(bool do_save_bg) { - struct timeval t1, t2; - if (debug) - gettimeofday(&t1, NULL); - if (*pb_design == PB_OFF) { paintInit(false); return; @@ -476,14 +472,6 @@ void CProgressBar::paintProgress(bool do_save_bg) if (is_painted) pb_last_width = pb_active_width; - - //benchmark - if (debug){ - gettimeofday(&t2, NULL); - uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL; - if (duration) - fprintf(stderr, "\033[33m[CProgressBar] %s: %" PRIu64 " ms to paint progress \033[0m\n",__func__, duration); - } } From 66876b7889dd1d795c2e621ce39736c840d6b613 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 16/23] CComponentsHeader: add missing check for null pointer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5221769840ca6226aab20038e43af8afe8459ecb Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 2a8d82db8..0fcb8aa68 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -343,14 +343,18 @@ void CComponentsHeader::initLogo() * with previous or next item. */ if (cch_caption_align & CC_TITLE_LEFT){ - int left_tag = prev_item->getXPos() + prev_item->getWidth(); - if (x_logo <= left_tag) - x_logo = left_tag + logo_space/2 - w_logo/2; + if (prev_item){ + int left_tag = prev_item->getXPos() + prev_item->getWidth(); + if (x_logo <= left_tag) + x_logo = left_tag + logo_space/2 - w_logo/2; + } } if (cch_caption_align & CC_TITLE_RIGHT){ - if (x_logo + w_logo >= next_item->getXPos()) - x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; + if (next_item){ + if (x_logo + w_logo >= next_item->getXPos()) + x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; + } } } From 31a3bb2ae0a2996a248f262aca2982ebbbd0a53b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 17/23] Helpbox: add missing check for null pointer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b5d33f10e1d80a85273190d99a892d89e0d0e01f Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/helpbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index d4fd87b76..66a3835ed 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -106,7 +106,7 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in txt->setColorBody(COL_RED); #endif int lines = txt->getCTextBoxObject()->getLines(); - txt_height = std::max(lines*font->getHeight(), h_line); + txt_height = std::max(font ? lines*font->getHeight() : 0, h_line); txt->setHeight(txt_height); line->addCCItem(txt); From e85ba36b4362dcd44b1178dac5022f24134ae145 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 18/23] cc_item_shapes.cpp/h: Add method to create draw boxes without explicit objects Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c743cb632bbabf3df366074c8478ee633fff6568 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_shapes.cpp | 9 +++++++++ src/gui/components/cc_item_shapes.h | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/gui/components/cc_item_shapes.cpp b/src/gui/components/cc_item_shapes.cpp index 9b55d0580..66b4be5e9 100644 --- a/src/gui/components/cc_item_shapes.cpp +++ b/src/gui/components/cc_item_shapes.cpp @@ -107,3 +107,12 @@ void CComponentsShapeCircle::paint(bool do_save_bg) { paintInit(do_save_bg); } + + +bool PaintBoxRel(const int& x, const int& y, const int& dx, const int& dy, const fb_pixel_t& col, int radius, int corner_type, int shadow_mode) +{ + CComponentsShapeSquare box(x, y, dx, dy, NULL, shadow_mode, COL_SHADOW_PLUS_0, col); + box.setCorner(radius, corner_type); + box.paint(CC_SAVE_SCREEN_NO); + return box.isPainted(); +} diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h index a1a48d97c..8530c5141 100644 --- a/src/gui/components/cc_item_shapes.h +++ b/src/gui/components/cc_item_shapes.h @@ -73,4 +73,28 @@ class CComponentsShapeSquare : public CComponentsItem void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; + + /**Small and easy to apply box paint methode without expilcit object declaration + * @return bool, true = painted + * + * @param[in] x expects type int, x position on screen + * @param[in] y expects type int, y position on screen modes are: + * @param[in] dx expects type int, width of scrollbar object + * @param[in] dy expects type int, height of scrollbar object + * @param[in] col expects type fb_pixel_t, as body color + * + * usual paraemters: + * @param[in] radius optional, expects type int as corner radius, default = 0 + * @param[in] corner_type optional, expects type int as cornar type, default CORNER_ALL + * @param[in] shadow_mode optional, expects type int defined by shadow mode enums, default CC_SHADOW_OFF + */ +bool PaintBoxRel(const int& x, + const int& y, + const int& dx, + const int& dy, + const fb_pixel_t& col, + int radius = 0, + int corner_type = CORNER_ALL, + int shadow_mode = CC_SHADOW_OFF); + #endif From ba35604b8d32ba646ba9a49309f4133505843a4e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 19/23] comments: fix copy paste errors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e310a81571dfe21f4cd97e69a3b531d49f17fff Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.h | 2 +- src/gui/components/cc_frm_button.h | 2 +- src/gui/components/cc_frm_header.h | 4 +- src/gui/components/cc_frm_scrollbar.h | 58 +++++++++++------------ src/gui/widget/helpbox.h | 58 +++++++++++------------ src/gui/widget/hintbox.h | 66 +++++++++++++-------------- src/gui/widget/msgbox.h | 50 ++++++++++---------- src/gui/widget/navibar.h | 20 ++++---- src/gui/widget/textbox.h | 4 +- 9 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 76b047f4c..005cc95d0 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -342,7 +342,7 @@ class CCDraw : public COSDFader, public CComponentsSignals * * @return bool returns true if effect was successful canceled * - * @param[in] keep_on_screen optional, exepts bool, default = false. means: item is not repainted after canceled effect + * @param[in] keep_on_screen optional, expects bool, default = false. means: item is not repainted after canceled effect * * @see take a look into test menu class for examples * NOTE: Effect must be started with paintBlink() diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index c85777ff7..0e9e4eca2 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -211,7 +211,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen * Returns true if filtered event msg value of button object is found in cc_directKeys container. * @return bool * @param[in] msg - * @li exepts type neutrino_msg_t as filter for searched message + * @li expects type neutrino_msg_t as filter for searched message * @see neutrino_msg_t getButtonDirectKey(), driver/rcinput.h for possible values */ bool hasButtonDirectKey(const neutrino_msg_t& msg) diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 2f96c7baf..2496043cc 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -204,7 +204,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT * Height can be changed with modes by setSizeMode(), setHeight() or constructor. * @return void * - * @param[in] font exepts font object, type Font* + * @param[in] font expects font object, type Font* * @see getCaptionFont(), setSizeMode(), * setCaptionColor(), * setCaptionAlignment(), @@ -227,7 +227,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT * If other size wanted then use set setCaptionFont() and setHeight() * @return void * - * @param[in] size_mode exepts type int (enums) + * @param[in] size_mode expects type int (enums) * possible modes are: * CC_HEADER_SIZE_LARGE * CC_HEADER_SIZE_SMALL diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 0b902d591..7395c1107 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -70,20 +70,20 @@ class CComponentsScrollBar : public CComponentsFrmChain public: /**Class constructor to generate individual scrollbar objects * - * @param[in] x_pos exepts type int, x position on screen - * @param[in] x_pos exepts type int, y position on screen modes are: - * @param[in] w exepts type int, width of scrollbar object - * @param[in] h exepts type int, height of scrollbar object - * @param[in] count optional, exepts type int, count of pages, default 1 + * @param[in] x_pos expects type int, x position on screen + * @param[in] x_pos expects type int, y position on screen modes are: + * @param[in] w expects type int, width of scrollbar object + * @param[in] h expects type int, height of scrollbar object + * @param[in] count optional, expects type int, count of pages, default 1 * * usual paraemters: - * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL - * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF - * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 - * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 - * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 - * @param[in] color_select optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 - * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] parent optional, expects type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, expects type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, expects type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 + * @param[in] color_body optional, expects type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 + * @param[in] color_shadow optional, expects type fb_pixel_t, default COL_SHADOW_PLUS_0 + * @param[in] color_select optional, expects type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_passive optional, expects type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 */ CComponentsScrollBar( const int &x_pos, const int &y_pos, @@ -102,7 +102,7 @@ class CComponentsScrollBar : public CComponentsFrmChain /**Set current page number * @return void * - * @param[in] mark_id exepts type int, this sets the current selected page number. + * @param[in] mark_id expects type int, this sets the current selected page number. * * @see getMarkID() */ @@ -120,8 +120,8 @@ class CComponentsScrollBar : public CComponentsFrmChain * Each segment is assigned to a page number. Starting with id 0...n * @return void * - * @param[in] segment_count exepts type int, sets the current count of pages. - * @param[in] mark_id optional, exepts type int, sets the current selected page number, default = 0 + * @param[in] segment_count expects type int, sets the current count of pages. + * @param[in] mark_id optional, expects type int, sets the current selected page number, default = 0 * @see also setMarkID() * getMarkID() */ @@ -135,7 +135,7 @@ class CComponentsScrollBar : public CComponentsFrmChain int getSegmentCount(){return sb_segments_count;} /**Enable/disable vizualized count of possible scroll items - * @param[in] enable optional, exepts type bool. + * @param[in] enable optional, expects type bool. * @note Default mode is disabled. */ void enableVisualize(bool enable = true){sb_visual_enable = enable;} @@ -150,21 +150,21 @@ void getScrollBarData(int *total_pages, int *current_page, int total_items, int /**Small and easy to apply scrollbar paint methode without expilcit object declaration * @return void * - * @param[in] x_pos exepts type int, x position on screen - * @param[in] x_pos exepts type int, y position on screen modes are: - * @param[in] w exepts type int, width of scrollbar object - * @param[in] h exepts type int, height of scrollbar object - * @param[in] count exepts type int, count of pages, default 1 - * @param[in] current_num exepts type int, current selected page, default 0 + * @param[in] x_pos expects type int, x position on screen + * @param[in] x_pos expects type int, y position on screen modes are: + * @param[in] w expects type int, width of scrollbar object + * @param[in] h expects type int, height of scrollbar object + * @param[in] count expects type int, count of pages, default 1 + * @param[in] current_num expects type int, current selected page, default 0 * * usual paraemters: - * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL - * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF - * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 - * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 - * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 - * @param[in] color_select optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 - * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] parent optional, expects type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, expects type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, expects type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 + * @param[in] color_body optional, expects type fb_pixel_t, default COL_SCROLLBAR_PLUS_0 + * @param[in] color_shadow optional, expects type fb_pixel_t, default COL_SHADOW_PLUS_0 + * @param[in] color_select optional, expects type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_passive optional, expects type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 */ void paintScrollBar( const int &x_pos, const int &y_pos, diff --git a/src/gui/widget/helpbox.h b/src/gui/widget/helpbox.h index ed173f7fa..6e0798291 100644 --- a/src/gui/widget/helpbox.h +++ b/src/gui/widget/helpbox.h @@ -52,19 +52,19 @@ public: * NOTE: addLine() members are used only for compatibilty with older implementation * of lines. * @param[in] Title - * @li exepts type std::string, defines caption of window + * @li expects type std::string, defines caption of window * @param[in] Default_Text - * @li optional: exepts type std::string, defines a pre defined help text + * @li optional: expects type std::string, defines a pre defined help text * @param[in] text_mode - * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @li optional: expects type int, defines text modes, see /gui/widget/textbox.h for possible modes * @param[in] line_height - * @li optional: exepts type int, defines height of line + * @li optional: expects type int, defines height of line * @param[in] line_indent - * @li optional: exepts type int, defines lenght of indent from left + * @li optional: expects type int, defines lenght of indent from left * @param[in] font_text - * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @li optional: expects type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used * @param[in] Icon - * @li exepts type const char*, defins the title bar icon and can be name (see /gui/icons.h) or path to an image file + * @li expects type const char*, defins the title bar icon and can be name (see /gui/icons.h) or path to an image file */ Helpbox( const std::string& Title, const std::string& Default_Text = std::string(), @@ -79,15 +79,15 @@ public: /**Adds an item with pre defined text * @param[in] text - * @li exepts type std::string + * @li expects type std::string * @param[in] text_mode - * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @li optional: expects type int, defines text modes, see /gui/widget/textbox.h for possible modes * @param[in] line_height - * @li optional: exepts type int, defines height of line + * @li optional: expects type int, defines height of line * @param[in] line_indent - * @li optional: exepts type int, defines lenght of indent from left + * @li optional: expects type int, defines lenght of indent from left * @param[in] font_text - * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @li optional: expects type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used */ void addLine( const std::string& text, const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, @@ -97,15 +97,15 @@ public: /**Adds an item with pre defined text * @param[in] text - * @li exepts type const char * + * @li expects type const char * * @param[in] text_mode - * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @li optional: expects type int, defines text modes, see /gui/widget/textbox.h for possible modes * @param[in] line_height - * @li optional: exepts type int, defines height of line + * @li optional: expects type int, defines height of line * @param[in] line_indent - * @li optional: exepts type int, defines lenght of indent from left + * @li optional: expects type int, defines lenght of indent from left * @param[in] font_text - * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @li optional: expects type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used */ void addLine( const char *text, const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, @@ -115,17 +115,17 @@ public: /**Adds an item with pre defined icon and text * @param[in] icon - * @li exepts type std::string, icon can be name (see /gui/icons.h) or path to an image file + * @li expects type std::string, icon can be name (see /gui/icons.h) or path to an image file * @param[in] text - * @li exepts type std::string + * @li expects type std::string * @param[in] text_mode - * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @li optional: expects type int, defines text modes, see /gui/widget/textbox.h for possible modes * @param[in] line_height - * @li optional: exepts type int, defines height of line + * @li optional: expects type int, defines height of line * @param[in] line_indent - * @li optional: exepts type int, defines lenght of indent from left + * @li optional: expects type int, defines lenght of indent from left * @param[in] font_text - * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @li optional: expects type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used */ void addLine( const std::string& icon, const std::string& text, @@ -136,17 +136,17 @@ public: /**Adds an item with pre defined icon and text * @param[in] icon - * @li exepts type const char *, icon can be name (see /gui/icons.h) or path to an image file + * @li expects type const char *, icon can be name (see /gui/icons.h) or path to an image file * @param[in] text - * @li exepts type const char * + * @li expects type const char * * @param[in] text_mode - * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @li optional: expects type int, defines text modes, see /gui/widget/textbox.h for possible modes * @param[in] line_height - * @li optional: exepts type int, defines height of line + * @li optional: expects type int, defines height of line * @param[in] line_indent - * @li optional: exepts type int, defines lenght of indent from left + * @li optional: expects type int, defines lenght of indent from left * @param[in] font_text - * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @li optional: expects type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used */ void addLine( const char *icon, const char *text, diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 9019228a6..d15fc1ce0 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -90,20 +90,20 @@ class CHintBox : public CComponentsWindow public: /**CHintBox Constructor * @param[in] Caption - * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @li expects type neutrino_locale_t with locale entry from /system/locals.h * @param[in] Text - * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @li expects type const char*, this is the message text inside the window, text is UTF-8 encoded * @param[in] Width - * @li optional: exepts type int, defines box width, default value = HINTBOX_MIN_WIDTH + * @li optional: expects type int, defines box width, default value = HINTBOX_MIN_WIDTH * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON + * @li optional: expects type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon - * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @li optional: expects type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] header_buttons - * @li optional: exepts type int, defines the icon name on the right side of titlebar, default = 0 (non Icon) + * @li optional: expects type int, defines the icon name on the right side of titlebar, default = 0 (non Icon) * @see class CComponentsWindow() * @param[in] text_mode - * @li optional: exepts type int, defines the text modes for embedded text lines + * @li optional: expects type int, defines the text modes for embedded text lines * Possible Modes defined in /gui/widget/textbox.h * AUTO_WIDTH * AUTO_HIGH @@ -115,7 +115,7 @@ class CHintBox : public CComponentsWindow * NO_AUTO_LINEBREAK * AUTO_LINEBREAK_NO_BREAKCHARS * @param[in] indent - * @li optional: exepts type int, defines indent of text + * @li optional: expects type int, defines indent of text * * @see classes CComponentsText(), CTextBox() */ @@ -130,7 +130,7 @@ class CHintBox : public CComponentsWindow /**CHintBox Constructor * @param[in] Caption - * @li exepts type const char* + * @li expects type const char* * @see for other parameters take a look to basic class CHintBox() */ CHintBox( const char * const Caption, @@ -144,9 +144,9 @@ class CHintBox : public CComponentsWindow /**CHintBox Constructor * @param[in] Caption - * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @li expects type neutrino_locale_t with locale entry from /system/locals.h * @param[in] Text - * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @li expects type neutrino_locale_t with locale entry from /system/locals.h * @see for other parameters take a look to basic class CHintBox() */ CHintBox( const neutrino_locale_t Caption, @@ -160,9 +160,9 @@ class CHintBox : public CComponentsWindow /**CHintBox Constructor * @param[in] Caption - * @li exepts type const char* + * @li expects type const char* * @param[in] Text - * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @li expects type neutrino_locale_t with locale entry from /system/locals.h * @see for other parameters take a look to basic class CHintBox() */ CHintBox( const char * const Caption, @@ -192,7 +192,7 @@ class CHintBox : public CComponentsWindow /** * enable/disable visualized timeout as progressbar under titlebar * @param[in] enable - * @li optional: exepts type bool, default = true + * @li optional: expects type bool, default = true */ void enableTimeOutBar(bool enable = true); @@ -205,7 +205,7 @@ class CHintBox : public CComponentsWindow /** * scroll handler for text objects: NOTE: exec() must be called ! * @param[in] hint_id - * @li optional: exepts type unsigned int, default = 0 + * @li optional: expects type unsigned int, default = 0 * default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 * @see Scroll() */ @@ -214,7 +214,7 @@ class CHintBox : public CComponentsWindow /** * scroll down handler for text objects: NOTE: exec() must be called ! * @param[in] hint_id - * @li exepts type unsigned int, default = 0 + * @li expects type unsigned int, default = 0 * default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we h * @see Scroll() */ @@ -223,9 +223,9 @@ class CHintBox : public CComponentsWindow /** * Member to add a hint item * @param[in] Text - * @li exepts type std::string, this is the message text inside the window, text is UTF-8 encoded + * @li expects type std::string, this is the message text inside the window, text is UTF-8 encoded * @param[in] text_mode - * @li optional: exepts type int, defines the text modes for embedded text lines + * @li optional: expects type int, defines the text modes for embedded text lines * Possible Modes defined in /gui/widget/textbox.h * AUTO_WIDTH * AUTO_HIGH @@ -237,11 +237,11 @@ class CHintBox : public CComponentsWindow * NO_AUTO_LINEBREAK * AUTO_LINEBREAK_NO_BREAKCHARS * @param[in] Picon - * @li optional: exepts type std::string, defines the picon name on the left side of message text, default = NULL (non Icon) + * @li optional: expects type std::string, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] color_text - * @li optional: exepts type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT + * @li optional: expects type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT * * @param[in] font_text - * @li optional: exepts type Font*, defines the text font type, default = NULL for system preset for message contents + * @li optional: expects type Font*, defines the text font type, default = NULL for system preset for message contents */ void addHintItem( const std::string& Text, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -252,7 +252,7 @@ class CHintBox : public CComponentsWindow /** * Member to add a hint item from specified cc-item type * @param[in] cc_Item - * @li exepts type CComponentsItem*, allows to add any possible cc-item type + * @li expects type CComponentsItem*, allows to add any possible cc-item type * * @see /gui/components/cc_types.h */ @@ -261,11 +261,11 @@ class CHintBox : public CComponentsWindow /** * Sets a text to a hint item. * @param[in] Text - * @li exepts type std::string, this is the message text inside the hint item, text is UTF-8 encoded + * @li expects type std::string, this is the message text inside the hint item, text is UTF-8 encoded * @param[in] hint_id - * @li optional: exepts type unsigned int, default = 0 for the first or one and only item + * @li optional: expects type unsigned int, default = 0 for the first or one and only item * @param[in] text_mode - * @li optional: exepts type int, defines the text modes for embedded text lines + * @li optional: expects type int, defines the text modes for embedded text lines * Possible Modes defined in /gui/widget/textbox.h * AUTO_WIDTH * AUTO_HIGH @@ -278,9 +278,9 @@ class CHintBox : public CComponentsWindow * AUTO_LINEBREAK_NO_BREAKCHARS * default: CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER * @param[in] color_text - * @li optional: exepts type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT + * @li optional: expects type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT * * @param[in] style - * @li optional: exepts type int, defines the text style NOTE: only for dynamic font + * @li optional: expects type int, defines the text style NOTE: only for dynamic font * possible styles are: * FONT_STYLE_REGULAR (default) * FONT_STYLE_BOLD @@ -323,16 +323,16 @@ class CHint : public CHintBox public: /**CHint Constructor * @param[in] Text - * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @li expects type const char*, this is the message text inside the window, text is UTF-8 encoded * @param[in] show_background - * @li optional: exepts type bool, enable/disable backround paint, default = true + * @li optional: expects type bool, enable/disable backround paint, default = true */ CHint(const char * const Text, bool show_background = true); /**CHint Constructor * @param[in] Text - * @li exepts type neutrino_locale_t, this is the message text inside the window, text is UTF-8 encoded + * @li expects type neutrino_locale_t, this is the message text inside the window, text is UTF-8 encoded * @param[in] show_background - * @li optional: exepts type bool, enable/disable backround paint, default = true + * @li optional: expects type bool, enable/disable backround paint, default = true */ CHint(const neutrino_locale_t Text, bool show_background = true); }; @@ -341,9 +341,9 @@ class CHint : public CHintBox * Simplified methodes to show hintboxes without titlebar and footer * Text is UTF-8 encoded * @param[in] timeout -* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (get from settings) +* @li optional: expects type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (get from settings) * @param[in] show_background -* @li optional: exepts type bool, enable/disable backround paint, default = true +* @li optional: expects type bool, enable/disable backround paint, default = true * @see for possible text parameters take a look to CHintBox() */ int ShowHintS(const neutrino_locale_t Text, int timeout = HINTBOX_DEFAULT_TIMEOUT, bool show_background = true); diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index dcca0b8a7..f207ffcd5 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -121,22 +121,22 @@ class CMsgBox : public CHintBox public: /**CMsgBox Constructor * @param[in] Text - * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @li expects type const char*, this is the message text inside the window, text is UTF-8 encoded * @param[in] Title - * @li optional: exepts type const char*, default = NULL, this causes default title "Information" + * @li optional: expects type const char*, default = NULL, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON + * @li optional: expects type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon - * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @li optional: expects type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width - * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_WIDTH + * @li optional: expects type int, defines box width, default value = MSGBOX_MIN_WIDTH * @param[in] Height - * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_HEIGHT + * @li optional: expects type int, defines box width, default value = MSGBOX_MIN_HEIGHT * @param[in] ShowButtons - * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * @li optional: expects type int, defines which buttons are available on screen, default value = mbCancel * @see setShowedButtons() * @param[in] Default_result - * @li optional: exepts type int, defines default result value, default value = mbrCancel + * @li optional: expects type int, defines default result value, default value = mbrCancel * possible values are: * mbrYes = 0, * mbrNo = 1, @@ -148,7 +148,7 @@ class CMsgBox : public CHintBox * mbrNone = -1 * @see setDefaultResult(), getResult(); getDefaultResult(), enableDefaultResultOnTimeOut() * @param[in] text_mode - * @li optional: exepts type int, defines the text modes for embedded text lines + * @li optional: expects type int, defines the text modes for embedded text lines * Possible Modes defined in /gui/widget/textbox.h * AUTO_WIDTH * AUTO_HIGH @@ -175,22 +175,22 @@ class CMsgBox : public CHintBox /**CMsgBox Constructor * @param[in] Text - * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @li expects type const char*, this is the message text inside the window, text is UTF-8 encoded * @param[in] Title - * @li optional: exepts type neutrino_locale_t with locale entry from /system/locals.h default = NONEXISTANT_LOCALE, this causes default title "Information" + * @li optional: expects type neutrino_locale_t with locale entry from /system/locals.h default = NONEXISTANT_LOCALE, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON + * @li optional: expects type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon - * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @li optional: expects type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width - * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_WIDTH + * @li optional: expects type int, defines box width, default value = MSGBOX_MIN_WIDTH * @param[in] Height - * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_HEIGHT + * @li optional: expects type int, defines box width, default value = MSGBOX_MIN_HEIGHT * @param[in] ShowButtons - * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * @li optional: expects type int, defines which buttons are available on screen, default value = mbCancel * @see setShowedButtons() * @param[in] Default_result - * @li optional: exepts type int, defines default result value, default value = mbrCancel + * @li optional: expects type int, defines default result value, default value = mbrCancel * possible values are: * mbrYes = 0, * mbrNo = 1, @@ -202,7 +202,7 @@ class CMsgBox : public CHintBox * mbrNone = -1 * @see setDefaultResult(), getResult(); getDefaultResult(), enableDefaultResultOnTimeOut() * @param[in] text_mode - * @li optional: exepts type int, defines the text modes for embedded text lines + * @li optional: expects type int, defines the text modes for embedded text lines * Possible Modes defined in /gui/widget/textbox.h * AUTO_WIDTH * AUTO_HIGH @@ -249,7 +249,7 @@ class CMsgBox : public CHintBox /** * sets current default result as msg_result_t, independently from current selected button result * @param[in] Default_result - * @li exepts type msg_result_t + * @li expects type msg_result_t */ void setDefaultResult(const msg_result_t& Default_result){default_result = Default_result;} @@ -258,7 +258,7 @@ class CMsgBox : public CHintBox * This member allows to set and overrides already defined buttons from constructor, * parameter ''ShowButtons'' accepts given types, find under button_define_t enumeration * @param[in] ShowButtons - * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * @li optional: expects type int, defines which buttons are available on screen, default value = mbCancel * possible values are: * mbYes = 0x01, * mbNo = 0x02, @@ -277,14 +277,14 @@ class CMsgBox : public CHintBox /** * define timeout, timeout is enabled if parmeter 1 > -1, otherwise it will be disabled, * @param[in] Timeout - * @li exepts type int + * @li expects type int */ void setTimeOut(const int& Timeout){timeout = Timeout;}; /** * enable/disable defined timeout, otherwise it will be ignored * @param[in] enable - * @li exepts type bool, default = true + * @li expects type bool, default = true */ void enableDefaultResultOnTimeOut(bool enable = true); @@ -293,17 +293,17 @@ class CMsgBox : public CHintBox * This member allows to define an alternate text for an already defined button, * Result values are not touched! * @param[in] showed_button - * @li exepts type int + * @li expects type int * @see setShowedButtons() * @param[in] text - * @li exepts type std::string, sets the new text for button + * @li expects type std::string, sets the new text for button */ void setButtonText(const int& showed_button, const std::string& text); /** * enables background of buttons * @param[in] enable - * @li exepts type bool, default = true + * @li expects type bool, default = true */ void enableButtonBg(bool enable = true); diff --git a/src/gui/widget/navibar.h b/src/gui/widget/navibar.h index cb3cbe08f..9ea3dee50 100644 --- a/src/gui/widget/navibar.h +++ b/src/gui/widget/navibar.h @@ -89,14 +89,14 @@ class CNaviBar : public CComponentsFrmChain /** * Enable or disable left icon * @param[in] enable - * @li exepts type bool, default = true + * @li expects type bool, default = true */ void enableLeftArrow(bool enable = true){nb_lpic_enable = enable; initCCItems();} /** * Enable or disable right icon * @param[in] enable - * @li exepts type bool, default = true + * @li expects type bool, default = true */ void enableRightArrow(bool enable = true){nb_rpic_enable = enable; initCCItems();} @@ -115,9 +115,9 @@ class CNaviBar : public CComponentsFrmChain /** * Enable or disable both icons at once. * @param[in] enable_left - * @li exepts type bool, default = true + * @li expects type bool, default = true * @param[in] enable_right - * @li exepts type bool, default = true + * @li expects type bool, default = true */ void enableArrows(bool enable_left = true, bool enable_right = true){enableLeftArrow(enable_left); enableRightArrow(enable_right);} @@ -130,37 +130,37 @@ class CNaviBar : public CComponentsFrmChain /** * Sets font type for texts. * @param[in] font - * @li exepts type Font* + * @li expects type Font* */ void setFont(Font *font) {nb_font = font; initCCItems();} /** * Sets left text. * @param[in] text - * @li exepts type std::string + * @li expects type std::string */ void setLeftText(const std::string& text) {nb_l_text = text; initCCItems();} /** * Sets right text * @param[in] text - * @li exepts type std::string + * @li expects type std::string */ void setRightText(const std::string& text) {nb_r_text = text; initCCItems();} /** * Sets left and right text at once. * @param[in] left - * @li exepts type std::string + * @li expects type std::string * @param[in] right - * @li exepts type std::string + * @li expects type std::string */ void setText(const std::string& left, const std::string& right) {setLeftText(left); setRightText(right);} /** * Paint bar on screen. * @param[in] do_save_bg - * @li optional: exepts type bool, default = CC_SAVE_SCREEN_YES. + * @li optional: expects type bool, default = CC_SAVE_SCREEN_YES. */ void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index 5980985e5..89ea1c81b 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -227,9 +227,9 @@ class CTextBox : public sigc::trackable /** * Returns width of largest line from passed text * @param[in] text - * @li exepts type std::string + * @li expects type std::string * @param[in] font - * @li exepts font type object + * @li expects font type object * @return width of largest line as int * @see getMaxLineWidth(void) */ From 4249ab049755609b956bc20ce532ece056a4e64f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 20/23] CTimerList: paint header only if required Avoid possible flicker effects. TODO: fix clock background with enabled gradient on header repaint. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4dd12767f9da83fff309422a33e386a615d3cd90 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 8d39b1783..f6396045d 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1386,7 +1386,8 @@ void CTimerList::paintHead() header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); } - header->paint(CC_SAVE_SCREEN_NO); + if(!header->isPainted()) + header->paint(CC_SAVE_SCREEN_NO); } void CTimerList::paintFoot() From ec598a94b5acfa801005d4281667cbe13fa54adb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Aug 2017 12:16:45 +0200 Subject: [PATCH 21/23] CTimerList: adjust label width in footer dependent by count of buttons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3987c3a30633111ed1e5d78f580e3b837b2f87e8 Author: Thilo Graf Date: 2017-08-28 (Mon, 28 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f6396045d..a0e33df98 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1413,9 +1413,9 @@ void CTimerList::paintFoot() footer.enableShadow(CC_SHADOW_ON, -1, true); if (timerlist.empty()) - footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1])); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1]), width/(2+1)); else - footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons, width/(c-1)); } void CTimerList::paint() From e7b9f353e27327f35a0ecdc06cd10aacda29bd1b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 29 Aug 2017 15:01:31 +0200 Subject: [PATCH 22/23] remove my stupid init Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5dc1b777021896f6daddc39dbb7e10fd81761e4 Author: Jacek Jendrzej Date: 2017-08-29 (Tue, 29 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/radiotext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index b74aa9ef0..773c51034 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -836,7 +836,7 @@ void CRadioText::RassDecode(unsigned char *mtext, int len) slidenumr = Rass_SlideFoto; } // - char *filepath = asprintf(&filepath, "%s/Rass_%d.error", DataDir, slidenumr); + char *filepath = NULL; (filetype == 2) ? asprintf(&filepath, "%s/Rass_%d.def", DataDir, slidenumr) : asprintf(&filepath, "%s/Rass_%d.mpg", DataDir, slidenumr); if ((fd = fopen(filepath, "wb")) != NULL) { @@ -881,7 +881,8 @@ void CRadioText::RassDecode(unsigned char *mtext, int len) } else printf("ERROR vdr-radio: writing image/data-file failed '%s'", filepath); - free(filepath); + if(filepath) + free(filepath); } } start = false; From 44a8e0b0b4f5208f1d191ddbc595d5d60df2db09 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 29 Aug 2017 16:35:32 +0200 Subject: [PATCH 23/23] pic max10 code from commit f480ad018c72d40a9d2d2fb4006cfca1c262234d Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d4f52ae6223b30a4f07a7fa89d1fe671944d021 Author: Jacek Jendrzej Date: 2017-08-29 (Tue, 29 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/radiotext.cpp | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 773c51034..6374b477e 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -2375,7 +2375,13 @@ void CRadioText::run() uint current_pid = 0; printf("CRadioText::run: ###################### Starting thread ######################\n"); +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || HAVE_GENERIC_HARDWARE + int buflen = 0; + unsigned char *buf = NULL; + audioDemux = new cDemux(0); // live demux +#else audioDemux = new cDemux(1); +#endif audioDemux->Open(DMX_PES_CHANNEL,0,128*1024); while(running) { @@ -2400,11 +2406,41 @@ void CRadioText::run() } mutex.unlock(); if (pid) { +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || HAVE_GENERIC_HARDWARE + int n; + unsigned char tmp[6]; + + n = audioDemux->Read(tmp, 6, 500); + if (n != 6) { + usleep(10000); /* save CPU if nothing read */ + continue; + } + if (memcmp(tmp, "\000\000\001\300", 4)) + continue; + int packlen = ((tmp[4] << 8) | tmp[5]) + 6; + + if (buflen < packlen) { + if (buf) + free(buf); + buf = (unsigned char *) calloc(1, packlen); + buflen = packlen; + } + if (!buf) + break; + memcpy(buf, tmp, 6); + + while ((n < packlen) && running) { + int len = audioDemux->Read(buf + n, packlen - n, 500); + if (len < 0) + break; + n += len; + } +#else int n; unsigned char buf[0x1FFFF]; n = audioDemux->Read(buf, sizeof(buf), 500 /*5000*/); - +#endif if (n > 0) { //printf("."); fflush(stdout); mutex.lock(); @@ -2413,6 +2449,10 @@ void CRadioText::run() } } } +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || HAVE_GENERIC_HARDWARE + if (buf) + free(buf); +#endif delete audioDemux; audioDemux = NULL; printf("CRadioText::run: ###################### exit ######################\n");