From 4211cb9d8e1ffc844289fb6d2823dcf63963b019 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:24 +0100 Subject: [PATCH 001/394] configure: Add macro ENABLE_CHANGE_OSD_RESOLUTION - macro is default for hd2 - macro can activated for other hardware by configure option --enable-reschange Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9497a3c43a910583f8e7c3464897206cd3624cd1 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ configure: Add macro ENABLE_CHANGE_OSD_RESOLUTION - macro is default for hd2 - macro can activated for other hardware by configure option --enable-reschange ------------------ This commit was generated by Migit --- acinclude.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 3eadaaff4..ee5c7ec0e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -22,6 +22,14 @@ if test "$DEBUG" = "yes"; then AC_DEFINE(DEBUG,1,[Enable debug messages]) fi +AC_ARG_ENABLE(reschange, + AS_HELP_STRING(--enable-reschange,enable change the osd resolution (default for hd2))) + +AM_CONDITIONAL(ENABLE_RESCHANGE,test "$enable_reschange" = "yes") +if test "$enable_reschange" = "yes"; then + AC_DEFINE(ENABLE_CHANGE_OSD_RESOLUTION,1,[enable change the osd resolution]) +fi + AC_ARG_ENABLE(tmsdk, AS_HELP_STRING(--enable-tmsdk, compile inside sdk), ,[enable_tmsdk=no]) @@ -559,6 +567,7 @@ if test "$BOXMODEL" = "hd1"; then AC_DEFINE(BOXMODEL_CS_HD1, 1, [coolstream hd1/neo/neo2/zee]) elif test "$BOXMODEL" = "hd2"; then AC_DEFINE(BOXMODEL_CS_HD2, 1, [coolstream tank/trinity/trinity v2/trinity duo/zee²/link]) + AC_DEFINE(ENABLE_CHANGE_OSD_RESOLUTION,1,[enable change the osd resolution]) elif test "$BOXMODEL" = "dm500"; then AC_DEFINE(BOXMODEL_DM500, 1, [dreambox 500]) elif test "$BOXMODEL" = "ip200"; then From d5d1fc0728cc468094b6ab978197201005003399 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:27 +0100 Subject: [PATCH 002/394] CFbAccelCSHD2::setMode: Update for new framebuffer driver (full hd) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/33125aed06d2175f197efa95645dba4f9bd962f2 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd2.cpp | 44 ++++++++++++++++++++++++++++++---- src/neutrino.cpp | 5 +++- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 393e6396c..233254acc 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -185,21 +185,57 @@ void CFbAccelCSHD2::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_ CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff); } -int CFbAccelCSHD2::setMode(unsigned int, unsigned int, unsigned int) +int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) { + if (!available&&!active) + return -1; + + if (available >= 16588800) { /* new fb driver with maxres 1920x1080(*8) */ + screeninfo.xres_virtual=screeninfo.xres=nxRes; + screeninfo.yres_virtual=screeninfo.yres=nyRes; + screeninfo.height=0; + screeninfo.width=0; + screeninfo.xoffset=screeninfo.yoffset=0; + screeninfo.bits_per_pixel=nbpp; + + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) + perror(LOGTAG "FBIOPUT_VSCREENINFO"); + + printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", + screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); + if ((screeninfo.xres != nxRes) || + (screeninfo.yres != nyRes) || + (screeninfo.bits_per_pixel != nbpp)) { + printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", + nxRes, nyRes, nbpp, + screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); + return -1; + } + } + fb_fix_screeninfo _fix; if (ioctl(fd, FBIOGET_FSCREENINFO, &_fix) < 0) { - perror("FBIOGET_FSCREENINFO"); + perror(LOGTAG "FBIOGET_FSCREENINFO"); return -1; } stride = _fix.line_length; if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) - printf("screen unblanking failed\n"); + printf(LOGTAG "screen unblanking failed\n"); xRes = screeninfo.xres; yRes = screeninfo.yres; bpp = screeninfo.bits_per_pixel; - printf(LOGTAG "%dx%dx%d line length %d. using hd2 graphics accelerator.\n", xRes, yRes, bpp, stride); + printf(LOGTAG "%dx%dx%d line length %d. using %s graphics accelerator.\n", xRes, yRes, bpp, stride, _fix.id); + +/* +max res 1280x720 + available 14745600 + stride 5120 +max res 1920x1080 + available 16588800 + stride 7680 +*/ + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8ab84bd88..7861c9228 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1815,7 +1815,10 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); - if(frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t))) { + /* Parameters only valid for hd2 hardware and new fb drivers, + all other hardware ignores these parameters */ +// if (frameBuffer->setMode(1280, 720, 8 * sizeof(fb_pixel_t)) == -1) { + if (frameBuffer->setMode(1920, 1080, 8 * sizeof(fb_pixel_t)) == -1) { dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); exit(-1); } From 9fe7ca7e26e1d88233b748fe4ef12175410f6994 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:30 +0100 Subject: [PATCH 003/394] CFbAccelCSHD2: Add scaleFont()function for font upscaling when fullhd is aktiv Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/88c834221bddf5400b65017d946e7d2beb798fbf Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel.h | 1 + src/driver/fb_accel_cs_hd2.cpp | 8 ++++++++ src/driver/fb_generic.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 54736d331..f13c08ef2 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -127,6 +127,7 @@ class CFbAccelCSHD2 void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); void setBlendMode(uint8_t); void setBlendLevel(int); + int scaleFont(int size); }; class CFbAccelGLFB diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 233254acc..61936135a 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -264,3 +264,11 @@ void CFbAccelCSHD2::setBlendLevel(int level) if (level == 100) // TODO: sucks. usleep(20000); } + +int CFbAccelCSHD2::scaleFont(int size) +{ + if (screeninfo.xres == 1920) + size += size/2; + + return size; +} diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 5b2a24402..747424648 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -270,6 +270,7 @@ class CFrameBuffer : public sigc::trackable void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); + virtual int scaleFont(int size) { return size; }; enum { From 346923a66bbe12f335e2713ed509bdefba270b84 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:34 +0100 Subject: [PATCH 004/394] neutrino: Upscaling fonts, infoclock and volumebar for full hd Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/13a7358e6489f06892689fe503f2008af47837d6 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/neutrinofonts.cpp | 17 ++++++++++++++--- src/gui/infoclock.cpp | 3 +++ src/gui/volumebar.cpp | 9 +++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 80b40377e..6bbe1e912 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -176,12 +176,23 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) fontStyle[2] = "Italic"; } + int fontSize; for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; - g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; +#else + fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; +#endif + g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), fontSize); } if (g_SignalFont) delete g_SignalFont; - g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; +#else + fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; +#endif + g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize); } void CNeutrinoFonts::refreshDynFonts() @@ -242,7 +253,7 @@ int CNeutrinoFonts::getFontHeight(Font* fnt) int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) { int dynSize = dy/1.6; - if (dx == 0) dx = 1280; + if (dx == 0) dx = CFrameBuffer::getInstance()->getScreenWidth(true); if (!vDynSize.empty()) { for (size_t i = 0; i < vDynSize.size(); i++) { diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 54b485b09..a5c75b7fc 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -76,6 +76,9 @@ void CInfoClock::initCCLockItems() //set height, NOTE: height is strictly bound to settings height = g_settings.infoClockFontSize; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif initClockFont(0, height); // set corner radius depending on clock height diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 9f9921ad6..6ba244f27 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -54,6 +54,9 @@ void CVolumeBar::initVarVolumeBar() corner_rad = CORNER_RADIUS_MID; vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif //assume volume value as pointer to global setting vb_vol = &g_settings.current_volume; @@ -92,6 +95,9 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = 200; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vb_pbw = CFrameBuffer::getInstance()->scaleFont(vb_pbw); +#endif vb_pbh = height-4*vb_item_offset; //result for width @@ -363,6 +369,9 @@ void CVolumeHelper::initVolBarSize() icon_width += 8; g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = g_settings.volume_size; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vol_height = CFrameBuffer::getInstance()->scaleFont(vol_height); +#endif if (g_settings.volume_digits) { CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance(); From 39035073123d9bcad4ce17cc7b6c2313df878b95 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:37 +0100 Subject: [PATCH 005/394] neutrino: Add switch osd resolution when supported from hardware - At the moment supported hardware: CS HD2 Currently known problems: ------------------------- - Display menus after changing resolution (Reboot required) - Display headers after changing resolution hd => fullhd (Reboot required) - Display infobar after changing resolution hd => fullhd (Reboot required) - Screenshot broken (With new driver and set resolution to 1280x720) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b158903f8fd08e3c6636c22ab00eae1c2262793 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ neutrino: Add switch osd resolution when supported from hardware - At the moment supported hardware: CS HD2 Currently known problems: ------------------------- - Display menus after changing resolution (Reboot required) - Display headers after changing resolution hd => fullhd (Reboot required) - Display infobar after changing resolution hd => fullhd (Reboot required) - Screenshot broken (With new driver and set resolution to 1280x720) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 +- data/locale/english.locale | 4 +- src/driver/fb_accel.h | 3 + src/driver/fb_accel_cs_hd1.cpp | 18 +++- src/driver/fb_accel_cs_hd2.cpp | 29 +++++- src/driver/fb_generic.cpp | 13 +++ src/driver/fb_generic.h | 10 ++ src/gui/osd_setup.cpp | 73 +++++++++++++-- src/gui/osd_setup.h | 6 ++ src/gui/screensetup.cpp | 57 ++++++++--- src/neutrino.cpp | 166 ++++++++++++++++++++++++--------- src/neutrino.h | 2 + src/system/locals.h | 4 +- src/system/locals_intern.h | 4 +- src/system/settings.h | 25 +++-- 15 files changed, 338 insertions(+), 80 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a1715b44f..81571ac83 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -322,10 +322,9 @@ colormenu.clock_textcolor Ziffernfarbe colormenu.fade Ein-/Ausblenden colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart -colormenu.hd_preset LCD colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl -colormenu.sd_preset CRT +colormenu.osd_resolution OSD-Auflösung colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1244,6 +1243,7 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) +menu.hint_osd_resolution Wählen Sie eine OSD Auflösung menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index 4feae3a1e..9cec3d22b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -322,10 +322,9 @@ colormenu.clock_textcolor Digit color colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font -colormenu.hd_preset LCD colormenu.menucolors Colors colormenu.osd_preset TV preset -colormenu.sd_preset CRT +colormenu.osd_resolution OSD resolution colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1244,6 +1243,7 @@ menu.hint_opkg_upgrade Updates all installed packages to the most recent version menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV +menu.hint_osd_resolution Change OSD resolution menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index f13c08ef2..5d1b380be 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -108,6 +108,7 @@ class CFbAccelCSHD1 void setBlendLevel(int); void add_gxa_sync_marker(void); void setupGXA(void); + void setOsdResolutions(); }; class CFbAccelCSHD2 @@ -128,6 +129,8 @@ class CFbAccelCSHD2 void setBlendMode(uint8_t); void setBlendLevel(int); int scaleFont(int size); + bool fullHdAvailable(); + void setOsdResolutions(); }; class CFbAccelGLFB diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index 4b3df3d20..0edd86b16 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -325,9 +325,25 @@ void CFbAccelCSHD1::setupGXA() add_gxa_sync_marker(); } -/* wrong name... */ +void CFbAccelCSHD1::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); +} + int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int) { + if (!available&&!active) + return -1; + + if (osd_resolutions.empty()) + setOsdResolutions(); + fb_fix_screeninfo _fix; if (ioctl(fd, FBIOGET_FSCREENINFO, &_fix) < 0) { diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 61936135a..8ee49c023 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -185,12 +185,32 @@ void CFbAccelCSHD2::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_ CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff); } +void CFbAccelCSHD2::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); + if (fullHdAvailable()) { + res.xRes = 1920; + res.yRes = 1080; + res.bpp = 32; + osd_resolutions.push_back(res); + } +} + int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) { if (!available&&!active) return -1; - if (available >= 16588800) { /* new fb driver with maxres 1920x1080(*8) */ + if (osd_resolutions.empty()) + setOsdResolutions(); + + if (fullHdAvailable()) { screeninfo.xres_virtual=screeninfo.xres=nxRes; screeninfo.yres_virtual=screeninfo.yres=nyRes; screeninfo.height=0; @@ -272,3 +292,10 @@ int CFbAccelCSHD2::scaleFont(int size) return size; } + +bool CFbAccelCSHD2::fullHdAvailable() +{ + if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */ + return true; + return false; +} diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 9377d77da..0cdac8a39 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -350,8 +350,21 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) { printf("screen unblanking failed\n"); } + return 0; } + +void CFrameBuffer::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); +} + #if 0 //never used void CFrameBuffer::setTransparency( int /*tr*/ ) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 747424648..1269abead 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -39,6 +39,13 @@ typedef struct fb_var_screeninfo t_fb_var_screeninfo; +typedef struct osd_resolution_t +{ + uint32_t yRes; + uint32_t xRes; + uint32_t bpp; +} osd_resolution_struct_t; + typedef struct gradientData_t { fb_pixel_t* gradientBuf; @@ -271,6 +278,9 @@ class CFrameBuffer : public sigc::trackable virtual void mark(int x, int y, int dx, int dy); virtual int scaleFont(int size) { return size; }; + virtual bool fullHdAvailable() { return false; }; + virtual void setOsdResolutions(); + std::vector osd_resolutions; enum { diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8a31cf3c2..4e5128c67 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -389,12 +389,11 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } - #define OSD_PRESET_OPTIONS_COUNT 2 -const CMenuOptionChooser::keyval OSD_PRESET_OPTIONS[OSD_PRESET_OPTIONS_COUNT] = +const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { - { 0, LOCALE_COLORMENU_SD_PRESET }, - { 1, LOCALE_COLORMENU_HD_PRESET } + { COsdSetup::PRESET_CRT, NONEXISTANT_LOCALE, "CRT" }, + { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 @@ -641,11 +640,37 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(GenericMenuSeparatorLine); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + // osd resolution + size_t resCount = frameBuffer->osd_resolutions.size(); + struct CMenuOptionChooser::keyval_ext kext[resCount]; + char valname[resCount][255]; + if (resCount > 0) { + for (size_t i = 0; i < resCount; i++) { + kext[i].key = i; + kext[i].value = NONEXISTANT_LOCALE; + snprintf(valname[i], sizeof(valname[resCount]), "%dx%d", frameBuffer->osd_resolutions[i].xRes, frameBuffer->osd_resolutions[i].yRes); + kext[i].valname = valname[i]; + } + } + else { + kext[0].key = 0; + kext[0].value = NONEXISTANT_LOCALE; + kext[0].valname = "-"; + resCount = 1; + } + CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this); + osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); + osd_menu->addItem(osd_res); +#endif + //monitor CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET); osd_menu->addItem(mc); + osd_menu->addItem(GenericMenuSeparatorLine); + // round corners mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS); @@ -1354,16 +1379,48 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) int preset = * (int *) data; printf("preset %d (setting %d)\n", preset, g_settings.screen_preset); - g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; - g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; - g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; - g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; + CNeutrinoApp::getInstance()->setScreenSettings(); osd_menu->hide(); if (g_InfoViewer == NULL) g_InfoViewer = new CInfoViewer; g_InfoViewer->changePB(); return true; } +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION)) + { + if (frameBuffer->fullHdAvailable()) { + if (frameBuffer->osd_resolutions.empty()) + return true; + + size_t index = (size_t)*(int*)data; + size_t resCount = frameBuffer->osd_resolutions.size(); + if (index >= resCount) + index = 0; + + uint32_t resW = frameBuffer->osd_resolutions[index].xRes; + uint32_t resH = frameBuffer->osd_resolutions[index].yRes; + uint32_t bpp = frameBuffer->osd_resolutions[index].bpp; + int switchFB = frameBuffer->setMode(resW, resH, bpp); + + if (switchFB == 0) { +//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp); + osd_menu->hide(); + frameBuffer->Clear(); + CNeutrinoApp::getInstance()->setScreenSettings(); + CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); + CVolumeHelper::getInstance()->refresh(); + CInfoClock::getInstance()->ClearDisplay(); + FileTimeOSD->Init(); + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); + if (g_InfoViewer) + g_InfoViewer->ResetModules(); + } + } + return true; + } +#endif else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_ROUNDED_CORNERS)) { osd_menu->hide(); g_settings.rounded_corners = * (int*) data; diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 18adc6311..cdea56535 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -96,6 +96,12 @@ class COsdSetup : public CMenuTarget, public CChangeObserver INFOBAR_LOGO_FRAMED, INFOBAR_LOGO_SHADED }; + + enum + { + PRESET_CRT, + PRESET_LCD + }; COsdSetup(int wizard_mode = SNeutrinoSettings::WIZARD_OFF); ~COsdSetup(); diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index b1327fed2..207020eab 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -109,27 +110,61 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) switch ( msg ) { - case CRCInput::RC_ok: + case CRCInput::RC_ok: { // abspeichern g_settings.screen_StartX = x_coord[0]; g_settings.screen_EndX = x_coord[1]; g_settings.screen_StartY = y_coord[0]; g_settings.screen_EndY = y_coord[1]; - if(g_settings.screen_preset) { - g_settings.screen_StartX_lcd = g_settings.screen_StartX; - g_settings.screen_StartY_lcd = g_settings.screen_StartY; - g_settings.screen_EndX_lcd = g_settings.screen_EndX; - g_settings.screen_EndY_lcd = g_settings.screen_EndY; - } else { - g_settings.screen_StartX_crt = g_settings.screen_StartX; - g_settings.screen_StartY_crt = g_settings.screen_StartY; - g_settings.screen_EndX_crt = g_settings.screen_EndX; - g_settings.screen_EndY_crt = g_settings.screen_EndY; + switch (g_settings.osd_resolution) { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + case 1: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX_crt_1 = g_settings.screen_StartX; + g_settings.screen_StartY_crt_1 = g_settings.screen_StartY; + g_settings.screen_EndX_crt_1 = g_settings.screen_EndX; + g_settings.screen_EndY_crt_1 = g_settings.screen_EndY; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX_lcd_1 = g_settings.screen_StartX; + g_settings.screen_StartY_lcd_1 = g_settings.screen_StartY; + g_settings.screen_EndX_lcd_1 = g_settings.screen_EndX; + g_settings.screen_EndY_lcd_1 = g_settings.screen_EndY; + break; + } + } + break; +#endif + case 0: + default: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX_crt_0 = g_settings.screen_StartX; + g_settings.screen_StartY_crt_0 = g_settings.screen_StartY; + g_settings.screen_EndX_crt_0 = g_settings.screen_EndX; + g_settings.screen_EndY_crt_0 = g_settings.screen_EndY; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX_lcd_0 = g_settings.screen_StartX; + g_settings.screen_StartY_lcd_0 = g_settings.screen_StartY; + g_settings.screen_EndX_lcd_0 = g_settings.screen_EndX; + g_settings.screen_EndY_lcd_0 = g_settings.screen_EndY; + break; + } + } + break; } + if (g_InfoViewer) /* recalc infobar position */ g_InfoViewer->start(); loop = false; break; + } case CRCInput::RC_home: if ( ( ( g_settings.screen_StartX != x_coord[0] ) || diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7861c9228..f9a21a22f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -225,6 +225,7 @@ CNeutrinoApp::CNeutrinoApp() : configfile('\t') { standby_pressed_at.tv_sec = 0; + osd_resolution_tmp = -1; frameBuffer = CFrameBuffer::getInstance(); frameBuffer->setIconBasePath(ICONSDIR); @@ -305,15 +306,6 @@ static SNeutrinoSettings::usermenu_t usermenu_default[] = { /************************************************************************************** * CNeutrinoApp - loadSetup, load the application-settings * **************************************************************************************/ -#define DEFAULT_X_START_SD 60 -#define DEFAULT_Y_START_SD 20 -#define DEFAULT_X_END_SD 1220 -#define DEFAULT_Y_END_SD 560 - -#define DEFAULT_X_START_HD 40 //5 -#define DEFAULT_Y_START_HD 25 //5 -#define DEFAULT_X_END_HD 1235 //1275 -#define DEFAULT_Y_END_HD 690 //715 std::string ttx_font_file = ""; @@ -721,29 +713,31 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1); //screen configuration - g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD); - g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD ); - g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD); - g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD); - g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD); - g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD ); - g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD); - g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD); - g_settings.screen_preset = configfile.getInt32( "screen_preset", 1); - - g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; - g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; - g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; - g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; - - g_settings.screen_width = frameBuffer->getScreenWidth(true); - g_settings.screen_height = frameBuffer->getScreenHeight(true); + g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; + g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); + g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); + g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1199); + g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 674); + g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40); + g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 22); + g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1193); + g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 697); + g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80); + g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45); + g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1839); + g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 1034); + g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40); + g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 22); + g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1879); + g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1057); + g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD); + setScreenSettings(); // avoid configuration mismatch - if (g_settings.screen_EndX > g_settings.screen_width) - g_settings.screen_EndX = g_settings.screen_width; - if (g_settings.screen_EndY > g_settings.screen_height) - g_settings.screen_EndY = g_settings.screen_height; + if (g_settings.screen_EndX >= g_settings.screen_width) + g_settings.screen_EndX = g_settings.screen_width - 1; + if (g_settings.screen_EndY >= g_settings.screen_height) + g_settings.screen_EndY = g_settings.screen_height - 1; g_settings.bigFonts = configfile.getInt32("bigFonts", 0); g_settings.window_size = configfile.getInt32("window_size", 100); @@ -947,6 +941,56 @@ int CNeutrinoApp::loadSetup(const char * fname) return erg; } +void CNeutrinoApp::setScreenSettings() +{ + g_settings.screen_width = frameBuffer->getScreenWidth(true); + g_settings.screen_height = frameBuffer->getScreenHeight(true); + + switch (g_settings.osd_resolution) { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + case 1: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX = g_settings.screen_StartX_crt_1; + g_settings.screen_StartY = g_settings.screen_StartY_crt_1; + g_settings.screen_EndX = g_settings.screen_EndX_crt_1; + g_settings.screen_EndY = g_settings.screen_EndY_crt_1; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX = g_settings.screen_StartX_lcd_1; + g_settings.screen_StartY = g_settings.screen_StartY_lcd_1; + g_settings.screen_EndX = g_settings.screen_EndX_lcd_1; + g_settings.screen_EndY = g_settings.screen_EndY_lcd_1; + break; + } + } + break; +#endif + case 0: + default: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX = g_settings.screen_StartX_crt_0; + g_settings.screen_StartY = g_settings.screen_StartY_crt_0; + g_settings.screen_EndX = g_settings.screen_EndX_crt_0; + g_settings.screen_EndY = g_settings.screen_EndY_crt_0; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX = g_settings.screen_StartX_lcd_0; + g_settings.screen_StartY = g_settings.screen_StartY_lcd_0; + g_settings.screen_EndX = g_settings.screen_EndX_lcd_0; + g_settings.screen_EndY = g_settings.screen_EndY_lcd_0; + break; + } + } + break; + } +} + void CNeutrinoApp::upgradeSetup(const char * fname) { dprintf(DEBUG_NORMAL, "upgrade/cleanup %s\n", fname); @@ -1310,15 +1354,24 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd ); - configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd ); - configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd ); - configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd ); - configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt ); - configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt ); - configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt ); - configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt ); - configfile.setInt32( "screen_preset", g_settings.screen_preset ); + configfile.setInt32("osd_resolution" , g_settings.osd_resolution); + configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); + configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); + configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); + configfile.setInt32("screen_EndY_lcd_0" , g_settings.screen_EndY_lcd_0); + configfile.setInt32("screen_StartX_crt_0", g_settings.screen_StartX_crt_0); + configfile.setInt32("screen_StartY_crt_0", g_settings.screen_StartY_crt_0); + configfile.setInt32("screen_EndX_crt_0" , g_settings.screen_EndX_crt_0); + configfile.setInt32("screen_EndY_crt_0" , g_settings.screen_EndY_crt_0); + configfile.setInt32("screen_StartX_lcd_1", g_settings.screen_StartX_lcd_1); + configfile.setInt32("screen_StartY_lcd_1", g_settings.screen_StartY_lcd_1); + configfile.setInt32("screen_EndX_lcd_1" , g_settings.screen_EndX_lcd_1); + configfile.setInt32("screen_EndY_lcd_1" , g_settings.screen_EndY_lcd_1); + configfile.setInt32("screen_StartX_crt_1", g_settings.screen_StartX_crt_1); + configfile.setInt32("screen_StartY_crt_1", g_settings.screen_StartY_crt_1); + configfile.setInt32("screen_EndX_crt_1" , g_settings.screen_EndX_crt_1); + configfile.setInt32("screen_EndY_crt_1" , g_settings.screen_EndY_crt_1); + configfile.setInt32("screen_preset" , g_settings.screen_preset); //Software-update configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode ); @@ -1815,10 +1868,37 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); - /* Parameters only valid for hd2 hardware and new fb drivers, - all other hardware ignores these parameters */ -// if (frameBuffer->setMode(1280, 720, 8 * sizeof(fb_pixel_t)) == -1) { - if (frameBuffer->setMode(1920, 1080, 8 * sizeof(fb_pixel_t)) == -1) { + int setFbMode = 0; + osd_resolution_tmp = -1; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + frameBuffer->setOsdResolutions(); + if (frameBuffer->osd_resolutions.empty()) { + dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); + exit(-1); + } + + uint32_t ort; + configfile.loadConfig(NEUTRINO_SETTINGS_FILE); + ort = configfile.getInt32("osd_resolution", 0); + + size_t resCount = frameBuffer->osd_resolutions.size(); + + if (ort > (resCount - 1)) + osd_resolution_tmp = ort = 0; + + if (resCount == 1) + ort = 0; + + setFbMode = frameBuffer->setMode(frameBuffer->osd_resolutions[ort].xRes, + frameBuffer->osd_resolutions[ort].yRes, + frameBuffer->osd_resolutions[ort].bpp); + +#else + /* all other hardware ignores setMode parameters */ + setFbMode = frameBuffer->setMode(0, 0, 0); +#endif + + if (setFbMode == -1) { dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); exit(-1); } diff --git a/src/neutrino.h b/src/neutrino.h index 1b15140ea..291a018ea 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -108,6 +108,7 @@ private: bool channelList_allowed; bool channelList_painted; int first_mode_found; + int osd_resolution_tmp; void SDT_ReloadChannels(); void setupNetwork( bool force= false ); @@ -162,6 +163,7 @@ public: void saveSetup(const char * fname); int loadSetup(const char * fname); + void setScreenSettings(); void upgradeSetup(const char * fname); void loadKeys(const char * fname = NULL); void saveKeys(const char * fname = NULL); diff --git a/src/system/locals.h b/src/system/locals.h index b74b90eb8..74403d860 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -349,10 +349,9 @@ typedef enum LOCALE_COLORMENU_FADE, LOCALE_COLORMENU_FONT, LOCALE_COLORMENU_FONT_TTX, - LOCALE_COLORMENU_HD_PRESET, LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, - LOCALE_COLORMENU_SD_PRESET, + LOCALE_COLORMENU_OSD_RESOLUTION, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1271,6 +1270,7 @@ typedef enum LOCALE_MENU_HINT_OSD, LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, + LOCALE_MENU_HINT_OSD_RESOLUTION, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b3b18075b..4c822ed47 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -349,10 +349,9 @@ const char * locale_real_names[] = "colormenu.fade", "colormenu.font", "colormenu.font_ttx", - "colormenu.hd_preset", "colormenu.menucolors", "colormenu.osd_preset", - "colormenu.sd_preset", + "colormenu.osd_resolution", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1271,6 +1270,7 @@ const char * locale_real_names[] = "menu.hint_osd", "menu.hint_osd_language", "menu.hint_osd_preset", + "menu.hint_osd_resolution", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 2c91416f6..3b605f557 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -608,14 +608,23 @@ struct SNeutrinoSettings int screen_StartY; int screen_EndX; int screen_EndY; - int screen_StartX_crt; - int screen_StartY_crt; - int screen_EndX_crt; - int screen_EndY_crt; - int screen_StartX_lcd; - int screen_StartY_lcd; - int screen_EndX_lcd; - int screen_EndY_lcd; + int screen_StartX_crt_0; + int screen_StartY_crt_0; + int screen_EndX_crt_0; + int screen_EndY_crt_0; + int screen_StartX_lcd_0; + int screen_StartY_lcd_0; + int screen_EndX_lcd_0; + int screen_EndY_lcd_0; + int screen_StartX_crt_1; + int screen_StartY_crt_1; + int screen_EndX_crt_1; + int screen_EndY_crt_1; + int screen_StartX_lcd_1; + int screen_StartY_lcd_1; + int screen_EndX_lcd_1; + int screen_EndY_lcd_1; + int osd_resolution; int screen_preset; int screen_width; int screen_height; From 168e359e2a1b83b26cd1280cc46d3565763c2aef Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 21:21:11 +0100 Subject: [PATCH 006/394] migrate users settings; screen_StartX_crt/lcd -> screen_StartX_crt/lcd_0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9792b47666f5a45973693e384e0b0c0cd7526b14 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - migrate users settings; screen_StartX_crt/lcd -> screen_StartX_crt/lcd_0 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f9a21a22f..7fac51f5f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4895,11 +4895,7 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) } /* - * commit 523b273a changed the names of config file entries: - * casystem_display => infobar_casystem_display - * casystem_dotmatrix => infobar_casystem_dotmatrix - * casystem_frame => infobar_casystem_frame - * convert these, so that users do not need to set up their system again + * convert config keys, so that users do not need to set up their system again */ struct __key_rename { const char *from; @@ -4910,6 +4906,14 @@ static struct __key_rename key_rename[] = { { "casystem_display", "infobar_casystem_display" }, { "casystem_dotmatrix", "infobar_casystem_dotmatrix"}, { "casystem_frame", "infobar_casystem_frame" }, + { "screen_StartX_crt", "screen_StartX_crt_0" }, + { "screen_StartY_crt", "screen_StartY_crt_0" }, + { "screen_EndX_crt", "screen_EndX_crt_0" }, + { "screen_EndY_crt", "screen_EndY_crt_0" }, + { "screen_StartX_lcd", "screen_StartX_lcd_0" }, + { "screen_StartY_lcd", "screen_StartY_lcd_0" }, + { "screen_EndX_lcd", "screen_EndX_lcd_0" }, + { "screen_EndY_lcd", "screen_EndY_lcd_0" }, { NULL, NULL } }; @@ -4932,9 +4936,8 @@ void CNeutrinoApp::migrateConfig(const char *fname) /* only set new key to old value if the new key does not yet exist */ if (configfile.getInt32(to, magic) == magic) configfile.setInt32(to, tmp); - /* always remove old key*/ + /* always remove old key */ configfile.deleteKey(from); } /* more complex migration, including converting values etc. could be done here */ } - From b19560e56ca4d2ba082ab4819ca9ee0c91d365ae Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 21:34:01 +0100 Subject: [PATCH 007/394] fix keywords in strange try-to-detect-bad-config-file if-statement Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6964b62c6f17b39b7a9b2269b1840a0940e1f407 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - fix keywords in strange try-to-detect-bad-config-file if-statement ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7fac51f5f..41559a5b9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -321,10 +321,10 @@ int CNeutrinoApp::loadSetup(const char * fname) erg = 1; } else { /* try to detect bad / broken config file */ - if (!configfile.getInt32("screen_EndX_crt", 0) || - !configfile.getInt32("screen_EndY_crt", 0) || - !configfile.getInt32("screen_EndX_lcd", 0) || - !configfile.getInt32("screen_EndY_lcd", 0)) { + if (!configfile.getInt32("screen_EndX_crt_0", 0) || + !configfile.getInt32("screen_EndY_crt_0", 0) || + !configfile.getInt32("screen_EndX_lcd_0", 0) || + !configfile.getInt32("screen_EndY_lcd_0", 0)) { printf("[neutrino] config file %s is broken, using defaults\n", fname); configfile.clear(); } else { From eb335c16388b29afc7e6131e14aa70ac8d68812a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 22:50:48 +0100 Subject: [PATCH 008/394] set new osd-presets closer to old values; auto-calc screenEnd-values Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/145c0d41b45e4f32a28e2039f2d04000e4e5feb0 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - set new osd-presets closer to old values; auto-calc screenEnd-values ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 41559a5b9..dfc1e5190 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -716,20 +716,20 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); - g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1199); - g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 674); + g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); + g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 580 - g_settings.screen_StartY_crt_0 - 1); g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40); - g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 22); - g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1193); - g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 697); + g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 25); + g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1280 - g_settings.screen_StartX_lcd_0 - 1); + g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 720 - g_settings.screen_StartY_lcd_0 - 1); g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80); g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45); - g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1839); - g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 1034); + g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1920 - g_settings.screen_StartX_crt_1 - 1); + g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 870 - g_settings.screen_StartY_crt_1 - 1); g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40); - g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 22); - g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1879); - g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1057); + g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 25); + g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1920 - g_settings.screen_StartX_lcd_1 - 1); + g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1080 - g_settings.screen_StartY_lcd_1 - 1); g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD); setScreenSettings(); From ed768d2c33907c4989e0455160c38fd4fccc85cb Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 14 Feb 2017 12:36:29 +0100 Subject: [PATCH 009/394] screenshot: Workaround for broken osd screenshot with new fb driver... ...and 1280x720 resolution. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/56446c358fce085b74581cbf62bb99b7937f55ac Author: Michael Liebmann Date: 2017-02-14 (Tue, 14 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/screenshot.cpp | 81 +++++++++++++++++++++++++++++++++++++++ src/driver/screenshot.h | 4 ++ 2 files changed, 85 insertions(+) diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 98b873ca0..5bff78b68 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -61,6 +61,7 @@ CScreenShot::CScreenShot(const std::string fname, screenshot_format_t fmt) fd = NULL; xres = 0; yres = 0; + extra_osd = false; get_video = g_settings.screenshot_video; get_osd = g_settings.screenshot_mode; scale_to_video = g_settings.screenshot_scale; @@ -70,18 +71,90 @@ CScreenShot::~CScreenShot() { } +#ifdef BOXMODEL_CS_HD2 + +bool CScreenShot::mergeOsdScreen(uint32_t dx, uint32_t dy, fb_pixel_t* osdData) +{ + uint8_t* d = (uint8_t *)pixel_data; + fb_pixel_t* d2; + + for (uint32_t count = 0; count < dy; count++ ) { + fb_pixel_t *pixpos = (fb_pixel_t*)&osdData[count*dx]; + d2 = (fb_pixel_t*)d; + for (uint32_t count2 = 0; count2 < dx; count2++ ) { + //don't paint backgroundcolor (*pixpos = 0x00000000) + if (*pixpos) { + fb_pixel_t pix = *pixpos; + if ((pix & 0xff000000) == 0xff000000) + *d2 = (pix & 0x00ffffff); + else { + uint8_t *in = (uint8_t *)(pixpos); + uint8_t *out = (uint8_t *)d2; + int a = in[3]; + *out = (*out + ((*in - *out) * a) / 256); + in++; out++; + *out = (*out + ((*in - *out) * a) / 256); + in++; out++; + *out = (*out + ((*in - *out) * a) / 256); + } + } + d2++; + pixpos++; + } + d += dx*sizeof(fb_pixel_t); + } + return true; +} +#endif + /* try to get video frame data in ARGB format, restore GXA state */ bool CScreenShot::GetData() { +#ifdef BOXMODEL_CS_HD2 + /* Workaround for broken osd screenshot with new fb driver and 1280x720 resolution */ + CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); + fb_pixel_t* screenBuf = NULL; + uint32_t _xres = 0, _yres = 0; + if (frameBuffer->fullHdAvailable() && (frameBuffer->getScreenWidth(true) == 1280)) { + _xres = xres = 1280; + _yres = yres = 720; + get_osd = false; + extra_osd = true; + screenBuf = new fb_pixel_t[_xres*_yres*sizeof(fb_pixel_t)]; + if (screenBuf == NULL) { + printf("[%s:%s:%d] memory error\n", __path_file__, __func__, __LINE__); + return false; + } + printf("\n[%s:%s:%d] Read osd screen...", __path_file__, __func__, __LINE__); + frameBuffer->SaveScreen(0, 0, _xres, _yres, screenBuf); + printf(" done.\n"); + } +#endif + static OpenThreads::Mutex mutex; bool res = false; mutex.lock(); + #ifdef BOXMODEL_CS_HD1 CFrameBuffer::getInstance()->setActive(false); #endif if (videoDecoder->getBlank()) get_video = false; + +#ifdef BOXMODEL_CS_HD2 + if (extra_osd && !get_video) { + uint32_t memSize = xres * yres * sizeof(fb_pixel_t) * 2; + pixel_data = (uint8_t*)cs_malloc_uncached(memSize); + if (pixel_data == NULL) { + printf("[%s:%s:%d] memory error\n", __path_file__, __func__, __LINE__); + return false; + } + memset(pixel_data, 0, memSize); + res = true; + } + else +#endif #if 1 // to enable after libcs/drivers update res = videoDecoder->GetScreenImage(pixel_data, xres, yres, get_video, get_osd, scale_to_video); #endif @@ -99,6 +172,14 @@ bool CScreenShot::GetData() return false; } +#ifdef BOXMODEL_CS_HD2 + if (extra_osd && screenBuf) { + printf("[%s:%s:%d] Merge osd screen to screenshot...", __path_file__, __func__, __LINE__); + mergeOsdScreen(_xres, _yres, screenBuf); + delete[] screenBuf; + printf(" done.\n \n"); + } +#endif printf("CScreenShot::GetData: data: %p %d x %d\n", pixel_data, xres, yres); return true; } diff --git a/src/driver/screenshot.h b/src/driver/screenshot.h index a4f348a8b..76a14e1a1 100644 --- a/src/driver/screenshot.h +++ b/src/driver/screenshot.h @@ -39,6 +39,7 @@ class CScreenShot : public OpenThreads::Thread unsigned char * pixel_data; int xres; int yres; + bool extra_osd; bool get_osd; bool get_video; bool scale_to_video; @@ -52,6 +53,9 @@ class CScreenShot : public OpenThreads::Thread bool SaveJpg(); bool SaveBmp(); void run(); +#ifdef BOXMODEL_CS_HD2 + bool mergeOsdScreen(uint32_t dx, uint32_t dy, fb_pixel_t* osdData); +#endif public: CScreenShot(const std::string fname = "", screenshot_format_t fmt = CScreenShot::FORMAT_JPG); From 1fd4237382c9b3c09cc5e3930366b42ac4acc765 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 15 Feb 2017 08:48:38 +0100 Subject: [PATCH 010/394] disable strange try-to-detect-bad-config-file if-statement Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/56b99e0b472b46523bf8b05e7cb66ec4509b7b57 Author: vanhofen Date: 2017-02-15 (Wed, 15 Feb 2017) Origin message was: ------------------ - disable strange try-to-detect-bad-config-file if-statement ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index dfc1e5190..43cda6fa9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -320,6 +320,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //file existiert nicht erg = 1; } else { +#if 0 /* try to detect bad / broken config file */ if (!configfile.getInt32("screen_EndX_crt_0", 0) || !configfile.getInt32("screen_EndY_crt_0", 0) || @@ -327,10 +328,11 @@ int CNeutrinoApp::loadSetup(const char * fname) !configfile.getInt32("screen_EndY_lcd_0", 0)) { printf("[neutrino] config file %s is broken, using defaults\n", fname); configfile.clear(); - } else { + } else +#endif migrateConfig(fname); - } } + parentallocked = !access(NEUTRINO_PARENTALLOCKED_FILE, R_OK); //theme/color options From 263b17c1de49f84bf57ec4b318eccf1da9d47d18 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 15 Feb 2017 08:48:38 +0100 Subject: [PATCH 011/394] neutrino: small code cosmetics in loadSetup() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d457cc8ef51c5a1157164f0b92f37def614311ff Author: vanhofen Date: 2017-02-15 (Wed, 15 Feb 2017) Origin message was: ------------------ - neutrino: small code cosmetics in loadSetup() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 43cda6fa9..095bcf06c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -315,11 +315,14 @@ int CNeutrinoApp::loadSetup(const char * fname) int erg = 0; configfile.clear(); - //settings laden - und dabei Defaults setzen! - if(!configfile.loadConfig(fname)) { - //file existiert nicht + // load settings; setup defaults + if (!configfile.loadConfig(fname)) + { + // file doesn't exist erg = 1; - } else { + } + else + { #if 0 /* try to detect bad / broken config file */ if (!configfile.getInt32("screen_EndX_crt_0", 0) || From 07b0dd6c9b0762bf24050590788562d34254474d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 15 Feb 2017 20:23:31 +0100 Subject: [PATCH 012/394] tuxtxt: Fix display in 1280x720 mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/979bac14f0cf7b4ed4783215422a112a832aac8a Author: Michael Liebmann Date: 2017-02-15 (Wed, 15 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index dc7d5a7c5..c20e12cf5 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5621,7 +5621,17 @@ void CopyBB2FB() #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, 0, true); #else - memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); + if ((uint32_t)stride > var_screeninfo.xres) { + fb_pixel_t *lfb_ = lfb; + fb_pixel_t *lbb_ = lbb; + for (uint32_t i1 = 0; i1 < var_screeninfo.yres; i1++) { + memcpy(lfb_, lbb_, var_screeninfo.xres * sizeof(fb_pixel_t)); + lfb_ += stride; + lbb_ += stride; + } + } + else + memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); #endif #endif From 22c66526daaef7534b272dba039f884e94fa51b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 013/394] framebuffer: rename scaleFont() to scale2Res() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e631c3e3c0853c9e9978395ffe6ef2700fe47595 Author: vanhofen Date: 2017-02-19 (Sun, 19 Feb 2017) Origin message was: ------------------ - framebuffer: rename scaleFont() to scale2Res() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel.h | 2 +- src/driver/fb_accel_cs_hd2.cpp | 7 ++++++- src/driver/fb_generic.h | 2 +- src/driver/neutrinofonts.cpp | 4 ++-- src/gui/infoclock.cpp | 2 +- src/gui/volumebar.cpp | 6 +++--- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 40ef3863a..03eac764c 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -129,7 +129,7 @@ class CFbAccelCSHD2 fb_pixel_t * getBackBufferPointer() const; void setBlendMode(uint8_t); void setBlendLevel(int); - int scaleFont(int size); + int scale2Res(int size); bool fullHdAvailable(); void setOsdResolutions(); uint32_t getWidth4FB_HW_ACC(const uint32_t x, const uint32_t w, const bool max=true); diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index b6d9be87f..cf229002b 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -290,8 +290,13 @@ void CFbAccelCSHD2::setBlendLevel(int level) usleep(20000); } -int CFbAccelCSHD2::scaleFont(int size) +int CFbAccelCSHD2::scale2Res(int size) { + /* + The historic resolution 1280x720 is default for some values/sizes. + So let's scale these values to other resolutions. + */ + if (screeninfo.xres == 1920) size += size/2; diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 291bb9af0..b9f0be111 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -277,7 +277,7 @@ class CFrameBuffer : public sigc::trackable virtual void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); - virtual int scaleFont(int size) { return size; }; + virtual int scale2Res(int size) { return size; }; virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); std::vector osd_resolutions; diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 6bbe1e912..d5da1827d 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -180,7 +180,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - fontSize = CFrameBuffer::getInstance()->scaleFont(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; + fontSize = CFrameBuffer::getInstance()->scale2Res(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; #else fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; #endif @@ -188,7 +188,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) } if (g_SignalFont) delete g_SignalFont; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - fontSize = CFrameBuffer::getInstance()->scaleFont(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; + fontSize = CFrameBuffer::getInstance()->scale2Res(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; #else fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; #endif diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index a5c75b7fc..c3f2e7168 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -77,7 +77,7 @@ void CInfoClock::initCCLockItems() //set height, NOTE: height is strictly bound to settings height = g_settings.infoClockFontSize; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scaleFont(height); + height = CFrameBuffer::getInstance()->scale2Res(height); #endif initClockFont(0, height); diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 6ba244f27..6f1f76fe8 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -55,7 +55,7 @@ void CVolumeBar::initVarVolumeBar() vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height #ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scaleFont(height); + height = CFrameBuffer::getInstance()->scale2Res(height); #endif //assume volume value as pointer to global setting @@ -96,7 +96,7 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = 200; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - vb_pbw = CFrameBuffer::getInstance()->scaleFont(vb_pbw); + vb_pbw = CFrameBuffer::getInstance()->scale2Res(vb_pbw); #endif vb_pbh = height-4*vb_item_offset; @@ -370,7 +370,7 @@ void CVolumeHelper::initVolBarSize() g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = g_settings.volume_size; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - vol_height = CFrameBuffer::getInstance()->scaleFont(vol_height); + vol_height = CFrameBuffer::getInstance()->scale2Res(vol_height); #endif if (g_settings.volume_digits) { From bb9e1d06e47d9b0ba76431ea2cadd946a222645d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 014/394] settings.h: scale RADIUS- and OFFSET-defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/726302f945439c5afd20bfe3b07e41661eb4cdf6 Author: vanhofen Date: 2017-02-19 (Sun, 19 Feb 2017) Origin message was: ------------------ - settings.h: scale RADIUS- and OFFSET-defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/system/settings.h b/src/system/settings.h index 3b605f557..48bf18e55 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -906,10 +906,10 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DEFAULT_LCD_AUTODIMM 0x00 #define DEFAULT_LCD_SHOW_VOLUME 0x01 -#define CORNER_RADIUS_LARGE 11 -#define CORNER_RADIUS_MID 7 -#define CORNER_RADIUS_SMALL 5 -#define CORNER_RADIUS_MIN 3 +#define CORNER_RADIUS_LARGE CFrameBuffer::getInstance()->scale2Res(11) +#define CORNER_RADIUS_MID CFrameBuffer::getInstance()->scale2Res(7) +#define CORNER_RADIUS_SMALL CFrameBuffer::getInstance()->scale2Res(5) +#define CORNER_RADIUS_MIN CFrameBuffer::getInstance()->scale2Res(3) #define CORNER_RADIUS_NONE 0 #define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : 0) @@ -919,12 +919,12 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define RADIUS_NONE 0 // offsets -#define OFFSET_SHADOW 6 -#define OFFSET_INTER 6 -#define OFFSET_INNER_LARGE 20 -#define OFFSET_INNER_MID 10 -#define OFFSET_INNER_SMALL 5 -#define OFFSET_INNER_MIN 2 +#define OFFSET_SHADOW CFrameBuffer::getInstance()->scale2Res(6) +#define OFFSET_INTER CFrameBuffer::getInstance()->scale2Res(6) +#define OFFSET_INNER_LARGE CFrameBuffer::getInstance()->scale2Res(20) +#define OFFSET_INNER_MID CFrameBuffer::getInstance()->scale2Res(10) +#define OFFSET_INNER_SMALL CFrameBuffer::getInstance()->scale2Res(5) +#define OFFSET_INNER_MIN CFrameBuffer::getInstance()->scale2Res(2) #define OFFSET_INNER_NONE 0 #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN From 0b5763033ca94e3898ed0da7068833a93998aa6d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 19 Feb 2017 23:31:46 +0100 Subject: [PATCH 015/394] move ENABLE_CHANGE_OSD_RESOLUTION to scale2Res() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/43dbfed1ba1d645723cdc65ee2b97f8430316287 Author: vanhofen Date: 2017-02-19 (Sun, 19 Feb 2017) Origin message was: ------------------ - move ENABLE_CHANGE_OSD_RESOLUTION to scale2Res() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd2.cpp | 2 ++ src/driver/neutrinofonts.cpp | 8 -------- src/gui/infoclock.cpp | 5 +---- src/gui/volumebar.cpp | 15 +++------------ 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index cf229002b..28f33d2c1 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -297,8 +297,10 @@ int CFbAccelCSHD2::scale2Res(int size) So let's scale these values to other resolutions. */ +#ifdef ENABLE_CHANGE_OSD_RESOLUTION if (screeninfo.xres == 1920) size += size/2; +#endif return size; } diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index d5da1827d..3f35a75ca 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -179,19 +179,11 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) int fontSize; for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; -#ifdef ENABLE_CHANGE_OSD_RESOLUTION fontSize = CFrameBuffer::getInstance()->scale2Res(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; -#else - fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; -#endif g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), fontSize); } if (g_SignalFont) delete g_SignalFont; -#ifdef ENABLE_CHANGE_OSD_RESOLUTION fontSize = CFrameBuffer::getInstance()->scale2Res(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; -#else - fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; -#endif g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize); } diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index c3f2e7168..5e770faac 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -75,10 +75,7 @@ void CInfoClock::initCCLockItems() setClockFormat("%H:%M", "%H %M"); //set height, NOTE: height is strictly bound to settings - height = g_settings.infoClockFontSize; -#ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scale2Res(height); -#endif + height = CFrameBuffer::getInstance()->scale2Res(g_settings.infoClockFontSize); initClockFont(0, height); // set corner radius depending on clock height diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 6f1f76fe8..1c79b22fa 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -53,10 +53,7 @@ void CVolumeBar::initVarVolumeBar() col_body = COL_MENUCONTENT_PLUS_0; corner_rad = CORNER_RADIUS_MID; vb_item_offset = OFFSET_INNER_SMALL; - height = g_settings.volume_size; //default height -#ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scale2Res(height); -#endif + height = CFrameBuffer::getInstance()->scale2Res(g_settings.volume_size); //assume volume value as pointer to global setting vb_vol = &g_settings.current_volume; @@ -94,10 +91,7 @@ void CVolumeBar::initVolumeBarSize() //vb_digit_w += corner_rad/2; //scale - vb_pbw = 200; -#ifdef ENABLE_CHANGE_OSD_RESOLUTION - vb_pbw = CFrameBuffer::getInstance()->scale2Res(vb_pbw); -#endif + vb_pbw = CFrameBuffer::getInstance()->scale2Res(200); vb_pbh = height-4*vb_item_offset; //result for width @@ -368,10 +362,7 @@ void CVolumeHelper::initVolBarSize() icon_height += 2; icon_width += 8; g_settings.volume_size = max(g_settings.volume_size, icon_height); - vol_height = g_settings.volume_size; -#ifdef ENABLE_CHANGE_OSD_RESOLUTION - vol_height = CFrameBuffer::getInstance()->scale2Res(vol_height); -#endif + vol_height = CFrameBuffer::getInstance()->scale2Res(g_settings.volume_size); if (g_settings.volume_digits) { CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance(); From cd669c5a78b14d90f9b1bc131622d2402298a215 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:23:00 +0100 Subject: [PATCH 016/394] CProgressWindow: add overloaded constructor with string arg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5049b69c3fdfec18e4eea04d3b441bfca9063c56 Author: Thilo Graf Date: 2017-02-15 (Wed, 15 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 11 +++++++++++ src/gui/widget/progresswindow.h | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 84c74e15d..77782d65c 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -57,6 +57,17 @@ CProgressWindow::CProgressWindow(const neutrino_locale_t title, Init(statusSignal, localSignal, globalSignal); } +CProgressWindow::CProgressWindow(const std::string &title, + const int &dx, + const int &dy, + signal *statusSignal, + signal *localSignal, + signal *globalSignal) + : CComponentsWindow(0, 0, dx, dy, title, NEUTRINO_ICON_INFO, NULL, CC_SHADOW_ON) +{ + Init(statusSignal, localSignal, globalSignal); +} + void CProgressWindow::Init( signal *statusSignal, signal *localSignal, signal *globalSignal) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 811b5714a..30f6f485b 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -150,6 +150,19 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); + /**CProgressWindow Constructor + * @param[in] title + * @li expects type std::string as window title + * + * @see For other arguments and examples, see related constructor(s) + */ + CProgressWindow(const std::string &title, + const int &dx = 700, + const int &dy = 200, + sigc::signal *status_Signal = NULL, + sigc::signal *localSignal = NULL, + sigc::signal *globalSignal = NULL); + /**Sets titel of window * @param[in] title * @li expects type neutrino_locale_t as window title From 660010a1f710de10112288cfb8fea4590246428b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:35:20 +0100 Subject: [PATCH 017/394] CTestMenu: ad samples for progress window Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b250ae6b9d906dcc711cb1df2c3ba6be5e4d6932 Author: Thilo Graf Date: 2017-02-15 (Wed, 15 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 060e7858b..54f6af3e4 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -836,6 +837,26 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } return res; } + else if (actionKey == "progress_window"){ + CProgressWindow progress0("Progress Single Test"); + progress0.paint(); + size_t max = 10; + for(size_t i = 0; i< max; i++){ + progress0.showStatus(i, max, to_string(i)); + sleep(1); + } + progress0.hide(); + + CProgressWindow progress1("Progress Local/Global Test"); + progress1.paint(); + for(size_t i = 0; i< max; i++){ + progress1.showLocalStatus(i, max, to_string(i)); + progress1.showGlobalStatus(i, max, to_string(i)); + sleep(1); + } + progress1.hide(); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "hintbox_test") { ShowHint("Testmenu: Hintbox popup test", "Test for HintBox,\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT); @@ -1080,6 +1101,7 @@ int CTestMenu::showTestMenu() void CTestMenu::showCCTests(CMenuWidget *widget) { widget->addIntroItems(); + widget->addItem(new CMenuForwarder("Progress Window", true, NULL, this, "progress_window")); widget->addItem(new CMenuForwarder("Running Clock", true, NULL, this, "running_clock")); widget->addItem(new CMenuForwarder("Clock", true, NULL, this, "clock")); widget->addItem(new CMenuForwarder("Button", true, NULL, this, "button")); From 47af4bedda5570ad1034d89340b1f236a70e5c7e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 16 Feb 2017 10:57:08 +0100 Subject: [PATCH 018/394] CProgressWindow: encapsulate show methodes, add dimension defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7339d3dd03179358e79c50c06edcd38105de51f6 Author: Thilo Graf Date: 2017-02-16 (Thu, 16 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 96 ++++++++++++++----------------- src/gui/widget/progresswindow.h | 19 +++--- 2 files changed, 54 insertions(+), 61 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 77782d65c..59c95c74b 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -82,54 +82,52 @@ void CProgressWindow::Init( signal *statusSignal, global_progress = local_progress = 100; showFooter(false); - shadow = true; - - int x_item = 10; - int y_item = 10; - - int w_item = width-2*x_item; - int h_item = 14; - int h_pbar = 20; - w_bar_frame = 0; //create status text object status_txt = new CComponentsLabel(); - int h_txt = max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), h_item); - status_txt->setDimensionsAll(x_item, y_item, w_item, h_txt); + status_txt->setDimensionsAll(OFFSET_INNER_MID, OFFSET_INNER_MID, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); status_txt->setColorBody(col_body); status_txt->doPaintTextBoxBg(true); status_txt->doPaintBg(false); addWindowItem(status_txt); - y_item += h_txt + 10; //create local_bar object - local_bar = new CProgressBar(); - local_bar->allowPaint(false); - local_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar); - local_bar->setColorBody(col_body); - local_bar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); - local_bar->setFrameThickness(w_bar_frame); - local_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); - addWindowItem(local_bar); - y_item += 2*h_pbar; + local_bar = InitProgressItem(); //create global_bar object - global_bar = new CProgressBar(); - global_bar->allowPaint(false); - global_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar); - global_bar->setColorBody(col_body); - global_bar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); - global_bar->setFrameThickness(w_bar_frame); - global_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); - addWindowItem(global_bar); - y_item += 2*h_pbar; + global_bar = InitProgressItem(); + //set window height h_height = ccw_head->getHeight(); - height = max(height, y_item + h_height); + ccw_body->setHeight((OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight())*ccw_body->size()); + height = max(height, ccw_body->getHeight() + h_height); + + //set position on screen setCenterPos(); } +CProgressBar* CProgressWindow::InitProgressItem() +{ + CProgressBar *pBar = new CProgressBar(); + pBar->allowPaint(false); + int y_tmp = 0; + for(size_t i = 0; i< ccw_body->size(); i++){ + y_tmp += ccw_body->getCCItem(i)->getHeight(); + y_tmp += OFFSET_INNER_MID; + } + pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); + pBar->setColorBody(col_body); + pBar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); + pBar->setFrameThickness(1); + pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); + addWindowItem(pBar); + + ccw_body->setHeight(y_tmp+OFFSET_INNER_MID); + + return pBar; +} + void CProgressWindow::setTitle(const neutrino_locale_t title) { setWindowCaption(title); @@ -155,36 +153,31 @@ void CProgressWindow::fitItems() return; for(size_t i=0; isize() ;i++){ - int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - 10; + int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; ccw_body->getCCItem(i)->setYPos(y_item); } } +void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) +{ + pBar->allowPaint(true); + pBar->setValues(prog, (int)max); + if (!statusText.empty()) + showStatusMessageUTF(statusText); + pBar->paint(false); +} + void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - if (global_progress == prog) - return; - - if (!global_bar->isPainted()){ - int g_height = global_bar->getHeight(); - global_bar->setYPos(local_bar->getYPos() + g_height/2); - global_bar->setHeight(g_height + g_height/2); - } - - showGlobalStatus(prog, max, statusText); + showLocalStatus(prog, max, statusText); } void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { if (global_progress == prog) return; - - global_bar->allowPaint(true); global_progress = prog; - global_bar->setValues(prog, (int)max); - if (!statusText.empty()) - showStatusMessageUTF(statusText); - global_bar->paint(false); + initStatus(prog, max, statusText, global_bar); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(-1,NULL,global_progress); @@ -195,13 +188,8 @@ void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned in { if (local_progress == prog) return; - - local_bar->allowPaint(true); local_progress = prog; - local_bar->setValues(prog, (int)max); - if (!statusText.empty()) - showStatusMessageUTF(statusText); - local_bar->paint(false); + initStatus(prog, max, statusText, local_bar); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(local_progress); diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 30f6f485b..2b8d443b3 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,6 +28,9 @@ #include #include "menue.h" +#define PW_MIN_WIDTH 700 +#define PW_MIN_HEIGHT 100 + class CProgressWindow : public CComponentsWindow, public CMenuTarget { private: @@ -36,11 +39,13 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; - int w_bar_frame; int h_height; void Init( sigc::signal *statusSignal, sigc::signal *localSignal, sigc::signal *globalSignal); + + CProgressBar* InitProgressItem(); + void initStatus(const unsigned int prog, const unsigned int max, const std::string &statusText, CProgressBar *pBar); void fitItems(); public: @@ -131,8 +136,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * Don't use status_Signal at same time with localSignal and globalSignal. In This case please set status_Signal = NULL */ CProgressWindow(CComponentsForm *parent = NULL, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); @@ -144,8 +149,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * @see For other arguments and examples, see related constructor(s) */ CProgressWindow(const neutrino_locale_t title, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); @@ -157,8 +162,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * @see For other arguments and examples, see related constructor(s) */ CProgressWindow(const std::string &title, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); From ae237935c33e2f92d0671b1f2e13cfb0ba21f7c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:11:34 +0100 Subject: [PATCH 019/394] CProgressWindow: move some methodes for more clarity Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d3e5f4fd2b6beb5b29c8773dc8ea657fd02cf59 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 59c95c74b..ad26a2a53 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -128,36 +128,6 @@ CProgressBar* CProgressWindow::InitProgressItem() return pBar; } -void CProgressWindow::setTitle(const neutrino_locale_t title) -{ - setWindowCaption(title); - -#ifdef VFD_UPDATE - CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD -#endif // VFD_UPDATE -} - -void CProgressWindow::setTitle(const string & title) -{ - setWindowCaption(title); - -#ifdef VFD_UPDATE - CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD -#endif // VFD_UPDATE -} - -//if header is disabled we need new position for body items -void CProgressWindow::fitItems() -{ - if (ccw_show_header) - return; - - for(size_t i=0; isize() ;i++){ - int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; - ccw_body->getCCItem(i)->setYPos(y_item); - } -} - void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); @@ -239,3 +209,33 @@ void CProgressWindow::paint(bool do_save_bg) fitItems(); CComponentsWindow::paint(do_save_bg); } + +void CProgressWindow::setTitle(const neutrino_locale_t title) +{ + setWindowCaption(title); + +#ifdef VFD_UPDATE + CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD +#endif // VFD_UPDATE +} + +void CProgressWindow::setTitle(const string & title) +{ + setWindowCaption(title); + +#ifdef VFD_UPDATE + CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD +#endif // VFD_UPDATE +} + +//if header is disabled we need new position for body items +void CProgressWindow::fitItems() +{ + if (ccw_show_header) + return; + + for(size_t i=0; isize() ;i++){ + int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; + ccw_body->getCCItem(i)->setYPos(y_item); + } +} \ No newline at end of file From c340ab499b6b2869631748d90ee62027ed6b63bf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:13:12 +0100 Subject: [PATCH 020/394] CProgressWindow: rename InitProgressItem -> getProgressItem more plausible Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0281b7e8c7243346c1aac3ddb0345a53de104cee Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 6 +++--- src/gui/widget/progresswindow.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index ad26a2a53..490b1396e 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -92,10 +92,10 @@ void CProgressWindow::Init( signal *statusSignal, addWindowItem(status_txt); //create local_bar object - local_bar = InitProgressItem(); + local_bar = getProgressItem(); //create global_bar object - global_bar = InitProgressItem(); + global_bar = getProgressItem(); //set window height h_height = ccw_head->getHeight(); @@ -107,7 +107,7 @@ void CProgressWindow::Init( signal *statusSignal, setCenterPos(); } -CProgressBar* CProgressWindow::InitProgressItem() +CProgressBar* CProgressWindow::getProgressItem() { CProgressBar *pBar = new CProgressBar(); pBar->allowPaint(false); diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 2b8d443b3..c50d8840d 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -44,7 +44,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal, sigc::signal *globalSignal); - CProgressBar* InitProgressItem(); + CProgressBar* getProgressItem(); void initStatus(const unsigned int prog, const unsigned int max, const std::string &statusText, CProgressBar *pBar); void fitItems(); From 03c524653940cbad2e31dbe1589051002b1cf869 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:19:32 +0100 Subject: [PATCH 021/394] CProgressWindow: small cosmetic Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e6997e3af83be3bcb1a8d1769a0db3783884d51 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 490b1396e..e2c077f30 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -69,7 +69,7 @@ CProgressWindow::CProgressWindow(const std::string &title, } void CProgressWindow::Init( signal *statusSignal, - signal *localSignal, + signal *localSignal, signal *globalSignal) { if (statusSignal) From 5b83d817c9041b9b5756b944b37a1bd3cd26d730 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:40:48 +0100 Subject: [PATCH 022/394] CTestMenu: add samples for progress window with signals Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42619c8d2cd82ef0b8fdbf110102487e012fedd1 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 47 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 54f6af3e4..2572883ab 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -838,23 +838,50 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "progress_window"){ - CProgressWindow progress0("Progress Single Test"); - progress0.paint(); - size_t max = 10; + //classical + CProgressWindow pw0("Progress Single Test"); + pw0.paint(); + size_t max = 3; for(size_t i = 0; i< max; i++){ - progress0.showStatus(i, max, to_string(i)); + pw0.showStatus(i, max, to_string(i)); sleep(1); } - progress0.hide(); + pw0.hide(); - CProgressWindow progress1("Progress Local/Global Test"); - progress1.paint(); + CProgressWindow pw1("Progress Local/Global Test"); + pw1.paint(); for(size_t i = 0; i< max; i++){ - progress1.showLocalStatus(i, max, to_string(i)); - progress1.showGlobalStatus(i, max, to_string(i)); + pw1.showGlobalStatus(i, max, to_string(i)); + for(size_t j = 0; j< max; j++){ + pw1.showLocalStatus(j, max, to_string(j)); + sleep(1); + } + } + pw1.hide(); + + //with signals + sigc::signal OnProgress0, OnProgress1; + CProgressWindow pw2("Progress Single Test -> single Signal", 700, 200, &OnProgress0); + pw2.paint(); + + for(size_t i = 0; i< max; i++){ + OnProgress0(i, max, to_string(i)); sleep(1); } - progress1.hide(); + pw2.hide(); + + CProgressWindow pw3("Progress Single Test -> dub Signal", 700, 200, NULL, &OnProgress0, &OnProgress1); + pw3.paint(); + + for(size_t i = 0; i< max; i++){ + OnProgress1(i, max, to_string(i)); + for(size_t j = 0; j< max; j++){ + OnProgress0(j, max, to_string(j)); + sleep(1); + } + } + pw3.hide(); + return menu_return::RETURN_REPAINT; } else if (actionKey == "hintbox_test") From 0a18ce9055154eae92b46125b935656e3b2de752 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:25:20 +0100 Subject: [PATCH 023/394] CProgressWindow: syncronize paint of local and global bar on first paint In some cases progress bars were painted with delay. Now it should be looks better. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f478c75e26668d830bb28a4028198bb6c0c1644d Author: Thilo Graf Date: 2017-02-23 (Thu, 23 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index e2c077f30..f80d20de7 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -79,7 +79,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = 100; + global_progress = local_progress = 0; showFooter(false); @@ -144,7 +144,9 @@ void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - if (global_progress == prog) + if (!local_bar->isPainted()) + showLocalStatus(0, 0, statusText); // ensure first paint of local bar on painted global bar at same time + if (global_progress == prog && global_bar->isPainted()) return; global_progress = prog; initStatus(prog, max, statusText, global_bar); @@ -156,7 +158,7 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned i void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - if (local_progress == prog) + if (local_progress == prog && local_bar->isPainted()) return; local_progress = prog; initStatus(prog, max, statusText, local_bar); From 2e9293fdc2323a912a87f08deab7f89420806f1b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:41:35 +0100 Subject: [PATCH 024/394] CMovieBrowser: visualize global loading of defined directories Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e487f28400648b3f08529137a326759d1a3834e Author: Thilo Graf Date: 2017-02-23 (Thu, 23 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 10 ++++++---- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b6d49b888..c28e5ed6c 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2754,7 +2754,7 @@ void CMovieBrowser::updateDir(void) void CMovieBrowser::loadAllTsFileNamesFromStorage(void) { //TRACE("[mb]->loadAllTsFileNamesFromStorage \n"); - int i,size; + size_t i,size; m_movieSelectionHandler = NULL; m_dirNames.clear(); @@ -2765,8 +2765,10 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) size = m_dir.size(); for (i=0; i < size;i++) { - if (*m_dir[i].used == true) + if (*m_dir[i].used == true){ + OnLoadDir(i+1, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); + } } TRACE("[mb] Dir%d, Files:%d\n", (int)m_dirNames.size(), (int)m_vMovieInfo.size()); @@ -2885,7 +2887,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLoadFile(i, flist.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + OnLoadFile(i, flist.size(), dirname ); } //result = true; } @@ -3124,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, 500, 150, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 700, 150, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 3f29afdea..0b37d4c2e 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -363,6 +363,7 @@ class CMovieBrowser : public CMenuTarget bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); sigc::signal OnLoadFile; + sigc::signal OnLoadDir; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. From d1083f05d34f4a1ebcb16ffed2992b821fcd236e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 13:25:50 +0100 Subject: [PATCH 025/394] CComponentsWindow: use percentage conversion for dimension values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dimension values for windows below a certain size are often not really useful, even with regard to different resolutions. Usage of percent values could be easier to handle. In the constructor, the argument values für dimesions must be only between 1 and 100 to achieve this. TODO: behavior inside parents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/055fef8b58f1959a6243be60b2767cc2a0c4deb5 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 80455a5ad..ab0663a2d 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -169,9 +169,13 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; + if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent + width = frameBuffer->getScreenWidth()*width/100; if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); + if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent + height = frameBuffer->getScreenHeight()*height/100; if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } From de9ed22811ca4e05a016e3cddf4c736072faca65 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:53:16 +0100 Subject: [PATCH 026/394] CComponentsWindow: add more tags for doxygen Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b6893ee3454e4fb679bc7795838551b67773e18 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.h | 305 ++++++++++++++++++++++++----- 1 file changed, 256 insertions(+), 49 deletions(-) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 7b2f71796..cb1b5288e 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -128,10 +128,47 @@ class CComponentsWindow : public CComponentsForm { CC_WINDOW_ITEM_HEADER = 0 }; - ///simple constructor for CComponentsWindow, this shows a window over full screen + + enum + { + CC_WINDOW_LEFT_SIDEBAR = 1, + CC_WINDOW_RIGHT_SIDEBAR = 2 + }; + + /**simple constructor for CComponentsWindow, this shows a window over full screen + * @param[in] parent + * @li optional: expects type CComponentsForm * as possible parent object, default = NULL + */ CComponentsWindow(CComponentsForm *parent = NULL); - ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption as string, x_pos or y_pos = 0 will center window + /** + * advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption as string, x_pos or y_pos = 0 will center window + * @param[in] x_pos + * @li expects type const &int, defines x position on screen + * @param[in] y_pos + * @li expects type const &int, defines y position on screen + * @param[in] w + * @li expects type const &int, width of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @param[in] h + * @li expects type const &int, height of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @param[in] caption + * @li optional: expects type const std::string&, defines title of window header + * @param[in] iconname + * @li optional: expects type const std::string&, defines icon name of window header + * @param[in] parent + * @li optional: expects type CComponentsForm * as possible parent object, default = NULL + * @param[in] shadow_mode + * @li optional: expects type int as mode, default = CC_SHADOW_OFF + * possible values are + * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) + * @see cc_types.h + * @param[in] color_frame + * @li optional: expects type fb_pixel_t, defines frame color, default = COL_FRAME_PLUS_0 + * @param[in] color_body + * @li optional: expects type fb_pixel_t, defines color color, default = COL_MENUCONTENT_PLUS_0 + * @param[in] color_shadow + * @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0 + */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption = "", const std::string& iconname = "", @@ -141,7 +178,12 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption from locales, x_pos or y_pos = 0 will center window + /** + * advanced constructor for CComponentsWindow, provides parameters for the most required properties + * @param[in] locale_text + * @li optional: expects type neutrino_locale_t, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& iconname = "", @@ -151,90 +193,249 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///add item to body object, also usable is addCCItem() to add items to the windo object + /** + * Add an item to body object, also usable is addCCItem() to add items to the window object + * @param[in] cc_Item + * @li expects type CComponentsItem* , defines a cc item + * @return Returns item ID + * @see Take a look to cc_types.h for possible types. + */ int addWindowItem(CComponentsItem* cc_Item); - ///allow/disallow paint a footer, default true, see also ccw_show_footer, showHeader() - void showFooter(bool show = true){ccw_show_footer = show; initCCWItems();}; - ///allow/disallow paint a header, default true, see also ccw_show_header, showFooter() - void showHeader(bool show = true){ccw_show_header = show; initCCWItems();}; + /** + * enable/disable paint of footer, default true + * @param[in] show + * @li expects type bool, default = true + * @see ccw_show_footer, showHeader() + */ + void showFooter(bool show = true){ccw_show_footer = show; initCCWItems();} - enum - { - CC_WINDOW_LEFT_SIDEBAR = 1, - CC_WINDOW_RIGHT_SIDEBAR = 2 - }; - ///allow/disallow paint a sidebar, default are enabled + /** + * enable/disable paint of header, default true + * @param[in] show + * @li expects type bool, default = true + * @see ccw_show_header, showFooter() + */ + void showHeader(bool show = true){ccw_show_header = show; initCCWItems();} + + /** + * enable/disable paint of sidebar, + * @param[in] show + * @li optional: expects type const int&, default = enabled + */ void enableSidebar(const int& sidbar_type = CC_WINDOW_LEFT_SIDEBAR | CC_WINDOW_RIGHT_SIDEBAR); - ///set caption in header with string, see also getHeaderObject() + /** + * sets title text in header + * @param[in] text + * @li expects type const std::string&, defines title of window header + * @param[in] align_mode + * @li optional: expects type const int&, defines allignment of title text + * @see CTextBox for alignment modes + */ void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;} - ///set header text color - void setWindowHeaderTextColor(const fb_pixel_t& color){ccw_col_head_text = color;} - ///set background to header - void setWindowHeaderColor(const fb_pixel_t& color){ccw_col_head = color;} - ///set caption in header from locales, see also getHeaderObject() + + /** + * sets title text in header + * @param[in] text + * @li expects type neutrino_locale_t + * @param[in] align_mode + * @li optional: expects type const int&, defines allignment of title text + * @see CTextBox for alignment modes + */ void setWindowCaption(neutrino_locale_t locale_text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); - ///set caption alignment, see CTextBox for possible modes + + /** + * Sets header text color + * @param[in] const fb_pixel_t& + * @li expects type const fb_pixel_t& + */ + void setWindowHeaderTextColor(const fb_pixel_t& color){ccw_col_head_text = color;} + + /** + * Sets header background color + * @param[in] const fb_pixel_t& + * @li expects type const fb_pixel_t& + */ + void setWindowHeaderColor(const fb_pixel_t& color){ccw_col_head = color;} + + /** + * sets title text alignment + * @param[in] align_mode + * @li expects type const int& + * @see CTextBox for alignment modes + */ void setWindowCaptionAlignment(const int& align_mode){ccw_align_mode = align_mode;}; - ///set icon name in header, see also getHeaderObject() + /** + * Sets icon name of window header. + * @param[in] iconname + * @li expects type const std::string& + */ void setWindowIcon(const std::string& iconname){ccw_icon_name = iconname; initHeader();}; ///set default header icon buttons, see also getHeaderObject() - void setWindowHeaderButtons(const int& buttons){ccw_buttons = buttons;}; + /** + * Sets context buttons in window header. + * @param[in] buttons + * @li expects type const int& + * @note possible types are: + * CC_BTN_HELP, + CC_BTN_INFO, + CC_BTN_MENU, + CC_BTN_EXIT, + CC_BTN_MUTE_ZAP_ACTIVE, + CC_BTN_MUTE_ZAP_INACTIVE, + CC_BTN_OKAY, + CC_BTN_MUTE, + CC_BTN_UP, + CC_BTN_DOWN, + CC_BTN_LEFT, + CC_BTN_RIGHT, + CC_BTN_FORWARD, + CC_BTN_BACKWARD, + CC_BTN_PAUSE, + CC_BTN_PLAY, + CC_BTN_RECORD_ACTIVE, + CC_BTN_RECORD_INACTIVE, + CC_BTN_RECORD_STOP, + * @see cc_frm_header.h for current types + */ + void setWindowHeaderButtons(const int& buttons){ccw_buttons = buttons;} - ///returns a pointer to the internal header object, use this to get access to header properities - CComponentsHeader* getHeaderObject(){return ccw_head;}; + /** + * Gets a pointer to the internal header object, use this to get direct access to header properities + * @return CComponentsHeader* + */ + CComponentsHeader* getHeaderObject(){return ccw_head;} - ///returns a pointer to the internal body object, use this to get access to body properities - CComponentsForm* getBodyObject(){return ccw_body;}; - ///returns a pointer to the internal footer object, use this to get access to footer properities - CComponentsFooter* getFooterObject(){return ccw_footer;}; + /** + * Gets a pointer to the internal body object, use this to get access to body properities + * @return CComponentsForm* + */ + CComponentsForm* getBodyObject(){return ccw_body;} - ///set background to footer + /** + * Gets a pointer to the internal footer object, use this to get access to footer properities + * @return CComponentsFooter* + */ + CComponentsFooter* getFooterObject(){return ccw_footer;} + + /** + * Sets footer background color + * @param[in] color + * @li expects type const fb_pixel_t& + */ void setWindowFooterColor(const fb_pixel_t& color){ccw_col_footer = color;} - ///set font for footer buttons + + /** + * Sets font for footer buttons + * @param[in] font_type + * @li expects type Font* + */ void setWindowFooterFont(Font* font_type){ccw_button_font = font_type;} - ///returns a pointer to the internal left side bar object, use this to get access to left sidebar properities - CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; - ///returns a pointer to the internal right side bar object, use this to get access to right sidebar properities - CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;}; - ///sets width of sidebars - void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();}; + /** + * Gets a pointer to the internal left side bar object, use this to get access to left sidebar properities + * @return CComponentsFrmChain* + */ + CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;} - ///sets current page, NOTE: this is simliar with setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + /** + * Gets a pointer to the internal right side bar object, use this to get access to right sidebar properities + * @return CComponentsFrmChain* + */ + CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;} + + /** + * Sets width of sidebars + * @param[in] sidebar_width + * @li expects type const int& + */ + void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();} + + /** + * Sets current page number + * @param[in] sidebar_width + * @li expects type const int& + * @note This is simliar to setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object. + */ void setCurrentPage(const u_int8_t& current_page); - ///get current page, NOTE: this is simliar with getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + + /** + * Gets current page number + * @return CComponentsFrmChain* + * @note This simliar to getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + */ u_int8_t getCurrentPage(); - ///paint window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage() + /** + * Paints window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage() + * @param[in] do_save_bg + * @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode + */ void paintCurPage(bool do_save_bg = CC_SAVE_SCREEN_NO); - ///paint defined page of body, parameter number 0...n + + /** + * Paints defined page of body, parameter number 0...n + * @param[in] page_number + * @li expects type const u_int8_t& as page number + * @param[in] do_save_bg + * @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode + */ void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO); - ///enable/disable page scroll, parameter1 default enabled for up/down keys, only for body! + + /** + * enable/disable page scroll + * @param[in] mode + * @li optional: expects type const int&, default enabled for up/down keys, only for body! + */ void enablePageScroll(const int& mode = PG_SCROLL_M_UP_DOWN_KEY); - ///set width of body scrollbar + /** + * Sets width of body scrollbar + * @param[in] crollbar_width + * @li expects type const int& + */ void setScrollBarWidth(const int& scrollbar_width); - ///refresh position and dimension and reinitialize elemenatary properties + /** + * Reinit position and dimensions and reinitialize mostly elemenatary properties + */ void Refresh(){initCCWItems();}; - ///paint all window items, this overwriting paint() from CComponentsForm + /** + * Paint window + * @param[in] do_save_bg + * @li optional: expects type bool, sets background save mode + */ void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - ///adds additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + /** + * Adds an additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + * @param[in] key + * @li expects type const neutrino_msg_t& + * @see river/rcinput.h for possible keys + */ virtual void addExitKey(const neutrino_msg_t& key){getBodyObject()->addExitKey(key);} - ///remove all current exec keys from current collection, NOTE: use addExitKey() if new exec key is required + + /** + * Removes all current exec keys from current collection. + * @note use addExitKey() if new exec key is required + */ virtual void removeExitKeys(){getBodyObject()->removeExitKeys();} }; class CComponentsWindowMax : public CComponentsWindow { public: - ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, this shows a centered window based up current screen settings + /** + * Simple constructor for CComponentsWindow, this shows only a centered window based up current screen settings + * @see for other parameters take a look to CComponentsWindow base class above + * @param[in] caption + * @li expects type const std::string&, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindowMax( const std::string& caption, const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -242,7 +443,13 @@ class CComponentsWindowMax : public CComponentsWindow fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings + /** + * Simple constructor for CComponentsWindow, this shows only a centered window based up current screen settings + * @see for other parameters take a look to CComponentsWindow base class above + * @param[in] locale_text + * @li expects type neutrino_locale_t, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, From 259ace12c277a20dd09a57ba6e143af026b57693 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:58:16 +0100 Subject: [PATCH 027/394] CMovieBrowser: use percental calculated dimensions for progress window Useful for possible for different screen resolutions. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11d8be5307342bdce81dd4ea6c868171566da716 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c28e5ed6c..72268adc4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 700, 150, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 50/*%*/, 25/*%*/, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); From 7696395d2222cf8ba19ecad288248f3a2eac303b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 22:09:28 +0100 Subject: [PATCH 028/394] CProgressWindow: use percental calculated dimensions as default Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed9edb5dada875be176ce53ea09804f692972aea Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 2 -- src/gui/widget/progresswindow.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index f80d20de7..f8262f972 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -123,8 +123,6 @@ CProgressBar* CProgressWindow::getProgressItem() pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); addWindowItem(pBar); - ccw_body->setHeight(y_tmp+OFFSET_INNER_MID); - return pBar; } diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index c50d8840d..10624dea8 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,8 +28,8 @@ #include #include "menue.h" -#define PW_MIN_WIDTH 700 -#define PW_MIN_HEIGHT 100 +#define PW_MIN_WIDTH 50 //% +#define PW_MIN_HEIGHT 25 //% class CProgressWindow : public CComponentsWindow, public CMenuTarget { From 8bf3e6c5b7b49880ef1b4e1a35bb542db3d27051 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 23:13:30 +0100 Subject: [PATCH 029/394] hintbox.h: use calculated dimensions as default Useful for possible different screen resolutions. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/85fc37090e633f6efbbf137928208c77842786e8 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 187752286..e7261babf 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -32,9 +32,10 @@ #include -#define HINTBOX_MIN_WIDTH 320 -#define HINTBOX_MIN_HEIGHT 125 -#define HINTBOX_MAX_HEIGHT 520 +#define HINTBOX_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(320) +#define HINTBOX_MIN_HEIGHT CFrameBuffer::getInstance()->scale2Res(125) +#define HINTBOX_MAX_HEIGHT CFrameBuffer::getInstance()->scale2Res(520) + #define HINTBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_POPUP_MESSAGES] #define NO_TIMEOUT 0 #define DEFAULT_TIMEOUT -1 From 554118ac6500a1c6d7bcabaa99ab5d876558c5e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:57:22 +0100 Subject: [PATCH 030/394] CBuildInfo: use percental calculated dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/04ba522dab3883148a0940a0e21c55b0f48db66e Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 23f81f85b..50b480964 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,7 +35,7 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 90/*%*/, 90/*%*/, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) From 874b3bc88679a5afd708db877733c7c1978bf17a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:58:31 +0100 Subject: [PATCH 031/394] CTextBox: use scaled base dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6b4e57ad73b377a9740c776f48d04439cd64d66a Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index f8ed60af4..b7fe4eccd 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -68,14 +68,14 @@ #endif #include -#define SCROLL_FRAME_WIDTH 10 -#define SCROLL_MARKER_BORDER 2 +#define SCROLL_FRAME_WIDTH SCROLLBAR_WIDTH +#define SCROLL_MARKER_BORDER OFFSET_INNER_MIN -#define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX - 40) -#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40) +#define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX - CFrameBuffer::getInstance()->scale2Res(40)) +#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - CFrameBuffer::getInstance()->scale2Res(40)) #define MIN_WINDOW_WIDTH ((g_settings.screen_EndX - g_settings.screen_StartX)>>1) -#define MIN_WINDOW_HEIGHT 40 +#define MIN_WINDOW_HEIGHT CFrameBuffer::getInstance()->scale2Res(40) CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, const CBox* position, CFBWindow::color_t textBackgroundColor) From 8805626dbc84e949ae7d98a890c04aac3846509a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 14:40:18 +0100 Subject: [PATCH 032/394] CHintBox: fix passed width parameter Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/820ea4db3b9ff3af13c2df962dd391c96afba875 Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 45ef2b6ed..ff62b35a7 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -67,7 +67,7 @@ CHintBox::CHintBox( const neutrino_locale_t Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent): CComponentsWindow( 0, 0, width, + const int& indent): CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -84,7 +84,7 @@ CHintBox::CHintBox( const char * const Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -101,7 +101,7 @@ CHintBox::CHintBox( const neutrino_locale_t Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -118,7 +118,7 @@ CHintBox::CHintBox( const char * const Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), From 1a3ef52004950d394e2ea4665452fba78b6a8b85 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 17:32:52 +0100 Subject: [PATCH 033/394] CHintBox: use OFFSET_INNER_MID as defaul value for W_RAME Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17a9c691dacc7421827c63a09995e4905ddbf083 Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index e7261babf..9019228a6 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -40,7 +40,7 @@ #define NO_TIMEOUT 0 #define DEFAULT_TIMEOUT -1 //frame around hint container as indent -#define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 +#define W_FRAME OFFSET_INNER_MID //frame color around hint/message box #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 From 9fecf3d4c5e4b52e47d29a9aee9a91cd55ceb1bd Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 27 Feb 2017 00:13:33 +0100 Subject: [PATCH 034/394] fb_generic: Add "#define SCALE2RES_DEFINED" to check... ...presence of 'CFrameBuffer::scale2Res()' - Revert this patch when pu/fb-setmode branch is merged to master Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1fea75f428d9d70b65d353e58feb31b359691182 Author: Michael Liebmann Date: 2017-02-27 (Mon, 27 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/fb_generic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 37c5a1572..810fcc063 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -278,6 +278,8 @@ class CFrameBuffer : public sigc::trackable virtual void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); +/* Remove this when pu/fb-setmode branch is merged to master */ +#define SCALE2RES_DEFINED virtual int scale2Res(int size) { return size; }; virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); From 788a0d9f3ddecdc7020ac57e1e75beb1b023f287 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 035/394] osd resolution: Add src/gui/osd_helpers.cpp - Move switch osd resolution from COsdSetup::changeNotify() to COsdHelpers::changeOsdResolution() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/84b2af00fb86a03df12ae7eb20acf01290d30077 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) Origin message was: ------------------ osd resolution: Add src/gui/osd_helpers.cpp - Move switch osd resolution from COsdSetup::changeNotify() to COsdHelpers::changeOsdResolution() ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 1 + src/gui/osd_helpers.cpp | 183 ++++++++++++++++++++++++++++++++++++++++ src/gui/osd_helpers.h | 29 +++++++ src/gui/osd_setup.cpp | 8 ++ 4 files changed, 221 insertions(+) create mode 100644 src/gui/osd_helpers.cpp create mode 100644 src/gui/osd_helpers.h diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 86a06903f..ce717471c 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -74,6 +74,7 @@ libneutrino_gui_a_SOURCES = \ network_setup.cpp \ nfs.cpp \ opkg_manager.cpp \ + osd_helpers.cpp \ osd_progressbar_setup.cpp \ osd_setup.cpp \ osdlang_setup.cpp \ diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp new file mode 100644 index 000000000..c06563f5a --- /dev/null +++ b/src/gui/osd_helpers.cpp @@ -0,0 +1,183 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +extern CInfoClock *InfoClock; +extern CTimeOSD *FileTimeOSD; +extern cVideo *videoDecoder; + +COsdHelpers::COsdHelpers() +{ + g_settings_osd_resolution_save = 0; +} + +COsdHelpers::~COsdHelpers() +{ +} + +COsdHelpers* COsdHelpers::getInstance() +{ + static COsdHelpers* osdh = NULL; + if(!osdh) + osdh = new COsdHelpers(); + + return osdh; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bool forceOsdReset/*=false*/) +{ + size_t idx = 0; + bool resetOsd = false; + uint32_t modeNew; + + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + + if (automode) { + if (g_settings.video_Mode == VIDEO_STD_AUTO) + modeNew = OSDMODE_1080; + else + modeNew = g_settings_osd_resolution_save; + } + else { + modeNew = mode; + } + + int videoSystem = getVideoSystem(); + if (!isVideoSystem1080(videoSystem)) + modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); + resetOsd = (modeNew != getOsdResolution()) ? true : false; + + if (forceOsdReset) + resetOsd = true; + + if (frameBuffer->fullHdAvailable()) { + if (frameBuffer->osd_resolutions.empty()) + return; + + bool ivVisible = false; + if (g_InfoViewer && g_InfoViewer->is_visible) { + g_InfoViewer->killTitle(); + ivVisible = true; + } + + int switchFB = frameBuffer->setMode(frameBuffer->osd_resolutions[idx].xRes, + frameBuffer->osd_resolutions[idx].yRes, + frameBuffer->osd_resolutions[idx].bpp); + + if (switchFB == 0) { +//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp); + g_settings.osd_resolution = modeNew; + if (InfoClock) + InfoClock->enableInfoClock(false); + frameBuffer->Clear(); + if (resetOsd) { + CNeutrinoApp::getInstance()->setScreenSettings(); + CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); + CVolumeHelper::getInstance()->refresh(); + if (InfoClock) + CInfoClock::getInstance()->ClearDisplay(); + if (FileTimeOSD) + FileTimeOSD->Init(); + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); + } + if (InfoClock) + InfoClock->enableInfoClock(true); + } + if (g_InfoViewer) { + g_InfoViewer->ResetModules(); + g_InfoViewer->start(); + } + if (ivVisible) { + CNeutrinoApp::getInstance()->StopSubtitles(); + g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel(), true, 0, true); + CNeutrinoApp::getInstance()->StartSubtitles(); + } + } +} + +void COsdHelpers::resetOsdResolution(int newSystem) +{ + int videoSystem = getVideoSystem(); + if ((isVideoSystem1080(videoSystem)) && (!isVideoSystem1080(newSystem))) { + CFrameBuffer::getInstance()->setMode(1280, 720, 32); + } +} +#else +void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) +{ +} + +void COsdHelpers::resetOsdResolution(int) +{ +} +#endif + + +int COsdHelpers::isVideoSystem1080(int res) +{ + if ((res == VIDEO_STD_1080I60) || + (res == VIDEO_STD_1080I50) || + (res == VIDEO_STD_1080P30) || + (res == VIDEO_STD_1080P24) || + (res == VIDEO_STD_1080P25)) + return true; + +#ifdef BOXMODEL_CS_HD2 + if ((res == VIDEO_STD_1080P50) || + (res == VIDEO_STD_1080P60) || + (res == VIDEO_STD_1080P2397) || + (res == VIDEO_STD_1080P2997)) + return true; +#endif + +#if 0 + /* for testing only */ + if (res == VIDEO_STD_720P50) + return true; +#endif + + return false; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +int COsdHelpers::getVideoSystem() +{ + return videoDecoder->GetVideoSystem(); +} +#else +int COsdHelpers::getVideoSystem() +{ + return g_settings.video_Mode; +} +#endif + +uint32_t COsdHelpers::getOsdResolution() +{ + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + if (frameBuffer->osd_resolutions.size() == 1) + return 0; + + uint32_t yRes = frameBuffer->getScreenHeight(true); + for (size_t i = 0; i < frameBuffer->osd_resolutions.size(); i++) { + if (frameBuffer->osd_resolutions[i].yRes == yRes) + return frameBuffer->osd_resolutions[i].mode; + } + return 0; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h new file mode 100644 index 000000000..d2c735e50 --- /dev/null +++ b/src/gui/osd_helpers.h @@ -0,0 +1,29 @@ + +#ifndef __osd_helpers__ +#define __osd_helpers__ + +enum { + OSDMODE_720 = 0, + OSDMODE_1080 = 1 +}; + +class COsdHelpers +{ + private: + + public: + COsdHelpers(); + ~COsdHelpers(); + static COsdHelpers* getInstance(); + + int g_settings_osd_resolution_save; + + void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); + void resetOsdResolution(int newSystem); + int isVideoSystem1080(int res); + int getVideoSystem(); + uint32_t getOsdResolution(); +}; + + +#endif //__osd_helpers__ diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 4e5128c67..ad4b6b51e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -39,6 +39,7 @@ #include #include "osd_setup.h" +#include "osd_helpers.h" #include "themes.h" #include "screensetup.h" #include "osdlang_setup.h" @@ -1389,6 +1390,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) #ifdef ENABLE_CHANGE_OSD_RESOLUTION else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION)) { + if (frameBuffer->osd_resolutions.empty()) + return true; + osd_menu->hide(); + uint32_t osd_mode = (uint32_t)*(int*)data; + COsdHelpers::getInstance()->changeOsdResolution(osd_mode, osd_mode); +#if 0 if (frameBuffer->fullHdAvailable()) { if (frameBuffer->osd_resolutions.empty()) return true; @@ -1418,6 +1425,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_InfoViewer->ResetModules(); } } +#endif return true; } #endif From 760a820f7834cd06994839b4e4ae081d78d372e7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 036/394] osd resolution: Add 'mode' to osd_resolution_struct_t - Use COsdSetup::OSDMODE_XXX enums to identify various resolutions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/653e574937874e8d0a0841372dbd9b1cc96462ae Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd1.cpp | 1 + src/driver/fb_accel_cs_hd2.cpp | 2 ++ src/driver/fb_accel_cs_hdx_inc.h | 1 + src/driver/fb_generic.cpp | 14 ++++++++++++++ src/driver/fb_generic.h | 2 ++ 5 files changed, 20 insertions(+) diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index af62fea21..f890cfbcc 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -344,6 +344,7 @@ void CFbAccelCSHD1::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 8a6b42767..0b027ece9 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -215,11 +215,13 @@ void CFbAccelCSHD2::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); if (fullHdAvailable()) { res.xRes = 1920; res.yRes = 1080; res.bpp = 32; + res.mode = OSDMODE_1080; osd_resolutions.push_back(res); } } diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index cd38baa72..da858312e 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index a530b67b8..126146459 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -362,9 +363,22 @@ void CFrameBuffer::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } +size_t CFrameBuffer::getIndexOsdResolution(uint32_t mode) +{ + if (osd_resolutions.size() == 1) + return 0; + + for (size_t i = 0; i < osd_resolutions.size(); i++) { + if (osd_resolutions[i].mode == mode) + return i; + } + return 0; +} + #if 0 //never used void CFrameBuffer::setTransparency( int /*tr*/ ) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 810fcc063..2209e7f2d 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -44,6 +44,7 @@ typedef struct osd_resolution_t uint32_t yRes; uint32_t xRes; uint32_t bpp; + uint32_t mode; } osd_resolution_struct_t; typedef struct gradientData_t @@ -284,6 +285,7 @@ class CFrameBuffer : public sigc::trackable virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); std::vector osd_resolutions; + size_t getIndexOsdResolution(uint32_t mode); enum { From 7329fb62943e7b1f124269f742e9398a31243710 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 037/394] CInfoViewer::showTitle: Add parameter forcePaintButtonBar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc05d272f2af7017d6e41810883fbcfc7989203f Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 11 ++++++----- src/gui/infoviewer.h | 4 ++-- src/gui/infoviewer_bb.cpp | 6 ++++-- src/gui/infoviewer_bb.h | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c32a4e9e2..cf640d883 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -696,15 +696,15 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() } } -void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); if(channel) - showTitle(channel, calledFromNumZap, epgpos); + showTitle(channel, calledFromNumZap, epgpos, forcePaintButtonBar); } -void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); @@ -728,7 +728,8 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap check_channellogo_ca_SettingsChange(); aspectRatio = 0; last_curr_id = last_next_id = 0; - showButtonBar = !calledFromNumZap; + showButtonBar = (!calledFromNumZap || forcePaintButtonBar); + bool noTimer = (calledFromNumZap && forcePaintButtonBar); fileplay = (ChanNum == 0); newfreq = true; @@ -780,7 +781,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap show_dot = !show_dot; if (showButtonBar) { - infoViewerBB->paintshowButtonBar(); + infoViewerBB->paintshowButtonBar(noTimer); } int ChanNumWidth = 0; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 69d1ce595..d5f605e7a 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -173,8 +173,8 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); - void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); + void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); + void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update void killTitle(); CSectionsdClient::CurrentNextInfo getEPG(const t_channel_id for_channel_id, CSectionsdClient::CurrentNextInfo &info); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 6cdd0d85b..cea2656eb 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -458,7 +458,7 @@ void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon) } } -void CInfoViewerBB::paintshowButtonBar() +void CInfoViewerBB::paintshowButtonBar(bool noTimer/*=false*/) { if (!is_visible) return; @@ -466,7 +466,9 @@ void CInfoViewerBB::paintshowButtonBar() for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = ""; } - g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); + + if (!noTimer) + g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); if (g_settings.infobar_casystem_display < 2) paint_ca_bar(); diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index 753e32a2e..765ddc20a 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -141,7 +141,7 @@ class CInfoViewerBB void showIcon_Tuner(void); void showIcon_DD(void); void showBBButtons(bool paintFooter = false); - void paintshowButtonBar(); + void paintshowButtonBar(bool noTimer = false); void getBBButtonInfo(void); void reset_allScala(void); void initBBOffset(void); From 3ce94ff8e7ecd0ac59e3e8da09267c846c4b03a2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 038/394] NeutrinoMessages: Add EVT_AUTO_SET_VIDEOSYSTEM Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bf32265c1547695c0be1186dc30cbf5b0b76cd2 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrinoMessages.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index fe89d019a..81f77fa6c 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -123,6 +123,7 @@ struct NeutrinoMessages { /* NEVER CHANGE THIS */ EVT_CA_MESSAGE = CRCInput::RC_Events + 60, /* data = CA_MESSAGE pointer */ EVT_SUBT_MESSAGE = CRCInput::RC_Events + 61, /* data = subtitles pointer */ + EVT_AUTO_SET_VIDEOSYSTEM = CRCInput::RC_Events + 62, /* data = new video system */ /* END */ EVT_CURRENTEPG = CRCInput::RC_WithData + 1, From ff6188530e2398f90fbacfc3957893b988d99d52 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 039/394] osd resolution: Use COsdHelpers::changeOsdResolution() to adjust... ...OSD resolution after switching video format Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff11dd44ab76d3d9a716ab20903449a27a2a5025 Author: Michael Liebmann Date: 2017-02-28 (Tue, 28 Feb 2017) ------------------ This commit was generated by Migit --- lib/libcoolstream2/cs_api.h | 1 + lib/libcoolstream2/video_cs.h | 2 ++ src/gui/osd_setup.cpp | 9 +++++++-- src/gui/videosettings.cpp | 7 +++++++ src/neutrino.cpp | 34 ++++++++++++++++++++++++++++++++- src/neutrino.h | 1 + src/zapit/include/zapit/zapit.h | 1 + src/zapit/src/zapit.cpp | 4 ++++ 8 files changed, 56 insertions(+), 3 deletions(-) diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h index fe1b463da..bbb03eb46 100644 --- a/lib/libcoolstream2/cs_api.h +++ b/lib/libcoolstream2/cs_api.h @@ -49,6 +49,7 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +void cs_new_auto_videosystem(); // Memory helpers void *cs_malloc_uncached(size_t size); diff --git a/lib/libcoolstream2/video_cs.h b/lib/libcoolstream2/video_cs.h index 6c1da4931..3bfa62793 100644 --- a/lib/libcoolstream2/video_cs.h +++ b/lib/libcoolstream2/video_cs.h @@ -190,6 +190,7 @@ private: analog_mode_t analog_mode_scart; fp_icon mode_icon; cDemux *demux; + int current_video_system; // int SelectAutoFormat(); void ScalePic(); @@ -244,6 +245,7 @@ public: int Flush(void); /* set video_system */ + int GetVideoSystem(); int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); void SetSyncMode(AVSYNC_TYPE mode); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index ad4b6b51e..281999311 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -660,7 +660,11 @@ int COsdSetup::showOsdSetup() kext[0].valname = "-"; resCount = 1; } - CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this); + int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); + bool enable = ((resCount > 1) && + COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && + (g_settings.video_Mode != VIDEO_STD_AUTO)); + CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); #endif @@ -1394,7 +1398,8 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) return true; osd_menu->hide(); uint32_t osd_mode = (uint32_t)*(int*)data; - COsdHelpers::getInstance()->changeOsdResolution(osd_mode, osd_mode); + COsdHelpers::getInstance()->g_settings_osd_resolution_save = osd_mode; + COsdHelpers::getInstance()->changeOsdResolution(osd_mode); #if 0 if (frameBuffer->fullHdAvailable()) { if (frameBuffer->osd_resolutions.empty()) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 9a013a6af..6cb14bcd4 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,9 @@ void CVideoSettings::setVideoSettings() void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); if (do_ask) { @@ -422,7 +425,9 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); } else prev_video_mode = g_settings.video_Mode; @@ -606,7 +611,9 @@ void CVideoSettings::nextMode(void) else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); //return; disp_cur = 1; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 87f4dcf2f..99eff149b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -81,6 +81,7 @@ #include "gui/infoviewer.h" #include "gui/mediaplayer.h" #include "gui/movieplayer.h" +#include "gui/osd_helpers.h" #include "gui/osd_setup.h" #include "gui/osdlang_setup.h" #include "gui/pictureviewer.h" @@ -226,6 +227,7 @@ CNeutrinoApp::CNeutrinoApp() { standby_pressed_at.tv_sec = 0; osd_resolution_tmp = -1; + frameBufferInitialized = false; frameBuffer = CFrameBuffer::getInstance(); frameBuffer->setIconBasePath(ICONSDIR); @@ -719,6 +721,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; + COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution; g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); @@ -1359,7 +1362,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32("osd_resolution" , g_settings.osd_resolution); + configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); @@ -1870,6 +1873,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) /************************************************************************************** * CNeutrinoApp - setup the framebuffer * **************************************************************************************/ + void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); @@ -1898,6 +1902,10 @@ void CNeutrinoApp::SetupFrameBuffer() frameBuffer->osd_resolutions[ort].yRes, frameBuffer->osd_resolutions[ort].bpp); +/* + setFbMode = 0; + COsdHelpers::getInstance()->changeOsdResolution(0, true); +*/ #else /* all other hardware ignores setMode parameters */ setFbMode = frameBuffer->setMode(0, 0, 0); @@ -1908,6 +1916,7 @@ void CNeutrinoApp::SetupFrameBuffer() exit(-1); } frameBuffer->Clear(); + frameBufferInitialized = true; } /************************************************************************************** @@ -2121,6 +2130,9 @@ int CNeutrinoApp::run(int argc, char **argv) TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); +#ifdef BOXMODEL_CS_HD2 + cs_new_auto_videosystem(); +#endif g_Locale = new CLocaleManager; @@ -2179,6 +2191,8 @@ TIMER_START(); ZapStart_arg.volume = g_settings.current_volume; ZapStart_arg.webtv_xml = &g_settings.webtv_xml; + ZapStart_arg.osd_resolution = g_settings.osd_resolution; + CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner); /* create decoders, read channels */ bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); @@ -2970,6 +2984,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CMoviePlayerGui::getInstance(true).showSubtitle(data); return messages_return::handled; } + if (msg == NeutrinoMessages::EVT_AUTO_SET_VIDEOSYSTEM) { + printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); + COsdHelpers *coh = COsdHelpers::getInstance(); + int videoSystem = (int)data; + if (coh->getVideoSystem() == videoSystem) + return messages_return::handled; + + if (!frameBufferInitialized) { + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + return messages_return::handled; + } + + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + coh->changeOsdResolution(0, true, true); + return messages_return::handled; + } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) diff --git a/src/neutrino.h b/src/neutrino.h index 291a018ea..6d8749865 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -109,6 +109,7 @@ private: bool channelList_painted; int first_mode_found; int osd_resolution_tmp; + bool frameBufferInitialized; void SDT_ReloadChannels(); void setupNetwork( bool force= false ); diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index a60c79fb5..989f3cc7c 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -42,6 +42,7 @@ typedef struct ZAPIT_start_arg t_channel_id startchannelradio_id; int uselastchannel; int video_mode; + uint32_t osd_resolution; int volume; int ci_clock; std::list *webtv_xml; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index e8682ba1b..7d1b517e7 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -76,6 +76,7 @@ #include #include +#include /* globals */ int sig_delay = 2; // seconds between signal check @@ -1664,6 +1665,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } @@ -2368,6 +2370,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) videoDecoder->SetDemux(videoDemux); videoDecoder->SetVideoSystem(video_mode); + uint32_t osd_resolution = ZapStart_arg->osd_resolution; + COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false); audioDecoder->SetDemux(audioDemux); From 871fffd0ada5052c8bd4383b1ca740cb4631f08c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:01:58 +0100 Subject: [PATCH 040/394] CComponentsWindow: use negative values for discret percental dimensions Also add possibility to use placeholder for better readability and better compatibilty with previous implementations. See doc in source files for more details Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf9a953b59f1cfe15d1d234c4f00c58ba0d0029f Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 8 ++++---- src/gui/components/cc_frm_window.h | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index ab0663a2d..73a6e23a5 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -169,13 +169,13 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; - if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent - width = frameBuffer->getScreenWidth()*width/100; + if (width < 0 && width >= -100) //percentage conversion TODO: behavior inside parent + width = frameBuffer->getScreenWidth()*abs(width)/100; if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); - if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent - height = frameBuffer->getScreenHeight()*height/100; + if (height < 0 && height >= -100) //percentage conversion TODO: behavior inside parent + height = frameBuffer->getScreenHeight()*abs(height)/100; if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index cb1b5288e..2c2b0ae64 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -29,6 +29,8 @@ #include "cc_frm_header.h" #include "cc_frm_footer.h" +#define CCW_PERCENATL - //placeholder for negative sign '-', used for discret dimensions parameters + //! Sub class of CComponentsForm. Shows a window with prepared items. /*! CComponentsWindow provides prepared items like header, footer and a container for @@ -135,6 +137,7 @@ class CComponentsWindow : public CComponentsForm CC_WINDOW_RIGHT_SIDEBAR = 2 }; + /**simple constructor for CComponentsWindow, this shows a window over full screen * @param[in] parent * @li optional: expects type CComponentsForm * as possible parent object, default = NULL @@ -148,9 +151,9 @@ class CComponentsWindow : public CComponentsForm * @param[in] y_pos * @li expects type const &int, defines y position on screen * @param[in] w - * @li expects type const &int, width of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @li expects type const &int, width of window, Note: value = 0 uses full screen * @param[in] h - * @li expects type const &int, height of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @li expects type const &int, height of window, Note: value = 0 uses full screen * @param[in] caption * @li optional: expects type const std::string&, defines title of window header * @param[in] iconname @@ -158,16 +161,24 @@ class CComponentsWindow : public CComponentsForm * @param[in] parent * @li optional: expects type CComponentsForm * as possible parent object, default = NULL * @param[in] shadow_mode - * @li optional: expects type int as mode, default = CC_SHADOW_OFF - * possible values are - * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) - * @see cc_types.h + * @li optional: expects type int as mode, default = CC_SHADOW_OFF \n + * possible values are \n + * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) \n + * Take a look into cc_types.h * @param[in] color_frame * @li optional: expects type fb_pixel_t, defines frame color, default = COL_FRAME_PLUS_0 * @param[in] color_body * @li optional: expects type fb_pixel_t, defines color color, default = COL_MENUCONTENT_PLUS_0 * @param[in] color_shadow * @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0 + * + * @note Discret dimensions parameters: values < 0 to -100 will be interpreted as percent values related to screen. + * For better readability please use placeholder 'CCW_PERCENATL' as negative sign '-' \n + * Example: \n + * this inits a window with position x100 y100 on screen with dimensions 700px x 800px \n + * CComponentsWindow win(100, 100, 700, 800, "Test window");\n + * this inits a window with position x100 y100 on screen with 50% of screen size assigned with discret percental screen dimensions \n + * CComponentsWindow win(100, 100, CCW_PERCENATL 50, CCW_PERCENATL 50, "Test window"); */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption = "", From 8f351d34633a1dd5fac503df2370219731eee5fb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:03:46 +0100 Subject: [PATCH 041/394] CBuildInfo: adaopt for discret percental window dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/449901f1d8b0423f5cf289e0b582219e9a201182 Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 50b480964..fabc41b1a 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,7 +35,7 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 90/*%*/, 90/*%*/, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENATL 90, CCW_PERCENATL 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) From 7f9168a7e271783f4327aa55cf939c29889057b6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:04:47 +0100 Subject: [PATCH 042/394] CMovieBrowser: adaopt for discret percental window dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/21b700879e86a4f9b0da1d05657bbd3b2f417021 Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 72268adc4..faad7a41c 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 50/*%*/, 25/*%*/, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENATL 50, CCW_PERCENATL 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); From 1551f52ce809f18ca1f5f4ee13629e6dc33659ad Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:06:04 +0100 Subject: [PATCH 043/394] CProgressWindow: adaopt for discret percental window dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/88f80053d24358bec745e5b145833166c9b7c3c0 Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 10624dea8..dfb269df0 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,8 +28,8 @@ #include #include "menue.h" -#define PW_MIN_WIDTH 50 //% -#define PW_MIN_HEIGHT 25 //% +#define PW_MIN_WIDTH CCW_PERCENATL 50 //% +#define PW_MIN_HEIGHT CCW_PERCENATL 20 //% class CProgressWindow : public CComponentsWindow, public CMenuTarget { From 7e2146fc0f14d53dd42d60f83efb14605d8a80d8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:07:15 +0100 Subject: [PATCH 044/394] CTestMenu: adaopt progress sample with discret percental window dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d50172fbdb0d73c0f9243200d5500570c2b89b8 Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 2572883ab..78aa1a9b4 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -861,7 +861,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) //with signals sigc::signal OnProgress0, OnProgress1; - CProgressWindow pw2("Progress Single Test -> single Signal", 700, 200, &OnProgress0); + CProgressWindow pw2("Progress Single Test -> single Signal", CCW_PERCENATL 50, CCW_PERCENATL 30, &OnProgress0); pw2.paint(); for(size_t i = 0; i< max; i++){ @@ -870,7 +870,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } pw2.hide(); - CProgressWindow pw3("Progress Single Test -> dub Signal", 700, 200, NULL, &OnProgress0, &OnProgress1); + OnProgress0.clear(); + OnProgress1.clear(); + CProgressWindow pw3("Progress Single Test -> dub Signal", CCW_PERCENATL 50, CCW_PERCENATL 20, NULL, &OnProgress0, &OnProgress1); pw3.paint(); for(size_t i = 0; i< max; i++){ From 1159eb7c958f01e8a786dc65b1109aa5bda1e4dc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:10:40 +0100 Subject: [PATCH 045/394] CProgressWindow: small optimize of size handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a9a09541e09a36acb9fe0362f7a5285dd48b5533 Author: Thilo Graf Date: 2017-03-03 (Fri, 03 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index f8262f972..539094345 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -99,8 +99,7 @@ void CProgressWindow::Init( signal *statusSignal, //set window height h_height = ccw_head->getHeight(); - ccw_body->setHeight((OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight())*ccw_body->size()); - + ccw_body->setHeight(ccw_body->back()->getYPos()+ ccw_body->back()->getHeight()+ OFFSET_INNER_MID); height = max(height, ccw_body->getHeight() + h_height); //set position on screen @@ -112,8 +111,8 @@ CProgressBar* CProgressWindow::getProgressItem() CProgressBar *pBar = new CProgressBar(); pBar->allowPaint(false); int y_tmp = 0; - for(size_t i = 0; i< ccw_body->size(); i++){ - y_tmp += ccw_body->getCCItem(i)->getHeight(); + for(size_t i = ccw_body->size()-1; i< ccw_body->size(); i++){ + y_tmp += ccw_body->getCCItem(i)->getYPos() + ccw_body->getCCItem(i)->getHeight(); y_tmp += OFFSET_INNER_MID; } pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); From c7d0a88e07d38bd368353a35e77571e3adc8eb1a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 09:52:57 +0100 Subject: [PATCH 046/394] fix funny typo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8862ef621b77d71b1974c4abff43b569e12b2002 Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - fix funny typo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- src/gui/components/cc_frm_window.h | 6 +++--- src/gui/moviebrowser/mb.cpp | 2 +- src/gui/test_menu.cpp | 4 ++-- src/gui/widget/progresswindow.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index fabc41b1a..6cd1241b8 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,7 +35,7 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENATL 90, CCW_PERCENATL 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 90, CCW_PERCENT 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 2c2b0ae64..52b4e0012 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -29,7 +29,7 @@ #include "cc_frm_header.h" #include "cc_frm_footer.h" -#define CCW_PERCENATL - //placeholder for negative sign '-', used for discret dimensions parameters +#define CCW_PERCENT - //placeholder for negative sign '-', used for discret dimensions parameters //! Sub class of CComponentsForm. Shows a window with prepared items. /*! @@ -173,12 +173,12 @@ class CComponentsWindow : public CComponentsForm * @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0 * * @note Discret dimensions parameters: values < 0 to -100 will be interpreted as percent values related to screen. - * For better readability please use placeholder 'CCW_PERCENATL' as negative sign '-' \n + * For better readability please use placeholder 'CCW_PERCENT' as negative sign '-' \n * Example: \n * this inits a window with position x100 y100 on screen with dimensions 700px x 800px \n * CComponentsWindow win(100, 100, 700, 800, "Test window");\n * this inits a window with position x100 y100 on screen with 50% of screen size assigned with discret percental screen dimensions \n - * CComponentsWindow win(100, 100, CCW_PERCENATL 50, CCW_PERCENATL 50, "Test window"); + * CComponentsWindow win(100, 100, CCW_PERCENT 50, CCW_PERCENT 50, "Test window"); */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption = "", diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index faad7a41c..724048fa9 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENATL 50, CCW_PERCENATL 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 78aa1a9b4..5bc587c4a 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -861,7 +861,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) //with signals sigc::signal OnProgress0, OnProgress1; - CProgressWindow pw2("Progress Single Test -> single Signal", CCW_PERCENATL 50, CCW_PERCENATL 30, &OnProgress0); + CProgressWindow pw2("Progress Single Test -> single Signal", CCW_PERCENT 50, CCW_PERCENT 30, &OnProgress0); pw2.paint(); for(size_t i = 0; i< max; i++){ @@ -872,7 +872,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) OnProgress0.clear(); OnProgress1.clear(); - CProgressWindow pw3("Progress Single Test -> dub Signal", CCW_PERCENATL 50, CCW_PERCENATL 20, NULL, &OnProgress0, &OnProgress1); + CProgressWindow pw3("Progress Single Test -> dub Signal", CCW_PERCENT 50, CCW_PERCENT 20, NULL, &OnProgress0, &OnProgress1); pw3.paint(); for(size_t i = 0; i< max; i++){ diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index dfb269df0..e94d08755 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,8 +28,8 @@ #include #include "menue.h" -#define PW_MIN_WIDTH CCW_PERCENATL 50 //% -#define PW_MIN_HEIGHT CCW_PERCENATL 20 //% +#define PW_MIN_WIDTH CCW_PERCENT 50 +#define PW_MIN_HEIGHT CCW_PERCENT 20 class CProgressWindow : public CComponentsWindow, public CMenuTarget { From 3c3dde00b272698b9736f28334963df3b51089f7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 5 Mar 2017 19:49:31 +0100 Subject: [PATCH 047/394] CFbAccelCSHD2::setMode: Fix value for screeninfo.yres_virtual Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/53460e54da657f30009cd6bf814fcf175c62dc52 Author: Michael Liebmann Date: 2017-03-05 (Sun, 05 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 0b027ece9..d8d13e543 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -235,8 +235,10 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int setOsdResolutions(); if (fullHdAvailable()) { - screeninfo.xres_virtual=screeninfo.xres=nxRes; - screeninfo.yres_virtual=screeninfo.yres=nyRes; + screeninfo.xres=nxRes; + screeninfo.yres=nyRes; + screeninfo.xres_virtual=nxRes; + screeninfo.yres_virtual=nyRes*2; screeninfo.height=0; screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; From 24176ae699516322ff14be9a69db60f9992eff7a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 5 Mar 2017 19:49:35 +0100 Subject: [PATCH 048/394] COsdHelpers: Add function setVideoSystem() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fa08347ef41026eb7bc4894af144e42cfc9e5447 Author: Michael Liebmann Date: 2017-03-05 (Sun, 05 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_helpers.cpp | 41 +++++++++++++++++++++++++++++++++++++++ src/gui/osd_helpers.h | 1 + src/gui/videosettings.cpp | 6 +++--- src/neutrino.cpp | 4 ++-- src/zapit/src/zapit.cpp | 4 ++-- 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c06563f5a..0133d4aa5 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -181,3 +181,44 @@ uint32_t COsdHelpers::getOsdResolution() } return 0; } + +#define DEBUGINFO_SETVIDEOSYSTEM + +int COsdHelpers::setVideoSystem(int newSystem, bool remember/* = true*/) +{ + if ((newSystem < 0) || (newSystem > VIDEO_STD_MAX)) + return -1; + + if (newSystem == getVideoSystem()) + return 0; + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + int fd = CFrameBuffer::getInstance()->getFileHandle(); + fb_var_screeninfo var; + fb_fix_screeninfo fix; + + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] before SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + int ret = videoDecoder->SetVideoSystem(newSystem, remember); + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] after SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + return ret; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index d2c735e50..bd4a629c0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -23,6 +23,7 @@ class COsdHelpers int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); + int setVideoSystem(int newSystem, bool remember = true); }; diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 6cb14bcd4..b477a7d00 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -414,7 +414,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); //FIXME COsdHelpers::getInstance()->changeOsdResolution(0, true, true); if (do_ask) @@ -426,7 +426,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask) { g_settings.video_Mode = prev_video_mode; COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); COsdHelpers::getInstance()->changeOsdResolution(0, true, true); } else @@ -612,7 +612,7 @@ void CVideoSettings::nextMode(void) g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); COsdHelpers::getInstance()->changeOsdResolution(0, true, true); //return; disp_cur = 1; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bfbc41b08..a9adafce6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2995,12 +2995,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (!frameBufferInitialized) { coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); + coh->setVideoSystem(videoSystem, false); return messages_return::handled; } coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); + coh->setVideoSystem(videoSystem, false); coh->changeOsdResolution(0, true, true); return messages_return::handled; } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index eafc43f60..391f658de 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1664,7 +1664,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); - videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->setVideoSystem(msg.val); COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; @@ -2369,7 +2369,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) audioDecoder = cAudio::GetDecoder(0); videoDecoder->SetDemux(videoDemux); - videoDecoder->SetVideoSystem(video_mode); + COsdHelpers::getInstance()->setVideoSystem(video_mode); uint32_t osd_resolution = ZapStart_arg->osd_resolution; COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false); From b548b6660787f64afc37cbbcc8021dc8ef4ce092 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 5 Mar 2017 19:49:39 +0100 Subject: [PATCH 049/394] COsdHelpers: Remove no longer required function resetOsdResolution() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1dcce0ad33246b4364ad3c5d25c34f3b6bc2a8e Author: Michael Liebmann Date: 2017-03-05 (Sun, 05 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_helpers.cpp | 21 +++++++-------------- src/gui/osd_helpers.h | 1 - src/gui/videosettings.cpp | 9 +++------ src/neutrino.cpp | 4 +--- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index 0133d4aa5..c4c78ca95 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -62,7 +62,13 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo modeNew = OSDMODE_720; idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; - +#if 1 + printf(">>>>>[%s:%d] osd mode: %s => %s, automode: %s, forceOsdReset: %s\n", __func__, __LINE__, + (g_settings.osd_resolution == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080", + (modeNew == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080", + (automode)?"true":"false", + (forceOsdReset)?"true":"false"); +#endif if (forceOsdReset) resetOsd = true; @@ -111,25 +117,12 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo } } } - -void COsdHelpers::resetOsdResolution(int newSystem) -{ - int videoSystem = getVideoSystem(); - if ((isVideoSystem1080(videoSystem)) && (!isVideoSystem1080(newSystem))) { - CFrameBuffer::getInstance()->setMode(1280, 720, 32); - } -} #else void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) { } - -void COsdHelpers::resetOsdResolution(int) -{ -} #endif - int COsdHelpers::isVideoSystem1080(int res) { if ((res == VIDEO_STD_1080I60) || diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index bd4a629c0..9c78886f0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,7 +19,6 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - void resetOsdResolution(int newSystem); int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index b477a7d00..6848628ae 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -413,9 +413,8 @@ void CVideoSettings::setVideoSettings() void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); //FIXME - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); if (do_ask) { @@ -425,9 +424,8 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); } else prev_video_mode = g_settings.video_Mode; @@ -611,9 +609,8 @@ void CVideoSettings::nextMode(void) else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); //return; disp_cur = 1; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a9adafce6..4522f5e41 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2994,14 +2994,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; if (!frameBufferInitialized) { - coh->resetOsdResolution(videoSystem); coh->setVideoSystem(videoSystem, false); return messages_return::handled; } - coh->resetOsdResolution(videoSystem); coh->setVideoSystem(videoSystem, false); - coh->changeOsdResolution(0, true, true); + coh->changeOsdResolution(0, true, false); return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { From 4e013de774c48cf15199e96feb433d7b3fae3d1c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 6 Mar 2017 15:50:06 +0100 Subject: [PATCH 050/394] subpagetable is unsigned Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e10cb00613898eb4a67fae3166fec019876c86e4 Author: Jacek Jendrzej Date: 2017-03-06 (Mon, 06 Mar 2017) Origin message was: ------------------ subpagetable is unsigned ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d83df3251..5eae7e587 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5234,7 +5234,7 @@ void RenderPage() { page_atrb[32].fg = yellow; page_atrb[32].bg = menu1; - int showpage = tuxtxt_cache.page_receiving; + int showpage = tuxtxt_cache.page_receiving < 0 ? 0 : tuxtxt_cache.page_receiving; int showsubpage = tuxtxt_cache.subpagetable[showpage]; if (showsubpage!=0xff) { From 8b8723a29779c35112ae1bebc63d12451a1155b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 051/394] CMovieBrowser: remove wrong progress value Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/26a0f319231bf1bb0865e283ceb1fb35b5df6b1a Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 724048fa9..d6c29d8c4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2766,7 +2766,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) for (i=0; i < size;i++) { if (*m_dir[i].used == true){ - OnLoadDir(i+1, size, m_dir[i].name); + OnLoadDir(i, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); } } From 562dbec77cc6bd0b285f1f1d75ff3ebd43a7d01f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 052/394] CProgressWindow/CProgressSignals: add prepared signals Required for inhertance of signals used with CProgressWindow. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7f511ebd1a394aa1650fcefa81423dc6c679099d Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.h | 76 ++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index e94d08755..4943fb0e2 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -89,10 +89,10 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * status.hide(); * } * - * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. - * //Working with signals have the advantage that the implementation could be more compactly, because - * //complex constructions within the classes are usually unnecessary, - * //beacuse of the signals can be installed where they directly take the required values. See next example: + * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. + * //Working with signals have the advantage that the implementation could be more compactly, because + * //complex constructions within the classes are usually unnecessary, + * //beacuse of the signals can be installed where they directly catching the required values. See next example: * * class CFooClass * { @@ -101,6 +101,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * private: * //other members... * sigc::signal OnProgress; + * void DoCount(); * //other members... * public: * //other members... @@ -132,8 +133,53 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * //finally remove window from screen * progress.hide(); * } + * + * //Another and a recommended way to implement signals is to inherit prepared signals with + * //class CProgressSignals. This class contains prepared signals for implemantation and disconnetion of slots + * //is performed automatically. + * //See next example: + * class CFooClass : public CProgressSignals + * { + * private: + * //other members... + * void DoCount(); + * //other members... + * public: + * //other members... + * void DoAnything(); + * //other members... + * }; + * + * //add the OnGlobalProgress and OnLocalProgress signals into a counter methode + * void CFooClass::DoCount();{ + * size_t max = 10; + * for (size_t i = 0; i < max; i++){ + * OnGlobalProgress(i, max, "Test"); //visualize global progress + * for (size_t j = 0; j < max; j++){ + * OnLocalProgress(ij, max, "Test"); // visualize local progress + * } + * } + * } + * + * void CFooClass::DoAnything{ + * //inside of methode which calls the progress define a CProgressWindow object and the counter method: + * //...any code + * CProgressWindow progress(NULL, 500, 150, NULL, &OnLocalProgress, &OnGlobalProgress); + * progress.paint(); // paint window + * + * //... + * + * void DoCount(); + * + * //... + * + * //finally remove window from screen + * progress.hide(); + * } + * * @note - * Don't use status_Signal at same time with localSignal and globalSignal. In This case please set status_Signal = NULL + * Don't use status_Signal at same time with localSignal and globalSignal. \n + * In This case please set prameter 'status_Signal' = NULL */ CProgressWindow(CComponentsForm *parent = NULL, const int &dx = PW_MIN_WIDTH, @@ -241,5 +287,25 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget void paint(bool do_save_bg = true); }; +class CProgressSignals : public sigc::trackable +{ + public: + /**CProgressSignals Constructor: + * Additional class for inherited signal implemantations into classes with used CProgressWindow instances. + */ + CProgressSignals() + { + //obligatory init of signals. Not really required but just to be safe. + OnProgress.clear(); + OnLocalProgress.clear(); + OnGlobalProgress.clear(); + }; + + /** + * For general usage for implementations of signals for classes which are using CProgressBar() window instances based on inheritance. + * @see Take a look into examples to find in progressbar.h + */ + sigc::signal OnProgress, OnLocalProgress, OnGlobalProgress; +}; #endif From a41f318adc49ac23742e7dcbe7ea7fc7c9e3b3ec Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 053/394] CMovieBrowser/cYTFeedParser: implement signals from CProgressSignals Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c6a47ee3a8047cd2f1c7ba6635ae3923d1ef127 Author: Thilo Graf Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 6 +++--- src/gui/moviebrowser/mb.h | 5 ++--- src/system/ytparser.cpp | 2 +- src/system/ytparser.h | 5 ++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d6c29d8c4..2e3c0780f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2766,7 +2766,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) for (i=0; i < size;i++) { if (*m_dir[i].used == true){ - OnLoadDir(i, size, m_dir[i].name); + OnGlobalProgress(i, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); } } @@ -2887,7 +2887,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLoadFile(i, flist.size(), dirname ); + OnLocalProgress(i, flist.size(), dirname ); } //result = true; } @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 0b37d4c2e..762fba5c6 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -57,6 +57,7 @@ #include #include #include +#include #define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items) #define MOVIEBROWSER_SETTINGS_FILE CONFIGDIR "/moviebrowser.conf" @@ -133,7 +134,7 @@ class CYTCacheSelectorTarget : public CMenuTarget }; // Priorities for Developmemt: P1: critical feature, P2: important feature, P3: for next release, P4: looks nice, lets see -class CMovieBrowser : public CMenuTarget +class CMovieBrowser : public CMenuTarget, public CProgressSignals { friend class CYTCacheSelectorTarget; @@ -362,8 +363,6 @@ class CMovieBrowser : public CMenuTarget void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); - sigc::signal OnLoadFile; - sigc::signal OnLoadDir; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 3c558ee1b..407d452a4 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -323,7 +323,7 @@ bool cYTFeedParser::parseFeedJSON(std::string &answer) Json::Value elements = root["items"]; for(unsigned int i=0; igetText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + OnProgress(i, elements.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); #ifdef DEBUG_PARSER printf("=========================================================\n"); printf("Element %d in elements\n", i); diff --git a/src/system/ytparser.h b/src/system/ytparser.h index c54c2239b..dcc8f1322 100644 --- a/src/system/ytparser.h +++ b/src/system/ytparser.h @@ -30,6 +30,7 @@ #include #include #include +#include class cYTVideoUrl { @@ -68,7 +69,7 @@ class cYTVideoInfo typedef std::vector yt_video_list_t; -class cYTFeedParser +class cYTFeedParser : public CProgressSignals { private: std::string error; @@ -155,8 +156,6 @@ class cYTFeedParser void SetMaxResults(int count) { max_results = count; } void SetConcurrentDownloads(int count) { concurrent_downloads = count; } void SetThumbnailDir(std::string &_thumbnail_dir); - - sigc::signal OnLoadVideoInfo; }; #endif From 78a2c71634d0448cb2a94385838ac35fad1ee3fb Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 6 Mar 2017 10:51:43 +0100 Subject: [PATCH 054/394] Fix osd mode switch in videosystem auto mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1bb9fc6687390a429bd8db89a6c4ec2a339aa627 Author: Michael Liebmann Date: 2017-03-06 (Mon, 06 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_helpers.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c4c78ca95..2675cffef 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -58,8 +58,15 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo } int videoSystem = getVideoSystem(); - if (!isVideoSystem1080(videoSystem)) + + if ((g_settings.video_Mode == VIDEO_STD_AUTO) && + (g_settings.enabled_auto_modes[videoSystem] == 1) && + (!isVideoSystem1080(videoSystem))) modeNew = OSDMODE_720; + +// if (!isVideoSystem1080(videoSystem)) +// modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 From f3fe4a116f92b0722fee7c0aaa315e0b73c0729d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 6 Mar 2017 13:20:02 +0100 Subject: [PATCH 055/394] allow to force given osd resolution in "videosystem = auto" mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fc24e990b3923d72c571477110102c9e3ddbbfa Author: vanhofen Date: 2017-03-06 (Mon, 06 Mar 2017) Origin message was: ------------------ - allow to force given osd resolution in "videosystem = auto" mode ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 ++++++- data/locale/english.locale | 5 +++++ src/gui/osd_helpers.cpp | 39 ++++++++++++++++++-------------------- src/gui/osd_helpers.h | 8 +++++++- src/gui/osd_setup.cpp | 16 +++++++++++++++- src/neutrino.cpp | 2 ++ src/system/locals.h | 5 +++++ src/system/locals_intern.h | 5 +++++ src/system/settings.h | 1 + 9 files changed, 64 insertions(+), 24 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5b9c45c61..bec07ffea 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,6 +325,10 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung +colormenu.osd_resolution_force OSD-Auflösung erzwingen +colormenu.osd_resolution_force_all in allen Modi +colormenu.osd_resolution_force_hd in HD-Modi +colormenu.osd_resolution_force_never nie colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1252,7 +1256,8 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) -menu.hint_osd_resolution Wählen Sie eine OSD Auflösung +menu.hint_osd_resolution Wählen Sie eine OSD-Auflösung +menu.hint_osd_resolution_force Erzwingt die eingestellte OSD-Auflösung, auch wenn das Videosystem automatisch umgeschalten wird menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index d8d2fbe20..b568e7b53 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,6 +325,10 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution +colormenu.osd_resolution_force Force OSD resolution +colormenu.osd_resolution_force_all in all modes +colormenu.osd_resolution_force_hd in HD modes +colormenu.osd_resolution_force_never never colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1253,6 +1257,7 @@ menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV menu.hint_osd_resolution Change OSD resolution +menu.hint_osd_resolution_force Forces the given OSD resolution, even when the videosystem is auto-changed menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index 2675cffef..ed257ce49 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -61,12 +61,9 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo if ((g_settings.video_Mode == VIDEO_STD_AUTO) && (g_settings.enabled_auto_modes[videoSystem] == 1) && - (!isVideoSystem1080(videoSystem))) + (!allow_OSDMODE_1080(videoSystem))) modeNew = OSDMODE_720; -// if (!isVideoSystem1080(videoSystem)) -// modeNew = OSDMODE_720; - idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 @@ -130,28 +127,28 @@ void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) } #endif -int COsdHelpers::isVideoSystem1080(int res) +bool COsdHelpers::allow_OSDMODE_1080(int res) { - if ((res == VIDEO_STD_1080I60) || - (res == VIDEO_STD_1080I50) || - (res == VIDEO_STD_1080P30) || - (res == VIDEO_STD_1080P24) || - (res == VIDEO_STD_1080P25)) - return true; - + if (g_settings.osd_resolution_force == FORCE_ALL || ( + (res == VIDEO_STD_1080I50) + || (res == VIDEO_STD_1080I60) + || (res == VIDEO_STD_1080P24) + || (res == VIDEO_STD_1080P25) + || (res == VIDEO_STD_1080P30) #ifdef BOXMODEL_CS_HD2 - if ((res == VIDEO_STD_1080P50) || - (res == VIDEO_STD_1080P60) || - (res == VIDEO_STD_1080P2397) || - (res == VIDEO_STD_1080P2997)) - return true; + || (res == VIDEO_STD_1080P50) + || (res == VIDEO_STD_1080P60) + || (res == VIDEO_STD_1080P2397) + || (res == VIDEO_STD_1080P2997) #endif + )) + return true; -#if 0 - /* for testing only */ - if (res == VIDEO_STD_720P50) + if (g_settings.osd_resolution_force == FORCE_HD && ( + (res == VIDEO_STD_720P50) + || (res == VIDEO_STD_720P60) + )) return true; -#endif return false; } diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index 9c78886f0..d9fa0c035 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,10 +19,16 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - int isVideoSystem1080(int res); + bool allow_OSDMODE_1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); int setVideoSystem(int newSystem, bool remember = true); + + enum { + FORCE_NEVER = 0, + FORCE_HD, + FORCE_ALL + }; }; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 281999311..9e8b9db00 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -397,6 +397,14 @@ const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; +const CMenuOptionChooser::keyval OSD_RESOLUTION_FORCE_OPTIONS[]= +{ + { COsdHelpers::FORCE_NEVER, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER }, + { COsdHelpers::FORCE_HD, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD }, + { COsdHelpers::FORCE_ALL, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL } +}; +int OSD_RESOLUTION_FORCE_OPTIONS_COUNT = sizeof(OSD_RESOLUTION_FORCE_OPTIONS)/sizeof(OSD_RESOLUTION_FORCE_OPTIONS[0]); + #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_MODE_OPTION_COUNT] = { @@ -662,11 +670,17 @@ int COsdSetup::showOsdSetup() } int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); bool enable = ((resCount > 1) && - COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && + COsdHelpers::getInstance()->allow_OSDMODE_1080(videoSystem) && (g_settings.video_Mode != VIDEO_STD_AUTO)); CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); + + // force resolution in auto-mode + enable = (g_settings.video_Mode == VIDEO_STD_AUTO); + CMenuOptionChooser * osd_res_force = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, &g_settings.osd_resolution_force, OSD_RESOLUTION_FORCE_OPTIONS, OSD_RESOLUTION_FORCE_OPTIONS_COUNT, enable, this); + osd_res_force->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE); + osd_menu->addItem(osd_res_force); #endif //monitor diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d417ababe..1266f9e83 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -724,6 +724,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution; + g_settings.osd_resolution_force = configfile.getInt32("osd_resolution_force", COsdHelpers::FORCE_NEVER); g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); @@ -1365,6 +1366,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //screen configuration configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); + configfile.setInt32("osd_resolution_force", g_settings.osd_resolution_force); configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); diff --git a/src/system/locals.h b/src/system/locals.h index b39748482..3ddb368d7 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,6 +352,10 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD, + LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1280,6 +1284,7 @@ typedef enum LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, LOCALE_MENU_HINT_OSD_RESOLUTION, + LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b39ca2c98..0f327937a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,6 +352,10 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", + "colormenu.osd_resolution_force", + "colormenu.osd_resolution_force_all", + "colormenu.osd_resolution_force_hd", + "colormenu.osd_resolution_force_never", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1280,6 +1284,7 @@ const char * locale_real_names[] = "menu.hint_osd_language", "menu.hint_osd_preset", "menu.hint_osd_resolution", + "menu.hint_osd_resolution_force", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 3a063669e..70c23c731 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -626,6 +626,7 @@ struct SNeutrinoSettings int screen_EndX_lcd_1; int screen_EndY_lcd_1; int osd_resolution; + int osd_resolution_force; int screen_preset; int screen_width; int screen_height; From e7d1a446936dd0eca61f43d6b922fd7aa34a4e42 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 12 Mar 2017 06:32:52 +0100 Subject: [PATCH 056/394] Revert "- allow to force given osd resolution in "videosystem = auto" mode" This reverts commit f3fe4a116f92b0722fee7c0aaa315e0b73c0729d. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ce34d5cf95bd496a59ba9dd23aeddb35a5746d7 Author: Michael Liebmann Date: 2017-03-12 (Sun, 12 Mar 2017) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 +------ data/locale/english.locale | 5 ----- src/gui/osd_helpers.cpp | 41 ++++++++++++++++++++------------------ src/gui/osd_helpers.h | 8 +------- src/gui/osd_setup.cpp | 16 +-------------- src/neutrino.cpp | 2 -- src/system/locals.h | 5 ----- src/system/locals_intern.h | 5 ----- src/system/settings.h | 1 - 9 files changed, 25 insertions(+), 65 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bec07ffea..5b9c45c61 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,10 +325,6 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung -colormenu.osd_resolution_force OSD-Auflösung erzwingen -colormenu.osd_resolution_force_all in allen Modi -colormenu.osd_resolution_force_hd in HD-Modi -colormenu.osd_resolution_force_never nie colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1256,8 +1252,7 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) -menu.hint_osd_resolution Wählen Sie eine OSD-Auflösung -menu.hint_osd_resolution_force Erzwingt die eingestellte OSD-Auflösung, auch wenn das Videosystem automatisch umgeschalten wird +menu.hint_osd_resolution Wählen Sie eine OSD Auflösung menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index b568e7b53..d8d2fbe20 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,10 +325,6 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution -colormenu.osd_resolution_force Force OSD resolution -colormenu.osd_resolution_force_all in all modes -colormenu.osd_resolution_force_hd in HD modes -colormenu.osd_resolution_force_never never colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1257,7 +1253,6 @@ menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV menu.hint_osd_resolution Change OSD resolution -menu.hint_osd_resolution_force Forces the given OSD resolution, even when the videosystem is auto-changed menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index ed257ce49..2675cffef 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -61,9 +61,12 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo if ((g_settings.video_Mode == VIDEO_STD_AUTO) && (g_settings.enabled_auto_modes[videoSystem] == 1) && - (!allow_OSDMODE_1080(videoSystem))) + (!isVideoSystem1080(videoSystem))) modeNew = OSDMODE_720; +// if (!isVideoSystem1080(videoSystem)) +// modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; #if 1 @@ -127,28 +130,28 @@ void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) } #endif -bool COsdHelpers::allow_OSDMODE_1080(int res) +int COsdHelpers::isVideoSystem1080(int res) { - if (g_settings.osd_resolution_force == FORCE_ALL || ( - (res == VIDEO_STD_1080I50) - || (res == VIDEO_STD_1080I60) - || (res == VIDEO_STD_1080P24) - || (res == VIDEO_STD_1080P25) - || (res == VIDEO_STD_1080P30) -#ifdef BOXMODEL_CS_HD2 - || (res == VIDEO_STD_1080P50) - || (res == VIDEO_STD_1080P60) - || (res == VIDEO_STD_1080P2397) - || (res == VIDEO_STD_1080P2997) -#endif - )) + if ((res == VIDEO_STD_1080I60) || + (res == VIDEO_STD_1080I50) || + (res == VIDEO_STD_1080P30) || + (res == VIDEO_STD_1080P24) || + (res == VIDEO_STD_1080P25)) return true; - if (g_settings.osd_resolution_force == FORCE_HD && ( - (res == VIDEO_STD_720P50) - || (res == VIDEO_STD_720P60) - )) +#ifdef BOXMODEL_CS_HD2 + if ((res == VIDEO_STD_1080P50) || + (res == VIDEO_STD_1080P60) || + (res == VIDEO_STD_1080P2397) || + (res == VIDEO_STD_1080P2997)) return true; +#endif + +#if 0 + /* for testing only */ + if (res == VIDEO_STD_720P50) + return true; +#endif return false; } diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index d9fa0c035..9c78886f0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,16 +19,10 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - bool allow_OSDMODE_1080(int res); + int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); int setVideoSystem(int newSystem, bool remember = true); - - enum { - FORCE_NEVER = 0, - FORCE_HD, - FORCE_ALL - }; }; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9e8b9db00..281999311 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -397,14 +397,6 @@ const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; -const CMenuOptionChooser::keyval OSD_RESOLUTION_FORCE_OPTIONS[]= -{ - { COsdHelpers::FORCE_NEVER, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER }, - { COsdHelpers::FORCE_HD, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD }, - { COsdHelpers::FORCE_ALL, LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL } -}; -int OSD_RESOLUTION_FORCE_OPTIONS_COUNT = sizeof(OSD_RESOLUTION_FORCE_OPTIONS)/sizeof(OSD_RESOLUTION_FORCE_OPTIONS[0]); - #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_MODE_OPTION_COUNT] = { @@ -670,17 +662,11 @@ int COsdSetup::showOsdSetup() } int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); bool enable = ((resCount > 1) && - COsdHelpers::getInstance()->allow_OSDMODE_1080(videoSystem) && + COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && (g_settings.video_Mode != VIDEO_STD_AUTO)); CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); - - // force resolution in auto-mode - enable = (g_settings.video_Mode == VIDEO_STD_AUTO); - CMenuOptionChooser * osd_res_force = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, &g_settings.osd_resolution_force, OSD_RESOLUTION_FORCE_OPTIONS, OSD_RESOLUTION_FORCE_OPTIONS_COUNT, enable, this); - osd_res_force->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE); - osd_menu->addItem(osd_res_force); #endif //monitor diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 67ff7e77e..fb9c3eeaa 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -726,7 +726,6 @@ int CNeutrinoApp::loadSetup(const char * fname) //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution; - g_settings.osd_resolution_force = configfile.getInt32("osd_resolution_force", COsdHelpers::FORCE_NEVER); g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); @@ -1368,7 +1367,6 @@ void CNeutrinoApp::saveSetup(const char * fname) //screen configuration configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); - configfile.setInt32("osd_resolution_force", g_settings.osd_resolution_force); configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); diff --git a/src/system/locals.h b/src/system/locals.h index 3ddb368d7..b39748482 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,10 +352,6 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_ALL, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_HD, - LOCALE_COLORMENU_OSD_RESOLUTION_FORCE_NEVER, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1284,7 +1280,6 @@ typedef enum LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, LOCALE_MENU_HINT_OSD_RESOLUTION, - LOCALE_MENU_HINT_OSD_RESOLUTION_FORCE, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0f327937a..b39ca2c98 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,10 +352,6 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", - "colormenu.osd_resolution_force", - "colormenu.osd_resolution_force_all", - "colormenu.osd_resolution_force_hd", - "colormenu.osd_resolution_force_never", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1284,7 +1280,6 @@ const char * locale_real_names[] = "menu.hint_osd_language", "menu.hint_osd_preset", "menu.hint_osd_resolution", - "menu.hint_osd_resolution_force", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 70c23c731..3a063669e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -626,7 +626,6 @@ struct SNeutrinoSettings int screen_EndX_lcd_1; int screen_EndY_lcd_1; int osd_resolution; - int osd_resolution_force; int screen_preset; int screen_width; int screen_height; From b5aa38dc56462596bce958d1c45f841d031899d8 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Mar 2017 09:20:31 +0100 Subject: [PATCH 057/394] CMenuWidget::calcSize: Recalculation of min_width ... ... for adjustment to the osd resolution Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/30db40da1afebe1c3a4f5748d864bb1a043b2946 Author: Michael Liebmann Date: 2017-03-13 (Mon, 13 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 8 ++++++++ src/gui/widget/menue.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3ccd2905c..9511e5239 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -600,6 +600,7 @@ void CMenuWidget::Init(const std::string &NameString, const std::string &Icon, c selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]); //dimension + mwidth_save = mwidth; min_width = 0; width = 0; /* is set in paint() */ if (mwidth > 100){ @@ -1096,6 +1097,13 @@ void CMenuWidget::checkHints() void CMenuWidget::calcSize() { + // recalc min_width + min_width = 0; + int mwidth = std::min(mwidth_save, 100); + min_width = frameBuffer->getScreenWidth(true) * mwidth / 100; + if (min_width > (int)frameBuffer->getScreenWidth()) + min_width = frameBuffer->getScreenWidth(); + width = min_width; int wi, hi; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bf784e3cb..6a174ea18 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -513,6 +513,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals std::string iconfile; int min_width; + int mwidth_save; int width; int height; int hheight; // header From 671568a19ea189b9e68de516423f3e85a07c4bd0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Mar 2017 09:20:36 +0100 Subject: [PATCH 058/394] CMenuWidget::calcSize: Use scale2Res() to adjust fixed sizes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2ed30486c47a6d13e852372347cd55d7734c3967 Author: Michael Liebmann Date: 2017-03-13 (Mon, 13 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 9511e5239..77ace6045 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1112,35 +1112,35 @@ void CMenuWidget::calcSize() if (items[i]->iconName_Info_right) { frameBuffer->getIconSize(items[i]->iconName_Info_right, &wi, &hi); if ((wi > 0) && (hi > 0)) - wi += 10; + wi += OFFSET_INNER_MID; else wi = 0; } - int tmpw = items[i]->getWidth() + 10 + 10 + wi; /* 10 pixels to the left and right of the text */ + int tmpw = items[i]->getWidth() + 2*OFFSET_INNER_MID; /* 10 pixels to the left and right of the text */ if (tmpw > width) width = tmpw; } hint_height = 0; if(g_settings.show_menu_hints && has_hints) { - hint_height = 60; //TODO: rework calculation of hint_height + hint_height = frameBuffer->scale2Res(60); //TODO: rework calculation of hint_height int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); - int h_tmp = 16 + 2*fheight; + int h_tmp = OFFSET_INNER_LARGE + 2*fheight; /* assuming all hint icons has the same size ! */ int iw, ih; frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &iw, &ih); - h_tmp = std::max(h_tmp, ih+10); + h_tmp = std::max(h_tmp, ih+OFFSET_INNER_MID); hint_height = std::max(h_tmp, hint_height); } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */ height = (frameBuffer->getScreenHeight() - fbutton_height - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ - if(height > ((int)frameBuffer->getScreenHeight() - 10)) - height = frameBuffer->getScreenHeight() - 10; + if(height > ((int)frameBuffer->getScreenHeight() - OFFSET_INNER_MID)) + height = frameBuffer->getScreenHeight() - OFFSET_INNER_MID; int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(getName()); - if (neededWidth > width-48) { - width= neededWidth+ 49; + if (neededWidth > width - frameBuffer->scale2Res(48)) { + width = neededWidth + frameBuffer->scale2Res(48)+1; } hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -1174,7 +1174,7 @@ void CMenuWidget::calcSize() iconOffset = w; } - iconOffset += 10; + iconOffset += OFFSET_INNER_MID; width += iconOffset; if (fbutton_count) From 94ddefdfd09744ea068ba68f5969edef3060bbe9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Mar 2017 10:33:32 +0100 Subject: [PATCH 059/394] CMenuWidget::calcSize: Add forgotten 'wi' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d0b02a9752ce56787c076d51db26d90f7a27c30e Author: Michael Liebmann Date: 2017-03-13 (Mon, 13 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 77ace6045..473c29c40 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1116,7 +1116,7 @@ void CMenuWidget::calcSize() else wi = 0; } - int tmpw = items[i]->getWidth() + 2*OFFSET_INNER_MID; /* 10 pixels to the left and right of the text */ + int tmpw = items[i]->getWidth() + 2*OFFSET_INNER_MID + wi; /* 10 pixels to the left and right of the text */ if (tmpw > width) width = tmpw; } From 5ab0fbc0817280750072be0268d787558a431f8a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:10:29 +0100 Subject: [PATCH 060/394] settings.h: enable scale for DETAILSLINE_WIDTH Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/afe98d395210f4263125a40a783deb5651302499 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/settings.h b/src/system/settings.h index 70280a589..945c13ecc 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -930,7 +930,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN -#define DETAILSLINE_WIDTH 16 // TODO: scale2Res() ? +#define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) struct SglobalInfo { From 20c5788556f3170c39cba3247cb7c8d59f2333d3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:11:45 +0100 Subject: [PATCH 061/394] cc_types.h: add scale to CC_WIDTH_MIN/CC_HEIGHT_MIN Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df484340927dae179ed3e21a10be2dec98d2d0d0 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 5f56ee181..7b57dc9e3 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -191,8 +191,8 @@ typedef struct button_label_cc button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){} } button_label_cc_struct; -#define CC_WIDTH_MIN 16 -#define CC_HEIGHT_MIN 16 +#define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) +#define CC_HEIGHT_MIN CC_WIDTH_MIN #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 From 19c6ff581a78823537c3ede472eed47cd48195ac Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:23:31 +0100 Subject: [PATCH 062/394] CComponentsDetailsLine: add scale to details line width Also added correction for odd line width values and added method to change details line width. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f5f2bf92bad20d532dbb95368dd52da54db53447 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_detailsline.cpp | 23 ++++++++++++----------- src/gui/components/cc_detailsline.h | 6 ++++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 81da16c5e..82dd27cca 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -61,7 +61,7 @@ void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_to shadow_w = 1; //CComponentsDetailsLine - thickness = 4; /* MUST be an even value! */ + dl_w = CFrameBuffer::getInstance()->scale2Res(3); cc_body_gradient_enable = false; } @@ -101,6 +101,7 @@ void CComponentsDetailsLine::paint(bool do_save_bg) int y_mark_top = y-h_mark_top/2; int y_mark_down = y_down-h_mark_down/2; + int dx_c = dl_w%2; //correction for odd values cc_fbdata_t fbdata[] = { @@ -108,26 +109,26 @@ void CComponentsDetailsLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical item mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_top, dl_w, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_top+h_mark_top, dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, width-2*dl_w-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+dl_w/2+dx_c, dl_w, y_down-y-dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, sw, y_down-y-dl_w, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+dl_w/2+dx_c, width-dl_w-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_down, dl_w, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_down+h_mark_down,dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index be07ef57f..66197f51f 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -40,8 +40,8 @@ Not usable as CCItem! class CComponentsDetailsLine : public CComponents { private: - ///property: line thickness - int thickness; + ///property: line width + int dl_w; ///property: lowest y position int y_down; ///property: height of top marker @@ -73,6 +73,8 @@ class CComponentsDetailsLine : public CComponents ///set all positions and dimensions of details line at once void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_) {setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);} + ///property: set line thickness + void setLineWidth(const int& w){dl_w = w;} ///paint all to screen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From 46859665edb06310f0e1575d877e225cde1684bb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:17:16 +0100 Subject: [PATCH 063/394] CImageInfo: use global offset for item offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1db1182b87be39b69b57d54bc99b0d620bb64f3f Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 8dd342ed8..dd0e8a1c1 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -69,7 +69,7 @@ void CImageInfo::Init(void) cc_sub_caption = NULL; b_info = NULL; btn_red = NULL; - item_offset = 10; + item_offset = OFFSET_INNER_MID; item_font = NULL; item_height = 0; y_tmp = 0; From 344b254a4b7c602dda4ba0453a3714c0988eff5b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:37:55 +0100 Subject: [PATCH 064/394] CComponentsExtTextForm: fix label width calculation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/81cde4836fc6b04129560f2b4847eb95e3e89b3d Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 6 +++--- src/gui/components/cc_frm_ext_text.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 864336d91..7ae619423 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -86,8 +86,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p width = w; //init ccx_label_width and ccx_text_width //default ccx_label_width = 30% of form width - ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; - ccx_label_width = ccx_percent_label_w * width/100; + ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100; ccx_text_width = width-ccx_label_width; height = h; @@ -223,7 +222,8 @@ void CComponentsExtTextForm::initCCTextItems() void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) { - ccx_percent_label_w = (int)percent_val; + ccx_label_width = (int)percent_val * width/100; + ccx_text_width = width-ccx_label_width; initCCTextItems(); } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 837eb8c18..4e37efd0f 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -49,8 +49,6 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen int ccx_text_width; ///property: font type of both items (label and text), see also setLabelAndText() Font* ccx_font; - ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() - uint8_t ccx_percent_label_w; ///centered y position of label and text int y_text; From e05016388d1b71e03f44e5275b2077e19701ff14 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:41:03 +0100 Subject: [PATCH 065/394] CImageInfo: optimize label arrangement Distance between label and text was too large with full hd resolution. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17227504c29ec48d6f96411aa1d049c579e658e2 Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index dd0e8a1c1..d62fa7487 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -355,7 +355,7 @@ void CImageInfo::InitInfos() y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelWidthPercent(20); + item->setLabelWidthPercent(15); if (!item_font){ item_font = item->getFont(); From 540c433a4158846c744c3ca8e98e39a7c53834cd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:47:00 +0100 Subject: [PATCH 066/394] CComponentsExtTextForm: use scaled default dimension values Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e498cc6b09b5521590db732c3296d91b4b78ff67 Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 7ae619423..0587d90db 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -31,7 +31,8 @@ #include -#define DEF_HEIGHT 27 +#define DEF_HEIGHT CFrameBuffer::getInstance()->scale2Res(27) +#define DEF_WIDTH CFrameBuffer::getInstance()->scale2Res(300) #define DEF_LABEL_WIDTH_PERCENT 30 using namespace std; @@ -39,7 +40,7 @@ using namespace std; CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent) { Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; - initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); + initVarExtTextForm(0, 0, DEF_WIDTH, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); initCCTextItems(); } From 69cc4d7a741a9e247404da8e090d90bc081c93de Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 19 Mar 2017 22:30:26 +0100 Subject: [PATCH 067/394] CProgressWindow: try to reduce effort inside progress display Should help to reduce some timing side effects with many data amounts. But there could still be more potential. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2de98df48fe6e6a98bfcbeddb89a04b8d31b23eb Author: Thilo Graf Date: 2017-03-19 (Sun, 19 Mar 2017) Origin message was: ------------------ CProgressWindow: try to reduce effort inside progress display Should help to reduce some timing side effects with many data amounts. But there could still be more potential. ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 18 +++++++++++++----- src/gui/widget/progresswindow.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 539094345..68b416439 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -79,7 +79,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = 0; + global_progress = local_progress = percent_progress = 0; showFooter(false); @@ -91,6 +91,8 @@ void CProgressWindow::Init( signal *statusSignal, status_txt->doPaintBg(false); addWindowItem(status_txt); + cur_statusText = string(); + //create local_bar object local_bar = getProgressItem(); @@ -128,10 +130,16 @@ CProgressBar* CProgressWindow::getProgressItem() void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); - pBar->setValues(prog, (int)max); - if (!statusText.empty()) - showStatusMessageUTF(statusText); - pBar->paint(false); + unsigned int cur_perc = prog*100/(max+1); + if (percent_progress != cur_perc || prog == 0){ + pBar->setValues(prog, (int)max); + if (!statusText.empty() && (cur_statusText != statusText)){ + showStatusMessageUTF(statusText); + cur_statusText = statusText; + } + pBar->paint(false); + percent_progress = cur_perc; + } } void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 4943fb0e2..1be4255a9 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -39,6 +39,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; + unsigned int percent_progress; + std::string cur_statusText; int h_height; void Init( sigc::signal *statusSignal, sigc::signal *localSignal, From 79b679a9ca119237dbbd05013fc5be55df4ad1ab Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Mar 2017 07:27:12 +0100 Subject: [PATCH 068/394] Fix videosystem auto mode / osd mode switch in movie player Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2a858c628a98bc70184a0ce62c75cdaebac7c850 Author: Michael Liebmann Date: 2017-03-22 (Wed, 22 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 20 ++++++++++++++++++++ src/gui/movieplayer.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 46e222231..9f1eb5862 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -147,6 +148,8 @@ void CMoviePlayerGui::Init(void) { playing = false; stopped = true; + currentVideoSystem = -1; + currentOsdResolution = 0; frameBuffer = CFrameBuffer::getInstance(); @@ -223,6 +226,12 @@ void CMoviePlayerGui::cutNeutrino() if (playing) return; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + COsdHelpers *coh = COsdHelpers::getInstance(); + currentVideoSystem = coh->getVideoSystem(); + currentOsdResolution = coh->getOsdResolution(); +#endif + playing = true; /* set g_InfoViewer update timer to 1 sec, should be reset to default from restoreNeutrino->set neutrino mode */ if (!isWebTV) @@ -247,6 +256,17 @@ void CMoviePlayerGui::restoreNeutrino() if (!playing) return; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + if ((currentVideoSystem > -1) && (g_settings.video_Mode == VIDEO_STD_AUTO)) { + COsdHelpers *coh = COsdHelpers::getInstance(); + if (currentVideoSystem != coh->getVideoSystem()) { + coh->setVideoSystem(currentVideoSystem, false); + coh->changeOsdResolution(currentOsdResolution, false, true); + } + currentVideoSystem = -1; + } +#endif + playing = false; if (isUPNP) diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 1e15997d7..0b6cd507d 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -118,6 +118,8 @@ class CMoviePlayerGui : public CMenuTarget int startposition; int position; int duration; + int currentVideoSystem; + uint32_t currentOsdResolution; unsigned short numpida; unsigned short vpid; From 968e1ce9c0eb4ad9b83e001dc7a409947ac02381 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 23 Mar 2017 21:26:57 +0100 Subject: [PATCH 069/394] src/neutrino.cpp: Simplification EVT_AUTO_SET_VIDEOSYSTEM handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ea18657562fb62154f61e6818d994d76931b9174 Author: Michael Liebmann Date: 2017-03-23 (Thu, 23 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index da09d08ca..aba7e3978 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2995,16 +2995,11 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); COsdHelpers *coh = COsdHelpers::getInstance(); int videoSystem = (int)data; - if (coh->getVideoSystem() == videoSystem) - return messages_return::handled; - - if (!frameBufferInitialized) { + if (coh->getVideoSystem() != videoSystem) { coh->setVideoSystem(videoSystem, false); - return messages_return::handled; + if (frameBufferInitialized) + coh->changeOsdResolution(0, true, false); } - - coh->setVideoSystem(videoSystem, false); - coh->changeOsdResolution(0, true, false); return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { From c2d87de865c28e9ea77dccccd88d77361976408f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 23 Mar 2017 21:27:06 +0100 Subject: [PATCH 070/394] CFbAccelCSHD2::setMode: Fix if ENABLE_CHANGE_OSD_RESOLUTION is not defined Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/515ab1fe598276b2cb169298cf9fd81968a7c3cd Author: Michael Liebmann Date: 2017-03-23 (Thu, 23 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd2.cpp | 50 ++++++++++++++++++++-------------- src/neutrino.cpp | 2 +- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index d8d13e543..7ca2eed3c 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -234,29 +234,35 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int if (osd_resolutions.empty()) setOsdResolutions(); - if (fullHdAvailable()) { - screeninfo.xres=nxRes; - screeninfo.yres=nyRes; - screeninfo.xres_virtual=nxRes; - screeninfo.yres_virtual=nyRes*2; - screeninfo.height=0; - screeninfo.width=0; - screeninfo.xoffset=screeninfo.yoffset=0; - screeninfo.bits_per_pixel=nbpp; + unsigned int nxRes_ = nxRes; + unsigned int nyRes_ = nyRes; + unsigned int nbpp_ = nbpp; + if (!fullHdAvailable()) { + nxRes_ = 1280; + nyRes_ = 720; + nbpp_ = 32; + } + screeninfo.xres=nxRes_; + screeninfo.yres=nyRes_; + screeninfo.xres_virtual=nxRes_; + screeninfo.yres_virtual=nyRes_*2; + screeninfo.height=0; + screeninfo.width=0; + screeninfo.xoffset=screeninfo.yoffset=0; + screeninfo.bits_per_pixel=nbpp_; - if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) - perror(LOGTAG "FBIOPUT_VSCREENINFO"); + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) + perror(LOGTAG "FBIOPUT_VSCREENINFO"); - printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", - screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); - if ((screeninfo.xres != nxRes) || - (screeninfo.yres != nyRes) || - (screeninfo.bits_per_pixel != nbpp)) { - printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", - nxRes, nyRes, nbpp, - screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); - return -1; - } + printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", + screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); + if ((screeninfo.xres != nxRes_) || + (screeninfo.yres != nyRes_) || + (screeninfo.bits_per_pixel != nbpp_)) { + printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", + nxRes_, nyRes_, nbpp_, + screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); + return -1; } fb_fix_screeninfo _fix; @@ -337,8 +343,10 @@ int CFbAccelCSHD2::scale2Res(int size) bool CFbAccelCSHD2::fullHdAvailable() { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */ return true; +#endif return false; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index aba7e3978..a37a4d3df 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2139,7 +2139,7 @@ int CNeutrinoApp::run(int argc, char **argv) TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); -#ifdef BOXMODEL_CS_HD2 +#if defined(HAVE_COOL_HARDWARE) && defined(ENABLE_CHANGE_OSD_RESOLUTION) cs_new_auto_videosystem(); #endif From 2cb6e23686be4adea06a964f4420fda926033cd1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:03 +0200 Subject: [PATCH 071/394] CFbAccelCSHD[1|2]::setMode(): Insert cVideo::updateOsdScreenInfo() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40a4ec42628d27a941b104e49f6a9d89cf18c036 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd1.cpp | 4 ++++ src/driver/fb_accel_cs_hd2.cpp | 3 +++ src/driver/fb_accel_cs_hdx_inc.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index f890cfbcc..2d4f4ad2a 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -370,6 +370,10 @@ int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int) yRes = screeninfo.yres; bpp = screeninfo.bits_per_pixel; printf(LOGTAG "%dx%dx%d line length %d. using %s graphics accelerator.\n", xRes, yRes, bpp, stride, _fix.id); + + if (videoDecoder != NULL) + videoDecoder->updateOsdScreenInfo(); + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 7ca2eed3c..36a99ca0e 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -289,6 +289,9 @@ max res 1920x1080 stride 7680 */ + if (videoDecoder != NULL) + videoDecoder->updateOsdScreenInfo(); + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index da858312e..5135e953d 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -36,4 +36,7 @@ #include #include +#include #include + +extern cVideo * videoDecoder; From 352b7f75f8830b24b5bda60dce6191cc88a8f564 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:07 +0200 Subject: [PATCH 072/394] CStreamInfo2: Add new info items - Videosystem - OSD Resolution Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7cea75f37baca88c64bd72e7ca795146272e9db Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/streaminfo2.cpp | 33 +++++++++++++++++++++++++++++---- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 259a43e6a..db95f8756 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Bildrate streaminfo.framerate_unknown unbekannt streaminfo.head Tech. Information streaminfo.not_available nicht verfügbar +streaminfo.osd_resolution OSD Auflösung streaminfo.resolution Auflösung streaminfo.signal Empfangssignal +streaminfo.videosystem Videosystem streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. diff --git a/data/locale/english.locale b/data/locale/english.locale index 9bc1b4031..d203308bf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Framerate streaminfo.framerate_unknown unknown streaminfo.head Stream-Information streaminfo.not_available not available +streaminfo.osd_resolution OSD Resolution streaminfo.resolution Resolution streaminfo.signal Receipt signal +streaminfo.videosystem Videosystem streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart GUI. streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. streaming.overflow Record buffer overflow, consider to stop some records diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d99ab6818..b799c4c3f 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -527,18 +527,20 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) if(!channel) return; - int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + int array[]= {g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))}; - for(i=0 ; i<6; i++) { + for(i=0 ; i<(int)(sizeof(array)/sizeof(array[0])); i++) { if(spaceoffset < array[i]) spaceoffset = array[i]; } - spaceoffset += g_Font[font_info]->getRenderWidth(" "); + spaceoffset += g_Font[font_info]->getRenderWidth(" "); average_bitrate_offset = spaceoffset; int box_width2 = box_width-(spaceoffset+xpos); @@ -557,7 +559,30 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%dx%d", xres, yres); g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); - //audio rate +#if HAVE_COOL_HARDWARE + //Video SYSTEM + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + cs_vs_format_t vsfn; + videoDecoder->GetVideoSystemFormatName(&vsfn); +#ifdef BOXMODEL_CS_HD1 + snprintf(buf, sizeof(buf), "HDMI: %s%s", vsfn.format, +#else + snprintf(buf, sizeof(buf), "HDMI: %s, Scart/Cinch: %s%s", vsfn.formatHD, vsfn.formatSD, +#endif + (g_settings.video_Mode == VIDEO_STD_AUTO)?" (AUTO)":""); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); +#endif + + //OSD RESOLUTION + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + snprintf(buf, sizeof(buf), "%dx%d", frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); + + //Aspect Ratio ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); diff --git a/src/system/locals.h b/src/system/locals.h index 024bb955b..05310ce1b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2346,8 +2346,10 @@ typedef enum LOCALE_STREAMINFO_FRAMERATE_UNKNOWN, LOCALE_STREAMINFO_HEAD, LOCALE_STREAMINFO_NOT_AVAILABLE, + LOCALE_STREAMINFO_OSD_RESOLUTION, LOCALE_STREAMINFO_RESOLUTION, LOCALE_STREAMINFO_SIGNAL, + LOCALE_STREAMINFO_VIDEOSYSTEM, LOCALE_STREAMING_BUSY, LOCALE_STREAMING_DIR_NOT_WRITABLE, LOCALE_STREAMING_OVERFLOW, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3fdeaa47a..143579cbb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2346,8 +2346,10 @@ const char * locale_real_names[] = "streaminfo.framerate_unknown", "streaminfo.head", "streaminfo.not_available", + "streaminfo.osd_resolution", "streaminfo.resolution", "streaminfo.signal", + "streaminfo.videosystem", "streaming.busy", "streaming.dir_not_writable", "streaming.overflow", From 6823a03aa4bba73b37e68c8b8311c78bdf573fe9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:10 +0200 Subject: [PATCH 073/394] lib/libtuxtxt/tuxtxt.cpp: Update for hd1/hd2 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e08f4cb9253a006c68e5de03463c3796e6e3b24 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 5eae7e587..714494681 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5524,7 +5524,7 @@ void CopyBB2FB() { fb_pixel_t *src, *dst, *topsrc; int fillcolor, i, screenwidth, swtmp; -#if defined(HAVE_SPARK_HARDWARE) || defined(BOXMODEL_CS_HD2) +#if defined(HAVE_SPARK_HARDWARE) || defined(HAVE_COOL_HARDWARE) CFrameBuffer *f = CFrameBuffer::getInstance(); #endif @@ -5537,7 +5537,7 @@ void CopyBB2FB() { #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, 0, true); -#elif defined BOXMODEL_CS_HD2 +#elif defined(HAVE_COOL_HARDWARE) f->fbCopyArea(var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, var_screeninfo.yres); #else if ((uint32_t)stride > var_screeninfo.xres) { @@ -5586,7 +5586,7 @@ void CopyBB2FB() if (screenmode == 1) { screenwidth = ( TV43STARTX ); -#if defined(HAVE_SPARK_HARDWARE) || defined(BOXMODEL_CS_HD2) +#if defined(HAVE_SPARK_HARDWARE) int cx = var_screeninfo.xres - TV43STARTX; /* x start */ int cw = TV43STARTX; /* width */ int cy = StartY; @@ -5594,8 +5594,6 @@ void CopyBB2FB() #endif #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, cw, ch, cx, cy, cx, cy, true); -#elif defined BOXMODEL_CS_HD2 - f->fbCopyArea(cw, ch, cx, cy, cx, cy+var_screeninfo.yres); #else fb_pixel_t *topdst = dst; size_t width = (ex - screenwidth) * sizeof(fb_pixel_t); From 8090c48f2f5d4b496fc484dd6975f1831ed623d8 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:13 +0200 Subject: [PATCH 074/394] fb_accel hd1/hd2: Add fb_accel_cs_hdx.cpp for common functions - Add 'class CFbAccelCSHDx' to fb_accel.h - Some small code updates Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3c1f2bfe0566e83b293c94f9e60ce22074228394 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) ------------------ This commit was generated by Migit --- src/driver/Makefile.am | 2 + src/driver/fb_accel.h | 34 ++++++++- src/driver/fb_accel_cs_hd1.cpp | 14 +++- src/driver/fb_accel_cs_hd2.cpp | 32 ++++++-- src/driver/fb_accel_cs_hdx.cpp | 122 +++++++++++++++++++++++++++++++ src/driver/fb_accel_cs_hdx_inc.h | 10 ++- 6 files changed, 199 insertions(+), 15 deletions(-) create mode 100644 src/driver/fb_accel_cs_hdx.cpp diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index e7d4eaf43..37040c4b0 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -47,6 +47,8 @@ libneutrino_driver_a_SOURCES = \ volume.cpp if BOXTYPE_COOL +libneutrino_driver_a_SOURCES += \ + fb_accel_cs_hdx.cpp if BOXMODEL_CS_HD2 libneutrino_driver_a_SOURCES += \ fb_accel_cs_hd2.cpp \ diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 84e42ffe1..6343056f9 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -78,17 +78,41 @@ class CFbAccelSTi void setBlendLevel(int); }; -class CFbAccelCSHD1 +class CFbAccelCSHDx : public CFbAccel { private: + + protected: + OpenThreads::Mutex mutex; + + int fbCopy(uint32_t *mem_p, int width, int height, int dst_x, int dst_y, int src_x, int src_y, int mode); + int fbFill(int sx, int sy, int width, int height, fb_pixel_t color, int mode=0); + + public: + CFbAccelCSHDx(); +// ~CFbAccelCSHDx(); + +#if 0 + /* TODO: Run this functions with hardware acceleration */ + void SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp); + void RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp); + void Clear(); +#endif +}; + +class CFbAccelCSHD1 + : public CFbAccelCSHDx +{ + private: fb_pixel_t lastcol; + fb_pixel_t *backbuffer; int devmem_fd; /* to access the GXA register we use /dev/mem */ unsigned int smem_start; /* as aquired from the fbdev, the framebuffers physical start address */ volatile uint8_t *gxa_base; /* base address for the GXA's register access */ + void setColor(fb_pixel_t col); - void run(void); - fb_pixel_t *backbuffer; + public: CFbAccelCSHD1(); ~CFbAccelCSHD1(); @@ -113,10 +137,12 @@ class CFbAccelCSHD1 }; class CFbAccelCSHD2 - : public CFbAccel + : public CFbAccelCSHDx { private: fb_pixel_t *backbuffer; + int sysRev; + bool IsApollo; public: CFbAccelCSHD2(); diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index 2d4f4ad2a..2b6b0e0dd 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -264,13 +264,21 @@ void CFbAccelCSHD1::paintBoxRel(const int x, const int y, const int dx, const in void CFbAccelCSHD1::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y) { + if ((width == 0) || (height == 0)) + return; + uint32_t w_, h_; w_ = (width > xRes) ? xRes : width; h_ = (height > yRes) ? yRes : height; - //printf("\033[33m>>>>\033[0m [CFbAccelCSHD1::%s:%d] fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - printf("\033[31m>>>>\033[0m [CFbAccelCSHD1::%s:%d] sw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y); + int mode = CS_FBCOPY_FB2FB; + uint32_t src_y_ = src_y; + if (src_y >= yRes) { + mode = CS_FBCOPY_BB2FB; + src_y_ -= yRes; + } + fbCopy(NULL, w_, h_, dst_x, dst_y, src_x, src_y_, mode); +// printf("\033[31m>>>>\033[0m%s hw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); } void CFbAccelCSHD1::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 36a99ca0e..cfafaf4bf 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -28,7 +28,9 @@ CFbAccelCSHD2::CFbAccelCSHD2() { - fb_name = "Coolstream HD2 framebuffer"; + fb_name = "Coolstream HD2 framebuffer"; + IsApollo = false; + sysRev = -1; } /* @@ -143,11 +145,22 @@ void CFbAccelCSHD2::paintBoxRel(const int x, const int y, const int dx, const in void CFbAccelCSHD2::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y) { + if ((width == 0) || (height == 0)) + return; + uint32_t w_, h_; w_ = (width > xRes) ? xRes : width; h_ = (height > yRes) ? yRes : height; - if(!(w_%4)) { + if (sysRev < 0) { + sysRev = cs_get_revision(); + IsApollo = (sysRev == 9); + } + + if(!(w_ % 4) && !IsApollo) { + /* workaround for bad fb driver */ + w_ -= 1; + h_ -= 1; fb_copyarea area; area.dx = dst_x; area.dy = dst_y; @@ -156,11 +169,18 @@ void CFbAccelCSHD2::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, area.sx = src_x; area.sy = src_y; ioctl(fd, FBIO_COPY_AREA, &area); - //printf("\033[33m>>>>\033[0m [CFbAccelCSHD2::%s:%d] fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - return; +// printf("\033[33m>>>>\033[0m%s fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); + } + else { + int mode = CS_FBCOPY_FB2FB; + uint32_t src_y_ = src_y; + if (src_y >= yRes) { + mode = CS_FBCOPY_BB2FB; + src_y_ -= yRes; + } + fbCopy(NULL, w_, h_, dst_x, dst_y, src_x, src_y_, mode); +// printf("\033[31m>>>>\033[0m%s fbCopy w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); } - //printf("\033[31m>>>>\033[0m [CFbAccelCSHD2::%s:%d] sw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y); } void CFbAccelCSHD2::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp) diff --git a/src/driver/fb_accel_cs_hdx.cpp b/src/driver/fb_accel_cs_hdx.cpp new file mode 100644 index 000000000..3ab238f35 --- /dev/null +++ b/src/driver/fb_accel_cs_hdx.cpp @@ -0,0 +1,122 @@ +/* + Framebuffer acceleration hardware abstraction functions. + The common functions for coolstream hd1/hd2 graphic chips + are represented in this class. + + (C) 2017 M. Liebmann + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "fb_accel_cs_hdx_inc.h" + +#define LOGTAG "[fb_accel_cs_hdx] " + +CFbAccelCSHDx::CFbAccelCSHDx() +{ + fb_name = "CST HDx framebuffer"; +} + +/* +CFbAccelCSHDx::~CFbAccelCSHDx() +{ +} +*/ + +int CFbAccelCSHDx::fbCopy(uint32_t *mem_p, int width, int height, + int dst_x, int dst_y, int src_x, int src_y, int mode) +{ + if (videoDecoder == NULL) { + if (dst_y < (int)yRes) { + uint32_t src_y_ = src_y; + if (mode == CS_FBCOPY_BB2FB) + src_y_ += yRes; + CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y_); + return 0; + } + return -1; + } + + mutex.lock(); + setActive(false); + int ret = videoDecoder->fbCopy(mem_p, width, height, dst_x, dst_y, src_x, src_y, mode); + add_gxa_sync_marker(); + setActive(true); + mutex.unlock(); + return ret; +} + +int CFbAccelCSHDx::fbFill(int sx, int sy, int width, int height, fb_pixel_t color, int mode/*=0*/) +{ + if (videoDecoder == NULL) { + CFbAccel::paintRect(sx, sy, width, height, color); + return 0; + } + + mutex.lock(); + setActive(false); + int ret = videoDecoder->fbFill(sx, sy, width, height, color, mode); + add_gxa_sync_marker(); + setActive(true); + mutex.unlock(); + return ret; +} + +#if 0 +/* TODO: Run this functions with hardware acceleration */ +void CFbAccelCSHDx::SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp) +{ + if (!getActive()) + return; + + checkFbArea(x, y, dx, dy, true); + fb_pixel_t * pos = getFrameBufferPointer() + x + swidth * y; + fb_pixel_t * bkpos = memp; + for (int count = 0; count < dy; count++) { + fb_pixel_t * dest = (fb_pixel_t *)pos; + for (int i = 0; i < dx; i++) + *(bkpos++) = *(dest++); + pos += swidth; + } + checkFbArea(x, y, dx, dy, false); +printf("%s\n", __func_ext__); +} + +void CFbAccelCSHDx::RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp) +{ + if (!getActive()) + return; + + checkFbArea(x, y, dx, dy, true); + fb_pixel_t * fbpos = getFrameBufferPointer() + x + swidth * y; + fb_pixel_t * bkpos = memp; + for (int count = 0; count < dy; count++) + { + memmove(fbpos, bkpos, dx * sizeof(fb_pixel_t)); + fbpos += swidth; + bkpos += dx; + } + mark(x, y, x + dx, y + dy); + checkFbArea(x, y, dx, dy, false); +printf("%s\n", __func_ext__); +} + +void CFbAccelCSHDx::Clear() +{ + paintBackground(); +printf("%s\n", __func_ext__); +} +#endif diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index 5135e953d..5f98cd34b 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -1,6 +1,6 @@ /* Framebuffer acceleration hardware abstraction functions. - The hardware dependent acceleration functions for coolstream hdx graphic chips + The common functions for coolstream hd1/hd2 graphic chips are represented in this class. (C) 2017 M. Liebmann @@ -23,6 +23,8 @@ along with this program. If not, see . */ +#ifndef FB_ACCEL_CS_HDX_INC_H +#define FB_ACCEL_CS_HDX_INC_H #include #include @@ -31,12 +33,16 @@ #include #include #include +#include + #include #include #include - #include #include +#include #include extern cVideo * videoDecoder; + +#endif // FB_ACCEL_CS_HDX_INC_H From 3a34afe94e142e2aa38abb83a4362efab7cc6e38 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:16 +0200 Subject: [PATCH 075/394] Fix videosystem auto mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b612c1f620c00e628d1cafc854d01e59753e2ba5 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 4 +++- src/neutrino.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 9f1eb5862..9b9590d99 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -257,7 +257,9 @@ void CMoviePlayerGui::restoreNeutrino() return; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - if ((currentVideoSystem > -1) && (g_settings.video_Mode == VIDEO_STD_AUTO)) { + if ((currentVideoSystem > -1) && + (g_settings.video_Mode == VIDEO_STD_AUTO) && + (g_settings.enabled_auto_modes[currentVideoSystem] == 1)) { COsdHelpers *coh = COsdHelpers::getInstance(); if (currentVideoSystem != coh->getVideoSystem()) { coh->setVideoSystem(currentVideoSystem, false); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a37a4d3df..3bba42f54 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2995,7 +2995,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); COsdHelpers *coh = COsdHelpers::getInstance(); int videoSystem = (int)data; - if (coh->getVideoSystem() != videoSystem) { + if ((videoSystem != -1) /* -1 => not enabled for automode */ && + (coh->getVideoSystem() != videoSystem)) { coh->setVideoSystem(videoSystem, false); if (frameBufferInitialized) coh->changeOsdResolution(0, true, false); From 440e157ad5139731b111da887f7be13d01673ce1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 29 Mar 2017 08:11:36 +0200 Subject: [PATCH 076/394] locale: minor changes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/923daa87da7613996361a751c62dfa61dd1da556 Author: vanhofen Date: 2017-03-29 (Wed, 29 Mar 2017) Origin message was: ------------------ - locale: minor changes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 6 +++--- data/locale/english.locale | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index db95f8756..d9ed14528 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1252,7 +1252,7 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) -menu.hint_osd_resolution Wählen Sie eine OSD Auflösung +menu.hint_osd_resolution Wählen Sie eine OSD-Auflösung menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird @@ -2319,11 +2319,11 @@ streaminfo.framerate Bildrate streaminfo.framerate_unknown unbekannt streaminfo.head Tech. Information streaminfo.not_available nicht verfügbar -streaminfo.osd_resolution OSD Auflösung +streaminfo.osd_resolution OSD-Auflösung streaminfo.resolution Auflösung streaminfo.signal Empfangssignal streaminfo.videosystem Videosystem -streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. +streaming.busy Einer oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. streaming.slow System oder Datenträger zu langsam! Bitte ggf. einige Aufnahmen beenden. diff --git a/data/locale/english.locale b/data/locale/english.locale index d203308bf..6ea0dd06f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1170,7 +1170,7 @@ menu.hint_key_volumedown Assign button to decrease volume menu.hint_key_volumeup Assign button to increase volume menu.hint_keys Remote control repeat rate\nEdit key bindings menu.hint_lang_pref Configure preferred audio, EPG\nand subtitle languages -menu.hint_language OSD language, timezone\nPreffered audio and subtitles languages +menu.hint_language OSD language, timezone\nPrefered audio and subtitles languages menu.hint_last_radio Start box on selected channel\nif last mode is Radio menu.hint_last_tv Start box on selected channel\nif last mode is TV menu.hint_last_use Start box on last used channel @@ -2319,7 +2319,7 @@ streaminfo.framerate Framerate streaminfo.framerate_unknown unknown streaminfo.head Stream-Information streaminfo.not_available not available -streaminfo.osd_resolution OSD Resolution +streaminfo.osd_resolution OSD resolution streaminfo.resolution Resolution streaminfo.signal Receipt signal streaminfo.videosystem Videosystem From 4aaf207d31784487a66dbe939d57e4edd5c27191 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 21:43:01 +0200 Subject: [PATCH 077/394] epgplus: smoother aligment for channelnumbers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab4adc92d0f7c9f83ac39b4175b1c05bef8467d3 Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - epgplus: smoother aligment for channelnumbers ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 42 +++++++++++++++++++++++++++++++----------- src/gui/epgplus.h | 2 ++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9bf4a36f5..0d4507fbe 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -68,6 +69,7 @@ time_t EpgPlus::duration = 0; int EpgPlus::sliderWidth = 0; int EpgPlus::channelsTableWidth = 0; int EpgPlus::entryFontSize = 0; +int EpgPlus::channelNumberOffset = 0; /* negative size means "screen width in percent" */ static EpgPlus::SizeSetting sizeSettingTable[] = @@ -363,16 +365,12 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, { this->channel = pchannel; + this->displayNumber = ""; + this->displayName = ""; if (pchannel != NULL) { - std::stringstream pdisplayName; - //pdisplayName << pindex + 1 << " " << pchannel->getName(); - if (g_settings.channellist_show_numbers) - pdisplayName << pchannel->number << " " << pchannel->getName(); - else - pdisplayName << pchannel->getName(); - - this->displayName = pdisplayName.str(); + this->displayNumber = to_string(pchannel->number); + this->displayName = pchannel->getName(); } this->index = pindex; @@ -423,8 +421,20 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor, radius, CORNER_LEFT); - this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), - this->width - 2*OFFSET_INNER_MID, this->displayName, color); + int xPos = this->x + OFFSET_INNER_MID; + int numberWidth = 0; + + if (g_settings.channellist_show_numbers) + { + // display channelnumber + int xOffset = EpgPlus::channelNumberOffset - this->font->getRenderWidth(this->displayNumber); + this->font->RenderString(xPos + xOffset, this->y + this->font->getHeight(), this->width - 2*OFFSET_INNER_MID, this->displayNumber, color); + numberWidth = EpgPlus::channelNumberOffset + OFFSET_INNER_SMALL; + xPos += numberWidth; + } + + // display channelname + this->font->RenderString(xPos, this->y + this->font->getHeight(), this->width - numberWidth - 2*OFFSET_INNER_MID, this->displayName, color); if (isSelected) { @@ -484,7 +494,7 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) // paint detailsline if (isSelected) { - int xPos = this->x - DETAILSLINE_WIDTH; + xPos = this->x - DETAILSLINE_WIDTH; int yPosTop = this->y + this->font->getHeight()/2; int yPosBottom = this->footer->y + this->footer->getUsedHeight()/2; @@ -725,6 +735,16 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) this->selectedChannelEntry = this->displayedChannelEntries[selectedChannelEntryIndex - this->channelListStartIndex]; } + + // get largest channelnumber + int n = 1; + for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); + It != this->displayedChannelEntries.end(); + ++It) + { + n = std::max(n, (*It)->channel->number); + } + channelNumberOffset = ChannelEntry::font->getRenderWidth(to_string(n)); } void EpgPlus::init() diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 4cb72f51d..29a6c5e89 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -211,6 +211,7 @@ class EpgPlus //// attributes public: const CZapitChannel * channel; + std::string displayNumber; std::string displayName; int index; @@ -420,6 +421,7 @@ class EpgPlus int channelListStartIndex; int maxNumberOfDisplayableEntries; // maximal number of displayable entrys + static int channelNumberOffset; time_t startTime; time_t firstStartTime; From 83a1fd845b19b113fe8f642be8c7d3db635ca138 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 21:43:01 +0200 Subject: [PATCH 078/394] epgplus: fix selected handling for channelevents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/25e56bf5dfffe479f4980aa02ba966aa7147e5af Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - epgplus: fix selected handling for channelevents ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 0d4507fbe..6e6b83fb2 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -309,13 +309,12 @@ bool EpgPlus::ChannelEventEntry::isSelected(time_t _selectedTime) const void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) { - if (this->channelEvent.description.empty()) - pisSelected = false; + bool selected = this->channelEvent.description.empty() ? false : pisSelected; fb_pixel_t color; fb_pixel_t bgcolor; - getItemColors(color, bgcolor, pisSelected, false, toggleColor); + getItemColors(color, bgcolor, selected, false, toggleColor); this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor); From 5b6034d48f5995eac689ca18a8beeff2bf5244b9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 21:43:01 +0200 Subject: [PATCH 079/394] color: allow to toggle normal <-> enlighten background colors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c75e7f447ba50e0c936306e33453c8f9dd0b180 Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - color: allow to toggle normal <-> enlighten background colors ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/color.cpp | 6 +++--- src/gui/color.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 519674667..ad9cec7e2 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -231,7 +231,7 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv) hsv->v = f_V; } -void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, bool switch_background) +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, bool toggle_background, bool toggle_enlighten) { if (selected && marked) { @@ -255,6 +255,6 @@ void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, boo } // default - t = switch_background ? COL_MENUCONTENTDARK_TEXT : COL_MENUCONTENT_TEXT; - b = switch_background ? COL_MENUCONTENTDARK_PLUS_0 : COL_MENUCONTENT_PLUS_0; + t = toggle_background ? (toggle_enlighten ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTDARK_TEXT) : COL_MENUCONTENT_TEXT; + b = toggle_background ? (toggle_enlighten ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENTDARK_PLUS_0) : COL_MENUCONTENT_PLUS_0; } diff --git a/src/gui/color.h b/src/gui/color.h index 61305ca4e..07a5227d9 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -161,6 +161,6 @@ uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv); -void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool switch_background = false); +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool toggle_background = false, bool toggle_enlighten = false); #endif From 8f10bcefef1b69b358add42e362cd315df340a4a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 21:43:01 +0200 Subject: [PATCH 080/394] epgplus: use enlighten background toggle color Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/41394be62edf54fc91a696c0adfd71b2c661918c Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - epgplus: use enlighten background toggle color ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 6e6b83fb2..9e290bab6 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -314,7 +314,7 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) fb_pixel_t color; fb_pixel_t bgcolor; - getItemColors(color, bgcolor, selected, false, toggleColor); + getItemColors(color, bgcolor, selected, false, toggleColor, true /* toggle enlighten */); this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor); From df1b65524ff1ac314bcc6832c8172fd34df198f5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 21:43:01 +0200 Subject: [PATCH 081/394] epgplus: add missing separationline to clearMark() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a64225c09a6a5a08ab1a87d0c87525c00d342f41 Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - epgplus: add missing separationline to clearMark() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9e290bab6..66be1d059 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -268,6 +268,13 @@ void EpgPlus::TimeLine::clearMark() { this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(), this->width, this->font->getHeight() , COL_MENUCONTENT_PLUS_0); + + // paint the separation line + if (separationLineThickness > 0) + { + this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(), + this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0); + } } int EpgPlus::TimeLine::getUsedHeight() @@ -333,7 +340,8 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0); } - if (pisSelected) { + if (pisSelected) + { if (this->channelEvent.description.empty()) { // dummy channel event this->timeLine->clearMark(); From 21e4bf01d250893554b98511e18584f3d9894fd0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 17:32:46 +0200 Subject: [PATCH 082/394] remove obsolete src/gui/dmx_tspidbandwidth.c Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ea5bcfd74c789712be6b7887a17398111979cb2 Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - remove obsolete src/gui/dmx_tspidbandwidth.c ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/dmx_tspidbandwidth.c | 235 ----------------------------------- 1 file changed, 235 deletions(-) delete mode 100644 src/gui/dmx_tspidbandwidth.c diff --git a/src/gui/dmx_tspidbandwidth.c b/src/gui/dmx_tspidbandwidth.c deleted file mode 100644 index 07ced12f5..000000000 --- a/src/gui/dmx_tspidbandwidth.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * some definition - */ -#define TS_LEN 188 -#define TS_SYNC_BYTE 0x47 -#define TS_BUF_SIZE (TS_LEN * 2048) /* fix dmx buffer size */ - -static unsigned long timeval_to_ms(const struct timeval *tv) -{ - return (tv->tv_sec * 1000) + ((tv->tv_usec + 500) / 1000); -} - -long delta_time_ms (struct timeval *tv, struct timeval *last_tv) -{ - return timeval_to_ms(tv) - timeval_to_ms(last_tv); -} - -int ts_pidbandwidth (OPTION *opt) -{ - - u_char buf[TS_BUF_SIZE]; - struct pollfd pfd; - struct dmx_pes_filter_params flt; - int dmxfd; - struct timeval tv,last_tv, first_tv; - int pid; - uint64_t b_total; - long b; - long packets_bad; - long packets_total; - struct { // simple struct for storing last average bandwidth - unsigned long kb_sec; - unsigned long b_sec; - } last_avg; - - - - - if (opt->ts_raw_mode) { - pid = PID_FULL_TS; - } else { - pid = opt->pid; - } - - - - indent (0); - out_nl (2,""); - out_nl (2,"---------------------------------------------------------"); - out_nl (2,"PID bandwidth statistics..."); - if (opt->ts_raw_mode) { - out (2,"Full Transponder"); - } else { - out (2,"PID: %u (0x%04x)", pid, pid); - } - if (opt->rd_packet_count != 0) { - out (2," - max packet count: %ld ", opt->rd_packet_count); - } - out_nl (2,""); - out_nl (2,"---------------------------------------------------------"); - - - - // -- open DVR device for reading - pfd.events = POLLIN | POLLPRI; - if((pfd.fd = open(opt->devDvr,O_RDONLY|O_NONBLOCK)) < 0){ - IO_error(opt->devDvr); - return -1; - } - - - - if ((dmxfd=open(opt->devDemux,O_RDWR)) < 0) { - IO_error(opt->devDemux); - close(pfd.fd); - return -1; - } - ioctl (dmxfd,DMX_SET_BUFFER_SIZE, sizeof(buf)); - - flt.pid = pid; - flt.input = DMX_IN_FRONTEND; - flt.output = DMX_OUT_TS_TAP; - flt.pes_type = DMX_PES_OTHER; - flt.flags = DMX_IMMEDIATE_START; - if (ioctl(dmxfd, DMX_SET_PES_FILTER, &flt) < 0) { - IO_error("DMX_SET_PES_FILTER"); - close(pfd.fd); - close(dmxfd); - return -1; - } - - - - gettimeofday (&first_tv, NULL); - last_tv.tv_sec = first_tv.tv_sec; - last_tv.tv_usec = first_tv.tv_usec; - - b_total = 0; - packets_total = 0; - packets_bad = 0; - - while ( !isSigAbort() ) { - int b_len, b_start; - - // -- we will poll the PID in 2 secs intervall - int timeout = 2000; - - b_len = 0; - b_start = 0; - if (poll(&pfd, 1, timeout) > 0) { - if (pfd.revents & POLLIN) { - - b_len = read(pfd.fd, buf, sizeof(buf)); - gettimeofday (&tv, NULL); - - - if (b_len >= TS_LEN) { - b_start = sync_ts (buf, b_len); - } else { - b_len = 0; - } - - b = b_len - b_start; - if (b == 0) continue; - if (b < 0) { - IO_error("read"); - continue; - } - - b_total += b; - - - - // -- calc bandwidth - - { - uint64_t bit_s; - long d_tim_ms; - int packets; - - packets = b/TS_LEN; - packets_total += packets; - - - // output on different verbosity levels - // -- current bandwidth - d_tim_ms = delta_time_ms (&tv, &last_tv); - if (d_tim_ms <= 0) d_tim_ms = 1; // ignore usecs - - out (3, "packets read: %3d/(%ld) d_time: %2ld.%03ld s = ", - packets, packets_total, d_tim_ms / 1000UL, d_tim_ms % 1000UL); - - // -- current bandwidth in kbit/sec - // --- cast to uint64_t so it doesn't overflow as - // --- early, add time / 2 before division for correct rounding - bit_s = (((uint64_t)b * 8000ULL) + ((uint64_t)d_tim_ms / 2ULL)) - / (uint64_t)d_tim_ms; - - out (1, "%5llu.%03llu kbit/s", bit_s / 1000ULL, bit_s % 1000ULL); - - - // -- average bandwidth - d_tim_ms = delta_time_ms (&tv,&first_tv); - if (d_tim_ms <= 0) d_tim_ms = 1; // ignore usecs - - bit_s = ((b_total * 8000ULL) + ((uint64_t)d_tim_ms / 2ULL)) - / (uint64_t)d_tim_ms; - - last_avg.kb_sec = (unsigned long) (bit_s / 1000ULL); - last_avg.b_sec = (unsigned long) (bit_s % 1000ULL); - - out (2, " (Avrg: %5lu.%03lu kbit/s)", last_avg.kb_sec, last_avg.b_sec); - - - // -- bad packet(s) check in buffer - { - int bp; - - bp = ts_error_count (buf+b_start, b); - packets_bad += bp; - out (4, " [bad: %d]", bp); - } - - out_NL (1); - - } - - - last_tv.tv_sec = tv.tv_sec; - last_tv.tv_usec = tv.tv_usec; - - - - // count packets ? - if (opt->rd_packet_count > 0) { - opt->rd_packet_count -= b/TS_LEN; - if (opt->rd_packet_count <= 0) break; - } - - - } - } - - } - - - // -- packets stats - - out (4, "## "); - - if (opt->ts_raw_mode) { out (2,"PID: "); - } else { out (2,"PID: %u (0x%04x)", pid, pid); - } - - out (4, " bad/total packets: %ld/%ld (= %1.1Lf%%)", - packets_bad, packets_total, - (((long double) packets_bad)*100)/packets_total ); - out (4, " Avrg: %5lu.%03lu kbit/s", - last_avg.kb_sec, last_avg.b_sec); - out_NL(4); - - - - - if (ioctl(dmxfd, DMX_STOP) < 0) { - IO_error("DMX_STOP"); - } - close(dmxfd); - close(pfd.fd); - - - return 0; - -} - From 290eb19dae36e1bd4e8f93d1eaee5f7c910a4a50 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 17:32:46 +0200 Subject: [PATCH 083/394] remove obsolete src/driver/wav.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3a1ef47dc4b03b16972797b86da57596c4ce1bc Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - remove obsolete src/driver/wav.h ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/wav.h | 65 ------------------------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 src/driver/wav.h diff --git a/src/driver/wav.h b/src/driver/wav.h deleted file mode 100644 index 1b108b746..000000000 --- a/src/driver/wav.h +++ /dev/null @@ -1,65 +0,0 @@ -static unsigned char click[] = { -0xE5, 0xF5, 0xFF, 0xF7, 0x18, 0xFA, 0x7F, 0xFB, 0x98, 0xFD, 0xFF, 0xFE, 0x17, 0x01, 0x31, 0x03, -0x4A, 0x05, 0xB1, 0x06, 0xCA, 0x08, 0xCA, 0x0F, 0xCA, 0x16, 0x97, 0x12, 0x17, 0x0F, 0xFE, 0x13, -0xE4, 0x18, 0x7E, 0x17, 0x17, 0x16, 0x64, 0x15, 0x64, 0x15, 0xE4, 0x18, 0x17, 0x1D, 0xCA, 0x1D, -0x7E, 0x1E, 0xCA, 0x24, 0x17, 0x2B, 0xE4, 0x26, 0x64, 0x23, 0x31, 0x2D, 0xFE, 0x36, 0x7E, 0x33, -0xB1, 0x30, 0x17, 0x32, 0x7E, 0x33, 0x64, 0x2A, 0x4A, 0x21, 0x64, 0x15, 0x7E, 0x09, 0x97, 0x04, -0xB2, 0xFF, 0xB2, 0xF1, 0xB2, 0xE3, 0xFF, 0xE2, 0x4B, 0xE2, 0x32, 0xD9, 0xCB, 0xD0, 0x7F, 0xD1, -0xE5, 0xD2, 0x18, 0xD0, 0x4B, 0xCD, 0x65, 0xC8, 0x7F, 0xC3, 0xCB, 0xC2, 0x18, 0xC2, 0x18, 0xC2, -0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0xCB, 0xC2, -0x7F, 0xC3, 0x18, 0xC9, 0xB2, 0xCE, 0xFF, 0xD4, 0x4B, 0xDB, 0x4B, 0xE2, 0x4B, 0xE9, 0xE5, 0xEE, -0x32, 0xF5, 0x7F, 0xFB, 0xCA, 0x01, 0x17, 0x08, 0x17, 0x0F, 0xFE, 0x13, 0x97, 0x19, 0xCA, 0x1D, -0xB1, 0x22, 0x31, 0x26, 0xB1, 0x29, 0xCA, 0x2B, 0x97, 0x2E, 0x4A, 0x2F, 0xB1, 0x30, 0xFE, 0x2F, -0xFE, 0x2F, 0xE4, 0x2D, 0x7E, 0x2C, 0xFE, 0x28, 0x31, 0x26, 0xFE, 0x21, 0xCA, 0x1D, 0x31, 0x18, -0x4A, 0x13, 0xB1, 0x0D, 0x17, 0x08, 0xCA, 0x01, 0x7F, 0xFB, 0x32, 0xF5, 0x98, 0xEF, 0x4B, 0xE9, -0xB2, 0xE3, 0x18, 0xDE, 0x7F, 0xD8, 0x98, 0xD3, 0x65, 0xCF, 0x32, 0xCB, 0xB2, 0xC7, 0xE5, 0xC4, -0xCB, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x7F, 0xC3, 0x98, 0xC5, 0x65, 0xC8, -0xE5, 0xCB, 0x18, 0xD0, 0xFF, 0xD4, 0x98, 0xDA, 0x32, 0xE0, 0x7F, 0xE6, 0x7F, 0xED, 0x7F, 0xF4, -0x32, 0xFC, 0xE4, 0x03, 0x97, 0x0B, 0xE4, 0x11, 0x31, 0x18, 0x31, 0x1F, 0x31, 0x26, 0x7E, 0x2C, -0x7E, 0x33, 0xB1, 0x37, 0x97, 0x3C, 0x4A, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, -0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xFE, 0x3D, 0xCA, 0x39, -0x97, 0x35, 0xFE, 0x2F, 0x17, 0x2B, 0xCA, 0x24, 0x7E, 0x1E, 0x7E, 0x17, 0x7E, 0x10, 0x7E, 0x09, -0x31, 0x03, 0xE5, 0xFC, 0x4B, 0xF7, 0xFF, 0xF0, 0x65, 0xEB, 0x7F, 0xE6, 0x98, 0xE1, 0xCB, 0xDE, -0xFF, 0xDB, 0x32, 0xD9, 0x65, 0xD6, 0xFF, 0xD4, 0x4B, 0xD4, 0xFF, 0xD4, 0x65, 0xD6, 0x7F, 0xD8, -0x98, 0xDA, 0x65, 0xDD, 0xE5, 0xE0, 0x18, 0xE5, 0x4B, 0xE9, 0xE5, 0xEE, 0x32, 0xF5, 0xCB, 0xFA, -0x64, 0x00, 0xB1, 0x06, 0xFE, 0x0C, 0x4A, 0x13, 0x4A, 0x1A, 0xE4, 0x1F, 0x7E, 0x25, 0xB1, 0x29, -0x97, 0x2E, 0x17, 0x32, 0x4A, 0x36, 0x17, 0x39, 0x97, 0x3C, 0x97, 0x3C, 0x4A, 0x3D, 0x4A, 0x3D, -0x4A, 0x3D, 0x31, 0x3B, 0xCA, 0x39, 0x4A, 0x36, 0x7E, 0x33, 0x97, 0x2E, 0xB1, 0x29, 0x17, 0x24, -0x31, 0x1F, 0x31, 0x18, 0xE4, 0x11, 0xE4, 0x0A, 0xE4, 0x03, 0xE5, 0xFC, 0xE5, 0xF5, 0x98, 0xEF, -0x4B, 0xE9, 0xFF, 0xE2, 0x65, 0xDD, 0xCB, 0xD7, 0xE5, 0xD2, 0xB2, 0xCE, 0x32, 0xCB, 0x65, 0xC8, -0x4B, 0xC6, 0xE5, 0xC4, 0x7F, 0xC3, 0x32, 0xC4, 0xE5, 0xC4, 0xB2, 0xC7, 0x7F, 0xCA, 0xFF, 0xCD, -0x7F, 0xD1, 0x65, 0xD6, 0x4B, 0xDB, 0x98, 0xE1, 0xE5, 0xE7, 0x32, 0xEE, 0x32, 0xF5, 0x7F, 0xFB, -0x7E, 0x02, 0xCA, 0x08, 0xCA, 0x0F, 0x17, 0x16, 0x17, 0x1D, 0xFE, 0x21, 0xE4, 0x26, 0x17, 0x2B, -0x4A, 0x2F, 0x17, 0x32, 0x97, 0x35, 0x4A, 0x36, 0xB1, 0x37, 0xFE, 0x36, 0x4A, 0x36, 0x31, 0x34, -0x17, 0x32, 0x97, 0x2E, 0x17, 0x2B, 0x7E, 0x25, 0x97, 0x20, 0x4A, 0x1A, 0xB1, 0x14, 0x4A, 0x0C, -0x97, 0x04, 0x4B, 0xFE, 0xB2, 0xF8, 0x4B, 0xF0, 0xE5, 0xE7, 0x98, 0xE1, 0xFF, 0xDB, 0x65, 0xD6, -0xCB, 0xD0, 0x4B, 0xCD, 0x7F, 0xCA, 0x65, 0xC8, 0x4B, 0xC6, 0xE5, 0xC4, 0x7F, 0xC3, 0x98, 0xC5, -0x65, 0xC8, 0xCB, 0xC9, 0xE5, 0xCB, 0x18, 0xD0, 0xFF, 0xD4, 0xE5, 0xD9, 0x7F, 0xDF, 0x18, 0xE5, -0x65, 0xEB, 0xB2, 0xF1, 0xB2, 0xF8, 0xFF, 0xFE, 0xFE, 0x05, 0xFE, 0x0C, 0xFE, 0x13, 0x97, 0x19, -0xE4, 0x1F, 0x7E, 0x25, 0x17, 0x2B, 0x97, 0x2E, 0xCA, 0x32, 0x97, 0x35, 0x17, 0x39, 0xCA, 0x39, -0x7E, 0x3A, 0xCA, 0x39, 0x17, 0x39, 0xFE, 0x36, 0xE4, 0x34, 0xFE, 0x2F, 0x17, 0x2B, 0xCA, 0x24, -0x31, 0x1F, 0x7E, 0x17, 0x7E, 0x10, 0x17, 0x08, 0x64, 0x00, 0xFF, 0xF7, 0x98, 0xEF, 0x32, 0xE7, -0x7F, 0xDF, 0xCB, 0xD7, 0x18, 0xD0, 0xCB, 0xC9, 0x32, 0xC4, 0xCB, 0xC2, 0x18, 0xC2, 0x18, 0xC2, -0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x98, 0xC5, 0xCB, 0xC9, 0x18, 0xD0, -0x65, 0xD6, 0x18, 0xDE, 0xCB, 0xE5, 0x7F, 0xED, 0x32, 0xF5, 0xE5, 0xFC, 0x4A, 0x05, 0x97, 0x0B, -0x97, 0x12, 0x31, 0x18, 0x7E, 0x1E, 0xB1, 0x22, 0xE4, 0x26, 0xB1, 0x29, 0x7E, 0x2C, 0x31, 0x2D, -0x97, 0x2E, 0xE4, 0x2D, 0xE4, 0x2D, 0xCA, 0x2B, 0xB1, 0x29, 0x31, 0x26, 0x64, 0x23, 0x7E, 0x1E, -0x4A, 0x1A, 0xB1, 0x14, 0x17, 0x0F, 0xCA, 0x08, 0x7E, 0x02, 0x32, 0xFC, 0x98, 0xF6, 0xE5, 0xEE, -0xE5, 0xE7, 0xE5, 0xE0, 0x98, 0xDA, 0x65, 0xD6, 0x32, 0xD2, 0xFF, 0xCD, 0xCB, 0xC9, 0x98, 0xC5, -0x18, 0xC2, 0x18, 0xC2, 0x18, 0xC2, 0x32, 0xC4, 0xFF, 0xC6, 0xCB, 0xC9, 0x98, 0xCC, 0x32, 0xD2, -0x7F, 0xD8, 0xE5, 0xE0, 0xFF, 0xE9, 0x65, 0xF2, 0xCB, 0xFA, 0x31, 0x03, 0x97, 0x0B, 0xFE, 0x13, -0x64, 0x1C, 0x64, 0x23, 0x17, 0x2B, 0x97, 0x2E, 0x17, 0x32, 0x31, 0x34, 0x4A, 0x36, 0x4A, 0x36, -0x4A, 0x36, 0xCA, 0x32, 0x4A, 0x2F, 0x64, 0x2A, 0x7E, 0x25, 0xE4, 0x1F, 0x4A, 0x1A, 0x4A, 0x13, -0x4A, 0x0C, 0x4A, 0x05, 0x4B, 0xFE, 0xFF, 0xF7, 0x65, 0xF2, 0xCB, 0xEC, 0x32, 0xE7, 0xFF, 0xE2, -0xCB, 0xDE, 0x4B, 0xDB, 0xCB, 0xD7, 0xFF, 0xD4, 0xE5, 0xD2, 0x7F, 0xD1, 0x18, 0xD0, 0x18, 0xD0, -0xCB, 0xD0, 0x32, 0xD2, 0x98, 0xD3, 0x65, 0xD6, 0x32, 0xD9, 0x18, 0xDE, 0xFF, 0xE2, 0x4B, 0xE9, -0x98, 0xEF, 0x98, 0xF6, 0x4B, 0xFE, 0xB1, 0x06, 0x17, 0x0F, 0x7E, 0x17, 0xE4, 0x1F, 0x31, 0x26, -0x31, 0x2D, 0x64, 0x31, 0x4A, 0x36, 0x64, 0x38, 0x7E, 0x3A, 0x17, 0x39, 0x64, 0x38, 0x7E, 0x33, -0x97, 0x2E, 0x97, 0x27, 0x4A, 0x21, 0x97, 0x19, 0xE4, 0x11, 0xCA, 0x08, 0xB2, 0xFF, 0x4B, 0xF7, -0xE5, 0xEE, 0xE5, 0xE7, 0x98, 0xE1, 0xB2, 0xDC, 0xCB, 0xD7, 0xB2, 0xD5, 0x98, 0xD3, 0x98, 0xD3, -0x98, 0xD3, 0xFF, 0xD4, 0x65, 0xD6, 0x32, 0xD9, 0xFF, 0xDB, 0x7F, 0xDF, 0xFF, 0xE2, 0x7F, 0xE6, -0xB2, 0xEA, 0xE5, 0xEE, 0xCB, 0xF3, 0xB2, 0xF8, 0x98, 0xFD, 0x7E, 0x02, 0x17, 0x08, 0xB1, 0x0D, -0xFE, 0x13, 0x4A, 0x1A, 0x97, 0x20, 0x7E, 0x25, 0x17, 0x2B, 0x4A, 0x2F, 0x31, 0x34, 0x4A, 0x36, -0x64, 0x38, 0xFE, 0x36, 0x4A, 0x36, 0x17, 0x32, 0xE4, 0x2D, 0xE4, 0x26, 0xE4, 0x1F, 0x17, 0x16, -0x4A, 0x0C, 0xCA, 0x01, 0xFF, 0xF7, 0x32, 0xEE -}; From d291aa3c22adbd96521ee47123ec07966634efcc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 23:12:41 +0200 Subject: [PATCH 084/394] channellist: simplify MaxChanNr() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/763f16ccca61817d1c7152dbd9671269ba0a5d55 Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - channellist: simplify MaxChanNr() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index bb016b2e1..2d02382cc 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -68,6 +68,7 @@ #else #include #endif +#include #include #include @@ -1276,7 +1277,7 @@ int CChannelList::numericZap(int key) } return res; } - size_t maxchansize = MaxChanNr().size(); + size_t maxchansize = MaxChanNr().size(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth(); int sx = maxchansize * fw + (fw/2); int sy = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight() + 6; @@ -2288,19 +2289,14 @@ bool CChannelList::SameTP(CZapitChannel * channel) return iscurrent; } -std::string CChannelList::MaxChanNr() +std::string CChannelList::MaxChanNr() { - zapit_list_it_t chan_it; - std::stringstream ss; - std::string maxchansize; - int chan_nr_max = 1; - unsigned int nr = 0; - for (chan_it=(*chanlist).begin(); chan_it!=(*chanlist).end(); ++chan_it) { - chan_nr_max = std::max(chan_nr_max, (*chanlist)[nr++]->number); + int n = 1; + for (zapit_list_it_t it = (*chanlist).begin(); it != (*chanlist).end(); ++it) + { + n = std::max(n, (*it)->number); } - ss << chan_nr_max; - ss >> maxchansize; - return maxchansize; + return to_string(n); } void CChannelList::paintPig (int _x, int _y, int w, int h) From c03b2777cd4ca834fae528169478c1b18473c865 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 23:12:41 +0200 Subject: [PATCH 085/394] channellist: a bit more offset for item; fix progressbar's width use OFFSET defines for logo in header and in right infozone Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e6746e2aa0d912fcf61aca88c74fd8776f2e00e Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - channellist: a bit more offset for item; fix progressbar's width use OFFSET defines for logo in header and in right infozone ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 52 +++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2d02382cc..03057fe87 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1900,10 +1900,10 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int prg_offset = 0; int title_offset = 0; int rec_mode; - if(g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) + if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); - title_offset = OFFSET_INNER_SMALL; + title_offset = OFFSET_INNER_MID; } snprintf(tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number); @@ -1994,16 +1994,16 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (curr == selected && move_state == beMoving) { frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight); } else if (edit_state && chan->bLocked) { frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight); } else if (g_settings.channellist_show_numbers) { - int numpos = x + OFFSET_INNER_SMALL + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); + int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight); } else if (!edit_state) @@ -2017,9 +2017,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) else l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); - int pb_space = prg_offset - title_offset; + int pb_width = prg_offset; int pb_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getDigitHeight(); - CProgressBar pb(x + OFFSET_INNER_SMALL + numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0); + CProgressBar pb(x + OFFSET_INNER_MID + numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_width, pb_height, COL_MENUCONTENT_PLUS_0); pb.setType(CProgressBar::PB_TIMESCALE); pb.setDesign(g_settings.theme.progressbar_design_channellist); pb.setCornerType(0); @@ -2032,28 +2032,28 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } pb.setFrameThickness(pb_frame); pb.doPaintBg(false); - int pb_max = pb_space - 4; if (!(p_event->description.empty())) { - snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); + snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l, g_settings.channellist_epgtext_align_right ? " " : " - "); unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description); - int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 2*OFFSET_INNER_MID - offset_right; // 15 = scrollbar + int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 3*OFFSET_INNER_MID - offset_right; // 15 = scrollbar if (max_desc_len < 0) max_desc_len = 0; if ((int) ch_desc_len > max_desc_len) ch_desc_len = max_desc_len; - if(g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { + if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) + { if(displayNext) { struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_SMALL + numwidth + 6, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); } else { @@ -2063,32 +2063,34 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (((jetzt - p_event->startTime + 30) / 60) < 0 ) runningPercent= 0; else - runningPercent=(jetzt-p_event->startTime) * pb_max / p_event->duration; + runningPercent=(jetzt-p_event->startTime) * pb_width / p_event->duration; - pb.setValues(runningPercent, pb_max); + pb.setValues(runningPercent, pb_width); pb.paint(); } } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); - if (g_settings.channellist_epgtext_align_right) { + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + if (g_settings.channellist_epgtext_align_right) + { // align right g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 15 - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } - else { + else + { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + ch_name_len + OFFSET_INNER_SMALL + prg_offset, ypos + fheight, ch_desc_len, p_event->description, ecolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID + ch_name_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } } else { if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { - pb.setValues(0, pb_max); + pb.setValues(0, pb_width); pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); } if (!firstpaint && curr == selected) updateVfd(); @@ -2157,7 +2159,7 @@ void CChannelList::paintHead() if (!header->getContextBtnObject()->empty()) header->removeContextButtons(); header->enableClock(true, "%H:%M", "%H %M", true); - logo_off = header->getClockObject()->getWidth() + 10; + logo_off = header->getClockObject()->getWidth() + OFFSET_INNER_MID; header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); }else{ @@ -2168,7 +2170,7 @@ void CChannelList::paintHead() } } else - logo_off = 10; + logo_off = OFFSET_INNER_MID; header->paint(CC_SAVE_SCREEN_NO); } @@ -2382,7 +2384,7 @@ void CChannelList::paint_events(CChannelEventList &evtlist) frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; - int eventStartTimeWidth = 4 * g_Font[eventFont]->getMaxDigitWidth() + g_Font[eventFont]->getRenderWidth(":") + 5; // use a fixed value + int eventStartTimeWidth = 4 * g_Font[eventFont]->getMaxDigitWidth() + g_Font[eventFont]->getRenderWidth(":") + OFFSET_INNER_SMALL; // use a fixed value int startTimeWidth = 0; CChannelEventList::iterator e; time_t azeit; @@ -2431,9 +2433,9 @@ void CChannelList::paint_events(CChannelEventList &evtlist) strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); startTimeWidth = eventStartTimeWidth; - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color); + g_Font[eventFont]->RenderString(x+ width+ OFFSET_INNER_MID, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color); } - g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, color); + g_Font[eventFont]->RenderString(x+ width+ OFFSET_INNER_MID +startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 2*OFFSET_INNER_MID, e->description, color); } else { From 0122d290787a3206db9013a9997e4cb824e0d72b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 09:31:21 +0200 Subject: [PATCH 086/394] eventlist: use OFFSET defines for right infobox Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a1f174b80a928705a2081a6cff7ffebd7e1c8236 Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - eventlist: use OFFSET defines for right infobox ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 315acf576..f8209f6d5 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -300,7 +300,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna // init right info_zone if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) - cc_infozone = new CComponentsText(x+width+10, y+theight, infozone_width-20, listmaxshow*fheight); + cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); int res = menu_return::RETURN_REPAINT; //printf("CEventList::exec: channel_id %llx\n", channel_id); From d1ebb017190476cf9ad6d99bf4ad4e8827f125a2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 09:31:21 +0200 Subject: [PATCH 087/394] channelist: use OFFSET defines for bottom detailsbox Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4a0e8faf1e2a5bd7723b8c7bbf8e8848dccd433 Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - channelist: use OFFSET defines for bottom detailsbox ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 03057fe87..7824f0b5c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1559,8 +1559,8 @@ void CChannelList::paintDetails(int index) std::string text1= p_event->description; std::string text2= p_event->text; - int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) + int xstart = OFFSET_INNER_MID; + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 3*OFFSET_INNER_MID - seit_len) ) { // zu breit, Umbruch versuchen... int pos; @@ -1568,7 +1568,7 @@ void CChannelList::paintDetails(int index) pos = text1.find_last_of("[ -.]+"); if ( pos!=-1 ) text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 30 - seit_len) ) ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1) > (full_width - 3*OFFSET_INNER_MID - seit_len) ) ); std::string text3 = ""; /* not perfect, but better than crashing... */ if (p_event->description.length() > text1.length()) @@ -1578,7 +1578,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID, ypos_a + 2*fheight, full_width - 3*OFFSET_INNER_MID - noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } if (!(text2.empty())) { @@ -1587,7 +1587,7 @@ void CChannelList::paintDetails(int index) text2 = text2.substr( 0, text2.find('\n') ); #if 0 //FIXME: to discuss, eat too much cpu time if string long enough int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2) > (full_width - 30 - noch_len) ) ) { + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2) > (full_width - 3*OFFSET_INNER_MID - noch_len) ) ) { pos = text2.find_last_of(" "); if ( pos!=-1 ) { @@ -1595,18 +1595,18 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, ypos_a + fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + xstart, ypos_a + fdescrheight+ fheight, full_width- xstart- 3*OFFSET_INNER_MID- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, ypos_a + fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, ypos_a + fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + fheight, full_width - 3*OFFSET_INNER_MID - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- seit_len, ypos_a + fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- noch_len, ypos_a + fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } else if (IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + fheight, full_width - 3*OFFSET_INNER_MID, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); } if (g_settings.channellist_foot == 0 && IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight + fdescrheight, full_width - 30, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight + fdescrheight, full_width - 3*OFFSET_INNER_MID, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); } else if(g_settings.channellist_foot == 0) { transponder t; CServiceManager::getInstance()->GetTransponder((*chanlist)[index]->getTransponderId(), t); @@ -1617,7 +1617,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName((*chanlist)[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight +fdescrheight, full_width - 3*OFFSET_INNER_MID, desc.c_str(), COL_MENUCONTENTDARK_TEXT); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event @@ -1631,8 +1631,8 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, ypos_a + 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ OFFSET_INNER_MID, ypos_a + 2*fheight+ fdescrheight, full_width - 3*OFFSET_INNER_MID - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- OFFSET_INNER_MID- from_len, ypos_a + 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } } } From cca8fbd2852fcb0313acb551ef68249b9d8c7d0c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 09:31:22 +0200 Subject: [PATCH 088/394] osd_setup: a bit smaller font for epgplus-items; ... it's now aligned to epgview's fontsizes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a17b434b6e5256915c102cde7a80675cfb5d15c Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - osd_setup: a bit smaller font for epgplus-items; ... it's now aligned to epgview's fontsizes ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index d36a1e7df..60cd9ebfc 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -198,7 +198,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2}, {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EPG_DATE , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, - {LOCALE_FONTSIZE_EPGPLUS_ITEM , 18, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_EPGPLUS_ITEM , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_EVENTLIST_TITLE , 30, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, From cd40e9c6a70378b58dde3a234321e2962f7ae298 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 10:04:03 +0200 Subject: [PATCH 089/394] channellist: one more missing OFFSET define Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/31979a4f8776e16744a9fad61901822e456b5b5a Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - channellist: one more missing OFFSET define ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7824f0b5c..571b2af6d 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -495,7 +495,7 @@ void CChannelList::calcSize() // calculate height (the infobox below mainbox is handled outside height) if (g_settings.channellist_show_infobox) - info_height = 2*fheight + fdescrheight + 10; + info_height = 2*fheight + fdescrheight + 2*OFFSET_INNER_SMALL; else info_height = 0; height = pig_on_win ? frameBuffer->getScreenHeight(): frameBuffer->getScreenHeightRel(); From 09237ad821faae6d04716f30cd32b8c448566ffc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 10:04:04 +0200 Subject: [PATCH 090/394] channelist: rename bool pig_on_win to minitv_is_active Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42aca4a4c98d50d4672d26eff8304c65e3ed1836 Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - channelist: rename bool pig_on_win to minitv_is_active ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 14 +++++++------- src/gui/channellist.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 571b2af6d..8499c38c5 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -125,7 +125,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl dline = NULL; cc_minitv = NULL; logo_off = 0; - pig_on_win = false; + minitv_is_active = false; CChannelLogo = NULL; headerNew = true; bouquet = NULL; @@ -484,9 +484,9 @@ void CChannelList::calcSize() fheight = 1; /* avoid div-by-zero crash on invalid font */ footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; - pig_on_win = ( (g_settings.channellist_additional == 2) /* with miniTV */ && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); + minitv_is_active = ( (g_settings.channellist_additional == 2) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width - full_width = pig_on_win ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); + full_width = minitv_is_active ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); if (g_settings.channellist_additional) width = full_width / 3 * 2; @@ -498,7 +498,7 @@ void CChannelList::calcSize() info_height = 2*fheight + fdescrheight + 2*OFFSET_INNER_SMALL; else info_height = 0; - height = pig_on_win ? frameBuffer->getScreenHeight(): frameBuffer->getScreenHeightRel(); + height = minitv_is_active ? frameBuffer->getScreenHeight() : frameBuffer->getScreenHeightRel(); height = height - OFFSET_INTER - info_height; // calculate x position @@ -522,7 +522,7 @@ void CChannelList::calcSize() // calculate width/height of right info_zone and pip-box infozone_width = full_width - width; pig_width = infozone_width; - if ( pig_on_win /* with miniTV */ ) + if (minitv_is_active) pig_height = (pig_width * 9) / 16; else pig_height = 0; @@ -2210,7 +2210,7 @@ void CChannelList::paintBody() liststart = (selected/listmaxshow)*listmaxshow; updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); - if (pig_on_win) // with miniTV + if (minitv_is_active) paintPig(x+width, y+theight, pig_width, pig_height); // paint background for main box @@ -2301,7 +2301,7 @@ std::string CChannelList::MaxChanNr() return to_string(n); } -void CChannelList::paintPig (int _x, int _y, int w, int h) +void CChannelList::paintPig(int _x, int _y, int w, int h) { //init minitv object with basic properties if (cc_minitv == NULL){ diff --git a/src/gui/channellist.h b/src/gui/channellist.h index f5addbe68..75ac35a63 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -131,7 +131,7 @@ private: bool vlist; // "virtual" list, not bouquet bool displayNext; bool displayList; - bool pig_on_win; + bool minitv_is_active; bool headerNew; From 93bdb67b0cdc5e36a6534c074cb9d0b56f7e5de3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Apr 2017 13:28:54 +0200 Subject: [PATCH 091/394] settings: fix calculation for SCROLLBAR_WIDTH ... to work with subtractions too Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bfee0b7dcdd689c953019db733909a64497f283 Author: vanhofen Date: 2017-04-12 (Wed, 12 Apr 2017) Origin message was: ------------------ - settings: fix calculation for SCROLLBAR_WIDTH ... to work with subtractions too ------------------ This commit was generated by Migit --- src/system/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/settings.h b/src/system/settings.h index 520ae7809..fa2ec6e94 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -920,7 +920,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define OFFSET_INNER_MIN 2 #define OFFSET_INNER_NONE 0 -#define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN +#define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) #define DETAILSLINE_WIDTH 16 // TODO: scale2Res() ? From 274e811e0603f6703e7e20caa5b7757111f85516 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 13 Apr 2017 11:20:10 +0200 Subject: [PATCH 092/394] epgplus: get sure we have enough space for detailsline Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf229bb3afba74fa5476be2d48cf026b14b475ac Author: vanhofen Date: 2017-04-13 (Thu, 13 Apr 2017) Origin message was: ------------------ - epgplus: get sure we have enough space for detailsline ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 66be1d059..de34c6063 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -803,6 +803,8 @@ void EpgPlus::init() this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); + if (this->usableScreenX < DETAILSLINE_WIDTH) + this->usableScreenX = DETAILSLINE_WIDTH; this->usableScreenY = getScreenStartY(this->usableScreenHeight); this->headerX = this->usableScreenX; From b3fa50e4c3604bde945b79b0fefb8264230c3210 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 13 Apr 2017 11:20:10 +0200 Subject: [PATCH 093/394] bouquetlist: rework; ... * use OFFSET defines * use CComponentsFooter to paint footer * use CComponentsScrollBar to paint scrollbar * use a bit more offset for items * re-align status icons in items * use same scambled-icon as used in channellist Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4ea2f46c7c7751b0f4961a0219e5812a5be48da6 Author: vanhofen Date: 2017-04-13 (Thu, 13 Apr 2017) Origin message was: ------------------ - bouquetlist: rework; ... * use OFFSET defines * use CComponentsFooter to paint footer * use CComponentsScrollBar to paint scrollbar * use a bit more offset for items * re-align status icons in items * use same scambled-icon as used in channellist ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 118 +++++++++++++++++++++------------------- src/gui/bouquetlist.h | 6 +- 2 files changed, 66 insertions(+), 58 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 4794e2579..4a5b6c9a0 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2009,2011,2013,2015-2017 Stefan Seyfried + Copyright (C) 2017 Sven Hoefer License: GPL @@ -67,7 +68,6 @@ CBouquetList::CBouquetList(const char * const Name) name = g_Locale->getText(LOCALE_BOUQUETLIST_HEAD); else name = Name; - } CBouquetList::~CBouquetList() @@ -411,7 +411,8 @@ int CBouquetList::show(bool bShowChannelList) int h_max_icon = 0; favonly = !bShowChannelList; - for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ + for (unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); count++) + { int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); @@ -419,26 +420,32 @@ int CBouquetList::show(bool bShowChannelList) h_max_icon = std::max(h_max_icon, icol_h); } - int need_width = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0])*(w_max_icon + w_max_text + 20); - CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + item_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - width = w_max (need_width, 20); - height = h_max (16 * fheight, 40); + /* + We align width to needed footer space, + but this manual calculation isn't a good idea. + It would be better to get the needed width from + CComponententsFooter class. + */ + width = (sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]))*(w_max_icon + w_max_text + 2*OFFSET_INNER_MID); + height = 16*item_height; - footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - listmaxshow = (height - theight - footerHeight)/fheight; - height = theight + footerHeight + listmaxshow * fheight; // recalc height + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + footer_height = header_height; + listmaxshow = (height - header_height - footer_height)/item_height; + height = header_height + footer_height + listmaxshow*item_height; // recalc height - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; + x = getScreenStartX(width); + y = getScreenStartY(height); int lmaxpos= 1; int i= Bouquets.size(); while ((i= i/10)!=0) lmaxpos++; + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); + COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); @@ -471,7 +478,7 @@ int CBouquetList::show(bool bShowChannelList) { selected = oldselected; if(fader.StartFadeOut()) { - timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + timeoutEnd = CRCInput::calcTimeoutEnd(1); msg = 0; } else loop=false; @@ -563,7 +570,7 @@ int CBouquetList::show(bool bShowChannelList) pos = 1; } } else { - chn = chn * 10 + CRCInput::getNumericValue(msg); + chn = chn*10 + CRCInput::getNumericValue(msg); pos++; } @@ -591,6 +598,7 @@ int CBouquetList::show(bool bShowChannelList) fader.StopFade(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + if (save_bouquets) { save_bouquets = false; #if 0 @@ -602,7 +610,8 @@ int CBouquetList::show(bool bShowChannelList) if (g_settings.epg_scan == CEpgScan::SCAN_SEL) CEpgScan::getInstance()->Start(); } - if(zapOnExit) + + if (zapOnExit) return (selected); return (res); @@ -610,13 +619,13 @@ int CBouquetList::show(bool bShowChannelList) void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height+10); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } void CBouquetList::paintItem(int pos) { - int ypos = y+ theight+0 + pos*fheight; + int ypos = y + header_height + pos*item_height; bool iscurrent = true; int npos = liststart + pos; const char * lname = NULL; @@ -633,8 +642,8 @@ void CBouquetList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if (npos < (int) Bouquets.size()) lname = (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bFav) ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : Bouquets[npos]->channelList->getName(); @@ -657,33 +666,33 @@ void CBouquetList::paintItem(int pos) } } - if(npos < (int) Bouquets.size()) { - char tmp[10]; - sprintf((char*) tmp, "%d", npos+ 1); + if (npos < (int) Bouquets.size()) { + char num[10]; + sprintf((char*) num, "%d", npos + 1); int iw = 0, ih = 0; if ((g_settings.epg_scan == CEpgScan::SCAN_SEL) && Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bScanEpg) { frameBuffer->getIconSize(NEUTRINO_ICON_EPG, &iw, &ih); if (iw && ih) { - int icon_x = (x+width-2) - RADIUS_LARGE/2 - iw; - frameBuffer->paintIcon(NEUTRINO_ICON_EPG, icon_x - iw, ypos, fheight); - iw = iw + 4 + RADIUS_LARGE/2; + int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw; + frameBuffer->paintIcon(NEUTRINO_ICON_EPG, icon_x, ypos, item_height); + iw = iw + OFFSET_INNER_MID; } } if (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bUseCI) { - int iw2; - frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED2, &iw2, &ih); + int iw2 = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED, &iw2, &ih); if (iw2 && ih) { - int icon_x = (x+width-2) - RADIUS_LARGE/2 - iw - iw2 - 2; - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED2, icon_x - iw2, ypos, fheight); - iw = iw + iw2 + 4 + RADIUS_LARGE/2; + int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw - iw2; + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x, ypos, item_height); + iw = iw + iw2 + OFFSET_INNER_MID; } } - int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); + int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(num); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + item_height, numwidth + OFFSET_INNER_SMALL, num, color, item_height); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15 - iw, lname, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + item_height, width - numwidth - 2*OFFSET_INNER_MID - iw - SCROLLBAR_WIDTH, lname, color); //CVFD::getInstance()->showMenuText(0, bouq->channelList->getName(), -1, true); } } @@ -691,7 +700,7 @@ void CBouquetList::paintItem(int pos) void CBouquetList::paintHead() { std::string icon(""); - CComponentsHeader header(x, y, width, theight, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); + CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); header.paint(CC_SAVE_SCREEN_NO); } @@ -711,33 +720,32 @@ void CBouquetList::paint() _lastnum /= 10; } - frameBuffer->paintBoxRel(x, y+theight, width, height - theight - footerHeight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); - int numbuttons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); -#if 0 - if (favonly) /* this actually shows favorites and providers button, but both are active anyway */ - numbuttons = 2; + int numButtons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); -#endif if (favonly) - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round - else - ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); - - if(!Bouquets.empty()) { - for(unsigned int count=0;countpaintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + } + else + { + CComponentsFooter footer; + footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); + } + + if (!Bouquets.empty()) + { + for (unsigned int count = 0; count < listmaxshow; count++) + { paintItem(count); } } - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); - int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero - int sbc= ((bsize - 1)/ listmaxshow_tmp)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow_tmp); + int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero + int total_pages = ((bsize - 1) / _listmaxshow) + 1; + int current_page = selected / _listmaxshow; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 04043e34e..94c7a617e 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -87,9 +87,9 @@ class CBouquetList : public CListHelpers unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; - int fheight; // Fonthoehe Bouquetlist-Inhalt - int theight; // Fonthoehe Bouquetlist-Titel - int footerHeight; + int item_height; + int header_height; + int footer_height; int width; int height; From a09507d832ec8ecbfea5c491fe1997d42f0e3377 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 13 Apr 2017 17:32:24 +0200 Subject: [PATCH 094/394] fix init cl_force_repaint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b4bb9ef5eafb32ac903f0c82cd97ff3143b54b4c Author: Jacek Jendrzej Date: 2017-04-13 (Thu, 13 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 a3d93c29ace3ceacc878653c3260de4270060488 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Apr 2017 22:26:51 +0200 Subject: [PATCH 095/394] CMovieBrowser: try to reduce effort for vizualized scan For comparings I added a benchmark with log output. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/68c2b29caf3fadeaf49d296231ad48ca32ed645d Author: Thilo Graf Date: 2017-04-13 (Thu, 13 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f55f994ab..f85cc093e 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2876,7 +2876,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) CFileList flist; if (readDir(dirname, &flist) == true) { - for (size_t i = 0; i < flist.size(); i++) + size_t count = flist.size(); + for (size_t i = 0; i < count; i++) { if (S_ISDIR(flist[i].Mode)) { if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) { @@ -2887,7 +2888,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLocalProgress(i, flist.size(), dirname ); + if (result) + OnLocalProgress(i, count, dirname ); } //result = true; } @@ -3126,6 +3128,9 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); + struct timeval t1, t2; + gettimeofday(&t1, NULL); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress); loadBox.enableShadow(); loadBox.paint(); @@ -3141,6 +3146,11 @@ void CMovieBrowser::loadMovies(bool doRefresh) } m_file_info_stale = false; + 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[CMovieBrowser] %s: %" PRIu64 " ms to scan movies \033[0m\n",__func__, duration); + loadBox.hide(); if (doRefresh) From aca54b04019f8c888002410c5aa9fd4fd77df23e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Apr 2017 23:28:35 +0200 Subject: [PATCH 096/394] CComponentsFooter: avoid crash because possible divisions by 0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb0dc47e35c06a790109b5c59094170ed7ee3e0b Author: Thilo Graf Date: 2017-04-13 (Thu, 13 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 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 9dbbf3e42a666a1ce182d4a19df46092bdc788ba Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 11 Apr 2017 07:16:54 +0200 Subject: [PATCH 097/394] CComponentsTimer: use sleep() instead mySleep() Had some problems with mySleep() related to select() which was used inside mySleep() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dbc4a487e4f81d1a702d5816c3b69d80ddac52bf Author: Thilo Graf Date: 2017-04-11 (Tue, 11 Apr 2017) ------------------ This commit was generated by Migit --- 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 e9d454a18a43ca70c0b15a4cb6fa6fb07cc1d929 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 098/394] CComponentsChannelLogo: add missing type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4762f78a5ed11ee4156e811393836698bf959d8 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 9a31a009cd8d33511e706a4898bf6004be3b69d4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 099/394] 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 ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/29a01bd2d8975b56017caf342c3e651e3fde9417 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) ------------------ This commit was generated by Migit --- 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 2590182e628f1253c2e40ac65e1f91a649ddee9a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 100/394] CComponentsPicture: init missing vars for old dimension dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f499d3d38723e57f1e777c66f5c41e1cde3b5ea3 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 3f497b85644ddbe0ee99e6c48cb9efa53f1271ed Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 101/394] CComponentsItem: add missing methodes for position setters Parent items were not considered for position calculation. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/069379930a6b5d7f25016513580fefedb02fc6c7 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) ------------------ This commit was generated by Migit --- 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 43519e858d448bfdad985cfcad0afec30943c090 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 16 Apr 2017 16:53:06 +0200 Subject: [PATCH 102/394] CComponentsPicture: add explicit methodes to set image position Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5361296ff48b4517eac502688d28479df69c1923 Author: Thilo Graf Date: 2017-04-16 (Sun, 16 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 f02858df196fc2bf7e1241617c20850c23ed8ca9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:04:34 +0200 Subject: [PATCH 103/394] CComponentsForm: try to fix fit items inside forms Some items had offsets on screen. Was seen eg. in message windows. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ac706b86c875556da906305d3307e086dc84186 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ This commit was generated by Migit --- 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 0b123ff4a8141ac97ac7fac40daecc64d58f4f0c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:07:56 +0200 Subject: [PATCH 104/394] CComponentsWindow: try to fix header and footer arrangement Header and footer were placed too much on left side. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e1f51050b213c823919b6ad40773e4d7ce3ca94f Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ This commit was generated by Migit --- 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 9fca1e29bdddcd7deba67c90c440a54079243cf7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:51:54 +0200 Subject: [PATCH 105/394] CComponentsHeader: Reduce offset between clock and right border. Was too large Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42db55e61de803e8dc610e754ded097e8d31b02a Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 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 16e62d452e5cefe1e179109a9919b3d4bdc4d2f0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:36:02 +0200 Subject: [PATCH 106/394] CComponentsFrmClock: remove unnecessary call of cch_cl_obj->setYPos() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cbba7b78f46ded09a80940579cc203dbeeb3ee96 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 0ab82cab7c89220ccbc6bf69fe7526331a17e9a1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:42:24 +0200 Subject: [PATCH 107/394] CComponentsFrmClock: use correct setHeight() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/04f9468ddb4eca0c3b8b2787d9016b06554638af Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 f1c74564a38e32df3a34e25f7ac3bc3ea7cb104c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:56:42 +0200 Subject: [PATCH 108/394] CSignalBar: use global offsets for init of min height Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8822803d9d59a95b8d54dbb10108ee623af61c3 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 1f7449bda4fedf0b0891b5ec11214658ef4f7e7d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:00:48 +0200 Subject: [PATCH 109/394] CComponentsForm: use global default width for scrollbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0e94c6830b25e91337e560eeacf82176af157881 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 c86f051cb60a1a133d612a18beaf1621d2eb906e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:41:34 +0200 Subject: [PATCH 110/394] CSignalBox: remove CC_APPEND flag Should be gradually removed in all affected classes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f74724ceb655b6f04a7b029ab58fa526423bbfd6 Author: Thilo Graf Date: 2017-04-17 (Mon, 17 Apr 2017) ------------------ This commit was generated by Migit --- 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 e1db717033dc708ba098118c737f2234cc2c2e90 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 18 Apr 2017 19:09:32 +0200 Subject: [PATCH 111/394] fix download pic from ssl url Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f6482eb04260945b6d75a3cc62b25b1909adb989 Author: Jacek Jendrzej Date: 2017-04-18 (Tue, 18 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 fee0463182e0cd0da8d8038d3d201b4d597eaa89 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 19 Apr 2017 17:19:43 +0200 Subject: [PATCH 112/394] try to fix version check for avformat codecpar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3bf23d9c90996fc414df4a057304ab8abc1b236 Author: Jacek Jendrzej Date: 2017-04-19 (Wed, 19 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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; From 7c03858f7c852b80a9a51c004c1d6a390b1e6083 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH 113/394] CComponentsHeader: add possibility to show channellogo Contains methode setChannelLogo() with parameters for channel id, channel name and optional alignment (primary between title and clock). Default alignment is centered. Optional parameter to set logo height is available too. Hope it works on first try. To see how it works, take look at channellist class. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/68835056c38a74b33c04e647ccbe21bb7bf5ae7a Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 38 ++++++----------- src/gui/components/cc_frm_header.cpp | 61 +++++++++++++++++++++++++++- src/gui/components/cc_frm_header.h | 52 ++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 27 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 8499c38c5..65213ea5d 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1676,35 +1676,16 @@ void CChannelList::paintAdditionals(int index) } } -void CChannelList::showChannelLogo() //TODO: move into an own handler, eg. header, channel logo should be paint inside header object +void CChannelList::showChannelLogo() { if ((*chanlist).empty()) return; if(g_settings.channellist_show_channellogo){ - int logo_w_max = full_width / 4; - int logo_h_max = theight - 2*OFFSET_INNER_MIN; - if (CChannelLogo) { - if (headerNew) - CChannelLogo->clearSavedScreen(); - else - CChannelLogo->hide(); - delete CChannelLogo; - } - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, (*chanlist)[selected]->getName(), (*chanlist)[selected]->getChannelID()); - - if (CChannelLogo->hasLogo()){ - CChannelLogo->setWidth(min(CChannelLogo->getWidth(), logo_w_max), true); - if (CChannelLogo->getHeight() > logo_h_max) - CChannelLogo->setHeight(logo_h_max, true); - CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth()); - CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2); - CChannelLogo->paint(); - } else { - CChannelLogo->hide(); - delete CChannelLogo; - CChannelLogo = NULL; - } - headerNew = false; + header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); + header->getLogoObject()->hide(); + header->getLogoObject()->clearSavedScreen(); + header->getLogoObject()->allowPaint(true); + header->getLogoObject()->paint(); } } @@ -2172,7 +2153,14 @@ void CChannelList::paintHead() else logo_off = OFFSET_INNER_MID; + if(g_settings.channellist_show_channellogo){ + //ensure to have clean background + header->getLogoObject()->hide(); + header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); + header->getLogoObject()->allowPaint(false); + } header->paint(CC_SAVE_SCREEN_NO); + showChannelLogo(); } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f8a1038cd..f053e94ec 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -31,6 +31,9 @@ #include "cc_frm_header.h" #include #include +#include + +extern CPictureViewer * g_PicViewer; using namespace std; @@ -91,8 +94,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cc_item_type = CC_ITEMTYPE_FRM_HEADER; clear(); cc_txt_save_screen = false; - x = x_old = x_pos; - y = y_old = y_pos; + x = cc_xr = x_old = x_pos; + y = cc_yr = y_old = y_pos; //init header width width = width_old = w == 0 ? frameBuffer->getScreenWidth(true) : w; @@ -121,6 +124,11 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_text_obj = NULL; cch_btn_obj = NULL; cch_cl_obj = NULL; + cch_logo_obj = NULL; + cch_logo.Id = 0; + cch_logo.Name = ""; + cch_logo.dy_max = -1; + cch_logo.Align = CC_LOGO_RIGHT; cch_col_text = COL_MENUHEAD_TEXT; cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; cch_items_y = CC_CENTERED; @@ -264,6 +272,49 @@ void CComponentsHeader::initIcon() } } +void CComponentsHeader::initLogo() +{ + cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_SMALL : cch_logo.dy_max; + + if(!cch_logo_obj) + cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this); + else + cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); + + if (cch_logo_obj->hasLogo()){ + cch_logo_obj->setHeight(cch_logo.dy_max, true); + + // set id of logo item depends of neighbor items + int logo_id = getCCItemId(cch_logo_obj); + int next_id = logo_id + 1; + int prev_id = logo_id - 1; + + //right end + int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID; + //left end + int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; + + //calculate available space + int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left; + + //reduce logo width if logo space too small + int w_logo = min(cch_logo_obj->getWidth(), logo_space); + cch_logo_obj->setWidth(w_logo, true); + + //set final logo position + int x_logo = 0; + if (cch_logo.Align == CC_LOGO_RIGHT) + x_logo = x_logo_right; + if (cch_logo.Align == CC_LOGO_LEFT) + x_logo = x_logo_left; + if (cch_logo.Align == CC_LOGO_CENTER) + x_logo = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + + cch_logo_obj->setXPos(x_logo); + cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2); + } +} + void CComponentsHeader::addContextButton(const std::string& button_name) { v_cch_btn.push_back(button_name); @@ -505,6 +556,9 @@ void CComponentsHeader::initCaption() if (cch_caption_align == CTextBox::CENTER) cch_text_x = CC_CENTERED; + //recalc caption width + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setColorBody(col_body); @@ -548,6 +602,9 @@ void CComponentsHeader::initCCItems() //init text initCaption(); + + //init logo + initLogo(); } void CComponentsHeader::paint(bool do_save_bg) diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index eb4a6d607..17e9f5dba 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -36,9 +36,29 @@ /*! CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows */ + class CComponentsHeader : public CComponentsForm, public CCTextScreen { + public: + ///logo position options + typedef enum + { + CC_LOGO_RIGHT , + CC_LOGO_LEFT , + CC_LOGO_CENTER + }cc_logo_alignment_t; + private: + ///required logo data type + typedef struct cch_logo_t + { + uint64_t Id; + std::string Name; + int32_t dx_max; + int32_t dy_max; + cc_logo_alignment_t Align; + } cch_logo_struct_t; + ///member: init genaral variables, parameters for mostly used properties void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -59,6 +79,11 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen CComponentsIconForm * cch_btn_obj; ///object: clock object CComponentsFrmClock * cch_cl_obj; + ///object: logo object + CComponentsChannelLogoScalable * cch_logo_obj; + + ///attributes for logos + cch_logo_t cch_logo; ///property: caption text, see also setCaption() std::string cch_text; @@ -112,6 +137,9 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen void initButtons(); ///sub: init clock object void initClock(); + ///sub: init logo object + void initLogo(); + ///int repaint slot void initRepaintSlot(); @@ -275,6 +303,30 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen ///set color gradient on/off, returns true if gradient mode was changed virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/, const int& direction = -1); + + /**Methode to set channel logo into header body via id and/or channel name + * @param[in] channelId + * @li required channel id as uint64_t + * @param[in] channelIName + * @li required channel name as std::string + * @param[in] alignment + * @li optional alingment parameter as cc_logo_alignment_t (enum)\n + * Possible values are:\n + * CC_LOGO_RIGHT \n + * CC_LOGO_CENTER (default)\n + * CC_LOGO_RIGHT \n + * @param[in] dy + * @li optional logo height, default = -1 (auto) + */ + void setChannelLogo( const uint64_t& channelId, + const std::string& channelName, + cc_logo_alignment_t alignment = CC_LOGO_CENTER, + const int& dy = -1) + {cch_logo.Id = channelId; cch_logo.Name = channelName, cch_logo.Align = alignment, cch_logo.dy_max = dy; initCCItems();} + /**Methode to get channel logo object for direct access to its properties and methodes + * @return CComponentsChannelLogoScalable* + */ + CComponentsChannelLogoScalable* getLogoObject(){return cch_logo_obj;} }; //! Sub class of CComponentsHeader. From ce19f8321e82518883cf3daa032a9e34db5c1da2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH 114/394] CComponentsPicture: Change order of called base methodes setWidth/Height Calls of base methods should come after internal method calls. Values could be changed unintentionally. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed5e79440a8f0ae6084298d9f54164eeddf69dce Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ This commit was generated by Migit --- 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 4bcbc14a1..91841c071 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -128,9 +128,9 @@ void CComponentsPicture::setPicture(const char* picture_name) void CComponentsPicture::setWidth(const int& w, bool keep_aspect) { - CComponentsItem::setWidth(w); if (w == width && keep_aspect == keep_dy_aspect) return; + CComponentsItem::setWidth(w); need_init = true; do_scale = true; keep_dy_aspect = keep_aspect; @@ -139,9 +139,9 @@ void CComponentsPicture::setWidth(const int& w, bool keep_aspect) void CComponentsPicture::setHeight(const int& h, bool keep_aspect) { - CComponentsItem::setHeight(h); if (h == height && keep_aspect == keep_dx_aspect) return; + CComponentsItem::setHeight(h); need_init = true; do_scale = true; keep_dx_aspect = keep_aspect; From 926b8c466a42a756cca58eab87ef35c3c25c934f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH 115/394] CComponentsScrollBar: fix radius for single segment Radius on top was missed if only one segment is available. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5451046d44fb85f1826e9c423b634383006d889 Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 2fcfd737c..e890ffbef 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -183,8 +183,12 @@ void CComponentsScrollBar::initSegments() } //set corner types - sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); - sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); + if (sb_segments_obj->size() == 1){ + sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_ALL); + }else{ + sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); + sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); + } } From cd80e260ee5848db851d17724b718dad4950fec5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH 116/394] colors.h: add missing base color for scrollbars Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/89bda2d14fd1b71fc2642ac59c2ff33e60e4c3e4 Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/color.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/color.h b/src/gui/color.h index 07a5227d9..abad69330 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -123,9 +123,10 @@ #define COL_FRAME COL_MENUCONTENT_PLUS_6 #define COL_FRAME_PLUS_0 COL_FRAME +#define COL_SCROLLBAR COL_MENUCONTENT_PLUS_1 #define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3 #define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE -#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_1 +#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_2 #define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE #define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7 From 3003cd2dedc835a6f212cbc8e8022610b62517a8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH 117/394] CComponentsScrollBar: add missing attributes for different visual modes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/324ba258a093ad80536274b79f67dff8e467349d Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 105 +++++++++++++++--------- src/gui/components/cc_frm_scrollbar.h | 44 +++++++--- 2 files changed, 102 insertions(+), 47 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index e890ffbef..73fa733be 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -32,29 +32,39 @@ using namespace std; /* base schema - x,y - +-----------------+ - |+---------------+| - ||sb_up_obj || - || || - |+---------------+| - |+---------------+| - ||sb_segments_obj|| - ||+-------------+|| - ||| segment ||| - ||| id 0 ||| - ||| ||| - ||+-------------+|| - ||| segment ||| - ||| id 1 ||| - ||| ||| - ||+-------------+|| - |+---------------+| - |+---------------+| - ||sb_up_obj || - || || - |+---------------+| - +-----------------+ + + x,y width (w) + /(x_pos, y_pos) ^ + +---------------------+ + | +-----------------+ | + | | sb_up_obj (icon)| |/color_frame + | | /\ | | + | +-----------------+ | |/color_shadow + | col_body | | + | | + | +-sb_segments_obj+ | + | | | | + | | +---segment---+ | | + | | | id 0 | | | + | | | active | | | + | | | color_select| | | + | | +-------------+ | | + | | append_y_offset | | + | | +---segment---+ | | + | | | id 1 | | | + | | | passive | | | + | | |color_passive| | | + | | +-------------+ | | + | | (count = 2) | | + | | other segments | | + | | are possible | | + | +-----------------+ | + | | + | +-----------------+ | + | | sb_up_obj (icon)| | + | | \/ | | + | +-----------------+ | + +---------------------+-> height (h) */ //sub class CComponentsScrollBar inherit from CComponentsFrmChain @@ -64,13 +74,15 @@ CComponentsScrollBar::CComponentsScrollBar( const int &x_pos, const int &y_pos, int shadow_mode, fb_pixel_t color_frame, fb_pixel_t color_body, - fb_pixel_t color_shadow) + fb_pixel_t color_shadow, + fb_pixel_t color_select, + fb_pixel_t color_passive) :CComponentsFrmChain(x_pos, y_pos, w, h, NULL, CC_DIR_Y, parent, shadow_mode, color_frame, color_body, color_shadow) { - initVarSbForm(count); + initVarSbForm(count, color_select, color_passive); } -void CComponentsScrollBar::initVarSbForm(const int& count) +void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& color_select, const fb_pixel_t& color_passive) { cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR; fr_thickness = 0; @@ -90,6 +102,10 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_segments_count = count; sb_mark_id = 0; + sb_visual_enable = false; + sb_segment_col_sel = color_select; + sb_segment_col = color_passive; + initCCItems(); } @@ -159,6 +175,8 @@ void CComponentsScrollBar::initSegments() if (h_seg < 0) h_seg = 0; + fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; + //create and add segments to segment container for(u_int8_t i=0; isetColorBody(COL_SCROLLBAR_ACTIVE); + item->setColorBody(sb_segment_col_sel); #if 0 item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B); item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal); #endif } else{ - item->setColorBody(COL_SCROLLBAR_PASSIVE); + item->setColorBody(passive_col); #if 0 item->disableColBodyGradient(); #endif } - } - //set corner types - if (sb_segments_obj->size() == 1){ - sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_ALL); - }else{ - sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); - sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); + //set different corner types for segments with possible conditions + if (passive_col == col_body){ + item->setCorner(RADIUS_MIN, CORNER_ALL); + continue; + }else if (sb_segments_count == 1){ + item->setCorner(RADIUS_MIN, CORNER_ALL); + break; + }else if(i == 0){ + item->setCorner(RADIUS_MIN, CORNER_TOP); + continue; + }else if(i == sb_segments_count - 1){ + item->setCorner(RADIUS_MIN, CORNER_BOTTOM); + break; + }else if((i > 0 && i < sb_segments_count - 1)){ + item->setCorner(RADIUS_MIN, CORNER_NONE); + }else{ + item->setCorner(RADIUS_MIN, CORNER_NONE); + } } } @@ -201,9 +230,11 @@ void paintScrollBar( const int &x_pos, int shadow_mode, fb_pixel_t color_frame, fb_pixel_t color_body, - fb_pixel_t color_shadow) + fb_pixel_t color_shadow, + fb_pixel_t color_select, + fb_pixel_t color_passive) { - CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow); + CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow, color_select, color_passive); scrollbar.setMarkID(current_num); scrollbar.paint0(); } diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 778349ac1..9fd1ab984 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -42,6 +42,12 @@ class CComponentsScrollBar : public CComponentsFrmChain ///names of navi icons std::string sb_up_icon, sb_down_icon; + ///visualize count mode + bool sb_visual_enable; + + ///segment colors + fb_pixel_t sb_segment_col, sb_segment_col_sel; + ///count of segments int sb_segments_count; @@ -55,11 +61,11 @@ class CComponentsScrollBar : public CComponentsFrmChain ///init segements void initSegments(); - + ///init all items void initCCItems(); - void initVarSbForm( const int& count); + void initVarSbForm( const int& count, const fb_pixel_t& color_select, const fb_pixel_t& color_passive); public: /**Class constructor to generate individual scrollbar objects @@ -73,9 +79,11 @@ class CComponentsScrollBar : public CComponentsFrmChain * 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_ACTIVE_PLUS_0 - * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR + * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR * @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 + * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE */ CComponentsScrollBar( const int &x_pos, const int &y_pos, @@ -84,9 +92,11 @@ class CComponentsScrollBar : public CComponentsFrmChain const int& count = 1, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, - fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_SCROLLBAR, + fb_pixel_t color_body = COL_SCROLLBAR, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, + fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE, + fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE); // ~CComponentsScrollBar(); //inherited from CComponentsForm /**Set current page number @@ -123,6 +133,16 @@ class CComponentsScrollBar : public CComponentsFrmChain * @see setSegmentCount() */ int getSegmentCount(){return sb_segments_count;} + + /**Enable/disable vizualized count of possible scroll items + * @param[in] enable optional, exepts type bool. + * @note Default mode is disabled. + */ + void enableVisualize(bool enable = true){sb_visual_enable = enable;} + + /**Disable vizualized count of possible scroll items + */ + void disableVisualize(){enableVisualize(false);} }; /**Small and easy to apply scrollbar paint methode without expilcit object declaration @@ -141,6 +161,8 @@ class CComponentsScrollBar : public CComponentsFrmChain * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_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 + * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE */ void paintScrollBar( const int &x_pos, const int &y_pos, @@ -149,8 +171,10 @@ void paintScrollBar( const int &x_pos, const int& count, const int& current_num, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, - fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_SCROLLBAR, + fb_pixel_t color_body = COL_SCROLLBAR, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, + fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE, + fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE); #endif From 425c0b40dede82f0a330eef22c54133b25b72b40 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 23:06:02 +0200 Subject: [PATCH 118/394] CComponentsHeader/CChannelList: unify methode names Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ef6c49a233aff6cc8548006e989734327b2c1b7 Author: Thilo Graf Date: 2017-04-21 (Fri, 21 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 12 ++++++------ src/gui/components/cc_frm_header.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 65213ea5d..2e6ad72b1 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1682,10 +1682,10 @@ void CChannelList::showChannelLogo() return; if(g_settings.channellist_show_channellogo){ header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); - header->getLogoObject()->hide(); - header->getLogoObject()->clearSavedScreen(); - header->getLogoObject()->allowPaint(true); - header->getLogoObject()->paint(); + header->getChannelLogoObject()->hide(); + header->getChannelLogoObject()->clearSavedScreen(); + header->getChannelLogoObject()->allowPaint(true); + header->getChannelLogoObject()->paint(); } } @@ -2155,9 +2155,9 @@ void CChannelList::paintHead() if(g_settings.channellist_show_channellogo){ //ensure to have clean background - header->getLogoObject()->hide(); + header->getChannelLogoObject()->hide(); header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); - header->getLogoObject()->allowPaint(false); + header->getChannelLogoObject()->allowPaint(false); } header->paint(CC_SAVE_SCREEN_NO); showChannelLogo(); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 17e9f5dba..1a0f1c8d4 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -326,7 +326,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen /**Methode to get channel logo object for direct access to its properties and methodes * @return CComponentsChannelLogoScalable* */ - CComponentsChannelLogoScalable* getLogoObject(){return cch_logo_obj;} + CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; //! Sub class of CComponentsHeader. From 450943123ac260f68b42de23c02c4c3a18b42e03 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 22 Apr 2017 16:11:55 +0200 Subject: [PATCH 119/394] epgplus: add channellogo to header Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e74db896bb1e81da5828336ec5e7ab8e8f42dca1 Author: vanhofen Date: 2017-04-22 (Sat, 22 Apr 2017) Origin message was: ------------------ - epgplus: add channellogo to header ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 31 +++++++++++++++++++++++++++++-- src/gui/epgplus.h | 4 ++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index de34c6063..7ebf586db 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -115,6 +115,12 @@ void EpgPlus::Header::paint(const char * Name) if (this->head) { + if (g_settings.channellist_show_channellogo) + { + // ensure to have clean background + this->head->getChannelLogoObject()->hide(); + this->head->getChannelLogoObject()->allowPaint(false); + } this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); @@ -123,6 +129,24 @@ void EpgPlus::Header::paint(const char * Name) } } +void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel) +{ + if (!g_settings.channellist_show_channellogo) + return; + + if (this->head) + { + this->head->getChannelLogoObject()->hide(); + this->head->getChannelLogoObject()->clearSavedScreen(); + if (Channel) + { + this->head->setChannelLogo(Channel->getChannelID(), Channel->getName()); + } + this->head->getChannelLogoObject()->allowPaint(true); + this->head->getChannelLogoObject()->paint(); + } +} + int EpgPlus::Header::getUsedHeight() { return font->getHeight(); @@ -368,7 +392,7 @@ int EpgPlus::ChannelEventEntry::getUsedHeight() Font *EpgPlus::ChannelEntry::font = NULL; int EpgPlus::ChannelEntry::separationLineThickness = 0; -EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) +EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Header * pheader, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) { this->channel = pchannel; @@ -383,6 +407,7 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, this->index = pindex; this->frameBuffer = pframeBuffer; + this->header = pheader; this->footer = pfooter; this->bouquetList = pbouquetList; @@ -510,6 +535,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2); detailsLine->paint(false); + + this->header->paintChannelLogo(this->channel); } } @@ -644,7 +671,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) CZapitChannel * channel = (*this->channelList)[i]; - ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth); + ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->header, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth); //printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); CChannelEventList channelEventList; CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 29a6c5e89..f5a0ee65f 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -84,6 +84,8 @@ class EpgPlus void paint(const char * Name = NULL); + void paintChannelLogo(const CZapitChannel * Channel = NULL); + static int getUsedHeight(); //// attributes @@ -192,6 +194,7 @@ class EpgPlus ChannelEntry(const CZapitChannel* channel, int index, CFrameBuffer* frameBuffer, + Header* header, Footer* footer, CBouquetList* bouquetList, int x, @@ -216,6 +219,7 @@ class EpgPlus int index; CFrameBuffer* frameBuffer; + Header* header; Footer* footer; CBouquetList* bouquetList; From 52ea1690bc59beb08874e7b4885da5688f252f78 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 22 Apr 2017 17:02:48 +0200 Subject: [PATCH 120/394] colors: add and use missing COL_SCROLLBAR_PLUS_0 wrapper Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e50353773b3405c373413f0b216132831568e6c Author: vanhofen Date: 2017-04-22 (Sat, 22 Apr 2017) Origin message was: ------------------ - colors: add and use missing COL_SCROLLBAR_PLUS_0 wrapper ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/color.h | 1 + src/gui/components/cc_frm_scrollbar.h | 32 +++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/gui/color.h b/src/gui/color.h index abad69330..a902ab709 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -124,6 +124,7 @@ #define COL_FRAME_PLUS_0 COL_FRAME #define COL_SCROLLBAR COL_MENUCONTENT_PLUS_1 +#define COL_SCROLLBAR_PLUS_0 COL_SCROLLBAR #define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3 #define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE #define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_2 diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 9fd1ab984..8658d5428 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -79,11 +79,11 @@ class CComponentsScrollBar : public CComponentsFrmChain * 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 - * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR + * @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 - * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE + * @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 */ CComponentsScrollBar( const int &x_pos, const int &y_pos, @@ -92,11 +92,11 @@ class CComponentsScrollBar : public CComponentsFrmChain const int& count = 1, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR, - fb_pixel_t color_body = COL_SCROLLBAR, + fb_pixel_t color_frame = COL_SCROLLBAR_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, - fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE, - fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE); + fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE_PLUS_0); // ~CComponentsScrollBar(); //inherited from CComponentsForm /**Set current page number @@ -158,11 +158,11 @@ class CComponentsScrollBar : public CComponentsFrmChain * 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_ACTIVE_PLUS_0 - * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @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 - * @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE + * @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 */ void paintScrollBar( const int &x_pos, const int &y_pos, @@ -171,10 +171,10 @@ void paintScrollBar( const int &x_pos, const int& count, const int& current_num, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR, - fb_pixel_t color_body = COL_SCROLLBAR, + fb_pixel_t color_frame = COL_SCROLLBAR_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, - fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE, - fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE); + fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE_PLUS_0); #endif From 53459ad6c01da56901a9fa73b2ff502baa8a775f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 22 Apr 2017 17:02:48 +0200 Subject: [PATCH 121/394] luainstance: add missing COL_SCROLLBAR colors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3669130b14c0dc4179e14ff930f31ffcd3e44863 Author: vanhofen Date: 2017-04-22 (Sat, 22 Apr 2017) Origin message was: ------------------ - luainstance: add missing COL_SCROLLBAR colors ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/luainstance.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 9e8343ca1..078e88ef8 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 72 +#define LUA_API_VERSION_MINOR 73 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index ee304db0a..c031083ce 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -175,6 +175,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTINACTIVE", MAGIC_COLOR | (COL_MENUCONTENTINACTIVE) }, { "MENUFOOT", MAGIC_COLOR | (COL_MENUFOOT) }, { "FRAME", MAGIC_COLOR | (COL_FRAME) }, + { "SCROLLBAR", MAGIC_COLOR | (COL_SCROLLBAR) }, { "SCROLLBAR_ACTIVE", MAGIC_COLOR | (COL_SCROLLBAR_ACTIVE) }, { "SCROLLBAR_PASSIVE", MAGIC_COLOR | (COL_SCROLLBAR_PASSIVE) }, { "PROGRESSBAR_ACTIVE", MAGIC_COLOR | (COL_PROGRESSBAR_ACTIVE) }, @@ -226,6 +227,7 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTINACTIVE_PLUS_0", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_PLUS_0) }, { "MENUFOOT_PLUS_0", (lua_Unsigned) (COL_MENUFOOT_PLUS_0) }, { "FRAME_PLUS_0", (lua_Unsigned) (COL_FRAME_PLUS_0) }, + { "SCROLLBAR_PLUS_0", (lua_Unsigned) (COL_SCROLLBAR_PLUS_0) }, { "SCROLLBAR_ACTIVE_PLUS_0", (lua_Unsigned) (COL_SCROLLBAR_ACTIVE_PLUS_0) }, { "SCROLLBAR_PASSIVE_PLUS_0", (lua_Unsigned) (COL_SCROLLBAR_PASSIVE_PLUS_0) }, { "PROGRESSBAR_ACTIVE_PLUS_0", (lua_Unsigned) (COL_PROGRESSBAR_ACTIVE_PLUS_0) }, From 5752e1e8558315eb43964887453eaabd48b07b9c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 22 Apr 2017 17:02:48 +0200 Subject: [PATCH 122/394] color.h: just code cosmetics Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d3f27914e33cae4f584ad3426cb8f739beec330d Author: vanhofen Date: 2017-04-22 (Sat, 22 Apr 2017) Origin message was: ------------------ - color.h: just code cosmetics ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/color.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gui/color.h b/src/gui/color.h index a902ab709..bcce61d8c 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -120,20 +120,20 @@ #endif // some wrappers to get more readability -#define COL_FRAME COL_MENUCONTENT_PLUS_6 -#define COL_FRAME_PLUS_0 COL_FRAME +#define COL_FRAME COL_MENUCONTENT_PLUS_6 +#define COL_FRAME_PLUS_0 COL_FRAME -#define COL_SCROLLBAR COL_MENUCONTENT_PLUS_1 -#define COL_SCROLLBAR_PLUS_0 COL_SCROLLBAR -#define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3 -#define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE -#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_2 -#define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE +#define COL_SCROLLBAR COL_MENUCONTENT_PLUS_1 +#define COL_SCROLLBAR_PLUS_0 COL_SCROLLBAR +#define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3 +#define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE +#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_2 +#define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE -#define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7 -#define COL_PROGRESSBAR_ACTIVE_PLUS_0 COL_PROGRESSBAR_ACTIVE -#define COL_PROGRESSBAR_PASSIVE COL_MENUCONTENT_PLUS_1 -#define COL_PROGRESSBAR_PASSIVE_PLUS_0 COL_PROGRESSBAR_PASSIVE +#define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7 +#define COL_PROGRESSBAR_ACTIVE_PLUS_0 COL_PROGRESSBAR_ACTIVE +#define COL_PROGRESSBAR_PASSIVE COL_MENUCONTENT_PLUS_1 +#define COL_PROGRESSBAR_PASSIVE_PLUS_0 COL_PROGRESSBAR_PASSIVE int convertSetupColor2RGB(unsigned char r, unsigned char g, unsigned char b); int convertSetupAlpha2Alpha(unsigned char alpha); From 3d811a3370750dbf18c7b3ba762588a04d9dbd78 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 15:06:16 +0200 Subject: [PATCH 123/394] CChannelList/CUpnpBrowserGui: add missing reinit for corner modes Required eg. if corner settings has been changed by user on runtime. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0943c467e2a88811374d3f980f0c2df4dccab139 Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 + src/gui/upnpbrowser.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2e6ad72b1..ba3cb8941 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2119,6 +2119,7 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); + header->setCorner(RADIUS_LARGE, CORNER_TOP); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 5871a3ea2..b407d7924 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -941,6 +941,7 @@ void CUpnpBrowserGui::paintDeviceInfo() tmp += m_devices[m_selecteddevice].modelurl; topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); + topbox.setCorner(RADIUS_LARGE); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -991,7 +992,7 @@ void CUpnpBrowserGui::paintDevices() header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); else header.removeContextButtons(); - //header.enableShadow(); + header.setCorner(RADIUS_LARGE, CORNER_TOP); header.paint(CC_SAVE_SCREEN_NO); // Items @@ -1012,6 +1013,7 @@ void CUpnpBrowserGui::paintDevices() m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, sb, COL_SHADOW_PLUS_0); // Foot + footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); paintItem2DetailsLine(-1); // clear it @@ -1148,6 +1150,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } } + topbox.setCorner(RADIUS_LARGE); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -1197,7 +1200,9 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) char tmp_time[] = "000:00"; int timebox_width = timebox.getFont()->getRenderWidth(tmp_time) + OFFSET_INNER_MID*2; infobox.setDimensionsAll(m_x, m_infobox_y, m_width - OFFSET_SHADOW - OFFSET_INTER - timebox_width, m_infobox_height); + infobox.setCorner(RADIUS_LARGE); timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), timebox_width, m_infobox_height); + timebox.setCorner(RADIUS_LARGE); printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); if ((!use_playing) && entry->isdir){ From d0a3315ca2f050fb7346eb8f5c0c3518e4ba6523 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 16:45:03 +0200 Subject: [PATCH 124/394] CComponentsHeader: add fallback if title and logo are overlapping Logo is now general centered on screen, not as before between title and clock Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1413f296ae1afb786a2a5b38edcf10f3123f59b4 Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f053e94ec..9fef1dfba 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -307,8 +307,15 @@ void CComponentsHeader::initLogo() x_logo = x_logo_right; if (cch_logo.Align == CC_LOGO_LEFT) x_logo = x_logo_left; - if (cch_logo.Align == CC_LOGO_CENTER) - x_logo = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + if (cch_logo.Align == CC_LOGO_CENTER){ + x_logo = width/2 - cch_logo_obj->getWidth()/2; + //fallback if previous item and logo are overlapping + if (getCCItem(prev_id)){ + int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + if (x_logo <= x_logo_left) + x_logo = x_tmp; + } + } cch_logo_obj->setXPos(x_logo); cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2); From 9570a9d36a031e0027967cdc97618c60e14c7cfa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 16:56:41 +0200 Subject: [PATCH 125/394] CComponentsHeader: use previous offset to fit logo Was OFFSET_INNER_MIN in older versions, not OFFSET_INNER_SMALL. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/330171c90bb02e94689529162df95fc5e855090a Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 9fef1dfba..9161a0fe3 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -274,7 +274,7 @@ void CComponentsHeader::initIcon() void CComponentsHeader::initLogo() { - cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_SMALL : cch_logo.dy_max; + cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this); From 000595e6b7f8d728daee41e7a76a341a614e617e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 13:42:50 +0200 Subject: [PATCH 126/394] CChannelList: remove unused logo object Not required since 7c03858f7c852b80a9a51c004c1d6a390b1e6083: add possibility to show channellogo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fbe8889fa9f63850b40247e6a33488b237a7178a Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ba3cb8941..680e09724 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,6 @@ extern bool autoshift; static CComponentsPIP *cc_minitv = NULL; extern CBouquetManager *g_bouquetManager; extern int old_b_id; -static CComponentsChannelLogoScalable* CChannelLogo = NULL; static CComponentsHeader *header = NULL; extern bool timeset; @@ -126,7 +125,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl cc_minitv = NULL; logo_off = 0; minitv_is_active = false; - CChannelLogo = NULL; headerNew = true; bouquet = NULL; chanlist = &channels; @@ -955,11 +953,6 @@ void CChannelList::hide() } if(header) header->kill(); - if (CChannelLogo){ - CChannelLogo->kill(); - delete CChannelLogo; - CChannelLogo = NULL; - } frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + OFFSET_INTER + info_height); clearItem2DetailsLine(); @@ -2130,11 +2123,6 @@ void CChannelList::paintHead() header->setCaption(header_txt, CTextBox::NO_AUTO_LINEBREAK, header_txt_col); - if (header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0)){ - if (CChannelLogo) - CChannelLogo->clearFbData(); - } - if (timeset) { if(!edit_state){ if (header->getContextBtnObject()) @@ -2181,10 +2169,6 @@ void CChannelList::ResetModules() delete cc_minitv; cc_minitv = NULL; } - if (CChannelLogo) { - delete CChannelLogo; - CChannelLogo = NULL; - } } void CChannelList::paintBody() From a2cab1dffa9bc953d4de71f4d26d82bc37775597 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 24 Apr 2017 12:29:52 +0200 Subject: [PATCH 127/394] scrollbars: avoid usage of COL_SCROLLBAR_PASSIVE_PLUS_0 ... ... outside of CComponentsScrollBar(). Since the color-changes in cd80e26 the non-CC scrollbars looks weird. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe5f84c1d08b194267b6ff11b74b8b3dca0facd7 Author: vanhofen Date: 2017-04-24 (Mon, 24 Apr 2017) Origin message was: ------------------ - scrollbars: avoid usage of COL_SCROLLBAR_PASSIVE_PLUS_0 ... ... outside of CComponentsScrollBar(). Since the color-changes in cd80e26 the non-CC scrollbars looks weird. ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/channellist.cpp | 2 +- src/gui/epgview.cpp | 2 +- src/gui/eventlist.cpp | 2 +- src/gui/filebrowser.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/timerlist.cpp | 2 +- src/gui/upnpbrowser.cpp | 4 ++-- src/gui/widget/listbox.cpp | 2 +- src/gui/widget/listframe.cpp | 2 +- src/gui/widget/textbox.cpp | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 673c8103c..a95fbcdfa 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1766,7 +1766,7 @@ void CAudioPlayerGui::paint() int ypos = m_y + m_title_height + m_theight; int sb = m_fheight * m_listmaxshow; - m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc = ((m_playlist.size() - 1) / tmp_max) + 1; int sbs = (m_selected / tmp_max); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 5e2e348c8..0109fd340 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -127,7 +127,7 @@ void CBEBouquetWidget::paint() int ypos = y+ theight; int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 2c87de088..97a65de4c 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -161,7 +161,7 @@ void CBEChannelWidget::paint() int ypos = y+ theight; int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1; if (sbc < 1) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index f88736107..f91b47469 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -459,7 +459,7 @@ void CBookmarkManager::paint() { int ypos = y+ theight; int sb = 2*fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int tmp_max = listmaxshow; if(!tmp_max) tmp_max = 1; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 680e09724..edc0e8bab 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2203,7 +2203,7 @@ void CChannelList::paintBody() const int ypos = y+ theight; const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1; const int sbs= (selected/listmaxshow_tmp); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 078da34ae..bf6658969 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -327,7 +327,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) int sbs= (startPos+ 1)/ medlinecount; if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); // scrollbar bg + frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_SCROLLBAR_PLUS_0); // scrollbar bg frameBuffer->paintBoxRel(sx+ ox- 13, ypos+ 2+ sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); // scrollbar } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index f8209f6d5..2c1a859d7 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -920,7 +920,7 @@ void CEventList::paint(t_channel_id channel_id) int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc= ((evtlist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 7ecdcf00e..d1f725fcf 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1454,7 +1454,7 @@ void CFileBrowser::paint() //scrollbar int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc= ((filelist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 97e335fa1..1dc102dca 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -750,7 +750,7 @@ void CPictureViewerGui::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int tmp_max = listmaxshow; if(!tmp_max) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 145360ee8..fa7e7467e 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1427,7 +1427,7 @@ void CTimerList::paint() { int ypos = y+ theight; int sb = 2*fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int tmp_max = listmaxshow; if (!tmp_max) tmp_max = 1; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b407d7924..9b6bf89b1 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1000,7 +1000,7 @@ void CUpnpBrowserGui::paintDevices() paintDevice(count); int sb = m_item_height * m_listmaxshow; - m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int tmp_max = m_listmaxshow; if(!tmp_max) tmp_max = 1; @@ -1179,7 +1179,7 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel paintItem(entry, count, selected); int sb = m_item_height * m_listmaxshow; - m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PLUS_0); unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero int sbc = ((max + offset - 1) / tmp) + 1; int sbs = ((selected + offset) / tmp); diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 6443e028f..1edcc681f 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -69,7 +69,7 @@ void CListBox::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1; if (sbc < 1) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 3d17d46fb..33f76ea43 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -385,7 +385,7 @@ void CListFrame::refreshScroll(void) if (m_nNrOfPages > 1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PLUS_0, RADIUS_MIN); unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*OFFSET_INNER_MIN) / m_nNrOfPages; frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + OFFSET_INNER_MIN+m_cFrame.iX, m_cFrameScrollRel.iY + OFFSET_INNER_MIN + m_nCurrentPage * marker_size +m_cFrame.iY, diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 82195ae5a..34b0a941e 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -527,7 +527,7 @@ void CTextBox::refreshScroll(void) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + COL_SCROLLBAR_PLUS_0, RADIUS_MIN); unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER + m_cFrame.iX, m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size + m_cFrame.iY, From 72ac3f9fd4e875ebd1dcb3a1dbff228fa8d06d97 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 24 Apr 2017 22:30:13 +0200 Subject: [PATCH 128/394] lib/libtuxtxt/Makefile.am: Fix FREETYPE_CFLAGS Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a08685b57c474ba35a958e8e3066c0455f36529 Author: Michael Liebmann Date: 2017-04-24 (Mon, 24 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libtuxtxt/Makefile.am b/lib/libtuxtxt/Makefile.am index f3dc7d972..537cb307c 100644 --- a/lib/libtuxtxt/Makefile.am +++ b/lib/libtuxtxt/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ - $(FREETYPE_CFLAGS) \ + @FREETYPE_CFLAGS@ \ @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ From ad1573af8c432634b1c7e823470971893338c623 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 24 Apr 2017 22:31:00 +0200 Subject: [PATCH 129/394] src/zapit/src/femanager.cpp: Fix compile error Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aaa7b41d0b1cfd737aa6cb44b752b84b011714e3 Author: Michael Liebmann Date: 2017-04-24 (Mon, 24 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/femanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 5364a64b8..7987eb5a0 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -371,7 +371,9 @@ void CFEManager::saveSettings(bool write) void CFEManager::copySettings(CFrontend * from, CFrontend * to) { INFO("Copy settings fe %d -> fe %d", from->fenumber, to->fenumber); - if (to->config.diseqcType != DISEQC_UNICABLE || to->config.diseqcType != DISEQC_UNICABLE2 || to->getMode() == CFrontend::FE_MODE_LINK_LOOP) + if ((to->config.diseqcType != DISEQC_UNICABLE && + to->config.diseqcType != DISEQC_UNICABLE2) || + to->getMode() == CFrontend::FE_MODE_LINK_LOOP) to->config.diseqcType = from->config.diseqcType; to->config.diseqcRepeats = from->config.diseqcRepeats; From 759ecbb4af0154ee14b9fe63ebb0f091118a28ac Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 24 Apr 2017 08:00:36 +0200 Subject: [PATCH 130/394] CComponentsHeader: unifiy init value for logo align Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/220829ffaa7fcbff0f6810284fb48c7f9154ad25 Author: Thilo Graf Date: 2017-04-24 (Mon, 24 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- src/gui/components/cc_frm_header.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 9161a0fe3..770c643de 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -128,7 +128,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_logo.Id = 0; cch_logo.Name = ""; cch_logo.dy_max = -1; - cch_logo.Align = CC_LOGO_RIGHT; + cch_logo.Align = DEFAULT_LOGO_ALIGN; cch_col_text = COL_MENUHEAD_TEXT; cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; cch_items_y = CC_CENTERED; diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 1a0f1c8d4..a525a3ecc 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,6 +32,8 @@ #include "cc_frm_clock.h" #include +#define DEFAULT_LOGO_ALIGN CComponentsHeader::CC_LOGO_CENTER + //! Sub class of CComponentsForm. Shows a header with prepared items. /*! CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows @@ -320,7 +322,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen */ void setChannelLogo( const uint64_t& channelId, const std::string& channelName, - cc_logo_alignment_t alignment = CC_LOGO_CENTER, + cc_logo_alignment_t alignment = DEFAULT_LOGO_ALIGN, const int& dy = -1) {cch_logo.Id = channelId; cch_logo.Name = channelName, cch_logo.Align = alignment, cch_logo.dy_max = dy; initCCItems();} /**Methode to get channel logo object for direct access to its properties and methodes From 8e1654d74ba9d213746d8eec23590ca242bc90e1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 24 Apr 2017 08:30:52 +0200 Subject: [PATCH 131/394] EpgPlus: simplify calls of logo attributes and logo instance Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b19ea1fd1a9ff689c8c42cf4731f9d8319b7b8e Author: Thilo Graf Date: 2017-04-24 (Mon, 24 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 19 +++++++++++-------- src/gui/epgplus.h | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 7ebf586db..c8db47377 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -111,20 +111,23 @@ void EpgPlus::Header::paint(const char * Name) std::string caption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD); if (this->head == NULL) + { this->head = new CComponentsHeader(); + this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); + this->head->enableClock(true, "%H:%M", "%H %M", true); + } if (this->head) { if (g_settings.channellist_show_channellogo) { // ensure to have clean background - this->head->getChannelLogoObject()->hide(); - this->head->getChannelLogoObject()->allowPaint(false); + this->logo = this->head->getChannelLogoObject(); + this->logo->hide(); + this->logo->allowPaint(false); } this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK); - this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); - this->head->enableClock(true, "%H:%M", "%H %M", true); this->head->paint(CC_SAVE_SCREEN_NO); } } @@ -136,14 +139,14 @@ void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel) if (this->head) { - this->head->getChannelLogoObject()->hide(); - this->head->getChannelLogoObject()->clearSavedScreen(); + this->logo->hide(); + this->logo->clearSavedScreen(); if (Channel) { this->head->setChannelLogo(Channel->getChannelID(), Channel->getName()); } - this->head->getChannelLogoObject()->allowPaint(true); - this->head->getChannelLogoObject()->paint(); + this->logo->allowPaint(true); + this->logo->paint(); } } diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index f5a0ee65f..b317e6f82 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -69,6 +69,8 @@ class EpgPlus class Header { + private: + CComponentsChannelLogoScalable *logo; //// construction / destruction public: Header(CFrameBuffer* frameBuffer, From 9ddf91b41027ce9b92bb40640e5d24a7c39aeac1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 24 Apr 2017 11:21:46 +0200 Subject: [PATCH 132/394] COsdSetup: reset channellist objects after changed window size Ensures complete reinit of relevent modules inside channellist instance. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4de8c61c043a7c0ddf5ce195aa14e096a208fbf1 Author: Thilo Graf Date: 2017-04-24 (Mon, 24 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 60cd9ebfc..f2ec1473e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -314,6 +314,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) memset(window_size_value, 0, sizeof(window_size_value)); snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height); mfWindowSize->setOption(window_size_value); + CNeutrinoApp::getInstance()->channelList->ResetModules(); break; } else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { g_settings.window_width = old_window_width; From 5b9d1ba1f6bc97eda861ca050beafafd10804f6b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 11 Apr 2017 07:35:31 +0200 Subject: [PATCH 133/394] EpgPlus: update license text Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e3390687c5633aeafea05dab21a3ac7cba2ae54 Author: Thilo Graf Date: 2017-04-11 (Tue, 11 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 3 +-- src/gui/epgplus.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index c8db47377..e945d32ee 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -19,8 +19,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index b317e6f82..d0dc7286d 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -18,8 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef __epgplus__ From a3875a8f511e47c8ad84b37faf945da6a41d8d12 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 25 Apr 2017 09:55:51 +0200 Subject: [PATCH 134/394] CProgressBar: add own position methodes NOTE: not required in branch pu/fb-setmode, remove this after merge! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cffab5f8f963fda235e98e389e9cbf363dabefd1 Author: Thilo Graf Date: 2017-04-25 (Tue, 25 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_progressbar.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index 610402687..b158bd49e 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -157,6 +157,9 @@ class CProgressBar : public CComponentsItem //set gradient (overides g_settings.theme.progressbar_gradient) void setGradient(int &gradient) { pb_gradient = &gradient; } + + void setXPos(const int& xpos){CCDraw::setXPos(xpos);} + void setYPos(const int& ypos){CCDraw::setYPos(ypos);} }; #endif /* __CC_PROGRESSBAR_H__ */ From bf914a5885c82369724d44b377f3e9ca51137f22 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 25 Apr 2017 11:21:44 +0200 Subject: [PATCH 135/394] CComponentsPicture: add methode to get real image size Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0aae491cccad8d5efb424c4b051f427ea4e3f455 Author: Thilo Graf Date: 2017-04-25 (Tue, 25 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_picture.cpp | 22 +++++++++++++++------- src/gui/components/cc_item_picture.h | 9 +++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 91841c071..c776dfcb6 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -76,6 +76,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, y = y_old = y_pos; width = width_old = dx = dxc = w; height = height_old = dy = dyc = h; + dx_orig = dy_orig = 0; pic_name = pic_name_old = image_name; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; @@ -201,6 +202,9 @@ void CComponentsPicture::initCCItem() if (height == 0) height = dy_tmp; } + dx_orig = width; + dy_orig = height; + /* leave init methode here if we in no scale mode * otherwise goto next step! */ @@ -211,8 +215,12 @@ void CComponentsPicture::initCCItem() * check internal dimension values (dx/dy) and ensure that values are >0 * real image size */ - if ((dx != width || dy != height) || (dx == 0 || dy == 0)) - g_PicViewer->getSize(pic_name.c_str(), &dx, &dy); + g_PicViewer->getSize(pic_name.c_str(), &dx_orig, &dy_orig); + if ((dx != width || dy != height) || (dx == 0 || dy == 0)){ + dx = dx_orig; + dy = dy_orig; + //g_PicViewer->getSize(pic_name.c_str(), &dx, &dy); + } } /* on next step check item dimensions (width/height) for 0 values @@ -269,11 +277,11 @@ void CComponentsPicture::initPosition(int *x_position, int *y_position) } -// void CComponentsPicture::getSize(int* width_image, int *height_image) -// { -// *width_image = width; -// *height_image = height; -// } +void CComponentsPicture::getRealSize(int* dx_original, int *dy_original) +{ + *dx_original = dx_orig; + *dy_original = dy_orig; +} int CComponentsPicture::getWidth() { diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 7bf8953d0..ef8204d55 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -54,9 +54,10 @@ class CComponentsPicture : public CComponentsItem ///screen cache content for painted image fb_pixel_t *image_cache; - ///current original image dimensions + ///current image dimensions int dx, dy; - + ///original image dimensions + int dx_orig, dy_orig; ///cached image dimensions int dxc, dyc; @@ -146,8 +147,8 @@ class CComponentsPicture : public CComponentsItem ///returns current assigned image name std::string getPictureName(){return pic_name;} -// ///handle image size -// void getSize(int* width_image, int *height_image); + ///get original image size + void getRealSize(int* dx_orig, int *dy_orig); ///return width of item int getWidth(); ///return height of item From 415c1cb987900bfdb8d03e4b629aa4860e90e74c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 25 Apr 2017 11:31:53 +0200 Subject: [PATCH 136/394] CComponentsHeader: optimize auto size mode for logos With very large font size settings it is possible that header is too large for reasonable display of logos, because of possible bad upscale effects (eg. step effects). So it seems it's better to use original size as largest possible size. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/76cd93555db7043a8442727f5f2fcba50ddde36d Author: Thilo Graf Date: 2017-04-25 (Tue, 25 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 8 ++++++++ src/gui/components/cc_frm_header.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 770c643de..0d5207d3b 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -281,6 +281,14 @@ void CComponentsHeader::initLogo() else cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); + //ensure logo is not larger than original size if in auto mode + if (cch_logo.dy_max == -1){ + int dx_orig = 0, dy_orig = 0 ; + cch_logo_obj->getRealSize(&dx_orig, &dy_orig); + if (cch_logo.dy_max > dy_orig) + cch_logo.dy_max = dy_orig; + } + if (cch_logo_obj->hasLogo()){ cch_logo_obj->setHeight(cch_logo.dy_max, true); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index a525a3ecc..320c59282 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -319,6 +319,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen * CC_LOGO_RIGHT \n * @param[in] dy * @li optional logo height, default = -1 (auto) + * @note In auto mode, logo use full height minus inner offset but not larger than original logo height. */ void setChannelLogo( const uint64_t& channelId, const std::string& channelName, From 28c88cd6f266f1951b44f54c602a11e8c35fb088 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 25 Apr 2017 16:38:47 +0200 Subject: [PATCH 137/394] fix logo position with clock Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b696007ec8d0ecb624cfbd9a31583cdc549f393e Author: Jacek Jendrzej Date: 2017-04-25 (Tue, 25 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 0d5207d3b..2c1d45f14 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -299,6 +299,7 @@ void CComponentsHeader::initLogo() //right end int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID; + x_logo_right -= cch_cl_enable ? cch_cl_obj->getWidth() : 0; //left end int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; From 8d9742e1bfc948ff346d7dc57c4562c5048a4b26 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Apr 2017 07:51:38 +0200 Subject: [PATCH 138/394] CComponentsHeader: fix logo position with clock This reverts "fix logo position with clock", commit 28c88cd6f266f1951b44f54c602a11e8c35fb088. Was not the right way. Id's are not in visual order, therefore it's better to calculate direct with the ''width"" properties of possible following items clock and context buttons. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2bc8b4f8f3ea150e4052a12856f5296c476485c Author: Thilo Graf Date: 2017-04-26 (Wed, 26 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 2c1d45f14..f4f013203 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -294,12 +294,15 @@ void CComponentsHeader::initLogo() // set id of logo item depends of neighbor items int logo_id = getCCItemId(cch_logo_obj); - int next_id = logo_id + 1; int prev_id = logo_id - 1; //right end - int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID; - x_logo_right -= cch_cl_enable ? cch_cl_obj->getWidth() : 0; + int x_logo_right = width - cch_logo_obj->getWidth(); + if (cch_btn_obj) + x_logo_right -= cch_btn_obj->getWidth(); + if (cch_cl_obj) + x_logo_right -= cch_cl_obj->getWidth(); + //left end int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; From 6285845b3dcba48e71aaf4331b1ae911d94bb539 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Apr 2017 09:27:45 +0200 Subject: [PATCH 139/394] CComponentsHeader: rectification for 'optimize auto size mode for logos' see commit: 415c1cb987900bfdb8d03e4b629aa4860e90e74c Additional variable was required. Values were overwritten and had no effect. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71606d0860b0c79ee29db1c1fcb0735ddf30b046 Author: Thilo Graf Date: 2017-04-27 (Thu, 27 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f4f013203..2c1cb9e9d 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -274,10 +274,10 @@ void CComponentsHeader::initIcon() void CComponentsHeader::initLogo() { - cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; + int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) - cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this); + cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this); else cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); @@ -285,12 +285,12 @@ void CComponentsHeader::initLogo() if (cch_logo.dy_max == -1){ int dx_orig = 0, dy_orig = 0 ; cch_logo_obj->getRealSize(&dx_orig, &dy_orig); - if (cch_logo.dy_max > dy_orig) - cch_logo.dy_max = dy_orig; + if (h_logo > dy_orig) + h_logo = dy_orig; } if (cch_logo_obj->hasLogo()){ - cch_logo_obj->setHeight(cch_logo.dy_max, true); + cch_logo_obj->setHeight(h_logo, true); // set id of logo item depends of neighbor items int logo_id = getCCItemId(cch_logo_obj); From 041b5e778b82868310853933fa726a429836c7c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Apr 2017 09:27:45 +0200 Subject: [PATCH 140/394] CComponentsForm: add member hideCCItems() In case of items with cached background it is useful to have possibility to restore their background. (eg. items are painted outside of form). Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/19fc8c6d3bd81cc25be26d6b5042277002be5bb0 Author: Thilo Graf Date: 2017-04-27 (Thu, 27 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 6 ++++++ src/gui/components/cc_frm.h | 10 ++++++++++ src/gui/components/cc_frm_header.h | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index c202c6742..bd1f4f555 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -532,6 +532,12 @@ void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent v_cc_items[i]->kill(bg_color, ignore_parent); } +void CComponentsForm::hideCCItems() +{ + for(size_t i=0; ihide(); +} + void CComponentsForm::setPageCount(const u_int8_t& pageCount) { u_int8_t new_val = pageCount; diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 3561e495a..59f488fdb 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -81,6 +81,16 @@ class CComponentsForm : public CComponentsItem ///NOTE: Items always have parent bindings to "this" and use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! virtual void killCCItems(const fb_pixel_t& bg_color, bool ignore_parent); + /** + Removes possible contained items and finally removes + current form from screen and + restores last displayed background before form was painted. + */ + void hide(){hideCCItems(); CCDraw::hide();} + + ///restore background for all items inside form, + void hideCCItems(); + ///add an item to form collection, returns id virtual int addCCItem(CComponentsItem* cc_Item); ///add items from a vector to form collection, returns size/count of items diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 320c59282..9550d1134 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -299,7 +299,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); ///hides item, arg: no_restore see hideCCItem() - void hide(){disableClock(); CComponents::hide();} + void hide(){disableClock(); CComponentsForm::hide();} ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES, bool disable_clock = true); From f0fd59d57b4da797f1de48b17d4aaddb7294665b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Apr 2017 11:24:29 +0200 Subject: [PATCH 141/394] CChannelList: don't assign logo if disabled Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/85f4992ca8444f833dd1aec4cdf672295747f165 Author: Thilo Graf Date: 2017-04-27 (Thu, 27 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index edc0e8bab..d27048362 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2148,6 +2148,8 @@ void CChannelList::paintHead() header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); header->getChannelLogoObject()->allowPaint(false); } + else + header->setChannelLogo(0, string()); header->paint(CC_SAVE_SCREEN_NO); showChannelLogo(); } From 4c2d450c36fa3da2b55b15618c0cea8a61bc84aa Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 27 Apr 2017 14:26:27 +0200 Subject: [PATCH 142/394] src/gui/channellist.cpp remove unused logo_off Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6cb58546d89a327f0c8ad464c43bcac036803329 Author: Jacek Jendrzej Date: 2017-04-27 (Thu, 27 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 ---- src/gui/channellist.h | 1 - 2 files changed, 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d27048362..22abc6782 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -123,7 +123,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; dline = NULL; cc_minitv = NULL; - logo_off = 0; minitv_is_active = false; headerNew = true; bouquet = NULL; @@ -2129,7 +2128,6 @@ void CChannelList::paintHead() if (!header->getContextBtnObject()->empty()) header->removeContextButtons(); header->enableClock(true, "%H:%M", "%H %M", true); - logo_off = header->getClockObject()->getWidth() + OFFSET_INNER_MID; header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); }else{ @@ -2139,8 +2137,6 @@ void CChannelList::paintHead() } } } - else - logo_off = OFFSET_INNER_MID; if(g_settings.channellist_show_channellogo){ //ensure to have clean background diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 75ac35a63..edde1bbda 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -112,7 +112,6 @@ private: int info_height; // the infobox below mainbox is handled outside height int x; int y; - int logo_off; int pig_width; int pig_height; int infozone_width; From 1068a5dce5991f3a9d083b773024ee316e965640 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 29 Apr 2017 18:00:03 +0200 Subject: [PATCH 143/394] CComponentsFrmChain: add possibility to assign border offsets Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3dda388c8deafde7f9e5852ebee78852ecf83a75 Author: Thilo Graf Date: 2017-04-29 (Sat, 29 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_chain.cpp | 88 +++++++++++++++++++++++++---- src/gui/components/cc_frm_chain.h | 25 +++++++- 2 files changed, 100 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_frm_chain.cpp b/src/gui/components/cc_frm_chain.cpp index 4910e469c..b08343e46 100644 --- a/src/gui/components/cc_frm_chain.cpp +++ b/src/gui/components/cc_frm_chain.cpp @@ -27,6 +27,25 @@ using namespace std; + +/* general chain form shema + + x/y + / + +---------------------------------------width----------------------------------------+ + | chn_t_offset | + | +--------+ +--------+ +--------+ | + |chn_l_offset| item |append_x_offset| item |append_x_offset| item |chn_r_offset| + | +--------+ +--------+ +--------+ | + | append_y_offset |height + | +--------+ +--------+ +--------+ | + | | item | | item | | item | | + | +--------+ +--------+ +--------+ | + | chn_t_offset | + +------------------------------------------------------------------------------------+ +*/ + + //------------------------------------------------------------------------------------------------------- //sub class CComponentsFrmChain CComponentsFrmChain::CComponentsFrmChain( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -59,11 +78,14 @@ void CComponentsFrmChain::initVarChain( const int& x_pos, const int& y_pos, cons width = w; height = h; + chn_l_offset = chn_r_offset = 0; + chn_t_offset = chn_b_offset = 0; + shadow = shadow_mode; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - + chn_direction = direction; if (v_items) @@ -86,23 +108,65 @@ void CComponentsFrmChain::initChainItems() return; //set new values - int w_tmp = append_x_offset; - int h_tmp = append_y_offset; + int w_tmp = 0, h_tmp = 0; + int w_item = 0, h_item = 0; + size_t i_count = v_cc_items.size(); - for (size_t i= 0; i< v_cc_items.size(); i++){ - int x_item = v_cc_items[i]->getXPos(); - int y_item = v_cc_items[i]->getYPos(); + + for (size_t i= 0; i< i_count; i++){ +// x_item = v_cc_items[i]->getXPos(); +// y_item = v_cc_items[i]->getYPos(); + w_item = v_cc_items[i]->getWidth(); + h_item = v_cc_items[i]->getHeight(); if (chn_direction & CC_DIR_X){ - w_tmp += v_cc_items[i]->getWidth(); - w_tmp += append_x_offset; - v_cc_items[i]->setPos(max(CC_APPEND, x_item), max(CC_CENTERED, y_item)); + if (i == 0){ + v_cc_items[i]->setXPos(chn_l_offset); + w_tmp += chn_l_offset; + w_tmp += w_item; + if (i_count == 1) + w_tmp += chn_r_offset; + } + + if (i_count > 1){ + if (i == i_count-1){ + w_tmp += w_item; + w_tmp += append_x_offset; + v_cc_items[i]->setXPos(w_tmp - v_cc_items[i]->getWidth()); + w_tmp += chn_r_offset; + } + } + + if (i != 0 && i != i_count-1){ + w_tmp += w_item; + w_tmp += append_x_offset; + v_cc_items[i]->setXPos(w_tmp - v_cc_items[i]->getWidth()); + } } if (chn_direction & CC_DIR_Y){ - h_tmp += v_cc_items[i]->getHeight(); - h_tmp += append_y_offset; - v_cc_items[i]->setPos(max(CC_CENTERED, x_item), max(CC_APPEND, y_item)); + if (i == 0){ + v_cc_items[i]->setYPos(chn_t_offset); + h_tmp += chn_t_offset; + h_tmp += h_item; + if (i_count == 1) + h_tmp += chn_b_offset; + } + + if (i_count > 1){ + if (i == i_count-1){ + h_tmp += h_item; + h_tmp += append_y_offset; + v_cc_items[i]->setYPos(h_tmp - v_cc_items[i]->getHeight()); + h_tmp += chn_b_offset; + } + } + + if (i != 0 && i != i_count-1){ + h_tmp += h_item; + h_tmp += append_y_offset; + v_cc_items[i]->setYPos(h_tmp - v_cc_items[i]->getHeight()); + } } } width = max (w_tmp, width); diff --git a/src/gui/components/cc_frm_chain.h b/src/gui/components/cc_frm_chain.h index a33f63ed8..560984a5e 100644 --- a/src/gui/components/cc_frm_chain.h +++ b/src/gui/components/cc_frm_chain.h @@ -55,6 +55,10 @@ class CComponentsFrmChain : public CComponentsForm fb_pixel_t& color_frame, fb_pixel_t& color_body, fb_pixel_t& color_shadow); + + int chn_l_offset, chn_r_offset; + int chn_t_offset, chn_b_offset; + protected: ///property: mode for arrangement direction of items, see also setDirection(), getDirection() int chn_direction; @@ -75,7 +79,26 @@ class CComponentsFrmChain : public CComponentsForm ///defines mode for arrangement direction of items, see also chn_direction virtual void setDirection(int direction); ///gets the mode of arrangment direction - virtual int getDirection(){return chn_direction;}; + virtual int getDirection(){return chn_direction;} + + /**Members to set border offsets + * @param[in] offset + * @li expects type int as offset value + * @return + * void + */ + void setLeftOffset(const int& offset){chn_l_offset = offset;} + void setRightOffset(const int& offset){chn_r_offset = offset;} + void setTopOffset(const int& offset){chn_t_offset = offset;} + void setBottomOffset(const int& offset){chn_b_offset = offset;} + + void setBorderOffsets(const int& left_offset, const int& right_offset, const int& top_offset, const int& bottom_offset) + { + setLeftOffset(left_offset); + setRightOffset(right_offset); + setTopOffset(top_offset); + setBottomOffset(bottom_offset); + } }; #endif From 7e2f0d1806e1a65847e34db189e64b986b7343d4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 29 Apr 2017 18:00:03 +0200 Subject: [PATCH 144/394] CComponentsHeader: adjust context button offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8326af0df4ffcbd835f30a239bc7a2fea0cc547 Author: Thilo Graf Date: 2017-04-29 (Sat, 29 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 2c1cb9e9d..fff49031a 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -414,8 +414,9 @@ void CComponentsHeader::initButtons() //set button form properties if (cch_btn_obj){ cch_btn_obj->setYPos(cch_items_y); - cch_btn_obj->doPaintBg(false); + cch_btn_obj->doPaintBg(false);; cch_btn_obj->setAppendOffset(cch_buttons_space, 0); + cch_btn_obj->setRightOffset(cch_buttons_space); cch_btn_obj->removeAllIcons(); cch_btn_obj->addIcon(v_cch_btn); From 2b47df912dee6301efacf93ba29e4519a2522750 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 29 Apr 2017 18:00:03 +0200 Subject: [PATCH 145/394] CTimerList: adjust date offset via format Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b7d50b923f7f435e63002b8f1169d372279a2e91 Author: Thilo Graf Date: 2017-04-29 (Sat, 29 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index fa7e7467e..3eda88907 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1378,7 +1378,7 @@ void CTimerList::paintItem(int pos) void CTimerList::paintHead() { CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, "%d.%m.%Y %H:%M"); + header.enableClock(true, " %d.%m.%Y %H:%M "); header.paint(CC_SAVE_SCREEN_NO); } From 8e623eea5adba59e93b8df2dd6bdde3f2a962048 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 29 Apr 2017 18:09:16 +0200 Subject: [PATCH 146/394] cc_frm_chain.cpp: fix c/p error in comment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/891b2e9ad2f4f8023ff4234b711d7a14ae705c55 Author: Thilo Graf Date: 2017-04-29 (Sat, 29 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_chain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_chain.cpp b/src/gui/components/cc_frm_chain.cpp index b08343e46..dcc261265 100644 --- a/src/gui/components/cc_frm_chain.cpp +++ b/src/gui/components/cc_frm_chain.cpp @@ -41,7 +41,7 @@ using namespace std; | +--------+ +--------+ +--------+ | | | item | | item | | item | | | +--------+ +--------+ +--------+ | - | chn_t_offset | + | chn_b_offset | +------------------------------------------------------------------------------------+ */ From f47e0837c061507da062a79167aa763d01cc39b0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 29 Apr 2017 22:46:06 +0200 Subject: [PATCH 147/394] CChannelList: Ensure new initialize of modules on palette changes while runtime. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e4967e114bfa5a6a054d062cc5d245cd48219ae Author: Thilo Graf Date: 2017-04-29 (Sat, 29 Apr 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 22abc6782..e03acf7e8 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -132,6 +132,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl channelsChanged = false; paint_events_index = -2; + CFrameBuffer::getInstance()->OnAfterSetPallette.connect(sigc::mem_fun(this, &CChannelList::ResetModules)); } CChannelList::~CChannelList() From d5bc25ae238916176510bf48c4c67ddfa3480ace Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 2 May 2017 13:08:06 +0200 Subject: [PATCH 148/394] src/gui/upnpbrowser.cpp fix segfault on connect error Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc0f0cd951b7be88bd0d452b3387f3288297cd16 Author: Jacek Jendrzej Date: 2017-05-02 (Tue, 02 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 9b6bf89b1..7458db5f7 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -731,7 +731,7 @@ bool CUpnpBrowserGui::selectItem(std::string id) if (!getItems(id, liststart, entries, total)) return endall; - while (loop) { + while (loop && entries!=NULL) { updateTimes(); updateMode(); From 32c6874aa2f3d9ef57b6eab030a3d9741fcd2a3c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 1 May 2017 14:59:16 +0200 Subject: [PATCH 149/394] CCDraw: add methode do get current background save mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ac5db718dd84b4594806d46ba9e6fc438452d14 Author: Thilo Graf Date: 2017-05-01 (Mon, 01 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 26b8875d5..0f23e7eb4 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -284,6 +284,8 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void enableSaveBg(bool save_bg = true); ///disable background buffering, does the same like enableSaveBg(false), NOTE: cleans existant pixbuffer content! virtual void disableSaveBg(){enableSaveBg(false);} + ///returns background buffering mode. Mode is assigned with paint() or enableSaveBg()/disableSaveBg()) + bool SaveBg(){return cc_save_bg;} ///allow/disalows paint of item and its contents, but initialize of other properties are not touched ///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently? From 964651701f56e18de5846451c80e4ca962b8cac5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 1 May 2017 15:01:32 +0200 Subject: [PATCH 150/394] CComponentsForm: use current bg save mode while paint items Mode was always false but current mode could be required in many constellations. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e7d60f7c08a59d7fe8c3e1f26b15b5ee3a82f4c3 Author: Thilo Graf Date: 2017-05-01 (Mon, 01 May 2017) ------------------ This commit was generated by Migit --- 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 bd1f4f555..15bf84e42 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -518,7 +518,7 @@ void CComponentsForm::paintCCItems() //finally paint current item, but only required contents of page if (cc_item->getPageNumber() == cur_page) - cc_item->paint(CC_SAVE_SCREEN_NO); + cc_item->paint(cc_item->SaveBg()); //restore defined old visibility mode of item after paint cc_item->allowPaint(item_visible); From e01c99e5e8140dd1689017e37605e5e99bd4e5bc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 2 May 2017 17:21:01 +0200 Subject: [PATCH 151/394] cc_types: add missing image types Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/30b58f49409c91399df13aa4295081de81ddac6a Author: Thilo Graf Date: 2017-05-02 (Tue, 02 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_picture.h | 6 ++++-- src/gui/components/cc_types.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index ef8204d55..fe42604e7 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -208,7 +208,8 @@ class CComponentsPictureScalable : public CComponentsPicture fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE) - : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; + : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent) + {cc_item_type = CC_ITEMTYPE_PICTURE_SCALABLE;}; }; class CComponentsChannelLogo : public CComponentsPicture @@ -292,7 +293,8 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK) - : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; + : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent) + {cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE;}; }; #endif diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 297cc5b66..532aba066 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -41,7 +41,9 @@ typedef enum CC_ITEMTYPE_GENERIC, CC_ITEMTYPE_ITEM, CC_ITEMTYPE_PICTURE, + CC_ITEMTYPE_PICTURE_SCALABLE, CC_ITEMTYPE_CHANNEL_LOGO, + CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE, CC_ITEMTYPE_TEXT, CC_ITEMTYPE_TEXT_INFOBOX, CC_ITEMTYPE_SHAPE_SQUARE, From d0fd666bdbd32e75ab1b819bde78b243fd9fbe25 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 2 May 2017 19:54:42 +0200 Subject: [PATCH 152/394] CComponentsForm: expand debug output with address. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/801d1beb1084d756daf0ae88d1a95de28f5551ab Author: Thilo Graf Date: 2017-05-02 (Tue, 02 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 15bf84e42..430423045 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -185,12 +185,11 @@ void CComponentsForm::clear() return; for(size_t i=0; igetItemType()); - - delete v_cc_items[i]; - v_cc_items[i] = NULL; + CComponentsItem *item = v_cc_items[i]; + if (item){ + dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\taddress = %p\n", __func__, (int)i+1, (int)v_cc_items.size(), item->getItemType(), item); + delete item; + item = NULL; } } v_cc_items.clear(); From 90226e9a46acb318041062c10a3813e27e099713 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 1 May 2017 16:18:53 +0200 Subject: [PATCH 153/394] cc_form_header: add max caption width picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: 4ff6c9f89b194c5fffdc4ee4e4eb744829be975f Signed-off-by: Thilo Graf review reqiured Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c482dd139f26e5db804e022921fd21a9b75c653b Author: TangoCash Date: 2017-05-01 (Mon, 01 May 2017) Origin message was: ------------------ -cc_form_header: add max caption width picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: 4ff6c9f89b194c5fffdc4ee4e4eb744829be975f Signed-off-by: Thilo Graf review reqiured ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 3 +++ src/gui/components/cc_frm_header.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index fff49031a..c633c74b9 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -144,6 +144,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; + cch_text_max_w = width; + addContextButton(buttons); initCCItems(); initParent(parent); @@ -562,6 +564,7 @@ void CComponentsHeader::initCaption() cch_cl_obj->allowPaint(cch_cl_enable); } + cc_text_w = min(cc_text_w,cch_text_max_w); //create cch_text_obj and add to collection if (cch_text_obj == NULL){ diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 9550d1134..16fa2ddd1 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -106,6 +106,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int cch_icon_w; ///property: internal width for clock object int cch_clock_w; + ///property: internal max width for text object + int cch_text_max_w; ///property: internal x-position for caption object int cch_text_x; ///property: internal offset of context button icons within context button object @@ -191,6 +193,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual Font* getCaptionFont(){return cch_font;} ///set text color for caption virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;} + ///set max width for caption + virtual void setCaptionMaxWidth(int max_width){cch_text_max_w = max_width;} enum { From e36f7ccecd0d78d6350e2f99b82d7e7a90a626ee Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 154/394] eventlist,epgview: adjust style, implement new header class picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: 477db186ee4f306e191035ed2201ff4fc9d70b9d Signed-off-by: Thilo Graf review reqiured Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3ac2f99a671b444426f515b0d25ead1708880bf8 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist,epgview: adjust style, implement new header class picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: 477db186ee4f306e191035ed2201ff4fc9d70b9d Signed-off-by: Thilo Graf review reqiured ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 118 +++++++++++++++--------------------- src/gui/epgview.h | 2 +- src/gui/eventlist.cpp | 107 +++++++++++++++++++++----------- src/gui/eventlist.h | 5 +- src/gui/moviebrowser/mb.cpp | 1 + 5 files changed, 126 insertions(+), 107 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index bf6658969..b619f3dd6 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -712,46 +712,16 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start const int pic_h = 39; toph = std::max(toph, pic_h); - // Calculate offset for the title when logo appears. - int pic_offx = 0; std::string lname; - int logo_w = 0; - int logo_h = 0; - int logo_w_max = ox / 4; - int logo_h_max = toph - 2*OFFSET_INNER_MIN; std::string channel_name; if (mp_info) channel_name = mp_movie_info->channelName; else channel_name = g_Zapit->getChannelName(channel_id); - if (g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel_name, lname, &logo_w, &logo_h)) - { - if ((logo_h > logo_h_max) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, logo_h_max); - pic_offx = logo_w + OFFSET_INNER_MID; - } - - int pos; - std::string text1 = epgData.title; - std::string text2 = ""; - if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID) - { - do - { - pos = text1.find_last_of("[ .]+"); - if (pos != -1) - text1 = text1.substr(0, pos); - } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID)); - if (epgData.title.length() > text1.length()) // shold never be false in this place - text2 = epgData.title.substr(text1.length()+ 1, uint(-1) ); - } if (!topboxheight) start(); - if (!text2.empty()) - toph = 2 * topboxheight; - sb = oy - toph - botboxheight; // 21.07.2005 - rainerk @@ -869,61 +839,65 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); - //show the epg + // show the epg // header + logo - int header_h = std::max(toph, logo_h); - if (!header){ - header = new CComponentsShapeSquare(sx, sy, ox, header_h); - header->setCorner(RADIUS_LARGE, CORNER_TOP); + if (header) { + header->kill(); + delete header; + header = NULL; } - header->setDimensionsAll(sx, sy, ox, header_h); + + header = new CComponentsHeader(sx, sy, ox, toph); + header->setCorner(RADIUS_LARGE, CORNER_TOP); + header->setDimensionsAll(sx, sy, ox, toph); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos - if (pic_offx > 0) { - headerPic = new CComponentsPicture(sx + OFFSET_INNER_MID, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); - headerPic->doPaintBg(false); - } - std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - CComponentsText headerText(sx + OFFSET_INNER_MID + pic_offx, sy, ox - 2*OFFSET_INNER_MID - pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); - headerText.doPaintBg(false); - headerText.setTextColor(COL_MENUHEAD_TEXT); + header->enableClock(true, "%H:%M", "%H.%M", true); + header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); + + header->getChannelLogoObject()->hide(); + header->setChannelLogo(channel_id, channel_name); + + header->setCaption(epgData.title); + header->paint(CC_SAVE_SCREEN_NO); - headerText.paint(CC_SAVE_SCREEN_NO); - if (headerPic) - headerPic->paint(CC_SAVE_SCREEN_NO); int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); // small bottom box - frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); + CComponentsFrmChain *Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); + Bottombox->setColorBody(COL_MENUHEAD_PLUS_0); + if (!mp_info) { - static int iw = 0, ih = 0, io = 0; - if (!iw && !ih) - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); - if (!io && iw) - io = iw + OFFSET_INNER_MID; - std::string fromto = epg_start + " - " + epg_end; - - int widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+OFFSET_INNER_MID+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); - int widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-OFFSET_INNER_MID-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); + int x_off = OFFSET_INNER_MID; + int mid_width = ox * 40 / 100; // 40% + int side_width = ((ox - mid_width) / 2) - (2 * x_off); GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); - if (!call_fromfollowlist) - { - int iy = sy + oy - botboxheight + (botboxheight - iw)/2; - if (prev_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + OFFSET_INNER_MID, iy); - if (next_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - OFFSET_INNER_MID, iy); - } + + CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); + CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, toph, fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + if ((prev_id) && (!call_fromfollowlist)) + Bottombox->addCCItem(lpic); + lpic->doPaintBg(false); + lText->doPaintBg(false); + + CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); + int x_pos = ox - rpic->getWidth() - OFFSET_INNER_MID; + if ((next_id) && (!call_fromfollowlist)) + Bottombox->addCCItem(rpic); + rpic->setXPos(x_pos); + CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, toph, epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); + rpic->doPaintBg(false); + rText->doPaintBg(false); + + Bottombox->paint(false); } showProgressBar(); @@ -1300,8 +1274,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if(epgTextSwitchClear) epgTextSwitch.clear(); } - if (headerPic) - delete headerPic; return res; } @@ -1314,6 +1286,12 @@ void CEpgData::hide() g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIGFONT_FACTOR)); } + if (header) { + header->kill(); + delete header; + header = NULL; + } + frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); } diff --git a/src/gui/epgview.h b/src/gui/epgview.h index c7ec15b80..e2dd8a573 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -50,7 +50,7 @@ class CEpgData CChannelEventList evtlist; CChannelEventList followlist; CEPGData epgData; - CComponentsShapeSquare* header; + CComponentsHeader* header; std::string epg_date; std::string epg_start; std::string epg_end; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2c1a859d7..d1150a017 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -291,8 +291,10 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); //fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); - listmaxshow = (height-theight-iheight-0)/fheight; - height = theight+iheight+0+listmaxshow*fheight; // recalc height + botboxheight = fheight1+2*OFFSET_INNER_MIN; + + listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; + height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height y = getScreenStartY(height); // calculate width of right info_zone @@ -804,6 +806,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) // paint 2nd line text g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); + + if (i_radius) + showProgressBar(currpos); } } @@ -847,57 +852,90 @@ void CEventList::paintDescription(int index) void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) { - int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE; - int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; + if (header) { + header->kill(); + delete header; + header = NULL; + } - if (!header) - header = new CComponentsFrmChain(); + header = new CComponentsHeader(); header->setDimensionsAll(x, y, full_width, theight); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->setCorner(RADIUS_LARGE, CORNER_TOP); - header->clear(); + header->enableClock(true, "%H:%M", "%H.%M", true); + header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); + + header->getChannelLogoObject()->hide(); + header->setChannelLogo(_channel_id,_channelname); + header->setCaption(_channelname,CTextBox::CENTER); + + header->paint(CC_SAVE_SCREEN_NO); + paintBottomBox(_channelname_prev, _channelname_next); +} + +void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) +{ + int by = y + height - iheight - botboxheight; + int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; int x_off = OFFSET_INNER_MID; int mid_width = full_width * 40 / 100; // 40% - int max_height = theight - 2*OFFSET_INNER_MIN; int side_width = ((full_width - mid_width) / 2) - (2 * x_off); - //create an logo object - CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header); - if (midLogo->hasLogo()) - { - midLogo->setWidth(min(midLogo->getWidth(), mid_width), true); - if (midLogo->getHeight() > max_height) - midLogo->setHeight(max_height, true); - - midLogo->setPos(CC_CENTERED, CC_CENTERED); - - // recalc widths - side_width = ((full_width - midLogo->getWidth()) / 2) - (4 * x_off); - } - else { - header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available - int w_midText = g_Font[font_mid]->getRenderWidth(_channelname); - CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - midText->setXPos(full_width/2 - midText->getWidth()/2); - midText->doPaintBg(false); - } + CComponentsFrmChain *Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); + Bottombox->setColorBody(COL_MENUHEAD_PLUS_0); if (!_channelname_prev.empty()) { - CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox); + CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + lpic->doPaintBg(false); lText->doPaintBg(false); } if (!_channelname_next.empty()) { - int x_pos = full_width - side_width - x_off; - CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); + int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID; + rpic->setXPos(x_pos); + CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); + rpic->doPaintBg(false); rText->doPaintBg(false); } - if (header->isPainted()) //clean up background of header for new captions - header->kill(header->getColorBody()); - header->paint(CC_SAVE_SCREEN_NO); + Bottombox->paint(false); +} + +void CEventList::showProgressBar(int pos) +{ + int epg_done= -1; + if ((( time(NULL)- evtlist[pos].startTime )>= 0 ) && (evtlist[pos].duration > 0)) + { + unsigned nProcentagePassed = ((time(NULL) - evtlist[pos].startTime) * 100 / evtlist[pos].duration); + if (nProcentagePassed<= 100) + epg_done= nProcentagePassed; + } + + int pbw = 104; + int pbx = x + (full_width - pbw)/2; + int pbh = botboxheight - 12; + int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + + //show progressbar + if (epg_done != -1) + { + CProgressBar pb(pbx, pby, pbw, pbh); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } + else + { + CComponentsShapeSquare pb(pbx, pby, pbw, pbh); + pb.setColorBody(COL_MENUHEAD_PLUS_0); + pb.paint(false); + } + } void CEventList::paint(t_channel_id channel_id) @@ -998,7 +1036,6 @@ void CEventList::showFunctionBar(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO; btn_cnt++; } - ::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 90542ba26..512a38cf2 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -95,6 +95,7 @@ class CEventList : public CListHelpers std::string search_head_name; int full_width, width, infozone_width; + int botboxheight; int height; int x; int y; @@ -102,13 +103,15 @@ class CEventList : public CListHelpers int sort_mode; event_id_t item_event_ID; CComponentsText *cc_infozone; - CComponentsFrmChain *header; + CComponentsHeader *header; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); + void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); + void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 2d670805a..df586ca19 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2095,6 +2095,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { + m_header->getClockObject()->kill(); framebuffer->paintBackground(); //clear whole screen g_EpgData->show_mp(m_movieSelectionHandler); refresh(); From b9a2458f1b98ad122707501c05eb997986136aa5 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 155/394] eventlist: fix clock Signed-off-by: Thilo Graf review required Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/099f83e819dca892026d10afd826928091332cd4 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist: fix clock Signed-off-by: Thilo Graf review required ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index d1150a017..01e703843 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -684,6 +684,8 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { + if (header) + header->getClockObject()->kill(); frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); } From b86d0a7a09218cc5bf6a311c32e58dca13e6b39f Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 156/394] epgview: fix movieinfo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b0668cc23e5ea1fc7a70468604126481062e5b9 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -epgview: fix movieinfo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b619f3dd6..bd2120766 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -896,9 +896,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); rpic->doPaintBg(false); rText->doPaintBg(false); - - Bottombox->paint(false); } + + Bottombox->paint(false); + showProgressBar(); // show Timer Event Buttons From bb4fd66cae0939af710c45cf48b3619450d8a599 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 157/394] eventlist,epgview: add infoviewer bottom gradient style Signed-off-by: Thilo Graf review required Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/54ce85c59876bd524fae066cc300a2115f859631 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist,epgview: add infoviewer bottom gradient style Signed-off-by: Thilo Graf review required ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 4 +++- src/gui/eventlist.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index bd2120766..424fda032 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -869,7 +869,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // small bottom box CComponentsFrmChain *Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); - Bottombox->setColorBody(COL_MENUHEAD_PLUS_0); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); if (!mp_info) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 01e703843..975615f7c 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -886,7 +886,9 @@ void CEventList::paintBottomBox(std::string _channelname_prev, std::string _chan int side_width = ((full_width - mid_width) / 2) - (2 * x_off); CComponentsFrmChain *Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); - Bottombox->setColorBody(COL_MENUHEAD_PLUS_0); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); if (!_channelname_prev.empty()) { CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox); From 1dbd9769df6ff506a1f8119fc4223ad2d2d82798 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 158/394] eventlist: fix gradient background Signed-off-by: Thilo Graf review required Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ae0810e339fbdd8c0eb3c66300fc4b76c25caf0f Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist: fix gradient background Signed-off-by: Thilo Graf review required ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 19 +++++++++++-------- src/gui/eventlist.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 975615f7c..f5e573d2e 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -920,24 +920,27 @@ void CEventList::showProgressBar(int pos) epg_done= nProcentagePassed; } + if (!pb) + { int pbw = 104; int pbx = x + (full_width - pbw)/2; int pbh = botboxheight - 12; int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + pb = new CProgressBar(pbx, pby, pbw, pbh); + pb->setType(CProgressBar::PB_TIMESCALE); + pb->doPaintBg(false); + } + //show progressbar - if (epg_done != -1) + if (epg_done > 0) { - CProgressBar pb(pbx, pby, pbw, pbh); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); + pb->setValues(epg_done, 100); + pb->paint(true); } else { - CComponentsShapeSquare pb(pbx, pby, pbw, pbh); - pb.setColorBody(COL_MENUHEAD_PLUS_0); - pb.paint(false); + pb->hide(); } } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 512a38cf2..10d255f73 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -104,6 +104,7 @@ class CEventList : public CListHelpers event_id_t item_event_ID; CComponentsText *cc_infozone; CComponentsHeader *header; + CProgressBar *pb; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); From 93ef2ac356d9d65b15642315a03f7a7fbeec8d73 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 159/394] eventlist: fix segfault Signed-off-by: Thilo Graf review required Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/08c48016980b637bf5e277b2da2d8f85d4f513f2 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist: fix segfault Signed-off-by: Thilo Graf review required ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index f5e573d2e..c08d78183 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -120,12 +120,15 @@ CEventList::CEventList() oldEventID = -1; bgRightBoxPaint = false; header = NULL; + pb = NULL; } CEventList::~CEventList() { delete header; header = NULL; + delete pb; + pb = NULL; } void CEventList::UpdateTimerList(void) From 5dc6e6375f78093114ea08fae908d749325bdddf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 160/394] CEpgData: optimize handling of header and bottom box Working with existant instances and reduce flicker effects. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc805049d31a1402696e3111eec883f17f2eb838 Author: Thilo Graf Date: 2017-05-03 (Wed, 03 May 2017) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 164 ++++++++++++++++++++++++++++---------------- src/gui/epgview.h | 7 +- 2 files changed, 111 insertions(+), 60 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 424fda032..cde35d13c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -121,17 +121,22 @@ void reformatExtendedEvents(std::string strItem, std::string strLabel, bool bUse CEpgData::CEpgData() { - bigFonts = false; - frameBuffer = CFrameBuffer::getInstance(); - tmdb_active = false; - mp_movie_info = NULL; - header = NULL; + bigFonts = false; + frameBuffer = CFrameBuffer::getInstance(); + tmdb_active = false; + mp_movie_info = NULL; + header = NULL; + Bottombox = NULL; + lpic = NULL; + rpic = NULL; + lText = NULL; + rText = NULL; + pb = NULL; } CEpgData::~CEpgData() { - delete header; - header = NULL; + ResetModules(); } void CEpgData::start() @@ -841,40 +846,39 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (header) { - header->kill(); - delete header; - header = NULL; - } - - header = new CComponentsHeader(sx, sy, ox, toph); - header->setCorner(RADIUS_LARGE, CORNER_TOP); - header->setDimensionsAll(sx, sy, ox, toph); - header->setColorBody(COL_MENUHEAD_PLUS_0); - header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - - header->enableClock(true, "%H:%M", "%H.%M", true); - header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - - header->getChannelLogoObject()->hide(); - header->setChannelLogo(channel_id, channel_name); + if (!header){ + header = new CComponentsHeader(sx, sy, ox, toph); + header->setColorBody(COL_MENUHEAD_PLUS_0); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->enableClock(true, "%H:%M", "%H %M", true); + }else + header->setDimensionsAll(sx, sy, ox, toph); header->setCaption(epgData.title); + if (header->isPainted()) + header->hideCCItems(); + + // set channel logo + header->setChannelLogo(channel_id, channel_name); + + //paint head header->paint(CC_SAVE_SCREEN_NO); int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - // small bottom box - CComponentsFrmChain *Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); - Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); - Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); - Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + // small bottom box with left/right navigation + if (!Bottombox){ + Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->setCornerType(CORNER_NONE); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + } - if (!mp_info) - { + if (!mp_info){ std::string fromto = epg_start + " - " + epg_end; int x_off = OFFSET_INNER_MID; int mid_width = ox * 40 / 100; // 40% @@ -882,26 +886,52 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); - CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); - CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, toph, fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - if ((prev_id) && (!call_fromfollowlist)) + // init left arrow + if (!lpic){ + lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); + lpic->doPaintBg(false); Bottombox->addCCItem(lpic); - lpic->doPaintBg(false); - lText->doPaintBg(false); + lpic->enableSaveBg(); + } + lpic->allowPaint(prev_id && !call_fromfollowlist); - CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); - int x_pos = ox - rpic->getWidth() - OFFSET_INNER_MID; - if ((next_id) && (!call_fromfollowlist)) + // init right arrow + if (!rpic){ + rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT); + + rpic->doPaintBg(false); Bottombox->addCCItem(rpic); - rpic->setXPos(x_pos); - CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, toph, epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); - rpic->doPaintBg(false); - rText->doPaintBg(false); + rpic->enableSaveBg(); + int x_pos = ox - rpic->getWidth() - x_off; + rpic->setXPos(x_pos); + } + rpic->allowPaint(next_id && !call_fromfollowlist); + + // init text left "from to" + if (!lText){ + lText = new CComponentsText(x_off + lpic->getWidth() + x_off, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, NULL, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + lText->doPaintBg(false); + Bottombox->addCCItem(lText); + lText->enableSaveBg(); + } + lText->setText(fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR); + + // init text right "follow" + if (!rText){ + rText = new CComponentsText(0, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + rText->doPaintBg(false); + rText->enableSaveBg(); + } + rText->setText(epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]); + rText->setXPos(rpic->getXPos() - x_off - rText->getWidth()); } - Bottombox->paint(false); + //ensure clean background + if(Bottombox->isPainted()) + Bottombox->hideCCItems(); + //paint bottombox contents + Bottombox->paint(false); showProgressBar(); // show Timer Event Buttons @@ -1214,6 +1244,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } case CRCInput::RC_help: bigFonts = bigFonts ? false : true; + ResetModules(); frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); start(); @@ -1289,11 +1320,7 @@ void CEpgData::hide() g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIGFONT_FACTOR)); } - if (header) { - header->kill(); - delete header; - header = NULL; - } + ResetModules(); frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); @@ -1437,18 +1464,21 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st void CEpgData::showProgressBar() { + int w = 104; + int x = sx + (ox - w)/2; + int h = botboxheight - 12; + int y = sy + oy - botboxheight + (botboxheight - h)/2; + if (!pb){ + pb = new CProgressBar(x, y, w, h); + pb->setType(CProgressBar::PB_TIMESCALE); + } //show progressbar if (epg_done != -1) { - int w = 104; - int x = sx + (ox - w)/2; - int h = botboxheight - 12; - int y = sy + oy - botboxheight + (botboxheight - h)/2; - - CProgressBar pb(x, y, w, h); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); + pb->setValues(epg_done, 100); + pb->paint(true); + }else{ + pb->hide(); } } @@ -1523,6 +1553,22 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) } } +void CEpgData::ResetModules() +{ + if (header){ + delete header; header = NULL; + } + if (Bottombox){ + delete Bottombox; Bottombox = NULL; + // bottom box items are destroyed but explicit reset of bottom box items here required + lpic = rpic = NULL; + lText = rText = NULL; + } + if (pb){ + delete pb; pb = NULL; + } +} + // -- EPG Data Viewer Menu Handler Class // -- to be used for calls from Menue // -- (2004-03-06 rasc) diff --git a/src/gui/epgview.h b/src/gui/epgview.h index e2dd8a573..5db5cfa12 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -50,7 +50,11 @@ class CEpgData CChannelEventList evtlist; CChannelEventList followlist; CEPGData epgData; - CComponentsHeader* header; + CComponentsHeader *header; + CComponentsFrmChain *Bottombox; + CComponentsPictureScalable *lpic, *rpic; + CComponentsText *lText, *rText; + CProgressBar *pb; std::string epg_date; std::string epg_start; std::string epg_end; @@ -100,6 +104,7 @@ class CEpgData int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); int show_mp(MI_MOVIE_INFO *mi, int mp_position = 0, int mp_duration = 0, bool doLoop = true); void hide(); + void ResetModules(); }; From 981af1f699f72b29a47e58650cdffd5c4e175abb Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 161/394] eventlist,epgview: reduce header flickering picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: df6862963a9b29a4d0955b01a22e1061c312b17f Signed-off-by: Thilo Graf review reqiured Conflicts: src/gui/epgview.cpp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e98564c8e977b9e7ceb3d8f1bc0e45933d17fc25 Author: TangoCash Date: 2017-05-03 (Wed, 03 May 2017) Origin message was: ------------------ -eventlist,epgview: reduce header flickering picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: df6862963a9b29a4d0955b01a22e1061c312b17f Signed-off-by: Thilo Graf review reqiured Conflicts: src/gui/epgview.cpp ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index c08d78183..4a429799b 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -857,14 +857,11 @@ void CEventList::paintDescription(int index) void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) { - if (header) { - header->kill(); - delete header; - header = NULL; + if (header == NULL){ + header = new CComponentsHeader(); + header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use } - header = new CComponentsHeader(); - header->setDimensionsAll(x, y, full_width, theight); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->setCorner(RADIUS_LARGE, CORNER_TOP); From ef15f83fb199c4a0afaa80ab68777506bcfccf36 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 162/394] CEventList: optimize handling of header and bottom box Mainly to reduce flicker effects on right/left scroll. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/43fda8bc11e58dd78ea0e4c10cd25455dfff5fe0 Author: Thilo Graf Date: 2017-05-03 (Wed, 03 May 2017) ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 61 +++++++++++++++++++++++++++++-------------- src/gui/eventlist.h | 2 ++ 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 4a429799b..ebb8d5e8f 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -121,14 +121,25 @@ CEventList::CEventList() bgRightBoxPaint = false; header = NULL; pb = NULL; + Bottombox = NULL; } CEventList::~CEventList() { - delete header; - header = NULL; - delete pb; - pb = NULL; + ResetModules(); +} + +void CEventList::ResetModules() +{ + if (header){ + delete header; header = NULL; + } + if (Bottombox){ + delete Bottombox; Bottombox = NULL; + } + if (pb){ + delete pb; pb = NULL; + } } void CEventList::UpdateTimerList(void) @@ -687,8 +698,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { - if (header) - header->getClockObject()->kill(); + ResetModules(); frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); } @@ -860,20 +870,19 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s if (header == NULL){ header = new CComponentsHeader(); header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use + header->enableClock(true, "%H:%M", "%H %M", true); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->setDimensionsAll(x, y, full_width, theight); } + //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - header->setDimensionsAll(x, y, full_width, theight); - header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setCorner(RADIUS_LARGE, CORNER_TOP); - - header->enableClock(true, "%H:%M", "%H.%M", true); - header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - - header->getChannelLogoObject()->hide(); + if (header->isPainted()) + header->getChannelLogoObject()->hide(); header->setChannelLogo(_channel_id,_channelname); header->setCaption(_channelname,CTextBox::CENTER); header->paint(CC_SAVE_SCREEN_NO); + paintBottomBox(_channelname_prev, _channelname_next); } @@ -885,26 +894,38 @@ void CEventList::paintBottomBox(std::string _channelname_prev, std::string _chan int mid_width = full_width * 40 / 100; // 40% int side_width = ((full_width - mid_width) / 2) - (2 * x_off); - CComponentsFrmChain *Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); - Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); - Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); - Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + if (!Bottombox){ + Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + }else{ + if (Bottombox->isPainted()) + Bottombox->hideCCItems(); + Bottombox->clear(); + } if (!_channelname_prev.empty()) { CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox); - CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); lpic->doPaintBg(false); + lpic->enableSaveBg(); + + CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); lText->doPaintBg(false); + lText->enableSaveBg(); } if (!_channelname_next.empty()) { CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID; + rpic->doPaintBg(false); rpic->setXPos(x_pos); + rpic->enableSaveBg(); + CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); - rpic->doPaintBg(false); rText->doPaintBg(false); + rText->enableSaveBg(); } Bottombox->paint(false); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 10d255f73..8b81aefb5 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -105,6 +105,7 @@ class CEventList : public CListHelpers CComponentsText *cc_infozone; CComponentsHeader *header; CProgressBar *pb; + CComponentsFrmChain *Bottombox; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); @@ -127,6 +128,7 @@ class CEventList : public CListHelpers CEventList(); ~CEventList(); int exec(const t_channel_id channel_id, const std::string& channelname, const std::string& prev = "", const std::string& next = "", const CChannelEventList &followlist = CChannelEventList ()); // UTF-8 + void ResetModules(); }; class CEventListHandler : public CMenuTarget From ff1c39231f93ff2d87991d769a35aa8f0707f658 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 163/394] Revert "-cc_form_header: add max caption width" This reverts commit 90226e9a46acb318041062c10a3813e27e099713. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cb02d6253d699d3105286aa2c4462aa43c24b958 Author: Thilo Graf Date: 2017-05-03 (Wed, 03 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 3 --- src/gui/components/cc_frm_header.h | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index c633c74b9..fff49031a 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -144,8 +144,6 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; - cch_text_max_w = width; - addContextButton(buttons); initCCItems(); initParent(parent); @@ -564,7 +562,6 @@ void CComponentsHeader::initCaption() cch_cl_obj->allowPaint(cch_cl_enable); } - cc_text_w = min(cc_text_w,cch_text_max_w); //create cch_text_obj and add to collection if (cch_text_obj == NULL){ diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 16fa2ddd1..9550d1134 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -106,8 +106,6 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int cch_icon_w; ///property: internal width for clock object int cch_clock_w; - ///property: internal max width for text object - int cch_text_max_w; ///property: internal x-position for caption object int cch_text_x; ///property: internal offset of context button icons within context button object @@ -193,8 +191,6 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual Font* getCaptionFont(){return cch_font;} ///set text color for caption virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;} - ///set max width for caption - virtual void setCaptionMaxWidth(int max_width){cch_text_max_w = max_width;} enum { From ddf003fab00820d51da7fb7d31c60403ae31c644 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 164/394] CComponentsHeader: optimize logo size/position handling Prevent oversized paint with stupid screen and/or font size settings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/18fb99688c62d7c35a527fa14d98ae9f2330ae06 Author: Thilo Graf Date: 2017-05-03 (Wed, 03 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index fff49031a..f6e20c5a0 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -277,10 +277,13 @@ void CComponentsHeader::initLogo() int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) - cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this); + cch_logo_obj = new CComponentsChannelLogoScalable(1, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this); else cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); + // use value 1 as initial value for logo width, ensures downscale with stupid available logo space + cch_logo_obj->setHeight(1, true); + //ensure logo is not larger than original size if in auto mode if (cch_logo.dy_max == -1){ int dx_orig = 0, dy_orig = 0 ; @@ -289,6 +292,7 @@ void CComponentsHeader::initLogo() h_logo = dy_orig; } + //cch_logo_obj->setWidth(1, true); if (cch_logo_obj->hasLogo()){ cch_logo_obj->setHeight(h_logo, true); @@ -533,7 +537,7 @@ void CComponentsHeader::initCaption() cch_btn_obj->setXPos(width - buttons_w); //set required width of caption object - cc_text_w -= (buttons_w + cch_offset); + cc_text_w -= buttons_w; } //clock @@ -548,7 +552,7 @@ void CComponentsHeader::initCaption() cch_cl_obj->setXPos(width - buttons_w - clock_w); //set required width of caption object - cc_text_w -= (clock_w + cch_offset); + cc_text_w -= clock_w; //stop clock if disabled or option run is disabled and clock is running if (cch_cl_enable){ From 694dd0d5e1e1b2da04cce0e045521c435cbd9b68 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 May 2017 21:29:41 +0200 Subject: [PATCH 165/394] CChannelList: rework details line handling, fix hide() after setup Detailsline is handling hide() by itself. After channellist setup, eg. switching additional infos and channellist window has different size, artefacts were possible. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/81001410f3264115d24c19be61f05838d6d0aba6 Author: Thilo Graf Date: 2017-05-03 (Wed, 03 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e03acf7e8..32d70dbd8 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -439,8 +439,9 @@ int CChannelList::doChannelMenu(void) previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; osd_setup.showContextChanlistMenu(this); - //FIXME check font/options changed ? hide(); + ResetModules(); + //FIXME check font/options changed ? calcSize(); ret = -1; } @@ -955,7 +956,11 @@ void CChannelList::hide() header->kill(); frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + OFFSET_INTER + info_height); - clearItem2DetailsLine(); + + //remove details line + if (dline) + dline->kill(); + CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -1637,12 +1642,6 @@ void CChannelList::clearItem2DetailsLine() void CChannelList::paintItem2DetailsLine (int pos) { - if (dline){ - dline->kill(); //kill details line - delete dline; - dline = NULL; - } - if (!g_settings.channellist_show_infobox) return; @@ -1652,9 +1651,15 @@ void CChannelList::paintItem2DetailsLine (int pos) // paint Line if detail info (and not valid list pos) if (pos >= 0) { - if (dline == NULL) + if (!dline){ dline = new CComponentsDetailsLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); - dline->paint(false); + }else{ + dline->setPos(xpos, ypos1); + dline->setYPosDown(ypos2); + dline->setHMarkTop(fheight/2); + dline->setHMarkDown(info_height-RADIUS_LARGE*2); + } + dline->paint(); } } From 1fd65448eb24e5f478556070472a9f5b2b274ce7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 16:30:37 +0200 Subject: [PATCH 166/394] CMovieBrowser: prevent possible segfault Clock is disabled, will crash here. comes with: e36f7ccecd0d78d6350e2f99b82d7e7a90a626ee Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/329fad5545766d94138b16334a74a9872366f650 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index df586ca19..9fdc4f188 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2095,7 +2095,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_header->getClockObject()->kill(); + m_header->kill(); framebuffer->paintBackground(); //clear whole screen g_EpgData->show_mp(m_movieSelectionHandler); refresh(); From 328ba0b4eba3b4ba38fb795d8e4564fd06e49784 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 16:52:30 +0200 Subject: [PATCH 167/394] CEpgData: fix header size Header height was bound to font size in previous versions, but new header is using other font as default, so we have wrong height, therefore header items could paint outside of header. This should fix this. In future we should unify header size with other windows. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/23912ba583582224750a3a4c148cfe5a0b97b372 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 4 +++- src/gui/epgview.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index cde35d13c..4defc0a8a 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -132,6 +132,7 @@ CEpgData::CEpgData() lText = NULL; rText = NULL; pb = NULL; + font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; } CEpgData::~CEpgData() @@ -144,7 +145,7 @@ void CEpgData::start() ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); - topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); + topheight = font_title->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; @@ -848,6 +849,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // header + logo if (!header){ header = new CComponentsHeader(sx, sy, ox, toph); + header->setCaptionFont(font_title); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 5db5cfa12..44de63c05 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -55,6 +55,7 @@ class CEpgData CComponentsPictureScalable *lpic, *rpic; CComponentsText *lText, *rText; CProgressBar *pb; + Font *font_title; std::string epg_date; std::string epg_start; std::string epg_end; From fee507c8139c0a9d9e98e9532e01405425bc7501 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 19:45:11 +0200 Subject: [PATCH 168/394] CEpgData: supplement to 'fix header size' commit: 7583714e6703a7ae9591e112726759c4070d0c68 Permanent font init is required to avoid possible crash after changed font settings by user. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17958da28fc32fc857066000456e0c6af90099e7 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4defc0a8a..980b6acec 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -132,7 +132,7 @@ CEpgData::CEpgData() lText = NULL; rText = NULL; pb = NULL; - font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; + font_title = NULL; } CEpgData::~CEpgData() @@ -145,6 +145,7 @@ void CEpgData::start() ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); + font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; topheight = font_title->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; @@ -849,13 +850,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // header + logo if (!header){ header = new CComponentsHeader(sx, sy, ox, toph); - header->setCaptionFont(font_title); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); }else header->setDimensionsAll(sx, sy, ox, toph); + header->setCaptionFont(font_title); header->setCaption(epgData.title); if (header->isPainted()) From 0d719b9761d59966a3cf37c8eac442d21b76e975 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 May 2017 20:57:12 +0200 Subject: [PATCH 169/394] CNaviBar: add new widget class: CNaviBar Should help to reduce and unify code in some epg windows. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf7dd61fd7332da0f087eca4d8802597e9abbd6a Author: Thilo Graf Date: 2017-05-05 (Fri, 05 May 2017) ------------------ This commit was generated by Migit --- src/gui/widget/Makefile.am | 1 + src/gui/widget/navibar.cpp | 116 +++++++++++++++++++++++++ src/gui/widget/navibar.h | 169 +++++++++++++++++++++++++++++++++++++ 3 files changed, 286 insertions(+) create mode 100644 src/gui/widget/navibar.cpp create mode 100644 src/gui/widget/navibar.h diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 5da8d7ebe..838ba162f 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -27,6 +27,7 @@ libneutrino_gui_widget_a_SOURCES = \ menue.cpp \ mountchooser.cpp \ msgbox.cpp \ + navibar.cpp \ shellwindow.cpp \ stringinput.cpp \ stringinput_ext.cpp \ diff --git a/src/gui/widget/navibar.cpp b/src/gui/widget/navibar.cpp new file mode 100644 index 000000000..74e1db74e --- /dev/null +++ b/src/gui/widget/navibar.cpp @@ -0,0 +1,116 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Class for epg window navigation bar. + Copyright (C) 2017, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "navibar.h" + + +using namespace std; + + +CNaviBar::CNaviBar( const int& x, + const int& y, + const int& dx, + const int& dy, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t& color_frame, + fb_pixel_t& color_body, + fb_pixel_t& color_shadow) + : CComponentsFrmChain( x, y, dx, dy, + NULL, + CC_DIR_X, + parent, + shadow_mode, + color_frame, + color_body, + color_shadow) +{ + setCornerType(CORNER_NONE); + enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + set2ndColor(COL_MENUCONTENT_PLUS_0); + + nb_lpic = nb_rpic = NULL; + nb_lText = nb_rText = NULL; + nb_font = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE];; + nb_lpic_enable = nb_rpic_enable = false; + nb_l_text = nb_r_text = string(); + + initCCItems(); +} + +void CNaviBar::initCCItems() +{ + int x_off = OFFSET_INNER_MID; + int mid_width = width * 40 / 100; // 40% + int side_width = ((width - mid_width) / 2) - (2 * x_off); + int h_text = height; + + // init left arrow + if (!nb_lpic){ + nb_lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); + nb_lpic->doPaintBg(false); + this->addCCItem(nb_lpic); + nb_lpic->enableSaveBg(); + } + nb_lpic->allowPaint(nb_lpic_enable); + + // init right arrow + if (!nb_rpic){ + nb_rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT); + + nb_rpic->doPaintBg(false); + this->addCCItem(nb_rpic); + nb_rpic->enableSaveBg(); + int x_pos = width - nb_rpic->getWidth() - x_off; + nb_rpic->setXPos(x_pos); + } + nb_rpic->allowPaint(nb_rpic_enable); + + // init text left + if (!nb_lText){ + nb_lText = new CComponentsText(x_off + nb_lpic->getWidth() + x_off, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + nb_lText->doPaintBg(false); + nb_lText->enableSaveBg(); + } + nb_lText->setText(nb_l_text, CTextBox::NO_AUTO_LINEBREAK, nb_font, COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR); + + // init text right + if (!nb_rText){ + nb_rText = new CComponentsText(0, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + nb_rText->doPaintBg(false); + nb_rText->enableSaveBg(); + } + nb_rText->setText(nb_r_text, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, nb_font); + nb_rText->setXPos(nb_rpic->getXPos() - x_off - nb_rText->getWidth()); +} + + +void CNaviBar::paint(bool do_save_bg) +{ + hideCCItems(); + CComponentsFrmChain::paint(do_save_bg); +} diff --git a/src/gui/widget/navibar.h b/src/gui/widget/navibar.h new file mode 100644 index 000000000..1bc71b6fe --- /dev/null +++ b/src/gui/widget/navibar.h @@ -0,0 +1,169 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Class for epg window navigation bar. + Copyright (C) 2017, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifndef __C_NAVIBAR__ +#define __C_NAVIBAR__ + +#include +#include + + +/** + CNaviBar is sub class of CComponentsFrmChain. + Shows a navigation bar with text and navigation icons. + You can enable/disable predefined icons and texts + on the left and/or right side of bar. +*/ +class CNaviBar : public CComponentsFrmChain +{ + private: + CComponentsPictureScalable *nb_lpic, *nb_rpic; + CComponentsText *nb_lText, *nb_rText; + + Font *nb_font; + + bool nb_lpic_enable; + bool nb_rpic_enable; + + std::string nb_l_text; + std::string nb_r_text; + + void initCCItems(); + + public: + /**CNaviBar Constructor + * @param[in] x + * @li expects type int, x position + * @param[in] y + * @li expects type int, y position + * @param[in] dx + * @li expects type int, width + * @param[in] dy + * @li expects type int, height + * @param[in] parent + * @li optional: expects type CComponentsForm or derivates, allows usage as item inside CComponentsForm container, default = NULL + * @param[in] shadow_mode + * @li optional: expects type fb_pixel_t, defines shadow mode, default CC_SHADOW_OFF + * @param[in] color_frame + * @li optional: expects type fb_pixel_t, defines frame color, default value = COL_FRAME_PLUS_0 + * @param[in] color_body + * @li optional: expects type fb_pixel_t, defines body color, default value = COL_MENUFOOT_PLUS_0 + * @param[in] color_shadow + * @li optional: expects type fb_pixel_t, defines shadow color, default value = COL_SHADOW_PLUS_0 + * + * @see class CComponentsFrmChain() + */ + CNaviBar( const int& x, + const int& y, + const int& dx, + const int& dy, + CComponentsForm* parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t& color_frame = COL_FRAME_PLUS_0, + fb_pixel_t& color_body = COL_MENUFOOT_PLUS_0, + fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); + + //~CNaviBar(); //is inherited + + /** + * Enable or disable left icon + * @param[in] enable + * @li exepts 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 + */ + void enableRightArrow(bool enable = true){nb_rpic_enable = enable; initCCItems();} + + /** + * disable left icon + * no parameter + */ + void disableLeftArrow(){enableLeftArrow(false);} + + /** + * disable right icon + * no parameter + */ + void disableRightArrow(){enableRightArrow(false);} + + /** + * Enable or disable both icons at once. + * @param[in] enable_left + * @li exepts type bool, default = true + * @param[in] enable_right + * @li exepts type bool, default = true + */ + void enableArrows(bool enable_left = true, bool enable_right = true){enableLeftArrow(enable_left); enableRightArrow(enable_right);} + + /** + * Disable all icons. + * no parameter + */ + void disableArrows(){disableLeftArrow(); disableRightArrow();} + + /** + * Sets font type for texts. + * @param[in] font + * @li exepts type Font* + */ + void setFont(Font *font) {nb_font = font; initCCItems();} + + /** + * Sets left text. + * @param[in] text + * @li exepts 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 + */ + 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 + * @param[in] right + * @li exepts 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. + */ + void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); +}; + +#endif + From c44c067b3ade99a3dd49183b23e0730a4df7adbc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 May 2017 23:58:12 +0200 Subject: [PATCH 170/394] CEpgData/CEventList: use class CNaviBar for bottom box Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8f3fcc6060ccdd73ce142a0b25720c3971b1cbcf Author: Thilo Graf Date: 2017-05-05 (Fri, 05 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 56 ++++--------------------------------------- src/gui/epgview.h | 4 ++-- src/gui/eventlist.cpp | 38 ++++------------------------- src/gui/eventlist.h | 6 ++--- 4 files changed, 13 insertions(+), 91 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 980b6acec..ace7a977d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -873,66 +873,18 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start showText(showPos, sy + toph); // small bottom box with left/right navigation - if (!Bottombox){ - Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); - Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); - Bottombox->setCornerType(CORNER_NONE); - Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); - Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); - } + if (!Bottombox) + Bottombox = new CNaviBar(sx, sy+oy-botboxheight, ox, botboxheight); if (!mp_info){ std::string fromto = epg_start + " - " + epg_end; - int x_off = OFFSET_INNER_MID; - int mid_width = ox * 40 / 100; // 40% - int side_width = ((ox - mid_width) / 2) - (2 * x_off); GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); - // init left arrow - if (!lpic){ - lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); - lpic->doPaintBg(false); - Bottombox->addCCItem(lpic); - lpic->enableSaveBg(); - } - lpic->allowPaint(prev_id && !call_fromfollowlist); - - // init right arrow - if (!rpic){ - rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT); - - rpic->doPaintBg(false); - Bottombox->addCCItem(rpic); - rpic->enableSaveBg(); - int x_pos = ox - rpic->getWidth() - x_off; - rpic->setXPos(x_pos); - } - rpic->allowPaint(next_id && !call_fromfollowlist); - - // init text left "from to" - if (!lText){ - lText = new CComponentsText(x_off + lpic->getWidth() + x_off, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, NULL, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - lText->doPaintBg(false); - Bottombox->addCCItem(lText); - lText->enableSaveBg(); - } - lText->setText(fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR); - - // init text right "follow" - if (!rText){ - rText = new CComponentsText(0, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - rText->doPaintBg(false); - rText->enableSaveBg(); - } - rText->setText(epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]); - rText->setXPos(rpic->getXPos() - x_off - rText->getWidth()); + Bottombox->enableArrows(prev_id && !call_fromfollowlist, next_id && !call_fromfollowlist); + Bottombox->setText(fromto, epg_date); } - //ensure clean background - if(Bottombox->isPainted()) - Bottombox->hideCCItems(); - //paint bottombox contents Bottombox->paint(false); showProgressBar(); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 44de63c05..d873b82de 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -38,7 +38,7 @@ #include #include "widget/menue.h" - +#include "widget/navibar.h" #include #include @@ -51,7 +51,7 @@ class CEpgData CChannelEventList followlist; CEPGData epgData; CComponentsHeader *header; - CComponentsFrmChain *Bottombox; + CNaviBar *Bottombox; CComponentsPictureScalable *lpic, *rpic; CComponentsText *lText, *rText; CProgressBar *pb; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index ebb8d5e8f..3d7c56e01 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -889,44 +889,14 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) { int by = y + height - iheight - botboxheight; - int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; - int x_off = OFFSET_INNER_MID; - int mid_width = full_width * 40 / 100; // 40% - int side_width = ((full_width - mid_width) / 2) - (2 * x_off); if (!Bottombox){ - Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); - Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); - Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); - Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); - }else{ - if (Bottombox->isPainted()) - Bottombox->hideCCItems(); - Bottombox->clear(); + Bottombox = new CNaviBar(x, by, full_width, botboxheight); + Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); } - if (!_channelname_prev.empty()) { - CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox); - lpic->doPaintBg(false); - lpic->enableSaveBg(); - - CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - lText->doPaintBg(false); - lText->enableSaveBg(); - } - - if (!_channelname_next.empty()) { - CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); - int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID; - rpic->doPaintBg(false); - rpic->setXPos(x_pos); - rpic->enableSaveBg(); - - CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); - rText->doPaintBg(false); - rText->enableSaveBg(); - } + Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); + Bottombox->setText(_channelname_prev, _channelname_next); Bottombox->paint(false); } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 8b81aefb5..69cf7442c 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -32,7 +32,7 @@ #include #include #include - +#include #include "infoviewer.h" #include "widget/menue.h" @@ -104,8 +104,8 @@ class CEventList : public CListHelpers event_id_t item_event_ID; CComponentsText *cc_infozone; CComponentsHeader *header; - CProgressBar *pb; - CComponentsFrmChain *Bottombox; + CProgressBar *pb; + CNaviBar *Bottombox; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); From 378cf47ccd5332eb0cc143d84d0a3a11186ef909 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 6 May 2017 22:25:40 +0200 Subject: [PATCH 171/394] CEpgData: remove unused vars Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bbb04bfb20ede8fb1476d1f51304d4a27fb88c3d Author: Thilo Graf Date: 2017-05-06 (Sat, 06 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 7 ------- src/gui/epgview.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ace7a977d..393bbb1ad 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -127,10 +127,6 @@ CEpgData::CEpgData() mp_movie_info = NULL; header = NULL; Bottombox = NULL; - lpic = NULL; - rpic = NULL; - lText = NULL; - rText = NULL; pb = NULL; font_title = NULL; } @@ -1515,9 +1511,6 @@ void CEpgData::ResetModules() } if (Bottombox){ delete Bottombox; Bottombox = NULL; - // bottom box items are destroyed but explicit reset of bottom box items here required - lpic = rpic = NULL; - lText = rText = NULL; } if (pb){ delete pb; pb = NULL; diff --git a/src/gui/epgview.h b/src/gui/epgview.h index d873b82de..617fff66f 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -52,8 +52,6 @@ class CEpgData CEPGData epgData; CComponentsHeader *header; CNaviBar *Bottombox; - CComponentsPictureScalable *lpic, *rpic; - CComponentsText *lText, *rText; CProgressBar *pb; Font *font_title; std::string epg_date; From 3398b6fb17407adbe496ad5e8c39db48daaa30e1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 6 May 2017 22:32:16 +0200 Subject: [PATCH 172/394] CChannelList: add missing compare for existant header object. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86c18141dd9cdd33388898a96f4d454d6ae819ac Author: Thilo Graf Date: 2017-05-06 (Sat, 06 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 32d70dbd8..db257a86c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2158,13 +2158,17 @@ void CChannelList::paintHead() CComponentsHeader* CChannelList::getHeaderObject() { - return header; + if (header) + return header; + return NULL; } void CChannelList::ResetModules() { - delete header; - header = NULL; + if (header){ + delete header; + header = NULL; + } if(dline){ delete dline; dline = NULL; From 0b75f57eb3bd509e23cde3dff40023c9c10951ad Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 6 May 2017 23:18:05 +0200 Subject: [PATCH 173/394] CChannelList: remove init of cc_minitv from constructor. Is not a member of CChannelList and already inititialized as static outside of constructor. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7f839dcc96d994532cceef91a9318e3d864e842 Author: Thilo Graf Date: 2017-05-06 (Sat, 06 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index db257a86c..8b796cd91 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -122,7 +122,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl previous_channellist_additional = -1; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; dline = NULL; - cc_minitv = NULL; + minitv_is_active = false; headerNew = true; bouquet = NULL; From 5a54326fe2bab5a6cf316475b6a3ba9127c68a1d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 14:18:47 +0200 Subject: [PATCH 174/394] CChannelList: add connection to ResetModuls() Ensures re init after font changes. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1359248f7218d72ede17d4971d10b896d2d182d1 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 8b796cd91..5ab87058e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -133,6 +133,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl paint_events_index = -2; CFrameBuffer::getInstance()->OnAfterSetPallette.connect(sigc::mem_fun(this, &CChannelList::ResetModules)); + CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CChannelList::ResetModules)); } CChannelList::~CChannelList() From e9e16b1d8da953a0a6f1bc35f50da47d0d0c5de3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 14:18:47 +0200 Subject: [PATCH 175/394] CChannelList: delete and reset minitv object inside unified scope Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf7a21032c3a43c4c89fac537ca14fec3fdfe5ac Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 5ab87058e..841d52990 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -949,9 +949,9 @@ void CChannelList::hide() paint_events(-2); // cancel paint_events thread if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV { - if (cc_minitv) - delete cc_minitv; - cc_minitv = NULL; + if (cc_minitv){ + delete cc_minitv; cc_minitv = NULL; + } } if(header) header->kill(); From cb07bd9bbc2364313e399c2ed5a01fdaf13f4f68 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 18:09:45 +0200 Subject: [PATCH 176/394] CChannelList: ensure disconnect signal/slot on delete of channellist ojects Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/66c109f8f987c14e0ad1547a54d5b7c9aa7cded3 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.h b/src/gui/channellist.h index edde1bbda..40d2c74d1 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -67,7 +67,7 @@ enum { class CFrameBuffer; class CBouquet; -class CChannelList : public CListHelpers +class CChannelList : public CListHelpers, public sigc::trackable { private: enum state_ From 304185631c1271ff03835008819aa0aa3da2c57e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:17:01 +0200 Subject: [PATCH 177/394] SNeutrinoSettings: add missing enums for channellist additional modes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5778d9295ab3491a4049fe536d33829c7531e913 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/system/settings.h b/src/system/settings.h index fa2ec6e94..08b9dc3d1 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -588,6 +588,13 @@ struct SNeutrinoSettings int window_height; int eventlist_additional; int eventlist_epgplus; + + enum CHANNELLIST_ADDITIONAL_MODES + { + CHANNELLIST_ADDITIONAL_MODE_OFF = 0, + CHANNELLIST_ADDITIONAL_MODE_EPG = 1, + CHANNELLIST_ADDITIONAL_MODE_MINITV = 2 + }; int channellist_additional; int channellist_epgtext_align_right; int channellist_foot; From 7693bab58b740575ef722ba8dcd4cf3aaea1cf5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:17:53 +0200 Subject: [PATCH 178/394] CChannelList: use enums for additional modes Readability Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/761bac8ca11f79066745025185d0c2f212406799 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 841d52990..20ffa551c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -119,7 +119,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(); - previous_channellist_additional = -1; + previous_channellist_additional = g_settings.channellist_additional; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; dline = NULL; @@ -484,7 +484,7 @@ void CChannelList::calcSize() fheight = 1; /* avoid div-by-zero crash on invalid font */ footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; - minitv_is_active = ( (g_settings.channellist_additional == 2) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); + minitv_is_active = ( (g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width full_width = minitv_is_active ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); @@ -947,7 +947,7 @@ int CChannelList::show() void CChannelList::hide() { paint_events(-2); // cancel paint_events thread - if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV + if ((g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) || (previous_channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV)) // with miniTV { if (cc_minitv){ delete cc_minitv; cc_minitv = NULL; From 1fd330008dd2640e0f48f5d29e12b81d9788f40c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:37:16 +0200 Subject: [PATCH 179/394] CChannelList: change scope of bool unlocked Scope of the variable 'unlocked' can be reduced. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8f6888d8f9eb968009f92a0124cc44487a1e3b3 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 20ffa551c..4a3735f5b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -298,7 +298,7 @@ int CChannelList::doChannelMenu(void) int shortcut = 0; static int old_selected = 0; char cnt[5]; - bool unlocked = true; + int ret = 0; if(g_settings.minimode) @@ -360,7 +360,8 @@ int CChannelList::doChannelMenu(void) CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; bool fav_found = true; switch(select) { - case 0: // edit mode + case 0: {// edit mode + bool unlocked = true; if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { int pl_z = g_settings.parentallock_zaptime * 60; if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { @@ -385,7 +386,7 @@ int CChannelList::doChannelMenu(void) editMode(true); ret = -1; break; - case 1: // add to + }case 1: // add to if (!addChannelToBouquet()) return -1; ret = 1; From 1148afc62bb589f42d7bc2e98547876a1dc119a9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 8 May 2017 07:53:58 +0200 Subject: [PATCH 180/394] movieplayer.cpp: remove possible compile issue "__STDC_LIMIT_MACROS" redefined Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/65b09044c5a207485ec8e1b832b32a491586157d Author: Thilo Graf Date: 2017-05-08 (Mon, 08 May 2017) ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 46e222231..b62e3d603 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -27,7 +27,7 @@ #include #endif -#define __STDC_LIMIT_MACROS + #include #include #include From 46bd5911eec3c14dae8a64d0f45f1dda571149bd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 8 May 2017 08:11:30 +0200 Subject: [PATCH 181/394] CNaviBar: prevent compiler warning -Wshadow Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/970390a32069a9f4e7bc5268854f92000086277d Author: Thilo Graf Date: 2017-05-08 (Mon, 08 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/navibar.cpp | 6 +++--- src/gui/widget/navibar.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/widget/navibar.cpp b/src/gui/widget/navibar.cpp index 74e1db74e..6afb1d46e 100644 --- a/src/gui/widget/navibar.cpp +++ b/src/gui/widget/navibar.cpp @@ -31,8 +31,8 @@ using namespace std; -CNaviBar::CNaviBar( const int& x, - const int& y, +CNaviBar::CNaviBar( const int& x_pos, + const int& y_pos, const int& dx, const int& dy, CComponentsForm* parent, @@ -40,7 +40,7 @@ CNaviBar::CNaviBar( const int& x, fb_pixel_t& color_frame, fb_pixel_t& color_body, fb_pixel_t& color_shadow) - : CComponentsFrmChain( x, y, dx, dy, + : CComponentsFrmChain( x_pos, y_pos, dx, dy, NULL, CC_DIR_X, parent, diff --git a/src/gui/widget/navibar.h b/src/gui/widget/navibar.h index 1bc71b6fe..cb3cbe08f 100644 --- a/src/gui/widget/navibar.h +++ b/src/gui/widget/navibar.h @@ -53,9 +53,9 @@ class CNaviBar : public CComponentsFrmChain public: /**CNaviBar Constructor - * @param[in] x + * @param[in] x_pos * @li expects type int, x position - * @param[in] y + * @param[in] y_ypos * @li expects type int, y position * @param[in] dx * @li expects type int, width @@ -74,8 +74,8 @@ class CNaviBar : public CComponentsFrmChain * * @see class CComponentsFrmChain() */ - CNaviBar( const int& x, - const int& y, + CNaviBar( const int& x_pos, + const int& y_pos, const int& dx, const int& dy, CComponentsForm* parent = NULL, From 0a2db29f3ca3092124efe5e0e47b8801e63b48c6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 8 May 2017 08:19:55 +0200 Subject: [PATCH 182/394] CChannelList: fix code indentation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9fd3b27d61d6e1b087ba614030ad3803f50474ec Author: Thilo Graf Date: 2017-05-08 (Mon, 08 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 176 ++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 86 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 4a3735f5b..16f03c41b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -360,96 +360,100 @@ int CChannelList::doChannelMenu(void) CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; bool fav_found = true; switch(select) { - case 0: {// edit mode - bool unlocked = true; - if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { - int pl_z = g_settings.parentallock_zaptime * 60; - if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { - unlocked = false; - } else if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked) { - /* on locked bouquet, enough to check any channel */ - unlocked = ((*chanlist)[selected]->last_unlocked_time + pl_z > time_monotonic()); + case 0: // edit mode + { + bool unlocked = true; + if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { + int pl_z = g_settings.parentallock_zaptime * 60; + + if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { + unlocked = false; + } else if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked) { + /* on locked bouquet, enough to check any channel */ + unlocked = ((*chanlist)[selected]->last_unlocked_time + pl_z > time_monotonic()); + } else { + /* check all locked channels for last_unlocked_time, overwrite only if already unlocked */ + for (unsigned int j = 0 ; j < (*chanlist).size(); j++) { + if ((*chanlist)[j]->bLocked) + unlocked = unlocked && ((*chanlist)[j]->last_unlocked_time + pl_z > time_monotonic()); + } + } + if (!unlocked) { + CZapProtection *zp = new CZapProtection(g_settings.parentallock_pincode, 0x100); + unlocked = zp->check(); + delete zp; + } + } + if (unlocked) + editMode(true); + + ret = -1; + break; + } + case 1: // add to + if (!addChannelToBouquet()) + return -1; + ret = 1; + break; + case 2: // add to my favorites + for (unsigned n = 0; n < AllFavBouquetList->Bouquets.size(); n++) { + if (AllFavBouquetList->Bouquets[n]->zapitBouquet && AllFavBouquetList->Bouquets[n]->zapitBouquet->bFav) { + CZapitChannel *ch = AllFavBouquetList->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id); + if (ch == NULL) { + AllFavBouquetList->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]); + fav_found = false; + } + break; + } + } + for (unsigned n = 0; n < blist->Bouquets.size() && !fav_found; n++) { + if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) { + blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode); + saveChanges(); + fav_found = true; + break; + } + } + if (!fav_found) { + CNeutrinoApp::getInstance()->MarkFavoritesChanged(); + CNeutrinoApp::getInstance()->MarkChannelsInit(); + } + ret = 1; + break; + case 3: // reset new + case 4: // reset all new + if (select == 3) { + (*chanlist)[selected]->flags = CZapitChannel::UPDATED; } else { - /* check all locked channels for last_unlocked_time, overwrite only if already unlocked */ - for (unsigned int j = 0 ; j < (*chanlist).size(); j++) { - if ((*chanlist)[j]->bLocked) - unlocked = unlocked && ((*chanlist)[j]->last_unlocked_time + pl_z > time_monotonic()); - } + for (unsigned int j = 0 ; j < (*chanlist).size(); j++) + (*chanlist)[j]->flags = CZapitChannel::UPDATED; } - if (!unlocked) { - CZapProtection *zp = new CZapProtection(g_settings.parentallock_pincode, 0x100); - unlocked = zp->check(); - delete zp; + CNeutrinoApp::getInstance()->MarkChannelsChanged(); + /* if make_new_list == ON, signal to re-init services */ + if(g_settings.make_new_list) + CNeutrinoApp::getInstance()->MarkChannelsInit(); + break; + case 5: // clear channel history + { + CNeutrinoApp::getInstance()->channelList->getLastChannels().clear(); + printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__); + ret = -2; // exit channellist } - } - if (unlocked) - editMode(true); - ret = -1; - break; - }case 1: // add to - if (!addChannelToBouquet()) - return -1; - ret = 1; - break; - case 2: // add to my favorites - for (unsigned n = 0; n < AllFavBouquetList->Bouquets.size(); n++) { - if (AllFavBouquetList->Bouquets[n]->zapitBouquet && AllFavBouquetList->Bouquets[n]->zapitBouquet->bFav) { - CZapitChannel *ch = AllFavBouquetList->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id); - if (ch == NULL) { - AllFavBouquetList->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]); - fav_found = false; - } - break; + break; + case 6: // settings + { + previous_channellist_additional = g_settings.channellist_additional; + COsdSetup osd_setup; + osd_setup.showContextChanlistMenu(this); + hide(); + ResetModules(); + //FIXME check font/options changed ? + calcSize(); + ret = -1; } - } - for (unsigned n = 0; n < blist->Bouquets.size() && !fav_found; n++) { - if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) { - blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode); - saveChanges(); - fav_found = true; - break; - } - } - if (!fav_found) { - CNeutrinoApp::getInstance()->MarkFavoritesChanged(); - CNeutrinoApp::getInstance()->MarkChannelsInit(); - } - ret = 1; - break; - case 3: // reset new - case 4: // reset all new - if (select == 3) { - (*chanlist)[selected]->flags = CZapitChannel::UPDATED; - } else { - for (unsigned int j = 0 ; j < (*chanlist).size(); j++) - (*chanlist)[j]->flags = CZapitChannel::UPDATED; - } - CNeutrinoApp::getInstance()->MarkChannelsChanged(); - /* if make_new_list == ON, signal to re-init services */ - if(g_settings.make_new_list) - CNeutrinoApp::getInstance()->MarkChannelsInit(); - break; - case 5: // clear channel history - { - CNeutrinoApp::getInstance()->channelList->getLastChannels().clear(); - printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__); - ret = -2; // exit channellist - } - break; - case 6: // settings - { - previous_channellist_additional = g_settings.channellist_additional; - COsdSetup osd_setup; - osd_setup.showContextChanlistMenu(this); - hide(); - ResetModules(); - //FIXME check font/options changed ? - calcSize(); - ret = -1; - } - break; - default: - break; + break; + default: + break; } } return ret; From 24b744c79d673f5ddc72c7ff3e472df42abf3eea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 May 2017 08:41:28 +0200 Subject: [PATCH 183/394] epgplus: fix progressbar's type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b9f8e9720ac37be59072bc033512ef5d0245766 Author: vanhofen Date: 2017-05-08 (Mon, 08 May 2017) Origin message was: ------------------ - epgplus: fix progressbar's type ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index e945d32ee..9fb8f0b57 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -243,6 +243,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int // paint new mark CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); + pbbar.setType(CProgressBar::PB_TIMESCALE); time_t currentTime; time(¤tTime); From 11b4748125fbed1d432f8a20cd74cb7aca28956d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 8 May 2017 12:14:36 +0200 Subject: [PATCH 184/394] movieplayer.cpp: prevent build error Avoid build error if build not configured with -D__STDC_LIMIT_MACROS Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f1779d0a971125f9100ffb34c832767e539205b0 Author: Thilo Graf Date: 2017-05-08 (Mon, 08 May 2017) ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b62e3d603..716c7262a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -27,6 +27,9 @@ #include #endif +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif #include #include From bdb2607b8e0345e50a4e0730174e27e071266ee3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 8 May 2017 17:39:30 +0200 Subject: [PATCH 185/394] src/gui/eventlist.cpp show prev next channel name on start Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5f9f82b8e6f232218f2a47bcdad7cf365a1e395f Author: Jacek Jendrzej Date: 2017-05-08 (Mon, 08 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 81 +++++++++++++++++++++++++------------------ src/gui/eventlist.h | 3 +- 2 files changed, 50 insertions(+), 34 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 3d7c56e01..b7102cd00 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -263,6 +263,38 @@ void CEventList::readEvents(const t_channel_id channel_id) return; } +void CEventList::getPrvNextChannelName(t_channel_id &channel_id,std::string &next_channel_name,std::string &prev_channel_name,std::string ¤t_channel_name, neutrino_msg_t msg){ + t_bouquet_id current_bouquet_id= bouquetList->getActiveBouquetNumber(); + t_channel_id channel_id_tmp = channel_id; + const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); + if(channel_nr < 2){ + channel_id = 0; + return; + } + unsigned int tmp_channel = 0; + for(unsigned int channel = 0; channel < channel_nr; channel++) + { + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + if(channel_id_tmp == channel_id){ + if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { + channel = (channel+1) %channel_nr; + }else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_rewind ){ //RC_rewind + channel = (channel == 0) ? channel_nr -1 : channel - 1; + } + channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + current_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id); + + tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + + tmp_channel = (channel+1) %channel_nr; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + break; + } + } +} int CEventList::exec(const t_channel_id channel_id, const std::string& channelname, const std::string& channelname_prev, const std::string& channelname_next,const CChannelEventList &followlist) // UTF-8 { @@ -346,7 +378,14 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna UpdateTimerList(); bool dont_hide = false; - paintHead(channel_id, channelname, channelname_prev, channelname_next); + if(channelname_prev.empty() && channelname_prev.empty()){ + std::string nextChannelName,prevChannelName,tmp; + t_channel_id tmp_channel_id = channel_id; + getPrvNextChannelName(tmp_channel_id, nextChannelName, prevChannelName, tmp,0); + paintHead(channel_id, channelname, prevChannelName, nextChannelName); + }else{ + paintHead(channel_id, channelname, channelname_prev, channelname_next); + } paint(channel_id); showFunctionBar(channel_id); @@ -558,39 +597,15 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_right || msg==CRCInput::RC_rewind || msg==CRCInput::RC_forward ) { // maybe remove RC_rewind and RC_forward in the future? - bgRightBoxPaint = false; - t_bouquet_id current_bouquet_id= bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp, _channel_id = channel_id; - const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); - std::string next_channel_name; - std::string prev_channel_name ; - std::string current_channel_name; - unsigned int tmp_channel = 0; - for(unsigned int channel = 0; channel < channel_nr; channel++) - { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - if(channel_id_tmp == channel_id){ - if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { - channel = (channel+1) %channel_nr; - }else { //RC_rewind - channel = (channel == 0) ? channel_nr -1 : channel - 1; - } - _channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - current_channel_name = CServiceManager::getInstance()->GetServiceName(_channel_id); - - tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - - tmp_channel = (channel+1) %channel_nr; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - break; - } + std::string next_channel_name, prev_channel_name, current_channel_name; + t_channel_id _channel_id = channel_id; + getPrvNextChannelName(_channel_id, next_channel_name, prev_channel_name, current_channel_name, msg); + if(_channel_id){ + bgRightBoxPaint = false; + loop = false; + dont_hide = true; + exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } - loop = false; - dont_hide = true; - exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } else if (msg == CRCInput::RC_0) { hide(); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 69cf7442c..05d9fbc87 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -116,7 +116,8 @@ class CEventList : public CListHelpers void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); - + void getPrvNextChannelName(t_channel_id &channel_id,std::string &next_channel_name,std::string &prev_channel_name,std::string ¤t_channel_name, neutrino_msg_t msg); + int timerPre; int timerPost; void UpdateTimerList(void); From cdd0bec2c71596a5663321b2cc71d7232955aef0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 8 May 2017 18:02:04 +0200 Subject: [PATCH 186/394] supplement to bdb2607b8e0345e50a4e0730174e27e071266ee3 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5dc4424d969c64fde9c61c38606514a5c31bfa11 Author: Jacek Jendrzej Date: 2017-05-08 (Mon, 08 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index b7102cd00..02e205425 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -378,7 +378,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna UpdateTimerList(); bool dont_hide = false; - if(channelname_prev.empty() && channelname_prev.empty()){ + if(channelname_prev.empty() && channelname_next.empty()){ std::string nextChannelName,prevChannelName,tmp; t_channel_id tmp_channel_id = channel_id; getPrvNextChannelName(tmp_channel_id, nextChannelName, prevChannelName, tmp,0); From f35bc8f43069da8dd9b81ccb1f80cd52687efbca Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 8 May 2017 19:43:36 +0200 Subject: [PATCH 187/394] supplement 2 to bdb2607b8e0345e50a4e0730174e27e071266ee3 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d051691f89c2d51fa66b41e218bd34224a067856 Author: Jacek Jendrzej Date: 2017-05-08 (Mon, 08 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 02e205425..9d2acb3b3 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -378,14 +378,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna UpdateTimerList(); bool dont_hide = false; - if(channelname_prev.empty() && channelname_next.empty()){ - std::string nextChannelName,prevChannelName,tmp; - t_channel_id tmp_channel_id = channel_id; - getPrvNextChannelName(tmp_channel_id, nextChannelName, prevChannelName, tmp,0); - paintHead(channel_id, channelname, prevChannelName, nextChannelName); - }else{ - paintHead(channel_id, channelname, channelname_prev, channelname_next); - } + paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); showFunctionBar(channel_id); @@ -898,6 +891,10 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->paint(CC_SAVE_SCREEN_NO); + if(_channelname_prev.empty() && _channelname_next.empty()){ + getPrvNextChannelName(_channel_id, _channelname_next, _channelname_prev, _channelname,0); + } + paintBottomBox(_channelname_prev, _channelname_next); } From 248fca8a7a6f9899884a008fa82dd46e826c7b2d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 May 2017 21:08:23 +0200 Subject: [PATCH 188/394] eventlist: minor cosmetics; rename getPrvNextChannelName() to getChannelNames() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/edb4ce3e4f4b93beb82d9e28e027951866a00323 Author: vanhofen Date: 2017-05-08 (Mon, 08 May 2017) Origin message was: ------------------ - eventlist: minor cosmetics; rename getPrvNextChannelName() to getChannelNames() ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 11 ++++++----- src/gui/eventlist.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 9d2acb3b3..d8203b2da 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -263,9 +263,10 @@ void CEventList::readEvents(const t_channel_id channel_id) return; } -void CEventList::getPrvNextChannelName(t_channel_id &channel_id,std::string &next_channel_name,std::string &prev_channel_name,std::string ¤t_channel_name, neutrino_msg_t msg){ - t_bouquet_id current_bouquet_id= bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp = channel_id; +void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) +{ + t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); + t_channel_id channel_id_tmp = channel_id; const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); if(channel_nr < 2){ channel_id = 0; @@ -592,7 +593,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna // maybe remove RC_rewind and RC_forward in the future? std::string next_channel_name, prev_channel_name, current_channel_name; t_channel_id _channel_id = channel_id; - getPrvNextChannelName(_channel_id, next_channel_name, prev_channel_name, current_channel_name, msg); + getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); if(_channel_id){ bgRightBoxPaint = false; loop = false; @@ -892,7 +893,7 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->paint(CC_SAVE_SCREEN_NO); if(_channelname_prev.empty() && _channelname_next.empty()){ - getPrvNextChannelName(_channel_id, _channelname_next, _channelname_prev, _channelname,0); + getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); } paintBottomBox(_channelname_prev, _channelname_next); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 05d9fbc87..55401bff9 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -116,7 +116,7 @@ class CEventList : public CListHelpers void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); - void getPrvNextChannelName(t_channel_id &channel_id,std::string &next_channel_name,std::string &prev_channel_name,std::string ¤t_channel_name, neutrino_msg_t msg); + void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); int timerPre; int timerPost; From 4ded8abb1220f909f344e6511da2e50dda241881 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 8 May 2017 23:44:45 +0200 Subject: [PATCH 189/394] neutrino: fix hw_caps init; it must be initialized after zapit start Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/edb0a5937e30477f633550c18c87cdfa6c2a5827 Author: vanhofen Date: 2017-05-08 (Mon, 08 May 2017) Origin message was: ------------------ - neutrino: fix hw_caps init; it must be initialized after zapit start ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index dda468ad7..07f6d2231 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -456,14 +456,22 @@ 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 uses CFEManager and CFEManager needs g_settings. + So g_settings cannot use hw_caps. + + For this reason we need this workaround. + */ + bool can_shutdown = (cs_get_revision() > 7); + g_settings.shutdown_real = false; - if (g_info.hw_caps->can_shutdown) + if (can_shutdown) //(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); g_settings.shutdown_min = 0; - if (g_info.hw_caps->can_shutdown) + if (can_shutdown) //(g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2043,8 +2051,6 @@ TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); - g_info.hw_caps = get_hwcaps(); - g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2130,6 +2136,9 @@ TIMER_START(); CheckFastScan(); + // init hw_caps *after* zapit start! + g_info.hw_caps = get_hwcaps(); + //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From 7c341be80996024e4f64f400338597669b2d01eb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 9 May 2017 11:30:06 +0200 Subject: [PATCH 190/394] CBuildInfo: fix shadow parameter Type is int not bool Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d5bb7cd8eb1d2c772d6b1e66fa0a9d9c8818791 Author: Thilo Graf Date: 2017-05-09 (Tue, 09 May 2017) ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 23f81f85b..b35300b78 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -53,7 +53,7 @@ void CBuildInfo::initVarBuildInfo() setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - shadow = true; + shadow = CC_SHADOW_ON; } From ab7e287bdf968ce3a49ecfd61d1326ab8485b8d1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 May 2017 11:40:32 +0200 Subject: [PATCH 191/394] locale: minor changes in EPG-Plus locales Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/468fbcd79c776bd0b3decbb4d82f1c10eb7f5ff8 Author: vanhofen Date: 2017-05-09 (Tue, 09 May 2017) Origin message was: ------------------ - locale: minor changes in EPG-Plus locales ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 6 +++--- data/locale/english.locale | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d8739fca7..d44cc4275 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1,5 +1,5 @@ AUDIOSelectMenue.head Auswahl der Tonspur -EPGMenu.epgplus Vorschauübersicht +EPGMenu.epgplus Vorschau-Übersicht EPGMenu.eventinfo Info zur Sendung EPGMenu.eventlist Vorschau aktuelles Programm EPGMenu.head EPG - Programminformation @@ -7,7 +7,7 @@ EPGMenu.streaminfo Technische Information EPGPlus.actions Aktionen EPGPlus.bybouquet_mode bouquetweise EPGPlus.bypage_mode seitenweise -EPGPlus.head Vorschau Übersicht (EPG Plus) +EPGPlus.head Vorschau-Übersicht (EPG Plus) EPGPlus.next_bouquet Bouquet vor EPGPlus.options Optionen EPGPlus.page_down Seite zurück @@ -19,7 +19,7 @@ EPGPlus.remind Vormerken EPGPlus.scroll_mode Scroll-Modus EPGPlus.stretch_mode Stretch-Modus EPGPlus.swap_mode Blättern -EPGPlus.view_mode Modus +EPGPlus.view_mode Ansicht GENRE.ALL aus GENRE.ARTS Kultur GENRE.ARTS.0 Kunst/Kultur diff --git a/data/locale/english.locale b/data/locale/english.locale index 7d71de370..e404aef70 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2,24 +2,24 @@ AUDIOSelectMenue.head Audio Selection EPGMenu.epgplus Eventlist overview EPGMenu.eventinfo Details current program EPGMenu.eventlist Eventlist current programm -EPGMenu.head EPG - Program Information -EPGMenu.streaminfo technical information +EPGMenu.head EPG - Program information +EPGMenu.streaminfo Technical information EPGPlus.actions Actions EPGPlus.bybouquet_mode by bouquet EPGPlus.bypage_mode by page -EPGPlus.head Eventlist Overview (EPG Plus) -EPGPlus.next_bouquet next bouquet -EPGPlus.options options -EPGPlus.page_down page down -EPGPlus.page_up page up -EPGPlus.prev_bouquet prev bouquet +EPGPlus.head Eventlist overview (EPG Plus) +EPGPlus.next_bouquet Next bouquet +EPGPlus.options Options +EPGPlus.page_down Page down +EPGPlus.page_up Page up +EPGPlus.prev_bouquet Prev bouquet EPGPlus.record Record EPGPlus.refresh_epg Refresh EPGPlus.remind Schedule -EPGPlus.scroll_mode Scroll Mode -EPGPlus.stretch_mode Stretch Mode -EPGPlus.swap_mode swap mode -EPGPlus.view_mode view mode +EPGPlus.scroll_mode Scroll mode +EPGPlus.stretch_mode Stretch mode +EPGPlus.swap_mode Swap mode +EPGPlus.view_mode View mode GENRE.ALL off GENRE.ARTS Arts GENRE.ARTS.0 arts/culture From aab9c8df904f838027619d20921346c8a27fcef1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 9 May 2017 12:08:03 +0200 Subject: [PATCH 192/394] CLuaInstCCWindow: fix passed shadow paramater Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f978f01ad2a14ce69097b34bd1d550523b8f9e9 Author: Thilo Graf Date: 2017-05-09 (Tue, 09 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_window.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 078e88ef8..1edd9814a 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 73 +#define LUA_API_VERSION_MINOR 74 diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 819fe18d2..8fb985e67 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -89,12 +89,13 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "icon", icon); - bool has_shadow = false; + int has_shadow = CC_SHADOW_OFF; if (!tableLookup(L, "has_shadow", has_shadow)) { tmp1 = "false"; if (tableLookup(L, "has_shadow", tmp1)) paramBoolDeprecated(L, tmp1.c_str()); - has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); + if ((tmp1 == "true" || tmp1 == "1" || tmp1 == "yes")) + has_shadow = CC_SHADOW_ON; } tableLookup(L, "color_frame" , color_frame); @@ -126,7 +127,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) CLuaCCWindow **udata = (CLuaCCWindow **) lua_newuserdata(L, sizeof(CLuaCCWindow *)); *udata = new CLuaCCWindow(); - (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), 0, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), NULL, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); /* Ignore percent conversion of width and height to remain compatible with the Lua API */ (*udata)->w->setWidth(dx); From c7a44bf07f6ef6f759c1a23bd41f2d89fa117b8e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 May 2017 13:31:59 +0200 Subject: [PATCH 193/394] clearify comment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c08144a9d9ba022c2548512bc97881521f900af6 Author: vanhofen Date: 2017-05-09 (Tue, 09 May 2017) Origin message was: ------------------ - clearify comment ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 07f6d2231..1ec31e04a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -457,8 +457,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); /* - hw_caps uses CFEManager and CFEManager needs g_settings. - So g_settings cannot use hw_caps. + 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. */ From d50c8ef4f8c717ca89f4fa3ab5ead8a587a55ce7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH 194/394] CComponentsHeader: fix order of width calculation Required for following position calculation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/107db09299f528ab0cea8bd7970a8aedb716d258 Author: Thilo Graf Date: 2017-05-10 (Wed, 10 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f6e20c5a0..21633e22c 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -576,20 +576,20 @@ void CComponentsHeader::initCaption() //set header text properties if (cch_text_obj){ + //recalc caption width + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)/*+ OFFSET_INNER_MID*/); + //set alignment of text item in dependency from text alignment if (cch_caption_align == CTextBox::CENTER) cch_text_x = CC_CENTERED; - //recalc caption width - cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); - //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setColorBody(col_body); if (cc_body_gradient_enable != cc_body_gradient_enable_old) cch_text_obj->getCTextBoxObject()->clearScreenBuffer(); cch_text_obj->setTextColor(cch_col_text); - cch_text_obj->setText(cch_text, cch_caption_align, cch_font); + cch_text_obj->setText(cch_text, cch_caption_align, cch_font, cch_col_text); cch_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); //corner of text item From 2564b17c7a2c4e9567cca3bfc4c9814d61626dfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH 195/394] CComponentsHeader: remove double text color assignment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c320dbf8ec424c40795e1eeea212946763ccac2b Author: Thilo Graf Date: 2017-05-10 (Wed, 10 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 21633e22c..e0ae29a75 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -588,7 +588,6 @@ void CComponentsHeader::initCaption() cch_text_obj->setColorBody(col_body); if (cc_body_gradient_enable != cc_body_gradient_enable_old) cch_text_obj->getCTextBoxObject()->clearScreenBuffer(); - cch_text_obj->setTextColor(cch_col_text); cch_text_obj->setText(cch_text, cch_caption_align, cch_font, cch_col_text); cch_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); From e0b4ef9cf34a25268e1f90f42157e82e497331ba Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH 196/394] CComponentsHeader: fix centering of header title Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/178bf6f5968a317cf0913f6bb6e2f0a734a4a343 Author: Thilo Graf Date: 2017-05-10 (Wed, 10 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index e0ae29a75..1f075bfac 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -581,7 +581,7 @@ void CComponentsHeader::initCaption() //set alignment of text item in dependency from text alignment if (cch_caption_align == CTextBox::CENTER) - cch_text_x = CC_CENTERED; + cch_text_x = width/2 - cc_text_w/2; //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); From 22bff2865b74b69c0e0688ef74a415e0a133d3d2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH 197/394] CComponentsHeader: Try to adopt different logo/title alignments Not all constellations are tested. Please report. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b541571f936275ad7973af6e6c9d90fb5016bfa Author: Thilo Graf Date: 2017-05-10 (Wed, 10 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 56 +++++++++++++++++++++------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 1f075bfac..da59a3b7f 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -302,13 +302,23 @@ void CComponentsHeader::initLogo() //right end int x_logo_right = width - cch_logo_obj->getWidth(); - if (cch_btn_obj) - x_logo_right -= cch_btn_obj->getWidth(); - if (cch_cl_obj) - x_logo_right -= cch_cl_obj->getWidth(); + if (cch_caption_align != CTextBox::RIGHT){ + if (cch_btn_obj) + x_logo_right -= cch_btn_obj->getWidth(); + if (cch_cl_obj) + x_logo_right -= cch_cl_obj->getWidth(); + }else{ + if (cch_icon_obj) + x_logo_right += cch_icon_obj->getWidth(); + } //left end - int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; + int x_logo_left = cch_offset; + if (cch_caption_align != CTextBox::RIGHT) + x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; + else + if (cch_icon_obj) + x_logo_left += cch_icon_obj->getWidth(); //calculate available space int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left; @@ -319,17 +329,30 @@ void CComponentsHeader::initLogo() //set final logo position int x_logo = 0; - if (cch_logo.Align == CC_LOGO_RIGHT) - x_logo = x_logo_right; + if (cch_logo.Align == CC_LOGO_RIGHT){ + if (cch_caption_align == CTextBox::RIGHT) + if (cch_text_obj) + x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); + else + x_logo = x_logo_right; + } if (cch_logo.Align == CC_LOGO_LEFT) x_logo = x_logo_left; if (cch_logo.Align == CC_LOGO_CENTER){ x_logo = width/2 - cch_logo_obj->getWidth()/2; - //fallback if previous item and logo are overlapping - if (getCCItem(prev_id)){ - int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; - if (x_logo <= x_logo_left) - x_logo = x_tmp; + //fallback if adjacent item and logo are overlapping + if (cch_caption_align != CTextBox::RIGHT){ + if (getCCItem(prev_id)){ + int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + if (x_logo <= x_logo_left) + x_logo = x_tmp; + } + }else{ + if (cch_text_obj){ + if (x_logo + cch_logo_obj->getWidth() >= cch_text_obj->getXPos()){ + x_logo = (x_logo_left + cch_text_obj->getXPos())/2 - cch_logo_obj->getWidth()/2; + } + } } } @@ -576,13 +599,20 @@ void CComponentsHeader::initCaption() //set header text properties if (cch_text_obj){ + int w_free = cc_text_w; + //recalc caption width - cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)/*+ OFFSET_INNER_MID*/); + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); //set alignment of text item in dependency from text alignment if (cch_caption_align == CTextBox::CENTER) cch_text_x = width/2 - cc_text_w/2; + if (cch_caption_align == CTextBox::RIGHT){ + cch_text_x += w_free; + cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + } + //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setColorBody(col_body); From 1fe98a3e4d5582bb76a8164f0c286896607282ce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH 198/394] CLuaInstCCWindow: try to fix window title align parameter Additional (lua_Integer)CTextBox::NO_AUTO_LINEBREAK) overwrites passed parameter and has no effect, because NO_AUTO_LINEBREAK is already default. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/27eb80eb5b51f47c792a0c7ace9b4d597ac61579 Author: Thilo Graf Date: 2017-05-10 (Wed, 10 May 2017) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 1edd9814a..4320eacbe 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 74 +#define LUA_API_VERSION_MINOR 75 diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 8fb985e67..490a48e37 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -224,7 +224,7 @@ int CLuaInstCCWindow::CCWindowSetCaption(lua_State *L) lua_Integer alignment = (lua_Integer)CTextBox::NO_AUTO_LINEBREAK; tableLookup(L, "alignment", alignment); - D->w->setWindowCaption(name, alignment | (lua_Integer)CTextBox::NO_AUTO_LINEBREAK); + D->w->setWindowCaption(name, alignment); return 0; } From 25645799c5af2d5a56bbaa5b6c10b13c25e0ac80 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 10 May 2017 15:35:44 +0200 Subject: [PATCH 199/394] use lua_Integer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/843703b175b227151371afc2f941b356207f03f3 Author: Jacek Jendrzej Date: 2017-05-10 (Wed, 10 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 490a48e37..6249af866 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -89,7 +89,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "icon", icon); - int has_shadow = CC_SHADOW_OFF; + lua_Integer has_shadow = CC_SHADOW_OFF; if (!tableLookup(L, "has_shadow", has_shadow)) { tmp1 = "false"; if (tableLookup(L, "has_shadow", tmp1)) From d831b0659aed1ee4124c193e4b80c8c50d807636 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 May 2017 08:35:24 +0200 Subject: [PATCH 200/394] CComponentsHeader: fix brace error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit suggest explicit braces to avoid ambiguous ‘else’ Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b2f1d320db1cf2fbfc7a85fec81c23597d52580 Author: Thilo Graf Date: 2017-05-11 (Thu, 11 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index da59a3b7f..ea3af35d4 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -330,10 +330,10 @@ void CComponentsHeader::initLogo() //set final logo position int x_logo = 0; if (cch_logo.Align == CC_LOGO_RIGHT){ - if (cch_caption_align == CTextBox::RIGHT) + if (cch_caption_align == CTextBox::RIGHT){ if (cch_text_obj) x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); - else + }else x_logo = x_logo_right; } if (cch_logo.Align == CC_LOGO_LEFT) From babdee806b28b9edf8f42240a7e44d8f7d997258 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 May 2017 11:06:42 +0200 Subject: [PATCH 201/394] EpgPlus: use default parameter for titel arrangement Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/100a1606f05639f948c9e971b033a1d4006681d9 Author: Thilo Graf Date: 2017-05-11 (Thu, 11 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9fb8f0b57..7d554df79 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -126,7 +126,7 @@ void EpgPlus::Header::paint(const char * Name) this->logo->allowPaint(false); } this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); - this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK); + this->head->setCaption(caption); this->head->paint(CC_SAVE_SCREEN_NO); } } From 064b2cc58863b520cf9756d1d60f4efd79b07ef4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 May 2017 12:03:28 +0200 Subject: [PATCH 202/394] cc_frm_header.cpp/h: remove CTextBox types for title allignment Title object has only width of current text content. This causes CTextBox types have not a really visible effect. Now we have only three align types for title and these are related to cc-text object position. Involved classes adjusted too. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/942a27e3ef1417506686ae5e8cda1fd10d785369 Author: Thilo Graf Date: 2017-05-11 (Thu, 11 May 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- src/gui/components/cc_frm_header.cpp | 24 +++++++------- src/gui/components/cc_frm_header.h | 48 ++++++++++++++++++---------- src/gui/components/cc_frm_window.cpp | 4 +-- src/gui/components/cc_frm_window.h | 12 ++++--- src/gui/eventlist.cpp | 2 +- src/gui/lua/lua_cc_window.cpp | 4 +-- src/gui/lua/lua_cc_window.h | 2 +- src/gui/scan.cpp | 2 +- src/gui/test_menu.cpp | 4 +-- 10 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 16f03c41b..3b08d8190 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2132,7 +2132,7 @@ void CChannelList::paintHead() fb_pixel_t header_txt_col = (edit_state ? COL_RED : COL_MENUHEAD_TEXT); header->setColorBody(COL_MENUHEAD_PLUS_0); - header->setCaption(header_txt, CTextBox::NO_AUTO_LINEBREAK, header_txt_col); + header->setCaption(header_txt, DEFAULT_TITLE_ALIGN, header_txt_col); if (timeset) { if(!edit_state){ diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index ea3af35d4..f0a5ba052 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -130,7 +130,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_logo.dy_max = -1; cch_logo.Align = DEFAULT_LOGO_ALIGN; cch_col_text = COL_MENUHEAD_TEXT; - cch_caption_align = CTextBox::NO_AUTO_LINEBREAK; + cch_caption_align = DEFAULT_TITLE_ALIGN; cch_items_y = CC_CENTERED; cch_offset = OFFSET_INNER_MID; cch_icon_x = cch_offset; @@ -163,7 +163,7 @@ CComponentsHeader::~CComponentsHeader() v_cch_btn.clear(); } -void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode, const fb_pixel_t& text_color) +void CComponentsHeader::setCaption(const std::string& caption, const cc_title_alignment_t& align_mode, const fb_pixel_t& text_color) { if (cch_cl_obj) cch_cl_obj->Stop(); @@ -172,7 +172,7 @@ void CComponentsHeader::setCaption(const std::string& caption, const int& align_ cch_col_text = text_color; } -void CComponentsHeader::setCaption(neutrino_locale_t caption_locale, const int& align_mode, const fb_pixel_t& text_color) +void CComponentsHeader::setCaption(neutrino_locale_t caption_locale, const cc_title_alignment_t& align_mode, const fb_pixel_t& text_color) { setCaption(string(g_Locale->getText(caption_locale)), align_mode, text_color); } @@ -302,7 +302,7 @@ void CComponentsHeader::initLogo() //right end int x_logo_right = width - cch_logo_obj->getWidth(); - if (cch_caption_align != CTextBox::RIGHT){ + if (!(cch_caption_align & CC_TITLE_RIGHT)){ if (cch_btn_obj) x_logo_right -= cch_btn_obj->getWidth(); if (cch_cl_obj) @@ -314,7 +314,7 @@ void CComponentsHeader::initLogo() //left end int x_logo_left = cch_offset; - if (cch_caption_align != CTextBox::RIGHT) + if (!(cch_caption_align & CC_TITLE_RIGHT)) x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; else if (cch_icon_obj) @@ -329,19 +329,19 @@ void CComponentsHeader::initLogo() //set final logo position int x_logo = 0; - if (cch_logo.Align == CC_LOGO_RIGHT){ - if (cch_caption_align == CTextBox::RIGHT){ + if (cch_logo.Align & CC_LOGO_RIGHT){ + if (cch_caption_align & CC_TITLE_RIGHT){ if (cch_text_obj) x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); }else x_logo = x_logo_right; } - if (cch_logo.Align == CC_LOGO_LEFT) + if (cch_logo.Align & CC_LOGO_LEFT) x_logo = x_logo_left; - if (cch_logo.Align == CC_LOGO_CENTER){ + if (cch_logo.Align & CC_LOGO_CENTER){ x_logo = width/2 - cch_logo_obj->getWidth()/2; //fallback if adjacent item and logo are overlapping - if (cch_caption_align != CTextBox::RIGHT){ + if (!(cch_caption_align & CC_TITLE_RIGHT)){ if (getCCItem(prev_id)){ int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; if (x_logo <= x_logo_left) @@ -605,10 +605,10 @@ void CComponentsHeader::initCaption() cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); //set alignment of text item in dependency from text alignment - if (cch_caption_align == CTextBox::CENTER) + if (cch_caption_align & CC_TITLE_CENTER) cch_text_x = width/2 - cc_text_w/2; - if (cch_caption_align == CTextBox::RIGHT){ + if (cch_caption_align & CC_TITLE_RIGHT){ cch_text_x += w_free; cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); } diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 9550d1134..e26d28ff2 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,25 +32,29 @@ #include "cc_frm_clock.h" #include -#define DEFAULT_LOGO_ALIGN CComponentsHeader::CC_LOGO_CENTER +#define DEFAULT_LOGO_ALIGN CCHeaderTypes::CC_LOGO_CENTER +#define DEFAULT_TITLE_ALIGN CCHeaderTypes::CC_TITLE_LEFT -//! Sub class of CComponentsForm. Shows a header with prepared items. -/*! -CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -*/ - -class CComponentsHeader : public CComponentsForm, public CCTextScreen +class CCHeaderTypes { public: ///logo position options typedef enum { - CC_LOGO_RIGHT , - CC_LOGO_LEFT , - CC_LOGO_CENTER + CC_LOGO_RIGHT = 0x01, + CC_LOGO_LEFT = 0x02, + CC_LOGO_CENTER = 0x04 }cc_logo_alignment_t; - private: + ///title position options + typedef enum + { /*for compatibilty use CTextBox enums values*/ + CC_TITLE_LEFT = 0x400, + CC_TITLE_CENTER = 0x40 , + CC_TITLE_RIGHT = 0x80 + }cc_title_alignment_t; + + protected: ///required logo data type typedef struct cch_logo_t { @@ -60,7 +64,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int32_t dy_max; cc_logo_alignment_t Align; } cch_logo_struct_t; +}; + +//! Sub class of CComponentsForm. Shows a header with prepared items. +/*! +CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows +*/ + +class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderTypes +{ + private: ///member: init genaral variables, parameters for mostly used properties void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -116,8 +130,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen std::vector v_cch_btn; ///property: size of header, possible values are CC_HEADER_SIZE_LARGE, CC_HEADER_SIZE_SMALL int cch_size_mode; - ///property: alignment of caption within header, see also setCaptionAlignment(), possible values are CTextBox::CENTER, default = CTextBox::NO_AUTO_LINEBREAK (left) - int cch_caption_align; + ///property: alignment of caption within header, see also setCaptionAlignment() + cc_title_alignment_t cch_caption_align; ///property: enable/disable of clock, see also enableClock() bool cch_cl_enable; ///property: clock format @@ -167,12 +181,12 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual ~CComponentsHeader(); ///set caption text, parameters: string, int align_mode (default left) - virtual void setCaption(const std::string& caption, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK, const fb_pixel_t& text_color = COL_MENUHEAD_TEXT); + virtual void setCaption(const std::string& caption, const cc_title_alignment_t& align_mode = DEFAULT_TITLE_ALIGN, const fb_pixel_t& text_color = COL_MENUHEAD_TEXT); ///set caption text, parameters: loacle, int align_mode (default left) - virtual void setCaption(neutrino_locale_t caption_locale, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK, const fb_pixel_t& text_color = COL_MENUHEAD_TEXT); + virtual void setCaption(neutrino_locale_t caption_locale, const cc_title_alignment_t& align_mode = DEFAULT_TITLE_ALIGN, const fb_pixel_t& text_color = COL_MENUHEAD_TEXT); - ///set alignment of caption within header, possible paramters are CTextBox::CENTER, CTextBox::NO_AUTO_LINEBREAK - virtual void setCaptionAlignment(const int& align_mode){cch_caption_align = align_mode;} + ///set alignment of caption within header, possible paramters are CComponentsHeader::CC_TITLE_LEFT, CComponentsHeader::CC_TITLE_RIGHT, CComponentsHeader::CC_TITLE_CENTER + virtual void setCaptionAlignment(const cc_title_alignment_t& align_mode){cch_caption_align = align_mode;} /**Set text font for title. * Internal default font is g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] and diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index acf06e1b4..4d43e08be 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -150,7 +150,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_buttons = 0; //no header buttons ccw_show_footer = true; ccw_show_header = true; - ccw_align_mode = CTextBox::NO_AUTO_LINEBREAK; + ccw_align_mode = DEFAULT_TITLE_ALIGN; ccw_show_l_sideber = false; ccw_show_r_sideber = false; ccw_w_sidebar = 40; @@ -187,7 +187,7 @@ void CComponentsWindow::initWindowPos() y = frameBuffer->getScreenY(); } -void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const int& align_mode) +void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const cc_title_alignment_t& align_mode) { ccw_caption = g_Locale->getText(locale_text); ccw_align_mode = align_mode; diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 7b2f71796..f6eb80f20 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -52,7 +52,7 @@ items like text, labels, pictures ... */ -class CComponentsWindow : public CComponentsForm +class CComponentsWindow : public CComponentsForm, CCHeaderTypes { protected: ///object: header object, to get access to header properties see also getHeaderObject() @@ -68,7 +68,7 @@ class CComponentsWindow : public CComponentsForm ///property: caption in header, see also getHeaderObject() std::string ccw_caption; ///property: alignment mode for header caption - int ccw_align_mode; + cc_title_alignment_t ccw_align_mode; ///property: icon name in header, see also getHeaderObject() std::string ccw_icon_name; ///property: assigned default icon buttons in header, see also getHeaderObject() @@ -168,15 +168,17 @@ class CComponentsWindow : public CComponentsForm void enableSidebar(const int& sidbar_type = CC_WINDOW_LEFT_SIDEBAR | CC_WINDOW_RIGHT_SIDEBAR); ///set caption in header with string, see also getHeaderObject() - void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;} + void setWindowCaption(const std::string& text, const cc_title_alignment_t& align_mode = DEFAULT_TITLE_ALIGN){ccw_caption = text; ccw_align_mode = align_mode;} ///set header text color + void setWindowHeaderTextColor(const fb_pixel_t& color){ccw_col_head_text = color;} ///set background to header void setWindowHeaderColor(const fb_pixel_t& color){ccw_col_head = color;} + ///set caption in header from locales, see also getHeaderObject() - void setWindowCaption(neutrino_locale_t locale_text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); + void setWindowCaption(neutrino_locale_t locale_text, const cc_title_alignment_t& align_mode = DEFAULT_TITLE_ALIGN); ///set caption alignment, see CTextBox for possible modes - void setWindowCaptionAlignment(const int& align_mode){ccw_align_mode = align_mode;}; + void setWindowCaptionAlignment(const cc_title_alignment_t& align_mode){ccw_align_mode = align_mode;}; ///set icon name in header, see also getHeaderObject() void setWindowIcon(const std::string& iconname){ccw_icon_name = iconname; initHeader();}; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index d8203b2da..02f56f04a 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -888,7 +888,7 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s if (header->isPainted()) header->getChannelLogoObject()->hide(); header->setChannelLogo(_channel_id,_channelname); - header->setCaption(_channelname,CTextBox::CENTER); + header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_CENTER); header->paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 6249af866..0d4c9d412 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -221,10 +221,10 @@ int CLuaInstCCWindow::CCWindowSetCaption(lua_State *L) std::string name = ""; tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); - lua_Integer alignment = (lua_Integer)CTextBox::NO_AUTO_LINEBREAK; + lua_Integer alignment = (lua_Integer)DEFAULT_TITLE_ALIGN; tableLookup(L, "alignment", alignment); - D->w->setWindowCaption(name, alignment); + D->w->setWindowCaption(name, (cc_title_alignment_t)alignment); return 0; } diff --git a/src/gui/lua/lua_cc_window.h b/src/gui/lua/lua_cc_window.h index 98cd9ac86..2c5c961f3 100644 --- a/src/gui/lua/lua_cc_window.h +++ b/src/gui/lua/lua_cc_window.h @@ -29,7 +29,7 @@ class CLuaCCWindow ~CLuaCCWindow() { delete w; } }; -class CLuaInstCCWindow +class CLuaInstCCWindow : CCHeaderTypes { public: CLuaInstCCWindow() {}; diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 26a00d41c..1709db61e 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -507,7 +507,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); - header.setCaptionAlignment(CTextBox::CENTER); + header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 060e7858b..9d1865966 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -743,11 +743,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "window"){ if (window == NULL){ window = new CComponentsWindow(); - window->setWindowCaption("|........HEADER........|", CTextBox::CENTER); + window->setWindowCaption("|........HEADER........|", CCHeaderTypes::CC_TITLE_CENTER); window->setDimensionsAll(50, 50, 500, 500); window->setWindowIcon(NEUTRINO_ICON_INFO); window->enableShadow(); - window->getFooterObject()->setCaption("|........FOOTER........|", CTextBox::CENTER); + window->getFooterObject()->setCaption("|........FOOTER........|", CCHeaderTypes::CC_TITLE_CENTER); CComponentsShapeCircle *c10 = new CComponentsShapeCircle(0, 0, 28); CComponentsShapeCircle *c11 = new CComponentsShapeCircle(0, CC_APPEND, 28); From cd85a9c85692eb78041c31fa17a83825c5e1d019 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 16 May 2017 10:31:25 +0200 Subject: [PATCH 203/394] buttons: use OFFSET defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf852064bcef5cbce388ba0ea78fbbe8a619a07f Author: vanhofen Date: 2017-05-16 (Tue, 16 May 2017) Origin message was: ------------------ - buttons: use OFFSET defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/buttons.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index e0095b45e..9c5a7995e 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -103,8 +103,8 @@ int paintButtons( const button_label_ext * const content, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; @@ -312,8 +312,8 @@ int paintButtons( const int &x, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; From 0298255e71e8421ff318454c4a37717041501e83 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 May 2017 17:23:22 +0200 Subject: [PATCH 204/394] cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b7ef6e47fe0e9b909988b75a73636c55f104b94b Author: vanhofen Date: 2017-05-17 (Wed, 17 May 2017) Origin message was: ------------------ - cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/cables.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/cables.xml b/data/cables.xml index e05516a44..fa4baec60 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -534,7 +534,7 @@ - + From f58c1d0089360f0c3bc2404916a2ea88622496c9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 May 2017 20:08:50 +0200 Subject: [PATCH 205/394] CHintBox: fix position in case of missing text Without text, position was not complete calculated. Only default position was used. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e48cc87b6fa93c38783cfc791c8bff94fd6ecd8c Author: Thilo Graf Date: 2017-05-17 (Wed, 17 May 2017) ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 45ef2b6ed..47d0e474c 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -162,6 +162,8 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string if (!Text.empty()) addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font); + else + ReSize(); } CHintBox::~CHintBox() @@ -312,13 +314,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const info_box->setPicture(Picon); info_box->doPaintBg(false); - /* recalculate new hintbox height */ + /* recalculate new hintbox dimensions and position*/ ReSize(); - - /* set hint box position general to center and refresh window */ - setCenterPos(CC_ALONG_X); - y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), - Refresh(); } void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style) @@ -350,6 +347,10 @@ void CHintBox::ReSize() h += item->getHeight(); } height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h))); + + /* set hint box position general to center and refresh window */ + setCenterPos(CC_ALONG_X); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), Refresh(); } From f183446d5c7138291dab2d992c2ec4bdd3d54b56 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 May 2017 22:15:15 +0200 Subject: [PATCH 206/394] src/gui/lua/lua_cc_text.cpp avoid segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ffe986f36ba3bee015f22cbb46c9628253ffb44f Author: Jacek Jendrzej Date: 2017-05-17 (Wed, 17 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_text.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 461164e1a..2cbaa45d3 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -208,10 +208,11 @@ int CLuaInstCCText::CCTextSetText(lua_State *L) std::string text = ""; lua_Integer mode = D->mode; lua_Integer font_text = D->font_text; - tableLookup(L, "text", text); - tableLookup(L, "mode", mode); - tableLookup(L, "font_text", font_text); - + if (lua_istable(L, -1)){ + tableLookup(L, "text", text); + tableLookup(L, "mode", mode); + tableLookup(L, "font_text", font_text); + } D->ct->setText(text, mode, g_Font[font_text]); return 0; } From e410e07c0c4c6e14affea2855e944b65cc68ef5d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 207/394] CHintBox: use less colors time scale mode for visual timeout Otherwise probably in this context to much colored with default settings. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c29b8e68f3886ead091d1a4f7e50dd99d727ff4 Author: Thilo Graf Date: 2017-05-21 (Sun, 21 May 2017) ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 47d0e474c..e0eec64f8 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -188,6 +188,7 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb->setValues(timeout_pb->getValue()+1, 100*timeout); }else{ timeout_pb = new CProgressBar(); + timeout_pb->setType(CProgressBar::PB_TIMESCALE); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, 100*timeout); if (!timeout_pb_timer) { From 5f3926af4e07566cec2f27fa20dfdb53d77ebb96 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 208/394] CMsgBox: fix paint of footer buttons Only paint of button container is required. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37387a3e690dd6684c9713a30325626a88cc8d48 Author: Thilo Graf Date: 2017-05-21 (Sun, 21 May 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index eb40539cb..c1cdbfe30 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -335,7 +335,7 @@ int CMsgBox::exec() void CMsgBox::refreshFoot(void) { - ccw_footer->paint(false); + ccw_footer->getButtonChainObject()->paint(); } From 1c3c6bf230c433d91dc62e168dbc44c44545dd25 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 209/394] cc_item.h/cc_frm.h/cc_frm_button.h: use pre defined frame color as default Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9132e7de8262e4930c8b18b8890d04016525ae4c Author: Thilo Graf Date: 2017-05-21 (Sun, 21 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.h | 4 ++-- src/gui/components/cc_frm_button.h | 24 ++++++++++++------------ src/gui/components/cc_item.h | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 59f488fdb..f1aba0a9c 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -157,7 +157,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as size_t virtual void setSelectedItem( int item_id, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, @@ -165,7 +165,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as CComponentsItem* virtual void setSelectedItem( CComponentsItem* cc_item, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 1e36bd826..c85777ff7 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;}; @@ -246,7 +246,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -257,7 +257,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -277,7 +277,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -289,7 +289,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -309,7 +309,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -320,7 +320,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -340,7 +340,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; @@ -351,7 +351,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 37677a813..9d633ad62 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -110,7 +110,7 @@ class CComponentsItem : public CComponents ///set select mode virtual void setSelected(bool selected, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, From c6c255a2f235cf0c419424b39fd0ac270277c3fd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 210/394] CComponentsButton: add missing init of col_body_old Some changes on runtime were ignored on runtime. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/36c8f4c24f45d2c97b48f8bccb3f2b923333792a Author: Thilo Graf Date: 2017-05-21 (Sun, 21 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index b7e964356..c7215b4fc 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -106,7 +106,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); col_frame = color_frame; - col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body; + col_body = col_body_old = cc_body_gradient_enable? COL_DARK_GRAY : color_body; col_shadow = color_shadow; cc_item_enabled = enabled; From bf7c16e8d6d5374c7214d074638089e4992ab36e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 23 May 2017 17:48:15 +0200 Subject: [PATCH 211/394] src/gui/adzap.cpp init before use Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e8c1cac9643fa044fb4d8ab358a0c290394d171 Author: Jacek Jendrzej Date: 2017-05-23 (Tue, 23 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/adzap.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 0199bc779..bc251f253 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -66,15 +66,16 @@ CAdZapMenu::CAdZapMenu() sem_init(&sem, 0, 0); + channelId = -1; + armed = false; + monitor = false; + alerted = false; + pthread_t thr; if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); else pthread_detach(thr); - channelId = -1; - armed = false; - monitor = false; - alerted = false; } static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) From 67490319f9ca3e246f6e262452d5a4d65e315f60 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 23 May 2017 17:52:16 +0200 Subject: [PATCH 212/394] src/gui/screensaver.cpp try to fix segfault on stop Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fcc3a12e887707c969aab1b27e730cda43d60168 Author: Jacek Jendrzej Date: 2017-05-23 (Tue, 23 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/screensaver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 3bf274b39..d3d61e7bb 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -164,7 +164,7 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) if (g_settings.screensaver_timeout) { - while(1) + while(PScreenSaver) { PScreenSaver->paint(); sleep(g_settings.screensaver_timeout); From cf709ec985d061b406fa9eac6c7e35ba93332b82 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 213/394] CComponentsFrmClock: fix wrong comparison Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4455c65225949be58d255af6a579c9dddb55f3ca Author: Thilo Graf Date: 2017-05-27 (Sat, 27 May 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 297406e9f..b43ffbbff 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -390,7 +390,7 @@ void CComponentsFrmClock::paint(bool do_save_bg) void CComponentsFrmClock::setClockFont(Font *font, const int& style) { - if (cl_font != font || (cl_font != font)){ + if (cl_font != font || cl_font_style != style){ if (cl_font != font) cl_font = font; if (style != -1) From 14b97bd2e0be1a836c3a2bdb92ec1c58be968f5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 214/394] CCDraw: expand debug output inside clearFbGradientData() get info for addresses. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/979e6370a76bd4ce03bc6a5518c83adafc739a2d Author: Thilo Graf Date: 2017-05-27 (Sat, 27 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index dbca41d93..078edf940 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -374,15 +374,16 @@ bool CCDraw::clearFbGradientData() for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].gradient_data){ if (v_fbdata[i].gradient_data->gradientBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->gradientBuf); free(v_fbdata[i].gradient_data->gradientBuf); v_fbdata[i].gradient_data->gradientBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf...\033[0m\n", __func__, __LINE__); } if (v_fbdata[i].gradient_data->boxBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->boxBuf); cs_free_uncached(v_fbdata[i].gradient_data->boxBuf); v_fbdata[i].gradient_data->boxBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf...\033[0m\n", __func__, __LINE__); } + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradient data \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data); delete v_fbdata[i].gradient_data; v_fbdata[i].gradient_data = NULL; ret = true; From ede262c34f6561a2cf1a1497360ffebfa4bc8c73 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 215/394] CComponentsHeader: ensure reset of icon object Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f8007c50c5d7c4af1cf8c223d2de679667f058e Author: Thilo Graf Date: 2017-05-27 (Sat, 27 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f0a5ba052..bce82f375 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -232,8 +232,10 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj) + if (cch_icon_obj){ removeCCItem(cch_icon_obj); + cch_icon_obj = NULL; + } return; } From 9fa536bc458bdba63569d4d64fdf9d1c3756e903 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 17:23:33 +0200 Subject: [PATCH 216/394] CComponentsFrmClock: init OnTimer after ititialized timer object Content of OnTimer was not considered after init of timer object. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de3c14a8810f14bd1439401475b4b2c4c487cf57 Author: Thilo Graf Date: 2017-05-27 (Sat, 27 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index b43ffbbff..46d4781df 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -325,12 +325,14 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); cl_timer->setThreadName("frmClock"); - if (cl_timer->OnTimer.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl_show); - force_paint_bg = true; - } } + + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; + } + cl_timer->setTimerInterval(cl_interval); if (cl_timer->startTimer()) From 1628e76f66f8b8b6134f14a5698ea2ddea60610e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 17:24:48 +0200 Subject: [PATCH 217/394] CComponentsTimer: ensure cleanup of OnTimer signal while sopping timer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c0fe5d24027da1dd4f7a5f250b14b6e0bf915759 Author: Thilo Graf Date: 2017-05-27 (Sat, 27 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_timer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index ab6523840..d6659aa38 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,6 +143,7 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; + OnTimer.clear(); stopThread(); if(tm_thread == 0) return true; From 07ccd1c6d7b473be3283e5b8d6b601353e720a5e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 28 May 2017 13:12:08 +0200 Subject: [PATCH 218/394] CComponentsButton: use defined offset for append offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5a2ac6037ffc7261f0061f7ce55f6f983cfed96 Author: Thilo Graf Date: 2017-05-28 (Sun, 28 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c7215b4fc..ff68a47db 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -112,7 +112,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons - append_x_offset = 6; + append_x_offset = OFFSET_INTER; append_y_offset = 0; corner_rad = RADIUS_SMALL; From cc940c76ade3bb3aa8a5267f68da1c15e2178325 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 28 May 2017 13:30:58 +0200 Subject: [PATCH 219/394] CComponentsButton: fix offset between icon and text items We have only two items, therfore it makes sense to set offset to 0 if we have only one item. Otherwise a single item will not be centered. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/294278aad38bf5bed8fef7e87dbb981edb553e4b Author: Thilo Graf Date: 2017-05-28 (Sun, 28 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_button.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index ff68a47db..c0c0039b0 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -187,6 +187,7 @@ void CComponentsButton::initCaption() } //set basic properties + int x_offset = (!cc_btn_text_obj || !cc_btn_icon_obj) ? 0 : append_x_offset; int w_frame = fr_thickness; int reduce = 2*w_frame; if (cc_btn_text_obj){ @@ -198,7 +199,7 @@ void CComponentsButton::initCaption() if (cc_btn_font == NULL) cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]; - int w_cap = min(width - append_x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); + int w_cap = min(width - x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); int h_cap = min(height - reduce, cc_btn_font->getHeight()); /*NOTE: paint of centered text in y direction without y_offset @@ -235,10 +236,10 @@ void CComponentsButton::initCaption() } //handle common position of icon and text inside container required for alignment - int w_required = w_frame + append_x_offset; - w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; + int w_required = w_frame + x_offset; + w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + x_offset : 0; w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_text) : 0; - w_required += append_x_offset + w_frame; + w_required += x_offset + w_frame; //dynamic width if (w_required > width){ @@ -247,10 +248,10 @@ void CComponentsButton::initCaption() } //do center - int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/; + int x_icon = width/2 - w_required/2 /*+ fr_thickness + x_offset*/; int w_icon = 0; if (cc_btn_icon_obj){ - x_icon += w_frame + append_x_offset; + x_icon += w_frame + x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); /*in case of dynamic changed height of caption or button opbject itself, @@ -260,7 +261,7 @@ void CComponentsButton::initCaption() cc_btn_icon_obj->setYPos(y_icon); } if (cc_btn_text_obj){ - cc_btn_text_obj->setXPos(x_icon + w_icon + append_x_offset); + cc_btn_text_obj->setXPos(x_icon + w_icon + x_offset); cc_btn_text_obj->setWidth(width - cc_btn_text_obj->getXPos()); } } From 7b89cd022d7cf101a121061729211c7301a5ee72 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 28 May 2017 20:40:42 +0200 Subject: [PATCH 220/394] CChannelList: simplify calls of logo paints, avoid possible dub paints Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4f5d216120b8f3872673030ebf5943ce4e42e3c7 Author: Thilo Graf Date: 2017-05-28 (Sun, 28 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 3b08d8190..755e19707 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1684,13 +1684,15 @@ void CChannelList::showChannelLogo() { if ((*chanlist).empty()) return; + if(g_settings.channellist_show_channellogo){ header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); header->getChannelLogoObject()->hide(); header->getChannelLogoObject()->clearSavedScreen(); - header->getChannelLogoObject()->allowPaint(true); header->getChannelLogoObject()->paint(); } + else + header->setChannelLogo(0, string()); } #define NUM_LIST_BUTTONS_SORT 9 @@ -2150,16 +2152,7 @@ void CChannelList::paintHead() } } - if(g_settings.channellist_show_channellogo){ - //ensure to have clean background - header->getChannelLogoObject()->hide(); - header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); - header->getChannelLogoObject()->allowPaint(false); - } - else - header->setChannelLogo(0, string()); header->paint(CC_SAVE_SCREEN_NO); - showChannelLogo(); } CComponentsHeader* CChannelList::getHeaderObject() From e39222a183d89fe91aad91076b4221c99a271816 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 May 2017 21:14:10 +0200 Subject: [PATCH 221/394] CComponentsTimer: exec OnTimer cleanup after stopped thread Users reported about crashes, but I could not verify them by myself. Supplement to: 1628e76f66f8b8b6134f14a5698ea2ddea60610e Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e9e4de63842bf6c6695bb4117793fc4b4c5067d Author: Thilo Graf Date: 2017-05-29 (Mon, 29 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_timer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index d6659aa38..5f32adf2d 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,10 +143,12 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; - OnTimer.clear(); stopThread(); - if(tm_thread == 0) + if(tm_thread == 0){ + if (!OnTimer.empty()) + OnTimer.clear(); return true; + } return false; } From 4a06fec24e8b83dfeabb9404ba509372cf42085f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 May 2017 21:36:12 +0200 Subject: [PATCH 222/394] CProgressBarCache: declare funtions pbcPaint(), pbcPaintBoxRel() as const Technically these members can be const. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/88e0479429e3931f786a6859fb3073e7f7925634 Author: Thilo Graf Date: 2017-05-29 (Mon, 29 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_progressbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index c4126f6dc..1613f4eb4 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -145,7 +145,7 @@ class CProgressBarCache static inline unsigned int make16color(__u32 rgb){return 0xFF000000 | rgb;}; - void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col); + void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const; void pbcApplyGradient(fb_pixel_t *pixbuf); void pbcCreateBitmaps(); @@ -177,7 +177,7 @@ class CProgressBarCache } void pbcClear(); public: - void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width); + void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const; static CProgressBarCache *pbcLookup( int dy, int dx, int active_col, @@ -222,7 +222,7 @@ CProgressBarCache *CProgressBarCache::pbcLookup(int dy, int dx, int active_col, return pbc; } -void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) +void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const { y += yoff; static CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); @@ -249,7 +249,7 @@ void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_pas } } -void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) +void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const { if (x < 0) { dx -= x; From 28bcf2997e78b7c3a76f2d8cc2c8142b032a7bdb Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 May 2017 19:26:04 +0200 Subject: [PATCH 223/394] change prozent ckeck to 90 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab829a61b651a6250240e70727c515fa8d7f5978 Author: Jacek Jendrzej Date: 2017-05-30 (Tue, 30 May 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 716c7262a..267b6f629 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1326,7 +1326,7 @@ void CMoviePlayerGui::PlayFileLoop(void) printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent); #endif /* in case ffmpeg report incorrect values */ - if(file_prozent > 96 && (playstate == CMoviePlayerGui::PLAY) && (speed == 1)){ + if(file_prozent > 89 && (playstate == CMoviePlayerGui::PLAY) && (speed == 1)){ if(position_tmp != position){ position_tmp = position ; eof2 = 0; From f273871fcff9667a3af625d16b0fa1b7d2e6d751 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 7 Jun 2017 14:12:27 +0200 Subject: [PATCH 224/394] HD1: Workaround for missing cs_get_chip_type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6fe60d60a5363973459384a156ed49c9e9ee91c Author: Michael Liebmann Date: 2017-06-07 (Wed, 07 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 6 +++++- lib/hardware/coolstream/hd1/libcoolstream/cs_api.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index b4d4c0a46..865e8ccf5 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -6,6 +6,7 @@ * * License: GPL v2 or later */ +#include #include "cs_api.h" #include #include @@ -20,7 +21,10 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); - int chip = cs_get_chip_type(); + int chip = 0; +#ifdef BOXMODEL_CS_HD2 + chip = cs_get_chip_type(); +#endif caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan caps.has_HDMI = 1; caps.has_SCART = (rev != 10); diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index 9a4e77259..80dd47ade 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -82,7 +82,7 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); /* Dummy function for compatibility with hd2 */ -unsigned int cs_get_chip_type(void); +//unsigned int cs_get_chip_type(void); // library version functions From deb3770a66aba791facd8f406c3eae337b11d695 Mon Sep 17 00:00:00 2001 From: gixxpunk Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 225/394] hdd_menu.cpp: remove "-T largefile" parameter Some users experience problems with too low amount of inodes (No space left on device but only a few percent of the device are actually used). To fix this, simply use default settings. This will give us a much higher amount of inodes on the hard drive but will waste a bit more space on the device for inode reservation. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/327dbbed1eccf37eae5339ba98e5823a76cb32d9 Author: gixxpunk Date: 2017-06-07 (Wed, 07 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index d1d7b6233..11d2831d0 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -86,12 +86,12 @@ const CMenuOptionChooser::keyval HDD_SLEEP_OPTIONS[HDD_SLEEP_OPTION_COUNT] = }; devtool_s CHDDMenuHandler::devtools[] = { - { "ext4", "/sbin/fsck.ext4", "-C 1 -f -y", "/sbin/mkfs.ext4", "-T largefile -m0", false, false }, - { "ext3", "/sbin/fsck.ext3", "-C 1 -f -y", "/sbin/mkfs.ext3", "-T largefile -m0", false, false }, - { "ext2", "/sbin/fsck.ext2", "-C 1 -f -y", "/sbin/mkfs.ext2", "-T largefile -m0", false, false }, - { "vfat", "/sbin/fsck.vfat", "-a", "/sbin/mkfs.vfat", "", false, false }, - { "exfat", "/sbin/fsck.exfat", "", "/sbin/mkfs.exfat", "", false, false }, - { "xfs", "/sbin/xfs_repair", "", "/sbin/mkfs.xfs", "-f", false, false }, + { "ext4", "/sbin/fsck.ext4", "-C 1 -f -y", "/sbin/mkfs.ext4", "-m 0", false, false }, + { "ext3", "/sbin/fsck.ext3", "-C 1 -f -y", "/sbin/mkfs.ext3", "-m 0", false, false }, + { "ext2", "/sbin/fsck.ext2", "-C 1 -f -y", "/sbin/mkfs.ext2", "-m 0", false, false }, + { "vfat", "/sbin/fsck.vfat", "-a", "/sbin/mkfs.vfat", "", false, false }, + { "exfat", "/sbin/fsck.exfat", "", "/sbin/mkfs.exfat", "", false, false }, + { "xfs", "/sbin/xfs_repair", "", "/sbin/mkfs.xfs", "-f", false, false }, }; #define FS_MAX (sizeof(CHDDMenuHandler::devtools)/sizeof(devtool_s)) From bf18914393cd9ca4bade5b1070134d6ba7c478be Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 226/394] filebrowser: use "dirs first" sort method by default Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/64f35bd2ef886b8f9206bf84049116dad689551b Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - filebrowser: use "dirs first" sort method by default Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1ec31e04a..6a41d2944 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -855,7 +855,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); - g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 0); + g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 1); if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS)) g_settings.filebrowser_sortmethod = 0; g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false); From 71f9b0fd85ae976e6eb056dbb1b1b1e7b6723f7b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 227/394] filebrowser: use a bit larger regular font by default Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11aa9054bcbd593a04ca49dd98fe64f288d266a2 Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - filebrowser: use a bit larger regular font by default Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f2ec1473e..99eae1590 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -213,7 +213,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_INFOBAR_CHANNAME , 30, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_INFOBAR_INFO , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, - {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, + {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, From f235e9b1ec76b1a7317f7fea6a08a91d6865c461 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 228/394] locale: small changes in filebrowser's sort locales Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/49bd2e9ba72930bbd6cfec93a80815540f644fff Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - locale: small changes in filebrowser's sort locales Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 10 +++++----- data/locale/english.locale | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d44cc4275..d1bb700f7 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -593,11 +593,11 @@ filebrowser.prevpage Seite zurück filebrowser.scan Durchsuche Verzeichnisse filebrowser.select Auswählen filebrowser.showrights Dateirechte anzeigen -filebrowser.sort.date (Datum) -filebrowser.sort.name (Dateiname) -filebrowser.sort.namedirsfirst (Dateiname2) -filebrowser.sort.size (Größe) -filebrowser.sort.type (Typ) +filebrowser.sort.date Datum +filebrowser.sort.name Name +filebrowser.sort.namedirsfirst Name, Verz. zuerst +filebrowser.sort.size Größe +filebrowser.sort.type Typ filesystem.is.utf8 Dateisystem filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 diff --git a/data/locale/english.locale b/data/locale/english.locale index e404aef70..f2934a7df 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -593,11 +593,11 @@ filebrowser.prevpage Prev. Page filebrowser.scan Scaning folder filebrowser.select Select filebrowser.showrights Show file rights -filebrowser.sort.date (date) -filebrowser.sort.name (name) -filebrowser.sort.namedirsfirst (name, dir first) -filebrowser.sort.size (Size) -filebrowser.sort.type (type) +filebrowser.sort.date Date +filebrowser.sort.name Name +filebrowser.sort.namedirsfirst Name, dirs first +filebrowser.sort.size Size +filebrowser.sort.type Type filesystem.is.utf8 file system filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 From f9947044b101921110becf5a398f865c97110e5d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 229/394] filebrowser: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables Unfortunately we can't use CComponentsFooter, because CComponentsFooter can't handle button_label_ext yet Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cb36d32799d2e85f67716a94028de2453a18a4db Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - filebrowser: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables Unfortunately we can't use CComponentsFooter, because CComponentsFooter can't handle button_label_ext yet Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 135 ++++++++++++++++++++-------------------- src/gui/filebrowser.h | 8 +-- 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index d1f725fcf..1c0175b47 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -268,19 +268,18 @@ void CFileBrowser::fontInit() height = frameBuffer->getScreenHeightRel(); x = getScreenStartX(width); - theight = fnt_title->getHeight(); - fheight = fnt_item->getHeight(); - if (fheight == 0) - fheight = 1; /* avoid div by zero on invalid font */ - //foheight = fnt_foot->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar - foheight = paintFoot(false); - skwidth = 26; + header_height = fnt_title->getHeight(); + item_height = fnt_item->getHeight(); + if (item_height == 0) + item_height = 1; /* avoid div by zero on invalid font */ + footer_height = paintFoot(false); + smskey_width = fnt_foot->getRenderWidth("M") + OFFSET_INNER_MID; liststart = 0; - listmaxshow = std::max(1,(int)(height - theight - foheight)/fheight); + listmaxshow = std::max(1,(int)(height - header_height - footer_height)/item_height); //recalc height - height = theight + listmaxshow * fheight + foheight; + height = header_height + listmaxshow * item_height + footer_height; y = getScreenStartY(height); } @@ -1167,8 +1166,8 @@ void CFileBrowser::hide() void CFileBrowser::paintItem(unsigned int pos) { - int colwidth1, colwidth2, colwidth3; - int ypos = y+ theight+0 + pos*fheight; + int col1_width, col2_width, col3_width; + int ypos = y + header_height + pos*item_height; CFile * actual_file = NULL; std::string fileicon; unsigned int currpos = liststart + pos; @@ -1176,7 +1175,7 @@ void CFileBrowser::paintItem(unsigned int pos) if (currpos >= filelist.size()) { // just paint an empty line - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); return; } @@ -1196,15 +1195,15 @@ void CFileBrowser::paintItem(unsigned int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode)) - colwidth2 = 0; + col2_width = 0; else - colwidth2 = fnt_item->getRenderWidth("rwxrwxrwx"); - colwidth3 = fnt_item->getRenderWidth("222.222G"); - colwidth1 = width - 35 - colwidth2 - colwidth3 - 10; + col2_width = fnt_item->getRenderWidth("rwxrwxrwx"); + col3_width = fnt_item->getRenderWidth("222.222G"); + col1_width = width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - col3_width - OFFSET_INNER_MID - col2_width - OFFSET_INNER_MID; if ( !actual_file->Name.empty() ) { @@ -1231,9 +1230,15 @@ void CFileBrowser::paintItem(unsigned int pos) default: fileicon = NEUTRINO_ICON_FILE; } - frameBuffer->paintIcon(fileicon, x+5 , ypos + (fheight-16) / 2 ); - fnt_item->RenderString(x + 35, ypos + fheight, colwidth1 - 10 , FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color); + int icon_w = 0; + int icon_h = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_FILE, &icon_w, &icon_h); + + frameBuffer->paintIcon(fileicon, x + OFFSET_INNER_MID, ypos, item_height); + + int col1_offset = OFFSET_INNER_MID + icon_w + OFFSET_INNER_MID; + fnt_item->RenderString(x + col1_offset, ypos + item_height, col1_width - col1_offset, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color); if( S_ISREG(actual_file->Mode) ) { @@ -1246,13 +1251,13 @@ void CFileBrowser::paintItem(unsigned int pos) modestring[9] = 0; - fnt_item->RenderString(x + width - 25 - colwidth3 - colwidth2 , ypos+ fheight, colwidth2, modestring, color); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - col3_width - OFFSET_INNER_MID - col2_width , ypos + item_height, col2_width, modestring, color); } #define GIGABYTE 1073741824LL #define MEGABYTE 1048576LL #define KILOBYTE 1024LL - char tmpstr[256]; + char sizestring[256]; const char *unit = ""; int64_t factor = 0; if (actual_file->Size >= GIGABYTE) @@ -1274,14 +1279,14 @@ void CFileBrowser::paintItem(unsigned int pos) { int a = actual_file->Size / factor; int b = (actual_file->Size - a * factor) * 1000 / factor; - snprintf(tmpstr, sizeof(tmpstr), "%d.%03d%s", a, b, unit); + snprintf(sizestring, sizeof(sizestring), "%d.%03d%s", a, b, unit); } else - snprintf(tmpstr,sizeof(tmpstr),"%d", (int)actual_file->Size); + snprintf(sizestring,sizeof(sizestring),"%d", (int)actual_file->Size); /* right align file size */ - int sz_w = fnt_item->getRenderWidth(tmpstr); - fnt_item->RenderString(x + width - sz_w - 25, ypos+ fheight, sz_w, tmpstr, color); + int sz_w = fnt_item->getRenderWidth(sizestring); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - sz_w, ypos + item_height, sz_w, sizestring, color); } if(actual_file->isDir()) @@ -1292,7 +1297,7 @@ void CFileBrowser::paintItem(unsigned int pos) strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&rawtime)); /* right align directory time */ int time_w = fnt_item->getRenderWidth(timestring); - fnt_item->RenderString(x + width - time_w - 25, ypos+ fheight, time_w, timestring, color); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - time_w, ypos + item_height, time_w, timestring, color); } } } @@ -1317,16 +1322,16 @@ void CFileBrowser::paintHead() /* too long? Leave out the "Filebrowser" or "Shoutcast" prefix * the allocated space is sufficient since it is surely shorter than before */ - if (fnt_title->getRenderWidth(l_name) > width - 11) + if (fnt_title->getRenderWidth(l_name) > width - 2*OFFSET_INNER_MID) l = sprintf(l_name, "%s", FILESYSTEM_ENCODING_TO_UTF8_STRING(name).c_str()); if (l_name[l - 1] == '/') l_name[--l] = '\0'; /* still too long? the last part is probably more interesting than the first part... */ - while ((fnt_title->getRenderWidth(&l_name[i]) > width - 20) && (i < l)) + while ((fnt_title->getRenderWidth(&l_name[i]) > width - 2*OFFSET_INNER_MID) && (i < l)) i++; - CComponentsHeader header(x, y, width, theight, &l_name[i]); + CComponentsHeader header(x, y, width, header_height, &l_name[i]); header.paint(CC_SAVE_SCREEN_NO); free(l_name); @@ -1360,17 +1365,12 @@ bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str, return false; } -const struct button_label FileBrowserFilterButton[2] = -{ - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_FILEBROWSER_FILTER_INACTIVE }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_FILEBROWSER_FILTER_ACTIVE }, -}; - int CFileBrowser::paintFoot(bool show) { - int cnt,res; + int cnt, res; std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); + sort_text += " "; sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]); int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); @@ -1380,65 +1380,72 @@ int CFileBrowser::paintFoot(bool show) sort_text_len += len; - neutrino_locale_t f_loc = LOCALE_FILEBROWSER_FILTER_INACTIVE; + neutrino_locale_t locale_filebrowser_filter = LOCALE_FILEBROWSER_FILTER_INACTIVE; if (Filter != NULL && use_filter) - f_loc = LOCALE_FILEBROWSER_FILTER_ACTIVE; + locale_filebrowser_filter = LOCALE_FILEBROWSER_FILTER_ACTIVE; - button_label_ext footerButtons_pm[] = { + button_label_ext buttons_playlistmode[] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_FILEBROWSER_DELETE, NULL, 0, false }, - { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_FILEBROWSER_ADD, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_FILEBROWSER_ADD, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_YELLOW, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_AUDIOPLAYER_SHUFFLE, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_AUDIOPLAYER_SHUFFLE, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, }; - button_label_ext footerButtons[] = { + button_label_ext buttons_filelistmode[] = { { NEUTRINO_ICON_BUTTON_RED, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_MUTE_SMALL, LOCALE_FILEBROWSER_DELETE, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, - { NEUTRINO_ICON_BUTTON_BLUE, f_loc, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BLUE, locale_filebrowser_filter, NULL, 0, false }, }; if (playlistmode) { - cnt = sizeof(footerButtons_pm) / sizeof(button_label_ext); + cnt = sizeof(buttons_playlistmode)/sizeof(button_label_ext); if (!show) - return paintButtons(footerButtons_pm, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + return paintButtons(buttons_playlistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } else { - cnt = sizeof(footerButtons) / sizeof(button_label_ext); + cnt = sizeof(buttons_filelistmode)/sizeof(button_label_ext); if (!show) - return paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + return paintButtons(buttons_filelistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } - int fowidth = width - skwidth; + int footer_width = width - smskey_width; - - if (filelist.empty()) { - frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM); - return foheight; + if (filelist.empty()) + { + // show an empty footer + frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + return footer_height; } + + /* + We can't use CComponentsFooter because + CComponentsFooter can't handle button_label_ext + */ if (playlistmode) - res = paintButtons(footerButtons_pm, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + res = paintButtons(buttons_playlistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); else - res = paintButtons(footerButtons, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + res = paintButtons(buttons_filelistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + paintSMSKey(); return res; } void CFileBrowser::paintSMSKey() { - int skheight = fnt_foot->getHeight(); + int smskey_height = fnt_foot->getHeight(); //background - frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - smskey_width, y + height - footer_height, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); int len = fnt_foot->getRenderWidth(cKey); - fnt_foot->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); + fnt_foot->RenderString(x + width - smskey_width, y + height - footer_height + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1452,16 +1459,10 @@ void CFileBrowser::paint() paintItem(count); //scrollbar - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); + int total_pages = ((filelist.size() - 1) / listmaxshow) + 1; + int current_page = (selected / listmaxshow); - int sbc= ((filelist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); - if (sbc < 1) - sbc = 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index 3d458125d..4de5981c2 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -162,10 +162,10 @@ class CFileBrowser unsigned int listmaxshow; std::vector selections; - int fheight; // Fonthoehe Filelist-Inhalt - int theight; // Fonthoehe Filelist-Titel - int foheight; // Hoehe der button leiste - int skwidth; // width SMSKey field + int item_height; + int header_height; + int footer_height; + int smskey_width; std::string name; std::string base; std::string m_baseurl; From 0b4acaab6cd6fc1d257489909473709c3703fa80 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 230/394] icons: add filetype-icon for pictures Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d8f364ca4630607918860e091c2d767dcc1125dc Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - icons: add filetype-icon for pictures Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/icons/filetypes/Makefile.am | 3 ++- data/icons/filetypes/picture.png | Bin 0 -> 708 bytes src/gui/widget/icons.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/icons/filetypes/picture.png diff --git a/data/icons/filetypes/Makefile.am b/data/icons/filetypes/Makefile.am index ec9f09d5a..c234f8891 100644 --- a/data/icons/filetypes/Makefile.am +++ b/data/icons/filetypes/Makefile.am @@ -3,4 +3,5 @@ installdir = $(ICONSDIR) install_DATA = \ file.png \ folder.png \ - movie.png + movie.png \ + picture.png diff --git a/data/icons/filetypes/picture.png b/data/icons/filetypes/picture.png new file mode 100644 index 0000000000000000000000000000000000000000..f1f450c7878203a6436d0333132923f62212e95f GIT binary patch literal 708 zcmV;#0z3VQP)dc)x&g=A_nR^%6DjN9aKl9D}e{;^6?@0L1LyAuI?QieM zjFqX10!>w+k~F$5)YzL>6}7jmK;6kVoDAb10U&@B1DcON=G&I)24f72Nr}j3 zLV$%Lu2NhJ9`HVuM%UR53E+I&BYvsA%zzvK8VMedb%42o<^ab9a&A&>5BHYTp!Hfy z0=Rgrmv=QV1EuuxDw3K5K1~8&r>Maq(Y;N+Mc^6wz_dVbMKccF%p`#Bw)^}-gKwZZ z3p8ppPO|wZ(Epj5W&oFb$EH!yNM?P&1p17_IC%X`0_Zs1!;jW}H*CcOD+y6isbhgP z0d?>T%-LB?nii(BB-4iQJQUFiy{b5cb62|)z>XtV_}b!8!_8U9S|*Ly#tePUaUA?I zbFi$)w;-a$L;yMTP_?xk0}n4JfZClIUOF{kq!;U0xeO>$eGH9c@omCIF6Y2?JvehN zWcq!?fJAL8ww%Dr2VDuEYI}x@k57#BB8JWDX`W$#4`VWh$3g@`iyNXNl}bUT|8Lti zDmS*GzppcSQnRartNfW!y3og_buL8U;N6f6{zJq7MWH}x8ls#;0N?jf-gE#j?sg=A zHM={xI{w@!DGt!I+JQ{-9OfFvf6|OY8M>~=O;K|M@@OH;8~5Ys?Y0C^mwA0lLbyDN zsj5U#rnoA9$M=t_>DiurT8mWJRYmD)3bsTEkn#bi1s8#kWtAKz$QR_3q*zmYP!x8f qOe)SxkG4RbNr^`=Pkvs7>) Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 231/394] filebrowser: use NEUTRINO_ICON_PICTURE to mark pictures Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/78dd5e2923b057ed4ef0054dc8c5501b5e772639 Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - filebrowser: use NEUTRINO_ICON_PICTURE to mark pictures Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 1c0175b47..feeb59004 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1218,6 +1218,7 @@ void CFileBrowser::paintItem(unsigned int pos) case CFile::FILE_WAV: case CFile::FILE_FLAC: case CFile::FILE_AAC: + case CFile::FILE_PLAYLIST: fileicon = NEUTRINO_ICON_MP3; break; @@ -1226,6 +1227,9 @@ void CFileBrowser::paintItem(unsigned int pos) break; case CFile::FILE_PICTURE: + fileicon = NEUTRINO_ICON_PICTURE; + break; + case CFile::FILE_TEXT: default: fileicon = NEUTRINO_ICON_FILE; From 67f8ed5225c1f2b778049f7164a81a44c218a5a2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 232/394] audioplayer: use NEUTRINO_ICON_AUDIO in header Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c1d7eea595e82e3f5a3f035f9c7656a5f4fc79d Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - audioplayer: use NEUTRINO_ICON_AUDIO in header Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index a95fbcdfa..ab6da1ff8 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -261,7 +261,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); int iw, ih; - m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih); + m_frameBuffer->getIconSize(NEUTRINO_ICON_AUDIO, &iw, &ih); m_theight = std::max(m_theight, ih+4); m_title_height = m_fheight*2 + 20 + m_sheight + 4; @@ -1536,7 +1536,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_MP3); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) From 0700c6cadd9c04f1cf6de415c6c14a8124bb3bf2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 233/394] icons: move mp3.png from /headers to /filetypes; align icon size Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a43617dda3c45f7fe4c3c71a1c13a44f7d2ee987 Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - icons: move mp3.png from /headers to /filetypes; align icon size Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/icons/filetypes/Makefile.am | 1 + data/icons/filetypes/mp3.png | Bin 0 -> 961 bytes data/icons/headers/Makefile.am | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 data/icons/filetypes/mp3.png diff --git a/data/icons/filetypes/Makefile.am b/data/icons/filetypes/Makefile.am index c234f8891..d71903773 100644 --- a/data/icons/filetypes/Makefile.am +++ b/data/icons/filetypes/Makefile.am @@ -4,4 +4,5 @@ install_DATA = \ file.png \ folder.png \ movie.png \ + mp3.png \ picture.png diff --git a/data/icons/filetypes/mp3.png b/data/icons/filetypes/mp3.png new file mode 100644 index 0000000000000000000000000000000000000000..7c4bb1eb852dbc8148c1d66c67cdc6c926e7240a GIT binary patch literal 961 zcmV;y13vtTP)gymzpBp5DflMVsL?YjC1_e9r!tZ%`A(1od&hm}cwxcIeg6S;bvIX+mX;3txoGOx zwMw)V_aiqkUv8wI1C&Yy!r?G3PfRqIm+f;r2ka@{9pByZ!EbuA#=w&*)Qpy+IDH?Q zcAS7&Z;n8eN(z!Bf#(El1cO3nSJz8t`cD560d%)^byk&@on$B;Va+=Bk2c_0Yyije zIy}`WwSJvin=GrKIJsHi1xWI_>T(TNRaVqS02hZx=5sT%a#W-&NerTIzFo?S-~H3M zM;FbLb(7zVqNoc6*+!D0lq}035ZJ)V%IbPuU5$y*>kW!4KTi4NscSa9LgI1udgp3u zMgRG|J$r42CF7L~{mwX#=dV`;KAat5S+F4vp%9A$wUrivVbt`E*?C{I(ZECi5Ya!? z_NcY2Z@9jrKIq->`o??46IYfW7qh&O$FjT(U}XS@+E=Tr1Wl{R(Xk&E@@?C#3`0W< z3uqf}k~+#ye><`;7L%dN@a86F`yM`=dqW6rQ3XR3f&vfknm2U#or5uv8ML*3^5s$c z(L)qPLX<6hIC2QD=f5j*;qY3jA;lwbqD7K|G{*-)NILl|NvsF_{@I%|MQ5m(!HV0yIoJ|*!nf)JrBHw|DzNzMK9aQC;J)Q{5K(*3 z9QPXWX=Y(O)QlR}zF7Vv`^m0*A0KHiWD=pdx^xNk$?r=81B0^-4F@wP)`zt5Y#Pi+ zTN@fWUqTS_iqpwtHDe(%xTjbQEr??TPj1-l_OgtHnKOlIx5 Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 234/394] icons: add filetype-icon for pictures Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58d25b5da28483dc8e0ba8f42fc4eea90338f724 Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - icons: add filetype-icon for pictures Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/icons.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 5cd2c2f03..cb2fec42d 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -101,6 +101,7 @@ #define NEUTRINO_ICON_LOCK_PASSIVE "lock_passive" #define NEUTRINO_ICON_HIDDEN "hidden" #define NEUTRINO_ICON_MOUNTED "mounted" +#define NEUTRINO_ICON_MOVIE "movie" #define NEUTRINO_ICON_MP3 "mp3" #define NEUTRINO_ICON_MULTIMEDIA "multimedia" #define NEUTRINO_ICON_MOVIEPLAYER "icon_movieplayer" From 90249adb92288eec54a19704b49edb68760eed4d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 235/394] file.cpp|h: port filetypes from TangoCash Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40241710410b00955be6fe0e2ed3f0cfd151bd1c Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - file.cpp|h: port filetypes from TangoCash ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/file.cpp | 14 +++++++------- src/driver/file.h | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/driver/file.cpp b/src/driver/file.cpp index ce4c809f5..87904bb7f 100644 --- a/src/driver/file.cpp +++ b/src/driver/file.cpp @@ -45,18 +45,18 @@ const char * const file_extension_list[] = "aac", "asf", "avi", "bin", "bmp", "cdr", "crw", "dts", "flac", "flv", "gif", "imu", "ipk", "iso", "jpeg", "jpg", "m2a", "m3u", "m3u8", "m4a", "mkv", "mp2", "mp3", - "mpa", "ogg", "opk", "pls", "png", "sh", - "txt", "url", "wav", "xml" + "mp4", "mpa", "mpeg", "mpg", "ogg", "opk", "pls", "png", "sh", + "ts", "txt", "url", "vob", "wav", "xml" }; /* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ const CFile::FileType file_type_list[] = { - CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_BIN_PACKAGE ,CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , - CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_FLV , CFile::FILE_PICTURE , CFile::STREAM_PICTURE , CFile::FILE_PKG_PACKAGE ,CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , - CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , - CFile::FILE_MP3 , CFile::FILE_OGG , CFile::FILE_PKG_PACKAGE, CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , - CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_WAV , CFile::FILE_XML + CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_BIN_PACKAGE , CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , + CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_MPG , CFile::FILE_PICTURE , CFile::STREAM_PICTURE , CFile::FILE_PKG_PACKAGE , CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , + CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , + CFile::FILE_MPG , CFile::FILE_MP3 , CFile::FILE_MPG , CFile::FILE_MPG , CFile::FILE_OGG , CFile::FILE_PKG_PACKAGE , CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , + CFile::FILE_TS , CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_VOB , CFile::FILE_WAV , CFile::FILE_XML }; int mycasecmp(const void * a, const void * b) diff --git a/src/driver/file.h b/src/driver/file.h index b26e52475..c71e3e37a 100644 --- a/src/driver/file.h +++ b/src/driver/file.h @@ -72,6 +72,9 @@ class CFile STREAM_AUDIO, FILE_PICTURE, STREAM_PICTURE, + FILE_VOB, + FILE_MPG, + FILE_TS, FILE_BIN_PACKAGE, FILE_PKG_PACKAGE }; From 8c7dcd10ac8fc6b034d921fe4b2db5ede8bd6409 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 236/394] filebrowser: port fileicon handling from TangoCash Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e49c326406253683027fe9e011dae1f72be7ee6b Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - filebrowser: port fileicon handling from TangoCash Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index feeb59004..444bb313b 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1230,6 +1230,15 @@ void CFileBrowser::paintItem(unsigned int pos) fileicon = NEUTRINO_ICON_PICTURE; break; + case CFile::FILE_AVI: + case CFile::FILE_ASF: + case CFile::FILE_MKV: + case CFile::FILE_VOB: + case CFile::FILE_MPG: + case CFile::FILE_TS: + fileicon = NEUTRINO_ICON_MOVIE; + break; + case CFile::FILE_TEXT: default: fileicon = NEUTRINO_ICON_FILE; From 1ff76f0de087a167e6ece1717a77cc59ee39cea8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 237/394] icons.h: sort filetype icons Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/535e4e2123421b0659c055b2ffa494fbe8ec0cfd Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - icons.h: sort filetype icons Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/icons.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index cb2fec42d..d1664d75c 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -91,8 +91,6 @@ #define NEUTRINO_ICON_EPGINFO "epginfo" #define NEUTRINO_ICON_ERROR "error" #define NEUTRINO_ICON_FEATURES "features" -#define NEUTRINO_ICON_FILE "file" -#define NEUTRINO_ICON_FOLDER "folder" #define NEUTRINO_ICON_GAMES "games" #define NEUTRINO_ICON_INFO "information" #define NEUTRINO_ICON_IMPORTANT "important" @@ -101,8 +99,6 @@ #define NEUTRINO_ICON_LOCK_PASSIVE "lock_passive" #define NEUTRINO_ICON_HIDDEN "hidden" #define NEUTRINO_ICON_MOUNTED "mounted" -#define NEUTRINO_ICON_MOVIE "movie" -#define NEUTRINO_ICON_MP3 "mp3" #define NEUTRINO_ICON_MULTIMEDIA "multimedia" #define NEUTRINO_ICON_MOVIEPLAYER "icon_movieplayer" #define NEUTRINO_ICON_NKPLAY "icon_nkplay" @@ -183,7 +179,6 @@ #define NEUTRINO_ICON_STAR_ON "star-on" #define NEUTRINO_ICON_STAR_OFF "star-off" #define NEUTRINO_ICON_TMDB "tmdb" -#define NEUTRINO_ICON_PICTURE "picture" #define DUMMY_ICON "dummy" @@ -261,6 +256,13 @@ #define NEUTRINO_ICON_HINT_RESTORE "hint_restore" #define NEUTRINO_ICON_HINT_FACTORY "hint_factory" +/* filetypes */ +#define NEUTRINO_ICON_FILE "file" +#define NEUTRINO_ICON_FOLDER "folder" +#define NEUTRINO_ICON_MOVIE "movie" +#define NEUTRINO_ICON_MP3 "mp3" +#define NEUTRINO_ICON_PICTURE "picture" + /* plugins */ #define NEUTRINO_ICON_HINT_PLUGIN "hint_plugin" From 3aad7a46d7bc4cb954bff3c915e696d4cd8053c6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 238/394] file.cpp|h: port filetypes handling from martii Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37e2efb3edfab7c09d8feaf29a90bcb56a61810c Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - file.cpp|h: port filetypes handling from martii Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/driver/file.cpp | 91 ++++++++++++++++++++++++++------------------- src/driver/file.h | 32 ++++++++-------- 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/driver/file.cpp b/src/driver/file.cpp index 87904bb7f..7e02bdf10 100644 --- a/src/driver/file.cpp +++ b/src/driver/file.cpp @@ -34,43 +34,65 @@ #include #endif /* HAVE_CONFIG_H */ -#include #include #include #include -/* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ -const char * const file_extension_list[] = -{ - "aac", "asf", "avi", "bin", "bmp", "cdr", "crw", - "dts", "flac", "flv", "gif", "imu", "ipk", "iso", "jpeg", "jpg", - "m2a", "m3u", "m3u8", "m4a", "mkv", "mp2", "mp3", - "mp4", "mpa", "mpeg", "mpg", "ogg", "opk", "pls", "png", "sh", - "ts", "txt", "url", "vob", "wav", "xml" +struct file_ext_s { + const char *ext; + const CFile::FileType type; }; -/* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ -const CFile::FileType file_type_list[] = +// ATTENTION: the array MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! +static const file_ext_s file_ext[] = { - CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_BIN_PACKAGE , CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , - CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_MPG , CFile::FILE_PICTURE , CFile::STREAM_PICTURE , CFile::FILE_PKG_PACKAGE , CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , - CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , - CFile::FILE_MPG , CFile::FILE_MP3 , CFile::FILE_MPG , CFile::FILE_MPG , CFile::FILE_OGG , CFile::FILE_PKG_PACKAGE , CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , - CFile::FILE_TS , CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_VOB , CFile::FILE_WAV , CFile::FILE_XML + { "aac", CFile::FILE_AAC }, + { "asf", CFile::FILE_ASF }, + { "avi", CFile::FILE_AVI }, + { "bin", CFile::FILE_BIN_PACKAGE }, + { "bmp", CFile::FILE_PICTURE }, + { "cdr", CFile::FILE_CDR }, + { "crw", CFile::FILE_PICTURE }, + { "dts", CFile::FILE_WAV }, + { "flac", CFile::FILE_FLAC }, + { "flv", CFile::FILE_MPG }, + { "gif", CFile::FILE_PICTURE }, + { "imu", CFile::STREAM_PICTURE }, + { "ipk", CFile::FILE_PKG_PACKAGE }, + { "iso", CFile::FILE_ISO }, + { "jpeg", CFile::FILE_PICTURE }, + { "jpg", CFile::FILE_PICTURE }, + { "m2a", CFile::FILE_MP3 }, + { "m3u", CFile::FILE_PLAYLIST }, + { "m3u8", CFile::FILE_PLAYLIST }, + { "m4a", CFile::FILE_AAC }, + { "mkv", CFile::FILE_MKV }, + { "mp2", CFile::FILE_MP3 }, + { "mp3", CFile::FILE_MP3 }, + { "mp4", CFile::FILE_MPG }, + { "mpa", CFile::FILE_MP3 }, + { "mpeg", CFile::FILE_MPG }, + { "mpg", CFile::FILE_MPG }, + { "ogg", CFile::FILE_OGG }, + { "opk", CFile::FILE_PKG_PACKAGE }, + { "pls", CFile::FILE_PLAYLIST }, + { "png", CFile::FILE_PICTURE }, + { "sh", CFile::FILE_TEXT }, + { "ts", CFile::FILE_TS }, + { "txt", CFile::FILE_TEXT }, + { "url", CFile::STREAM_AUDIO }, + { "vob", CFile::FILE_VOB }, + { "wav", CFile::FILE_WAV }, + { "xml", CFile::FILE_XML } }; int mycasecmp(const void * a, const void * b) { - return strcasecmp(*(const char * *)a, *(const char * *)b); + return strcasecmp(((file_ext_s *)a)->ext, ((file_ext_s *)b)->ext); } -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -CFile::CFile() - : Size( 0 ), Mode( 0 ), Marked( false ), Time( 0 ) +CFile::CFile() : Size( 0 ), Mode( 0 ), Marked( false ), Time( 0 ) { - Type = -1; } CFile::FileType CFile::getType(void) const @@ -78,24 +100,17 @@ CFile::FileType CFile::getType(void) const if(S_ISDIR(Mode)) return FILE_DIR; - if (Type < 0) { - Type = (int) FILE_UNKNOWN; - std::string::size_type ext_pos = Name.rfind('.'); + std::string::size_type ext_pos = Name.rfind('.'); - if (ext_pos != std::string::npos) { - const char * key = &(Name.c_str()[ext_pos + 1]); - - void * result = ::bsearch(&key, file_extension_list, sizeof(file_extension_list) / sizeof(const char *), sizeof(const char *), mycasecmp); - - if (result != NULL) - Type = (int) file_type_list[(const char * *)result - (const char * *)&file_extension_list]; - } + if (ext_pos != std::string::npos) { + const char * key = &(Name.c_str()[ext_pos + 1]); + void * result = ::bsearch(&key, file_ext, sizeof(file_ext) / sizeof(file_ext_s), sizeof(file_ext_s), mycasecmp); + if (result) + return ((file_ext_s *)result)->type; } - return (CFile::FileType) Type; + return FILE_UNKNOWN; } -//------------------------------------------------------------------------ - std::string CFile::getFileName(void) const // return name.extension or folder name without trailing / { std::string::size_type namepos = Name.rfind('/'); @@ -103,8 +118,6 @@ std::string CFile::getFileName(void) const // return name.extension or folder n return (namepos == std::string::npos) ? Name : Name.substr(namepos + 1); } -//------------------------------------------------------------------------ - std::string CFile::getPath(void) const // return complete path including trailing / { int pos = 0; diff --git a/src/driver/file.h b/src/driver/file.h index c71e3e37a..9a3be6167 100644 --- a/src/driver/file.h +++ b/src/driver/file.h @@ -55,28 +55,28 @@ class CFile { FILE_UNKNOWN = 0, FILE_AAC, - FILE_AVI, FILE_ASF, - FILE_DIR, - FILE_ISO, - FILE_TEXT, + FILE_AVI, + FILE_BIN_PACKAGE, FILE_CDR, - FILE_MP3, - FILE_MKV, - FILE_OGG, - FILE_WAV, + FILE_DIR, FILE_FLAC, FILE_FLV, - FILE_XML, - FILE_PLAYLIST, - STREAM_AUDIO, - FILE_PICTURE, - STREAM_PICTURE, - FILE_VOB, + FILE_ISO, + FILE_MKV, + FILE_MP3, FILE_MPG, + FILE_OGG, + FILE_PICTURE, + FILE_PKG_PACKAGE, + FILE_PLAYLIST, + FILE_TEXT, FILE_TS, - FILE_BIN_PACKAGE, - FILE_PKG_PACKAGE + FILE_VOB, + FILE_WAV, + FILE_XML, + STREAM_AUDIO, + STREAM_PICTURE }; FileType getType(void) const; From f3e4e995531feaff383e61ef3f4c814f43f3deff Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 239/394] epgplus: fix possible segfault (thx dbo) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/866f5c37b8b7ddb2064831acea9488442a6ef502 Author: TangoCash Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ -epgplus: fix possible segfault (thx dbo) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 7d554df79..f740daafc 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1383,6 +1383,8 @@ void EpgPlus::hide() if (this->header->head) { this->header->head->kill(); + delete this->header->head; + this->header->head = NULL; } this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); } From 1409e2b7547154a810a84a3d0a0063f24d718796 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 240/394] Followscreenings: add enumeration for a better readability Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/141d198b291b578d5db0fc2d0439010ea8180bbd Author: Thilo Graf Date: 2017-06-07 (Wed, 07 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/followscreenings.cpp | 2 +- src/gui/followscreenings.h | 6 ++++++ src/gui/record_setup.cpp | 8 ++++++++ src/neutrino.cpp | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index 2ee471fd6..9f33be0a7 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -67,7 +67,7 @@ CChannelEventList *CFollowScreenings::getFollowScreenings(void) continue; followlist.push_back(*e); - if (followlist.size() == 1 && !g_settings.timer_followscreenings) + if (followlist.size() == 1 && g_settings.timer_followscreenings == FOLLOWSCREENINGS_OFF) break; } } diff --git a/src/gui/followscreenings.h b/src/gui/followscreenings.h index 53e362e3e..d24d39171 100644 --- a/src/gui/followscreenings.h +++ b/src/gui/followscreenings.h @@ -59,6 +59,12 @@ class CFollowScreenings : public CMenuTarget std::vector forwarders; void updateRightIcon(int i, time_t start, unsigned int duration); public: + enum + { + FOLLOWSCREENINGS_OFF = 0, + FOLLOWSCREENINGS_ON = 1, + }; + CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0, unsigned char Apids=TIMERD_APIDS_STD, bool Safety=false, std::string RecDir="", CChannelEventList *Evtlist=NULL) : CMenuTarget () { this->channel_id = Channel_id; diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 00cd52f39..4213ecf21 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -41,6 +41,7 @@ #include "record_setup.h" #include +#include #include #include @@ -173,6 +174,13 @@ const CMenuOptionChooser::keyval END_OF_RECORDING[END_OF_RECORDING_COUNT] = {1, LOCALE_RECORDINGMENU_END_OF_RECORDING_EPG} }; +const CMenuOptionChooser::keyval timer_followscreenings_options[] = +{ + {CFollowScreenings::FOLLOWSCREENINGS_OFF ,LOCALE_OPTIONS_OFF }, + {CFollowScreenings::FOLLOWSCREENINGS_ON ,LOCALE_OPTIONS_ON } +}; +size_t timer_followscreenings_options_count = sizeof(timer_followscreenings_options)/sizeof(CMenuOptionChooser::keyval); + int CRecordSetup::showRecordSetup() { CMenuForwarder * mf; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6a41d2944..e629a685f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -77,6 +77,7 @@ #include "gui/eventlist.h" #include "gui/favorites.h" #include "gui/filebrowser.h" +#include "gui/followscreenings.h" #include "gui/hdd_menu.h" #include "gui/infoviewer.h" #include "gui/mediaplayer.h" @@ -500,7 +501,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.timer_remotebox_ip.push_back(timer_rb); } } - g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", 1 ); + g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", CFollowScreenings::FOLLOWSCREENINGS_ON ); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); From b06b9394b7545a5b78a645a7fed9404efe97784b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 241/394] set threadnames to unique values Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5307e62506128b41cd6635ef6a138bfe21fd925f Author: Stefan Seyfried Date: 2017-06-07 (Wed, 07 Jun 2017) ------------------ This commit was generated by Migit --- src/driver/radiotext.cpp | 2 ++ src/driver/screenshot.cpp | 2 ++ src/driver/streamts.cpp | 4 ++++ src/eitd/sectionsd.cpp | 6 +++++- src/nhttpd/yhttpd.cpp | 4 ++-- src/zapit/src/scan.cpp | 2 ++ src/zapit/src/scanbat.cpp | 2 ++ src/zapit/src/scannit.cpp | 2 ++ src/zapit/src/zapit.cpp | 3 +++ 9 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 80eae7e1a..28f1c8186 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -79,6 +79,7 @@ #include #include +#include #include #include @@ -2369,6 +2370,7 @@ void CRadioText::setPid(uint inPid) void CRadioText::run() { + set_threadname("n:radiotext"); uint current_pid = 0; printf("CRadioText::run: ###################### Starting thread ######################\n"); diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 7818795e3..c965f3117 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -46,6 +46,7 @@ #include #include #include +#include extern "C" { #include @@ -162,6 +163,7 @@ void CScreenShot::cleanupThread(void *arg) /* start ::run in new thread to save file in selected format */ bool CScreenShot::Start() { + set_threadname("n:screenshot"); bool ret = false; if (GetData()) ret = startThread(); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 9d23e25fc..ee9438cce 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,6 +56,8 @@ #include #include #include +#include + #include #include @@ -181,6 +183,7 @@ bool CStreamInstance::Open() void CStreamInstance::run() { printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); + set_threadname("n:streaminstance"); /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); @@ -556,6 +559,7 @@ void CStreamManager::run() int poll_timeout = -1; printf("Starting STREAM thread keeper, tid %ld\n", syscall(__NR_gettid)); + set_threadname("n:streammanager"); while (running) { mutex.lock(); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index b7443d575..e5619d321 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1428,7 +1428,8 @@ void CTimeThread::run() { time_t dvb_time = 0; xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); - + const char *tn = ("sd:" + name).c_str(); + set_threadname(tn); addFilters(); DMX::start(); @@ -1542,6 +1543,8 @@ int CSectionThread::Sleep() void CSectionThread::run() { xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); + const char *tn = ("sd:" + name).c_str(); + set_threadname(tn); if (sections_debug) dump_sched_info(name); @@ -2220,6 +2223,7 @@ void CEitManager::run() int rc; xprintf("[sectionsd] starting\n"); + set_threadname("sd:eitmanager"); printf("SIevent size: %d\n", (int)sizeof(SIevent)); /* "export NO_SLOW_ADDEVENT=true" to disable this */ diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index cddc90e01..93e6a66e6 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -120,7 +120,7 @@ void thread_cleanup (void *p) #ifndef Y_CONFIG_BUILD_AS_DAEMON void * nhttpd_main_thread(void *) { - set_threadname(__func__); + set_threadname("yweb:main_thread"); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); @@ -338,7 +338,7 @@ bool Cyhttpd::Configure() { // Main Webserver call //----------------------------------------------------------------------------- void Cyhttpd::run() { - set_threadname(__func__); + set_threadname("yweb:run"); if (webserver) { if (flag_threading_off) webserver->is_threading = false; diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 29d59eea8..d078ed4b8 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -36,6 +36,7 @@ #include #include #include +#include //#define USE_BAT @@ -96,6 +97,7 @@ bool CServiceScan::Stop() void CServiceScan::run() { + set_threadname("zap:servicescan"); running = true; CleanAllMaps(); diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index 01d655599..49e731568 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #define DEBUG_BAT #define DEBUG_BAT_UNUSED @@ -68,6 +69,7 @@ bool CBat::Stop() void CBat::run() { + set_threadname("zap:bat"); if(Parse()) printf("[scan] BAT finished.\n"); else diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index dc47c6686..cb7a81b0b 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -29,6 +29,7 @@ #include #include #include +#include //#define DEBUG_NIT //#define DEBUG_NIT_UNUSED @@ -65,6 +66,7 @@ bool CNit::Stop() void CNit::run() { + set_threadname("zap:nit"); if(Parse()) printf("[scan] NIT finished.\n"); else diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index da0b6eaa8..92d7929d7 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -70,6 +70,7 @@ #endif #include +#include #include #include #include @@ -2489,6 +2490,7 @@ static bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd) void CZapit::run() { + set_threadname("zap:main"); printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); abort_zapit = 0; @@ -2661,6 +2663,7 @@ void CZapitSdtMonitor::run() t_satellite_position satellitePosition = 0; freq_id_t freq = 0; transponder_id_t tpid = 0; + set_threadname("zap:sdtmonitor"); //tstart = time(0); sdt_tp.clear(); From f84ef5014b0303bb32e088a5aa847ed5cd759299 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 242/394] bouquetlist: fix calculation of footerwidth wrong font was used Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f2cae79b1caa5918bb307ad15c081e4101b9b87e Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - bouquetlist: fix calculation of footerwidth wrong font was used Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 4a5b6c9a0..3ad6b4038 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -413,7 +413,7 @@ int CBouquetList::show(bool bShowChannelList) for (unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); count++) { - int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); + int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); w_max_icon = std::max(w_max_icon, icol_w); From 8d55020df7398efa96022cba9ee8d6c38bce78cb Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 7 Jun 2017 14:19:11 +0200 Subject: [PATCH 243/394] configure.ac: bump revision to 3.5.0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/45f915dd390a68dc0fc702185e6d94bf5d156611 Author: Michael Liebmann Date: 2017-06-07 (Wed, 07 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1863e8f80..603853065 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(Tuxbox-Neutrino,3.4.2) +AC_INIT(Tuxbox-Neutrino,3.5.0) AM_INIT_AUTOMAKE([1.0.1 nostdinc]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) From f10bd199a98ed326351b943bbae688d6d065d4e1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Jun 2017 14:50:52 +0200 Subject: [PATCH 244/394] record-setup: use new timer_followscreenings_options struct in item Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a79a96efd6e6be5fe3978f9f18886e4953878207 Author: vanhofen Date: 2017-06-07 (Wed, 07 Jun 2017) Origin message was: ------------------ - record-setup: use new timer_followscreenings_options struct in item ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/record_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 4213ecf21..49ed97d86 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -350,7 +350,7 @@ void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) menu_timersettings->addItem(GenericMenuSeparatorLine); //allow followscreenings - CMenuOptionChooser* followscreenings = new CMenuOptionChooser(LOCALE_TIMERSETTINGS_FOLLOWSCREENINGS, &g_settings.timer_followscreenings, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + CMenuOptionChooser* followscreenings = new CMenuOptionChooser(LOCALE_TIMERSETTINGS_FOLLOWSCREENINGS, &g_settings.timer_followscreenings, timer_followscreenings_options, timer_followscreenings_options_count, true); followscreenings->setHint("", LOCALE_MENU_HINT_TIMER_FOLLOWSCREENINGS); menu_timersettings->addItem(followscreenings); } From ab03a37a9aaa6f0db29813c18b40e3dfb1a819da Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 6 Jun 2017 16:08:29 +0200 Subject: [PATCH 245/394] filebrowser: fix total_pages calculation for CComponentsScrollBar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/628e8ea3e4b1e66a115190defbc12efa1a587d57 Author: vanhofen Date: 2017-06-06 (Tue, 06 Jun 2017) Origin message was: ------------------ - filebrowser: fix total_pages calculation for CComponentsScrollBar ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 444bb313b..6e877060d 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1472,7 +1472,7 @@ void CFileBrowser::paint() paintItem(count); //scrollbar - int total_pages = ((filelist.size() - 1) / listmaxshow) + 1; + int total_pages = filelist.size() == 0 ? 1 : ((filelist.size() - 1) / listmaxshow) + 1; int current_page = (selected / listmaxshow); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); From d9224e10509ef141ad96b62fb96ee64aab5e14e7 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 11 Jun 2017 20:00:33 +0200 Subject: [PATCH 246/394] src/gui/movieplayer.cpp fix possible segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cca6526b2f2f7415841c6aa698a8c221a26962bd Author: Jacek Jendrzej Date: 2017-06-11 (Sun, 11 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d108e5473..5ecc32a27 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -923,7 +923,7 @@ bool CMoviePlayerGui::selectLivestream(std::vector &streamLis #endif bool resIO = false; - while (1) { + while (!streamList.empty()) { size_t i; for (i = 0; i < streamList.size(); ++i) { _info = &(streamList[i]); From cb942044f34cce8846fc86c868e8b535843a6f0f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 13 Jun 2017 13:34:17 +0200 Subject: [PATCH 247/394] src/driver/pictureviewer/pictureviewer.cpp add bufferram and cached to calc freemem Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f0a1bfdf25ba4f489d5e738940fab66ec1a5d61 Author: Jacek Jendrzej Date: 2017-06-13 (Tue, 13 Jun 2017) Origin message was: ------------------ src/driver/pictureviewer/pictureviewer.cpp add bufferram and cached to calc freemem ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index f93779996..6c4ed8f42 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -854,12 +854,38 @@ unsigned char * CPictureViewer::ResizeA(unsigned char *orgin, int ox, int oy, in return int_Resize(orgin, ox, oy, dx, dy, COLOR, NULL, true); } +static size_t getCachedMemSize(void) +{ + FILE *procmeminfo = fopen("/proc/meminfo", "r"); + size_t cached = 0; + if (procmeminfo) { + char buf[80] = {0}, a[80] = {0}; + size_t v = 0; + while (fgets(buf, sizeof(buf), procmeminfo)) { + char unit[10]; + *unit = 0; + if ((3 == sscanf(buf, "%[^:]: %llu %s", a, &v, unit)) + || (2 == sscanf(buf, "%[^:]: %llu", a, &v))) { + if (*unit == 'k') + v <<= 10; + if (!strcasecmp(a, "Cached")){ + cached = v; + break; + } + } + } + fclose(procmeminfo); + } + return cached; +} + bool CPictureViewer::checkfreemem(size_t bufsize) { struct sysinfo info; sysinfo( &info ); - if(bufsize + 4096 > (size_t)info.freeram + (size_t)info.freeswap){ - dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory: need %zu > free %zu\n", __func__, __LINE__,bufsize,(size_t)info.freeram + (size_t)info.freeswap); + size_t cached = getCachedMemSize(); + if(bufsize + sysconf(_SC_PAGESIZE) > (size_t)info.freeram + (size_t)info.freeswap + (size_t)info.bufferram + cached){ + dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory: need %zu > free %zu\n", __func__, __LINE__,bufsize,(size_t)info.freeram + (size_t)info.freeswap + (size_t)info.bufferram + cached); return false; } return true; From b740521d7fac40cc5cd6d62f7ebb91cbf69f2089 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 13 Jun 2017 14:23:56 +0200 Subject: [PATCH 248/394] supplement to cb942044f34cce8846fc86c868e8b535843a6f0f Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/30b1c3f286e7b634f6f17b79838285ca24a94b31 Author: Jacek Jendrzej Date: 2017-06-13 (Tue, 13 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 6c4ed8f42..f3a1a03a0 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -860,7 +860,7 @@ static size_t getCachedMemSize(void) size_t cached = 0; if (procmeminfo) { char buf[80] = {0}, a[80] = {0}; - size_t v = 0; + long long unsigned int v = 0; while (fgets(buf, sizeof(buf), procmeminfo)) { char unit[10]; *unit = 0; From b31221c2097529dd371c5148022fa2d621643094 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 13 Jun 2017 14:30:37 +0200 Subject: [PATCH 249/394] 2 supplement to cb942044f34cce8846fc86c868e8b535843a6f0f Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/85cff28f07a7e7e36db210f80b3b63a585577ca6 Author: Jacek Jendrzej Date: 2017-06-13 (Tue, 13 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index f3a1a03a0..90947fe39 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -860,12 +860,12 @@ static size_t getCachedMemSize(void) size_t cached = 0; if (procmeminfo) { char buf[80] = {0}, a[80] = {0}; - long long unsigned int v = 0; + size_t v = 0; while (fgets(buf, sizeof(buf), procmeminfo)) { char unit[10]; *unit = 0; - if ((3 == sscanf(buf, "%[^:]: %llu %s", a, &v, unit)) - || (2 == sscanf(buf, "%[^:]: %llu", a, &v))) { + if ((3 == sscanf(buf, "%[^:]: %zu %s", a, &v, unit)) + || (2 == sscanf(buf, "%[^:]: %zu", a, &v))) { if (*unit == 'k') v <<= 10; if (!strcasecmp(a, "Cached")){ From 2e738f08030d38cf0eb3546d83b3923482b7663e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 250/394] CComponentsInfoBox: fix image y pos Image was not centered, because of frame was not considered. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e2c5cb939ab2f73e68db112ea7559163e2afc55 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_infobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index bc41347b0..92835ade6 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -124,7 +124,7 @@ void CComponentsInfoBox::paintPicture() pic->doPaintBg(false); //fit icon into frame - pic->setYPos(y_pic+(height/2-pic->getHeight()/2)); + pic->setYPos(y_pic+(height-2*fr_thickness)/2-pic->getHeight()/2); //paint, but set visibility mode pic->allowPaint(cc_allow_paint); From 7e3920a42e04acdfc227298605c7751ce7bfe176 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 251/394] CCButtonSelect: outsource button select handling into own class Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d753d7437f73c1a8b2e222fb85e729cef6850c8 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/Makefile.am | 1 + src/gui/components/cc_button_select.cpp | 74 ++++++++++++++++++++++ src/gui/components/cc_button_select.h | 81 +++++++++++++++++++++++++ src/gui/components/cc_frm.h | 2 +- src/gui/components/cc_frm_footer.cpp | 42 +------------ src/gui/components/cc_frm_footer.h | 47 ++------------ src/gui/components/cc_types.h | 1 + 7 files changed, 165 insertions(+), 83 deletions(-) create mode 100644 src/gui/components/cc_button_select.cpp create mode 100644 src/gui/components/cc_button_select.h diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am index 0089ac8a1..e43158b13 100644 --- a/src/gui/components/Makefile.am +++ b/src/gui/components/Makefile.am @@ -18,6 +18,7 @@ noinst_LIBRARIES = libneutrino_gui_components.a libneutrino_gui_components_a_SOURCES = \ cc_base.cpp \ + cc_button_select.cpp \ cc_detailsline.cpp \ cc_draw.cpp \ cc_extra.cpp \ diff --git a/src/gui/components/cc_button_select.cpp b/src/gui/components/cc_button_select.cpp new file mode 100644 index 000000000..95dfcbefc --- /dev/null +++ b/src/gui/components/cc_button_select.cpp @@ -0,0 +1,74 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2017, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "config.h" +#include "cc_button_select.h" + +CCButtonSelect::CCButtonSelect(CComponentsFrmChain *chain_obj) +{ + chain = chain_obj; +} + +CComponentsFrmChain* CCButtonSelect::getButtonChainObject() +{ + return chain; +} + +CComponentsButton* CCButtonSelect::getSelectedButtonObject() +{ + CComponentsButton* ret = static_cast(chain->getSelectedItemObject()); + return ret; +} + +int CCButtonSelect::getSelectedButton() +{ + if (chain) + return chain->getSelectedItem(); + return -1; +} + +void CCButtonSelect::setSelectedButton(size_t item_id, + const fb_pixel_t& fr_col, + const fb_pixel_t& sel_fr_col, + const fb_pixel_t& bg_col, + const fb_pixel_t& sel_bg_col, + const fb_pixel_t& text_col, + const fb_pixel_t& sel_text_col, + const int& frame_width, + const int& sel_frame_width) +{ + if (chain){ + for (size_t i= 0; i< chain->size(); i++){ + CComponentsButton *btn = static_cast(chain->getCCItem(i)); + btn->setButtonTextColor(text_col); + } + fb_pixel_t sel_col = fr_col; + if (chain->size() > 1) + sel_col = sel_fr_col; //TODO: make it configurable + chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); + + getSelectedButtonObject()->setButtonTextColor(sel_text_col); + } +} + + diff --git a/src/gui/components/cc_button_select.h b/src/gui/components/cc_button_select.h new file mode 100644 index 000000000..c122e1479 --- /dev/null +++ b/src/gui/components/cc_button_select.h @@ -0,0 +1,81 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2017, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __CC_BTN_SEL_H__ +#define __CC_BTN_SEL_H__ + + +#include "cc_frm_button.h" + +/*! +Class for inheritation of button select handling inside other CComponentsForm objects and their derivations +*/ +class CCButtonSelect +{ + protected: + CComponentsFrmChain *chain; + + public: + CCButtonSelect(CComponentsFrmChain *chain_obj = NULL); + + ///returns selected button object, return value as pointer to object, NULL means nothing is selected + CComponentsButton* getSelectedButtonObject(); + + ///returns pointer to internal button container + CComponentsFrmChain* getButtonChainObject(); + + ///returns id of select button, return value as int, -1 = nothing is selected + int getSelectedButton(); + + /**Select a definied button inside button chain object + * @param[in] item_id + * @li optional: expects type size_t + * @param[in] fr_col + * @li optional: expects type fb_pixel_t, as default frame color + * @param[in] sel_fr_col + * @li optional: expects type fb_pixel_t, as selected frame color + * @param[in] bg_col + * @li optional: expects type fb_pixel_t, as default background color + * @param[in] sel_bg_col + * @li optional: expects type fb_pixel_t, as selected background color + * @param[in] text_col + * @li optional: expects type fb_pixel_t, as default text color + * @param[in] sel_text_col + * @li optional: expects type fb_pixel_t, as selected text color + * @param[in] frame_width + * @li optional: expects type int, default = 1 + * @param[in] sel_frame_width + * @li optional: expects type int, default = 1 + */ + void setSelectedButton(size_t item_id, + const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, + const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& text_col = COL_MENUCONTENT_TEXT, + const fb_pixel_t& sel_text_col = COL_MENUCONTENTSELECTED_TEXT, + const int& frame_width = 1, + const int& sel_frame_width = 1); +}; + +#endif //__CC_BTN_SEL_H__ diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index f1aba0a9c..0b7b74401 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -28,7 +28,7 @@ #include "config.h" #include "cc_base.h" #include "cc_item.h" -#include "cc_frm_scrollbar.h" + class CComponentsForm : public CComponentsItem { diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 3532e05f3..31fc2c5c9 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -35,7 +35,7 @@ using namespace std; //------------------------------------------------------------------------------------------------------- //sub class CComponentsFooter inherit from CComponentsHeader -CComponentsFooter::CComponentsFooter(CComponentsForm* parent) +CComponentsFooter::CComponentsFooter(CComponentsForm* parent):CCButtonSelect() { //CComponentsFooter initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0); @@ -47,7 +47,7 @@ CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int shadow_mode, fb_pixel_t color_frame, fb_pixel_t color_body, - fb_pixel_t color_shadow ) + fb_pixel_t color_shadow ):CCButtonSelect() { //CComponentsFooter initVarFooter(x_pos, y_pos, w, h, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); @@ -95,7 +95,6 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const corner_type = CORNER_BOTTOM; ccf_enable_button_bg = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment - chain = NULL; addContextButton(buttons); initCCItems(); @@ -323,43 +322,6 @@ void CComponentsFooter::enableButtonBg(bool enable) } } -void CComponentsFooter::setSelectedButton(size_t item_id, - const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, - const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, - const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col, - const int& frame_width, - const int& sel_frame_width) -{ - if (chain){ - for (size_t i= 0; i< chain->size(); i++){ - CComponentsButton *btn = static_cast(chain->getCCItem(i)); - btn->setButtonTextColor(text_col); - } - fb_pixel_t sel_col = fr_col; - if (chain->size() > 1) - sel_col = sel_fr_col; //TODO: make it configurable - chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); - - getSelectedButtonObject()->setButtonTextColor(sel_text_col); - } -} - -int CComponentsFooter::getSelectedButton() -{ - int ret = -1; - if (chain) - ret = chain->getSelectedItem(); - - return ret; -} - -CComponentsButton* CComponentsFooter::getSelectedButtonObject() -{ - CComponentsButton* ret = static_cast(chain->getSelectedItemObject()); - return ret; -} - - void CComponentsFooter::paintButtons(const int& x_pos, const int& y_pos, const int& w, diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 852faaae1..2586d1772 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -26,6 +26,8 @@ #include "cc_frm_header.h" #include "cc_frm_button.h" +#include "cc_button_select.h" + #include #include //for compatibility with 'button_label' type @@ -39,7 +41,7 @@ to add button labels known by older button handler, to find in gui/widget/button functionality. Why limited ?: old parameter 'struct button_label' doesn't provide newer parameters. Missing parameters are filled with default values and must be assigned afterward, if required. */ -class CComponentsFooter : public CComponentsHeader +class CComponentsFooter : public CComponentsHeader, public CCButtonSelect { private: void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -67,9 +69,6 @@ class CComponentsFooter : public CComponentsHeader ///init default fonts for size modes virtual void initDefaultFonts(); - ///container for button objects - CComponentsFrmChain *chain; - public: CComponentsFooter(CComponentsForm *parent = NULL); CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, @@ -114,40 +113,6 @@ class CComponentsFooter : public CComponentsHeader ///disables background of buttons void disableButtonBg(){enableButtonBg(false);} - /**Select a definied button inside button chain object - * @param[in] item_id - * @li optional: exepts type size_t - * @param[in] fr_col - * @li optional: exepts type fb_pixel_t, as default frame color - * @param[in] sel_fr_col - * @li optional: exepts type fb_pixel_t, as selected frame color - * @param[in] bg_col - * @li optional: exepts type fb_pixel_t, as default background color - * @param[in] sel_bg_col - * @li optional: exepts type fb_pixel_t, as selected background color - * @param[in] text_col - * @li optional: exepts type fb_pixel_t, as default text color - * @param[in] sel_text_col - * @li optional: exepts type fb_pixel_t, as selected text color - * @param[in] frame_width - * @li optional: exepts type int, default = 1 - * @param[in] sel_frame_width - * @li optional: exepts type int, default = 2 - */ - void setSelectedButton(size_t item_id, - const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, - const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0, - const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& text_col = COL_MENUCONTENT_TEXT, - const fb_pixel_t& sel_text_col = COL_MENUCONTENTSELECTED_TEXT, - const int& frame_width = 1, - const int& sel_frame_width = 1); - ///returns id of select button, return value as int, -1 = nothing is selected - int getSelectedButton(); - ///returns selected button object, return value as pointer to object, NULL means nothing is selected - CComponentsButton* getSelectedButtonObject(); - /*! Sets a new text to an already predefined button. 1st parameter 'btn_id' accepts current id of an already defined button. 2nd parameter sets the new text as std::string @@ -164,10 +129,6 @@ class CComponentsFooter : public CComponentsHeader ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font void setButtonFont(Font* font){ccf_btn_font = font;}; - ///returns pointer to internal button container - CComponentsFrmChain* getButtonChainObject(){return chain;}; - - ///this is a nearly methode similar with the older button handler find in gui/widget/buttons.h, some parameters are different, but require minimalized input ///this member sets some basic parameters and will paint concurrently on execute, explicit call of paint() is not required void paintButtons( const int& x_pos, @@ -196,4 +157,6 @@ class CComponentsFooter : public CComponentsHeader void disbaleButtonShadow(){enableButtonShadow(CC_SHADOW_OFF);} }; + + #endif diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 1db5ed7aa..e24f5cc03 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -34,6 +34,7 @@ struct gradientData_t; class Font; class CComponentsForm; class CComponentsScrollBar; +class CCButtonSelect; ///cc item types typedef enum From f9d5aa4ee69720c919cb457d18fd7dd479ca8121 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 252/394] CCButtonSelect: rename chain to btn_container more plausible name Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4146a461c1d98c733a7a15ebf91f3fb586531577 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_button_select.cpp | 22 +++++----- src/gui/components/cc_button_select.h | 4 +- src/gui/components/cc_frm_footer.cpp | 58 ++++++++++++------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/gui/components/cc_button_select.cpp b/src/gui/components/cc_button_select.cpp index 95dfcbefc..ea373f3c7 100644 --- a/src/gui/components/cc_button_select.cpp +++ b/src/gui/components/cc_button_select.cpp @@ -24,26 +24,26 @@ #include "config.h" #include "cc_button_select.h" -CCButtonSelect::CCButtonSelect(CComponentsFrmChain *chain_obj) +CCButtonSelect::CCButtonSelect() { - chain = chain_obj; + btn_container = NULL; } CComponentsFrmChain* CCButtonSelect::getButtonChainObject() { - return chain; + return btn_container; } CComponentsButton* CCButtonSelect::getSelectedButtonObject() { - CComponentsButton* ret = static_cast(chain->getSelectedItemObject()); + CComponentsButton* ret = static_cast(btn_container->getSelectedItemObject()); return ret; } int CCButtonSelect::getSelectedButton() { - if (chain) - return chain->getSelectedItem(); + if (btn_container) + return btn_container->getSelectedItem(); return -1; } @@ -57,15 +57,15 @@ void CCButtonSelect::setSelectedButton(size_t item_id, const int& frame_width, const int& sel_frame_width) { - if (chain){ - for (size_t i= 0; i< chain->size(); i++){ - CComponentsButton *btn = static_cast(chain->getCCItem(i)); + if (btn_container){ + for (size_t i= 0; i< btn_container->size(); i++){ + CComponentsButton *btn = static_cast(btn_container->getCCItem(i)); btn->setButtonTextColor(text_col); } fb_pixel_t sel_col = fr_col; - if (chain->size() > 1) + if (btn_container->size() > 1) sel_col = sel_fr_col; //TODO: make it configurable - chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); + btn_container->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); getSelectedButtonObject()->setButtonTextColor(sel_text_col); } diff --git a/src/gui/components/cc_button_select.h b/src/gui/components/cc_button_select.h index c122e1479..ecf35b8dc 100644 --- a/src/gui/components/cc_button_select.h +++ b/src/gui/components/cc_button_select.h @@ -33,10 +33,10 @@ Class for inheritation of button select handling inside other CComponentsForm ob class CCButtonSelect { protected: - CComponentsFrmChain *chain; + CComponentsFrmChain *btn_container; public: - CCButtonSelect(CComponentsFrmChain *chain_obj = NULL); + CCButtonSelect(); ///returns selected button object, return value as pointer to object, NULL means nothing is selected CComponentsButton* getSelectedButtonObject(); diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 31fc2c5c9..74b48d754 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -107,8 +107,8 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) { /* clean up before init*/ - if (chain) - chain->clear(); + if (btn_container) + btn_container->clear(); if (label_count == 0) return; @@ -149,11 +149,11 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con int y_chain = height/2 - h_chain/2; if (cch_icon_obj) x_chain = cch_offset+cch_icon_obj->getWidth()+cch_offset; - if (chain == NULL){ - chain = new CComponentsFrmChain(x_chain, y_chain, w_chain, h_chain, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, col_body); - chain->setAppendOffset(0, 0); - chain->setCorner(this->corner_rad, this->corner_type); - chain->doPaintBg(false); + if (btn_container == NULL){ + btn_container = new CComponentsFrmChain(x_chain, y_chain, w_chain, h_chain, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, col_body); + btn_container->setAppendOffset(0, 0); + btn_container->setCorner(this->corner_rad, this->corner_type); + btn_container->doPaintBg(false); } /* Calculate usable width of button labels inside button object container @@ -165,11 +165,11 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con * button objects itself. */ int w_offset = int((label_count-1)*cch_offset); - int w_btn = chain->getWidth()/label_count - w_offset; + int w_btn = btn_container->getWidth()/label_count - w_offset; if (label_width){ int w_label = label_width; int w_defined = int(label_width*label_count); - int w_max = chain->getWidth() - w_offset; + int w_max = btn_container->getWidth() - w_offset; while (w_defined > w_max){ w_label--; w_defined = int(w_label*label_count) - w_offset; @@ -181,7 +181,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con * with default width to chain object. */ vector v_btns; - int h_btn = /*(ccf_enable_button_bg ? */chain->getHeight()-2*fr_thickness/*-OFFSET_INNER_SMALL*//* : height)*/-ccf_button_shadow_width; + int h_btn = /*(ccf_enable_button_bg ? */btn_container->getHeight()-2*fr_thickness/*-OFFSET_INNER_SMALL*//* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ string txt = content[i].locale == NONEXISTANT_LOCALE ? content[i].text : g_Locale->getText(content[i].locale); string icon_name = string(content[i].button); @@ -192,7 +192,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con continue; } - int y_btn = chain->getHeight()/2 - h_btn/2; + int y_btn = btn_container->getHeight()/2 - h_btn/2; dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] y_btn [%d] ccf_button_shadow_width [%d]\n", __func__, __LINE__, y_btn, ccf_button_shadow_width); CComponentsButton *btn = new CComponentsButton(0, y_btn, w_btn, h_btn, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); @@ -223,27 +223,27 @@ 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, chain->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(), i, btn->getWidth(), w_btn, btn_container->getWidth()); } /* add generated button objects to chain object. */ if (!v_btns.empty()){ /*add all buttons into button container*/ - chain->addCCItem(v_btns); + btn_container->addCCItem(v_btns); /* set position of labels, as centered inside button container*/ int w_chain_used = 0; - for (size_t a= 0; a< chain->size(); a++) - w_chain_used += chain->getCCItem(a)->getWidth(); - w_chain_used += (chain->size()-1)*cch_offset; + for (size_t a= 0; a< btn_container->size(); a++) + w_chain_used += btn_container->getCCItem(a)->getWidth(); + w_chain_used += (btn_container->size()-1)*cch_offset; - int x_btn = chain->getWidth()/2 - w_chain_used/2; - chain->getCCItem(0)->setXPos(x_btn); + int x_btn = btn_container->getWidth()/2 - w_chain_used/2; + btn_container->getCCItem(0)->setXPos(x_btn); - for (size_t c= 1; c< chain->size(); c++){ - x_btn += chain->getCCItem(c-1)->getWidth()+ cch_offset; - chain->getCCItem(c)->setXPos(x_btn); + for (size_t c= 1; c< btn_container->size(); c++){ + x_btn += btn_container->getCCItem(c-1)->getWidth()+ cch_offset; + btn_container->getCCItem(c)->setXPos(x_btn); } } } @@ -316,9 +316,9 @@ void CComponentsFooter::setButtonLabel( const char *button_icon, void CComponentsFooter::enableButtonBg(bool enable) { ccf_enable_button_bg = enable; - if (chain) { - for (size_t i= 0; i< chain->size(); i++) - chain->getCCItem(i)->doPaintBg(ccf_enable_button_bg); + if (btn_container) { + for (size_t i= 0; i< btn_container->size(); i++) + btn_container->getCCItem(i)->doPaintBg(ccf_enable_button_bg); } } @@ -357,12 +357,12 @@ void CComponentsFooter::enableButtonShadow(int mode, const int& shadow_width, bo ccf_enable_button_shadow = mode; ccf_button_shadow_width = shadow_width; ccf_button_shadow_force_paint = force_paint; - if (chain){ - for(size_t i=0; isize(); i++){ - chain->getCCItem(i)->enableShadow(ccf_enable_button_shadow, ccf_button_shadow_width, ccf_button_shadow_force_paint); + if (btn_container){ + for(size_t i=0; isize(); i++){ + btn_container->getCCItem(i)->enableShadow(ccf_enable_button_shadow, ccf_button_shadow_width, ccf_button_shadow_force_paint); //int y_btn = ccf_enable_button_shadow == CC_SHADOW_OFF ? CC_CENTERED : chain->getHeight()/2 - chain->getCCItem(i)->getHeight()/2 - ccf_button_shadow_width; - int y_btn = chain->getHeight()/2 - chain->getCCItem(i)->getHeight()/2; - chain->getCCItem(i)->setYPos(y_btn); + int y_btn = btn_container->getHeight()/2 - btn_container->getCCItem(i)->getHeight()/2; + btn_container->getCCItem(i)->setYPos(y_btn); } } } From 37a15282dcc930c8517342ab5584397a20d05645 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 253/394] CCButtonSelect: select button objects only Other types are not required. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c4976bb132ec791dc0d69ffb63023a0347ea60d8 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_button_select.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_button_select.cpp b/src/gui/components/cc_button_select.cpp index ea373f3c7..cb396d7cb 100644 --- a/src/gui/components/cc_button_select.cpp +++ b/src/gui/components/cc_button_select.cpp @@ -23,6 +23,7 @@ #include "config.h" #include "cc_button_select.h" +#include CCButtonSelect::CCButtonSelect() { @@ -57,11 +58,18 @@ void CCButtonSelect::setSelectedButton(size_t item_id, const int& frame_width, const int& sel_frame_width) { + CComponentsButton *btn = NULL; if (btn_container){ for (size_t i= 0; i< btn_container->size(); i++){ - CComponentsButton *btn = static_cast(btn_container->getCCItem(i)); - btn->setButtonTextColor(text_col); + CComponentsItem *item = btn_container->getCCItem(i); + if (item->getItemType() >= CC_ITEMTYPE_BUTTON && item->getItemType() <= CC_ITEMTYPE_BUTTON_BLUE){ + btn = static_cast(item); + btn->setButtonTextColor(text_col); + } } + if (!btn) + dprintf(DEBUG_NORMAL, "\033[33m[CCButtonSelect]\t[%s - %d], no button object found...\033[0m\n", __func__, __LINE__); + fb_pixel_t sel_col = fr_col; if (btn_container->size() > 1) sel_col = sel_fr_col; //TODO: make it configurable From e87854a95ff406bf44e0dfd257eeca30332fdf44 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 254/394] CChannelList: add instance check for header clock object Only for sure. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/340a6992a18349baa6816a3ccb1420bc346ca3fd Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 755e19707..5cb0eff49 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2143,7 +2143,8 @@ void CChannelList::paintHead() header->removeContextButtons(); header->enableClock(true, "%H:%M", "%H %M", true); - header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); + if (header->getClockObject()) + header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); }else{ if (header->getClockObject()){ header->disableClock(); From 48e82d6dac3059d03c99f32cf9e4a41ba600dab7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 255/394] CComponentsHeader: remove virtual declararion from getClockObject() Not required. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86af640fae3d82149c7970f5f2de97231ca70c5d Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ CComponentsHeader: remove virtual declararion from getClockObject() Not required. ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index e26d28ff2..29f8b8315 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -302,7 +302,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT } ///returns the clock object - virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;} + CComponentsFrmClock* getClockObject(){return cch_cl_obj;} ///enable display of clock, parameter bool enable, const char* format, bool run virtual void enableClock(bool enable = true, const char* format = "%H:%M", const char* sec_format_str = NULL, bool run = false); From 2aeab995a77c2af17f86eecf6fdd20b8779f2789 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 256/394] CComponentsForm: remove extra item declaration Remove instances from vector only for sure. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0066430b77644f0daab75abe4b76ad9961554c28 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 430423045..33dd15c94 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -185,11 +185,10 @@ void CComponentsForm::clear() return; for(size_t i=0; igetItemType(), item); - delete item; - item = NULL; + if (v_cc_items[i]){ + dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\taddress = %p\n", __func__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i]->getItemType(), v_cc_items[i]); + delete v_cc_items[i]; + v_cc_items[i] = NULL; } } v_cc_items.clear(); From 038b4e36e40fb9473ab81b4bb56779c0bbb98d3e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 257/394] CProgressBar/CComponentsInfoBox: add missing value inits Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a7f7ab5a6ce029bcdd87a087dc69ec818862ad4 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_infobox.cpp | 8 ++++---- src/gui/components/cc_item_progressbar.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 92835ade6..2dccb9820 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -51,10 +51,10 @@ CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, { cc_item_type = CC_ITEMTYPE_TEXT_INFOBOX; - x = x_pos; - y = y_pos; - width = w; - height = h; + x = x_old = x_pos; + y = y_old = y_pos; + width = width_old = w; + height = height_old = h; shadow = shadow_mode; col_frame = color_frame; cc_enable_frame = true; diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index 1613f4eb4..570bb0de9 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -57,10 +57,10 @@ CProgressBar::CProgressBar( const int x_pos, cc_item_type = CC_ITEMTYPE_PROGRESSBAR; //CComponents - x = x_pos; - y = y_pos; - width = w; - height = h; + x = x_old = x_pos; + y = y_old = y_pos; + width = width_old = w; + height = height_old = h; col_frame = color_frame; col_body = color_body; From a652c229aa941a2042d5357b092b8fa8844b32fe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 258/394] CComponentsFrmClock: ensure clean timer instance For safety only. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/08e610859f6b73f1fb5b2db4b9079e025a2e3dcd Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 46d4781df..1beb3d70f 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -112,8 +112,9 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, CComponentsFrmClock::~CComponentsFrmClock() { - if (cl_timer) - delete cl_timer; + if (cl_timer){ + delete cl_timer; cl_timer = NULL; + } } void CComponentsFrmClock::initClockFont(int dx, int dy) From e3bd6e917dc7d76c1034dfa1a5d1e4f341ea4451 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 259/394] CProgressBarCache: ensure clean iterator inside pbcClear() For safety only. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5573d17cce9a9fbcc2952e6a0a5607ca5cdf5478 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_progressbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index 570bb0de9..d3ea4831f 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -198,6 +198,7 @@ void CProgressBarCache::pbcClear() if ((*it)->pbc_passive) free((*it)->pbc_passive); delete (*it); + (*it) = NULL; } pbCache.clear(); } From 1e49b4ab61860b8600687ee9b1668e170a2c06e8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 260/394] FBFontRenderClass/CNeutrinoFonts: ensure reset of some instances Only for safety. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71d0c42a477cba6e63cc6dd7dc793852096ab318 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/driver/fontrenderer.cpp | 2 +- src/driver/neutrinofonts.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 375be1570..3a5e1e5ff 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -99,7 +99,7 @@ FBFontRenderClass::~FBFontRenderClass() for (fontListEntry * f = font; f; f = g) { g = f->next; - delete f; + delete f; f = NULL; } FTC_Manager_Done(cacheManager); diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 16fa1de89..64da5fe44 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -92,14 +92,18 @@ void CNeutrinoFonts::InitDynFonts() CNeutrinoFonts::~CNeutrinoFonts() { if (!v_share_fonts.empty()) { - for (unsigned int i = 0; i < v_share_fonts.size(); i++) + for (unsigned int i = 0; i < v_share_fonts.size(); i++){ delete v_share_fonts[i].font; + v_share_fonts[i].font = NULL; + } v_share_fonts.clear(); } if (!v_dyn_fonts.empty()) { - for (unsigned int i = 0; i < v_dyn_fonts.size(); i++) + for (unsigned int i = 0; i < v_dyn_fonts.size(); i++){ delete v_dyn_fonts[i].font; + v_dyn_fonts[i].font = NULL; + } v_dyn_fonts.clear(); } if (!vDynSize.empty()) { @@ -402,8 +406,10 @@ void CNeutrinoFonts::deleteDynFontExtAll() { if (!v_dyn_fonts_ext.empty()) { for (size_t i = 0; i < v_dyn_fonts_ext.size(); ++i) { - if (v_dyn_fonts_ext[i].font != NULL) + if (v_dyn_fonts_ext[i].font != NULL){ delete v_dyn_fonts_ext[i].font; + v_dyn_fonts_ext[i].font = NULL; + } } v_dyn_fonts_ext.clear(); } From 42d6c768fcfc43e4d6d20bbe09085658554f7ec0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 261/394] CEventList: Move channel name to left side Center place is reserved for logo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/14ea1c3a31bd349a18556d0bfabb0d225a7e641f Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 02f56f04a..9f575f516 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -888,7 +888,7 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s if (header->isPainted()) header->getChannelLogoObject()->hide(); header->setChannelLogo(_channel_id,_channelname); - header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_CENTER); + header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_LEFT); header->paint(CC_SAVE_SCREEN_NO); From 46c3f4d348556626eacae1e6180e70752fb7819e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 262/394] CComponentsText: make initCCText() Is more useful Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cdafe580bea1bfa1a78c60ae332d1834de1e6a3c Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 5e5d53d48..8f716dc0b 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -95,8 +95,6 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///destroy current CTextBox and CBox objects void clearCCText(); - ///initialize all required attributes for text and send to the CTextBox object - void initCCText(); ///init internal CBox object required by CTextBox object void initCBox(); @@ -164,6 +162,9 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///send option to CTextBox object to paint background box behind text or not virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;}; + ///initialize all required attributes for text and send to the CTextBox object + void initCCText(); + ///set text as string also possible with overloades members for loacales, const char and text file, returns true if text was changed virtual bool setText(const std::string& stext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR); ///set text with const char*, returns true if text was changed From 73a84ad4fa377cdf7253fad5711d766b9c8bef62 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:54 +0200 Subject: [PATCH 263/394] CtextBox: Precise function getLines() Use refreshTextLineArray() for calculation of lines. Note: count of lines will be only returned if CTextBox object is initialized with a valid CBox instance, otherwise count of 0 lines will be returned! also remove inline declaration, not needed here Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec83549e50c665dafe8fbc647d06182bf6ddb0f0 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 ++++++++++ src/gui/widget/textbox.h | 22 ++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 23ed96132..7a9e326b1 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -900,6 +900,16 @@ int CTextBox::getLines(const std::string& text) return count; } +int CTextBox::getLines() +{ + if (m_cText.empty()) + return 0; + + refreshTextLineArray(); + + return m_nNrOfLines; +} + int CTextBox::getMaxLineWidth(const std::string& text, Font* font) { std::string txt = text; diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index 0c182eaa8..5980985e5 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -164,7 +164,7 @@ class CTextBox : public sigc::trackable int text_Hborder_width; int text_Vborder_width; bool m_FontUseDigitHeight; - + public: /* Constructor */ CTextBox(); @@ -199,28 +199,30 @@ class CTextBox : public sigc::trackable void enableUTF8(bool enable = true){m_utf8_encoded = enable;} void disableUTF8(bool enable = false){enableUTF8(enable);} - inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; - inline CBox getWindowsPos(void) {return(m_cFrame);}; + bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; + CBox getWindowsPos(void) {return(m_cFrame);}; - inline int getLinesPerPage(void) {return m_nLinesPerPage;}; - inline int getPages(void) {return(m_nNrOfPages);}; - inline int getBackGroundRadius(void) {return(m_nBgRadius);}; + int getLinesPerPage(void) {return m_nLinesPerPage;}; + int getPages(void) {return(m_nNrOfPages);}; + int getBackGroundRadius(void) {return(m_nBgRadius);}; /** * Returns count of lines of a passed text. * @param[in] text - * @li exepts type std::string + * @li expects type std::string * @return count of lines as int * @see getLines() */ - static int getLines(const std::string& text); + static int getLines(const std::string& text); /** - * Returns count of evaluated lines from an existent CTextBox instance. + * Returns count of calculated lines from an existing CTextBox instance. * @return count of lines as int * @see static version getLines() + * @note Real count of lines will be only returned if CTextBox object is initialized with a valid CBox instance, \n + * otherwise count of 0 lines will be returned! */ - int getLines(){return(m_nNrOfLines);} + int getLines(); /** * Returns width of largest line from passed text From afcb78a5c4d1721d27dcaa915a4ddd18662bdd60 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 264/394] CLuaInstCCText: try to fix return value of CCTextGetLines() Init was missing. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b12952d8b1f1f4198e7b027569831acba5fab7f Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_text.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 4320eacbe..6f932f261 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 75 +#define LUA_API_VERSION_MINOR 76 diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 2cbaa45d3..3e2158e52 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -229,6 +229,7 @@ int CLuaInstCCText::CCTextGetLines(lua_State *L) } else { CTextBox* ctb = D->ct->getCTextBoxObject(); + D->ct->initCCText(); if (ctb) lines = (lua_Integer)ctb->getLines(); } From 9d69ed31b056775b4a40d831817bf8c22aa2f33a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 265/394] vfd-setup: fix brightness setup for CST's boxmodel "Link" ... and hide the brightness menu for all "Trinity" models. There's no display. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42958395267eab8523d37e85e279e1cc736decfb Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - vfd-setup: fix brightness setup for CST's boxmodel "Link" ... and hide the brightness menu for all "Trinity" models. There's no display. Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 6 +++--- lib/hardware/coolstream/hardware_caps.cpp | 2 ++ src/gui/vfd_setup.cpp | 6 +++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 94852a2b8..8da57980e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -884,7 +884,7 @@ languagesetup.select Sprache lcd_info_line Zeige in Infozeile lcd_info_line_channel Kanalname lcd_info_line_clock Uhrzeit -lcdcontroler.brightness normale +lcdcontroler.brightness Normalbetrieb lcdcontroler.brightnessdeepstandby Deep-Standby lcdcontroler.brightnessstandby Standby lcdmenu.dim_brightness nach Dimm-Timeout diff --git a/data/locale/english.locale b/data/locale/english.locale index 43ffeb429..d3e4788ea 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -884,9 +884,9 @@ languagesetup.select OSD Language lcd_info_line show in infoline lcd_info_line_channel Channelname lcd_info_line_clock clock -lcdcontroler.brightness normal Brightness -lcdcontroler.brightnessdeepstandby DeepStandby Brightness -lcdcontroler.brightnessstandby Standby Brightness +lcdcontroler.brightness Normal mode +lcdcontroler.brightnessdeepstandby Deep standby +lcdcontroler.brightnessstandby Standby lcdmenu.dim_brightness Brightness after dim timeout lcdmenu.dim_time Dim timeout lcdmenu.head VFD/LED Settings diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 865e8ccf5..e5af0e255 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -79,6 +79,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Trinity V2"); strcpy(caps.boxarch, "Kronos"); } + caps.can_set_display_brightness = 0; break; case 12: strcpy(caps.boxname, "Zee2"); @@ -91,6 +92,7 @@ hw_caps_t *get_hwcaps(void) { case 14: strcpy(caps.boxname, "Trinity Duo"); strcpy(caps.boxarch, "Kronos"); + caps.can_set_display_brightness = 0; break; default: strcpy(caps.boxname, "UNKNOWN_BOX"); diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index b4e3a053f..f4c600a32 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -126,12 +126,16 @@ int CVfdSetup::showSetup() vfds->addItem(mf); } - if (CVFD::getInstance()->has_lcd) { + if (g_info.hw_caps->can_set_display_brightness) + { //vfd brightness menu mf = new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, this, "brightness", CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS_SETUP); vfds->addItem(mf); + } + if (CVFD::getInstance()->has_lcd) + { if (cs_get_revision() == 9) // Tank only { //backlight menu From 48b11b6a8554a0f28e61f84394036123564f23f0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 266/394] volumebar: use OFFSET defines; fix height of progressbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4dffefcc21a31d7f78de4e79e3f23be43ebff21e Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - volumebar: use OFFSET defines; fix height of progressbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 1c79b22fa..6205ee322 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -92,7 +92,7 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = CFrameBuffer::getInstance()->scale2Res(200); - vb_pbh = height-4*vb_item_offset; + vb_pbh = height-2*vb_item_offset; //result for width width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2; @@ -112,8 +112,6 @@ void CVolumeBar::initVolumeBarSize() mute_corrY = (height - mute_dy) / 2; cvh->setMuteIconCorrY(mute_corrY); - vb_pbh = height-8; - vb_pby = height/2-vb_pbh/2; } @@ -267,8 +265,8 @@ void CVolumeBar::paint(bool do_save_bg) CVolumeHelper::CVolumeHelper() { - h_spacer = 11; - v_spacer = 6; + h_spacer = OFFSET_INNER_MID; + v_spacer = OFFSET_INNER_SMALL; vb_font = NULL; clock_font = NULL; @@ -359,8 +357,8 @@ void CVolumeHelper::initVolBarSize() digit_width = 0; frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_width, &icon_height); icon_height = max(icon_height, 16); // if no icon available - icon_height += 2; - icon_width += 8; + icon_height += OFFSET_INNER_MIN; + icon_width += OFFSET_INNER_MID; g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = CFrameBuffer::getInstance()->scale2Res(g_settings.volume_size); @@ -370,7 +368,7 @@ void CVolumeHelper::initVolBarSize() int tmp_h = vol_height; digit_width = 0; vb_font = cnf->getDynFont(digit_width, tmp_h, "100", CNeutrinoFonts::FONT_STYLE_REGULAR, CNeutrinoFonts::FONT_ID_VOLBAR); - digit_width += 6; + digit_width += OFFSET_INNER_SMALL; vol_height = max(vol_height, tmp_h); } } From 90af43f37f61368fd006d6b9edea1b3165c568a2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 267/394] icon: add missing pictureviewer icon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d78e132ba27a4f9066167268a868713e22d985b6 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/headers/Makefile.am | 1 + data/icons/headers/pictureviewer.png | Bin 0 -> 1290 bytes src/gui/widget/icons.h | 1 + 3 files changed, 2 insertions(+) create mode 100755 data/icons/headers/pictureviewer.png diff --git a/data/icons/headers/Makefile.am b/data/icons/headers/Makefile.am index b56c38768..faf172967 100644 --- a/data/icons/headers/Makefile.am +++ b/data/icons/headers/Makefile.am @@ -20,6 +20,7 @@ install_DATA = \ multimedia.png \ network.png \ personalize.png \ + pictureviewer.png \ recording.png \ settings.png \ shell.png \ diff --git a/data/icons/headers/pictureviewer.png b/data/icons/headers/pictureviewer.png new file mode 100755 index 0000000000000000000000000000000000000000..9f4414adf4a26851b38a06d16d4ac90294f45af8 GIT binary patch literal 1290 zcmV+l1@-!gP)3$w6g~I7H~Z^s(9YI{(ozgeOq2pqUMR zi3GKTelyUe>E=W%o0znYKf}%DhK}Nyi>_VD0ZQ6?L<=Z{( zy)~S3r=0BM1xvlmCW-t37eejHEJz~7#K>^PI?!)wVRdXZ8Ppn<`V16LE>z1;@#!uL zDKLm4adUegO?+Y~4iy!wi4x>{+?6|zVe;KFKxhMO5?CdozsH3@!*Ga_2&>f!hdB=Z z;g?}ZX@D`LgUe=xsm+NhpA{A1bhPm+}(9nID4T+y0F@BN@h zAQ)z)o%H&m5vVA6>Ar)NpLwnqZD6~jnwt9zu$e;ahlYHucDQPjS*2D{yu%5}phBg~ z%WM{?aF&_V9i!;VsUxu5>fwDgx%7TxT%^DEhG+eP;V3U&5hci3RqU=TEr!i-0Jj@m zNOQH|Vy_9hyE4Yy7zT|_i$rHUh6qMzLv;pT01uZN4GDDI+$Jfx!ZlL0org49xp!vl`^A} zAVC*aM;dHV8k{)P3HcWlOkEn7)CTCUhj3y`8>Y|DV%^RZTxpaC{e!}6C(1rq6m>9X z?H3;Ri6$160nWI57#4303(C9&^&0$W?c=^=JvrOL$g3L(Ta1OZKBgp#ldqSAsQ8Q# z=WiMLfvpgUSI@NL&_{Vu2Xof#@p#HxSrJRI{yHR7x!F`Nl3v>aZ*P!&soCjVK=HLO#-(Q=dEQubc8EApKNfyL{KH+8Kh=!A z@6L<%AouNqp5kviA5ziVbOl#S^I6o%ls@BCXoh7%SvVXFM{p0}AB>kxGNN?z?5Kl< z?|kjqb*|?j5I0_c&Uc(Utj~~X#1!0HxP5_vWPeJq_-O-nZ_JJoEZTa+z57D%V2|M- zMtt`I#;2%IZ+Z@Av{kMo{Xqj>#{HIaL;=Ws<)b2ksN$$>sPS+Yfe5>L&2g+#q&;FkQI z62-}c1=-UJNu^R*0)c?@-(0P~dP?r5NB`*m3Q Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 268/394] test_menu: avoid usage of CORNER_RADIUS defines; use RADIUS instead ... because the RADIUS defines depends on user's corner settings Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/15257194721c33b6fb7c349b300b15fe550c5ed1 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - test_menu: avoid usage of CORNER_RADIUS defines; use RADIUS instead ... because the RADIUS defines depends on user's corner settings Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 9f6637d6b..f5edf226d 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -1031,7 +1031,7 @@ void CTestMenu::showRecords() recline->doPaintBg(true); recline->setColorBody(COL_INFOBAR_PLUS_0); recline->enableShadow(CC_SHADOW_ON, w_shadow); - recline->setCorner(CORNER_RADIUS_MID); + recline->setCorner(RADIUS_MID); recordsbox->addCCItem(recline); CComponentsPicture *iconf = new CComponentsPicture(OFFSET_INNER_MID, CC_CENTERED, NEUTRINO_ICON_REC, recline, CC_SHADOW_OFF, COL_RED, COL_INFOBAR_PLUS_0); From 750211ec999a1f1a404a28f2bdccb2e6aae15f34 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 269/394] settings.h: use CORNER_RADIUS_NONE defines ... to determinate RADIUS defines Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7ce3dbf4c2b2070a3b0e6864605a1621389c2a3 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - settings.h: use CORNER_RADIUS_NONE defines ... to determinate RADIUS defines Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/system/settings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/system/settings.h b/src/system/settings.h index 352e45d33..34de4f54f 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -921,10 +921,10 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define CORNER_RADIUS_MIN CFrameBuffer::getInstance()->scale2Res(3) #define CORNER_RADIUS_NONE 0 -#define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : 0) -#define RADIUS_MID (g_settings.rounded_corners ? CORNER_RADIUS_MID : 0) -#define RADIUS_SMALL (g_settings.rounded_corners ? CORNER_RADIUS_SMALL : 0) -#define RADIUS_MIN (g_settings.rounded_corners ? CORNER_RADIUS_MIN : 0) +#define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : CORNER_RADIUS_NONE) +#define RADIUS_MID (g_settings.rounded_corners ? CORNER_RADIUS_MID : CORNER_RADIUS_NONE) +#define RADIUS_SMALL (g_settings.rounded_corners ? CORNER_RADIUS_SMALL : CORNER_RADIUS_NONE) +#define RADIUS_MIN (g_settings.rounded_corners ? CORNER_RADIUS_MIN : CORNER_RADIUS_NONE) #define RADIUS_NONE 0 // offsets From fd52e89afb1ec59262827d50061e8fce9cbe64cc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 270/394] menue: replace last fixed values ... ... with OFFSET defines and scale2Res()-calculations Signed-off-by: Thilo Graf - removed TODO for height of hint calculation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c783a5c50a24ea02724667d14a9dc8dddd28a94 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - menue: replace last fixed values ... ... with OFFSET defines and scale2Res()-calculations Signed-off-by: Thilo Graf - removed TODO for height of hint calculation ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 75 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 807c26442..ef4905cf3 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -78,7 +78,7 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I x = -1; used = false; - icon_frame_w = 10; + icon_frame_w = OFFSET_INNER_MID; hint = NONEXISTANT_LOCALE; name = NONEXISTANT_LOCALE; nameString = ""; @@ -249,7 +249,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text stringstartposOption = name_start_x; if (right_bgcol) { if (!*right_text) - stringstartposOption -= 60; + stringstartposOption -= CFrameBuffer::getInstance()->scale2Res(60); fb_pixel_t right_frame_col, right_bg_col; if (active) { right_bg_col = right_bgcol; @@ -270,7 +270,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text } } if (desc_text && *desc_text) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->RenderString(name_start_x + 10, y+ item_height, _dx- 10 - (name_start_x - x), desc_text, item_color); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->RenderString(name_start_x + OFFSET_INNER_MID, y+ item_height, _dx- OFFSET_INNER_MID - (name_start_x - x), desc_text, item_color); } void CMenuItem::prepareItem(const bool select_mode, const int &item_height) @@ -296,7 +296,7 @@ void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, } int stringwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text); - int maxspace = dx - stringwidth - icon_frame_w - stringwidth2 - 10; + int maxspace = dx - stringwidth - icon_frame_w - stringwidth2 - OFFSET_INNER_MID; if(maxspace < slider_lenght) return ; @@ -379,7 +379,7 @@ void CMenuItem::paintItemButton(const bool select_mode, int item_height, const c if (icon_w>0 && icon_h>0) { - frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); + frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 2*OFFSET_INNER_MID), y+ ((item_height/2- icon_h/2)) ); } } } @@ -1122,14 +1122,13 @@ void CMenuWidget::calcSize() } hint_height = 0; if(g_settings.show_menu_hints && has_hints) { - hint_height = frameBuffer->scale2Res(60); //TODO: rework calculation of hint_height - int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); - int h_tmp = OFFSET_INNER_LARGE + 2*fheight; + int lines = 2; + int text_height = 2*OFFSET_INNER_MID + lines*g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); /* assuming all hint icons has the same size ! */ - int iw, ih; - frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &iw, &ih); - h_tmp = std::max(h_tmp, ih+OFFSET_INNER_MID); - hint_height = std::max(h_tmp, hint_height); + int icon_width, icon_height; + frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &icon_width, &icon_height); + icon_height += 2*OFFSET_INNER_MID; + hint_height = std::max(icon_height, text_height); } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */ @@ -1197,7 +1196,7 @@ void CMenuWidget::calcSize() * + center_offset for symmetry * + 20 for setMenuPos calculates 10 pixels border left and right */ int center_offset = (g_settings.menu_pos == MENU_POS_CENTER) ? DETAILSLINE_WIDTH : 0; - int max_possible = (int)frameBuffer->getScreenWidth() - DETAILSLINE_WIDTH - center_offset - 20; + int max_possible = (int)frameBuffer->getScreenWidth() - DETAILSLINE_WIDTH - center_offset - 2*OFFSET_INNER_MID; if (full_width > max_possible) { width = max_possible - sb_width - OFFSET_SHADOW; @@ -1241,7 +1240,7 @@ void CMenuWidget::paint() if (header == NULL){ header = new CComponentsHeader(x, y, width + sb_width, hheight, getName(), iconfile); header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); - header->setOffset(10); + header->setOffset(OFFSET_INNER_MID); } header->setCaption(getName()); header->setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); @@ -1281,25 +1280,25 @@ void CMenuWidget::setMenuPos(const int& menu_width) break; case MENU_POS_TOP_LEFT: - y = offy + scr_y + 10; - x = offx + scr_x + 10; + y = offy + scr_y + OFFSET_INNER_MID; + x = offx + scr_x + OFFSET_INNER_MID; x += DETAILSLINE_WIDTH; break; case MENU_POS_TOP_RIGHT: - y = offy + scr_y + 10; - x = /*offx +*/ scr_x + scr_w - menu_width - 10; + y = offy + scr_y + OFFSET_INNER_MID; + x = /*offx +*/ scr_x + scr_w - menu_width - OFFSET_INNER_MID; break; case MENU_POS_BOTTOM_LEFT: - y = /*offy +*/ scr_y + scr_h - real_h - 10; - x = offx + scr_x + 10; + y = /*offy +*/ scr_y + scr_h - real_h - OFFSET_INNER_MID; + x = offx + scr_x + OFFSET_INNER_MID; x += DETAILSLINE_WIDTH; break; case MENU_POS_BOTTOM_RIGHT: - y = /*offy +*/ scr_y + scr_h - real_h - 10; - x = /*offx +*/ scr_x + scr_w - menu_width - 10; + y = /*offy +*/ scr_y + scr_h - real_h - OFFSET_INNER_MID; + x = /*offx +*/ scr_x + scr_w - menu_width - OFFSET_INNER_MID; break; } if (x_old != x || y_old != y) @@ -1696,11 +1695,11 @@ int CMenuOptionNumberChooser::getWidth(void) width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0"); } - width += 10; /* min 10 pixels between option name and value. enough? */ + width += OFFSET_INNER_MID; /* min 10 pixels between option name and value. enough? */ const char *desc_text = getDescription(); if (*desc_text) - width = std::max(width, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); + width = std::max(width, OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); return width; } @@ -2022,10 +2021,10 @@ int CMenuOptionChooser::getWidth(void) width = tw + ow; } - width += 10; /* min 10 pixels between option name and value. enough? */ + width += OFFSET_INNER_MID; /* min 10 pixels between option name and value. enough? */ const char *desc_text = getDescription(); if (*desc_text) - width = std::max(width, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); + width = std::max(width, OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); return width; } @@ -2215,13 +2214,13 @@ int CMenuForwarder::getWidth(void) bgcol = jumpTarget->getColor(); if (!option_name.empty()) - tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_name); + tw += OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_name); else if (bgcol) - tw += 10 + 60; + tw += OFFSET_INNER_MID + CFrameBuffer::getInstance()->scale2Res(60); const char *desc_text = getDescription(); if (*desc_text) - tw = std::max(tw, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); + tw = std::max(tw, OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); return tw; } @@ -2280,7 +2279,7 @@ CMenuSeparator::CMenuSeparator(const int Type, const std::string &Text, bool IsS int CMenuSeparator::getHeight(void) { if (nameString.empty() && name == NONEXISTANT_LOCALE) - return 10; + return OFFSET_INNER_MID; return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); } @@ -2288,7 +2287,7 @@ int CMenuSeparator::getWidth(void) { int w = 0; if (type & LINE) - w = 30; /* 15 pixel left and right */ + w = 2*OFFSET_INNER_MID; /* offset left and right */ const char *l_name = getName(); if ((type & STRING) && *l_name) w += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); @@ -2315,7 +2314,7 @@ int CMenuSeparator::paint(bool selected) if ((type & LINE)) { int grad = g_settings.theme.menu_Separator_gradient_enable ? CC_COLGRAD_COL_DARK_LIGHT_DARK : CC_COLGRAD_OFF; - paintBoxRel(x+10, y+(height>>1), dx-20, 2, COL_MENUCONTENT_PLUS_3, 0, CORNER_NONE, grad, COL_MENUCONTENT_PLUS_0, CFrameBuffer::gradientHorizontal, CColorGradient::light); + paintBoxRel(x+OFFSET_INNER_MID, y+(height>>1), dx-2*OFFSET_INNER_MID, 1, COL_MENUCONTENT_PLUS_1, 0, CORNER_NONE, grad, COL_MENUCONTENT_PLUS_0, CFrameBuffer::gradientHorizontal, CColorGradient::light); } if ((type & STRING)) { @@ -2323,17 +2322,19 @@ int CMenuSeparator::paint(bool selected) if (*l_name) { - int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); // UTF-8 + int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); + int iconwidth, iconheight; + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_HOME, &iconwidth, &iconheight); /* if no alignment is specified, align centered */ if (type & ALIGN_LEFT) - name_start_x = x + (!(type & SUB_HEAD) ? name_start_x : 20 + 24 /*std icon_width is 24px - this should be determinated from NEUTRINO_ICON_BUTTON_HOME or so*/); + name_start_x = x + (!(type & SUB_HEAD) ? name_start_x : 2*OFFSET_INNER_MID + iconwidth); else if (type & ALIGN_RIGHT) - name_start_x = x + dx - stringwidth - 20; + name_start_x = x + dx - stringwidth - 2*OFFSET_INNER_MID; else /* ALIGN_CENTER */ name_start_x = x + (dx >> 1) - (stringwidth >> 1); - frameBuffer->paintBoxRel(name_start_x-5, y, stringwidth+10, height, item_bgcolor); + frameBuffer->paintBoxRel(name_start_x-OFFSET_INNER_SMALL, y, stringwidth+2*OFFSET_INNER_SMALL, height, item_bgcolor); paintItemCaption(selected); } @@ -2458,7 +2459,7 @@ int CMenuProgressbar::getWidth(void) { int width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); if (width) - width += 10; + width += OFFSET_INNER_MID; return width + scale.getWidth(); } From c708c24454ec346d659728926e012e88d877acf3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 271/394] pictureviewer: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1a2143c68b523bb9c8d84d4801ccd8425f26be98 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - pictureviewer: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/pictureviewer.cpp | 57 +++++++++++++++++---------------------- src/gui/pictureviewer.h | 10 +++---- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 1dc102dca..6fde49fb9 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -162,19 +162,19 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + item_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - //get footerHeight from paintButtons - buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - footerHeight = buttons1Height + buttons2Height; + //get footer_height from paintButtons + buttons1_height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); + buttons2_height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); + footer_height = buttons1_height + buttons2_height; - listmaxshow = (height-theight-footerHeight)/(fheight); - height = theight+listmaxshow*fheight+footerHeight; // recalc height + listmaxshow = (height - header_height - footer_height)/item_height; + height = header_height + listmaxshow*item_height + footer_height; // recalc height - x=getScreenStartX( width ); - y=getScreenStartY( height ); + x=getScreenStartX(width); + y=getScreenStartY(height); m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); @@ -660,7 +660,7 @@ void CPictureViewerGui::hide() void CPictureViewerGui::paintItem(int pos) { // printf("paintItem{\n"); - int ypos = y+ theight + 0 + pos*fheight; + int ypos = y + header_height + pos*item_height; unsigned int currpos = liststart + pos; @@ -678,8 +678,8 @@ void CPictureViewerGui::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width - 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width - 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if (currpos < playlist.size()) { @@ -690,8 +690,8 @@ void CPictureViewerGui::paintItem(int pos) char timestring[18]; strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[currpos].Date)); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(timestring); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, width-30 - w, tmp, color, fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+width-20-w,ypos+fheight, w, timestring, color, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, ypos + item_height, width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - w, tmp, color, item_height); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + item_height, w, timestring, color, item_height); } // printf("paintItem}\n"); @@ -701,7 +701,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_MP3, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); #ifdef ENABLE_GUI_MOUNT header.setContextButton(NEUTRINO_ICON_BUTTON_MENU); @@ -719,15 +719,15 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + (height - footer_height), width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { - ::paintButtons(x, y + (height - footerHeight), 0, PictureViewerButtons1Count, PictureViewerButtons1, width); - ::paintButtons(x, y + (height - buttons2Height), 0, PictureViewerButtons2Count, PictureViewerButtons2, width); + ::paintButtons(x, y + (height - footer_height), 0, PictureViewerButtons1Count, PictureViewerButtons1, width); + ::paintButtons(x, y + (height - buttons2_height), 0, PictureViewerButtons2Count, PictureViewerButtons2, width); } else - ::paintButtons(x, y + (height - footerHeight), 0, 1, &(PictureViewerButtons1[1]), width); + ::paintButtons(x, y + (height - footer_height), 0, 1, &(PictureViewerButtons1[1]), width); } //------------------------------------------------------------------------ @@ -748,19 +748,12 @@ void CPictureViewerGui::paint() paintItem(count); } - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); + //scrollbar + int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero + int total_pages = playlist.size() == 0 ? 1 : ((playlist.size() - 1) / _listmaxshow) + 1; + int current_page = selected / _listmaxshow; - unsigned int tmp_max = listmaxshow; - if(!tmp_max) - tmp_max = 1; - int sbc= ((playlist.size()- 1)/ tmp_max)+ 1; - int sbs= (selected/tmp_max); - if (sbc < 1) - sbc = 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); paintFoot(); paintInfo(); diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 6e89ccbcd..70b38fd16 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -74,11 +74,11 @@ class CPictureViewerGui : public CMenuTarget unsigned int selected; unsigned int liststart; unsigned int listmaxshow; - int fheight; // Fonthoehe Playlist-Inhalt - int theight; // Fonthoehe Playlist-Titel - int footerHeight; - int buttons1Height; - int buttons2Height; + int item_height; + int header_height; + int footer_height; + int buttons1_height; + int buttons2_height; bool visible; State m_state; SortOrder m_sort; From c7e763aa610abf80aedcd12cc936074c0b3db06b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 272/394] locale: minor changes in audioplayer's and pictureviewer's locales Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddb027a0065ba3af5d8fb06dc931c9d04c256455 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - locale: minor changes in audioplayer's and pictureviewer's locales Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 10 +++--- data/locale/english.locale | 68 +++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 8da57980e..d6fa786d8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -162,8 +162,8 @@ audioplayer.artist_title Interpret, Titel audioplayer.building_search_index Erstelle Suchindex audioplayer.button_select_title_by_id Suche n. ID audioplayer.button_select_title_by_name Suche n. Name -audioplayer.defdir Start-Verz. -audioplayer.delete entfernen +audioplayer.defdir Start-Verzeichnis +audioplayer.delete Entfernen audioplayer.deleteall Alle entfernen audioplayer.display_order Anzeige audioplayer.enable_sc_metadata Aktiviere SHOUTcast Meta-Daten Parsing @@ -2021,7 +2021,7 @@ personalize.usermenu_plugin_types Anzuzeigende Plugin-Typen wählen personalize.usermenu_preferred_buttons Bevorzugte Tasten zuweisen personalize.usermenu_show_cancel Zeige Schalter "Abbrechen" personalize.visible sichtbar -pictureviewer.defdir Start-Verz. +pictureviewer.defdir Start-Verzeichnis pictureviewer.head Bildbetrachter pictureviewer.help1 Menü-Modus pictureviewer.help10 Bild neu einlesen @@ -2055,8 +2055,8 @@ pictureviewer.scaling Skalierung pictureviewer.show Anzeigen pictureviewer.slide_time Diaschau-Anzeigedauer pictureviewer.slideshow Diaschau -pictureviewer.sortorder.date Sortierreihenf. ändern (Datum) -pictureviewer.sortorder.filename Sortierreihenf. ändern (Dateiname) +pictureviewer.sortorder.date Sortierreihenfolge: Datum +pictureviewer.sortorder.filename Sortierreihenfolge: Dateiname ping.ok ist erreichbar (ping) ping.protocol ist nicht erreichbar (Host- oder Protokoll-Fehler) ping.socket ist nicht erreichbar (Socket-Fehler) diff --git a/data/locale/english.locale b/data/locale/english.locale index d3e4788ea..11e584539 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -159,46 +159,46 @@ audioplayer.add_ic Icecast audioplayer.add_loc Local radio list audioplayer.add_sc SHOUTcast audioplayer.artist_title Artist, Title -audioplayer.building_search_index building search index -audioplayer.button_select_title_by_id search by ID -audioplayer.button_select_title_by_name search by name -audioplayer.defdir start dir. +audioplayer.building_search_index Building search index +audioplayer.button_select_title_by_id Search by ID +audioplayer.button_select_title_by_name Search by name +audioplayer.defdir Start directory audioplayer.delete Remove -audioplayer.deleteall remove all -audioplayer.display_order display order -audioplayer.enable_sc_metadata enable SHOUTcast meta data parsing -audioplayer.fastforward fast forw. -audioplayer.follow auto select current +audioplayer.deleteall Remove all +audioplayer.display_order Display order +audioplayer.enable_sc_metadata Enable SHOUTcast meta data parsing +audioplayer.fastforward Fast forward +audioplayer.follow Auto select current audioplayer.head Audio Playlist audioplayer.highprio High decode priority -audioplayer.jump_backwards jump backwards +audioplayer.jump_backwards Jump backwards audioplayer.jump_dialog_hint1 Please enter jump target audioplayer.jump_dialog_hint2 (relative, in seconds) audioplayer.jump_dialog_title Enter jump target -audioplayer.jump_forwards jump forwards -audioplayer.keylevel key level +audioplayer.jump_forwards Jump forwards +audioplayer.keylevel Key level audioplayer.load_radio_stations Load internet radios audioplayer.name Audioplayer -audioplayer.pause pause +audioplayer.pause Pause audioplayer.play Play -audioplayer.playing Current Track +audioplayer.playing Current track audioplayer.playlist_fileerror_msg File could not be created: audioplayer.playlist_fileoverwrite_msg Do you want to overwrite this file: audioplayer.playlist_fileoverwrite_title Overwrite? -audioplayer.playlist_name filename of the play list +audioplayer.playlist_name Filename of the play list audioplayer.playlist_name_hint1 Please enter the filename of the playlist audioplayer.playlist_name_hint2 The extension .m3u will be added automatically -audioplayer.reading_files reading files -audioplayer.receiving_list Receiving list, please wait -audioplayer.repeat_on enable repeat mode -audioplayer.rewind rewind -audioplayer.save_playlist save play list -audioplayer.select_title_by_name search title by name (SMS) -audioplayer.show_playlist Show Playlist -audioplayer.shuffle shuffle -audioplayer.spectrum lcd a-spectrum +audioplayer.reading_files Reading files +audioplayer.receiving_list Receiving list, please wait ... +audioplayer.repeat_on Enable repeat mode +audioplayer.rewind Rewind +audioplayer.save_playlist Save play list +audioplayer.select_title_by_name Search title by name (SMS) +audioplayer.show_playlist Show playlist +audioplayer.shuffle Shuffle +audioplayer.spectrum LCD spectrum audioplayer.stop Stop -audioplayer.title_artist Title, Artist +audioplayer.title_artist Title, artist bookmarkmanager.delete delete bookmarkmanager.name bookmarks bookmarkmanager.rename rename @@ -2021,14 +2021,14 @@ personalize.usermenu_plugin_types Choose Plugin types to show personalize.usermenu_preferred_buttons Assigning of preferred keys personalize.usermenu_show_cancel Show "Cancel"-Button personalize.visible Visible -pictureviewer.defdir start dir. +pictureviewer.defdir Start directory pictureviewer.head Picture viewer pictureviewer.help1 menu mode pictureviewer.help10 reread image pictureviewer.help11 previous image pictureviewer.help12 next image -pictureviewer.help13 Zoom out -pictureviewer.help14 Zoom in +pictureviewer.help13 zoom out +pictureviewer.help14 zoom in pictureviewer.help15 scroll up pictureviewer.help16 scroll left pictureviewer.help17 scroll right @@ -2051,12 +2051,12 @@ pictureviewer.help9 show mode pictureviewer.resize.color_average advanced pictureviewer.resize.none none pictureviewer.resize.simple simple -pictureviewer.scaling scaling -pictureviewer.show show -pictureviewer.slide_time slideshow display time -pictureviewer.slideshow slideshow -pictureviewer.sortorder.date change sort order (date) -pictureviewer.sortorder.filename change sort order (filename) +pictureviewer.scaling Scaling +pictureviewer.show Show +pictureviewer.slide_time Slideshow display time +pictureviewer.slideshow Slideshow +pictureviewer.sortorder.date Sort order: Date +pictureviewer.sortorder.filename Sort order: Filename ping.ok is reachable (ping) ping.protocol is unreachable (host or protocol error) ping.socket is unreachable (socket error) From 578791847eba1fd5651ab9a52e9d5ba76d2f96c5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 273/394] cc_frm_scrollbar: add getScrollBarData() function ... to calculate total pages and current page for CComponentsScrollBar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e9e73cb3cd2c48712335761afb405a54a8df432 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - cc_frm_scrollbar: add getScrollBarData() function ... to calculate total pages and current page for CComponentsScrollBar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 10 ++++++++++ src/gui/components/cc_frm_scrollbar.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 73fa733be..5e4c046f3 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -220,6 +220,16 @@ void CComponentsScrollBar::initSegments() } } +void getScrollBarData(int *total_pages, int *current_page, int total_items, int items_per_page, int selected_item) +{ + // avoid divison by zero and fix wrong values + total_items = std::max(total_items, 1); + items_per_page = std::max(items_per_page, 1); + selected_item = std::max(selected_item, 0); + + *total_pages = ((total_items - 1) / items_per_page) + 1; + *current_page = selected_item / items_per_page; +} void paintScrollBar( const int &x_pos, const int &y_pos, diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 8658d5428..8bd1c0568 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -145,6 +145,8 @@ class CComponentsScrollBar : public CComponentsFrmChain void disableVisualize(){enableVisualize(false);} }; +void getScrollBarData(int *total_pages, int *current_page, int total_items, int items_per_page, int selected_item); + /**Small and easy to apply scrollbar paint methode without expilcit object declaration * @return void * From 59435af21a9e1c8914d91e4678a6c73245fcea46 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 274/394] filebrowser: use getScrollBarData() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/28b3cc80df2e04edbfb81ac9bbdc4ba8d2eb8afe Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - filebrowser: use getScrollBarData() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 6e877060d..5c4fa4e23 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1472,8 +1472,9 @@ void CFileBrowser::paint() paintItem(count); //scrollbar - int total_pages = filelist.size() == 0 ? 1 : ((filelist.size() - 1) / listmaxshow) + 1; - int current_page = (selected / listmaxshow); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } From 995061d7f91c7856acc1137a7e7ef46f29de5a58 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 275/394] bouquetlist: use getScrollBarData() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4f32cf25e4b7f633b068e3d4e9ca5331e615db87 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - bouquetlist: use getScrollBarData() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 3ad6b4038..024ea7ce0 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -710,7 +710,6 @@ void CBouquetList::paint() CInfoClock::getInstance()->disableInfoClock(); liststart = (selected/listmaxshow)*listmaxshow; int lastnum = liststart + listmaxshow; - int bsize = Bouquets.empty() ? 1 : Bouquets.size(); numwidth = 0; int maxDigitWidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getMaxDigitWidth(); @@ -743,9 +742,9 @@ void CBouquetList::paint() } } - int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero - int total_pages = ((bsize - 1) / _listmaxshow) + 1; - int current_page = selected / _listmaxshow; + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } From 7fdeb09671ce5f6aa6fb50e8ee1130c07ac8d87b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 276/394] pictureviewer: use getScrollBarData() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf44e1a97438c347137b17e90b6eb898c5423781 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - pictureviewer: use getScrollBarData() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/pictureviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 6fde49fb9..50d9a7086 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -749,9 +749,9 @@ void CPictureViewerGui::paint() } //scrollbar - int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero - int total_pages = playlist.size() == 0 ? 1 : ((playlist.size() - 1) / _listmaxshow) + 1; - int current_page = selected / _listmaxshow; + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, playlist.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); From a2871335769e6fe7c7a7611c475305ffb8945739 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 277/394] epgplus: use getScrollBarData() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa4723173b9c295d18512e05155022621f7fd6b5 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - epgplus: use getScrollBarData() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f740daafc..b5d209dd3 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1429,8 +1429,12 @@ void EpgPlus::paint() this->timeLine->paintGrid(); // paint slider - int total_pages = ((this->channelList->getSize() - 1) / this->maxNumberOfDisplayableEntries) + 1; - int current_page = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, + this->channelList->getSize(), + this->maxNumberOfDisplayableEntries, + this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); } From b7aab60d37e61956af9dd7055d60d7f13e1207e6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 278/394] CFileBrowser: add fallback for possible missing init directory In some rare exceptional cases it is possible that wrong or missing start directories could be defined. Result: filebrowser window will be freezing, no key is helping. With this fallback, filebrowser should jump into next existant upper directory. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ecc1f4860c9dc0cd18c8b5b1296c48f6f052ffc9 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ CFileBrowser: add fallback for possible missing init directory In some rare exceptional cases it is possible that wrong or missing start directories could be defined. Result: filebrowser window will be freezing, no key is helping. With this fallback, filebrowser should jump into next existant upper directory. ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 5c4fa4e23..bb3677ece 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -555,19 +556,29 @@ bool CFileBrowser::readDir_std(const std::string & dirname, CFileList* flist) struct stat64 statbuf; dirent64 **namelist; int n; + std::string to_scan_dir = dirname; - n = scandir64(dirname.c_str(), &namelist, 0, alphasort64); + n = scandir64(to_scan_dir.c_str(), &namelist, 0, alphasort64); if (n < 0) { - perror(("Filebrowser scandir: "+dirname).c_str()); + std::string scn_err = "Filebrowser scandir: " + to_scan_dir + " "; + to_scan_dir = "/media/"; + dprintf(DEBUG_NORMAL, "\033[33m[CFileBrowser]\[%s - %d], %s failed, %s, try fallback to [%s]\033[0m\n", __func__, __LINE__, scn_err.c_str(), strerror(errno), to_scan_dir.c_str()); + n = scandir64(to_scan_dir.c_str(), &namelist, 0, alphasort64); + name = to_scan_dir; + } + + if (n < 0){ //fallback failed + perror(("Filebrowser scandir: "+to_scan_dir).c_str()); return false; } + for (int i = 0; i < n; i++) { CFile file; if(strcmp(namelist[i]->d_name,".") != 0) { - file.Name = dirname + namelist[i]->d_name; + file.Name = to_scan_dir + namelist[i]->d_name; // printf("file.Name: '%s', getFileName: '%s' getPath: '%s'\n",file.Name.c_str(),file.getFileName().c_str(),file.getPath().c_str()); if(stat64((file.Name).c_str(),&statbuf) != 0) From ddee4406caec26a92445973680dd3693045cfa33 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 279/394] CCDraw: rework getScreen(), getScreenData(), add pixbuf checks Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5fda283a616fc90a2232cb4502350fc423109480 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 078edf940..c28144444 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -440,11 +440,13 @@ bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int //screen area save fb_pixel_t* CCDraw::getScreen(int ax, int ay, int dx, int dy) { + fb_pixel_t* pixbuf = NULL; + if (dx < 1 || dy < 1 || dx * dy == 0) return NULL; + else + pixbuf = new fb_pixel_t[dx * dy]; - dprintf(DEBUG_INFO, "[CCDraw] INFO! [%s - %d], ax = %d, ay = %d, dx = %d, dy = %d\n", __func__, __LINE__, ax, ay, dx, dy); - fb_pixel_t* pixbuf = new fb_pixel_t[dx * dy]; frameBuffer->waitForIdle("CCDraw::getScreen()"); frameBuffer->SaveScreen(ax, ay, dx, dy, pixbuf); return pixbuf; @@ -453,8 +455,14 @@ fb_pixel_t* CCDraw::getScreen(int ax, int ay, int dx, int dy) cc_screen_data_t CCDraw::getScreenData(const int& ax, const int& ay, const int& dx, const int& dy) { cc_screen_data_t res; + res.x = res.y = res.dx = res.dy = 0; res.pixbuf = getScreen(ax, ay, dx, dy); - res.x = ax; res.y = ay; res.dx = dx; res.dy = dy; + + if (res.pixbuf){ + res.x = ax; res.y = ay; res.dx = dx; res.dy = dy; + } + else + dprintf(DEBUG_NORMAL, "\033[33m[CCDraw]\[%s - %d], Warning: initialize of screen buffer failed!\033[0m\n", __func__, __LINE__); return res; } From 915d9f06766008d16b15d263e0e3d20c7b3f7b09 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH 280/394] CNeutrinoApp: add hook for neutrino start Script will be executed on start of neutrino before. Handling is similar like all other possible hooks, see global.h. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/78f1b294a9165fe9d968b28176cd2c0dd33c3f5b Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/global.h | 1 + src/neutrino.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/global.h b/src/global.h index 65f55aff7..7bde595f7 100644 --- a/src/global.h +++ b/src/global.h @@ -42,6 +42,7 @@ #define MOVIEPLAYER_START_SCRIPT CONFIGDIR "/movieplayer.start" #define MOVIEPLAYER_END_SCRIPT CONFIGDIR "/movieplayer.end" #define NEUTRINO_ENTER_FLASH_SCRIPT CONFIGDIR "/flash.start" +#define NEUTRINO_APP_START_SCRIPT CONFIGDIR "/neutrino.start" #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1a2d9fb7b..10f96a1db 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2143,6 +2143,10 @@ void wake_up( bool &wakeup) int CNeutrinoApp::run(int argc, char **argv) { + puts("[neutrino] executing " NEUTRINO_APP_START_SCRIPT "."); + if (my_system(NEUTRINO_APP_START_SCRIPT) != 0) + perror(NEUTRINO_APP_START_SCRIPT " failed"); + CmdParser(argc, argv); TIMER_START(); From f34899d430101505842ae442792ac66db07c6e9b Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 15 Jun 2017 16:34:19 +0200 Subject: [PATCH 281/394] [RemoteTimers] add possibility to transfer all timers at once via webif Use: http://boxip/control/sendalltimers?ip=10.1.1.xxx&force=1 http://boxip/control/sendalltimers?name=record%20box&force=true if parameter name is given, it has to be in timerlist as remote box. if parameter ip and name is given, ip is used. if parameter force is set, all checks are disabled, and the local timer will be deleted even the transfer was not successful. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7031e99573959206d0cd887f04c2ebe8d0b8d408 Author: TangoCash Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 28 +++++++++++++++ src/nhttpd/tuxboxapi/controlapi.h | 1 + src/nhttpd/tuxboxapi/neutrinoapi.cpp | 52 ++++++++++++++++++++++++++++ src/nhttpd/tuxboxapi/neutrinoapi.h | 2 ++ 4 files changed, 83 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 38e47231d..296c83ae7 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -209,6 +209,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"crypt", &CControlAPI::CryptCGI, "text/plain"}, // timer {"timer", &CControlAPI::TimerCGI, "text/plain"}, + {"sendalltimers", &CControlAPI::TimerSendCGI, "text/plain"}, // bouquet editing {"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"}, {"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"}, @@ -335,7 +336,34 @@ void CControlAPI::TimerCGI(CyhookHandler *hh) hh->SendError(); } +void CControlAPI::TimerSendCGI(CyhookHandler *hh) +{ + hh->outStart(); + + if (NeutrinoAPI->Timerd->isTimerdAvailable()) + { + if (!hh->ParamList.empty()) + { + bool force = (hh->ParamList["force"] == "1") || (hh->ParamList["force"] == "true"); + if(!hh->ParamList["ip"].empty()) + { + NeutrinoAPI->SendAllTimers(hh->ParamList["ip"],force); + hh->SendOk(); + } + else if(!hh->ParamList["name"].empty()) + { + NeutrinoAPI->SendAllTimers(NeutrinoAPI->GetRemoteBoxIP(decodeString(hh->ParamList["name"])),force); + hh->SendOk(); + } + else + hh->SendError(); + } + } + else + hh->SendError(); +} //----------------------------------------------------------------------------- + void CControlAPI::SetModeCGI(CyhookHandler *hh) { if (!(hh->ParamList.empty())) diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 36873b8fc..b266e85d4 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -73,6 +73,7 @@ private: // CGI functions for ExecuteCGI void TimerCGI(CyhookHandler *hh); + void TimerSendCGI(CyhookHandler *hh); void SetModeCGI(CyhookHandler *hh); void GetModeCGI(CyhookHandler *hh); void ExecCGI(CyhookHandler *hh); diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index bfd6b216c..46f819145 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -530,3 +531,54 @@ std::string CNeutrinoAPI::getLogoFile(t_channel_id channelId) return logoString; return ""; } + +std::string CNeutrinoAPI::GetRemoteBoxIP(std::string _rbname) +{ + std::string c_url = ""; + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) + { + if (it->rbname == _rbname) + { + if (!it->user.empty() && !it->pass.empty()) + c_url += it->user + ":" + it->pass +"@"; + c_url += it->rbaddress; + c_url += ":" + to_string(it->port); + break; + } + } + return c_url; +} + +void CNeutrinoAPI::SendAllTimers(std::string url, bool force) +{ + CTimerd::TimerList timerlist; + timerlist.clear(); + Timerd->getTimerList(timerlist); + sort(timerlist.begin(), timerlist.end()); + CTimerd::TimerList::iterator timer = timerlist.begin(); + + int pre,post; + Timerd->getRecordingSafety(pre,post); + CHTTPTool httpTool; + std::string r_url; + + for(int i = 0; timer != timerlist.end(); ++timer) + { + if (timer->eventType == CTimerd::TIMER_RECORD) { + r_url = "http://"; + r_url += url; + r_url += "/control/timer?action=new"; + r_url += "&alarm=" + to_string((int)timer->alarmTime + pre); + r_url += "&stop=" + to_string((int)timer->stopTime - post); + r_url += "&announce=" + to_string((int)timer->announceTime + pre); + r_url += "&channel_id=" + string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id); + r_url += "&aj=on"; + r_url += "&rs=on"; + + r_url = httpTool.downloadString(r_url, -1, 300); + + if ((r_url=="ok") || force) + Timerd->removeTimerEvent(timer->eventID); + } + } +} diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 5936e194b..77e51baa0 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -84,6 +84,8 @@ public: std::string getAudioInfoAsString(void); std::string getCryptInfoAsString(void); std::string getLogoFile(t_channel_id channelId); + std::string GetRemoteBoxIP(std::string _rbname); + void SendAllTimers(std::string url, bool force = false); public: CNeutrinoAPI(); ~CNeutrinoAPI(void); From 8c864a4b9c4568be35d92602d4c55a7f71f0a184 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Jun 2017 20:56:08 +0200 Subject: [PATCH 282/394] neutrinoapi.cpp: fix possible broken build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: ‘to_string’ was not declared... to_string is handled inside helpers.h/cpp. include of is required here. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f0891cb76fa580d54147a0b9a1f567ffcb8b88a3 Author: Thilo Graf Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 46f819145..1e3eeeef8 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include From 5204cf2a3bd85ba51a195a79288704084488edb8 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 15 Jun 2017 21:09:28 +0200 Subject: [PATCH 283/394] supplemental to f34899d430101505842ae442792ac66db07c6e9b Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5256a11e66e833eef00eebce16171ad0b0c5a5c2 Author: TangoCash Date: 2017-06-15 (Thu, 15 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 1e3eeeef8..e067a7f4a 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -556,14 +556,13 @@ void CNeutrinoAPI::SendAllTimers(std::string url, bool force) timerlist.clear(); Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); - CTimerd::TimerList::iterator timer = timerlist.begin(); int pre,post; Timerd->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; - for(int i = 0; timer != timerlist.end(); ++timer) + for(CTimerd::TimerList::iterator timer = timerlist.begin(); timer != timerlist.end(); ++timer) { if (timer->eventType == CTimerd::TIMER_RECORD) { r_url = "http://"; From 6ff5268969c4347b5017869f7816c0ff050ea98e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 12:13:24 +0200 Subject: [PATCH 284/394] upnpbrowser: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d4ae277f9ef05481502ace7b8196fad65afbcbc Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - upnpbrowser: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 47 +++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 7458db5f7..a02596374 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -966,8 +966,8 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) } if (i_radius) - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, bgcolor, i_radius); if (pos >= m_devices.size()) return; @@ -976,8 +976,8 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) std::string name = m_devices[pos].friendlyname; int w = g_Font[font_item]->getRenderWidth(name); - g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - 15 - OFFSET_INNER_MID - w, num, color, m_item_height); - g_Font[font_item]->RenderString(m_x + m_width - 15 - OFFSET_INNER_MID - w, ypos + m_item_height, w, name, color, m_item_height); + g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, num, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + m_item_height, w, name, color, m_item_height); } void CUpnpBrowserGui::paintDevices() @@ -999,18 +999,14 @@ void CUpnpBrowserGui::paintDevices() for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PLUS_0); - unsigned int tmp_max = m_listmaxshow; - if(!tmp_max) - tmp_max = 1; - int sbc = ((m_devices.size() - 1) / tmp_max) + 1; - int sbs = ((m_selecteddevice) / tmp_max); - - m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); + // scrollbar + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, m_devices.size(), m_listmaxshow, m_selecteddevice); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); //shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, sb, COL_SHADOW_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); // Foot footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); @@ -1035,8 +1031,8 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po i_radius = RADIUS_LARGE; if (i_radius) - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, bgcolor, i_radius); if (pos >= (*entries).size()) return; @@ -1088,8 +1084,8 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po icon_o = icon_w + OFFSET_INNER_MID; m_frameBuffer->paintIcon(fileicon, m_x + OFFSET_INNER_MID, ypos + (m_item_height - icon_h)/2); } - g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID + icon_o, ypos + m_item_height, m_width - 15 - OFFSET_INNER_MID - w, name, color, m_item_height); - g_Font[font_item]->RenderString(m_x + m_width - 15 - OFFSET_INNER_MID - w, ypos + m_item_height, w, info, color, m_item_height); + g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID + icon_o, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, name, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + m_item_height, w, info, color, m_item_height); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) @@ -1178,16 +1174,11 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PLUS_0); - unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero - int sbc = ((max + offset - 1) / tmp) + 1; - int sbs = ((selected + offset) / tmp); - - int sbh = 0; - if ((sbc > 0) && (sbc > sb-4)) - sbh = 2; - m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_SCROLLBAR_ACTIVE_PLUS_0); + //scrollbar + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, max + offset, m_listmaxshow, selected + offset); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); // Foot buttons size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); From 5b050827a7013c84f640d274347890e6c0a18e59 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 12:59:21 +0200 Subject: [PATCH 285/394] listframe: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/217dd9636043161e08f5b150a0d7032dec1551da Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - listframe: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/listframe.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 33f76ea43..2ed9085ec 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -54,11 +54,10 @@ #include #include #include "listframe.h" +#include #include #include -#define SCROLL_FRAME_WIDTH 10 - #define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) #define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) @@ -270,9 +269,9 @@ void CListFrame::initFramesRel(void) if(m_nMode & SCROLL) { - m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH; + m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLLBAR_WIDTH; m_cFrameScrollRel.iY = m_cFrameTitleRel.iHeight; - m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH; + m_cFrameScrollRel.iWidth = SCROLLBAR_WIDTH; m_cFrameScrollRel.iHeight = m_cFrameHeaderListRel.iHeight + m_cFrameListRel.iHeight - m_nBgRadius; } else @@ -384,13 +383,9 @@ void CListFrame::refreshScroll(void) if (m_nNrOfPages > 1) { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PLUS_0, RADIUS_MIN); - unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*OFFSET_INNER_MIN) / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + OFFSET_INNER_MIN+m_cFrame.iX, - m_cFrameScrollRel.iY + OFFSET_INNER_MIN + m_nCurrentPage * marker_size +m_cFrame.iY, - m_cFrameScrollRel.iWidth - (2*OFFSET_INNER_MIN), - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); + paintScrollBar(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, + m_nNrOfPages, m_nCurrentPage); } } From 599db5b01f0cbfa341b934d08c316d90e2677a8d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 13:05:39 +0200 Subject: [PATCH 286/394] textbox: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6f3ba61d5bc1586c4a27e05eafe1b01ce0ca448 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - textbox: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 7a9e326b1..587c237d6 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -61,6 +61,7 @@ #include #include #include "textbox.h" +#include #include #include #ifdef VISUAL_DEBUG @@ -525,14 +526,9 @@ void CTextBox::refreshScroll(void) if (m_nNrOfPages > 1) { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, + paintScrollBar(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_SCROLLBAR_PLUS_0, RADIUS_MIN); - unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER + m_cFrame.iX, - m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size + m_cFrame.iY, - m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER, - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); + m_nNrOfPages, m_nCurrentPage); m_has_scrolled = true; } else From a4982a5fb3255892838ee5225c82844ffaa92c6a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 13:36:12 +0200 Subject: [PATCH 287/394] channellist: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fd84cedf90624b2bf16e9879072868956d755c00 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - channellist: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 5cb0eff49..0672956d9 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1878,7 +1878,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) color = COL_MENUCONTENTINACTIVE_TEXT; if (!firstpaint || i_selected || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber()) - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); if(curr < (*chanlist).size()) { char nameAndDescription[255]; @@ -1932,7 +1932,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int icon_w = 0; int icon_h = 0; int offset_right = OFFSET_INNER_MID; - int icon_x_right = x + width - 15 - offset_right; + int icon_x_right = x + width - SCROLLBAR_WIDTH - offset_right; if (scramble_icon) { @@ -2026,7 +2026,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description); - int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 3*OFFSET_INNER_MID - offset_right; // 15 = scrollbar + int max_desc_len = width - numwidth - prg_offset - ch_name_len - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - offset_right; if (max_desc_len < 0) max_desc_len = 0; @@ -2040,7 +2040,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - SCROLLBAR_WIDTH - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); } else { @@ -2057,11 +2057,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - SCROLLBAR_WIDTH - prg_offset, nameAndDescription, color); if (g_settings.channellist_epgtext_align_right) { // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 15 - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - SCROLLBAR_WIDTH - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } else { @@ -2077,7 +2077,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - SCROLLBAR_WIDTH - prg_offset, nameAndDescription, color); } if (!firstpaint && curr == selected) updateVfd(); @@ -2209,16 +2209,11 @@ void CChannelList::paintBody() for(unsigned int count = 0; count < listmaxshow; count++) paintItem(count, true); - const int ypos = y+ theight; - const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero - int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1; - const int sbs= (selected/listmaxshow_tmp); - if (sbc < 1) - sbc = 1; + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, (*chanlist).size(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, height - theight - footerHeight, total_pages, current_page); - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); showChannelLogo(); if ((*chanlist).empty()) paintButtonBar(false); From 625c39fa4e564411f2394d222ad37e5fc1228956 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 13:51:27 +0200 Subject: [PATCH 288/394] eventlist: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/578c7904b36454fb1e41bb6022136ad92dcf4070 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - eventlist: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 9f575f516..2bcd1094b 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -753,8 +753,8 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); if(currposgetText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - 15 - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - 15 - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); // 2nd line // set status icons @@ -967,17 +967,10 @@ void CEventList::paint(t_channel_id channel_id) // paint content for right box paintDescription(selected); - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - - int sbc= ((evtlist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); - if (sbc < 1) - sbc = 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); - + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, evtlist.size(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, fheight*listmaxshow, total_pages, current_page); } void CEventList::showFunctionBar(t_channel_id channel_id) From f1681b87bee8e1a4fae7cdb5c62ae8235c563966 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 16:18:25 +0200 Subject: [PATCH 289/394] epgview: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4255640ce1edd49545b16d08a6dc2a23ac89e8ce Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - epgview: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 393bbb1ad..6dbda256f 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -199,7 +199,7 @@ void CEpgData::processTextToArray(std::string text, int screening, bool has_cove // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 2*OFFSET_INNER_MID - 15 - (has_cover ? ((ox/4)+OFFSET_INNER_MID) : 0))) + if ((aktWordWidth+aktWidth)<(ox - 2*OFFSET_INNER_MID - SCROLLBAR_WIDTH - (has_cover ? ((ox/4)+OFFSET_INNER_MID) : 0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -270,12 +270,12 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ")); } int offs = fullClear ? 0 : cover_offset; - frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + frameBuffer->paintBoxRel(sx+offs, y, ox-SCROLLBAR_WIDTH-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box if (has_cover) { if (!g_PicViewer->DisplayImage(cover ,sx+OFFSET_INNER_MID ,y+OFFSET_INNER_MID+((sb-cover_height)/2), cover_width, cover_height, CFrameBuffer::TM_NONE)) { cover_offset = 0; - frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + frameBuffer->paintBoxRel(sx, y, ox-SCROLLBAR_WIDTH, sb, COL_MENUCONTENT_PLUS_0); // background of the text box } } int logo_offset = 0; @@ -312,7 +312,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) offset += digi; break; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+offset, y+medlineheight, ox - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - offset, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT); count++; pos1 = epgText[i].first.find_first_not_of(tok, pos2); pos2 = epgText[i].first.find_first_of(tok, pos1); @@ -321,17 +321,14 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+cover_offset, y+medlineheight, ox-15-15-cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+OFFSET_INNER_MID+cover_offset, y+medlineheight, ox - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); } } - - int sbc = ((textSize - 1)/ medlinecount) + 1; - int sbs= (startPos+ 1)/ medlinecount; - if (sbc < 1) - sbc = 1; - frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_SCROLLBAR_PLUS_0); // scrollbar bg - frameBuffer->paintBoxRel(sx+ ox- 13, ypos+ 2+ sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); // scrollbar + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, textSize, medlinecount, startPos + 1); + paintScrollBar(sx + ox - SCROLLBAR_WIDTH, ypos, SCROLLBAR_WIDTH, sb, total_pages, current_page); } #define GENRE_MOVIE_COUNT 9 From e077cd09e3d63dfe72b88e1382d8413aed9964c0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 16:30:02 +0200 Subject: [PATCH 290/394] timerlist: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5d1a6a7f8b93c563bebe26fa9d598b96ceb2961d Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - timerlist: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 3eda88907..2b6c5f59f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1134,7 +1134,7 @@ void CTimerList::paintItem(int pos) int real_width=width; if (timerlist.size() > listmaxshow) { - real_width-=15; //scrollbar + real_width -= SCROLLBAR_WIDTH; //scrollbar } unsigned int currpos = liststart + pos; @@ -1425,15 +1425,10 @@ void CTimerList::paint() if (timerlist.size()>listmaxshow) { - int ypos = y+ theight; - int sb = 2*fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - unsigned int tmp_max = listmaxshow; - if (!tmp_max) - tmp_max = 1; - int sbc = ((timerlist.size()- 1)/ tmp_max)+ 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, timerlist.size(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, 2*fheight*listmaxshow, total_pages, current_page); } paintFoot(); From 2f80d5641d02fc619d8500550e9a6a6e1c533b96 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 16:47:19 +0200 Subject: [PATCH 291/394] listbox: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/36ebcb586ac761e08e807e4c5916dad886c360aa Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - listbox: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/listbox.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 1edcc681f..ad7c26fb9 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -67,18 +67,10 @@ void CListBox::paint() paintItem(count); } - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - - int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1; - if (sbc < 1) - sbc = 1; - - int sbh= (sb- 4)/ sbc; - int sbs= (selected/listmaxshow); - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs* sbh , 11, sbh, COL_SCROLLBAR_ACTIVE_PLUS_0); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, getItemCount(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, fheight*listmaxshow, total_pages, current_page); } void CListBox::paintHead() @@ -111,8 +103,9 @@ void CListBox::hide() frameBuffer->paintBackgroundBoxRel(x,y, width,height+ButtonHeight); } -unsigned int CListBox::getItemCount() +unsigned int CListBox::getItemCount() { + // WTF? Why a fixed value? return 10; } @@ -130,8 +123,8 @@ void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected) getItemColors(color, bgcolor, pselected); - frameBuffer->paintBoxRel(x,ypos, width- 15, getItemHeight(), bgcolor); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 10, ypos+ fheight, width-20, "demo", color); + frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, getItemHeight(), bgcolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID, ypos + fheight, width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID, "demo", color); } void CListBox::updateSelection(unsigned int newpos) From 9270242bda48daadc157b1c91fb43412474afeaa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Jun 2017 17:21:10 +0200 Subject: [PATCH 292/394] bouqueteditor: use CComponentsScrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c80cc2433594fe2def05f36771b4e073d3fb9158 Author: vanhofen Date: 2017-06-15 (Thu, 15 Jun 2017) Origin message was: ------------------ - bouqueteditor: use CComponentsScrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_bouquets.cpp | 21 ++++++----------- src/gui/bedit/bouqueteditor_channels.cpp | 26 +++++++--------------- src/gui/bedit/bouqueteditor_chanselect.cpp | 8 +++---- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 0109fd340..fc2eb5994 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -66,7 +66,7 @@ CBEBouquetWidget::CBEBouquetWidget() void CBEBouquetWidget::paintItem(int pos) { - int ypos = y+ theight+0 + pos*iheight; + int ypos = y + theight + pos*iheight; unsigned int current = liststart + pos; bool i_selected = current == selected; @@ -92,8 +92,8 @@ void CBEBouquetWidget::paintItem(int pos) } if (i_radius) - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, iheight, bgcolor, i_radius); if (current < Bouquets->size()) { if ((i_selected) && (state == beMoving)) @@ -125,17 +125,10 @@ void CBEBouquetWidget::paint() paintItem(count); } - int ypos = y+ theight; - int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - - int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); - if (sbc < 1) - sbc = 1; - - //scrollbar - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, Bouquets->size(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, iheight*listmaxshow, total_pages, current_page); } void CBEBouquetWidget::paintHead() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 97a65de4c..8618ffca5 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -121,8 +121,8 @@ void CBEChannelWidget::paintItem(int pos) } if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, iheight, bgcolor, i_radius); if ((current == selected) && (state == beMoving)) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID, ypos, iheight); @@ -131,13 +131,12 @@ void CBEChannelWidget::paintItem(int pos) if ((*Channels)[current]->bLocked) { frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + iconoffset, ypos, iheight); } - //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color); //FIXME numwidth ? we not show chan numbers g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, (*Channels)[current]->getName(), color); if((*Channels)[current]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!(*Channels)[current]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } @@ -159,19 +158,10 @@ void CBEChannelWidget::paint() paintItem(count); } - int ypos = y+ theight; - int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); - - int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1; - if (sbc < 1) - sbc = 1; - - int sbh= (sb- 4)/ sbc; - int sbs= (selected/listmaxshow); - - if (sbh) - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_SCROLLBAR_ACTIVE_PLUS_0); + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, Channels->size(), listmaxshow, selected); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, iheight*listmaxshow, total_pages, current_page); } void CBEChannelWidget::paintHead() diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index c80a182b2..87227e8df 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -129,8 +129,8 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec } if (i_radius) - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, iheight, bgcolor, i_radius); if(itemNr < getItemCount()) { @@ -141,9 +141,9 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, Channels[itemNr]->getName(), color); if(Channels[itemNr]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!Channels[itemNr]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } From c7aee9c0e30feb1e65ec56be0888eee49b461795 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 16 Jun 2017 10:10:48 +0200 Subject: [PATCH 293/394] CComponentsHeader: fix corner type comparison Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f46a17415508ac8dead9bfde74e3055d4980ea75 Author: Thilo Graf Date: 2017-06-16 (Fri, 16 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index bce82f375..7a91fd8c5 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -258,7 +258,7 @@ void CComponentsHeader::initIcon() //set corner mode of icon item int cc_icon_corner_type = CORNER_LEFT; - if (corner_type == CORNER_TOP_LEFT || corner_type == CORNER_TOP) + if (corner_type & CORNER_TOP_LEFT || corner_type & CORNER_TOP) cc_icon_corner_type = CORNER_TOP_LEFT; cch_icon_obj->setCorner(corner_rad-fr_thickness, cc_icon_corner_type); From 1ba0a9b971bd16d78f549f0bd907d3d8379329ce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 16 Jun 2017 11:42:21 +0200 Subject: [PATCH 294/394] CCDraw: precise function for kill handler This should fix possible artefacts or holes in some rendered boxes. Was especially striking at HD1 Hardware. e.g. was observed while right/left switching on channel list at header and without rounded corners and at certain footers. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ef4467b6da8206c0e97364d1820364b59bf34abc Author: Thilo Graf Date: 2017-06-16 (Fri, 16 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 54 ++++++++++++++++-------------- src/gui/components/cc_draw.h | 2 +- src/gui/components/cc_frm_header.h | 2 +- src/gui/components/cc_item.h | 2 +- src/gui/components/cc_types.h | 2 +- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index c28144444..39ca711d8 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -729,14 +729,21 @@ void CCDraw::hide() //erase or paint over rendered objects void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/) { + int layers = fblayer_type; + + if (fblayer_type & ~CC_FBDATA_TYPES) + layers = CC_FBDATA_TYPES; + for(size_t i =0; i< v_fbdata.size() ;i++){ - if (fblayer_type == CC_FBDATA_TYPES || v_fbdata[i].fbdata_type & fblayer_type){ -#if 0 - if (bg_color != COL_BACKGROUND_PLUS_0) -#endif - int r = v_fbdata[i].r; - if (corner_radius > -1) - r = corner_radius; + if (v_fbdata[i].fbdata_type & layers){ + + int r = 0; + + if (corner_radius > -1){ + r = v_fbdata[i].r; + if (corner_radius != v_fbdata[i].r) + r = corner_radius; + } if (v_fbdata[i].dx > 0 && v_fbdata[i].dy > 0){ frameBuffer->paintBoxRel(v_fbdata[i].x, @@ -745,31 +752,28 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in v_fbdata[i].dy, bg_color, r, - corner_type); + v_fbdata[i].rtype); + + if (v_fbdata[i].fbdata_type & CC_FBDATA_TYPE_FRAME){ + if (v_fbdata[i].frame_thickness) + frameBuffer->paintBoxFrame(v_fbdata[i].x, + v_fbdata[i].y, + v_fbdata[i].dx, + v_fbdata[i].dy, + v_fbdata[i].frame_thickness, + bg_color, + v_fbdata[i].r, + v_fbdata[i].rtype); + } }else dprintf(DEBUG_DEBUG, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); - if (v_fbdata[i].frame_thickness) - frameBuffer->paintBoxFrame(v_fbdata[i].x, - v_fbdata[i].y, - v_fbdata[i].dx, - v_fbdata[i].dy, - v_fbdata[i].frame_thickness, - bg_color, - r, - corner_type); v_fbdata[i].is_painted = false; -#if 0 - else - frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); -#endif } } - if (fblayer_type == CC_FBDATA_TYPES){ - firstPaint = true; - is_painted = false; - } + firstPaint = true; + is_painted = false; } void CCDraw::killShadow(const fb_pixel_t& bg_color, const int& corner_radius) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 0f23e7eb4..ab7400ca8 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -396,7 +396,7 @@ class CCDraw : public COSDFader, public CComponentsSignals * Shadow paint must be reworked, because dimensions of shadow containes not the real defined size. Parts of item are killed too. * */ - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = ~CC_FBDATA_TYPES); /**Erase shadow around rendered item. * This is similar with the kill() member, but shadow will be handled only. diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 29f8b8315..e1dd05f66 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -315,7 +315,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT ///hides item, arg: no_restore see hideCCItem() void hide(){disableClock(); CComponentsForm::hide();} ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer - void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES, bool disable_clock = true); + void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = ~CC_FBDATA_TYPES, bool disable_clock = true); ///set color gradient on/off, returns true if gradient mode was changed virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/, const int& direction = -1); diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 9d633ad62..d168c3832 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -100,7 +100,7 @@ class CComponentsItem : public CComponents * gui/color.h * driver/framebuffer.h */ - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = CC_FBDATA_TYPES); + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = ~CC_FBDATA_TYPES); ///get the current item type, see attribute cc_item_type above virtual int getItemType(); diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index e24f5cc03..d73bd1549 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -100,7 +100,7 @@ typedef enum CC_FBDATA_TYPE_FRAME = 8, CC_FBDATA_TYPE_BACKGROUND = 16, - CC_FBDATA_TYPES = 32 + CC_FBDATA_TYPES = CC_FBDATA_TYPE_BOX | CC_FBDATA_TYPE_SHADOW_BOX | CC_FBDATA_TYPE_FRAME }FBDATA_TYPES; //fb color gradient types From 992e1a6613b12e358cbaacb4f0eed35b4f348015 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Jun 2017 11:10:31 +0200 Subject: [PATCH 295/394] epgview: align with and height of progressbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4adea2366172af85bffb8514197b8230ffe4a270 Author: vanhofen Date: 2017-06-16 (Fri, 16 Jun 2017) Origin message was: ------------------ - epgview: align with and height of progressbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 6dbda256f..b696c54ea 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1412,9 +1412,9 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st void CEpgData::showProgressBar() { - int w = 104; + int w = ox/10; int x = sx + (ox - w)/2; - int h = botboxheight - 12; + int h = botboxheight - 2*OFFSET_INNER_SMALL; int y = sy + oy - botboxheight + (botboxheight - h)/2; if (!pb){ pb = new CProgressBar(x, y, w, h); From 909cf0482d71b99e4118c9f892d780c5c6af0a35 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 16 Jun 2017 19:10:23 +0200 Subject: [PATCH 296/394] Revert "HD1: Workaround for missing cs_get_chip_type" This reverts commit f273871fcff9667a3af625d16b0fa1b7d2e6d751. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e3cc6cee67f5314efb0222d533d76001a60ea686 Author: Michael Liebmann Date: 2017-06-16 (Fri, 16 Jun 2017) ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 6 +----- lib/hardware/coolstream/hd1/libcoolstream/cs_api.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index e5af0e255..139825c32 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -6,7 +6,6 @@ * * License: GPL v2 or later */ -#include #include "cs_api.h" #include #include @@ -21,10 +20,7 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); - int chip = 0; -#ifdef BOXMODEL_CS_HD2 - chip = cs_get_chip_type(); -#endif + 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_HDMI = 1; caps.has_SCART = (rev != 10); diff --git a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h index 80dd47ade..9a4e77259 100644 --- a/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h +++ b/lib/hardware/coolstream/hd1/libcoolstream/cs_api.h @@ -82,7 +82,7 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); /* Dummy function for compatibility with hd2 */ -//unsigned int cs_get_chip_type(void); +unsigned int cs_get_chip_type(void); // library version functions From f4eae34527c31332f0b7967962f50240c9e277a1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 16 Jun 2017 19:05:59 +0200 Subject: [PATCH 297/394] COsdHelpers: Fix video system switching on HD1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/224521bc40bcaeb9c5198565286544658ba400c9 Author: Michael Liebmann Date: 2017-06-16 (Fri, 16 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_helpers.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index 2675cffef..b5bb20127 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -156,17 +156,10 @@ int COsdHelpers::isVideoSystem1080(int res) return false; } -#ifdef ENABLE_CHANGE_OSD_RESOLUTION int COsdHelpers::getVideoSystem() { return videoDecoder->GetVideoSystem(); } -#else -int COsdHelpers::getVideoSystem() -{ - return g_settings.video_Mode; -} -#endif uint32_t COsdHelpers::getOsdResolution() { From a3d5baa1e61ee57385aa164020b7991e5804942a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 298/394] audioplayer: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables * many, many position calculation fixes * re-format code Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4c21971b4a17028f9a053feb0137f935656a511e Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - audioplayer: small design reworks ... * use OFFSET defines * use CComponentsScrollbar * rename some variables * many, many position calculation fixes * re-format code Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 +- src/gui/audioplayer.cpp | 932 ++++++++++++++++++------------------- src/gui/audioplayer.h | 365 +++++++-------- 3 files changed, 643 insertions(+), 658 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d6fa786d8..3148cb971 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -160,8 +160,8 @@ audioplayer.add_loc Lokale Radioliste audioplayer.add_sc SHOUTcast audioplayer.artist_title Interpret, Titel audioplayer.building_search_index Erstelle Suchindex -audioplayer.button_select_title_by_id Suche n. ID -audioplayer.button_select_title_by_name Suche n. Name +audioplayer.button_select_title_by_id Suche nach ID +audioplayer.button_select_title_by_name Suche nach Name audioplayer.defdir Start-Verzeichnis audioplayer.delete Entfernen audioplayer.deleteall Alle entfernen diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index ab6da1ff8..1434f822c 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1,37 +1,26 @@ /* - Neutrino-GUI - DBoxII-Project + Neutrino-GUI - DBoxII-Project - AudioPlayer by Dirch, Zwen - AudioPlayer by Dirch,Zwen + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2002-2008 the tuxbox project contributors + Copyright (C) 2008 Novell, Inc. Author: Stefan Seyfried + Copyright (C) 2017 Sven Hoefer - (C) 2002-2008 the tuxbox project contributors - (C) 2008 Novell, Inc. Author: Stefan Seyfried + License: GPL - Homepage: http://dbox.cyberphoria.org/ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - Kommentar: + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ #ifdef HAVE_CONFIG_H #include @@ -104,18 +93,15 @@ extern cVideo * videoDecoder; const char RADIO_STATION_XML_FILE[] = {DEFAULT_RADIOSTATIONS_XMLFILE}; -CAudiofileExt::CAudiofileExt() - : CAudiofile(), firstChar('\0') +CAudiofileExt::CAudiofileExt() : CAudiofile(), firstChar('\0') { } -CAudiofileExt::CAudiofileExt(std::string name, CFile::FileType type) - : CAudiofile(name, type), firstChar('\0') +CAudiofileExt::CAudiofileExt(std::string name, CFile::FileType type) : CAudiofile(name, type), firstChar('\0') { } -CAudiofileExt::CAudiofileExt(const CAudiofileExt& src) - : CAudiofile(src), firstChar(src.firstChar) +CAudiofileExt::CAudiofileExt(const CAudiofileExt& src) : CAudiofile(src), firstChar(src.firstChar) { } @@ -127,7 +113,8 @@ void CAudiofileExt::operator=(const CAudiofileExt& src) firstChar = src.firstChar; } -struct MemoryStruct { +struct MemoryStruct +{ char *memory; size_t size; }; @@ -142,14 +129,14 @@ static void *myrealloc(void *ptr, size_t size) return malloc(size); } -static size_t -WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) +static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)data; mem->memory = (char *)myrealloc(mem->memory, mem->size + realsize + 1); - if (mem->memory) { + if (mem->memory) + { memmove(&(mem->memory[mem->size]), ptr, realsize); mem->size += realsize; mem->memory[mem->size] = 0; @@ -165,8 +152,8 @@ CAudioPlayerGui::CAudioPlayerGui(bool inetmode) m_frameBuffer = CFrameBuffer::getInstance(); m_visible = false; m_inetmode = inetmode; - dline = NULL; - ibox = NULL; + m_detailsline = NULL; + m_infobox = NULL; Init(); } @@ -186,12 +173,15 @@ void CAudioPlayerGui::Init(void) m_Path = "/"; audiofilefilter.Clear(); - if (m_inetmode) { + if (m_inetmode) + { audiofilefilter.addFilter("url"); audiofilefilter.addFilter("xml"); audiofilefilter.addFilter("m3u"); audiofilefilter.addFilter("pls"); - } else { + } + else + { audiofilefilter.addFilter("cdr"); audiofilefilter.addFilter("mp3"); audiofilefilter.addFilter("m2a"); @@ -217,10 +207,56 @@ CAudioPlayerGui::~CAudioPlayerGui() m_radiolist.clear(); m_filelist.clear(); m_title2Pos.clear(); - delete dline; - delete ibox; + delete m_detailsline; + delete m_infobox; } +const struct button_label AudioPlayerButtons[][4] = +{ + { + { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, + { NEUTRINO_ICON_BUTTON_BACKWARD , LOCALE_AUDIOPLAYER_REWIND }, + { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, + { NEUTRINO_ICON_BUTTON_FORWARD , LOCALE_AUDIOPLAYER_FASTFORWARD }, + }, + { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE }, + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_AUDIOPLAYER_DELETEALL }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_SHUFFLE }, + }, + { + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_JUMP_BACKWARDS }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_JUMP_FORWARDS }, + }, + { + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_JUMP_BACKWARDS }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_JUMP_FORWARDS }, + }, + { + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_SAVE_PLAYLIST }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_AUDIOPLAYER_BUTTON_SELECT_TITLE_BY_ID }, + }, + { + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_SAVE_PLAYLIST }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_AUDIOPLAYER_BUTTON_SELECT_TITLE_BY_NAME}, + }, + { + { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, + { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, + }, + { + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_INETRADIO_NAME }, + }, + { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE }, + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_AUDIOPLAYER_DELETEALL }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_INETRADIO_NAME }, + }, +}; + int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) { @@ -236,8 +272,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) if (m_select_title_by_name != (g_settings.audioplayer_select_title_by_name==1)) { - if ((g_settings.audioplayer_select_title_by_name == 1) - && m_playlistHasChanged) + if ((g_settings.audioplayer_select_title_by_name == 1) && m_playlistHasChanged) { buildSearchTree(); } @@ -254,28 +289,24 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); + m_header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + m_item_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_buttonHeight = std::max(25, m_sheight); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + m_meta_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + m_title_height = 3*OFFSET_INNER_SMALL + 2*m_item_height + m_meta_height; + m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); + m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); - int iw, ih; - m_frameBuffer->getIconSize(NEUTRINO_ICON_AUDIO, &iw, &ih); - m_theight = std::max(m_theight, ih+4); + m_listmaxshow = (m_height - m_title_height - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_INTER - m_info_height) / (m_item_height); + m_height = m_title_height + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_INTER + m_info_height; // recalc height - m_title_height = m_fheight*2 + 20 + m_sheight + 4; - m_info_height = m_fheight*2; - m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); - m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height - - m_x = getScreenStartX( m_width ); + m_x = getScreenStartX(m_width); if (m_x < DETAILSLINE_WIDTH) m_x = DETAILSLINE_WIDTH; - m_y = getScreenStartY( m_height ); + m_y = getScreenStartY(m_height); - m_idletime=time(NULL); - m_screensaver=false; + m_idletime = time(NULL); + m_screensaver = false; if (parent) parent->hide(); @@ -291,7 +322,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) // tell neutrino we're in audio mode m_LastMode = CNeutrinoApp::getInstance()->getMode(); - CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio ); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) @@ -313,8 +344,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) CZapit::getInstance()->EnablePlayback(true); m_frameBuffer->stopFrame(); - CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); - g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , m_LastMode); + g_RCInput->postMsg(NeutrinoMessages::SHOW_INFOBAR, 0); CNeutrinoApp::getInstance()->StartSubtitles(); @@ -323,7 +354,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) int CAudioPlayerGui::show() { - neutrino_msg_t msg; + neutrino_msg_t msg; neutrino_msg_data_t data; int ret = menu_return::RETURN_REPAINT; @@ -350,9 +381,11 @@ int CAudioPlayerGui::show() if (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_audio) loop = false; - if ((m_state != CAudioPlayerGui::STOP) && - (CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) && - (!m_playlist.empty())) + if ( + (m_state != CAudioPlayerGui::STOP) && + (CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) && + (!m_playlist.empty()) + ) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) playNext(); @@ -370,7 +403,7 @@ int CAudioPlayerGui::show() } g_RCInput->getMsg(&msg, &data, 10); // 1 sec timeout to update play/stop state display - if ( msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) + if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { int delay = time(NULL) - m_idletime; int screensaver_delay = g_settings.screensaver_delay; @@ -388,7 +421,8 @@ int CAudioPlayerGui::show() m_frameBuffer->showFrame("mp3.jpg"); paint(); - if (msg <= CRCInput::RC_MaxRC) { + if (msg <= CRCInput::RC_MaxRC) + { // ignore first keypress - just quit the screensaver g_RCInput->clearRCMsg(); continue; @@ -448,7 +482,8 @@ int CAudioPlayerGui::show() else if (!m_playlist.empty()) { m_selected += m_listmaxshow; - if (m_selected >= m_playlist.size()) { + if (m_selected >= m_playlist.size()) + { if (((m_playlist.size() / m_listmaxshow) + 1) * m_listmaxshow == m_playlist.size() + m_listmaxshow) m_selected = 0; else @@ -461,10 +496,10 @@ int CAudioPlayerGui::show() } else if ((msg &~ CRCInput::RC_Repeat) == CRCInput::RC_up || (msg &~ CRCInput::RC_Repeat) == CRCInput::RC_page_up) { - if (m_show_playlist && !m_playlist.empty() ) + if (m_show_playlist && !m_playlist.empty()) { int prevselected = m_selected; - int step = msg == CRCInput::RC_page_up ? m_listmaxshow : 1; + int step = msg == CRCInput::RC_page_up ? m_listmaxshow : 1; m_selected -= step; if ((prevselected-step) < 0) @@ -485,13 +520,14 @@ int CAudioPlayerGui::show() } else if ((msg &~ CRCInput::RC_Repeat) == CRCInput::RC_down || (msg &~ CRCInput::RC_Repeat) == CRCInput::RC_page_down) { - if (m_show_playlist && !m_playlist.empty() ) + if (m_show_playlist && !m_playlist.empty()) { int prevselected = m_selected; - unsigned int step = msg == CRCInput::RC_page_down ? m_listmaxshow : 1; + unsigned int step = msg == CRCInput::RC_page_down ? m_listmaxshow : 1; m_selected += step; - if (m_selected >= m_playlist.size()) { + if (m_selected >= m_playlist.size()) + { if (((m_playlist.size() / m_listmaxshow) + 1) * m_listmaxshow == m_playlist.size() + m_listmaxshow) // last page has full entries m_selected = 0; else @@ -514,7 +550,8 @@ int CAudioPlayerGui::show() } else if (msg == CRCInput::RC_ok || msg == CRCInput::RC_play) { - if (!m_playlist.empty()) { + if (!m_playlist.empty()) + { if (!m_show_playlist) play(m_current); else @@ -582,10 +619,10 @@ int CAudioPlayerGui::show() // is no stream, so we do not have to test for this case int seconds=0; CIntInput secondsInput(LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, - &seconds, - 5, - LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, - LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT2); + &seconds, + 5, + LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, + LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT2); int res = secondsInput.exec(NULL,""); if (seconds != 0 && res!= menu_return::RETURN_EXIT_ALL) rev(seconds); @@ -621,7 +658,8 @@ int CAudioPlayerGui::show() { if (m_key_level == 0) { - if (m_inetmode) { + if (m_inetmode) + { static int old_select = 0; char cnt[5]; CMenuWidget InputSelector(LOCALE_AUDIOPLAYER_LOAD_RADIO_STATIONS, NEUTRINO_ICON_AUDIO); @@ -631,16 +669,16 @@ int CAudioPlayerGui::show() // -- setup menue for inetradio input sprintf(cnt, "%d", count); InputSelector.addItem(new CMenuForwarder( - LOCALE_AUDIOPLAYER_ADD_LOC, true, NULL, InetRadioInputChanger, - cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); + LOCALE_AUDIOPLAYER_ADD_LOC, true, NULL, InetRadioInputChanger, + cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); sprintf(cnt, "%d", ++count); InputSelector.addItem(new CMenuForwarder( - LOCALE_AUDIOPLAYER_ADD_IC, true, NULL, InetRadioInputChanger, - cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); + LOCALE_AUDIOPLAYER_ADD_IC, true, NULL, InetRadioInputChanger, + cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); sprintf(cnt, "%d", ++count); InputSelector.addItem(new CMenuForwarder( - LOCALE_AUDIOPLAYER_ADD_SC, g_settings.shoutcast_enabled, NULL, InetRadioInputChanger, - cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); + LOCALE_AUDIOPLAYER_ADD_SC, g_settings.shoutcast_enabled, NULL, InetRadioInputChanger, + cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); //InputSelector.addItem(GenericMenuSeparator); hide(); @@ -650,26 +688,27 @@ int CAudioPlayerGui::show() if (select >= 0) old_select = select; - switch (select) { - case 0: - scanXmlFile(RADIO_STATION_XML_FILE); - CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); - paintLCD(); - break; - case 1: - readDir_ic(); - CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); - paintLCD(); - break; - case 2: - openSCbrowser(); - break; - default: - break; + switch (select) + { + case 0: + scanXmlFile(RADIO_STATION_XML_FILE); + CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); + paintLCD(); + break; + case 1: + readDir_ic(); + CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); + paintLCD(); + break; + case 2: + openSCbrowser(); + break; + default: + break; } update=true; } - else if ( shufflePlaylist() ) + else if (shufflePlaylist()) { update = true; } @@ -687,10 +726,10 @@ int CAudioPlayerGui::show() // is no stream, so we do not have to test for this case int seconds=0; CIntInput secondsInput(LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, - &seconds, - 5, - LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, - LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT2); + &seconds, + 5, + LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, + LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT2); int res = secondsInput.exec(NULL,""); if (seconds != 0 && res!= menu_return::RETURN_EXIT_ALL) ff(seconds); @@ -698,7 +737,7 @@ int CAudioPlayerGui::show() } } } - else if ( (msg == CRCInput::RC_info) && (!m_playlist.empty()) ) + else if (msg == CRCInput::RC_info && !m_playlist.empty()) { pictureviewer = true; m_frameBuffer->Clear(); @@ -725,8 +764,7 @@ int CAudioPlayerGui::show() if (m_state != CAudioPlayerGui::STOP) { // jumping in streams not supported - if (m_key_level == 2 && - m_curr_audiofile.FileType == CFile::STREAM_AUDIO) + if (m_key_level == 2 && m_curr_audiofile.FileType == CFile::STREAM_AUDIO) { m_key_level = 0; } @@ -755,8 +793,10 @@ int CAudioPlayerGui::show() int w = 0; do { + //FIXME - remove fixed values + smsKey = m_SMSKeyInput.handleMsg(msg); - //printf(" new key: %c", smsKey); + //printf(" new key: %c", smsKey); /* show a hint box with current char (too slow at the moment?)*/ char selectedKey[1]; sprintf(selectedKey,"%c",smsKey); @@ -765,16 +805,14 @@ int CAudioPlayerGui::show() int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); w = std::max(w, g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(selectedKey)); m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_FRAME_PLUS_0, RADIUS_SMALL); - m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_SMALL); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP] - ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT); + m_frameBuffer->paintBoxRel(x1 - 6, y1 - h - 4, w + 12, h + 8, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_SMALL); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT); g_RCInput->getMsg_ms(&msg, &data, AUDIOPLAYERGUI_SMSKEY_TIMEOUT - 200); } while (CRCInput::isNumeric(msg) && !(m_playlist.empty())); - if (msg == CRCInput::RC_timeout - || msg == CRCInput::RC_nokey) + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_nokey) { //printf("selected key: %c\n",smsKey); selectTitle(smsKey); @@ -811,14 +849,16 @@ int CAudioPlayerGui::show() m_LastMode=data; } } - else if (msg == NeutrinoMessages::RECORD_START || + else if ( + msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::ZAPTO || msg == NeutrinoMessages::STANDBY_ON || msg == NeutrinoMessages::LEAVE_ALL || msg == NeutrinoMessages::SHUTDOWN || - ((msg == NeutrinoMessages::SLEEPTIMER) && !data)) + (msg == NeutrinoMessages::SLEEPTIMER && !data) + ) { - if(msg != NeutrinoMessages::RECORD_START ) + if (msg != NeutrinoMessages::RECORD_START) ret = menu_return::RETURN_EXIT_ALL; // Exit for Record/Zapto Timers loop = false; @@ -827,11 +867,11 @@ int CAudioPlayerGui::show() } else if (msg == NeutrinoMessages::EVT_TIMER) { - CNeutrinoApp::getInstance()->handleMsg( msg, data ); + CNeutrinoApp::getInstance()->handleMsg(msg, data); } else { - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { ret = menu_return::RETURN_EXIT_ALL; loop = false; @@ -869,9 +909,11 @@ bool CAudioPlayerGui::playNext(bool allow_rotate) void CAudioPlayerGui::wantNextPlay() { - if ((m_state != CAudioPlayerGui::STOP) && + if ( + (m_state != CAudioPlayerGui::STOP) && (CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) && - (!m_playlist.empty())) + (!m_playlist.empty()) + ) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) playNext(); @@ -946,12 +988,15 @@ bool CAudioPlayerGui::shufflePlaylist(void) void CAudioPlayerGui::addUrl2Playlist(const char *url, const char *name, const time_t bitrate) { - CAudiofileExt mp3( url, CFile::STREAM_AUDIO ); -// tmp = tmp.substr(0,tmp.length()-4); //remove .url -//printf("[addUrl2Playlist], name = %s, url = %s\n", name, url); - if (name != NULL) { + CAudiofileExt mp3(url, CFile::STREAM_AUDIO); + //tmp = tmp.substr(0,tmp.length()-4); //remove .url + //printf("[addUrl2Playlist], name = %s, url = %s\n", name, url); + if (name != NULL) + { mp3.MetaData.title = name; - } else { + } + else + { std::string tmp = mp3.Filename.substr(mp3.Filename.rfind('/')+1); mp3.MetaData.title = tmp; } @@ -972,7 +1017,7 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons printf("CAudioPlayerGui::processPlaylistUrl (%s, %s)\n", url, name); chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ - chunk.size = 0; /* no data at this point */ + chunk.size = 0; /* no data at this point */ curl_global_init(CURL_GLOBAL_ALL); @@ -982,7 +1027,7 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons /* specify URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, url); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); /* we pass our 'chunk' struct to the callback function */ @@ -1013,19 +1058,24 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons */ long res_code; - if (curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE/*CURLINFO_RESPONSE_CODE*/, &res_code ) == CURLE_OK) { - if (200 == res_code) { + if (curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE/*CURLINFO_RESPONSE_CODE*/, &res_code) == CURLE_OK) + { + if (200 == res_code) + { //printf("\nchunk = %s\n", chunk.memory); std::istringstream iss; iss.str (std::string(chunk.memory, chunk.size)); char line[512]; char *ptr; - while (iss.rdstate() == std::ifstream::goodbit) { + while (iss.rdstate() == std::ifstream::goodbit) + { iss.getline(line, 512); - if (line[0] != '#') { + if (line[0] != '#') + { //printf("chunk: line = %s\n", line); ptr = strstr(line, "http://"); - if (ptr != NULL) { + if (ptr != NULL) + { char *tmp; // strip \n and \r characters from url tmp = strchr(line, '\r'); @@ -1064,7 +1114,7 @@ void CAudioPlayerGui::readDir_ic(void) curl_handle = curl_easy_init(); /* specify URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, icecasturl.c_str()); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, CurlWriteToString); /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl_handle, CURLOPT_FILE, (void *)&answer); @@ -1105,22 +1155,26 @@ void CAudioPlayerGui::scanXmlFile(std::string filename) scanXmlData(answer_parser, "name", "url"); } -void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, - const char *bitratetag, bool usechild) +void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, const char *bitratetag, bool usechild) { #define IC_typetag "server_type" - if (answer_parser != NULL) { + if (answer_parser != NULL) + { xmlNodePtr element = xmlDocGetRootElement(answer_parser); element = xmlChildrenNode(element); xmlNodePtr element_tmp = element; - if (element == NULL) { + if (element == NULL) + { printf("[openFilebrowser] No valid XML File.\n"); - } else { + } + else + { CProgressWindow progress; long maxProgress = 1; // count # of entries - while (element) { + while (element) + { maxProgress++; element = xmlNextNode(element); } @@ -1128,10 +1182,11 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, long listPos = -1; progress.setTitle(LOCALE_AUDIOPLAYER_LOAD_RADIO_STATIONS); progress.exec(this, ""); - neutrino_msg_t msg; + neutrino_msg_t msg; neutrino_msg_data_t data; g_RCInput->getMsg(&msg, &data, 0); - while (element && msg != CRCInput::RC_home) { + while (element && msg != CRCInput::RC_home) + { const char *ptr = NULL; const char *name = NULL; const char *url = NULL; @@ -1146,33 +1201,40 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, CVFD::getInstance()->setMode(CVFD::MODE_PROGRESSBAR); #endif // LCD_UPDATE - if (usechild) { + if (usechild) + { const char *type = NULL; xmlNodePtr child = xmlChildrenNode(element); - while (child) { + while (child) + { if (strcmp(xmlGetName(child), nametag) == 0) name = xmlGetData(child); else if (strcmp(xmlGetName(child), urltag) == 0) url = xmlGetData(child); else if (strcmp(xmlGetName(child), IC_typetag) == 0) type = xmlGetData(child); - else if (bitratetag && strcmp(xmlGetName(child), bitratetag) == 0) { + else if (bitratetag && strcmp(xmlGetName(child), bitratetag) == 0) + { ptr = xmlGetData(child); if (ptr) bitrate = atoi(ptr); } child = xmlNextNode(child); } - if(type){ - if (strcmp("audio/mpeg", type) == 0) skip = false; - else if (strcmp("application/ogg", type) == 0) skip = false; - else if (strcmp("mp3", type) == 0) skip = false; - else if (strcmp("application/mp3", type) == 0) skip = false; + if (type) + { + if (strcmp("audio/mpeg", type) == 0) skip = false; + else if (strcmp("application/ogg", type) == 0) skip = false; + else if (strcmp("mp3", type) == 0) skip = false; + else if (strcmp("application/mp3", type) == 0) skip = false; } - } else { + } + else + { url = xmlGetAttribute(element, urltag); name = xmlGetAttribute(element, nametag); - if (bitratetag) { + if (bitratetag) + { ptr = xmlGetAttribute(element, bitratetag); if (ptr) bitrate = atoi(ptr); @@ -1180,7 +1242,8 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, skip = false; } - if ((url != NULL) && !skip) { + if ((url != NULL) && !skip) + { progress.showStatusMessageUTF(url); //printf("Processing %s, %s\n", url, name); if (strstr(url, ".m3u") || strstr(url, ".pls")) @@ -1203,12 +1266,11 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, bool CAudioPlayerGui::openFilebrowser(void) { bool result = false; - CFileBrowser filebrowser((g_settings.filebrowser_denydirectoryleave) - ? g_settings.network_nfs_audioplayerdir.c_str() : ""); + CFileBrowser filebrowser((g_settings.filebrowser_denydirectoryleave) ? g_settings.network_nfs_audioplayerdir.c_str() : ""); - filebrowser.Multi_Select = true; - filebrowser.Dirs_Selectable = true; - filebrowser.Filter = &audiofilefilter; + filebrowser.Multi_Select = true; + filebrowser.Dirs_Selectable = true; + filebrowser.Filter = &audiofilefilter; hide(); @@ -1243,16 +1305,17 @@ bool CAudioPlayerGui::openFilebrowser(void) CVFD::getInstance()->setMode(CVFD::MODE_PROGRESSBAR); #endif // LCD_UPDATE } - if ((files->getType() == CFile::FILE_CDR) - || (files->getType() == CFile::FILE_OGG) - || (files->getType() == CFile::FILE_MP3) - || (files->getType() == CFile::FILE_WAV) + if ( + (files->getType() == CFile::FILE_CDR) + || (files->getType() == CFile::FILE_OGG) + || (files->getType() == CFile::FILE_MP3) + || (files->getType() == CFile::FILE_WAV) #ifdef ENABLE_FFMPEGDEC - || (files->getType() == CFile::FILE_AAC) + || (files->getType() == CFile::FILE_AAC) #endif - || (files->getType() == CFile::FILE_FLAC) - || (files->getType() == CFile::FILE_FLV) - ) + || (files->getType() == CFile::FILE_FLAC) + || (files->getType() == CFile::FILE_FLV) + ) { CAudiofileExt audiofile(files->Name, files->getType()); @@ -1298,14 +1361,19 @@ bool CAudioPlayerGui::openFilebrowser(void) if (cLine[strlen(cLine)-1]=='\r') cLine[strlen(cLine)-1]=0; char *url = strstr(cLine, "http://"); - if (url != NULL) { + if (url != NULL) + { if (strstr(url, ".m3u") || strstr(url, ".pls")) processPlaylistUrl(url); else addUrl2Playlist(url, name, duration); - } else if ((url = strstr(cLine, "icy://")) != NULL) { + } + else if ((url = strstr(cLine, "icy://")) != NULL) + { addUrl2Playlist(url); - } else if ((url = strstr(cLine, "scast:://")) != NULL) { + } + else if ((url = strstr(cLine, "scast:://")) != NULL) + { addUrl2Playlist(url); } else @@ -1338,20 +1406,21 @@ bool CAudioPlayerGui::openFilebrowser(void) CFile playlistItem; playlistItem.Name = filename; CFile::FileType fileType = playlistItem.getType(); - if (fileType == CFile::FILE_CDR - || fileType == CFile::FILE_MP3 - || fileType == CFile::FILE_OGG - || fileType == CFile::FILE_WAV - || fileType == CFile::FILE_FLAC - || fileType == CFile::FILE_FLV - ) + if ( + fileType == CFile::FILE_CDR + || fileType == CFile::FILE_MP3 + || fileType == CFile::FILE_OGG + || fileType == CFile::FILE_WAV + || fileType == CFile::FILE_FLAC + || fileType == CFile::FILE_FLV + ) { CAudiofileExt audioFile(filename,fileType); addToPlaylist(audioFile); - } else + } + else { - printf("Audioplayer: file type (%d) is *not* supported in playlists\n(%s)\n", - fileType, filename.c_str()); + printf("Audioplayer: file type (%d) is *not* supported in playlists\n(%s)\n", fileType, filename.c_str()); } } } @@ -1377,7 +1446,7 @@ bool CAudioPlayerGui::openFilebrowser(void) printTimevalDiff(start,end); #endif //store last dir - if( (g_settings.network_nfs_audioplayerdir.size()) > m_Path.size() && g_settings.network_nfs_audioplayerdir != m_Path.c_str() ) + if (g_settings.network_nfs_audioplayerdir.size() > m_Path.size() && g_settings.network_nfs_audioplayerdir != m_Path.c_str()) g_settings.network_nfs_audioplayerdir = m_Path; result = true; @@ -1388,7 +1457,7 @@ bool CAudioPlayerGui::openFilebrowser(void) if (!m_show_playlist && !m_playlist.empty()) play(m_selected); - return ( result); + return result; } bool CAudioPlayerGui::openSCbrowser(void) @@ -1399,9 +1468,9 @@ bool CAudioPlayerGui::openSCbrowser(void) CFileBrowser filebrowser(sc_base_dir, CFileBrowser::ModeSC); - filebrowser.Multi_Select = true; - filebrowser.Dirs_Selectable = true; - filebrowser.Filter = NULL;//&audiofilefilter; + filebrowser.Multi_Select = true; + filebrowser.Dirs_Selectable = true; + filebrowser.Filter = NULL;//&audiofilefilter; hide(); @@ -1422,7 +1491,7 @@ bool CAudioPlayerGui::openSCbrowser(void) m_Path = filebrowser.getCurrentDir(); CFileList::const_iterator files = filebrowser.getSelectedFiles().begin(); - neutrino_msg_t msg; + neutrino_msg_t msg; neutrino_msg_data_t data; g_RCInput->getMsg(&msg, &data, 0); for (; (files != filebrowser.getSelectedFiles().end()) && (msg != CRCInput::RC_home); ++files) @@ -1459,7 +1528,7 @@ bool CAudioPlayerGui::openSCbrowser(void) if (!m_show_playlist && !m_playlist.empty()) play(m_selected); - return ( result); + return result; } void CAudioPlayerGui::hide() @@ -1467,10 +1536,8 @@ void CAudioPlayerGui::hide() // printf("hide(){\n"); if (m_visible) { - m_frameBuffer->paintBackgroundBoxRel(m_x - DETAILSLINE_WIDTH, m_y + m_title_height, - m_width + DETAILSLINE_WIDTH, m_height - m_title_height); - clearItemID3DetailsLine(); - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); + clearDetailsLine(); + m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_height); m_visible = false; } } @@ -1480,7 +1547,7 @@ void CAudioPlayerGui::paintItem(int pos) if (!m_show_playlist) return; - int ypos = m_y + m_title_height + m_theight + pos*m_fheight; + int ypos = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; unsigned int currpos = m_liststart + pos; bool i_selected = currpos == m_selected; @@ -1497,11 +1564,11 @@ void CAudioPlayerGui::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_selected) - paintItemID3DetailsLine(pos); + paintDetailsLine(pos); if (i_radius) - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, i_radius); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - SCROLLBAR_WIDTH, m_item_height, bgcolor, i_radius); if (currpos < m_playlist.size()) { @@ -1514,19 +1581,15 @@ void CAudioPlayerGui::paintItem(int pos) if (m_inetmode) snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); else - snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, - m_playlist[currpos].MetaData.total_time % 60); - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + 5; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, - tmp, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, dura, color, m_fheight); + snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); + + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + OFFSET_INNER_SMALL; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - w, tmp, color, m_item_height); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + m_item_height, w, dura, color, m_item_height); if (currpos == m_selected) { if (m_state == CAudioPlayerGui::STOP) - CVFD::getInstance()->showAudioTrack(m_playlist[currpos].MetaData.artist, - m_playlist[currpos].MetaData.title, - m_playlist[currpos].MetaData.album); + CVFD::getInstance()->showAudioTrack(m_playlist[currpos].MetaData.artist, m_playlist[currpos].MetaData.title, m_playlist[currpos].MetaData.album); } } } @@ -1536,7 +1599,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) @@ -1550,52 +1613,6 @@ void CAudioPlayerGui::paintHead() header.paint(CC_SAVE_SCREEN_NO); } -const struct button_label AudioPlayerButtons[][4] = -{ - { - { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, - { NEUTRINO_ICON_BUTTON_BACKWARD, LOCALE_AUDIOPLAYER_REWIND }, - { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, - { NEUTRINO_ICON_BUTTON_FORWARD , LOCALE_AUDIOPLAYER_FASTFORWARD }, - }, - { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE }, - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_SHUFFLE }, - }, - { - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_JUMP_BACKWARDS }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_JUMP_FORWARDS }, - }, - { - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_JUMP_BACKWARDS }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_AUDIOPLAYER_JUMP_FORWARDS }, - }, - { - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_SAVE_PLAYLIST }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_BUTTON_SELECT_TITLE_BY_ID }, - }, - { - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_SAVE_PLAYLIST }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_BUTTON_SELECT_TITLE_BY_NAME }, - }, - { - { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, - { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, - }, - { - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_INETRADIO_NAME }, - }, - { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE }, - { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_INETRADIO_NAME }, - }, -}; - void CAudioPlayerGui::paintFoot() { if (m_screensaver) @@ -1603,119 +1620,105 @@ void CAudioPlayerGui::paintFoot() const struct button_label SecondLineButtons[3] = { - { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, - { NEUTRINO_ICON_BUTTON_HELP , LOCALE_AUDIOPLAYER_KEYLEVEL }, - { NEUTRINO_ICON_BUTTON_INFO , LOCALE_PICTUREVIEWER_HEAD}, + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_AUDIOPLAYER_PLAY }, + { NEUTRINO_ICON_BUTTON_HELP, LOCALE_AUDIOPLAYER_KEYLEVEL }, + { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; - int top; - int c_rad_mid = RADIUS_MID; - if (m_show_playlist) - top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - else - top = m_y + (m_height - 2 * m_buttonHeight); + int button_y = m_y + m_height - m_info_height - OFFSET_INTER - 2*m_button_height; - m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_MENUFOOT_PLUS_0, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_MENUFOOT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - int bwidth = m_width - (2*c_rad_mid); if (!m_playlist.empty()) - ::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, bwidth, 3, SecondLineButtons, bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y + m_button_height, m_width, 3, SecondLineButtons, m_width, m_button_height); if (m_key_level == 0) { if (m_playlist.empty()) { if (m_inetmode) - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[7], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[7], m_width, m_button_height); else - ::paintButtons(m_x + c_rad_mid, top, bwidth, 1, &(AudioPlayerButtons[7][0]), bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 1, &(AudioPlayerButtons[7][0]), m_width, m_button_height); } else if (m_inetmode) - ::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[8], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[8], m_width, m_button_height); else - ::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[1], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[1], m_width, m_button_height); } else if (m_key_level == 1) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) - ::paintButtons(m_x + c_rad_mid, top, bwidth, 4, AudioPlayerButtons[0], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[0], m_width, m_button_height); else - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[6], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[6], m_width, m_button_height); } - else - { // key_level == 2 + else // key_level == 2 + { if (m_state == CAudioPlayerGui::STOP) { if (m_select_title_by_name) - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[5], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[5], m_width, m_button_height); else - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[4], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[4], m_width, m_button_height); } else { if (m_select_title_by_name) - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[3], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[3], m_width, m_button_height); else - ::paintButtons(m_x + c_rad_mid, top, bwidth, 2, AudioPlayerButtons[2], bwidth, m_buttonHeight); + ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[2], m_width, m_button_height); } } } void CAudioPlayerGui::paintCover() { - int c_rad_mid = RADIUS_MID; - int title_height = m_title_height; const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); - if (!m_show_playlist) // no playlist -> smaller Info-Box - title_height -= m_fheight; - std::string cover = m_curr_audiofile.Filename.substr(0, m_curr_audiofile.Filename.rfind('/')) + "/folder.jpg"; if (!meta.cover.empty()) cover = meta.cover; if (access(cover.c_str(), F_OK) == 0) - g_PicViewer->DisplayImage(cover, m_x + 2 + c_rad_mid/2, m_y + 2 + c_rad_mid/2, title_height - 14 - c_rad_mid, title_height - 14 - c_rad_mid, m_frameBuffer->TM_NONE); + g_PicViewer->DisplayImage(cover, m_x + OFFSET_INNER_MID, m_y + OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_frameBuffer->TM_NONE); } -void CAudioPlayerGui::paintInfo() +void CAudioPlayerGui::paintTitleBox() { if (m_screensaver) return; - int c_rad_mid = RADIUS_MID; - int title_height = m_title_height; - if (m_state == CAudioPlayerGui::STOP && m_show_playlist) m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); else { - if (!m_show_playlist) // no playlist -> smaller Info-Box - title_height -= m_fheight; - - m_frameBuffer->paintBoxRel(m_x + 1, m_y + 1 , m_width - 2, title_height - 12, COL_MENUCONTENTSELECTED_PLUS_0, c_rad_mid); - m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, title_height - 10, 2, COL_FRAME_PLUS_0, c_rad_mid); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); paintCover(); // first line (Track number) std::string tmp; - if (m_inetmode) { + if (m_inetmode) + { tmp = m_curr_audiofile.MetaData.album; - } else { + } + else + { char sNr[20]; sprintf(sNr, ": %2d", m_current + 1); tmp = g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYING); tmp += sNr ; } + // FIXME - there's no cover-check; so we maybe paint over the cover + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - int xstart = (m_width - w) / 2; - if (xstart < 10) - xstart = 10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_fheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + int xstart = (m_width - w)/2; + if (xstart < OFFSET_INNER_MID) + xstart = OFFSET_INNER_MID; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1730,24 +1733,24 @@ void CAudioPlayerGui::paintInfo() tmp += " / "; tmp += m_curr_audiofile.MetaData.artist; } - else //if(g_settings.audioplayer_display == ARTIST_TITLE) + else //if (g_settings.audioplayer_display == ARTIST_TITLE) { tmp = m_curr_audiofile.MetaData.artist; tmp += " / "; tmp += m_curr_audiofile.MetaData.title; } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - xstart=(m_width-w)/2; - if (xstart < 10) - xstart=10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x+xstart, m_y +4+ 2*m_fheight, m_width- 20, tmp, COL_MENUCONTENTSELECTED_TEXT); + xstart = (m_width - w)/2; + if (xstart < OFFSET_INNER_MID) + xstart = OFFSET_INNER_MID; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); // reset so fields get painted always m_metainfo.clear(); m_time_total = 0; m_time_played = 0; - updateMetaData(); + updateMetaData(); updateTimes(true); } } @@ -1757,66 +1760,63 @@ void CAudioPlayerGui::paint() if (m_show_playlist) { unsigned int tmp_max = m_listmaxshow; - if(!tmp_max) + if (!tmp_max) tmp_max = 1; m_liststart = (m_selected / tmp_max) * m_listmaxshow; paintHead(); for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_SCROLLBAR_PLUS_0); + //scrollbar + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, m_playlist.size(), m_listmaxshow, m_selected); - int sbc = ((m_playlist.size() - 1) / tmp_max) + 1; - int sbs = (m_selected / tmp_max); - if (sbc < 1) - sbc = 1; - - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_y + m_title_height + OFFSET_INTER + m_header_height, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); } - paintInfo(); + paintTitleBox(); paintFoot(); m_visible = true; } -void CAudioPlayerGui::clearItemID3DetailsLine () +void CAudioPlayerGui::clearDetailsLine() { - paintItemID3DetailsLine(-1); + paintDetailsLine(-1); } -void CAudioPlayerGui::paintItemID3DetailsLine (int pos) +void CAudioPlayerGui::paintDetailsLine(int pos) { - int xpos = m_x - DETAILSLINE_WIDTH; - int ypos1 = m_y + m_title_height + m_theight + pos*m_fheight; - int ypos2 = m_y + (m_height - m_info_height) + OFFSET_INTER; - int ypos1a = ypos1 + (m_fheight / 2); + int xpos = m_x - DETAILSLINE_WIDTH; + int ypos1 = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos2 = m_y + (m_height - m_info_height); + int ypos1a = ypos1 + (m_item_height / 2); int ypos2a = ypos2 + (m_info_height / 2); // clear details line - if (dline != NULL) + if (m_detailsline != NULL) { - dline->kill(); - dline = NULL; + m_detailsline->kill(); + m_detailsline = NULL; } // paint Line if detail info (and not valid list pos) and info box if (!m_playlist.empty() && (pos >= 0)) { //details line - if (dline == NULL) - dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); - dline->paint(false); + if (m_detailsline == NULL) + m_detailsline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, m_item_height/2, m_info_height - RADIUS_LARGE*2); + m_detailsline->paint(false); // paint id3 infobox - if (ibox == NULL){ - ibox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height); - ibox->setFrameThickness(2); - ibox->setCorner(RADIUS_LARGE); - ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); - ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); - ibox->forceTextPaint(false); + if (m_infobox == NULL) + { + m_infobox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height); + m_infobox->setFrameThickness(2); + m_infobox->setCorner(RADIUS_LARGE); + m_infobox->setColorFrame(COL_FRAME_PLUS_0); + m_infobox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + m_infobox->forceTextPaint(false); } //title @@ -1843,15 +1843,18 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) text_info += ')'; } - ibox->setText(text_info, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], COL_MENUCONTENT_TEXT); - ibox->paint(false); + // 'simulate' a second line; maybe usefull for some more informations e.g. url or so + text_info += "\n "; + + m_infobox->setText(text_info, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], COL_MENUCONTENTDARK_TEXT); + m_infobox->paint(false); } else { - if (dline != NULL) - dline->kill(); - if (ibox != NULL) - ibox->kill(); + if (m_detailsline != NULL) + m_detailsline->kill(); + if (m_infobox != NULL) + m_infobox->kill(); } } @@ -1865,7 +1868,7 @@ void CAudioPlayerGui::stop() //LCD paintLCD(); //Display - paintInfo(); + paintTitleBox(); m_key_level = 0; paintFoot(); } @@ -1876,9 +1879,11 @@ void CAudioPlayerGui::stop() void CAudioPlayerGui::pause() { - if (m_state == CAudioPlayerGui::PLAY - || m_state == CAudioPlayerGui::FF - || m_state == CAudioPlayerGui::REV) + if ( + m_state == CAudioPlayerGui::PLAY + || m_state == CAudioPlayerGui::FF + || m_state == CAudioPlayerGui::REV + ) { m_state = CAudioPlayerGui::PAUSE; CAudioPlayer::getInstance()->pause(); @@ -1898,9 +1903,11 @@ void CAudioPlayerGui::ff(unsigned int seconds) m_state = CAudioPlayerGui::PLAY; CAudioPlayer::getInstance()->ff(seconds); } - else if (m_state == CAudioPlayerGui::PLAY - || m_state == CAudioPlayerGui::PAUSE - || m_state == CAudioPlayerGui::REV) + else if ( + m_state == CAudioPlayerGui::PLAY + || m_state == CAudioPlayerGui::PAUSE + || m_state == CAudioPlayerGui::REV + ) { m_state = CAudioPlayerGui::FF; CAudioPlayer::getInstance()->ff(seconds); @@ -1915,9 +1922,11 @@ void CAudioPlayerGui::rev(unsigned int seconds) m_state = CAudioPlayerGui::PLAY; CAudioPlayer::getInstance()->rev(seconds); } - else if (m_state == CAudioPlayerGui::PLAY - || m_state == CAudioPlayerGui::PAUSE - || m_state == CAudioPlayerGui::FF) + else if ( + m_state == CAudioPlayerGui::PLAY + || m_state == CAudioPlayerGui::PAUSE + || m_state == CAudioPlayerGui::FF + ) { m_state = CAudioPlayerGui::REV; CAudioPlayer::getInstance()->rev(seconds); @@ -1982,7 +1991,7 @@ void CAudioPlayerGui::play(unsigned int pos) //LCD paintLCD(); // Display - paintInfo(); + paintTitleBox(); m_key_level = 1; paintFoot(); } @@ -2009,27 +2018,25 @@ void CAudioPlayerGui::updateMetaData() bool updateLcd = false; bool updateScreen = false; - if (m_state == CAudioPlayerGui::STOP || !m_show_playlist) + if (m_state == CAudioPlayerGui::STOP) return; - if ( CAudioPlayer::getInstance()->hasMetaDataChanged() - || m_metainfo.empty() ) + if (CAudioPlayer::getInstance()->hasMetaDataChanged() || m_metainfo.empty()) { - const CAudioMetaData meta = - CAudioPlayer::getInstance()->getMetaData(); + const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); std::stringstream info; info.precision(3); - if ( meta.bitrate > 0 ) + if (meta.bitrate > 0) { info << " / "; - if ( meta.vbr ) + if (meta.vbr) info << "VBR "; info << meta.bitrate/1000 << "kbps"; } - if ( meta.samplerate > 0 ) + if (meta.samplerate > 0) info << " / " << meta.samplerate/1000 << "." << (meta.samplerate/100)%10 <<"kHz"; m_metainfo = meta.type_info + info.str(); @@ -2053,7 +2060,7 @@ void CAudioPlayerGui::updateMetaData() updateLcd = true; } - if (!meta.sc_station.empty() && meta.sc_station != m_curr_audiofile.MetaData.album) + if (!meta.sc_station.empty() && meta.sc_station != m_curr_audiofile.MetaData.album) { m_curr_audiofile.MetaData.album = meta.sc_station; updateLcd = true; @@ -2063,22 +2070,21 @@ void CAudioPlayerGui::updateMetaData() paintCover(); } if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) - updateLcd = true; + updateLcd = true; //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); if (updateLcd) paintLCD(); if (updateScreen) - paintInfo(); + paintTitleBox(); if (updateMeta || updateScreen) { - m_frameBuffer->paintBoxRel(m_x + 10 + m_title_height, m_y + 4 + 2*m_fheight, m_width - 20 - m_title_height, m_sheight, COL_MENUCONTENTSELECTED_PLUS_0); - int xstart = ((m_width - 20 - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo))/2)+10; - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] - ->RenderString(m_x + xstart, m_y + 4 + 2*m_fheight + m_sheight, - m_width- 2*xstart, m_metainfo, COL_MENUCONTENTSELECTED_TEXT); + int cover_width = m_title_height + 2*OFFSET_INNER_MID; + m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - cover_width - OFFSET_INNER_MID, m_meta_height, COL_MENUHEAD_PLUS_0); + int xstart = ((m_width - 2*OFFSET_INNER_MID - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo))/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL + m_meta_height, m_width - 2*xstart, m_metainfo, COL_MENUHEAD_TEXT); } } @@ -2107,35 +2113,42 @@ void CAudioPlayerGui::updateTimes(const bool force) } if (!m_screensaver) { - char tot_time[11]; - snprintf(tot_time, 10, " / %ld:%02ld", m_time_total / 60, m_time_total % 60); - char tmp_time[8]; - snprintf(tmp_time, 7, "%ld:00", m_time_total / 60); - char play_time[8]; - snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60); + char total_time[11]; + snprintf(total_time, 10, " / %ld:%02ld", m_time_total / 60, m_time_total % 60); + char played_time[8]; + snprintf(played_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60); - int w1 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tot_time); - int w2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp_time); + int w_total_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(total_time); + int w_faked_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("000:00"); + int w_played_time = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(played_time); - if (updateTotal) + // in inetmode we havn't a total_time + if (m_inetmode) + w_total_time = 0; + + int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time; + // played time offset to align this value on the right side + int o_played_time = std::max(w_faked_time - w_played_time, 0); + int x_faked_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - w_faked_time; + int x_played_time = x_faked_time + o_played_time; + int y_times = m_y + OFFSET_INNER_SMALL; + + if (updateTotal && !m_inetmode) { - m_frameBuffer->paintBoxRel(m_x + m_width - w1 - 10, m_y + 4, w1 + 4, - m_fheight, COL_MENUCONTENTSELECTED_PLUS_0); + m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time + OFFSET_INNER_MID, m_item_height, COL_MENUHEAD_PLUS_0); if (m_time_total > 0) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w1 - 10, m_y + 4 + m_fheight, - w1, tot_time, COL_MENUCONTENTSELECTED_TEXT); + { + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT); + } } if (updatePlayed || (m_state == CAudioPlayerGui::PAUSE)) { - //m_frameBuffer->paintBoxRel(m_x + m_width - w1 - w2 - 15, m_y + 4, w2 + 4, m_fheight, - m_frameBuffer->paintBoxRel(m_x + m_width - w1 - w2 - 16, m_y + 4, w2 + 5, m_fheight, - COL_MENUCONTENTSELECTED_PLUS_0); + m_frameBuffer->paintBoxRel(x_faked_time, y_times, w_faked_time, m_item_height, COL_MENUHEAD_PLUS_0); struct timeval tv; gettimeofday(&tv, NULL); if ((m_state != CAudioPlayerGui::PAUSE) || (tv.tv_sec & 1)) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w1 - w2 - 11, m_y + 4 + m_fheight, - w2+4, play_time, COL_MENUCONTENTSELECTED_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_played_time, y_times + m_item_height, w_played_time, played_time, COL_MENUHEAD_TEXT); } } } @@ -2150,32 +2163,28 @@ void CAudioPlayerGui::paintLCD() { switch (m_state) { - case CAudioPlayerGui::STOP: - CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_STOP); - CVFD::getInstance()->showAudioProgress(0); - break; - case CAudioPlayerGui::PLAY: - CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PLAY); - CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, - m_curr_audiofile.MetaData.album); - if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0) - CVFD::getInstance()->showAudioProgress(uint8_t(100 * m_time_played / m_time_total)); - break; - case CAudioPlayerGui::PAUSE: - CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PAUSE); - CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, - m_curr_audiofile.MetaData.album); - break; - case CAudioPlayerGui::FF: - CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_FF); - CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, - m_curr_audiofile.MetaData.album); - break; - case CAudioPlayerGui::REV: - CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_REV); - CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, - m_curr_audiofile.MetaData.album); - break; + case CAudioPlayerGui::STOP: + CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_STOP); + CVFD::getInstance()->showAudioProgress(0); + break; + case CAudioPlayerGui::PLAY: + CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PLAY); + CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); + if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0) + CVFD::getInstance()->showAudioProgress(uint8_t(100 * m_time_played / m_time_total)); + break; + case CAudioPlayerGui::PAUSE: + CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PAUSE); + CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); + break; + case CAudioPlayerGui::FF: + CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_FF); + CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); + break; + case CAudioPlayerGui::REV: + CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_REV); + CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); + break; } } void CAudioPlayerGui::screensaver(bool on) @@ -2198,15 +2207,13 @@ void CAudioPlayerGui::GetMetaData(CAudiofileExt &File) bool ret = 1; if (File.FileType != CFile::STREAM_AUDIO && !File.MetaData.bitrate) - ret = CAudioPlayer::getInstance()->readMetaData( &File, - m_state != CAudioPlayerGui::STOP && - !g_settings.audioplayer_highprio); + ret = CAudioPlayer::getInstance()->readMetaData(&File, m_state != CAudioPlayerGui::STOP && !g_settings.audioplayer_highprio); - if (!ret || (File.MetaData.artist.empty() && File.MetaData.title.empty() )) + if (!ret || (File.MetaData.artist.empty() && File.MetaData.title.empty())) { //Set from Filename std::string tmp = File.Filename.substr(File.Filename.rfind('/') + 1); - tmp = tmp.substr(0,tmp.length()-4); //remove extension (.mp3) + tmp = tmp.substr(0,tmp.length() - 4); //remove extension (.mp3) std::string::size_type i = tmp.rfind(" - "); if (i != std::string::npos) { // Trennzeichen " - " gefunden @@ -2225,11 +2232,13 @@ void CAudioPlayerGui::GetMetaData(CAudiofileExt &File) File.MetaData.title = tmp; } File.MetaData.artist = FILESYSTEM_ENCODING_TO_UTF8_STRING(File.MetaData.artist); - File.MetaData.title = FILESYSTEM_ENCODING_TO_UTF8_STRING(File.MetaData.title ); + File.MetaData.title = FILESYSTEM_ENCODING_TO_UTF8_STRING(File.MetaData.title); } } -bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) { +bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) +{ + //FIXME - remove fixed values neutrino_msg_data_t data; int x1 = (g_settings.screen_EndX - g_settings.screen_StartX) / 2 + g_settings.screen_StartX - 50; @@ -2237,12 +2246,13 @@ bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) { char str[11]; do { + val = val * 10 + CRCInput::getNumericValue(msg); sprintf(str, "%d", val); int w = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(str); int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_FRAME_PLUS_0); - m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0); + m_frameBuffer->paintBoxRel(x1 - 6, y1 - h - 4, w + 12, h + 8, COL_MENUCONTENTSELECTED_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED_TEXT); while (true) { @@ -2266,7 +2276,8 @@ void CAudioPlayerGui::getFileInfoToDisplay(std::string &fileInfo, CAudiofileExt std::string artist; std::string title; - if (!m_inetmode) { + if (!m_inetmode) + { artist ="Artist?"; title = "Title?"; } @@ -2285,7 +2296,7 @@ void CAudioPlayerGui::getFileInfoToDisplay(std::string &fileInfo, CAudiofileExt if (!title.empty() && !artist.empty()) fileInfo += ", "; fileInfo += artist; } - else //if(g_settings.audioplayer_display == ARTIST_TITLE) + else //if (g_settings.audioplayer_display == ARTIST_TITLE) { fileInfo += artist; if (!title.empty() && !artist.empty()) fileInfo += ", "; @@ -2309,10 +2320,12 @@ void CAudioPlayerGui::getFileInfoToDisplay(std::string &fileInfo, CAudiofileExt void CAudioPlayerGui::addToPlaylist(CAudiofileExt &file) { //printf("add2Playlist: %s\n", file.Filename.c_str()); - if (m_select_title_by_name) { + if (m_select_title_by_name) + { std::string t = ""; getFileInfoToDisplay(t,file); - } else + } + else GetMetaData(file); m_playlist.push_back(file); @@ -2332,7 +2345,6 @@ void CAudioPlayerGui::removeFromPlaylist(long pos) if (m_select_title_by_name) { - #ifdef AUDIOPLAYER_TIME_DEBUG timeval start; gettimeofday(&start,NULL); @@ -2355,12 +2367,10 @@ void CAudioPlayerGui::removeFromPlaylist(long pos) // decrease position information for all titles with a position // behind item to delete long p = 0; - for (CTitle2Pos::iterator title=m_title2Pos.begin(); - title!=m_title2Pos.end(); ++title) + for (CTitle2Pos::iterator title=m_title2Pos.begin(); title!=m_title2Pos.end(); ++title) { CPosList newList; - for (CPosList::iterator posIt=title->second.begin(); - posIt!=title->second.end(); ++posIt) + for (CPosList::iterator posIt=title->second.begin(); posIt!=title->second.end(); ++posIt) { p = *(posIt); if (*posIt > pos) @@ -2397,7 +2407,7 @@ void CAudioPlayerGui::selectTitle(unsigned char selectionChar) } else { - if ( !it->second.empty() ) + if (!it->second.empty()) { i = *(it->second.begin()); //printf("using begin i: %ld\n",i); @@ -2434,13 +2444,11 @@ void CAudioPlayerGui::selectTitle(unsigned char selectionChar) void CAudioPlayerGui::printSearchTree() { - for (CTitle2Pos::iterator it=m_title2Pos.begin(); - it!=m_title2Pos.end(); ++it) + for (CTitle2Pos::iterator it=m_title2Pos.begin(); it!=m_title2Pos.end(); ++it) { printf("key: %c\n",it->first); long pos=-1; - for (CPosList::iterator it2=it->second.begin(); - it2!=it->second.end(); ++it2) + for (CPosList::iterator it2=it->second.begin(); it2!=it->second.end(); ++it2) { pos++; printf(" val: %ld ",*it2); @@ -2453,9 +2461,8 @@ void CAudioPlayerGui::printSearchTree() void CAudioPlayerGui::buildSearchTree() { - - // printf("before\n"); - // printSearchTree(); + //printf("before\n"); + //printSearchTree(); #ifdef AUDIOPLAYER_TIME_DEBUG timeval start; @@ -2471,15 +2478,13 @@ void CAudioPlayerGui::buildSearchTree() m_title2Pos.clear(); long listPos = -1; - for (CAudioPlayList::iterator it=m_playlist.begin(); - it!=m_playlist.end(); ++it) + for (CAudioPlayList::iterator it=m_playlist.begin(); it!=m_playlist.end(); ++it) { listPos++; progress.showStatus(100*listPos / maxProgress); progress.showStatusMessageUTF(it->Filename); unsigned char firstChar = getFirstChar(*it); - const std::pair item = - m_title2Pos.insert(CTitle2PosItem(firstChar,CPosList())); + const std::pair item = m_title2Pos.insert(CTitle2PosItem(firstChar,CPosList())); item.first->second.insert(listPos); } progress.hide(); @@ -2491,7 +2496,7 @@ void CAudioPlayerGui::buildSearchTree() printf("searchtree took: "); printTimevalDiff(start,end); #endif - // printf("after:\n"); + //printf("after:\n"); //printSearchTree(); } @@ -2509,7 +2514,6 @@ unsigned char CAudioPlayerGui::getFirstChar(CAudiofileExt &file) #ifdef AUDIOPLAYER_TIME_DEBUG void CAudioPlayerGui::printTimevalDiff(timeval &start, timeval &end) { - long secs = end.tv_sec - start.tv_sec; long usecs = end.tv_usec -start.tv_usec; if (usecs < 0) @@ -2608,17 +2612,15 @@ void CAudioPlayerGui::savePlaylist() // an error occured const int msgsize = 255; char msg[msgsize] = ""; - snprintf(msg, - msgsize, - "%s\n%s", - g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEERROR_MSG), - absPlaylistFilename.c_str()); + snprintf(msg, msgsize, + "%s\n%s", + g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEERROR_MSG), + absPlaylistFilename.c_str()); DisplayErrorMessage(msg); // refresh view this->paint(); - std::cout << "CAudioPlayerGui: could not create play list file " - << absPlaylistFilename << std::endl; + std::cout << "CAudioPlayerGui: could not create play list file " << absPlaylistFilename << std::endl; return; } // writing .m3u file @@ -2627,8 +2629,7 @@ void CAudioPlayerGui::savePlaylist() CAudioPlayList::const_iterator it; for (it = m_playlist.begin(); it!=m_playlist.end(); ++it) { - playlistFile << "#EXTINF:" << it->MetaData.total_time << "," - << it->MetaData.artist << " - " << it->MetaData.title << std::endl; + playlistFile << "#EXTINF:" << it->MetaData.total_time << "," << it->MetaData.artist << " - " << it->MetaData.title << std::endl; if (m_inetmode) playlistFile << it->Filename << std::endl; else @@ -2643,14 +2644,11 @@ bool CAudioPlayerGui::askToOverwriteFile(const std::string& filename) { char msg[filename.length() + 127]; - snprintf(msg, - filename.length() + 126, - "%s\n%s", - g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_MSG), - filename.c_str()); - bool res = (ShowMsg(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, - msg,CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) - == CMsgBox::mbrYes); + snprintf(msg, filename.length() + 126, + "%s\n%s", + g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_MSG), + filename.c_str()); + bool res = (ShowMsg(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); this->paint(); return res; } @@ -2663,8 +2661,8 @@ std::string CAudioPlayerGui::absPath2Rel(const std::string& fromDir, int length = fromDir.length() < absFilename.length() ? fromDir.length() : absFilename.length(); int lastSlash = 0; // find common prefix for both paths - // fromDir: /foo/bar/angle/1 (length: 16) - // absFilename: /foo/bar/devil/2/fire.mp3 (length: 19) + // fromDir: /foo/bar/angle/1 (length: 16) + // absFilename: /foo/bar/devil/2/fire.mp3 (length: 19) // -> /foo/bar/ is prefix, lastSlash will be 8 for (int i=0; i. */ #ifndef __audioplayergui__ @@ -55,212 +46,208 @@ typedef std::pair CTitle2PosItem; class CFrameBuffer; class CAudiofileExt : public CAudiofile { -public: + public: + CAudiofileExt(); - CAudiofileExt(); + CAudiofileExt(std::string name, CFile::FileType type); - CAudiofileExt(std::string name, CFile::FileType type); + CAudiofileExt(const CAudiofileExt& src); - CAudiofileExt(const CAudiofileExt& src); + void operator=(const CAudiofileExt& src); - void operator=(const CAudiofileExt& src); - - - char firstChar; + char firstChar; }; typedef std::vector CAudioPlayList; class RandomNumber { - public: - RandomNumber() - { - std::srand(time(0)); - } + public: + RandomNumber() { std::srand(time(0)); } - int operator()(int n){ - return std::rand() / (1.0 + RAND_MAX) * n; - } + int operator()(int n) { return std::rand() / (1.0 + RAND_MAX) * n; } }; class CAudioPlayerGui : public CMenuTarget { - public: - enum State - { - PLAY=0, - STOP, - PAUSE, - FF, - REV - }; + public: + enum State + { + PLAY=0, + STOP, + PAUSE, + FF, + REV + }; - enum DisplayOrder {ARTIST_TITLE = 0, TITLE_ARTIST=1}; + enum DisplayOrder + { + ARTIST_TITLE = 0, + TITLE_ARTIST=1 + }; - private: - void Init(void); - CFrameBuffer * m_frameBuffer; - unsigned int m_selected; - int m_current; - unsigned int m_liststart; - unsigned int m_listmaxshow; - int m_fheight; // Fonthoehe Playlist-Inhalt - int m_theight; // Fonthoehe Playlist-Titel - int m_sheight; // Fonthoehe MP Info - int m_buttonHeight; - int m_title_height; - int m_info_height; - int m_key_level; - bool m_visible; - State m_state; - time_t m_time_total; - time_t m_time_played; - std::string m_metainfo; - bool m_select_title_by_name; - bool m_show_playlist; + private: + void Init(void); + CFrameBuffer * m_frameBuffer; + unsigned int m_selected; + int m_current; + unsigned int m_liststart; + unsigned int m_listmaxshow; + int m_item_height; + int m_header_height; + int m_meta_height; + int m_button_height; + int m_title_height; + int m_info_height; + int m_key_level; + bool m_visible; + State m_state; + time_t m_time_total; + time_t m_time_played; + std::string m_metainfo; + bool m_select_title_by_name; + bool m_show_playlist; + bool m_playlistHasChanged; - bool m_playlistHasChanged; + CAudioPlayList m_playlist; + CAudioPlayList m_radiolist; + CAudioPlayList m_filelist; + CTitle2Pos m_title2Pos; + CAudiofileExt m_curr_audiofile; + std::string m_Path; - CAudioPlayList m_playlist; - CAudioPlayList m_radiolist; - CAudioPlayList m_filelist; - CTitle2Pos m_title2Pos; - CAudiofileExt m_curr_audiofile; - std::string m_Path; + int m_width; + int m_height; + int m_x; + int m_y; + int m_title_w; - int m_width; - int m_height; - int m_x; - int m_y; - int m_title_w; + int m_LastMode; + int m_idletime; + bool m_screensaver; + bool m_inetmode; + CComponentsDetailsLine *m_detailsline; + CComponentsInfoBox *m_infobox; - int m_LastMode; - int m_idletime; - bool m_screensaver; - bool m_inetmode; - CComponentsDetailsLine *dline; - CComponentsInfoBox *ibox; + SMSKeyInput m_SMSKeyInput; - SMSKeyInput m_SMSKeyInput; + void paintItem(int pos); + void paint(); + void paintHead(); + void paintFoot(); + void paintTitleBox(); + void paintCover(); + void paintLCD(); + void paintDetailsLine(int pos); + void clearDetailsLine(); + void hide(); - void paintItem(int pos); - void paint(); - void paintHead(); - void paintFoot(); - void paintInfo(); - void paintCover(); - void paintLCD(); - void hide(); + void get_id3(CAudiofileExt * audiofile); + void get_mp3info(CAudiofileExt * audiofile); + CFileFilter audiofilefilter; + void ff(unsigned int seconds=0); + void rev(unsigned int seconds=0); + int getNext(); + void GetMetaData(CAudiofileExt &File); + void updateMetaData(); + void updateTimes(const bool force = false); + void showMetaData(); + void screensaver(bool on); + bool getNumericInput(neutrino_msg_t& msg, int& val); - void get_id3(CAudiofileExt * audiofile); - void get_mp3info(CAudiofileExt * audiofile); - CFileFilter audiofilefilter; - void paintItemID3DetailsLine (int pos); - void clearItemID3DetailsLine (); - void ff(unsigned int seconds=0); - void rev(unsigned int seconds=0); - int getNext(); - void GetMetaData(CAudiofileExt &File); - void updateMetaData(); - void updateTimes(const bool force = false); - void showMetaData(); - void screensaver(bool on); - bool getNumericInput(neutrino_msg_t& msg,int& val); + void addToPlaylist(CAudiofileExt &file); + void removeFromPlaylist(long pos); - void addToPlaylist(CAudiofileExt &file); - void removeFromPlaylist(long pos); + /** + * Adds an url (shoutcast, ...) to the to the audioplayer playlist + */ + void addUrl2Playlist(const char *url, const char *name = NULL, const time_t bitrate = 0); - /** - * Adds an url (shoutcast, ...) to the to the audioplayer playlist - */ - void addUrl2Playlist(const char *url, const char *name = NULL, const time_t bitrate = 0); + /** + * Adds a url which points to an .m3u format (playlist, ...) to the audioplayer playlist + */ + void processPlaylistUrl(const char *url, const char *name = NULL, const time_t bitrate = 0); - /** - * Adds a url which points to an .m3u format (playlist, ...) to the audioplayer playlist - */ - void processPlaylistUrl(const char *url, const char *name = NULL, const time_t bitrate = 0); + /** + * Loads a given XML file of internet audiostreams or playlists and processes them + */ + void scanXmlFile(std::string filename); - /** - * Loads a given XML file of internet audiostreams or playlists and processes them - */ - void scanXmlFile(std::string filename); + /** + * Processes a loaded XML file/data of internet audiostreams or playlists + */ + void scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, const char *bitratetag = NULL, bool usechild = false); - /** - * Processes a loaded XML file/data of internet audiostreams or playlists - */ - void scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, const char *bitratetag = NULL, bool usechild = false); + /** + * Reads the icecast directory (XML file) and calls scanXmlData + */ + void readDir_ic(void); - /** - * Reads the icecast directory (XML file) and calls scanXmlData - */ - void readDir_ic(void); + void selectTitle(unsigned char selectionChar); - void selectTitle(unsigned char selectionChar); - /** - * Appends the file information to the given string. - * @param fileInfo a string where the file information will be appended - * @param file the file to return the information for - */ - void getFileInfoToDisplay(std::string& fileInfo, CAudiofileExt &file); + /** + * Appends the file information to the given string. + * @param fileInfo a string where the file information will be appended + * @param file the file to return the information for + */ + void getFileInfoToDisplay(std::string& fileInfo, CAudiofileExt &file); - void printSearchTree(); + void printSearchTree(); - void buildSearchTree(); + void buildSearchTree(); - unsigned char getFirstChar(CAudiofileExt &file); + unsigned char getFirstChar(CAudiofileExt &file); - void printTimevalDiff(timeval &start, timeval &end); + void printTimevalDiff(timeval &start, timeval &end); - /** - * Saves the current playlist into a .m3u playlist file. - */ - void savePlaylist(); + /** + * Saves the current playlist into a .m3u playlist file. + */ + void savePlaylist(); - /** - * Converts an absolute filename to a relative one - * as seen from a file in fromDir. - * Example: - * absFilename: /mnt/audio/A/abc.mp3 - * fromDir: /mnt/audio/B - * => ../A/abc.mp3 will be returned - * @param fromDir the directory from where we want to - * access the file - * @param absFilename the file we want to access in a - * relative way from fromDir (given as an absolute path) - * @return the location of absFilename as seen from fromDir - * (relative path) - */ - std::string absPath2Rel(const std::string& fromDir, - const std::string& absFilename); + /** + * Converts an absolute filename to a relative one + * as seen from a file in fromDir. + * Example: + * absFilename: /mnt/audio/A/abc.mp3 + * fromDir: /mnt/audio/B + * => ../A/abc.mp3 will be returned + * @param fromDir the directory from where we want to + * access the file + * @param absFilename the file we want to access in a + * relative way from fromDir (given as an absolute path) + * @return the location of absFilename as seen from fromDir + * (relative path) + */ + std::string absPath2Rel(const std::string& fromDir, const std::string& absFilename); - /** - * Asks the user if the file filename should be overwritten or not - * @param filename the name of the file - * @return true if file should be overwritten, false otherwise - */ - bool askToOverwriteFile(const std::string& filename); - bool openFilebrowser(void); - bool openSCbrowser(void); - bool clearPlaylist(void); - bool shufflePlaylist(void); + /** + * Asks the user if the file filename should be overwritten or not + * @param filename the name of the file + * @return true if file should be overwritten, false otherwise + */ + bool askToOverwriteFile(const std::string& filename); - bool pictureviewer; + bool openFilebrowser(void); + bool openSCbrowser(void); + bool clearPlaylist(void); + bool shufflePlaylist(void); - public: - CAudioPlayerGui(bool inetmode = false); - ~CAudioPlayerGui(); - int show(); - int exec(CMenuTarget* parent, const std::string & actionKey); + bool pictureviewer; - void wantNextPlay(); - void pause(); - void play(unsigned int pos); - void stop(); - bool playNext(bool allow_rotate = false); - bool playPrev(bool allow_rotate = false); - int getAudioPlayerM_current() {return m_current;} + public: + CAudioPlayerGui(bool inetmode = false); + ~CAudioPlayerGui(); + int show(); + int exec(CMenuTarget* parent, const std::string & actionKey); + + void wantNextPlay(); + void pause(); + void play(unsigned int pos); + void stop(); + bool playNext(bool allow_rotate = false); + bool playPrev(bool allow_rotate = false); + int getAudioPlayerM_current() { return m_current; } }; - #endif From 5f1d85300f44367d25dcad668dd5dd955979f421 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 299/394] CMenuOptionChooser: clean up multiple code parts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8899660dad7229e2639c85398a6bc3c7666e35eb Author: Thilo Graf Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 152 ++++++++++++++++----------------------- src/gui/widget/menue.h | 24 ++++--- 2 files changed, 74 insertions(+), 102 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index ef4905cf3..d7b1be5ab 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1703,104 +1703,52 @@ int CMenuOptionNumberChooser::getWidth(void) return width; } -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, - const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionChooser::CMenuOptionChooser( const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const size_t Number_Of_Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = ""; - name = OptionName; - optionValue = OptionValue; - number_of_options = Number_Of_Options; - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; - for (unsigned int i = 0; i < number_of_options; i++) - { - struct keyval_ext opt; - opt = Options[i]; - options.push_back(opt); - } + init("", OptionName, OptionValue, Options, NULL, NULL, Number_Of_Options, Observ, Pulldown, OptionsSort); } -CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, - const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionChooser::CMenuOptionChooser( const std::string &OptionName, int * const OptionValue, const struct keyval * const Options, const size_t Number_Of_Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = OptionName; - name = NONEXISTANT_LOCALE; - optionValue = OptionValue; - number_of_options = Number_Of_Options; - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; - for (unsigned int i = 0; i < number_of_options; i++) - { - struct keyval_ext opt; - opt = Options[i]; - options.push_back(opt); - } + init(OptionName, NONEXISTANT_LOCALE, OptionValue, Options, NULL, NULL, Number_Of_Options, Observ, Pulldown, OptionsSort); } -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval_ext * const Options, - const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionChooser::CMenuOptionChooser( const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval_ext * const Options, const size_t Number_Of_Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = ""; - name = OptionName; - optionValue = OptionValue; - number_of_options = Number_Of_Options; - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; - for (unsigned int i = 0; i < number_of_options; i++) - options.push_back(Options[i]); + init("", OptionName, OptionValue, NULL, Options, NULL, Number_Of_Options, Observ, Pulldown, OptionsSort); } -CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, const struct keyval_ext * const Options, - const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionChooser::CMenuOptionChooser( const std::string &OptionName, int * const OptionValue, const struct keyval_ext * const Options, const size_t Number_Of_Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = OptionName; - name = NONEXISTANT_LOCALE; - optionValue = OptionValue; - number_of_options = Number_Of_Options; - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; - for (unsigned int i = 0; i < number_of_options; i++) - options.push_back(Options[i]); + init(OptionName, NONEXISTANT_LOCALE, OptionValue, NULL, Options, NULL, Number_Of_Options, Observ, Pulldown, OptionsSort); } -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, std::vector &Options, - const bool Active, CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionChooser::CMenuOptionChooser( const neutrino_locale_t OptionName, int * const OptionValue, std::vector &Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = ""; - name = OptionName; - optionValue = OptionValue; - options = Options; - number_of_options = options.size(); - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; + init("", OptionName, OptionValue, NULL, NULL, &Options, Options.size(), Observ, Pulldown, OptionsSort); } CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, std::vector &Options, const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - nameString = OptionName; - name = NONEXISTANT_LOCALE; - optionValue = OptionValue; - options = Options; - number_of_options = options.size(); - observ = Observ; - pulldown = Pulldown; - optionsSort = OptionsSort; + init(OptionName, NONEXISTANT_LOCALE, OptionValue, NULL, NULL, &Options, Options.size(), Observ, Pulldown, OptionsSort); } CMenuOptionChooser::~CMenuOptionChooser() @@ -1808,26 +1756,48 @@ CMenuOptionChooser::~CMenuOptionChooser() clearChooserOptions(); } -void CMenuOptionChooser::initVarOptionChooser( const std::string &OptionName, - const neutrino_locale_t Name, - int * const OptionValue, - const bool Active, - CChangeObserver * const Observ, - neutrino_msg_t DirectKey, - const char * IconName, - bool Pulldown, - bool OptionsSort) +void CMenuOptionChooser::init( const std::string &OptionName, + const neutrino_locale_t Name, + int * const OptionValue, + const struct keyval * const Options, + const struct keyval_ext * const OptionsExt, + std::vector * v_Options, + const size_t Number_Of_Options, + CChangeObserver * const Observ, + bool Pulldown, + bool OptionsSort) { height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); nameString = OptionName; name = Name; optionValue = OptionValue; - active = Active; + number_of_options = Number_Of_Options; observ = Observ; - directKey = DirectKey; - iconName = IconName; pulldown = Pulldown; optionsSort = OptionsSort; + + if (Options || OptionsExt) + { + if (Options) + { + for (unsigned int i = 0; i < number_of_options; i++) + { + struct keyval_ext opt; + opt = Options[i]; + options.push_back(opt); + } + } + + if (OptionsExt) + { + for (unsigned int i = 0; i < number_of_options; i++) + options.push_back(OptionsExt[i]); + } + } + else{ + if (v_Options) + options = *v_Options; + } } void CMenuOptionChooser::clearChooserOptions() diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index ff4f3e008..73512ac9f 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -386,39 +386,40 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser private: std::vector options; std::vector option_chooser_options_v; - unsigned number_of_options; + size_t number_of_options; CChangeObserver * observ; bool pulldown; bool optionsSort; void clearChooserOptions(); - void initVarOptionChooser( const std::string &OptionName, + void init( const std::string &OptionName, const neutrino_locale_t Name, int * const OptionValue, - const bool Active, + const struct keyval * const Options, + const struct keyval_ext * const OptionsExt, + std::vector * v_Options, + const size_t Number_Of_Options, CChangeObserver * const Observ, - neutrino_msg_t DirectKey, - const char * IconName, bool Pulldown, bool OptionsSort - ); + ); public: CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval * const Options, - const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, bool Pulldown = false, bool OptionsSort = false); CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval_ext * const Options, - const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, bool Pulldown = false, bool OptionsSort = false); CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval * const Options, - const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, - bool Pulldown = false, bool OptionsSort = false); + bool size_t = false, bool OptionsSort = false); CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval_ext * const Options, - const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, bool Pulldown = false, bool OptionsSort = false); CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, std::vector &Options, @@ -429,6 +430,7 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, bool Pulldown = false, bool OptionsSort = false); + ~CMenuOptionChooser(); void setOption(const int newvalue); From cd712fe5d586b129cf963669a5843efdd0bbb06d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 300/394] CMenuOptionStringChooser: clean up multiple code parts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/284dba8c253a0fa7c2ea4b39745aecc116ce903c Author: Thilo Graf Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 31 ++++++++++++++++++------------- src/gui/widget/menue.h | 5 +++++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d7b1be5ab..6dadde798 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2000,24 +2000,29 @@ int CMenuOptionChooser::getWidth(void) //------------------------------------------------------------------------------------------------------------------------------- -CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) - : CMenuItem(Active, DirectKey, IconName) +CMenuOptionStringChooser::CMenuOptionStringChooser( const neutrino_locale_t OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) { - nameString = ""; - name = OptionName; - optionValuePtr = OptionValue ? OptionValue : &optionValue; - observ = Observ; - pulldown = Pulldown; + init("", OptionName, OptionValue, Observ, Pulldown); } -CMenuOptionStringChooser::CMenuOptionStringChooser(const std::string &OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) - : CMenuItem(Active, DirectKey, IconName) +CMenuOptionStringChooser::CMenuOptionStringChooser( const std::string &OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) +{ + init(OptionName, NONEXISTANT_LOCALE, OptionValue, Observ, Pulldown); +} + +void CMenuOptionStringChooser::init( const std::string &OptionName, + const neutrino_locale_t Name, + std::string* pOptionValue, + CChangeObserver * const Observ, + bool Pulldown) { nameString = OptionName; - name = NONEXISTANT_LOCALE; - optionValuePtr = OptionValue ? OptionValue : &optionValue; + name = Name; + optionValuePtr = pOptionValue ? pOptionValue : &optionValue; observ = Observ; pulldown = Pulldown; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 73512ac9f..b059ed525 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -453,6 +453,11 @@ class CMenuOptionStringChooser : public CMenuItem std::vector options; CChangeObserver * observ; bool pulldown; + void init( const std::string &OptionName, + const neutrino_locale_t Name, + std::string* pOptionValue, + CChangeObserver * const Observ, + bool Pulldown ); public: CMenuOptionStringChooser(const neutrino_locale_t Name, std::string* OptionValue, bool Active = false, From 65a2486250a932cdd2159a09e0476f394fc072ba Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 301/394] CMenuForwarder: clean up multiple code parts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b3ce6f330bffa348bcca2d38971179178e7f5ab Author: Thilo Graf Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 74 +++++++++++++++++++++------------------- src/gui/widget/menue.h | 6 ++++ 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 6dadde798..008017dee 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2127,48 +2127,52 @@ int CMenuOptionStringChooser::paint( bool selected ) } //------------------------------------------------------------------------------------------------------------------------------- -CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, - neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) - : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +CMenuForwarder::CMenuForwarder( const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) { - option_string_ptr = &Option; - name = Text; - nameString = ""; - jumpTarget = Target; - actionKey = ActionKey ? ActionKey : ""; + init("", Text, Option, NULL, Target, ActionKey); } -CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, - neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) - : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +CMenuForwarder::CMenuForwarder( const std::string& Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +{ + init(Text, NONEXISTANT_LOCALE, Option, NULL, Target, ActionKey); +} + +CMenuForwarder::CMenuForwarder( const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +{ + init("", Text, "", Option, Target, ActionKey); +} + +CMenuForwarder::CMenuForwarder( const std::string& Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +{ + init(Text, NONEXISTANT_LOCALE, "", Option, Target, ActionKey); +} + +void CMenuForwarder::init( const std::string &Text, + const neutrino_locale_t Name, + const std::string &sOption, + const char * const cOption, + CMenuTarget* Target, + const char * const ActionKey) { - option_string_ptr = &Option; - name = NONEXISTANT_LOCALE; nameString = Text; - jumpTarget = Target; - actionKey = ActionKey ? ActionKey : ""; -} + name = Name; -CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, - neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) - : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) -{ - option_string = Option ? Option : ""; - option_string_ptr = &option_string; - name = Text; - nameString = ""; - jumpTarget = Target; - actionKey = ActionKey ? ActionKey : ""; -} + if (sOption.empty()) + { + option_string = cOption ? cOption : ""; + option_string_ptr = &option_string; + } + else + option_string_ptr = &sOption; -CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, - neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) - : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) -{ - option_string = Option ? Option : ""; - option_string_ptr = &option_string; - name = NONEXISTANT_LOCALE; - nameString = Text; jumpTarget = Target; actionKey = ActionKey ? ActionKey : ""; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index b059ed525..d9726588e 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -231,6 +231,12 @@ class CMenuSeparator : public CMenuItem class CMenuForwarder : public CMenuItem { std::string actionKey; + void init( const std::string &OptionName, + const neutrino_locale_t Name, + const std::string &sOption, + const char * const cOption, + CMenuTarget* Target, + const char * const ActionKey); protected: std::string option_string; From b0d7a2a488cf477151d6d471b8edfb0728b5aab2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 302/394] CMenuOptionNumberChooser: clean up multiple code parts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f2e8f95e66b76b3f28230ecd306898ace4e77f14 Author: Thilo Graf Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 87 ++++++++++++++++++---------------------- src/gui/widget/menue.h | 11 +++++ 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 008017dee..768daf514 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1525,61 +1525,50 @@ void CMenuWidget::setFooter(const struct button_label *_fbutton_labels, const in //------------------------------------------------------------------------------------------------------------------------------- -CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t Name, int * const OptionValue, const bool Active, - const int min_value, const int max_value, - CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, - const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionNumberChooser::CMenuOptionNumberChooser( const neutrino_locale_t Name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, + CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, + const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - name = Name; - optionValue = OptionValue; - - lower_bound = min_value; - upper_bound = max_value; - - display_offset = print_offset; - - localized_value = special_value; - localized_value_name = special_value_name; - - display_offset = print_offset; - nameString = ""; - numberFormat = "%d"; - numberFormatFunction = NULL; - observ = Observ; - slider_on = sliderOn; - - numeric_input = false; - - directKeyOK = false; + init(Name, "", OptionValue, min_value, max_value, print_offset, special_value, special_value_name, Observ, sliderOn); } -CMenuOptionNumberChooser::CMenuOptionNumberChooser(const std::string &Name, int * const OptionValue, const bool Active, - const int min_value, const int max_value, - CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, - const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) - : CAbstractMenuOptionChooser(Active, DirectKey, IconName) +CMenuOptionNumberChooser::CMenuOptionNumberChooser( const std::string &Name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, + CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, + const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - name = NONEXISTANT_LOCALE; - optionValue = OptionValue; + init(NONEXISTANT_LOCALE, Name, OptionValue, min_value, max_value, print_offset, special_value, special_value_name, Observ, sliderOn); +} - lower_bound = min_value; - upper_bound = max_value; +void CMenuOptionNumberChooser::init( const neutrino_locale_t& lName, + const std::string &sName, + int* const Option_Value, + const int& min_value, + const int& max_value, + const int& print_offset, + const int& special_value, + const neutrino_locale_t& special_value_name, + CChangeObserver * const Observ, + bool sliderOn) +{ + name = lName; + nameString = sName; + optionValue = Option_Value; + lower_bound = min_value; + upper_bound = max_value; + display_offset = print_offset; + localized_value = special_value; + localized_value_name = special_value_name; + observ = Observ; + slider_on = sliderOn; - display_offset = print_offset; - - localized_value = special_value; - localized_value_name = special_value_name; - - nameString = Name; - numberFormat = "%d"; - numberFormatFunction = NULL; - observ = Observ; - slider_on = sliderOn; - - numeric_input = false; - - directKeyOK = false; + numberFormat = "%d"; + numberFormatFunction = NULL; + directKeyOK = false; + numeric_input = false; } int CMenuOptionNumberChooser::exec(CMenuTarget*) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index d9726588e..464be99f4 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -325,6 +325,17 @@ private: std::string numberFormat; std::string (*numberFormatFunction)(int num); + void init( const neutrino_locale_t& lName, + const std::string &sName, + int* const Option_Value, + const int& min_value, + const int& max_value, + const int& print_offset, + const int& special_value, + const neutrino_locale_t& special_value_name, + CChangeObserver * const Observ, + bool sliderOn); + public: CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ = NULL, From b295c863d0d1a84bf4191c4418c18ddf5ae20651 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Jun 2017 00:04:40 +0200 Subject: [PATCH 303/394] CMenuSeparator: clean up multiple code parts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/326a9634e1e06d6046b2c4a4c249898ebd8f1618 Author: Thilo Graf Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 14 ++++++++------ src/gui/widget/menue.h | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 768daf514..be765c30c 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2231,18 +2231,20 @@ int CMenuForwarder::paint(bool selected) //------------------------------------------------------------------------------------------------------------------------------- CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) { - type = Type; - name = Text; - nameString = ""; + init(Type, Text, ""); } CMenuSeparator::CMenuSeparator(const int Type, const std::string &Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) { - type = Type; - name = NONEXISTANT_LOCALE; - nameString = Text; + init(Type, NONEXISTANT_LOCALE, Text); } +void CMenuSeparator::init(const int& Type, const neutrino_locale_t& lText, const std::string &sText) +{ + type = Type; + name = lText; + nameString = sText; +} int CMenuSeparator::getHeight(void) { diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 464be99f4..3b47f51de 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -202,6 +202,9 @@ class CMenuItem : public CComponentsSignals class CMenuSeparator : public CMenuItem { int type; + void init( const int& Type, + const neutrino_locale_t& lText, + const std::string& sText); public: From 17b08e16ba03d43cbbedaecdf6e9cb09a04186fb Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 18 Jun 2017 21:43:34 +0200 Subject: [PATCH 304/394] try to fix versio check for ffmpeg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0bc31c6397e0a76afbdde9715497bab210bdf40e Author: Jacek Jendrzej Date: 2017-06-18 (Sun, 18 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 dc49aea02..19c48a9eb 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 ace7de81e..83d9bd6a4 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) 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 ee9438cce..79da7d7f0 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -850,7 +850,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 (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -923,7 +923,7 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; From 9a8b058b878b3b0656c235518255a933c8dff4bd Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 18 Jun 2017 15:06:11 +0200 Subject: [PATCH 305/394] progresswindow: fix progressbar if both bars have the same value (thx dbo) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac46bb04929e596479df90e1bd4dffa1f5aef52a Author: TangoCash Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ -progresswindow: fix progressbar if both bars have the same value (thx dbo) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 16 +++++++--------- src/gui/widget/progresswindow.h | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 68b416439..d1e0ae642 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -79,7 +79,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = percent_progress = 0; + global_progress = local_progress = 0; showFooter(false); @@ -131,15 +131,13 @@ void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max { pBar->allowPaint(true); unsigned int cur_perc = prog*100/(max+1); - if (percent_progress != cur_perc || prog == 0){ - pBar->setValues(prog, (int)max); - if (!statusText.empty() && (cur_statusText != statusText)){ - showStatusMessageUTF(statusText); - cur_statusText = statusText; - } - pBar->paint(false); - percent_progress = cur_perc; + pBar->setValues(prog, (int)max); + if (!statusText.empty() && (cur_statusText != statusText)){ + showStatusMessageUTF(statusText); + cur_statusText = statusText; } + pBar->paint(false); + frameBuffer->blit(); } void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 1be4255a9..da88911f3 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -39,7 +39,6 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; - unsigned int percent_progress; std::string cur_statusText; int h_height; void Init( sigc::signal *statusSignal, From 6676157b0f1567149fec493c070d9086d2518863 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 20 Jun 2017 09:54:52 +0200 Subject: [PATCH 306/394] CProgressWindow: remove unused variable fix for possible compiler error with -Werror=unused-variable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/64396a1c5e9b831b13a6c252e9cd1cb2aa87c67c Author: Thilo Graf Date: 2017-06-20 (Tue, 20 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index d1e0ae642..983ff2aac 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -130,7 +130,6 @@ CProgressBar* CProgressWindow::getProgressItem() void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); - unsigned int cur_perc = prog*100/(max+1); pBar->setValues(prog, (int)max); if (!statusText.empty() && (cur_statusText != statusText)){ showStatusMessageUTF(statusText); From bf6c0109b42170546a79e08105efc6ea7e36706e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 23:27:45 +0200 Subject: [PATCH 307/394] audioplayer: minor format changes in title box Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cd6c123e561e569b7626202f3764cf1f347639ef Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - audioplayer: minor format changes in title box Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 1434f822c..2bf432701 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1730,13 +1730,13 @@ void CAudioPlayerGui::paintTitleBox() else if (g_settings.audioplayer_display == TITLE_ARTIST) { tmp = m_curr_audiofile.MetaData.title; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.artist; } else //if (g_settings.audioplayer_display == ARTIST_TITLE) { tmp = m_curr_audiofile.MetaData.artist; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.title; } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); From ac9b77d198a274ea15e49361582573f228f067dc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 23:54:43 +0200 Subject: [PATCH 308/394] audioplayer: don't show not recognized bitrates Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1460ef90515ab991cc3183e55d61b3ce06f2670 Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - audioplayer: don't show not recognized bitrates Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 2bf432701..cdfd4eb28 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1577,9 +1577,12 @@ void CAudioPlayerGui::paintItem(int pos) std::string tmp = sNr; getFileInfoToDisplay(tmp, m_playlist[currpos]); - char dura[9]; + char dura[9] = {0}; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + { + if (m_playlist[currpos].MetaData.total_time != 0) + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + } else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); @@ -2070,7 +2073,7 @@ void CAudioPlayerGui::updateMetaData() paintCover(); } if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) - updateLcd = true; + updateLcd = true; //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); if (updateLcd) From 3d99119ebe151fba96934de9845a26e9cd46ae2d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 09:33:11 +0200 Subject: [PATCH 309/394] audioplayer: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37e5f8032e07108ebf3f82b9a08a99cd9f286c70 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - audioplayer: add shadow to gui-elements Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index cdfd4eb28..0cc052a6f 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -297,8 +297,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); - m_listmaxshow = (m_height - m_title_height - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_INTER - m_info_height) / (m_item_height); - m_height = m_title_height + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_INTER + m_info_height; // recalc height + m_listmaxshow = (m_height - m_title_height - OFFSET_SHADOW - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_SHADOW - OFFSET_INTER - m_info_height - OFFSET_SHADOW) / (m_item_height); + m_height = m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_SHADOW + OFFSET_INTER + m_info_height + OFFSET_SHADOW; // recalc height m_x = getScreenStartX(m_width); if (m_x < DETAILSLINE_WIDTH) @@ -1547,7 +1547,7 @@ void CAudioPlayerGui::paintItem(int pos) if (!m_show_playlist) return; - int ypos = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos = m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + pos*m_item_height; unsigned int currpos = m_liststart + pos; bool i_selected = currpos == m_selected; @@ -1602,7 +1602,8 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) @@ -1628,7 +1629,10 @@ void CAudioPlayerGui::paintFoot() { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; - int button_y = m_y + m_height - m_info_height - OFFSET_INTER - 2*m_button_height; + int button_y = m_y + m_height - OFFSET_SHADOW - m_info_height - OFFSET_INTER - OFFSET_SHADOW - 2*m_button_height; + + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); @@ -1696,6 +1700,9 @@ void CAudioPlayerGui::paintTitleBox() m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); else { + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); @@ -1770,12 +1777,15 @@ void CAudioPlayerGui::paint() for (unsigned int count=0; countpaintBoxRel(m_x + m_width, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); } paintTitleBox(); @@ -1791,8 +1801,8 @@ void CAudioPlayerGui::clearDetailsLine() void CAudioPlayerGui::paintDetailsLine(int pos) { int xpos = m_x - DETAILSLINE_WIDTH; - int ypos1 = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; - int ypos2 = m_y + (m_height - m_info_height); + int ypos1 = m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos2 = m_y + (m_height - OFFSET_SHADOW - m_info_height); int ypos1a = ypos1 + (m_item_height / 2); int ypos2a = ypos2 + (m_info_height / 2); @@ -1819,6 +1829,7 @@ void CAudioPlayerGui::paintDetailsLine(int pos) m_infobox->setCorner(RADIUS_LARGE); m_infobox->setColorFrame(COL_FRAME_PLUS_0); m_infobox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + m_infobox->enableShadow(CC_SHADOW_ON, -1, true); m_infobox->forceTextPaint(false); } From 4f92e2ec9b91d06f07d6e9b5a33de477a9185fb8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 310/394] pictureviewer: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/26d1cb31fa9c3743d27e418dacc16024971d2146 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - pictureviewer: add shadow to gui-elements Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/pictureviewer.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 50d9a7086..2cdd04039 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -170,8 +170,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) buttons2_height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footer_height = buttons1_height + buttons2_height; - listmaxshow = (height - header_height - footer_height)/item_height; - height = header_height + listmaxshow*item_height + footer_height; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW)/item_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; // recalc height x=getScreenStartX(width); y=getScreenStartY(height); @@ -702,6 +702,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT header.setContextButton(NEUTRINO_ICON_BUTTON_MENU); @@ -719,15 +720,20 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footer_height), width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + int footer_y = y + (height - footer_height - OFFSET_SHADOW); + + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { - ::paintButtons(x, y + (height - footer_height), 0, PictureViewerButtons1Count, PictureViewerButtons1, width); - ::paintButtons(x, y + (height - buttons2_height), 0, PictureViewerButtons2Count, PictureViewerButtons2, width); + ::paintButtons(x, footer_y, width, PictureViewerButtons1Count, PictureViewerButtons1, width, buttons1_height); + ::paintButtons(x, footer_y + buttons1_height, width, PictureViewerButtons2Count, PictureViewerButtons2, width, buttons2_height); } else - ::paintButtons(x, y + (height - footer_height), 0, 1, &(PictureViewerButtons1[1]), width); + ::paintButtons(x, footer_y, width, 1, &(PictureViewerButtons1[1]), width, buttons1_height); } //------------------------------------------------------------------------ @@ -755,6 +761,9 @@ void CPictureViewerGui::paint() paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + // shadow + frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintFoot(); paintInfo(); From c291c4b3d830ae6ffd24ec8f1e6152e125cf5f4c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 311/394] audioplayer: fix coordinates in hide() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc42ee1e42ab2a9e2e6ccaada8a6caea272f5890 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - audioplayer: fix coordinates in hide() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 0cc052a6f..abbab66c8 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1537,7 +1537,7 @@ void CAudioPlayerGui::hide() if (m_visible) { clearDetailsLine(); - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_height); + m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_height + OFFSET_SHADOW); m_visible = false; } } From 57d44a4adacad8564f1e4de122a67d2869d85c8e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 312/394] filebrowser: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f5a91799573dd21b7088918cbc65b8d1198ec5f9 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - filebrowser: add shadow to gui-elements Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index bb3677ece..1a489d7cb 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -277,10 +277,10 @@ void CFileBrowser::fontInit() smskey_width = fnt_foot->getRenderWidth("M") + OFFSET_INNER_MID; liststart = 0; - listmaxshow = std::max(1,(int)(height - header_height - footer_height)/item_height); + listmaxshow = std::max(1,(int)(height - header_height - footer_height - OFFSET_SHADOW)/item_height); //recalc height - height = header_height + listmaxshow * item_height + footer_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; y = getScreenStartY(height); } @@ -1172,7 +1172,7 @@ void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, b void CFileBrowser::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); } void CFileBrowser::paintItem(unsigned int pos) @@ -1356,6 +1356,7 @@ void CFileBrowser::paintHead() i++; CComponentsHeader header(x, y, width, header_height, &l_name[i]); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); free(l_name); @@ -1435,12 +1436,16 @@ int CFileBrowser::paintFoot(bool show) return paintButtons(buttons_filelistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } + int footer_y = y + height - OFFSET_SHADOW - footer_height; int footer_width = width - smskey_width; + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_MID, CORNER_BOTTOM); + if (filelist.empty()) { // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); return footer_height; } @@ -1449,9 +1454,9 @@ int CFileBrowser::paintFoot(bool show) CComponentsFooter can't handle button_label_ext */ if (playlistmode) - res = paintButtons(buttons_playlistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_playlistmode, cnt, x, footer_y, width, footer_height, footer_width); else - res = paintButtons(buttons_filelistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_filelistmode, cnt, x, footer_y, width, footer_height, footer_width); paintSMSKey(); return res; @@ -1460,16 +1465,17 @@ int CFileBrowser::paintFoot(bool show) void CFileBrowser::paintSMSKey() { int smskey_height = fnt_foot->getHeight(); + int smskey_y = y + height - OFFSET_SHADOW - footer_height; //background - frameBuffer->paintBoxRel(x + width - smskey_width, y + height - footer_height, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - smskey_width, smskey_y, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); int len = fnt_foot->getRenderWidth(cKey); - fnt_foot->RenderString(x + width - smskey_width, y + height - footer_height + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); + fnt_foot->RenderString(x + width - smskey_width, smskey_y + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1488,6 +1494,9 @@ void CFileBrowser::paint() getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + + // shadow + frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) From d403f7fc36a66dec857a76c958cc7dbb5e07171a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 16:07:25 +0200 Subject: [PATCH 313/394] epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e89096c4ec22558deb940f5096734e81c8225f3 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b5d209dd3..1c4107a65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -114,6 +114,8 @@ void EpgPlus::Header::paint(const char * Name) this->head = new CComponentsHeader(); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); this->head->enableClock(true, "%H:%M", "%H %M", true); + this->head->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); + } if (this->head) @@ -220,6 +222,9 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) toggleColor = !toggleColor; } + + // shadow + this->frameBuffer->paintBoxRel(this->x + this->width, this->y + OFFSET_SHADOW, OFFSET_SHADOW, this->getUsedHeight(), COL_SHADOW_PLUS_0); } void EpgPlus::TimeLine::paintGrid() @@ -560,7 +565,7 @@ EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, this->width = pwidth; this->buttonHeight = pbuttonHeight; - this->buttonY = this->y - OFFSET_INTER - this->buttonHeight; + this->buttonY = this->y - OFFSET_INTER - OFFSET_SHADOW - this->buttonHeight; } EpgPlus::Footer::~Footer() @@ -591,6 +596,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int frame_thickness = 2; // clear the whole footer + this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0, RADIUS_LARGE); @@ -619,8 +625,9 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - CComponentsFooter _footer; - _footer.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); + CComponentsFooter foot; + foot.enableShadow(CC_SHADOW_ON, -1, true); + foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); } EpgPlus::EpgPlus() @@ -828,10 +835,10 @@ void EpgPlus::init() int footerHeight = Footer::getUsedHeight(); - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_INTER - footerHeight) / this->entryHeight; + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_SHADOW - OFFSET_INTER - footerHeight - OFFSET_SHADOW) / this->entryHeight; this->bodyHeight = this->maxNumberOfDisplayableEntries * entryHeight; - this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY + this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_SHADOW + OFFSET_INTER + footerHeight + OFFSET_SHADOW; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); if (this->usableScreenX < DETAILSLINE_WIDTH) this->usableScreenX = DETAILSLINE_WIDTH; @@ -846,7 +853,7 @@ void EpgPlus::init() this->timeLineWidth = this->usableScreenWidth; this->footerX = usableScreenX; - this->footerY = this->usableScreenY + this->usableScreenHeight - footerHeight; + this->footerY = this->usableScreenY + this->usableScreenHeight - OFFSET_SHADOW - footerHeight; this->footerWidth = this->usableScreenWidth; this->channelsTableX = this->usableScreenX; @@ -1386,7 +1393,7 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } - this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } void EpgPlus::paintChannelEntry(int position) @@ -1436,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); } // -- EPG+ Menue Handler Class From 5c243cf9ff9c20797265777533ddf8da32365f3e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 16:20:49 +0200 Subject: [PATCH 314/394] simplify last shadow-changes ... I didn't know about the possibility to add a shadow directly to the scrollbar. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/000edc2942e1aa89ee05cfc7f0ecf0e125c4dd9b Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - simplify last shadow-changes ... I didn't know about the possibility to add a shadow directly to the scrollbar. Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 5 +---- src/gui/filebrowser.cpp | 6 +----- src/gui/pictureviewer.cpp | 6 +----- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index abbab66c8..f3ff5f8b6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1782,10 +1782,7 @@ void CAudioPlayerGui::paint() int current_page; getScrollBarData(&total_pages, ¤t_page, m_playlist.size(), m_listmaxshow, m_selected); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); - - // shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); } paintTitleBox(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 1a489d7cb..9a49f973b 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1492,11 +1492,7 @@ void CFileBrowser::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); - - // shadow - frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 2cdd04039..9ccb9952f 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -758,11 +758,7 @@ void CPictureViewerGui::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, playlist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); - - // shadow - frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); paintFoot(); paintInfo(); From c765be6431af079c0dab1a6b174f0f473a5ee9d4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 17:01:47 +0200 Subject: [PATCH 315/394] bouquetlist: add shadow to gui-elements; simplify footer handling Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df46c1d6da6129f66788bd3a3957130050eda5ed Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - bouquetlist: add shadow to gui-elements; simplify footer handling Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 024ea7ce0..73eb025dc 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -619,7 +619,7 @@ int CBouquetList::show(bool bShowChannelList) void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -701,6 +701,7 @@ void CBouquetList::paintHead() { std::string icon(""); CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); } @@ -721,18 +722,12 @@ void CBouquetList::paint() frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); - int numButtons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); + // no buttons in favonly mode + int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - if (favonly) - { - // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - } - else - { - CComponentsFooter footer; - footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); - } + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); if (!Bouquets.empty()) { @@ -745,6 +740,5 @@ void CBouquetList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } From a00322f3e4e871ab4afad3b8f3309debf005772a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 17:21:33 +0200 Subject: [PATCH 316/394] upnpbrowser: activate shadow on scrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddcda8be275fc5be276be6fc750f1899680473cc Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - upnpbrowser: activate shadow on scrollbar Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a02596374..e4e62208a 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1003,10 +1003,7 @@ void CUpnpBrowserGui::paintDevices() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, m_devices.size(), m_listmaxshow, m_selecteddevice); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); - - //shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); @@ -1178,7 +1175,7 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, max + offset, m_listmaxshow, selected + offset); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot buttons size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); From d3ee96d3121c497037c5d77f0f4d9c23c4ffb301 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 21:20:19 +0200 Subject: [PATCH 317/394] upnpbrowser: center text in topbox Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d357835b381fb642e8ca40074541118524f7124c Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - upnpbrowser: center text in topbox Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index e4e62208a..b8c3d5878 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -942,7 +942,7 @@ void CUpnpBrowserGui::paintDeviceInfo() topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } @@ -1144,7 +1144,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } From b75a9e3f363083137babef9ab8c9c8aa8c422143 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 20:02:24 +0200 Subject: [PATCH 318/394] audioplayer: minor format changes in title box Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c93be1dfe71a68c1d4e176aacdfaade57fa49864 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - audioplayer: minor format changes in title box Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 291 +++++++++++++++++++++--------------------- src/gui/eventlist.h | 51 ++++---- 2 files changed, 172 insertions(+), 170 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2bcd1094b..76c7d5cdf 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -110,18 +110,17 @@ CEventList::CEventList() m_search_fsk = 1; full_width = width = 0; height = 0; - x = y = 0; - cc_infozone = NULL; + infozone = NULL; infozone_text = ""; item_event_ID = 0; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; header = NULL; pb = NULL; - Bottombox = NULL; + navibar = NULL; } CEventList::~CEventList() @@ -134,8 +133,8 @@ void CEventList::ResetModules() if (header){ delete header; header = NULL; } - if (Bottombox){ - delete Bottombox; Bottombox = NULL; + if (navibar){ + delete navibar; navibar = NULL; } if (pb){ delete pb; pb = NULL; @@ -318,38 +317,33 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna width = full_width; height = frameBuffer->getScreenHeightRel(); - // Calculate iheight (we assume the red button is the largest one?) - struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; - iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - - // Calculate theight - theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); + // Calculate header_height + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + footer_height = header_height; const int pic_h = 39; - theight = std::max(theight, pic_h); + header_height = std::max(header_height, pic_h); - fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); + largefont_height = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); { int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight(); int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight(); - fheight2 = std::max( h1, h2 ); + smallfont_height = std::max(h1, h2); } unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); - fheight = fheight1 + fheight2 + OFFSET_INNER_MIN; - fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); - //fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); + item_height = smallfont_height + OFFSET_INNER_MIN + largefont_height; - botboxheight = fheight1+2*OFFSET_INNER_MIN; + navibar_height = largefont_height+2*OFFSET_INNER_MIN; - listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; - height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW - navibar_height)/item_height; + height = header_height + footer_height + OFFSET_SHADOW + navibar_height + listmaxshow*item_height; // recalc height y = getScreenStartY(height); // calculate width of right info_zone infozone_width = full_width - width; // init right info_zone - if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) - cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); + if ((g_settings.eventlist_additional) && (infozone == NULL)) + infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y + header_height, infozone_width-2*OFFSET_INNER_MID, listmaxshow*item_height); int res = menu_return::RETURN_REPAINT; //printf("CEventList::exec: channel_id %llx\n", channel_id); @@ -381,7 +375,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna bool dont_hide = false; paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); int oldselected = selected; @@ -428,7 +422,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else paintItem(selected - liststart, channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } //sort else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort)) @@ -486,7 +480,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } std::string recDir = g_settings.network_nfs_recordingdir; @@ -541,7 +535,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(used_id); - showFunctionBar(used_id); + paintFoot(used_id); } } else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event @@ -553,7 +547,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } @@ -565,7 +559,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); - showFunctionBar(evtlist[selected].channelID ); + paintFoot(evtlist[selected].channelID ); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) @@ -576,7 +570,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); readEvents(epg_id); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } else { selected = oldselected; if(fader.StartFadeOut()) { @@ -595,7 +589,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna t_channel_id _channel_id = channel_id; getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); if(_channel_id){ - bgRightBoxPaint = false; + infozone_background = false; loop = false; dont_hide = true; exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); @@ -613,9 +607,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_epg) @@ -656,9 +650,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, in_search ? search_head_name : channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -667,7 +661,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna { oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } @@ -691,12 +685,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } } - if (cc_infozone) - delete cc_infozone; - cc_infozone = NULL; + if (infozone) + delete infozone; + infozone = NULL; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; if(!dont_hide){ hide(); @@ -708,7 +702,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { ResetModules(); - frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width + OFFSET_SHADOW, height + OFFSET_SHADOW); } CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChannelEvent * event, int * tID) @@ -737,7 +731,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { - int ypos = y+ theight + pos*fheight; + int ypos = y + header_height + pos*item_height; unsigned int currpos = liststart + pos; bool i_selected = currpos == selected; @@ -753,27 +747,27 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if(currposgetText(CLocaleManager::getWeekday(tmStartZeit)); - datetime1_str += strftime(", %H:%M", tmStartZeit); - datetime1_str += strftime(", %d", tmStartZeit); - datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetime_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + datetime_str += strftime(", %H:%M", tmStartZeit); + datetime_str += strftime(", %d", tmStartZeit); + datetime_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { t_channel_id channel = evtlist[currpos].channelID; - datetime1_str += " "; - datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); + datetime_str += " "; + datetime_str += CServiceManager::getInstance()->GetServiceName(channel); } snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); @@ -781,10 +775,10 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); + int datetime_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime_str); + int duration_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + fheight2, fwidth1a, datetime1_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + smallfont_height, datetime_width, datetime_str, color); int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) @@ -792,9 +786,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - duration_width - w, ypos + OFFSET_INNER_MIN + smallfont_height, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - duration_width, ypos + OFFSET_INNER_MIN + smallfont_height, duration_width, duration_str, color); // 2nd line // set status icons @@ -811,7 +805,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) int iw = 0, ih = 0; if(icontype != 0) { frameBuffer->getIconSize(icontype, &iw, &ih); - frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += OFFSET_INNER_MID; } @@ -824,15 +818,14 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { //paint_warning = true; frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += i2w + OFFSET_INNER_MID; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + item_height, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); - if (i_radius) - showProgressBar(currpos); + showProgressBar(currpos); } } @@ -858,6 +851,13 @@ void CEventList::paintDescription(int index) else CEitManager::getInstance()->getActualEPGServiceKey(evtlist[index].channelID, &epgData ); + infozone_text = ""; + if (!epgData.info1.empty() && !epgData.info2.empty() && (epgData.info2.find(epgData.info1) != 0)) { + infozone_text += epgData.info1; + infozone_text += "\n"; + infozone_text += epgData.info2; + } + else if(!epgData.info2.empty()){ infozone_text = epgData.info2; } @@ -867,11 +867,12 @@ void CEventList::paintDescription(int index) else infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - cc_infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); - cc_infozone->doPaintBg(false); - cc_infozone->doPaintTextBoxBg(true); - cc_infozone->forceTextPaint(); - cc_infozone->paint(CC_SAVE_SCREEN_NO); + infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); + infozone->doPaintBg(false); + infozone->doPaintTextBoxBg(true); + //FIXME infozone->enableShadow(CC_SHADOW_RIGHT, -1, true); + infozone->forceTextPaint(); + infozone->paint(CC_SAVE_SCREEN_NO); } void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) @@ -881,13 +882,15 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use header->enableClock(true, "%H:%M", "%H %M", true); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setDimensionsAll(x, y, full_width, theight); + header->setDimensionsAll(x, y, full_width, header_height); + header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); } //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); if (header->isPainted()) header->getChannelLogoObject()->hide(); - header->setChannelLogo(_channel_id,_channelname); + if (g_settings.channellist_show_channellogo) + header->setChannelLogo(_channel_id,_channelname); header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_LEFT); header->paint(CC_SAVE_SCREEN_NO); @@ -896,22 +899,27 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); } - paintBottomBox(_channelname_prev, _channelname_next); + paintNaviBar(_channelname_prev, _channelname_next); } -void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) +void CEventList::paintNaviBar(std::string _channelname_prev, std::string _channelname_next) { - int by = y + height - iheight - botboxheight; + int navibar_y = y + height - OFFSET_SHADOW - footer_height - navibar_height; - if (!Bottombox){ - Bottombox = new CNaviBar(x, by, full_width, botboxheight); - Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + if (!navibar) + { + navibar = new CNaviBar(x, navibar_y, full_width, navibar_height); + navibar->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + //FIXME navibar->enableShadow(CC_SHADOW_RIGHT, -1, true); } - Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); - Bottombox->setText(_channelname_prev, _channelname_next); + navibar->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); + navibar->setText(_channelname_prev, _channelname_next); - Bottombox->paint(false); + navibar->paint(false); + + // shadow + frameBuffer->paintBoxRel(x + full_width, navibar_y + OFFSET_SHADOW, OFFSET_SHADOW, navibar_height, COL_SHADOW_PLUS_0); } void CEventList::showProgressBar(int pos) @@ -926,10 +934,10 @@ void CEventList::showProgressBar(int pos) if (!pb) { - int pbw = 104; - int pbx = x + (full_width - pbw)/2; - int pbh = botboxheight - 12; - int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + int pbw = full_width/10; + int pbx = x + (full_width - pbw)/2; + int pbh = navibar_height - 2*OFFSET_INNER_SMALL; + int pby = y + height - OFFSET_SHADOW - footer_height - navibar_height + (navibar_height - pbh)/2; pb = new CProgressBar(pbx, pby, pbw, pbh); pb->setType(CProgressBar::PB_TIMESCALE); @@ -954,12 +962,13 @@ void CEventList::paint(t_channel_id channel_id) liststart = (selected/listmaxshow)*listmaxshow; // paint background for right box - if (g_settings.eventlist_additional && !bgRightBoxPaint) { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,listmaxshow*fheight,COL_MENUCONTENT_PLUS_0); - bgRightBoxPaint = true; + if (g_settings.eventlist_additional && !infozone_background) + { + frameBuffer->paintBoxRel(x + width,y + header_height, infozone_width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0); + infozone_background = true; } - for(unsigned int count=0;countpaintBoxRel(x + full_width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); } -void CEventList::showFunctionBar(t_channel_id channel_id) +void CEventList::paintFoot(t_channel_id channel_id) { - int bx = x; - int bw = full_width; - int bh = iheight; - int by = y + height - bh; - CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; - struct button_label buttons[5]; + struct button_label buttons[5]; //TODO dbt: add directly into footer object with setButtonLabels() int btn_cnt = 0; int tID = -1; //any value, not NULL @@ -1040,26 +1047,38 @@ void CEventList::showFunctionBar(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO; btn_cnt++; } - ::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); + +#if 0 + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; + buttons[btn_cnt].locale = LOCALE_EPGPLUS_HEAD; + btn_cnt++; + + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_0; + buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; + btn_cnt++; +#endif + + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); } int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { - int res = menu_return::RETURN_EXIT_ALL; - if (parent) { + int res = menu_return::RETURN_EXIT_ALL; + + if (parent) parent->hide(); - } + CEventList *e = new CEventList; CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; - e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); // UTF-8 + e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); delete e; return res; } -/************************************************************************************************/ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) -/************************************************************************************************/ { bool res = false; int event = 0; @@ -1070,19 +1089,19 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) m_search_autokeyword = m_search_keyword; } - CEventFinderMenu menu( &event, - &m_search_epg_item, - &m_search_keyword, - &m_search_list, - &m_search_channel_id, - &m_search_bouquet_id, - &m_search_genre, - &m_search_fsk - ); + CEventFinderMenu menu(&event, + &m_search_epg_item, + &m_search_keyword, + &m_search_list, + &m_search_channel_id, + &m_search_bouquet_id, + &m_search_genre, + &m_search_fsk); + hide(); menu.exec(NULL,""); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); - if(event == 1) + if (event == 1) { res = true; m_showChannel = true; // force the event list to paint the channel name @@ -1183,16 +1202,15 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) } } - if(event) + if (event) paintHead(0, search_head_name); else paintHead(channel_id, channelname); paint(); - showFunctionBar(channel_id); + paintFoot(channel_id); return(res); } -/************************************************************************************************/ /* class CSearchNotifier : public CChangeObserver { @@ -1208,7 +1226,7 @@ class CSearchNotifier : public CChangeObserver } }; */ -/************************************************************************************************ +/* bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data) { if(OptionName == ) @@ -1266,36 +1284,29 @@ const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] = { CEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } }; - - -/************************************************************************************************/ -CEventFinderMenu::CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ) -/************************************************************************************************/ +CEventFinderMenu::CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk) { - m_event = event; - m_search_epg_item = search_epg_item; + m_event = event; + m_search_epg_item = search_epg_item; m_search_keyword = search_keyword; - m_search_list = search_list; - m_search_channel_id = search_channel_id; - m_search_bouquet_id = search_bouquet_id; - m_search_genre = search_genre; - m_search_fsk = search_fsk; + m_search_list = search_list; + m_search_channel_id = search_channel_id; + m_search_bouquet_id = search_bouquet_id; + m_search_genre = search_genre; + m_search_fsk = search_fsk; + width = 40; selected = -1; } - -/************************************************************************************************/ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; @@ -1383,9 +1394,7 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) return res; } -/************************************************************************************************/ int CEventFinderMenu::showMenu(void) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; m_search_channelname_mf = NULL; @@ -1449,12 +1458,8 @@ int CEventFinderMenu::showMenu(void) return(res); } - -/************************************************************************************************/ bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) -/************************************************************************************************/ { - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) { if (*m_search_list == CEventList::SEARCH_LIST_CHANNEL) diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 55401bff9..e6df12580 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -23,7 +23,6 @@ Boston, MA 02110-1301, USA. */ - #ifndef __EVENTLIST_HPP__ #define __EVENTLIST_HPP__ @@ -43,7 +42,6 @@ class CFramebuffer; class CEventList : public CListHelpers { - // Eventfinder start public: typedef enum { @@ -53,14 +51,16 @@ class CEventList : public CListHelpers SEARCH_EPG_INFO2, SEARCH_EPG_GENRE, SEARCH_EPG_ALL - }SEARCH_EPG; + } SEARCH_EPG; + typedef enum { SEARCH_LIST_NONE, SEARCH_LIST_CHANNEL, SEARCH_LIST_BOUQUET, SEARCH_LIST_ALL - }SEARCH_LIST; + } SEARCH_LIST; + private: int m_search_epg_item; std::string m_search_keyword; @@ -73,10 +73,8 @@ class CEventList : public CListHelpers bool m_showChannel; int oldIndex; event_id_t oldEventID; - bool bgRightBoxPaint; bool findEvents(t_channel_id channel_id, std::string channelname); - // Eventfinder end CFrameBuffer *frameBuffer; CChannelEventList evtlist; @@ -86,36 +84,36 @@ class CEventList : public CListHelpers unsigned int current_event; unsigned int liststart; unsigned int listmaxshow; - int fheight; // Fonthoehe Channellist-Inhalt - int fheight1,fheight2; - int fwidth1,fwidth2; - int theight; // Fonthoehe Channellist-Titel - int iheight; // Height info bar + int item_height; + int largefont_height, smallfont_height; + int header_height; + int footer_height; std::string search_head_name; int full_width, width, infozone_width; - int botboxheight; + int navibar_height; int height; int x; int y; std::string infozone_text; + bool infozone_background; int sort_mode; event_id_t item_event_ID; - CComponentsText *cc_infozone; + CComponentsText *infozone; CComponentsHeader *header; CProgressBar *pb; - CNaviBar *Bottombox; + CNaviBar *navibar; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); - void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); + void paintNaviBar(std::string _channelname_prev, std::string _channelname_next); void showProgressBar(int pos); void hide(); - void showFunctionBar(t_channel_id channel_id); + void paintFoot(t_channel_id channel_id); void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); int timerPre; @@ -136,7 +134,6 @@ class CEventListHandler : public CMenuTarget { public: int exec( CMenuTarget* parent, const std::string &actionkey); - }; class CEventFinderMenu : public CMenuTarget, CChangeObserver @@ -156,16 +153,16 @@ class CEventFinderMenu : public CMenuTarget, CChangeObserver int selected; int showMenu(void); public: - CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ); - int exec( CMenuTarget* parent, const std::string &actionkey); + CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk); + + int exec( CMenuTarget* parent, const std::string &actionkey); bool changeNotify(const neutrino_locale_t OptionName, void *); }; From 4c9c63c42e7d6ab401e2a2763cebc6d234ec2086 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 May 2017 01:24:21 +0200 Subject: [PATCH 319/394] CComponentsScrollBar: overwrite default corner type Rounded corners are in mostly cases not required, because of possible pixel errors if scrollbars are used as embedded standalone part and is generated with external method paintScrollBar(). Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cdf0123bea362c73e48d8b61e5dd5411001d9cce Author: Thilo Graf Date: 2017-05-30 (Tue, 30 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 5e4c046f3..2e59a630f 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -94,7 +94,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& col sb_down_obj = NULL; sb_segments_obj = NULL; - setCorner(RADIUS_MIN, CORNER_ALL); + corner_type = CORNER_NONE; sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); From d6608d21f697323fcad975a1b49399aa558453a2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 320/394] timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/915410e5715f89a5713a73acc63f4da7bcaa45ab Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 185 ++++++++++++++++++++++-------------------- src/gui/timerlist.h | 8 +- 2 files changed, 100 insertions(+), 93 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 2b6c5f59f..ffa203a09 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -272,11 +272,14 @@ CTimerList::CTimerList() visible = false; x = y = 0; width = height = 0; - fheight = theight = 0; - footerHeight = 0; + header_height = 0; + font_height = 0; + item_height = 0; + footer_height = 0; selected = 0; liststart = 0; listmaxshow = 0; + header = NULL; Timer = new CTimerdClient(); timerNew_message = ""; timerNew_pluginName = ""; @@ -672,27 +675,23 @@ void CTimerList::updateEvents(void) RemoteBoxTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - //get footerHeight from paintButtons - footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + item_height = 2*font_height; + footer_height = header_height; - //width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); - width = frameBuffer->getScreenWidth()*0.9; - height = frameBuffer->getScreenHeight() - (2*theight); // max height - - listmaxshow = (height-theight)/(fheight*2); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height + width = frameBuffer->getScreenWidth()/100 * 90; + height = frameBuffer->getScreenHeight(); + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW) / item_height; if (timerlist.size() < listmaxshow) - { - listmaxshow=timerlist.size(); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height - } + listmaxshow = timerlist.size(); + + height = header_height + item_height*listmaxshow + footer_height + OFFSET_SHADOW; // recalc height if (!timerlist.empty() && selected == (int)timerlist.size()) { - selected=timerlist.size()-1; + selected = timerlist.size() - 1; liststart = (selected/listmaxshow)*listmaxshow; } @@ -1084,6 +1083,12 @@ void CTimerList::hide() { if (visible) { + if (header) + { + header->kill(); + delete header; + header = NULL; + } frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); visible = false; } @@ -1129,12 +1134,12 @@ bool CTimerList::RemoteBoxSetup() void CTimerList::paintItem(int pos) { - int ypos = y+ theight+ pos*fheight*2; + int ypos = y + header_height + pos*item_height; - int real_width=width; + int real_width = width; if (timerlist.size() > listmaxshow) { - real_width -= SCROLLBAR_WIDTH; //scrollbar + real_width -= SCROLLBAR_WIDTH; } unsigned int currpos = liststart + pos; @@ -1153,43 +1158,50 @@ void CTimerList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); //shadow - frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); + + int line1_y = ypos + 1*font_height; + int line2_y = ypos + 2*font_height; + + int digit_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth(); + int time_width = 8*digit_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(".. :"); // keep in sync with strftime-lines below if (currpos < timerlist.size()) { CTimerd::responseGetTimer & timer = timerlist[currpos]; char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); - strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); + strftime(zAlarmTime, 20, "%d.%m. %H:%M", alarmTime); char zStopTime[25] = {0}; struct tm *stopTime = localtime(&(timer.stopTime)); - strftime(zStopTime,20,"%d.%m. %H:%M",stopTime); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight); - if (timer.stopTime != 0) - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight); - } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight); + strftime(zStopTime, 20, "%d.%m. %H:%M", stopTime); + // paint start/stop times + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line1_y, time_width, zAlarmTime, color, font_height); + if (timer.stopTime != 0) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line2_y, time_width, zStopTime, color, font_height); + + // paint timer-type + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line1_y, real_width - time_width - 3*OFFSET_INNER_MID, t_type, color, font_height); + + // paint repeat-type/count + std::string t_repeat = convertTimerRepeat2String(timer.eventRepeat); if (timer.eventRepeat != CTimerd::TIMERREPEAT_ONCE) { - char srepeatcount[25] = {0}; if (timer.repeatCount == 0) - { - // Unicode 8734 (hex: 221E) not available in all fonts - //sprintf(srepeatcount,"∞"); - sprintf(srepeatcount,"00"); - } + t_repeat += ", oo"; // Unicode 8734 (hex: 221E) not available in all fonts else - sprintf(srepeatcount,"%ux",timer.repeatCount); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); + t_repeat += ", " + to_string(timer.repeatCount) + "x"; } - std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); + int t_repeat_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(t_repeat); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + real_width - OFFSET_INNER_MID - t_repeat_width, line1_y, t_repeat_width, t_repeat, color, font_height); + + int icon_w, icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) @@ -1199,23 +1211,14 @@ void CTimerList::paintItem(int pos) recinfo.eventID = timer.eventID; if (CRecordManager::getInstance()->IsRecording(&recinfo)) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } } - - if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) + else if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } std::string zAddData(""); @@ -1340,46 +1343,47 @@ void CTimerList::paintItem(int pos) default: {} } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); + + // paint timer-name + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line2_y, real_width - time_width - 3*OFFSET_INNER_MID, zAddData, color, font_height); + // LCD Display if (currpos == (unsigned) selected) { - std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 - //std::string line2 = zAlarmTime; + std::string line1 = convertTimerType2String(timer.eventType); switch (timer.eventType) { - case CTimerd::TIMER_RECORD : - // line2+= " -"; - // line2+= zStopTime+6; - //case CTimerd::TIMER_NEXTPROGRAM : - case CTimerd::TIMER_ZAPTO : - { - line1 += ' '; - line1 += convertChannelId2String(timer.channel_id); // UTF-8 + case CTimerd::TIMER_RECORD : + case CTimerd::TIMER_ZAPTO : + { + line1 += ' '; + line1 += convertChannelId2String(timer.channel_id); + break; + } + case CTimerd::TIMER_STANDBY : + { + if (timer.standby_on) + line1 += " ON"; + else + line1 += " OFF"; + break; + } + default: + ; } - break; - case CTimerd::TIMER_STANDBY : - { - if (timer.standby_on) - line1+=" ON"; - else - line1+=" OFF"; - } - break; - default: - ; - } - CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); // UTF-8 - //CVFD::getInstance()->showMenuText(1, line2.c_str(), -1, true); // UTF-8 + CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); } } } void CTimerList::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, " %d.%m.%Y %H:%M "); - header.paint(CC_SAVE_SCREEN_NO); + if (header == NULL) + { + header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(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 ", " %d.%m.%Y, %H.%M ", true); + } + header->paint(CC_SAVE_SCREEN_NO); } void CTimerList::paintFoot() @@ -1389,24 +1393,25 @@ void CTimerList::paintFoot() CTimerd::responseGetTimer* timer=&timerlist[selected]; if (timer != NULL) { - //replace info button with dummy if timer is not type REC or ZAP + //replace info button with dummy if timer is not type REC or ZAP if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; } } - //shadow - frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footerHeight, width, footerHeight + OFFSET_SHADOW, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); int c = TimerListButtonsCount; if (g_settings.timer_remotebox_ip.size() == 0) c--; // reduce play button + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + if (timerlist.empty()) - ::paintButtons(x, y + height - footerHeight, width, 2, &(TimerListButtons[1]), width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1])); else - ::paintButtons(x, y + height - footerHeight, width, c, TimerListButtons, width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons); } void CTimerList::paint() @@ -1428,7 +1433,7 @@ void CTimerList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, timerlist.size(), listmaxshow, selected); - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, 2*fheight*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } paintFoot(); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index d58b0a8a9..e8a30af1f 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -51,13 +51,15 @@ class CTimerList : public CMenuTarget, public CListHelpers int y; int width; int height; - int fheight; // fontheight content - int theight; // fontheight titel - int footerHeight; + int font_height; + int item_height; + int header_height; + int footer_height; int selected; int liststart; unsigned int listmaxshow; bool visible; + CComponentsHeader *header; int httpConnectTimeout; CTimerdClient *Timer; From a3f7799ed05f196ed44707a9dd7f2af4a325b9bb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 321/394] CTimerList: partial revert of - timerlist: small design reworks ... removed: * blinking clock in header (shameless stolen from TangoCash) Not really required here and before we can enable a ticking clock here, clock must be disabled on opened context menues, because the timerlist context menus will be damaged. This needs a separate handling. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/06c8fd33f8e66a1733d2b30040b1bf9009a6e12a Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ffa203a09..ca48a92f6 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1381,7 +1381,7 @@ void CTimerList::paintHead() if (header == NULL) { header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(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 ", " %d.%m.%Y, %H.%M ", true); + header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); } header->paint(CC_SAVE_SCREEN_NO); } From 0449efa2d3c044343d2da2ca5feb6148df3b29ac Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 322/394] cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead Signed-off-by: Thilo Graf Good idea, this I had already in mind too. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/980e293517accca2adf09a09948374933ff3ec35 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead Signed-off-by: Thilo Graf Good idea, this I had already in mind too. ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/components/cc_frm_header.cpp | 27 +++++++++------------ src/gui/components/cc_frm_header.h | 31 +++++++++--------------- src/gui/epgview.cpp | 9 ++++--- src/gui/motorcontrol.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/scan.cpp | 4 +-- src/gui/timerlist.cpp | 2 +- src/gui/upnpbrowser.cpp | 2 +- 11 files changed, 37 insertions(+), 48 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index f3ff5f8b6..91d0a3085 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1602,7 +1602,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeader header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index fc2eb5994..6c8486bc0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -133,7 +133,7 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_EXIT); + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeader::CC_BTN_EXIT); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index f91b47469..383ee2555 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -411,7 +411,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a91fd8c5..a74875e72 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -65,21 +65,18 @@ CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); } -CComponentsHeaderLocalized::CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h, - neutrino_locale_t caption_locale, - const std::string& icon_name, - const int& buttons, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t color_frame, - fb_pixel_t color_body, - fb_pixel_t color_shadow) - :CComponentsHeader( x_pos, y_pos, w, h, - g_Locale->getText(caption_locale), - icon_name, buttons, - parent, - shadow_mode, - color_frame, color_body, color_shadow){}; +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t caption_locale, + const std::string& icon_name, + const int& buttons, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + initVarHeader(x_pos, y_pos, w, h, g_Locale->getText(caption_locale), icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); +}; void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index e1dd05f66..1d634c3cd 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -170,7 +170,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const std::string& caption = std::string(), - const std::string& = std::string(), + const std::string& icon_name = std::string(), + const int& buttons = 0, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, + const std::string& icon_name = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -346,23 +356,4 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; -//! Sub class of CComponentsHeader. -/*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -Caption is defined with locales. -*/ -class CComponentsHeaderLocalized : public CComponentsHeader -{ - public: - CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b696c54ea..f2d5d4adb 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -841,14 +841,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (!header){ - header = new CComponentsHeader(sx, sy, ox, toph); + if (!header) + { + header = new CComponentsHeader(); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); - }else - header->setDimensionsAll(sx, sy, ox, toph); + } + header->setDimensionsAll(sx, sy, ox, toph); header->setCaptionFont(font_title); header->setCaption(epgData.title); diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 67adbf805..1b9e38e36 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -455,7 +455,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeaderLocalized header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 9ccb9952f..a7f19f1ef 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -701,7 +701,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { - CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeader::CC_BTN_HELP); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 1709db61e..358cbd8bf 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -345,7 +345,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); } if(!test) { - CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); + CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); header.paint(CC_SAVE_SCREEN_NO); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(0xFFFF); do { @@ -506,7 +506,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); + CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ca48a92f6..5fe4586b3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1380,7 +1380,7 @@ void CTimerList::paintHead() { if (header == NULL) { - header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + 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); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b8c3d5878..dbfcf8aa7 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -986,7 +986,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); From 068f868b038fb366d1fc407d77a58d0f119abc52 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 323/394] timermanager: don't set stoptime for timers without a stop-event Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/57ff49c32133e14903aae44c1b769aefd25776c0 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - timermanager: don't set stoptime for timers without a stop-event Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 8998ea2d2..82051b394 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -332,7 +332,7 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi CTimerEvent *event = events[peventID]; event->announceTime = announceTime; event->alarmTime = alarmTime; - event->stopTime = stopTime; + event->stopTime = (event->eventType == CTimerd::TIMER_RECORD) ? stopTime : 0; if(event->eventState==CTimerd::TIMERSTATE_PREANNOUNCE) event->eventState = CTimerd::TIMERSTATE_SCHEDULED; event->eventRepeat = evrepeat; From 54375b98b01174ce9219e441d6580053a7ce206c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 324/394] moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b4f34857f1c3d6715e45944f1c4a7d90c696566 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 7a881f479..38625fe4e 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2479,13 +2479,20 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - filelist_it = filelist.end(); - if (!cursor_only && getSelectedFiles(filelist, movielist)) - filelist_it = filelist.begin(); - if (filelist.empty()) { //just add the m_movieSelectionHandler + + if (cursor_only) + { + filelist.clear(); + movielist.clear(); + + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); } + else + { + getSelectedFiles(filelist, movielist); + } MI_MOVIE_LIST dellist; MI_MOVIE_LIST::iterator dellist_it; From 1f79ba0b8a85017cb0421fe1755cd21ccd196635 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 325/394] moviebrowser: clearify deletion-locale; add movie-title to menu Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37f930686256738cafebcedac0298600f38a3ccd Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - moviebrowser: clearify deletion-locale; add movie-title to menu Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 6 +++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3148cb971..6aaf0e4eb 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1669,6 +1669,7 @@ moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freie moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_all Alle markierten Filme ohne weitere Nachfrage löschen? moviebrowser.delete_info Lösche Dateien, bitte warten ... +moviebrowser.delete_movie Film löschen moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse diff --git a/data/locale/english.locale b/data/locale/english.locale index 11e584539..cc4e86104 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1669,6 +1669,7 @@ moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free spa moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_all Delete all selected movies without any questions? moviebrowser.delete_info Delete files, please wait ... +moviebrowser.delete_movie Delete movie moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 38625fe4e..f513de08a 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3319,12 +3319,10 @@ int CMovieBrowser::showMovieCutMenu() movieCutMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD); CMenuForwarder *mf; -#if 0 mf = new CMenuForwarder(m_movieSelectionHandler->epgTitle, false); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, NONEXISTANT_LOCALE); movieCutMenu.addItem(mf); movieCutMenu.addItem(GenericMenuSeparator); -#endif mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_COPY_ONEFILE, true, NULL, this, "copy_onefile", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MOVIEBROWSER_HINT_COPY_ONEFILE); @@ -3451,9 +3449,11 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_FILEBROWSER_DELETE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_1)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_2)); diff --git a/src/system/locals.h b/src/system/locals.h index a7147a146..f62dff5e9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1696,6 +1696,7 @@ typedef enum LOCALE_MOVIEBROWSER_CUTTING, LOCALE_MOVIEBROWSER_DELETE_ALL, LOCALE_MOVIEBROWSER_DELETE_INFO, + LOCALE_MOVIEBROWSER_DELETE_MOVIE, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIRECTORIES, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index adb7a51b0..ea6d87aac 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1696,6 +1696,7 @@ const char * locale_real_names[] = "moviebrowser.cutting", "moviebrowser.delete_all", "moviebrowser.delete_info", + "moviebrowser.delete_movie", "moviebrowser.delete_screenshot", "moviebrowser.dir", "moviebrowser.directories", From 64aaf60400629b3a0b189d3e2a7f1349228687ed Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 326/394] cc_types.h: add more shadow defines Allows compact style on use for arguments in methods. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa92fc525f040bb4f9eb601e1c990e251f19ea5f Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index d73bd1549..3c32c0275 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -201,12 +201,16 @@ typedef struct button_label_cc #define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) #define CC_HEIGHT_MIN CC_WIDTH_MIN +//shadow defines #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 #define CC_SHADOW_BOTTOM 0x4 #define CC_SHADOW_CORNER_BOTTOM_LEFT 0x8 #define CC_SHADOW_CORNER_BOTTOM_RIGHT 0x10 #define CC_SHADOW_CORNER_TOP_RIGHT 0x20 +//prepared combined shadow defines +#define CC_SHADOW_RIGHT_CORNER_ALL CC_SHADOW_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT +#define CC_SHADOW_BOTTOM_CORNER_ALL CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_BOTTOM_LEFT #define CC_SHADOW_ON CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT #define CC_SAVE_SCREEN_YES true From f140be3486c059cba3c29b79fad12cf0292a85af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 327/394] EpgPlus: fix wrong shadow parameter for scrollbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/579a73f91bdbfe7cd44a608a70d8d5510a9a9a20 Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 1c4107a65..bcece667b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1443,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } // -- EPG+ Menue Handler Class From 6771de1f2d13401ab88b7e4ac5bd4d973a36558d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 Jun 2017 11:53:59 +0200 Subject: [PATCH 328/394] lib/libtuxtxt/tuxtxt.cpp avoid segfault, FIXME Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7aec84d124b6040deaa306d6980ffdc7463784e8 Author: Jacek Jendrzej Date: 2017-06-26 (Mon, 26 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 714494681..d5d093a6a 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -58,6 +58,10 @@ fb_pixel_t *getFBp(int *y) void FillRect(int x, int y, int w, int h, int color) { + if(color < 0 || SIZECOLTABLE < color){ + printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); + return; + } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; From 6e321d596686aa1590ba617a2f3707761c121e74 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 Jun 2017 19:23:23 +0200 Subject: [PATCH 329/394] init pre post Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4bdacf39c81a89e07dd7f5399a88217f7030c303 Author: Jacek Jendrzej Date: 2017-06-26 (Mon, 26 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/record_setup.cpp | 2 +- src/gui/timerlist.cpp | 2 +- src/timerd/timerd.cpp | 2 +- src/timerd/timermanager.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 49ed97d86..fae191c0e 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -310,7 +310,7 @@ int CRecordSetup::showRecordSetup() void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) { //recording start/end correcture - int pre,post; + int pre = 0,post = 0; g_Timerd->getRecordingSafety(pre,post); g_settings.record_safety_time_before = pre/60; g_settings.record_safety_time_after = post/60; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 5fe4586b3..601ae3981 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -442,7 +442,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } else if ((strcmp(key, "send_remotetimer") == 0) && RemoteBoxChanExists(timerlist[selected].channel_id)) { - int pre,post; + int pre = 0,post = 0; Timer->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 385afac85..e1b00fbf9 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -306,7 +306,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); if(recInfo.recordingSafety) { - int pre,post; + int pre = 0,post = 0; CTimerManager::getInstance()->getRecordingSafety(pre,post); msgAddTimer.announceTime -= pre; msgAddTimer.alarmTime -= pre; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 82051b394..3903a4b0f 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1347,7 +1347,7 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); - int pre, post; + int pre = 0, post = 0; CTimerManager::getInstance()->getRecordingSafety(pre, post); time_t _announceTime = announceTime; From d566a902b3042437800e35f5992b50ccd2aa8feb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 330/394] CProgressWindow: use CProgressBar::PB_TIMESCALE as default More colors makes not really sense here. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3fdd07e92c4f06c1715c23c5e03014fcbe3c2dd4 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 983ff2aac..26975c02a 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -122,6 +122,7 @@ CProgressBar* CProgressWindow::getProgressItem() pBar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); pBar->setFrameThickness(1); pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); + pBar->setType(CProgressBar::PB_TIMESCALE); addWindowItem(pBar); return pBar; From 64bbca26a35e2eafbed2548f609dfbfe3da9bd52 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 331/394] timerlist: add separationline to items (cherry picked from commit a5dd8a55fb279d878e48c21acacdd8351aa0e93e) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d2415c49303e9bec96132a3b3a3e6a0c61e5701a Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - timerlist: add separationline to items (cherry picked from commit a5dd8a55fb279d878e48c21acacdd8351aa0e93e) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 601ae3981..dfbc96a9f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -677,7 +677,7 @@ void CTimerList::updateEvents(void) header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - item_height = 2*font_height; + item_height = 2*font_height + 1; // + 1 for separationline footer_height = header_height; width = frameBuffer->getScreenWidth()/100 * 90; @@ -1160,6 +1160,8 @@ void CTimerList::paintItem(int pos) if (i_radius) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); + // separationline + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 7db503f654cb9b9403cf46ec61f42f11f462a7d9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 332/394] timerlist: fix compiler-warning (comparison signed/unsigned int) (cherry picked from commit 4e42382842baf5d2b0705c89388b994ae68fc00d) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/033d6bb3593e3829b8de43f3cb515ec53e9b418b Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - timerlist: fix compiler-warning (comparison signed/unsigned int) (cherry picked from commit 4e42382842baf5d2b0705c89388b994ae68fc00d) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index dfbc96a9f..23f6d734a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1161,7 +1161,7 @@ void CTimerList::paintItem(int pos) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); // separationline - frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == (int) listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 86a87a7083f01f325319ed1f0cff313fa2f6fb00 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 333/394] moviebrowser: fix deletion of non-marked movies via mute-key (cherry picked from commit 98dcedd452a5b2ea024c2a36f8caf9fbb472d13f) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f8ae15b669cc48d33e8b72f1069ea4a1a56b120 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of non-marked movies via mute-key (cherry picked from commit 98dcedd452a5b2ea024c2a36f8caf9fbb472d13f) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f513de08a..9d3a3e27f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2480,7 +2480,7 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - if (cursor_only) + if (cursor_only || (filelist.empty() || movielist.empty())) { filelist.clear(); movielist.clear(); From 5a33e3eebf090ddb5c510719ad08c9725a8e031c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 334/394] bouqueteditor: use default font for CComponentsFooter (cherry picked from commit 3beb87c12d522978ccb6989258d6c344790275d2) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d323f499474f1aefa18c8bbee1a8fd3d7f4089f Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - bouqueteditor: use default font for CComponentsFooter (cherry picked from commit 3beb87c12d522978ccb6989258d6c344790275d2) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 6c8486bc0..a5b2d6ebc 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -150,7 +150,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8618ffca5..1b405ae83 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -184,7 +184,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 87227e8df..e9ee12385 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -251,7 +251,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelSelectWidget::getInfoText(int index) From 9a98c77126d596ef4ca4f7f63d95e498eb15e682 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 27 Jun 2017 23:45:57 +0200 Subject: [PATCH 335/394] audioplayer: change scanXmlData() arguments order ... switch url <-> name to get the same order as in other used functions (cherry picked from commit f97a29a785cf021e6deaa6382aae8300b646bc01) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d75a3b0f58c7f6a2328387d5fc6799a486add595 Author: vanhofen Date: 2017-06-27 (Tue, 27 Jun 2017) Origin message was: ------------------ - audioplayer: change scanXmlData() arguments order ... switch url <-> name to get the same order as in other used functions (cherry picked from commit f97a29a785cf021e6deaa6382aae8300b646bc01) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 6 +++--- src/gui/audioplayer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 91d0a3085..9ce933e3d 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1141,7 +1141,7 @@ void CAudioPlayerGui::readDir_ic(void) { xmlDocPtr answer_parser = parseXml(answer.c_str()); scanBox->hide(); - scanXmlData(answer_parser, "server_name", "listen_url", "bitrate", true); + scanXmlData(answer_parser, "listen_url", "server_name", "bitrate", true); } else scanBox->hide(); @@ -1152,10 +1152,10 @@ void CAudioPlayerGui::readDir_ic(void) void CAudioPlayerGui::scanXmlFile(std::string filename) { xmlDocPtr answer_parser = parseXmlFile(filename.c_str()); - scanXmlData(answer_parser, "name", "url"); + scanXmlData(answer_parser, "url", "name"); } -void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, const char *bitratetag, bool usechild) +void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *bitratetag, bool usechild) { #define IC_typetag "server_type" diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index c99f6dbc5..3f945c993 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -176,7 +176,7 @@ class CAudioPlayerGui : public CMenuTarget /** * Processes a loaded XML file/data of internet audiostreams or playlists */ - void scanXmlData(xmlDocPtr answer_parser, const char *nametag, const char *urltag, const char *bitratetag = NULL, bool usechild = false); + void scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *bitratetag = NULL, bool usechild = false); /** * Reads the icecast directory (XML file) and calls scanXmlData From 684cf8076b2fb3a9308e688c1fc2075deedf8443 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 27 Jun 2017 23:45:57 +0200 Subject: [PATCH 336/394] audiodec: unify cover handling (cherry picked from commit c5dbede1d3f23e7c88ea62a188809d65fda9b0ae) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/99d72a0b8a0f31cc1ad7a85d0f80bcdebb94d681 Author: vanhofen Date: 2017-06-27 (Tue, 27 Jun 2017) Origin message was: ------------------ - audiodec: unify cover handling (cherry picked from commit c5dbede1d3f23e7c88ea62a188809d65fda9b0ae) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/driver/audiodec/ffmpegdec.cpp | 8 +++++--- src/driver/audiodec/mp3dec.cpp | 5 +++-- src/global.h | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 19c48a9eb..ef2583775 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -33,15 +33,19 @@ #include #include #include + +#include #include #include #include // UTF8 #include "ffmpegdec.h" + extern "C" { #include #include #include } + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) #define av_frame_alloc avcodec_alloc_frame #define av_frame_unref avcodec_get_frame_defaults @@ -63,8 +67,6 @@ extern cAudio * audioDecoder; #define ProgName "FfmpegDec" -#define COVERDIR "/tmp/cover" - static OpenThreads::Mutex mutex; static int cover_count = 0; @@ -521,7 +523,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (save_cover && (avc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC)) { mkdir(COVERDIR, 0755); std::string cover(COVERDIR); - cover += "/" + to_string(cover_count++) + ".jpg"; + cover += "/cover_" + to_string(cover_count++) + ".jpg"; FILE *f = fopen(cover.c_str(), "wb"); if (f) { AVPacket *pkt = &avc->streams[i]->attached_pic; diff --git a/src/driver/audiodec/mp3dec.cpp b/src/driver/audiodec/mp3dec.cpp index 69c11d5b4..c555add3f 100644 --- a/src/driver/audiodec/mp3dec.cpp +++ b/src/driver/audiodec/mp3dec.cpp @@ -1388,9 +1388,10 @@ bool CMP3Dec::SaveCover(FILE * in, CAudioMetaData * const m) data = id3_field_getbinarydata(field, &size); if ( data ) { + mkdir(COVERDIR, 0755); std::ostringstream cover; - cover.str(""); - cover << "/tmp/cover_" << cover_count++ << ".jpg"; + cover.str(COVERDIR); + cover << "/cover_" << cover_count++ << ".jpg"; FILE * pFile; pFile = fopen ( cover.str().c_str() , "wb" ); if (pFile) diff --git a/src/global.h b/src/global.h index 7bde595f7..6d3c5497e 100644 --- a/src/global.h +++ b/src/global.h @@ -47,6 +47,8 @@ #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" +#define COVERDIR "/tmp/cover" + #define LOGODIR ICONSDIR "/logo" #define LOGODIR_VAR ICONSDIR_VAR "/logo" From a82d0e9e58d85713faeb0ae5cc571fdf427083af Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 27 Jun 2017 23:45:57 +0200 Subject: [PATCH 337/394] audioplayer: fix coordinates to clear title-box (cherry picked from commit 519de5279c8065322c46a33b5059adaa49eb84f8) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b4cf14d6ba0e1ae0964a98709213948ef6c9be2 Author: vanhofen Date: 2017-06-27 (Tue, 27 Jun 2017) Origin message was: ------------------ - audioplayer: fix coordinates to clear title-box (cherry picked from commit 519de5279c8065322c46a33b5059adaa49eb84f8) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 9ce933e3d..cf33438a4 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1697,7 +1697,7 @@ void CAudioPlayerGui::paintTitleBox() return; if (m_state == CAudioPlayerGui::STOP && m_show_playlist) - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); + m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_title_height + OFFSET_SHADOW); else { // shadow From dc545ddf1d3fb191afdbd77267964be8d5bf999c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 19:53:38 +0200 Subject: [PATCH 338/394] audiometadata: add logo to metadata # Conflicts: # src/driver/audiometadata.cpp # src/driver/audiometadata.h cherry-picked from 9c58e2fc21eb701d44bedfe26b5dfd01fe800ceb Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b66ea2f9cc712b1708daa3e49adb063cd91e0f94 Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audiometadata: add logo to metadata # Conflicts: # src/driver/audiometadata.cpp # src/driver/audiometadata.h cherry-picked from 9c58e2fc21eb701d44bedfe26b5dfd01fe800ceb Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/driver/audiometadata.cpp | 6 +++++- src/driver/audiometadata.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/driver/audiometadata.cpp b/src/driver/audiometadata.cpp index 7dbe1bd08..8d48a0f10 100644 --- a/src/driver/audiometadata.cpp +++ b/src/driver/audiometadata.cpp @@ -64,6 +64,7 @@ CAudioMetaData::CAudioMetaData( const CAudioMetaData& src ) hasInfoOrXingTag( src.hasInfoOrXingTag ), artist( src.artist ), title( src.title ), album( src.album ), sc_station( src.sc_station ), date( src.date ), genre( src.genre ), track( src.track ),cover(src.cover), + logo( src.logo ), url( src.url ), cover_temporary( false ), changed( src.changed ) { @@ -97,9 +98,10 @@ void CAudioMetaData::operator=( const CAudioMetaData& src ) genre = src.genre; track = src.track; cover = src.cover; + logo = src.logo; + url = src.url; sc_station = src.sc_station; changed = src.changed; - changed = src.changed; cover_temporary = false; } @@ -125,6 +127,8 @@ void CAudioMetaData::clear() if (cover_temporary && !cover.empty()) unlink(cover.c_str()); cover.clear(); + logo.clear(); + url.clear(); cover_temporary=false; changed=false; } diff --git a/src/driver/audiometadata.h b/src/driver/audiometadata.h index 3f25fd79e..5220b0877 100644 --- a/src/driver/audiometadata.h +++ b/src/driver/audiometadata.h @@ -96,6 +96,8 @@ public: std::string genre; std::string track; std::string cover; + std::string logo; + std::string url; bool cover_temporary; bool changed; }; From b7f6c11c5939ea3fa8f9d2d1c4f1153a89a06696 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 27 Jun 2017 23:45:57 +0200 Subject: [PATCH 339/394] audioplayer: fix position of meta data in titlebox (cherry picked from commit b49ce6f0e77f39d7264affceddf10aa7ea46ed24) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f0c70b854cf7ceffe37a852ead9b5bea8b250feb Author: vanhofen Date: 2017-06-27 (Tue, 27 Jun 2017) Origin message was: ------------------ - audioplayer: fix position of meta data in titlebox (cherry picked from commit b49ce6f0e77f39d7264affceddf10aa7ea46ed24) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index cf33438a4..439856702 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -2093,8 +2093,12 @@ void CAudioPlayerGui::updateMetaData() if (updateMeta || updateScreen) { int cover_width = m_title_height + 2*OFFSET_INNER_MID; - m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - cover_width - OFFSET_INNER_MID, m_meta_height, COL_MENUHEAD_PLUS_0); - int xstart = ((m_width - 2*OFFSET_INNER_MID - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo))/2); + m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, COL_MENUHEAD_PLUS_0); + + int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo); + int xstart = (m_width - w)/2; + if (xstart < OFFSET_INNER_MID) + xstart = OFFSET_INNER_MID; g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL + m_meta_height, m_width - 2*xstart, m_metainfo, COL_MENUHEAD_TEXT); } } From fd6a3a90671a953218301a78eb50ab648b6f8dad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 11:29:03 +0200 Subject: [PATCH 340/394] audioplayer: reset idle time to avoid screensaver ... when returning from filebrowser (cherry picked from commit e65e21a0b8af97f8d097c2d436c39cb2d60a1505) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bab708281acb3b12d8a8d48d0c5a69f08f482e69 Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audioplayer: reset idle time to avoid screensaver ... when returning from filebrowser (cherry picked from commit e65e21a0b8af97f8d097c2d436c39cb2d60a1505) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 439856702..c4ae07f58 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1451,6 +1451,7 @@ bool CAudioPlayerGui::openFilebrowser(void) result = true; } + m_idletime = time(NULL); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); // if playlist is turned off -> start playing immediately From 9ac898c88263c0b9957024115d1e4230c3ecd8e4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 11:29:03 +0200 Subject: [PATCH 341/394] audioplayer: fix round borders in footer when playlist is hidden ... and use large roundings as in the other gui-elements cherry-picked from 102866f71d4f33912727d00f22ba1dde2b21d297 Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bb7b9e2207a062e52d3e063c8654c48b59d6c101 Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audioplayer: fix round borders in footer when playlist is hidden ... and use large roundings as in the other gui-elements cherry-picked from 102866f71d4f33912727d00f22ba1dde2b21d297 Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 44 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c4ae07f58..c360a281f 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1605,7 +1605,6 @@ void CAudioPlayerGui::paintHead() CComponentsHeader header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); - header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) header.setCaption(LOCALE_INETRADIO_NAME); @@ -1630,52 +1629,61 @@ void CAudioPlayerGui::paintFoot() { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; + int radius = RADIUS_LARGE; int button_y = m_y + m_height - OFFSET_SHADOW - m_info_height - OFFSET_INTER - OFFSET_SHADOW - 2*m_button_height; + int button_x = m_x; + int button_width = m_width; + + // ensure to get round corners in footer + if (!m_show_playlist && radius) + { + button_x += radius; + button_width -= 2*radius; + } // shadow - m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - - m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, radius, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, radius, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); if (!m_playlist.empty()) - ::paintButtons(m_x, button_y + m_button_height, m_width, 3, SecondLineButtons, m_width, m_button_height); + ::paintButtons(button_x, button_y + m_button_height, button_width, 3, SecondLineButtons, button_width, m_button_height); if (m_key_level == 0) { if (m_playlist.empty()) { if (m_inetmode) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[7], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[7], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 1, &(AudioPlayerButtons[7][0]), m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 1, &(AudioPlayerButtons[7][0]), button_width, m_button_height); } else if (m_inetmode) - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[8], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[8], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[1], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[1], button_width, m_button_height); } else if (m_key_level == 1) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) - ::paintButtons(m_x, button_y, m_width, 4, AudioPlayerButtons[0], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[0], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[6], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[6], button_width, m_button_height); } else // key_level == 2 { if (m_state == CAudioPlayerGui::STOP) { if (m_select_title_by_name) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[5], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[5], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[4], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[4], button_width, m_button_height); } else { if (m_select_title_by_name) - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[3], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[3], button_width, m_button_height); else - ::paintButtons(m_x, button_y, m_width, 2, AudioPlayerButtons[2], m_width, m_button_height); + ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[2], button_width, m_button_height); } } } @@ -1702,10 +1710,10 @@ void CAudioPlayerGui::paintTitleBox() else { // shadow - m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_LARGE); - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); - m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_LARGE); + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, 2, COL_FRAME_PLUS_0, RADIUS_LARGE); paintCover(); From ec16de6f289636b12f1ed7e994a67d2550ac41cf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 15:58:40 +0200 Subject: [PATCH 342/394] audioplayer: reset idle time to avoid screensaver ... when returning from shoutcast-filebrowser (cherry picked from commit a07fbc0cd627e47f0a73f1b09de9e6e0700dbf68) Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b62bb3715f32b62fd6c25d3f7c08ac9760bc5520 Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audioplayer: reset idle time to avoid screensaver ... when returning from shoutcast-filebrowser (cherry picked from commit a07fbc0cd627e47f0a73f1b09de9e6e0700dbf68) Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c360a281f..bc18229b3 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1523,6 +1523,7 @@ bool CAudioPlayerGui::openSCbrowser(void) #endif result = true; } + m_idletime = time(NULL); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); // if playlist is turned off -> start playing immediately From 6c9584034575a5f08a38203853fc5aebd5e9122f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 28 Jun 2017 20:36:51 +0200 Subject: [PATCH 343/394] CComponentsFooter: remove FIXME tag fixed since 1b2eea185fc3a50a027d7834c340a184b1eb62e4 Obsolete wrong types caused this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/47f7426aa727985aa0cdb06cfc77b26ceef698af Author: Thilo Graf Date: 2017-06-28 (Wed, 28 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 74b48d754..913de581e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -123,8 +123,8 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con * If already existing some items then subtract those width from footer width. * ...so we have the possible usable size for button container. */ - if(!v_cc_items.empty()){ //FIXME: footer container seems always not empty here, so here j initialized with = 1. I dont't know where it comes from! dbt! - for (size_t j= 1; j< size(); j++) + if(!v_cc_items.empty()){ + for (size_t j= 0; j< size(); j++) w_chain -= getCCItem(j)->getWidth(); } From 9b0650d695426be6c0a606937e021082d5d9ea12 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 28 Jun 2017 21:24:09 +0200 Subject: [PATCH 344/394] settings.h: add define for minimal frame width Mostly we are using a frame width of 2 lines. This should ensure correct scaling with other screen resolution. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aaa4031972d7a82c3f4c5683122ff819478e4cf Author: Thilo Graf Date: 2017-06-28 (Wed, 28 Jun 2017) ------------------ This commit was generated by Migit --- src/system/settings.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system/settings.h b/src/system/settings.h index 34de4f54f..fd72578b2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -938,6 +938,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) +#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2) + #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) #define BIGFONT_FACTOR 1.5 From 43d2aeee1c9535d80eb1dd3c76090aac7a579304 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 28 Jun 2017 22:03:12 +0200 Subject: [PATCH 345/394] CAudioPlayerGui: add cc scquare objekt as title box, fix caption bg colors Use of cc square object saves unnecessary paintBoxRel() calls. BgColors of metatdata and time display were different to titlebox body color, but was not to see with all themes. btw: time box was too much on the right side. Frame of titelbox was overpainted but was not very noticeable if frame width < 2. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86742b1d72a5a306fb5181f1ec418f4c5c4c09c9 Author: Thilo Graf Date: 2017-06-28 (Wed, 28 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 40 +++++++++++++++++++++++++--------------- src/gui/audioplayer.h | 1 + 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index bc18229b3..34e022b86 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -154,6 +154,7 @@ CAudioPlayerGui::CAudioPlayerGui(bool inetmode) m_inetmode = inetmode; m_detailsline = NULL; m_infobox = NULL; + m_titlebox = NULL; Init(); } @@ -209,6 +210,7 @@ CAudioPlayerGui::~CAudioPlayerGui() m_title2Pos.clear(); delete m_detailsline; delete m_infobox; + delete m_titlebox; } const struct button_label AudioPlayerButtons[][4] = @@ -1707,15 +1709,23 @@ void CAudioPlayerGui::paintTitleBox() return; if (m_state == CAudioPlayerGui::STOP && m_show_playlist) - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_title_height + OFFSET_SHADOW); + { + if (m_titlebox) + { + m_titlebox->kill(); + delete m_titlebox; m_titlebox = NULL; + } + } else { - // shadow - m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_LARGE); - - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_LARGE); - m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, 2, COL_FRAME_PLUS_0, RADIUS_LARGE); - + // title box + if (!m_titlebox) + { + m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); + m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->setCorner(RADIUS_LARGE); + } + m_titlebox->paint(false); paintCover(); // first line (Track number) @@ -1738,7 +1748,7 @@ void CAudioPlayerGui::paintTitleBox() int xstart = (m_width - w)/2; if (xstart < OFFSET_INNER_MID) xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //caption "current track" // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1763,7 +1773,7 @@ void CAudioPlayerGui::paintTitleBox() xstart = (m_width - w)/2; if (xstart < OFFSET_INNER_MID) xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //artist - title // reset so fields get painted always m_metainfo.clear(); @@ -2103,7 +2113,7 @@ void CAudioPlayerGui::updateMetaData() if (updateMeta || updateScreen) { int cover_width = m_title_height + 2*OFFSET_INNER_MID; - m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, COL_MENUHEAD_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, m_titlebox->getColorBody()); int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo); int xstart = (m_width - w)/2; @@ -2151,7 +2161,7 @@ void CAudioPlayerGui::updateTimes(const bool force) if (m_inetmode) w_total_time = 0; - int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time; + int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - 2*m_titlebox->getFrameThickness(); // played time offset to align this value on the right side int o_played_time = std::max(w_faked_time - w_played_time, 0); int x_faked_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - w_faked_time; @@ -2160,20 +2170,20 @@ void CAudioPlayerGui::updateTimes(const bool force) if (updateTotal && !m_inetmode) { - m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time + OFFSET_INNER_MID, m_item_height, COL_MENUHEAD_PLUS_0); + m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time + OFFSET_INNER_MID, m_item_height, m_titlebox->getColorBody()); if (m_time_total > 0) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT); //total time } } if (updatePlayed || (m_state == CAudioPlayerGui::PAUSE)) { - m_frameBuffer->paintBoxRel(x_faked_time, y_times, w_faked_time, m_item_height, COL_MENUHEAD_PLUS_0); + m_frameBuffer->paintBoxRel(x_faked_time, y_times, w_faked_time, m_item_height, m_titlebox->getColorBody()); struct timeval tv; gettimeofday(&tv, NULL); if ((m_state != CAudioPlayerGui::PAUSE) || (tv.tv_sec & 1)) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_played_time, y_times + m_item_height, w_played_time, played_time, COL_MENUHEAD_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_played_time, y_times + m_item_height, w_played_time, played_time, COL_MENUHEAD_TEXT); //elapsed time } } } diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 3f945c993..8cb914a12 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -128,6 +128,7 @@ class CAudioPlayerGui : public CMenuTarget bool m_inetmode; CComponentsDetailsLine *m_detailsline; CComponentsInfoBox *m_infobox; + CComponentsShapeSquare *m_titlebox; SMSKeyInput m_SMSKeyInput; From 8d1a669301e16544f42d7e88ffe2cef94a3d2261 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 29 Jun 2017 15:03:16 +0200 Subject: [PATCH 346/394] lib-libtuxtxt-tuxtxt.cpp avoid segfault, supplement to 6771de1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6344b352790fe63bb4c84c2d4a5fc3ab5a05029 Author: Michael Liebmann Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d5d093a6a..102efd4c1 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -47,6 +47,9 @@ static int cfg_national_subset; static int screen_x, screen_y, screen_w, screen_h; +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor=false); +void FillBorder(fb_pixel_t color, bool modeFullColor=false); + fb_pixel_t *getFBp(int *y) { if (*y < (int)var_screeninfo.yres) @@ -56,34 +59,31 @@ fb_pixel_t *getFBp(int *y) return lbb; } -void FillRect(int x, int y, int w, int h, int color) +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor/*=false*/) { - if(color < 0 || SIZECOLTABLE < color){ - printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); - return; - } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; - if (w > 0) + if (w > 0) { + fb_pixel_t col = (modeFullColor) ? color : bgra[color]; for (int count = 0; count < h; count++) { fb_pixel_t *dest0 = p; for (int i = 0; i < w; i++) - *(dest0++) = bgra[color]; + *(dest0++) = col; p += stride; } + } } - -void FillBorder(int color) +void FillBorder(fb_pixel_t color, bool modeFullColor/*=false*/) { int ys = (var_screeninfo.yres-var_screeninfo.yoffset); - FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color); - FillRect(StartX, ys ,displaywidth,StartY ,color); - FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color); + FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color, modeFullColor); + FillRect(StartX, ys ,displaywidth,StartY ,color, modeFullColor); + FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color, modeFullColor); if (screenmode == 0 ) - FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color); + FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color, modeFullColor); } int getIndexOfPageInHotlist() @@ -258,7 +258,7 @@ void RenderClearMenuLineBB(char *p, tstPageAttr *attrcol, tstPageAttr *attr) memset(p-TOPMENUCHARS, ' ', TOPMENUCHARS); /* init with spaces */ } -void ClearBB(int color) +void ClearBB(fb_pixel_t color) { FillRect(0, (var_screeninfo.yres - var_screeninfo.yoffset), var_screeninfo.xres, var_screeninfo.yres, color); } @@ -270,7 +270,7 @@ void ClearFB(int /*color*/) } #if 0 //never used -void ClearB(int color) +void ClearB(fb_pixel_t color) { FillRect(0, 0, var_screeninfo.xres, var_screeninfo.yres, color); /* framebuffer */ FillRect(0, var_screeninfo.yres, var_screeninfo.xres, var_screeninfo.yres, color); /* backbuffer */ @@ -841,7 +841,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, { *pAPy = RowAddress2Row(iAddress); /* new Active Row */ - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0 + *pAPy; int maxrow; #if TUXTXT_DEBUG @@ -892,7 +892,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, *pAPx = *pAPy = 0; /* new Active Position 0,0 */ if (*endcol == 40) /* active object */ { - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0; // + *pAPy; int maxrow; @@ -4096,7 +4096,7 @@ void RenderDRCS( //FIX ME } -void DrawVLine(int x, int y, int l, int color) +void DrawVLine(int x, int y, int l, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, 0, l); @@ -4109,7 +4109,7 @@ void DrawVLine(int x, int y, int l, int color) } } -void DrawHLine(int x, int y, int l, int color) +void DrawHLine(int x, int y, int l, fb_pixel_t color) { int ltmp; fb_pixel_t *p = getFBp(&y); @@ -4130,7 +4130,7 @@ void FillRectMosaicSeparated(int x, int y, int w, int h, int fgcolor, int bgcolo } } -void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, int color) +void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y0); MARK_FB(x0, y0, l0, h); @@ -4789,7 +4789,7 @@ void RenderChar(int Char, tstPageAttr *Attribute, int zoom, int yoffset) { for (Bit = 0x80; Bit; Bit >>= 1) { - int color; + fb_pixel_t color; if (--pixtodo < 0) break; @@ -5559,7 +5559,7 @@ void CopyBB2FB() /* adapt background of backbuffer if changed */ if (StartX > 0 && *lfb != *lbb) { - FillBorder(*lbb); + FillBorder(*lbb, true); // ClearBB(*(lfb + var_screeninfo.xres * var_screeninfo.yoffset)); } From 82f30b454dc471e8f31ae3326dc656c834e251bf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Jun 2017 17:18:06 +0200 Subject: [PATCH 347/394] settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a7ac6c0b0293660e2be11dc23439d76467b9296 Author: vanhofen Date: 2017-06-29 (Thu, 29 Jun 2017) Origin message was: ------------------ - settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/system/settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 34e022b86..6596d959b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1722,7 +1722,7 @@ void CAudioPlayerGui::paintTitleBox() if (!m_titlebox) { m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); - m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->enableFrame(true, FRAME_WIDTH_MIN); m_titlebox->setCorner(RADIUS_LARGE); } m_titlebox->paint(false); diff --git a/src/system/settings.h b/src/system/settings.h index fd72578b2..7950a6fa3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -938,7 +938,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) -#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2) +#define FRAME_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(2) #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) From 0dda6b79793300130dae484925c7be344bc3d92e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Jun 2017 19:04:10 +0200 Subject: [PATCH 348/394] src/gui/moviebrowser/mb.cpp fix segfault if m_movieSelectionHandler is NULL Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc5ba460a55a68c7db94365f97c858bc5a3cfece Author: Jacek Jendrzej Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9d3a3e27f..76161a8f7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3449,7 +3449,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + if (m_movieSelectionHandler){ + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + } mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); From d5b0ebf8f18f41306196d7ff1c68a8333a8ff463 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:40:19 +0200 Subject: [PATCH 349/394] src/gui/movieplayer.cpp show FileTimeOSD only if setSpeed work Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f095b96c92dd94cdbcaf9439314e8e89faeb30c Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5ecc32a27..d90f10e64 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1534,7 +1534,8 @@ void CMoviePlayerGui::PlayFileLoop(void) makeScreenShot(); } else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || (msg == (neutrino_msg_t) g_settings.mpkey_forward)) { - int newspeed; + int newspeed = 0; + bool setSpeed = false; if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) { newspeed = (speed >= 0) ? -1 : speed - 1; } else { @@ -1547,9 +1548,10 @@ void CMoviePlayerGui::PlayFileLoop(void) if (playstate != CMoviePlayerGui::PAUSE) playstate = msg == (neutrino_msg_t) g_settings.mpkey_rewind ? CMoviePlayerGui::REW : CMoviePlayerGui::FF; updateLcd(); + setSpeed = true; } - if (!FileTimeOSD->IsVisible() && !time_forced) { + if (!FileTimeOSD->IsVisible() && !time_forced && setSpeed) { FileTimeOSD->switchMode(position, duration); time_forced = true; } From 5d38764dc896c0a815acfa5cce01785c7be68574 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 30 Jun 2017 13:42:09 +0200 Subject: [PATCH 350/394] src/gui/movieplayer.cpp fix play icon after pause->seek Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4318615a606b426e926b7e2b395c2a253caf1304 Author: Jacek Jendrzej Date: 2017-06-30 (Fri, 30 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d90f10e64..b087fee10 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1253,6 +1253,11 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute) { clearSubtitle(); bool res = playback->SetPosition(pos, absolute); + if(is_file_player && res && speed == 0 && playstate == CMoviePlayerGui::PAUSE){ + playstate = CMoviePlayerGui::PLAY; + speed = 1; + playback->SetSpeed(speed); + } return res; } From 1c9ce40eb46333a7d8ebf1d51f2be8c7345fe253 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 29 Jun 2017 22:13:17 +0200 Subject: [PATCH 351/394] CBouquetList: fix scrollbar shadow Footer is painted as first item and scrollbar as last, so shadow overpaint footer body. Either paint scrollbar as first or use matching shadow parameter. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/acb5b7e292e60cbfd6234d102e462af94a77a09d Author: Thilo Graf Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 73eb025dc..d031f4bc8 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -740,5 +740,5 @@ void CBouquetList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } From 9473eabf2adfea6b567f6e77fe1090b0a275b7ff Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 1 Jul 2017 10:26:33 +0200 Subject: [PATCH 352/394] src/gui/opkg_manager.cpp fix esource leak; supplement to 6e321d596686aa1590ba617a2f3707761c121e74 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/18e1ec060f4c6582142ce5a6f55d90ba6f03c575 Author: Jacek Jendrzej Date: 2017-07-01 (Sat, 01 Jul 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 5 +++-- src/gui/timerlist.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index f9970b7ec..5276bbc76 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -674,9 +674,10 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc) fseek(fd, 0, SEEK_END); fgetpos(fd, &fz); fseek(fd, 0, SEEK_SET); - if (fz.__pos == 0) + if (fz.__pos == 0){ + fclose(fd); return pkgDesc; - + } char buf[512]; string package, version, description; while (fgets(buf, sizeof(buf), fd)) { diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 23f6d734a..c54dbf792 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1817,7 +1817,7 @@ int CTimerList::newTimer() bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_name) { CTimerd::TimerList overlappingTimers; - int pre,post; + int pre = 0,post = 0; Timer->getRecordingSafety(pre,post); for (CTimerd::TimerList::iterator it = timerlist.begin(); it != timerlist.end();++it) From 6c363152e3c84e65961142e2eba7f623430e663f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 1 Jul 2017 20:40:20 +0200 Subject: [PATCH 353/394] CUpnpBrowserGui: fix dline paint during directory selection Dline was not removed on directory selection. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/baf441b5d074b60c17b1fd829ea86504aa340dd6 Author: Thilo Graf Date: 2017-07-01 (Sat, 01 Jul 2017) ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index dbfcf8aa7..d343191ba 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1226,8 +1226,11 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) void CUpnpBrowserGui::paintItem2DetailsLine(int pos) { - if (pos < 0) + if (pos < 0){ + if (dline) + dline->kill(); return; + } int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_item_y + pos*m_item_height; From f0c15bdf9c3c999cd701a63314a84353c9d2a922 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 1 Jul 2017 22:01:11 +0200 Subject: [PATCH 354/394] CUpnpBrowserGui: try to reduce flicker effects on scroll Some parts on screen should be painted only if changed. This should help to reduce some flicker effects. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3213999198c227b66ceb4d3306a9a912f4302e0a Author: Thilo Graf Date: 2017-07-01 (Sat, 01 Jul 2017) ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index d343191ba..55c4ce3bc 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -93,7 +93,7 @@ void CUpnpBrowserGui::Init() topbox.setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0, COL_MENUHEAD_TEXT); topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - topbox.enableShadow(CC_SHADOW_ON, -1, true); + topbox.enableShadow(CC_SHADOW_ON); infobox.enableFrame(true, 2); infobox.setCorner(RADIUS_LARGE); @@ -101,7 +101,7 @@ void CUpnpBrowserGui::Init() infobox.setTextColor(COL_MENUCONTENTDARK_TEXT); infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); - infobox.enableShadow(CC_SHADOW_ON, -1, true); + infobox.enableShadow(CC_SHADOW_ON); timebox.enableFrame(true, 2); timebox.setCorner(RADIUS_LARGE); @@ -109,7 +109,7 @@ void CUpnpBrowserGui::Init() timebox.setTextColor(infobox.getTextColor()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); - timebox.enableShadow(CC_SHADOW_ON, -1, true); + timebox.enableShadow(CC_SHADOW_ON); m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); @@ -193,7 +193,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ stopAudio(); m_frameBuffer->stopFrame(); - m_frameBuffer->Clear(); + topbox.kill(); CZapit::getInstance()->EnablePlayback(true); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , m_LastMode); @@ -916,7 +916,6 @@ bool CUpnpBrowserGui::selectItem(std::string id) delete entries; timeout = 0; - m_frameBuffer->Clear(); return endall; } @@ -942,8 +941,8 @@ void CUpnpBrowserGui::paintDeviceInfo() topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); - topbox.paint0(); + if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER)) + topbox.paint0(); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) @@ -1144,8 +1143,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); - topbox.paint0(); + if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER)) + topbox.paint0(); } void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset) @@ -1205,8 +1204,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text = m_playing_entry.title; text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : ""; text += "\n" + m_playing_entry.album; - infobox.setText(text, CTextBox::AUTO_WIDTH); - infobox.paint0(); + if (infobox.setText(text, CTextBox::AUTO_WIDTH)) + infobox.paint0(); } }else{ if (!entry) @@ -1215,8 +1214,8 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text = entry->title; text += !entry->artist.empty() ? " - " + entry->artist : ""; text += "\n" + entry->album; - infobox.setText(text, CTextBox::AUTO_WIDTH); - infobox.paint0(); + if (infobox.setText(text, CTextBox::AUTO_WIDTH)) + infobox.paint0(); } if (image) image->paint0(); From ff3e6fd94982de4d191d68f222f2328af0bf32e8 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 2 Jul 2017 19:11:27 +0200 Subject: [PATCH 355/394] fix epgplus detailsline hide bug (thx dbo) Signed-off-by: Thilo Graf dline was not removed after called epg info. btw. Small request: It would be nice if a short brief justification would be included. That would be make some things easier to track and saves unnecessary questions. Thx! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7e196c58ad5d1906fcb2edceba5c740a0d676a5 Author: TangoCash Date: 2017-07-02 (Sun, 02 Jul 2017) ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bcece667b..9bdc9c69b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1393,6 +1393,13 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } + + if (this->selectedChannelEntry->detailsLine) { + this->selectedChannelEntry->detailsLine->kill(); + delete this->selectedChannelEntry->detailsLine; + this->selectedChannelEntry->detailsLine = NULL; + } + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } From 54da8c572fb9deee6b824d7eac57ffdf87d5e674 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Jul 2017 10:50:20 +0200 Subject: [PATCH 356/394] CLocaleManager: add casted version of getText() function Allows easier handling with strings instead const char for usage as string source. Separate casts are not requiered. Overload of getText() was not possible but, name getTextAsString() is keeping namespace of base function getText(). Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aa66b84c1346c32832b1b4bd17e48eb6880c15e Author: Thilo Graf Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ CLocaleManager: add casted version of getText() function Allows easier handling with strings instead const char for usage as string source. Separate casts are not requiered. Overload of getText() was not possible but, name getTextAsString() is keeping namespace of base function getText(). ------------------ This commit was generated by Migit --- src/system/localize.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system/localize.h b/src/system/localize.h index b12b430fd..0794ff499 100644 --- a/src/system/localize.h +++ b/src/system/localize.h @@ -69,6 +69,7 @@ class CLocaleManager loadLocale_ret_t loadLocale(const char * const locale, bool asdefault = false); const char * getText(const neutrino_locale_t keyName) const; + std::string getTextAsString(const neutrino_locale_t keyName) const {return (static_cast(getText(keyName)));} static neutrino_locale_t getMonth (const struct tm * struct_tm_p); static neutrino_locale_t getMonth (const int mon); From 05d63ab5bc1c0f22b030764426af49e25bffd873 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 12:07:33 +0200 Subject: [PATCH 357/394] audioplayer: don't scale covers to quadrat-dimensions Signed-off-by: Thilo Graf # Conflicts: # src/gui/audioplayer.cpp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dd193140009b5683b479d68d5ce184f887d1a30d Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - audioplayer: don't scale covers to quadrat-dimensions Signed-off-by: Thilo Graf # Conflicts: # src/gui/audioplayer.cpp ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 34 +++++++++++++++++++++++----------- src/gui/audioplayer.h | 1 + 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 6596d959b..03edd14c6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -296,6 +296,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_meta_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_title_height = 3*OFFSET_INNER_SMALL + 2*m_item_height + m_meta_height; + m_cover_width = 0; m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); @@ -1700,7 +1701,21 @@ void CAudioPlayerGui::paintCover() cover = meta.cover; if (access(cover.c_str(), F_OK) == 0) - g_PicViewer->DisplayImage(cover, m_x + OFFSET_INNER_MID, m_y + OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_title_height - 2*OFFSET_INNER_SMALL, m_frameBuffer->TM_NONE); + { + int cover_x = m_x + OFFSET_INNER_MID; + int cover_y = m_y + OFFSET_INNER_SMALL; + m_cover_width = 0; + CComponentsPicture *cover_object = new CComponentsPicture(cover_x, cover_y, cover); + if (cover_object) + { + cover_object->doPaintBg(false); + cover_object->SetTransparent(CFrameBuffer::TM_BLACK); + cover_object->setHeight(m_title_height - 2*OFFSET_INNER_SMALL, true); + cover_object->paint(); + + m_cover_width = cover_object->getWidth() + OFFSET_INNER_MID; + } + } } void CAudioPlayerGui::paintTitleBox() @@ -1742,13 +1757,11 @@ void CAudioPlayerGui::paintTitleBox() tmp += sNr ; } - // FIXME - there's no cover-check; so we maybe paint over the cover - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); int xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //caption "current track" + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //caption "current track" // second line (Artist/Title...) GetMetaData(m_curr_audiofile); @@ -1771,9 +1784,9 @@ void CAudioPlayerGui::paintTitleBox() } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); xstart = (m_width - w)/2; - if (xstart < OFFSET_INNER_MID) - xstart = OFFSET_INNER_MID; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //artist - title + if (xstart < OFFSET_INNER_MID + m_cover_width) + xstart = OFFSET_INNER_MID + m_cover_width; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - OFFSET_INNER_MID - xstart, tmp, COL_MENUHEAD_TEXT); //artist - title // reset so fields get painted always m_metainfo.clear(); @@ -2112,8 +2125,7 @@ void CAudioPlayerGui::updateMetaData() if (updateMeta || updateScreen) { - int cover_width = m_title_height + 2*OFFSET_INNER_MID; - m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, m_titlebox->getColorBody()); + m_frameBuffer->paintBoxRel(m_x + OFFSET_INNER_MID + m_cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - 2*OFFSET_INNER_MID - m_cover_width, m_meta_height, m_titlebox->getColorBody()); int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo); int xstart = (m_width - w)/2; diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 8cb914a12..86810d109 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -98,6 +98,7 @@ class CAudioPlayerGui : public CMenuTarget int m_meta_height; int m_button_height; int m_title_height; + int m_cover_width; int m_info_height; int m_key_level; bool m_visible; From 3533a3bb8acc86845017b286c9d29dd45ca763b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2017 22:02:50 +0200 Subject: [PATCH 358/394] moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f191f0730fa2f347b2f3a38cf84127acb084ce51 Author: vanhofen Date: 2017-07-03 (Mon, 03 Jul 2017) Origin message was: ------------------ - moviebrowser: another fix for deletion function ... and add some temporary console output to see what happens Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 76161a8f7..86f7d5e51 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1252,8 +1252,8 @@ bool CMovieBrowser::getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist) { flist.clear(); mlist.clear(); - P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; + P_MI_MOVIE_LIST *handle_list = &m_vHandleBrowserList; if (m_windowFocus == MB_FOCUS_LAST_PLAY) handle_list = &m_vHandlePlayList; if (m_windowFocus == MB_FOCUS_LAST_RECORD) @@ -2480,18 +2480,26 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; + getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); + if (cursor_only || (filelist.empty() || movielist.empty())) { + printf("CMovieBrowser::onDelete(%s) clearing the lists\n", cursor_only ? "true" : "false"); + filelist.clear(); movielist.clear(); + printf("CMovieBrowser::onDelete(%s) add the m_movieSelectionHandler\n", cursor_only ? "true" : "false"); + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); - } - else - { - getSelectedFiles(filelist, movielist); + + printf("CMovieBrowser::onDelete(%s) filelist size: %d\n", cursor_only ? "true" : "false", filelist.size()); + printf("CMovieBrowser::onDelete(%s) movielist size: %d\n", cursor_only ? "true" : "false", movielist.size()); } MI_MOVIE_LIST dellist; From 5820d8a8a00521ae523b1c43f3ae65dcc7693855 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Jul 2017 11:07:30 +0200 Subject: [PATCH 359/394] epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/761a2b2e739daec2340f8d0d5a005d4fea699e4a Author: vanhofen Date: 2017-07-04 (Tue, 04 Jul 2017) Origin message was: ------------------ - epgscan: allow to set rescan period to catch a bug in epgscan Scan isn't executed while a movie is played. When movie is stopped the scan-timer is ignored too. Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 4 ++-- src/driver/scanepg.cpp | 5 +++-- src/neutrino.cpp | 2 ++ src/system/settings.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 657a2a244..cbaab0987 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -469,7 +469,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) _newtimer.correct_time = correct_time; -//printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); +printf("adding timer %d (0x%llx, 0x%llx)\n", _newtimer.id, _newtimer.times_out, Interval); std::vector::iterator e; for ( e= timers.begin(); e!= timers.end(); ++e ) @@ -482,7 +482,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time ) void CRCInput::killTimer(uint32_t &id) { -//printf("killing timer %d\n", id); +printf("killing timer %d\n", id); if(id == 0) return; diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index 586c9023a..7a659feff 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -39,7 +39,7 @@ #include #include -#define EPG_RESCAN_TIME (24*60*60) +//#define EPG_RESCAN_TIME (24*60*60) extern CBouquetList * bouquetList; extern CBouquetList * TVfavList; @@ -322,8 +322,9 @@ int CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) void CEpgScan::AddTimer() { if (rescan_timer == 0) - rescan_timer = g_RCInput->addTimer(EPG_RESCAN_TIME*1000ULL*1000ULL, true); + rescan_timer = g_RCInput->addTimer((g_settings.epg_scan_rescan*60*60)*1000ULL*1000ULL, true); INFO("rescan timer id %d", rescan_timer); + INFO("rescan time is %d*60*60", g_settings.epg_scan_rescan); } void CEpgScan::EnterStandby() diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 10f96a1db..24ed037d0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -579,6 +579,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_scan = CEpgScan::SCAN_CURRENT; g_settings.epg_scan_mode = CEpgScan::MODE_OFF; } + g_settings.epg_scan_rescan = configfile.getInt32("epg_scan_rescan", 24); g_settings.epg_save_mode = configfile.getInt32("epg_save_mode", 0); //widget settings g_settings.widget_fade = false; @@ -1246,6 +1247,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); + configfile.setInt32("epg_scan_rescan", g_settings.epg_scan_rescan); configfile.setInt32("epg_save_mode", g_settings.epg_save_mode); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache ); configfile.setInt32("epg_extendedcache_time" ,g_settings.epg_extendedcache); diff --git a/src/system/settings.h b/src/system/settings.h index 7950a6fa3..9ca4e21d6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -293,6 +293,7 @@ struct SNeutrinoSettings std::string epg_dir; int epg_scan; int epg_scan_mode; + int epg_scan_rescan; int epg_save_mode; int epg_search_history_size; From 19059348be37ed0dd6b6e62fe94a83b95ad32951 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 5 Jul 2017 08:57:04 +0200 Subject: [PATCH 360/394] no shutdown if streaming (thx dbo) prevent shutdown from timer if stb is started from deep standby > does a timer-record > and meanwhile streaming (eg. localTV or via web-if to PC) is active Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/57f46e1f2b01852e4f719e72e10f87258b9647eb Author: TangoCash Date: 2017-07-05 (Wed, 05 Jul 2017) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 24ed037d0..b25ed8e7b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3497,6 +3497,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 5) == CMsgBox::mbrYes); } else if( msg == NeutrinoMessages::SHUTDOWN ) { + if(CStreamManager::getInstance()->StreamStatus()) + skipShutdownTimer = true; if(!skipShutdownTimer) { ExitRun(g_info.hw_caps->can_shutdown); } From c9e8652129f319a40e485a0378f39aa201a6220f Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 6 Aug 2017 21:29:07 +0200 Subject: [PATCH 361/394] neutrino.cpp: repaint of background in radio mode, when close UPNP-Browser Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/95b535016f4a8b2d4edfbcec223a87f3c9b4aebb Author: GetAway Date: 2017-08-06 (Sun, 06 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b25ed8e7b..519ebdfda 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4103,7 +4103,7 @@ void CNeutrinoApp::radioMode( bool rezap) CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); videoDecoder->Standby(false); } - mode = mode_radio; + #ifdef ENABLE_PIP pipDecoder->Pig(g_settings.pip_radio_x, g_settings.pip_radio_y, g_settings.pip_radio_width, g_settings.pip_radio_height, @@ -4111,6 +4111,12 @@ void CNeutrinoApp::radioMode( bool rezap) #endif CRecordManager::getInstance()->StopAutoRecord(); + if (mode != mode_webtv) { + frameBuffer->useBackground(false); + frameBuffer->paintBackground(); + } + mode = mode_radio; + g_RemoteControl->radioMode(); SetChannelMode(g_settings.channel_mode_radio); From aaee0baf0778c70c2e0d340439aab53afdb7c451 Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 6 Aug 2017 23:03:25 +0200 Subject: [PATCH 362/394] neutrino: disable some menus in upnp & ts mode to prevent inoperability of neutrino Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/90de51de3807c76f66f642c94fec82cd1f7d2f6f Author: GetAway Date: 2017-08-06 (Sun, 06 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/user_menue.cpp | 13 +++++++------ src/gui/widget/menue.cpp | 8 +++++++- src/gui/widget/menue.h | 3 +++ src/neutrino_menue.cpp | 18 +++++++++++++++--- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index a7d77530d..657956f86 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -184,6 +184,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu->addItem(GenericMenuSeparator); bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp; bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); @@ -249,7 +250,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIO_SELECT: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon); + menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -285,7 +286,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (g_settings.recording_type == RECORDING_OFF) break; keyhelper.get(&key,&icon,CRCInput::RC_green); - menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); break; } @@ -407,14 +408,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_YOUTUBE: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); break; } case SNeutrinoSettings::ITEM_FILEPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY); break; } @@ -442,14 +443,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIOPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); break; } case SNeutrinoSettings::ITEM_INETPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); break; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index be765c30c..f944ccfb9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -131,7 +131,13 @@ bool CMenuItem::initModeCondition(const int& stb_mode) void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition) { int stb_mode = CNeutrinoApp::getInstance()->getMode(); - +#if ENABLE_UPNP + if (condition & DCOND_MODE_UPNP){ + if (stb_mode == CNeutrinoApp::mode_upnp) + if (initModeCondition(stb_mode)) + return; + } +#endif if (condition & DCOND_MODE_TS){ if (stb_mode == CNeutrinoApp::mode_ts) if (initModeCondition(stb_mode)) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 3b47f51de..4aa5797ca 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -78,6 +78,9 @@ enum DCOND_MODE_TV = 2, DCOND_MODE_RADIO = 4, DCOND_MODE_TS = 8 +#if ENABLE_UPNP + ,DCOND_MODE_UPNP = 16 +#endif }/*menu_item_disable_cond_t*/; class CChangeObserver diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index fc673329b..3b281fcae 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -164,17 +164,29 @@ void CNeutrinoApp::InitMenuMain() //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); - personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); + personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); } //timer From 208498a730e9346d02eb5bea7ea60ff4f89ed36c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 363/394] Colorsettings: add possibility to change shadow color Shadow color was bound to infobar color and it's not really understandable why, because with some colors eg. black, the shadow is grey or with other colors it is exaggerated colored and seems to be not realistically and looks unusual if shadow is brighter or colorful than foreground. Some themes will thank it. TODO: update theme files with matching values if required Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c600b4c416b0fc409ff70e7d6a3898ae89a97bfa Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/osd_setup.cpp | 9 +++++++++ src/gui/themes.cpp | 10 ++++++++++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/setting_helpers.cpp | 6 +++--- src/system/settings.h | 5 +++++ 8 files changed, 35 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6aaf0e4eb..1319f74a8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung +colormenu.shadow_color Schattenfarbe colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Farbverlauf für Menü-Trennlinien akt menu.hint_colored_events Definiert, ob die aktuelle oder nächste Sendung in einer anderen Farbe dargestellt werden soll menu.hint_colored_events_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar menu.hint_colors Konfigurieren Sie die Menü-Farben +menu.hint_colors_shadow Einstellen der Schattenfarbe menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt menu.hint_dboxinfo Informationen über CPU und Arbeitsspeicher der Box diff --git a/data/locale/english.locale b/data/locale/english.locale index cc4e86104..7ff88c04a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution +colormenu.shadow_color Shadow Color colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Disable/enable color gradient for menu menu.hint_colored_events Use different color for current or next event menu.hint_colored_events_textcolor Change color for colored events in channellist and infobar menu.hint_colors Configure GUI colors +menu.hint_colors_shadow Setup for shadow color. menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color menu.hint_dboxinfo Information about box cpu and storage diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 06122d93a..a56e0365a 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -765,6 +765,8 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) &t.menu_Foot_alpha, colorSetupNotifier); CColorChooser* chFootTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Foot_Text_red, &t.menu_Foot_Text_green, &t.menu_Foot_Text_blue, NULL, colorSetupNotifier); + CColorChooser* chShadowColor = new CColorChooser(LOCALE_COLORMENU_SHADOW_COLOR, &t.shadow_red, &t.shadow_green, &t.shadow_blue, + &t.menu_Head_alpha, colorSetupNotifier); menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD)); @@ -930,6 +932,13 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_COLORED_EVENTS_INFOBAR, &t.colored_events_infobar, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true); oj->setHint("", LOCALE_MENU_HINT_COLORED_EVENTS); menu_colors->addItem(oj); + + // shadow + menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE)); + + mf = new CMenuDForwarder(LOCALE_COLORMENU_SHADOW_COLOR, true, NULL, chShadowColor ); + mf->setHint("", LOCALE_MENU_HINT_COLORS_SHADOW); + menu_colors->addItem(mf); } /* for font size setup */ diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 8e510b37a..70b202c6e 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -329,6 +329,11 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "progressbar_timescale_green", t.progressbar_timescale_green); configfile.setInt32( "progressbar_timescale_yellow", t.progressbar_timescale_yellow); configfile.setInt32( "progressbar_timescale_invert", t.progressbar_timescale_invert); + + configfile.setInt32( "shadow_alpha", t.shadow_alpha ); + configfile.setInt32( "shadow_red", t.shadow_red ); + configfile.setInt32( "shadow_green", t.shadow_green ); + configfile.setInt32( "shadow_blue", t.shadow_blue ); } void CThemes::getTheme(CConfigFile &configfile) @@ -428,6 +433,11 @@ void CThemes::getTheme(CConfigFile &configfile) t.progressbar_timescale_green = configfile.getInt32("progressbar_timescale_green", 100); t.progressbar_timescale_yellow = configfile.getInt32("progressbar_timescale_yellow", 70); t.progressbar_timescale_invert = configfile.getInt32("progressbar_timescale_invert", 0); + + t.shadow_alpha = configfile.getInt32( "shadow_alpha", 0 ); + t.shadow_red = configfile.getInt32( "shadow_red", 8 ); + t.shadow_green = configfile.getInt32( "shadow_green", 8); + t.shadow_blue = configfile.getInt32( "shadow_blue", 8 ); } void CThemes::move_userDir() diff --git a/src/system/locals.h b/src/system/locals.h index f62dff5e9..9aee9e30b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,6 +352,7 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, + LOCALE_COLORMENU_SHADOW_COLOR, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1063,6 +1064,7 @@ typedef enum LOCALE_MENU_HINT_COLORED_EVENTS, LOCALE_MENU_HINT_COLORED_EVENTS_TEXTCOLOR, LOCALE_MENU_HINT_COLORS, + LOCALE_MENU_HINT_COLORS_SHADOW, LOCALE_MENU_HINT_CONTENT_BACK, LOCALE_MENU_HINT_CONTENT_TEXTCOLOR, LOCALE_MENU_HINT_DBOXINFO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ea6d87aac..bdd72cbfd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,6 +352,7 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", + "colormenu.shadow_color", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1063,6 +1064,7 @@ const char * locale_real_names[] = "menu.hint_colored_events", "menu.hint_colored_events_textcolor", "menu.hint_colors", + "menu.hint_colors_shadow", "menu.hint_content_back", "menu.hint_content_textcolor", "menu.hint_dboxinfo", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index f53bce83e..2212b569f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -179,9 +179,9 @@ void CColorSetupNotifier::setPalette() 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); frameBuffer->paletteGenFade(COL_SHADOW, - convertSetupColor2RGB(int(t.infobar_red*0.4), int(t.infobar_green*0.4), int(t.infobar_blue*0.4)), - convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), - 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); + convertSetupColor2RGB(int(t.shadow_red), int(t.shadow_green), int(t.shadow_blue)), + convertSetupColor2RGB(t.shadow_red, t.shadow_green, t.shadow_blue), + 8, convertSetupAlpha2Alpha(t.shadow_alpha) ); frameBuffer->paletteGenFade(COL_INFOBAR_CASYSTEM, convertSetupColor2RGB(t.infobar_casystem_red, t.infobar_casystem_green, t.infobar_casystem_blue), diff --git a/src/system/settings.h b/src/system/settings.h index 9ca4e21d6..e344c2c71 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -153,6 +153,11 @@ struct SNeutrinoTheme int progressbar_timescale_green; int progressbar_timescale_yellow; int progressbar_timescale_invert; + + unsigned char shadow_alpha; + unsigned char shadow_red; + unsigned char shadow_green; + unsigned char shadow_blue; }; struct timer_remotebox_item From 7600126c2f6a0056c131335457f43e20618360bd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 364/394] CBuildInfo: add missing offset defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c89f13cba84abe23b33c1480d505e8bc2a13820 Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 2ffc959c4..bf7349352 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -173,13 +173,13 @@ void CBuildInfo::InitInfoItems() ccw_body->clear(); //define size and position - int x_info = 10; + int x_info = OFFSET_INNER_MID; int h_info = ccw_body->getHeight()/v_info.size(); //default height int w_info = width-2*x_info; //init info texts for(size_t i=0; igetText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); + CComponentsExtTextForm *info = new CComponentsExtTextForm(OFFSET_INNER_MID, CC_APPEND, w_info, h_info, g_Locale->getText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); info->setLabelAndTextFont(font); info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); info->doPaintBg(false); From 7246626692aa5cecbc65575425859843e2242e7f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 365/394] offsets: add SIDEBAR_WIDTH required in window class Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c18e337d1fa81c5ff9505550490c814046efab12 Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 2 +- src/system/settings.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 39aaffbf8..5c05a19ed 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -153,7 +153,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_align_mode = DEFAULT_TITLE_ALIGN; ccw_show_l_sideber = false; ccw_show_r_sideber = false; - ccw_w_sidebar = 40; + ccw_w_sidebar = SIDEBAR_WIDTH; ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; ccw_col_footer = COL_MENUFOOT_PLUS_0; diff --git a/src/system/settings.h b/src/system/settings.h index e344c2c71..534c7a7a3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -948,6 +948,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) +#define SIDEBAR_WIDTH CFrameBuffer::getInstance()->scale2Res(40) + #define BIGFONT_FACTOR 1.5 struct SglobalInfo From d47a04240e280552a94faf7803634e33257bf7fb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 366/394] CBuildinfo: Don't load graphical related objects if not needed. Objects are only required in show mode. HasData() is renamed because of for more plausibility. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9678adc4017771205c59b23b93e1cdf3849ef630 Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 15 +++++++-------- src/gui/buildinfo.h | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index bf7349352..fb9d7a3ac 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,13 +35,13 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 90, CCW_PERCENT 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 85, CCW_PERCENT 85, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) exec(NULL, ""); else - InitInfoItems(); + GetData(); } //init all var members @@ -52,7 +52,6 @@ void CBuildInfo::initVarBuildInfo() font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - shadow = CC_SHADOW_ON; } @@ -64,13 +63,13 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) if (parent) parent->hide(); - InitInfoItems(); - //exit if no informations available - if (!HasData()){ + if (!GetData()){ return res; } + InitInfoItems(); + //paint window if (!is_painted) paint(); @@ -117,7 +116,7 @@ void CBuildInfo::setFontType(Font* font_text) InitInfoItems(); } -bool CBuildInfo::HasData() +bool CBuildInfo::GetData() { v_info.clear(); @@ -166,7 +165,7 @@ bool CBuildInfo::HasData() void CBuildInfo::InitInfoItems() { //get and checkup required informations - if (!HasData()) + if (!GetData()) return; //ensure a clean body diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 154cba8bb..30a1033be 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -52,7 +52,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow void initVarBuildInfo(); void InitInfoItems(); - bool HasData(); + bool GetData(); public: //type_id's for infos From dad04f22027eaf2600549e17e8f1e002c7e82d5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 367/394] CFrameBuffer: fb-generic.cpp - add methode for clean up icon cache This could be required eg. on changed resoulutions or changed iconsets on runtime. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4e66739ff583db0e4be981d14a9052ae77c3a9b7 Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 20 ++++++++++++-------- src/driver/fb_generic.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index af678dc7c..ad9f77d34 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -207,16 +207,9 @@ nolfb: lbb = lfb = NULL; } - CFrameBuffer::~CFrameBuffer() { - std::map::iterator it; - - for(it = icon_cache.begin(); it != icon_cache.end(); ++it) { - /* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */ - cs_free_uncached(it->second.data); - } - icon_cache.clear(); + clearIconCache(); if (background) { delete[] background; @@ -921,6 +914,17 @@ _display: return true; } +void CFrameBuffer::clearIconCache() +{ + std::map::iterator it; + + for(it = icon_cache.begin(); it != icon_cache.end(); ++it) { + /* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */ + cs_free_uncached(it->second.data); + } + icon_cache.clear(); +} + void CFrameBuffer::loadPal(const std::string & filename, const unsigned char offset, const unsigned char endidx) { if (!getActive()) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index b355377ce..4b68e1e18 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -239,6 +239,7 @@ class CFrameBuffer : public sigc::trackable const int h = 0, const unsigned char offset = 1, bool paint = true, bool paintBg = false, const fb_pixel_t colBg = 0); bool paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset = 0); void loadPal (const std::string & filename, const unsigned char offset = 0, const unsigned char endidx = 255); + void clearIconCache(); bool loadPicture2Mem (const std::string & filename, fb_pixel_t * const memp); bool loadPicture2FrameBuffer(const std::string & filename); From 5e3d70752b9e236704547628e51fd2034b2d6d38 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 368/394] COsdSetup: add slot to ensure clean up icon cache on changed resolution. Some old icon data makes no sense with changed resolution. In some cases it could happens that no icons are to see on screen after changed resolution. This should fix this, Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58d4f13bb7beef046f3d94bff8e0c0851affd69f Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index a56e0365a..88b0c8e5e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -668,6 +668,7 @@ int COsdSetup::showOsdSetup() COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && (g_settings.video_Mode != VIDEO_STD_AUTO)); CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); + osd_res->OnAfterChangeOption.connect(sigc::mem_fun(frameBuffer->getInstance(), &CFrameBuffer::clearIconCache)); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); #endif From af5abcccf9bd2143c49ac13cad36c383ca972e7a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 369/394] CComponentsHeader: rework and simplified logo handling This should fix some issues with possible overlapps of logos with title. With some Conditions with text alignment on the right side needs a fix. There is an issue with size and position of text object, but is stll not used at the moment. For all other conditions of logo and text alignments now it should be not a problem (I hope) and have more code clarity. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/356719cf3a771cb2eb667969e7072b97a6501e0b Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 104 ++++++++++++++------------- src/gui/components/cc_frm_header.h | 2 +- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index a74875e72..7a6acec9f 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -273,6 +273,7 @@ void CComponentsHeader::initIcon() void CComponentsHeader::initLogo() { + // init logo with required height and logo int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) @@ -291,70 +292,71 @@ void CComponentsHeader::initLogo() h_logo = dy_orig; } - //cch_logo_obj->setWidth(1, true); + // manage logo position if (cch_logo_obj->hasLogo()){ cch_logo_obj->setHeight(h_logo, true); - // set id of logo item depends of neighbor items + /* Detect next and previous items, + * current item is logo item. + */ int logo_id = getCCItemId(cch_logo_obj); - int prev_id = logo_id - 1; + CComponentsItem *prev_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 2 : logo_id - 1); + CComponentsItem *next_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 1 : logo_id + 1); - //right end - int x_logo_right = width - cch_logo_obj->getWidth(); - if (!(cch_caption_align & CC_TITLE_RIGHT)){ - if (cch_btn_obj) - x_logo_right -= cch_btn_obj->getWidth(); - if (cch_cl_obj) - x_logo_right -= cch_cl_obj->getWidth(); - }else{ - if (cch_icon_obj) - x_logo_right += cch_icon_obj->getWidth(); + /* + * FIXME: Workaround to fix next item in case of wrong order of items. + */ + if (next_item){ + if (next_item->getItemType() == CC_ITEMTYPE_FRM_ICONFORM) + next_item = cch_cl_obj; } - //left end - int x_logo_left = cch_offset; - if (!(cch_caption_align & CC_TITLE_RIGHT)) - x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; - else - if (cch_icon_obj) - x_logo_left += cch_icon_obj->getWidth(); + /* + * Adjust usable space for logo. + */ + int x_logo_left = prev_item ? prev_item->getXPos() + prev_item->getWidth() : cch_offset; + int x_logo_right = next_item ? next_item->getXPos() : width - cch_offset; + int logo_space = x_logo_right - x_logo_left; - //calculate available space - int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left; - - //reduce logo width if logo space too small + /* + * Reduce logo width if logo space too small + * and adjust logo new width if required. + */ int w_logo = min(cch_logo_obj->getWidth(), logo_space); cch_logo_obj->setWidth(w_logo, true); - //set final logo position - int x_logo = 0; - if (cch_logo.Align & CC_LOGO_RIGHT){ - if (cch_caption_align & CC_TITLE_RIGHT){ - if (cch_text_obj) - x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); - }else - x_logo = x_logo_right; - } + /* + * Adjust logo x position depends of align parameters. + */ + int x_logo = x_logo_left; + if (cch_logo.Align & CC_LOGO_RIGHT) + x_logo = x_logo_right - w_logo; + if (cch_logo.Align & CC_LOGO_LEFT) x_logo = x_logo_left; + if (cch_logo.Align & CC_LOGO_CENTER){ - x_logo = width/2 - cch_logo_obj->getWidth()/2; - //fallback if adjacent item and logo are overlapping - if (!(cch_caption_align & CC_TITLE_RIGHT)){ - if (getCCItem(prev_id)){ - int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; - if (x_logo <= x_logo_left) - x_logo = x_tmp; - } - }else{ - if (cch_text_obj){ - if (x_logo + cch_logo_obj->getWidth() >= cch_text_obj->getXPos()){ - x_logo = (x_logo_left + cch_text_obj->getXPos())/2 - cch_logo_obj->getWidth()/2; - } - } + x_logo = logo_space/2 - w_logo/2; + /* + * We are using centered mode as default, + * but we must notice possible overlapp + * 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 (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; } } + /* + * Finally set logo x position + */ cch_logo_obj->setXPos(x_logo); cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2); } @@ -547,7 +549,7 @@ void CComponentsHeader::initCaption() } //calc width of text object in header - cc_text_w = width-cch_text_x-cch_offset; + cc_text_w = width-cch_text_x/*-cch_offset*/; //context buttons int buttons_w = 0; @@ -601,15 +603,15 @@ void CComponentsHeader::initCaption() int w_free = cc_text_w; //recalc caption width - cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)) + cch_offset; //set alignment of text item in dependency from text alignment if (cch_caption_align & CC_TITLE_CENTER) cch_text_x = width/2 - cc_text_w/2; - if (cch_caption_align & CC_TITLE_RIGHT){ + if (cch_caption_align & CC_TITLE_RIGHT){ //FIXME: does not work correct with some conditions, but still not used at the moment cch_text_x += w_free; - cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)); } //assign general properties diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 1d634c3cd..2f96c7baf 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,7 +32,7 @@ #include "cc_frm_clock.h" #include -#define DEFAULT_LOGO_ALIGN CCHeaderTypes::CC_LOGO_CENTER +#define DEFAULT_LOGO_ALIGN CCHeaderTypes::CC_LOGO_RIGHT #define DEFAULT_TITLE_ALIGN CCHeaderTypes::CC_TITLE_LEFT class CCHeaderTypes From 44833782698a8ab5917defcf911db0e3072f4a9d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 370/394] CComponentsHeader: disable permanent clock paint on interval. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e17eadb6ae005a88619dc93028ff5ada16d46ce Author: Thilo Graf Date: 2017-08-02 (Wed, 02 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a6acec9f..2a8d82db8 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -507,6 +507,7 @@ void CComponentsHeader::initClock() if (cch_cl_obj == NULL){ dprintf(DEBUG_DEBUG, "[CComponentsHeader]\n [%s - %d] init clock...\n", __func__, __LINE__); cch_cl_obj = new CComponentsFrmClock(0, cch_items_y, cch_font, cch_cl_format, NULL, false, 1, this); + cch_cl_obj->disableForceSegmentPaint(); cch_cl_obj->doPaintBg(false); } From 864bdc78675aa54ddb424a658bde055190193384 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 26 Jul 2017 21:34:09 +0200 Subject: [PATCH 371/394] audioplayer: fix right offsets for item Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bfedeffb61945a3a13a41057654a663056fceca6 Author: vanhofen Date: 2017-07-26 (Wed, 26 Jul 2017) Origin message was: ------------------ - audioplayer: fix right offsets for item Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 03edd14c6..99b9ccb57 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1591,8 +1591,8 @@ void CAudioPlayerGui::paintItem(int pos) else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + OFFSET_INNER_SMALL; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - w, tmp, color, m_item_height); + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - w, tmp, color, m_item_height); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + m_item_height, w, dura, color, m_item_height); if (currpos == m_selected) { From 47371d2567f768b3b03fdb01106582342bb2887c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 7 Nov 2016 19:52:28 +0100 Subject: [PATCH 372/394] fix epgtitle Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bc5b3edc93350dfb55661add0d87d6caae9d3141 Author: TangoCash Date: 2016-11-07 (Mon, 07 Nov 2016) ------------------ 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 c54dbf792..8d39b1783 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -840,7 +840,8 @@ void CTimerList::RemoteBoxTimerList(CTimerd::TimerList &rtimerlist) rtimer.stopTime = (time_t) atoll(remotetimers[i]["stop"][0].get("digits","").asString().c_str()); rtimer.epgID = (event_id_t) atoi(remotetimers[i].get("epg_id","").asString()); sscanf(remotetimers[i].get("channel_id","").asString().c_str(), SCANF_CHANNEL_ID_TYPE, &rtimer.channel_id); - strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),51); + strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),sizeof(rtimer.epgTitle)); + rtimer.epgTitle[sizeof(rtimer.epgTitle) - 1] = 0; if (remotetimers[i]["audio"].get("apids_conf","").asString() == "true") rtimer.apids = TIMERD_APIDS_CONF; //printf("[remotetimer] r-timer:%s - %s\n", remotetimers[i].get("channel_id","").asString().c_str(), remotetimers[i].get("title","").asString().c_str()); From ec4b897f31f39017d9bddca2017c402226f0e437 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:32:09 +0200 Subject: [PATCH 373/394] CComponentsItem: move real position methods from draw class into item class These methods ar only relavant for items Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dcdff2c03bbc05802620eccb33d3abebd0371cf4 Author: Thilo Graf Date: 2017-08-03 (Thu, 03 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.h | 15 ++------------- src/gui/components/cc_item.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index ab7400ca8..76b047f4c 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -62,9 +62,9 @@ class CCDraw : public COSDFader, public CComponentsSignals ///property: y-position on screen, to alter setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED int y, y_old; ///property: contains real x-position on screen - int cc_xr; + int cc_xr, cc_xr_old; ///property: contains real y-position on screen - int cc_yr; + int cc_yr, cc_yr_old; ///property: height-dimension on screen, to alter with setHeight() or setDimensionsAll() int height, height_old; ///property: width-dimension on screen, to alter with setWidth() or setDimensionsAll() @@ -184,17 +184,6 @@ class CCDraw : public COSDFader, public CComponentsSignals ///to set the real screen position, look at setRealPos() virtual void setPos(const int& xpos, const int& ypos){setXPos(xpos); setYPos(ypos);} - ///sets real x position on screen. Use this, if item is added to a parent form - virtual void setRealXPos(const int& xr){cc_xr = xr;} - ///sets real y position on screen. Use this, if item is added to a parent form - virtual void setRealYPos(const int& yr){cc_yr = yr;} - ///sets real x and y position on screen at once. Use this, if item is added to a parent form - virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;} - ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealXPos(){return cc_xr;} - ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealYPos(){return cc_yr;} - ///set height of component on screen virtual void setHeight(const int& h); ///set width of component on screen diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index d168c3832..d76684020 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -146,6 +146,17 @@ class CComponentsItem : public CComponents ///set x and y position as percent value related to current parent form or screen dimensions at once virtual void setPosP(const uint8_t& xpos_percent, const uint8_t& ypos_percent); + ///sets real x position on screen. Use this, if item is added to a parent form + virtual void setRealXPos(const int& xr){cc_xr = xr;} + ///sets real y position on screen. Use this, if item is added to a parent form + virtual void setRealYPos(const int& yr){cc_yr = yr;} + ///sets real x and y position on screen at once. Use this, if item is added to a parent form + virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;} + ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealXPos(){return cc_parent ? cc_xr : x;} + ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealYPos(){return cc_parent ? cc_yr : y;} + ///do center item on screen or within a parent form, parameter along_mode assigns direction of centering virtual void setCenterPos(int along_mode = CC_ALONG_X | CC_ALONG_Y); From 67ad8c6c51e671c7214214eed659c3b5e64d0070 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:37:14 +0200 Subject: [PATCH 374/394] CCDraw: add missing member for real item position Changes of real positions were not watched. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9687dda8673bb907d7f47eb597bb55ab81d94951 Author: Thilo Graf Date: 2017-08-03 (Thu, 03 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 39ca711d8..0ac6128c0 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -35,8 +35,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { frameBuffer = CFrameBuffer::getInstance(); - x = cc_xr = x_old = 0; - y = cc_yr = y_old = 0; + x = cc_xr = cc_xr_old = x_old = 0; + y = cc_yr = cc_yr_old = y_old = 0; height = height_old = CC_HEIGHT_MIN; width = width_old = CC_WIDTH_MIN; @@ -95,14 +95,16 @@ CCDraw::~CCDraw() inline bool CCDraw::applyPosChanges() { bool ret = false; - if (x != x_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes x %d != x_old %d...\033[0m\n", __func__, __LINE__, x, x_old); + if (x != x_old || cc_xr != cc_xr_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes x %d != x_old %d... [cc_xr = %d cc_xr_old = %d]\033[0m\n", __func__, __LINE__, x, x_old, cc_xr, cc_xr_old); x_old = x; + cc_xr_old = cc_xr; ret = true; } - if (y != y_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes y %d != y_old %d...\033[0m\n", __func__, __LINE__, y, y_old); + if (y != y_old || cc_yr != cc_yr_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes y %d != y_old %d... [cc_yr = %d cc_yr_old = %d]\033[0m\n", __func__, __LINE__, y, y_old, cc_yr, cc_yr_old); y_old = y; + cc_yr_old = cc_yr; ret = true; } From ee5d2d2de9f7ee4bb321999cac1f9fd8b3477a69 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:34:37 +0200 Subject: [PATCH 375/394] CComponentsItem: fix possible issues with position inside forms This ensures relative position for items inside form Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a19a1f067e5a101c18b62db6fc56eeb132ea32ee Author: Thilo Graf Date: 2017-08-03 (Thu, 03 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 54c335c9a..be2e6678a 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -265,14 +265,14 @@ void CComponentsItem::setXPos(const int& xpos) { CCDraw::setXPos(xpos); if (cc_parent) - cc_xr = cc_parent->getXPos() + x; + cc_xr = cc_parent->getRealXPos() + x; } void CComponentsItem::setYPos(const int& ypos) { CCDraw::setYPos(ypos); if (cc_parent) - cc_yr = cc_parent->getYPos() + y; + cc_yr = cc_parent->getRealYPos() + y; } void CComponentsItem::setXPosP(const uint8_t& xpos_percent) From 5bb95f5c79deaf096df9a87cbadd03f4adc2df4b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Aug 2017 15:30:21 +0200 Subject: [PATCH 376/394] CComponentsForm: add methods to get previous and next item Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a4af92d219ace2edc1eb64457a04a698d2ed18bc Author: Thilo Graf Date: 2017-08-04 (Fri, 04 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 10 ++++++++++ src/gui/components/cc_frm.h | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 33dd15c94..2725183d7 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -257,6 +257,16 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) return NULL; } +CComponentsItem* CComponentsForm::getPrevCCItem(CComponentsItem* current_cc_item) +{ + return getCCItem(getCCItemId(current_cc_item) - 1); +} + +CComponentsItem* CComponentsForm::getNextCCItem(CComponentsItem* current_cc_item) +{ + return getCCItem(getCCItemId(current_cc_item) + 1); +} + void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item) { if (!v_cc_items.empty()){ diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 0b7b74401..cb512856c 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -106,8 +106,39 @@ class CComponentsForm : public CComponentsItem virtual void replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item); virtual void exchangeCCItem(const uint& item_id_a, const uint& item_id_b); virtual void exchangeCCItem(CComponentsItem* item_a, CComponentsItem* item_b); - virtual int getCCItemId(CComponentsItem* cc_Item); - virtual CComponentsItem* getCCItem(const uint& cc_item_id); + + /**Function to get current item id from passed item. + * @param[in] cc_Item + * @li CComponentsItem* + * @return + * int, in case of not found item returns -1 + */ + int getCCItemId(CComponentsItem* cc_Item); + + /**Function to get current item from item collection. + * @param[in] cc_item_id + * @li item id as unsigned int + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getCCItem(const uint& cc_item_id); + + /**Function to get previous item from item collection. + * @param[in] current_cc_item + * @li CComponentsItem* + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getPrevCCItem(CComponentsItem* current_cc_item); + + /**Function to get next item from item collection. + * @param[in] current_cc_item + * @li CComponentsItem* + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getNextCCItem(CComponentsItem* current_cc_item); + virtual void paintCCItems(); ///clean up and deallocate existant items from v_cc_items at once From 184538db45085e59d659ffda3afd01e8e350f8cf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Aug 2017 19:08:50 +0200 Subject: [PATCH 377/394] CComponentsForm: add functions to get used or free space of form dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67a71d5e4e795fd7243c22b9eb98cb7da79d0cfd Author: Thilo Graf Date: 2017-08-04 (Fri, 04 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 18 ++++++++++++++++++ src/gui/components/cc_frm.h | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 2725183d7..defe1433c 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -695,3 +695,21 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix } return false; } + +int CComponentsForm::getUsedDY() +{ + int y_res = 0; + for (size_t i= 0; i< v_cc_items.size(); i++) + y_res = max(v_cc_items[i]->getYPos() + v_cc_items[i]->getHeight(), y_res); + + return y_res; +} + +int CComponentsForm::getUsedDX() +{ + int x_res = 0; + for (size_t i= 0; i< v_cc_items.size(); i++) + x_res = max(v_cc_items[i]->getXPos() + v_cc_items[i]->getWidth(), x_res); + + return x_res; +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index cb512856c..ca8daa31f 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -183,6 +183,31 @@ class CComponentsForm : public CComponentsItem virtual void setScrollBarWidth(const int& scrollbar_width){w_sb = scrollbar_width;}; ///returns id of selected item, return value as int, returns -1: if is nothing selected virtual int getSelectedItem(); + + /**Function to get consumed space of items inside form in y direction. + * @return + * int, used lines + */ + int getUsedDY(); + + /**Function to get consumed space of items inside form in x direction. + * @return + * int, used lines + */ + int getUsedDX(); + + /**Function to get free usable space of items inside form in y direction. + * @return + * int, free lines + */ + int getFreeDY(){return height - getUsedDY();} + + /**Function to get free usable space of items inside form in x direction. + * @return + * int, free lines + */ + int getFreeDX(){return width - getUsedDX();} + ///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected virtual CComponentsItem* getSelectedItemObject(); ///select a definied item, parameter1 as size_t From 71d32096c7348d2b6605ef97aca0ef1fe56331b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 1 Aug 2017 14:44:21 +0200 Subject: [PATCH 378/394] menu: fix icon for CGenericMenuNext forwarder Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c4fe6df2f03b97d45b819c3117e0ef49c908753 Author: vanhofen Date: 2017-08-01 (Tue, 01 Aug 2017) Origin message was: ------------------ - menu: fix icon for CGenericMenuNext forwarder Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index f944ccfb9..d246b1936 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -51,7 +51,7 @@ CMenuSeparator CGenericMenuSeparator(0, NONEXISTANT_LOCALE, true); CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE, NONEXISTANT_LOCALE, true); CMenuForwarder CGenericMenuBack(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT, NULL, true); CMenuForwarder CGenericMenuCancel(LOCALE_MENU_CANCEL, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true); -CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true); +CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_RIGHT, NULL, true); CMenuSeparator * const GenericMenuSeparator = &CGenericMenuSeparator; CMenuSeparator * const GenericMenuSeparatorLine = &CGenericMenuSeparatorLine; CMenuForwarder * const GenericMenuBack = &CGenericMenuBack; From c647e359eca08896201c0163cc636b4807ecc433 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 7 Aug 2017 16:58:55 +0200 Subject: [PATCH 379/394] english.locale: corrections in channellist locales Consideration of rules for capitalization of headings, titles and labels. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/57e410c052f7f03e200e50028a55b97f24427e6d Author: Thilo Graf Date: 2017-08-07 (Mon, 07 Aug 2017) ------------------ This commit was generated by Migit --- data/locale/english.locale | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 7ff88c04a..474aeeed7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -233,52 +233,52 @@ buildinfo.creator Creator buildinfo.kernel Kernel version buildinfo.menu Build information cablesetup.provider cable provider -channellist.additional Additional informations -channellist.additional_off off -channellist.additional_on on -channellist.additional_on_minitv on (with MiniTV) -channellist.current_tp Current transponder +channellist.additional Additional Informations +channellist.additional_off Off +channellist.additional_on On +channellist.additional_on_minitv On (with MiniTV) +channellist.current_tp Current Transponder channellist.edit Edit -channellist.epgtext_align_left left -channellist.epgtext_align_right right -channellist.extended Show event progress +channellist.epgtext_align_left Left +channellist.epgtext_align_right Right +channellist.extended Show Event Progress channellist.extended_colored with colored progressbar channellist.extended_simple with simple progressbar -channellist.favs Favoriten +channellist.favs Favorites channellist.foot Channel Information channellist.foot_freq Sat/Freq Info -channellist.foot_next next Event -channellist.foot_off off -channellist.foot_sort_alpha sorted[alpha] -channellist.foot_sort_chnum sorted[number] -channellist.foot_sort_freq sorted[freq] -channellist.foot_sort_sat sorted[sat] +channellist.foot_next Next Event +channellist.foot_off Off +channellist.foot_sort_alpha Sorted[Alpha] +channellist.foot_sort_chnum Sorted[Number] +channellist.foot_sort_freq Sorted[Freq] +channellist.foot_sort_sat Sorted[Sat] channellist.head All Services channellist.history History -channellist.history_clear Clear history -channellist.keep_numbers Persistent channel numbers +channellist.history_clear Clear History +channellist.keep_numbers Persistent Channel Numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.make_webtvlist Create list of WebTV channels -channellist.new_zap_mode Quickzap in list -channellist.new_zap_mode_active active -channellist.new_zap_mode_allow allow -channellist.new_zap_mode_off off +channellist.new_zap_mode Quickzap in List +channellist.new_zap_mode_active Active +channellist.new_zap_mode_allow Allow +channellist.new_zap_mode_off Off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) -channellist.numeric_adjust Numeric zap adjust +channellist.numeric_adjust Numeric Zap Adjust channellist.provs Providers channellist.recording_not_possible Recording not possible! channellist.remember Last used channellist.reset_all Reset 'new' flag for all channels channellist.reset_flags Reset 'new' channel flag channellist.sats Satellites -channellist.show_channellogo Show channel logos -channellist.show_channelnumber Show channel numbers -channellist.show_empty_favs Show empty favorites bouquets -channellist.show_infobox Show bottom infobox -channellist.since since -channellist.start starts +channellist.show_channellogo Show Channel Logos +channellist.show_channelnumber Show Channel Numbers +channellist.show_empty_favs Show empty Favorites Bouquets +channellist.show_infobox Show Bottom Infobox +channellist.since Since +channellist.start Starts ci.clock CI clock (Mhz) ci.empty No CAM in slot ci.ignore_msg Ignore CA messages From fb51e7dde644e17d68664948e1ec130cab5bbbd8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Aug 2017 19:11:27 +0200 Subject: [PATCH 380/394] CComponentsScrollBar: fix possible too small type size Possible segment count could be more than 265. Was a remnant from scrollbar test phase. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/379d1ffa7667e0003a80bebf16e23f461d43f200 Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 2e59a630f..769733cf1 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -178,7 +178,7 @@ void CComponentsScrollBar::initSegments() fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(u_int8_t i=0; i Date: Wed, 9 Aug 2017 20:28:08 +0200 Subject: [PATCH 381/394] CComponentsScrollBar: fix possible build error with -Werror=sign-compare Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/431cfadcc237c909ce663403da4bdb45168303ca Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 8bd1c0568..75746371f 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -49,7 +49,7 @@ class CComponentsScrollBar : public CComponentsFrmChain fb_pixel_t sb_segment_col, sb_segment_col_sel; ///count of segments - int sb_segments_count; + u_int32_t sb_segments_count; ///mark id int sb_mark_id; From ee80c4475f0f8718f4a54a29556cf8d1759f0d0a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Aug 2017 21:34:20 +0200 Subject: [PATCH 382/394] CComponentsScrollBar: use matching type names Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b863f874b0cde8eb24bffc4bc8826e3c72d2f7d6 Author: Thilo Graf Date: 2017-08-09 (Wed, 09 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- src/gui/components/cc_frm_scrollbar.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 769733cf1..44c820311 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -178,7 +178,7 @@ void CComponentsScrollBar::initSegments() fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(u_int32_t i=0; i Date: Fri, 11 Aug 2017 19:29:10 +0200 Subject: [PATCH 383/394] infoviewer.cpp: handle timeout of mode upnp like mode ts Signed-off-by: Thilo Graf Infobar timeout in the upnp mode is fixed to 6 sec. Because it's acting about streams, so we should use the same timeout such as with playing a movie file. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0225b043db882011b6ce258bb3da648d32a45f4d Author: GetAway Date: 2017-08-11 (Fri, 11 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 693f543c4..1629d4451 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -932,6 +932,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] + timeout_ext); break; case NeutrinoMessages::mode_ts: + case NeutrinoMessages::mode_upnp: timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] + timeout_ext); break; default: From 135555143afc0dfff62c69247a606f60c23be004 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 11 Aug 2017 18:36:15 +0200 Subject: [PATCH 384/394] CComponentsScrollBar: try to fix handling with very much segment count In some cases, eg. with very much pages in channellist, the effort to handle with all count of scrollbar segments was too much. Result: long waiting times during page scrolling and slider was not visible. This should be fixed now. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71f5779a40ce9ee9165bb31094344b1b19bf279e Author: Thilo Graf Date: 2017-08-11 (Fri, 11 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 41 +++++++++++++++---------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 44c820311..13006e722 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -147,14 +147,10 @@ void CComponentsScrollBar::initBottomNaviIcon() void CComponentsScrollBar::initSegments() { //init dimensions for segments - int w_seg = width - 2*fr_thickness - 2*append_x_offset; - if (w_seg < 0) - w_seg = 0; + int w_seg = max(0, width - 2*fr_thickness - 2*append_x_offset); //calculate height of segment container - int h_seg_obj = height - 2*fr_thickness - 2*sb_up_obj->getHeight() - 2*append_y_offset; - if (h_seg_obj < 0) - h_seg_obj = 0; + int h_seg_obj = max(0, height - 2*fr_thickness - 2*sb_up_obj->getHeight() - 2*append_y_offset); //init segment container if (sb_segments_obj == NULL){ @@ -169,30 +165,41 @@ void CComponentsScrollBar::initSegments() //clean up segment container before add new segments sb_segments_obj->clear(); + //hold segment count in this scope + uint32_t tmp_segments = sb_segments_count; + //set y position of 1st segment and set height of segments int y_seg = append_y_offset; - int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; - if (h_seg < 0) - h_seg = 0; + int h_seg = max(0, int(sb_segments_obj->getHeight()/tmp_segments - append_y_offset)); + + //reduce required segment count and create a moderate segment height for better visibility of slider if we have very much segments. + uint32_t tmp_quot = 1; + if (h_seg == 0){ + h_seg = w_seg - append_y_offset; + tmp_segments = max(1, sb_segments_obj->getHeight() / (h_seg+append_y_offset)); + tmp_quot = uint32_t((float)sb_segments_count/(float)tmp_segments + 0.5); + } fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body; //create and add segments to segment container - for(uint32_t i=0; igetCCItemId(item); //set color for marked id - if (sb_mark_id == id){ + if ((tmp_segments == sb_segments_count && sb_mark_id == id) || (tmp_segments != sb_segments_count && int(sb_mark_id/tmp_quot) == id)) + { item->setColorBody(sb_segment_col_sel); #if 0 item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B); item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal); #endif } - else{ + else + { item->setColorBody(passive_col); #if 0 item->disableColBodyGradient(); @@ -203,19 +210,19 @@ void CComponentsScrollBar::initSegments() if (passive_col == col_body){ item->setCorner(RADIUS_MIN, CORNER_ALL); continue; - }else if (sb_segments_count == 1){ + }else if (tmp_segments == 1){ item->setCorner(RADIUS_MIN, CORNER_ALL); break; }else if(i == 0){ item->setCorner(RADIUS_MIN, CORNER_TOP); continue; - }else if(i == sb_segments_count - 1){ + }else if(i == tmp_segments - 1){ item->setCorner(RADIUS_MIN, CORNER_BOTTOM); break; - }else if((i > 0 && i < sb_segments_count - 1)){ - item->setCorner(RADIUS_MIN, CORNER_NONE); + }else if((i > 0 && i < tmp_segments - 1)){ + item->setCorner(RADIUS_NONE, CORNER_NONE); }else{ - item->setCorner(RADIUS_MIN, CORNER_NONE); + item->setCorner(RADIUS_NONE, CORNER_NONE); } } } From cc78c406783cf775fe9f357580fc192f6ae1d411 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 12 Aug 2017 11:27:55 +0200 Subject: [PATCH 385/394] Revert "infoviewer.cpp: handle timeout of mode upnp like mode ts" This reverts commit 6f7b583b594e3775db89b8cdf21641f328ca242d. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40fee475236ceb16be3ba055eccab4aee85b902d Author: Thilo Graf Date: 2017-08-12 (Sat, 12 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 1629d4451..693f543c4 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -932,7 +932,6 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] + timeout_ext); break; case NeutrinoMessages::mode_ts: - case NeutrinoMessages::mode_upnp: timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] + timeout_ext); break; default: From e8711e0475acedc11084e768017bbcdc2391b07d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:47:33 +0200 Subject: [PATCH 386/394] Revert "neutrino: disable some menus in upnp & ts mode" This reverts commit aaee0baf0778c70c2e0d340439aab53afdb7c451. Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/944ad7cb63bfdb8d3d4424a06d8e61596a184a3e Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) ------------------ This commit was generated by Migit --- src/gui/user_menue.cpp | 13 ++++++------- src/gui/widget/menue.cpp | 8 +------- src/gui/widget/menue.h | 3 --- src/neutrino_menue.cpp | 18 +++--------------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 657956f86..a7d77530d 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -184,7 +184,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu->addItem(GenericMenuSeparator); bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; - bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp; bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); @@ -250,7 +249,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIO_SELECT: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon); + menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -286,7 +285,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (g_settings.recording_type == RECORDING_OFF) break; keyhelper.get(&key,&icon,CRCInput::RC_green); - menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); break; } @@ -408,14 +407,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_YOUTUBE: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); break; } case SNeutrinoSettings::ITEM_FILEPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY); break; } @@ -443,14 +442,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIOPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); break; } case SNeutrinoSettings::ITEM_INETPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); break; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d246b1936..6fe122746 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -131,13 +131,7 @@ bool CMenuItem::initModeCondition(const int& stb_mode) void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition) { int stb_mode = CNeutrinoApp::getInstance()->getMode(); -#if ENABLE_UPNP - if (condition & DCOND_MODE_UPNP){ - if (stb_mode == CNeutrinoApp::mode_upnp) - if (initModeCondition(stb_mode)) - return; - } -#endif + if (condition & DCOND_MODE_TS){ if (stb_mode == CNeutrinoApp::mode_ts) if (initModeCondition(stb_mode)) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 4aa5797ca..3b47f51de 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -78,9 +78,6 @@ enum DCOND_MODE_TV = 2, DCOND_MODE_RADIO = 4, DCOND_MODE_TS = 8 -#if ENABLE_UPNP - ,DCOND_MODE_UPNP = 16 -#endif }/*menu_item_disable_cond_t*/; class CChangeObserver diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 3b281fcae..fc673329b 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -164,29 +164,17 @@ void CNeutrinoApp::InitMenuMain() //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); - personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed -#if ENABLE_UPNP - | DCOND_MODE_UPNP -#endif - ); + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed } //timer From 66e825b39d48b9c44a4c671d0e875e545ec5b20d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Aug 2017 12:48:17 +0200 Subject: [PATCH 387/394] upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6659dbb6f3152abcc9858088266bb7e67bff29da Author: vanhofen Date: 2017-08-12 (Sat, 12 Aug 2017) Origin message was: ------------------ - upnpbrowser: fix mode_ts for videos; was switched back to mode_upnp by stopAudio() Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 55c4ce3bc..1f4c67b17 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1311,10 +1311,10 @@ void CUpnpBrowserGui::showPicture(std::string name) void CUpnpBrowserGui::playVideo(std::string name, std::string url) { - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); - stopAudio(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); From 254893c8896825884840d9373dfc6fbb64dcdc14 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 12:53:05 +0200 Subject: [PATCH 388/394] 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/8c8ae9595c331f5c2540289d6b552c81b9a93072 Author: Jacek Jendrzej Date: 2017-08-21 (Mon, 21 Aug 2017) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 519ebdfda..99c17645d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -456,22 +456,14 @@ 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); g_settings.shutdown_min = 0; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2158,6 +2150,8 @@ TIMER_START(); cs_new_auto_videosystem(); #endif + g_info.hw_caps = get_hwcaps(); + g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2245,9 +2239,6 @@ TIMER_START(); CheckFastScan(); - // init hw_caps *after* zapit start! - g_info.hw_caps = get_hwcaps(); - //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From cb1974101413658a2f468882c1dd3438d5159f0b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Aug 2017 10:56:45 +0200 Subject: [PATCH 389/394] hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c307ed5b36178f97f75060147c3c16183f6ee816 Author: vanhofen Date: 2017-08-14 (Mon, 14 Aug 2017) Origin message was: ------------------ - hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start ------------------ This commit was generated by Migit --- lib/hardware/coolstream/Makefile.am | 7 ------- lib/hardware/coolstream/hardware_caps.cpp | 13 ++----------- src/neutrino.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 18 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..0922eb655 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); // see dirty part of hw_caps in neutrino.cpp caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -44,14 +42,7 @@ hw_caps_t *get_hwcaps(void) { 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.boxname, "Neo"); // see dirty part of hw_caps in neutrino.cpp strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 99c17645d..080a31d07 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2239,6 +2239,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 timer_wakeup = false;//init wake_up( timer_wakeup ); From c592fe60d6ba4d1912748cf81b3e23f088a6f59f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 14:42:24 +0200 Subject: [PATCH 390/394] some inits warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c99486520e02c9ce45442c180fd150aafdee3eca 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 --- src/driver/radiotext.cpp | 2 +- src/gui/infoviewer.cpp | 3 ++- src/gui/movieplayer.cpp | 2 +- src/gui/streaminfo2.cpp | 2 +- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 8 ++++---- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 28f1c8186..b74aa9ef0 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; + char *filepath = asprintf(&filepath, "%s/Rass_%d.error", DataDir, slidenumr); (filetype == 2) ? asprintf(&filepath, "%s/Rass_%d.def", DataDir, slidenumr) : asprintf(&filepath, "%s/Rass_%d.mpg", DataDir, slidenumr); if ((fd = fopen(filepath, "wb")) != NULL) { diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 693f543c4..68b29cadc 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -951,7 +951,7 @@ bool CInfoViewer::showLivestreamInfo() CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1); if (!(videoDecoder->getBlank())) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string tmp2; videoDecoder->getPictureInfo(xres, yres, framerate); switch (framerate) { @@ -980,6 +980,7 @@ bool CInfoViewer::showLivestreamInfo() tmp2 = "60fps"; break; default: + framerate = 0; tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN); break; } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b087fee10..786a340cd 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2298,7 +2298,7 @@ void CMoviePlayerGui::selectChapter() playback->GetChapters(positions, titles); std::vector playlists; std::vector ptitles; - int current; + int current = 0; playback->GetTitles(playlists, ptitles, current); if (positions.empty() && playlists.empty()) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index b799c4c3f..f4ddae10b 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -649,7 +649,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; /* audioDecoder->getAudioInfo() seems broken in libcoolstream2. ddmode is always 1 ("CH1/CH2"). diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index e067a7f4a..ba9c40ad3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -466,7 +466,7 @@ int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoResolutionAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; videoDecoder->getPictureInfo(xres, yres, framerate); std::stringstream out; out << xres << "x" << yres; @@ -476,7 +476,7 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoFramerateAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string sframerate = "{=L:unknown=}"; videoDecoder->getPictureInfo(xres, yres, framerate); switch(framerate){ @@ -491,7 +491,7 @@ std::string CNeutrinoAPI::getVideoFramerateAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getAudioInfoAsString(void) { - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); std::stringstream out; if(type == 0) @@ -557,7 +557,7 @@ void CNeutrinoAPI::SendAllTimers(std::string url, bool force) Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); - int pre,post; + int pre = 0,post = 0; Timerd->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; From d7856dc0ce3dc4355422b59411a80822b754f21e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 12:58:26 +0200 Subject: [PATCH 391/394] some inits and never read var Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba600f0e5ce176a88d369a8bec16edf048242753 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libmd5sum/md5.c | 2 +- lib/libtuxtxt/tuxtxt_common.h | 3 ++- src/gui/eventlist.cpp | 3 +-- src/gui/infoviewer.cpp | 1 - src/gui/movieplayer.cpp | 2 -- src/gui/opkg_manager.cpp | 1 + src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 4 ++++ src/zapit/src/frontend.cpp | 1 + 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libmd5sum/md5.c b/lib/libmd5sum/md5.c index e433782e8..aece50d10 100644 --- a/lib/libmd5sum/md5.c +++ b/lib/libmd5sum/md5.c @@ -132,7 +132,7 @@ md5_stream (stream, resblock) /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; + char buffer[BLOCKSIZE + 72] = {0}; size_t sum; /* Initialize the computation context. */ diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 52f9d419e..c6e6c7bd8 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -704,8 +704,9 @@ void *tuxtxt_CacheThread(void * /*arg*/) tuxtxt_cache.current_subpage[magazine] = -1; continue; } - +#if 0 /* ? */ b1 &= 3; +#endif b3 &= 7; if (tuxtxt_is_dec(tuxtxt_cache.page_receiving)) /* ignore other subpage bits for hex pages */ diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 76c7d5cdf..7f17c199d 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -265,7 +265,6 @@ void CEventList::readEvents(const t_channel_id channel_id) void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) { t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp = channel_id; const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); if(channel_nr < 2){ channel_id = 0; @@ -274,7 +273,7 @@ void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_ unsigned int tmp_channel = 0; for(unsigned int channel = 0; channel < channel_nr; channel++) { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + t_channel_id channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); if(channel_id_tmp == channel_id){ if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { channel = (channel+1) %channel_nr; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 68b29cadc..323084f09 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1073,7 +1073,6 @@ void CInfoViewer::loop(bool show_dot) //printf("%s:%d: imitate VZAP; RC_left/right\n", __func__, __LINE__); CMoviePlayerGui::getInstance().setFromInfoviewer(true); g_RCInput->postMsg (msg, data); - hideIt = true; } else setSwitchMode(IV_MODE_VIRTUAL_ZAP); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 786a340cd..a18773a4b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1472,7 +1472,6 @@ void CMoviePlayerGui::PlayFileLoop(void) disableOsdElements(MUTE); CFileBrowser *playlist = new CFileBrowser(); CFile *pfile = NULL; - pfile = &(*filelist_it); int selected = std::distance( filelist.begin(), filelist_it ); filelist_it = filelist.end(); if (playlist->playlist_manager(filelist, selected)) @@ -2451,7 +2450,6 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) else { memset(buf + (len - olen), 0, olen); text = buf; - ret = true; } free(buf); diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 5276bbc76..be5029a3b 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -671,6 +671,7 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc) return pkgDesc; fpos_t fz; + fz.__pos = 0; fseek(fd, 0, SEEK_END); fgetpos(fd, &fz); fseek(fd, 0, SEEK_SET); diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 04dd13a4f..50f14c4b9 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -1023,6 +1023,10 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin unsigned timerId=0; std::string cmd, stimerid; CTimerd::responseGetTimer timer; // Timer + timer.alarmTime = 0; + timer.stopTime = 0; + timer.apids = 0; + timer.eventType = CTimerd::__TIMER_NEXTPROGRAM;//nothing time_t now_t = time(NULL); ySplitString(para, " ", cmd, stimerid); if(cmd != "new") diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 215a58ea2..26482d2b1 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -603,6 +603,7 @@ uint32_t CFrontend::getRate() const fe_status_t CFrontend::getStatus(void) const { struct dvb_frontend_event event; + event.status = FE_REINIT; fop(ioctl, FE_READ_STATUS, &event.status); return (fe_status_t) (event.status & FE_HAS_LOCK); } From 7b57171e467fda7594cbed15dbf935c698e1d74f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:00:24 +0200 Subject: [PATCH 392/394] fxi possible buffer overflow Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e58e72635b5b04c82ef39fea1b30931e634dc6d3 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 9c5a7995e..6ee70f32a 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -205,7 +205,7 @@ int paintButtons( const button_label_ext * const content, fprintf(stderr, "PB: sp %d mw %d w_t %d w_i %d w_s %d c_i %d\n", spacing, maxwidth, w_text, w_icons, w_space, count_items); #endif - if (fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ + if (cnt > 0 && fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ count_labels++; /* side effect: we don't try to divide by 0 :-) */ if (maximize) { From d4247c00363cf5c0f21d3b29a441dcb951fa5e4a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:03:34 +0200 Subject: [PATCH 393/394] null pointer check Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/527c0de33a36617ef810109df26e487b68751133 Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/helpbox.cpp | 14 ++++++++------ src/gui/widget/listframe.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index fc8989efc..d4fd87b76 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -99,16 +99,18 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in if (!text.empty()){ int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0); CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, 0, text, text_mode, font); - txt->doPaintBg(false); - txt->forceTextPaint(); + if(txt){ + txt->doPaintBg(false); + txt->forceTextPaint(); #if 0 //"contrast agent", if you want to see where the text items are drawn. txt->setColorBody(COL_RED); #endif - int lines = txt->getCTextBoxObject()->getLines(); - txt_height = std::max(lines*font->getHeight(), h_line); - txt->setHeight(txt_height); + int lines = txt->getCTextBoxObject()->getLines(); + txt_height = std::max(lines*font->getHeight(), h_line); + txt->setHeight(txt_height); - line->addCCItem(txt); + line->addCCItem(txt); + } } if (txt_height > line->getHeight()) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 2ed9085ec..de9a1bf1b 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -58,10 +58,10 @@ #include #include -#define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) -#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) +#define MAX_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() - 40:0) +#define MAX_WINDOW_HEIGHT (frameBuffer ? frameBuffer->getScreenHeight() - 40:0) -#define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1) +#define MIN_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() >> 1:0) #define MIN_WINDOW_HEIGHT 40 #define TITLE_BACKGROUND_COLOR COL_MENUHEAD_PLUS_0 @@ -206,7 +206,7 @@ void CListFrame::reSizeMainFrameWidth(int textWidth) int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*OFFSET_INNER_MID; - if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; + if(iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if((unsigned int) iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; m_cFrame.iWidth = iNewWindowWidth; From 6b015862c1ee6d137d1ab875f4f3d1b44d3e047a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 23 Aug 2017 13:05:57 +0200 Subject: [PATCH 394/394] fix possible out of bound memory access Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/350a73ce08dee05dfc80e5f35bffb38bbeec877f Author: Jacek Jendrzej Date: 2017-08-23 (Wed, 23 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/stringinput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index f325cedb1..a0c789a86 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -278,12 +278,17 @@ void CStringInput::keyDownPressed() { int npos = 0; std::string tmp_value = *valueString; - for(int count=0;count<(int)strlen(validchars);count++) + const int validchar_len = (int)strlen(validchars); + for(int count=0;countat(selected)==validchars[count]) npos = count; npos--; - if(npos<0) - npos = strlen(validchars)-1; + if(npos<0){ + if(validchar_len > 0) + npos = validchar_len-1; + else + npos = 0; + } valueString->at(selected)=validchars[npos]; int current_value = atoi(*valueString);