From 9497a3c43a910583f8e7c3464897206cd3624cd1 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Feb 2017 12:49:24 +0100 Subject: [PATCH 01/98] configure: Add macro ENABLE_CHANGE_OSD_RESOLUTION - macro is default for hd2 - macro can activated for other hardware by configure option --enable-reschange --- 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 33125aed06d2175f197efa95645dba4f9bd962f2 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Feb 2017 12:49:27 +0100 Subject: [PATCH 02/98] CFbAccelCSHD2::setMode: Update for new framebuffer driver (full hd) --- 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 88c834221bddf5400b65017d946e7d2beb798fbf Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Feb 2017 12:49:30 +0100 Subject: [PATCH 03/98] CFbAccelCSHD2: Add scaleFont()function for font upscaling when fullhd is aktiv --- 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 13a7358e6489f06892689fe503f2008af47837d6 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Feb 2017 12:49:34 +0100 Subject: [PATCH 04/98] neutrino: Upscaling fonts, infoclock and volumebar for full hd --- 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 7b158903f8fd08e3c6636c22ab00eae1c2262793 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Feb 2017 12:49:37 +0100 Subject: [PATCH 05/98] 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) --- 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 9792b47666f5a45973693e384e0b0c0cd7526b14 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 13 Feb 2017 21:21:11 +0100 Subject: [PATCH 06/98] - migrate users settings; screen_StartX_crt/lcd -> screen_StartX_crt/lcd_0 --- 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 6964b62c6f17b39b7a9b2269b1840a0940e1f407 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 13 Feb 2017 21:34:01 +0100 Subject: [PATCH 07/98] - fix keywords in strange try-to-detect-bad-config-file if-statement --- 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 145c0d41b45e4f32a28e2039f2d04000e4e5feb0 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 13 Feb 2017 22:50:48 +0100 Subject: [PATCH 08/98] - set new osd-presets closer to old values; auto-calc screenEnd-values --- 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 56446c358fce085b74581cbf62bb99b7937f55ac Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 14 Feb 2017 12:36:29 +0100 Subject: [PATCH 09/98] screenshot: Workaround for broken osd screenshot with new fb driver... ...and 1280x720 resolution. --- 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 56b99e0b472b46523bf8b05e7cb66ec4509b7b57 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 15 Feb 2017 08:48:38 +0100 Subject: [PATCH 10/98] - disable strange try-to-detect-bad-config-file if-statement --- 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 d457cc8ef51c5a1157164f0b92f37def614311ff Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 15 Feb 2017 08:48:38 +0100 Subject: [PATCH 11/98] - neutrino: small code cosmetics in loadSetup() --- 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 979bac14f0cf7b4ed4783215422a112a832aac8a Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 15 Feb 2017 20:23:31 +0100 Subject: [PATCH 12/98] tuxtxt: Fix display in 1280x720 mode --- 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 e631c3e3c0853c9e9978395ffe6ef2700fe47595 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 13/98] - framebuffer: rename scaleFont() to scale2Res() --- 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 726302f945439c5afd20bfe3b07e41661eb4cdf6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 14/98] - settings.h: scale RADIUS- and OFFSET-defines --- 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 43dbfed1ba1d645723cdc65ee2b97f8430316287 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 19 Feb 2017 23:31:46 +0100 Subject: [PATCH 15/98] - move ENABLE_CHANGE_OSD_RESOLUTION to scale2Res() function --- 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 5049b69c3fdfec18e4eea04d3b441bfca9063c56 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:23:00 +0100 Subject: [PATCH 16/98] CProgressWindow: add overloaded constructor with string arg --- 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 b250ae6b9d906dcc711cb1df2c3ba6be5e4d6932 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:35:20 +0100 Subject: [PATCH 17/98] CTestMenu: ad samples for progress window --- 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 7339d3dd03179358e79c50c06edcd38105de51f6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 16 Feb 2017 10:57:08 +0100 Subject: [PATCH 18/98] CProgressWindow: encapsulate show methodes, add dimension defines --- 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 9d3e5f4fd2b6beb5b29c8773dc8ea657fd02cf59 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:11:34 +0100 Subject: [PATCH 19/98] CProgressWindow: move some methodes for more clarity --- 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 0281b7e8c7243346c1aac3ddb0345a53de104cee Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:13:12 +0100 Subject: [PATCH 20/98] CProgressWindow: rename InitProgressItem -> getProgressItem more plausible --- 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 1e6997e3af83be3bcb1a8d1769a0db3783884d51 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:19:32 +0100 Subject: [PATCH 21/98] CProgressWindow: small cosmetic --- 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 42619c8d2cd82ef0b8fdbf110102487e012fedd1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:40:48 +0100 Subject: [PATCH 22/98] CTestMenu: add samples for progress window with signals --- 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 f478c75e26668d830bb28a4028198bb6c0c1644d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:25:20 +0100 Subject: [PATCH 23/98] 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. --- 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 6e487f28400648b3f08529137a326759d1a3834e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:41:35 +0100 Subject: [PATCH 24/98] CMovieBrowser: visualize global loading of defined directories --- 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 055fef8b58f1959a6243be60b2767cc2a0c4deb5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 13:25:50 +0100 Subject: [PATCH 25/98] 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 --- 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 9b6893ee3454e4fb679bc7795838551b67773e18 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:53:16 +0100 Subject: [PATCH 26/98] CComponentsWindow: add more tags for doxygen --- 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 11d8be5307342bdce81dd4ea6c868171566da716 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:58:16 +0100 Subject: [PATCH 27/98] CMovieBrowser: use percental calculated dimensions for progress window Useful for possible for different screen resolutions. --- 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 ed9edb5dada875be176ce53ea09804f692972aea Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 22:09:28 +0100 Subject: [PATCH 28/98] CProgressWindow: use percental calculated dimensions as default --- 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 85fc37090e633f6efbbf137928208c77842786e8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 23:13:30 +0100 Subject: [PATCH 29/98] hintbox.h: use calculated dimensions as default Useful for possible different screen resolutions. --- 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 04ba522dab3883148a0940a0e21c55b0f48db66e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:57:22 +0100 Subject: [PATCH 30/98] CBuildInfo: use percental calculated dimensions --- 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 6b4e57ad73b377a9740c776f48d04439cd64d66a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:58:31 +0100 Subject: [PATCH 31/98] CTextBox: use scaled base dimensions --- 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 820ea4db3b9ff3af13c2df962dd391c96afba875 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 14:40:18 +0100 Subject: [PATCH 32/98] CHintBox: fix passed width parameter --- 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 17a9c691dacc7421827c63a09995e4905ddbf083 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 17:32:52 +0100 Subject: [PATCH 33/98] CHintBox: use OFFSET_INNER_MID as defaul value for W_RAME --- 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 1fea75f428d9d70b65d353e58feb31b359691182 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 27 Feb 2017 00:13:33 +0100 Subject: [PATCH 34/98] fb_generic: Add "#define SCALE2RES_DEFINED" to check... ...presence of 'CFrameBuffer::scale2Res()' - Revert this patch when pu/fb-setmode branch is merged to master --- 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 84b2af00fb86a03df12ae7eb20acf01290d30077 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 35/98] osd resolution: Add src/gui/osd_helpers.cpp - Move switch osd resolution from COsdSetup::changeNotify() to COsdHelpers::changeOsdResolution() --- 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 653e574937874e8d0a0841372dbd9b1cc96462ae Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 36/98] osd resolution: Add 'mode' to osd_resolution_struct_t - Use COsdSetup::OSDMODE_XXX enums to identify various resolutions --- 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 cc05d272f2af7017d6e41810883fbcfc7989203f Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 37/98] CInfoViewer::showTitle: Add parameter forcePaintButtonBar --- 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 3bf32265c1547695c0be1186dc30cbf5b0b76cd2 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 38/98] NeutrinoMessages: Add EVT_AUTO_SET_VIDEOSYSTEM --- 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 ff11dd44ab76d3d9a716ab20903449a27a2a5025 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 15:02:09 +0100 Subject: [PATCH 39/98] osd resolution: Use COsdHelpers::changeOsdResolution() to adjust... ...OSD resolution after switching video format --- 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 cf9a953b59f1cfe15d1d234c4f00c58ba0d0029f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:01:58 +0100 Subject: [PATCH 40/98] 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 --- 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 449901f1d8b0423f5cf289e0b582219e9a201182 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:03:46 +0100 Subject: [PATCH 41/98] CBuildInfo: adaopt for discret percental window dimensions --- 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 21b700879e86a4f9b0da1d05657bbd3b2f417021 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:04:47 +0100 Subject: [PATCH 42/98] CMovieBrowser: adaopt for discret percental window dimensions --- 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 88f80053d24358bec745e5b145833166c9b7c3c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:06:04 +0100 Subject: [PATCH 43/98] CProgressWindow: adaopt for discret percental window dimensions --- 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 4d50172fbdb0d73c0f9243200d5500570c2b89b8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:07:15 +0100 Subject: [PATCH 44/98] CTestMenu: adaopt progress sample with discret percental window dimensions --- 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 a9a09541e09a36acb9fe0362f7a5285dd48b5533 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 3 Mar 2017 09:10:40 +0100 Subject: [PATCH 45/98] CProgressWindow: small optimize of size handling --- 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 8862ef621b77d71b1974c4abff43b569e12b2002 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 3 Mar 2017 09:52:57 +0100 Subject: [PATCH 46/98] - fix funny typo --- 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 53460e54da657f30009cd6bf814fcf175c62dc52 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 5 Mar 2017 19:49:31 +0100 Subject: [PATCH 47/98] CFbAccelCSHD2::setMode: Fix value for screeninfo.yres_virtual --- 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 fa08347ef41026eb7bc4894af144e42cfc9e5447 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 5 Mar 2017 19:49:35 +0100 Subject: [PATCH 48/98] COsdHelpers: Add function setVideoSystem() --- 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 b1dcce0ad33246b4364ad3c5d25c34f3b6bc2a8e Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 5 Mar 2017 19:49:39 +0100 Subject: [PATCH 49/98] COsdHelpers: Remove no longer required function resetOsdResolution() --- 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 e10cb00613898eb4a67fae3166fec019876c86e4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 6 Mar 2017 15:50:06 +0100 Subject: [PATCH 50/98] subpagetable is unsigned --- 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 26a0f319231bf1bb0865e283ceb1fb35b5df6b1a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 51/98] CMovieBrowser: remove wrong progress value --- 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 7f511ebd1a394aa1650fcefa81423dc6c679099d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 52/98] CProgressWindow/CProgressSignals: add prepared signals Required for inhertance of signals used with CProgressWindow. --- 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 8c6a47ee3a8047cd2f1c7ba6635ae3923d1ef127 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Mar 2017 21:25:36 +0100 Subject: [PATCH 53/98] CMovieBrowser/cYTFeedParser: implement signals from CProgressSignals --- 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 1bb9fc6687390a429bd8db89a6c4ec2a339aa627 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 6 Mar 2017 10:51:43 +0100 Subject: [PATCH 54/98] Fix osd mode switch in videosystem auto mode --- 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 6fc24e990b3923d72c571477110102c9e3ddbbfa Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 6 Mar 2017 13:20:02 +0100 Subject: [PATCH 55/98] - allow to force given osd resolution in "videosystem = auto" mode --- 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 5ce34d5cf95bd496a59ba9dd23aeddb35a5746d7 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 12 Mar 2017 06:32:52 +0100 Subject: [PATCH 56/98] Revert "- allow to force given osd resolution in "videosystem = auto" mode" This reverts commit 6fc24e990b3923d72c571477110102c9e3ddbbfa. --- 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 30db40da1afebe1c3a4f5748d864bb1a043b2946 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Mar 2017 09:20:31 +0100 Subject: [PATCH 57/98] CMenuWidget::calcSize: Recalculation of min_width ... ... for adjustment to the osd resolution --- 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 2ed30486c47a6d13e852372347cd55d7734c3967 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Mar 2017 09:20:36 +0100 Subject: [PATCH 58/98] CMenuWidget::calcSize: Use scale2Res() to adjust fixed sizes --- 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 d0b02a9752ce56787c076d51db26d90f7a27c30e Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Mar 2017 10:33:32 +0100 Subject: [PATCH 59/98] CMenuWidget::calcSize: Add forgotten 'wi' --- 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 afe98d395210f4263125a40a783deb5651302499 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:10:29 +0100 Subject: [PATCH 60/98] settings.h: enable scale for DETAILSLINE_WIDTH --- 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 df484340927dae179ed3e21a10be2dec98d2d0d0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:11:45 +0100 Subject: [PATCH 61/98] cc_types.h: add scale to CC_WIDTH_MIN/CC_HEIGHT_MIN --- 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 f5f2bf92bad20d532dbb95368dd52da54db53447 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:23:31 +0100 Subject: [PATCH 62/98] CComponentsDetailsLine: add scale to details line width Also added correction for odd line width values and added method to change details line width. --- 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 1db1182b87be39b69b57d54bc99b0d620bb64f3f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:17:16 +0100 Subject: [PATCH 63/98] CImageInfo: use global offset for item offset --- 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 81cde4836fc6b04129560f2b4847eb95e3e89b3d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:37:55 +0100 Subject: [PATCH 64/98] CComponentsExtTextForm: fix label width calculation --- 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 17227504c29ec48d6f96411aa1d049c579e658e2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:41:03 +0100 Subject: [PATCH 65/98] CImageInfo: optimize label arrangement Distance between label and text was too large with full hd resolution. --- 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 e498cc6b09b5521590db732c3296d91b4b78ff67 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:47:00 +0100 Subject: [PATCH 66/98] CComponentsExtTextForm: use scaled default dimension values --- 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 2de98df48fe6e6a98bfcbeddb89a04b8d31b23eb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 19 Mar 2017 22:30:26 +0100 Subject: [PATCH 67/98] 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. --- 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 2a858c628a98bc70184a0ce62c75cdaebac7c850 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 22 Mar 2017 07:27:12 +0100 Subject: [PATCH 68/98] Fix videosystem auto mode / osd mode switch in movie player --- 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 ea18657562fb62154f61e6818d994d76931b9174 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Thu, 23 Mar 2017 21:26:57 +0100 Subject: [PATCH 69/98] src/neutrino.cpp: Simplification EVT_AUTO_SET_VIDEOSYSTEM handling --- 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 515ab1fe598276b2cb169298cf9fd81968a7c3cd Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Thu, 23 Mar 2017 21:27:06 +0100 Subject: [PATCH 70/98] CFbAccelCSHD2::setMode: Fix if ENABLE_CHANGE_OSD_RESOLUTION is not defined --- 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 40a4ec42628d27a941b104e49f6a9d89cf18c036 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:03 +0200 Subject: [PATCH 71/98] CFbAccelCSHD[1|2]::setMode(): Insert cVideo::updateOsdScreenInfo() --- 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 f7cea75f37baca88c64bd72e7ca795146272e9db Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:07 +0200 Subject: [PATCH 72/98] CStreamInfo2: Add new info items - Videosystem - OSD Resolution --- 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 9e08f4cb9253a006c68e5de03463c3796e6e3b24 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:10 +0200 Subject: [PATCH 73/98] lib/libtuxtxt/tuxtxt.cpp: Update for hd1/hd2 --- 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 3c1f2bfe0566e83b293c94f9e60ce22074228394 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:13 +0200 Subject: [PATCH 74/98] fb_accel hd1/hd2: Add fb_accel_cs_hdx.cpp for common functions - Add 'class CFbAccelCSHDx' to fb_accel.h - Some small code updates --- 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 b612c1f620c00e628d1cafc854d01e59753e2ba5 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Mar 2017 23:55:16 +0200 Subject: [PATCH 75/98] Fix videosystem auto mode --- 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 923daa87da7613996361a751c62dfa61dd1da556 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 29 Mar 2017 08:11:36 +0200 Subject: [PATCH 76/98] - locale: minor changes --- 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 68c2b29caf3fadeaf49d296231ad48ca32ed645d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Apr 2017 22:26:51 +0200 Subject: [PATCH 77/98] CMovieBrowser: try to reduce effort for vizualized scan For comparings I added a benchmark with log output. --- 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 ab829a61b651a6250240e70727c515fa8d7f5978 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 May 2017 19:26:04 +0200 Subject: [PATCH 78/98] change prozent ckeck to 90 --- 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 a6fe60d60a5363973459384a156ed49c9e9ee91c Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 7 Jun 2017 14:12:27 +0200 Subject: [PATCH 79/98] HD1: Workaround for missing cs_get_chip_type --- 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 327dbbed1eccf37eae5339ba98e5823a76cb32d9 Mon Sep 17 00:00:00 2001 From: Striper Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 80/98] 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 --- 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 64f35bd2ef886b8f9206bf84049116dad689551b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 81/98] - filebrowser: use "dirs first" sort method by default Signed-off-by: Thilo Graf --- 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 11aa9054bcbd593a04ca49dd98fe64f288d266a2 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 82/98] - filebrowser: use a bit larger regular font by default Signed-off-by: Thilo Graf --- 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 49bd2e9ba72930bbd6cfec93a80815540f644fff Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 83/98] - locale: small changes in filebrowser's sort locales Signed-off-by: Thilo Graf --- 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 cb36d32799d2e85f67716a94028de2453a18a4db Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 84/98] - 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 --- 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 d8f364ca4630607918860e091c2d767dcc1125dc Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 85/98] - icons: add filetype-icon for pictures Signed-off-by: Thilo Graf --- 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 86/98] - filebrowser: use NEUTRINO_ICON_PICTURE to mark pictures Signed-off-by: Thilo Graf --- 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 6c1d7eea595e82e3f5a3f035f9c7656a5f4fc79d Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:11 +0200 Subject: [PATCH 87/98] - audioplayer: use NEUTRINO_ICON_AUDIO in header Signed-off-by: Thilo Graf --- 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 a43617dda3c45f7fe4c3c71a1c13a44f7d2ee987 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 88/98] - icons: move mp3.png from /headers to /filetypes; align icon size Signed-off-by: Thilo Graf --- 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 89/98] - icons: add filetype-icon for pictures Signed-off-by: Thilo Graf --- 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 40241710410b00955be6fe0e2ed3f0cfd151bd1c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 90/98] - file.cpp|h: port filetypes from TangoCash --- 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 e49c326406253683027fe9e011dae1f72be7ee6b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 91/98] - filebrowser: port fileicon handling from TangoCash Signed-off-by: Thilo Graf --- 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 535e4e2123421b0659c055b2ffa494fbe8ec0cfd Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 92/98] - icons.h: sort filetype icons Signed-off-by: Thilo Graf --- 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 37e2efb3edfab7c09d8feaf29a90bcb56a61810c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 93/98] - file.cpp|h: port filetypes handling from martii Signed-off-by: Thilo Graf --- 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 866f5c37b8b7ddb2064831acea9488442a6ef502 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 94/98] -epgplus: fix possible segfault (thx dbo) Signed-off-by: Thilo Graf --- 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 141d198b291b578d5db0fc2d0439010ea8180bbd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 95/98] Followscreenings: add enumeration for a better readability --- 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 5307e62506128b41cd6635ef6a138bfe21fd925f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 96/98] set threadnames to unique values Signed-off-by: Thilo Graf --- 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 f2cae79b1caa5918bb307ad15c081e4101b9b87e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 7 Jun 2017 14:17:12 +0200 Subject: [PATCH 97/98] - bouquetlist: fix calculation of footerwidth wrong font was used Signed-off-by: Thilo Graf --- 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 45f915dd390a68dc0fc702185e6d94bf5d156611 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 7 Jun 2017 14:19:11 +0200 Subject: [PATCH 98/98] configure.ac: bump revision to 3.5.0 --- 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])