From 4211cb9d8e1ffc844289fb6d2823dcf63963b019 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:24 +0100 Subject: [PATCH 01/10] configure: Add macro ENABLE_CHANGE_OSD_RESOLUTION - macro is default for hd2 - macro can activated for other hardware by configure option --enable-reschange Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9497a3c43a910583f8e7c3464897206cd3624cd1 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ configure: Add macro ENABLE_CHANGE_OSD_RESOLUTION - macro is default for hd2 - macro can activated for other hardware by configure option --enable-reschange ------------------ This commit was generated by Migit --- acinclude.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 3eadaaff4..ee5c7ec0e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -22,6 +22,14 @@ if test "$DEBUG" = "yes"; then AC_DEFINE(DEBUG,1,[Enable debug messages]) fi +AC_ARG_ENABLE(reschange, + AS_HELP_STRING(--enable-reschange,enable change the osd resolution (default for hd2))) + +AM_CONDITIONAL(ENABLE_RESCHANGE,test "$enable_reschange" = "yes") +if test "$enable_reschange" = "yes"; then + AC_DEFINE(ENABLE_CHANGE_OSD_RESOLUTION,1,[enable change the osd resolution]) +fi + AC_ARG_ENABLE(tmsdk, AS_HELP_STRING(--enable-tmsdk, compile inside sdk), ,[enable_tmsdk=no]) @@ -559,6 +567,7 @@ if test "$BOXMODEL" = "hd1"; then AC_DEFINE(BOXMODEL_CS_HD1, 1, [coolstream hd1/neo/neo2/zee]) elif test "$BOXMODEL" = "hd2"; then AC_DEFINE(BOXMODEL_CS_HD2, 1, [coolstream tank/trinity/trinity v2/trinity duo/zee²/link]) + AC_DEFINE(ENABLE_CHANGE_OSD_RESOLUTION,1,[enable change the osd resolution]) elif test "$BOXMODEL" = "dm500"; then AC_DEFINE(BOXMODEL_DM500, 1, [dreambox 500]) elif test "$BOXMODEL" = "ip200"; then From d5d1fc0728cc468094b6ab978197201005003399 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:27 +0100 Subject: [PATCH 02/10] CFbAccelCSHD2::setMode: Update for new framebuffer driver (full hd) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/33125aed06d2175f197efa95645dba4f9bd962f2 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel_cs_hd2.cpp | 44 ++++++++++++++++++++++++++++++---- src/neutrino.cpp | 5 +++- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 393e6396c..233254acc 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -185,21 +185,57 @@ void CFbAccelCSHD2::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_ CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff); } -int CFbAccelCSHD2::setMode(unsigned int, unsigned int, unsigned int) +int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) { + if (!available&&!active) + return -1; + + if (available >= 16588800) { /* new fb driver with maxres 1920x1080(*8) */ + screeninfo.xres_virtual=screeninfo.xres=nxRes; + screeninfo.yres_virtual=screeninfo.yres=nyRes; + screeninfo.height=0; + screeninfo.width=0; + screeninfo.xoffset=screeninfo.yoffset=0; + screeninfo.bits_per_pixel=nbpp; + + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) + perror(LOGTAG "FBIOPUT_VSCREENINFO"); + + printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", + screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); + if ((screeninfo.xres != nxRes) || + (screeninfo.yres != nyRes) || + (screeninfo.bits_per_pixel != nbpp)) { + printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", + nxRes, nyRes, nbpp, + screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); + return -1; + } + } + fb_fix_screeninfo _fix; if (ioctl(fd, FBIOGET_FSCREENINFO, &_fix) < 0) { - perror("FBIOGET_FSCREENINFO"); + perror(LOGTAG "FBIOGET_FSCREENINFO"); return -1; } stride = _fix.line_length; if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) - printf("screen unblanking failed\n"); + printf(LOGTAG "screen unblanking failed\n"); xRes = screeninfo.xres; yRes = screeninfo.yres; bpp = screeninfo.bits_per_pixel; - printf(LOGTAG "%dx%dx%d line length %d. using hd2 graphics accelerator.\n", xRes, yRes, bpp, stride); + printf(LOGTAG "%dx%dx%d line length %d. using %s graphics accelerator.\n", xRes, yRes, bpp, stride, _fix.id); + +/* +max res 1280x720 + available 14745600 + stride 5120 +max res 1920x1080 + available 16588800 + stride 7680 +*/ + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8ab84bd88..7861c9228 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1815,7 +1815,10 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); - if(frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t))) { + /* Parameters only valid for hd2 hardware and new fb drivers, + all other hardware ignores these parameters */ +// if (frameBuffer->setMode(1280, 720, 8 * sizeof(fb_pixel_t)) == -1) { + if (frameBuffer->setMode(1920, 1080, 8 * sizeof(fb_pixel_t)) == -1) { dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); exit(-1); } From 9fe7ca7e26e1d88233b748fe4ef12175410f6994 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:30 +0100 Subject: [PATCH 03/10] CFbAccelCSHD2: Add scaleFont()function for font upscaling when fullhd is aktiv Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/88c834221bddf5400b65017d946e7d2beb798fbf Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel.h | 1 + src/driver/fb_accel_cs_hd2.cpp | 8 ++++++++ src/driver/fb_generic.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 54736d331..f13c08ef2 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -127,6 +127,7 @@ class CFbAccelCSHD2 void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); void setBlendMode(uint8_t); void setBlendLevel(int); + int scaleFont(int size); }; class CFbAccelGLFB diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 233254acc..61936135a 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -264,3 +264,11 @@ void CFbAccelCSHD2::setBlendLevel(int level) if (level == 100) // TODO: sucks. usleep(20000); } + +int CFbAccelCSHD2::scaleFont(int size) +{ + if (screeninfo.xres == 1920) + size += size/2; + + return size; +} diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 5b2a24402..747424648 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -270,6 +270,7 @@ class CFrameBuffer : public sigc::trackable void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); + virtual int scaleFont(int size) { return size; }; enum { From 346923a66bbe12f335e2713ed509bdefba270b84 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:34 +0100 Subject: [PATCH 04/10] neutrino: Upscaling fonts, infoclock and volumebar for full hd Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/13a7358e6489f06892689fe503f2008af47837d6 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/neutrinofonts.cpp | 17 ++++++++++++++--- src/gui/infoclock.cpp | 3 +++ src/gui/volumebar.cpp | 9 +++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 80b40377e..6bbe1e912 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -176,12 +176,23 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) fontStyle[2] = "Italic"; } + int fontSize; for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; - g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; +#else + fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; +#endif + g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), fontSize); } if (g_SignalFont) delete g_SignalFont; - g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; +#else + fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; +#endif + g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize); } void CNeutrinoFonts::refreshDynFonts() @@ -242,7 +253,7 @@ int CNeutrinoFonts::getFontHeight(Font* fnt) int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) { int dynSize = dy/1.6; - if (dx == 0) dx = 1280; + if (dx == 0) dx = CFrameBuffer::getInstance()->getScreenWidth(true); if (!vDynSize.empty()) { for (size_t i = 0; i < vDynSize.size(); i++) { diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 54b485b09..a5c75b7fc 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -76,6 +76,9 @@ void CInfoClock::initCCLockItems() //set height, NOTE: height is strictly bound to settings height = g_settings.infoClockFontSize; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif initClockFont(0, height); // set corner radius depending on clock height diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 9f9921ad6..6ba244f27 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -54,6 +54,9 @@ void CVolumeBar::initVarVolumeBar() corner_rad = CORNER_RADIUS_MID; vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif //assume volume value as pointer to global setting vb_vol = &g_settings.current_volume; @@ -92,6 +95,9 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = 200; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vb_pbw = CFrameBuffer::getInstance()->scaleFont(vb_pbw); +#endif vb_pbh = height-4*vb_item_offset; //result for width @@ -363,6 +369,9 @@ void CVolumeHelper::initVolBarSize() icon_width += 8; g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = g_settings.volume_size; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vol_height = CFrameBuffer::getInstance()->scaleFont(vol_height); +#endif if (g_settings.volume_digits) { CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance(); From 39035073123d9bcad4ce17cc7b6c2313df878b95 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Feb 2017 12:49:37 +0100 Subject: [PATCH 05/10] neutrino: Add switch osd resolution when supported from hardware - At the moment supported hardware: CS HD2 Currently known problems: ------------------------- - Display menus after changing resolution (Reboot required) - Display headers after changing resolution hd => fullhd (Reboot required) - Display infobar after changing resolution hd => fullhd (Reboot required) - Screenshot broken (With new driver and set resolution to 1280x720) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b158903f8fd08e3c6636c22ab00eae1c2262793 Author: Michael Liebmann Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ neutrino: Add switch osd resolution when supported from hardware - At the moment supported hardware: CS HD2 Currently known problems: ------------------------- - Display menus after changing resolution (Reboot required) - Display headers after changing resolution hd => fullhd (Reboot required) - Display infobar after changing resolution hd => fullhd (Reboot required) - Screenshot broken (With new driver and set resolution to 1280x720) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 +- data/locale/english.locale | 4 +- src/driver/fb_accel.h | 3 + src/driver/fb_accel_cs_hd1.cpp | 18 +++- src/driver/fb_accel_cs_hd2.cpp | 29 +++++- src/driver/fb_generic.cpp | 13 +++ src/driver/fb_generic.h | 10 ++ src/gui/osd_setup.cpp | 73 +++++++++++++-- src/gui/osd_setup.h | 6 ++ src/gui/screensetup.cpp | 57 ++++++++--- src/neutrino.cpp | 166 ++++++++++++++++++++++++--------- src/neutrino.h | 2 + src/system/locals.h | 4 +- src/system/locals_intern.h | 4 +- src/system/settings.h | 25 +++-- 15 files changed, 338 insertions(+), 80 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a1715b44f..81571ac83 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -322,10 +322,9 @@ colormenu.clock_textcolor Ziffernfarbe colormenu.fade Ein-/Ausblenden colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart -colormenu.hd_preset LCD colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl -colormenu.sd_preset CRT +colormenu.osd_resolution OSD-Auflösung colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1244,6 +1243,7 @@ menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste ve menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) +menu.hint_osd_resolution Wählen Sie eine OSD Auflösung menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird menu.hint_other_fonts Ändern Sie andere Schriftgrößen menu.hint_parentallock_changepin Geben Sie den 4-stelligen PIN-Code ein, der dann ggf. abgefragt wird diff --git a/data/locale/english.locale b/data/locale/english.locale index 4feae3a1e..9cec3d22b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -322,10 +322,9 @@ colormenu.clock_textcolor Digit color colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font -colormenu.hd_preset LCD colormenu.menucolors Colors colormenu.osd_preset TV preset -colormenu.sd_preset CRT +colormenu.osd_resolution OSD resolution colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1244,6 +1243,7 @@ menu.hint_opkg_upgrade Updates all installed packages to the most recent version menu.hint_osd Colors, fonts, screen size\nGUI look and feel options menu.hint_osd_language Select OSD language menu.hint_osd_preset Pre-configured screen margins for CRT and LCD TV +menu.hint_osd_resolution Change OSD resolution menu.hint_osd_timing After this time the OSD will be faded out menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index f13c08ef2..5d1b380be 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -108,6 +108,7 @@ class CFbAccelCSHD1 void setBlendLevel(int); void add_gxa_sync_marker(void); void setupGXA(void); + void setOsdResolutions(); }; class CFbAccelCSHD2 @@ -128,6 +129,8 @@ class CFbAccelCSHD2 void setBlendMode(uint8_t); void setBlendLevel(int); int scaleFont(int size); + bool fullHdAvailable(); + void setOsdResolutions(); }; class CFbAccelGLFB diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index 4b3df3d20..0edd86b16 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -325,9 +325,25 @@ void CFbAccelCSHD1::setupGXA() add_gxa_sync_marker(); } -/* wrong name... */ +void CFbAccelCSHD1::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); +} + int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int) { + if (!available&&!active) + return -1; + + if (osd_resolutions.empty()) + setOsdResolutions(); + fb_fix_screeninfo _fix; if (ioctl(fd, FBIOGET_FSCREENINFO, &_fix) < 0) { diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 61936135a..8ee49c023 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -185,12 +185,32 @@ void CFbAccelCSHD2::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_ CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff); } +void CFbAccelCSHD2::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); + if (fullHdAvailable()) { + res.xRes = 1920; + res.yRes = 1080; + res.bpp = 32; + osd_resolutions.push_back(res); + } +} + int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) { if (!available&&!active) return -1; - if (available >= 16588800) { /* new fb driver with maxres 1920x1080(*8) */ + if (osd_resolutions.empty()) + setOsdResolutions(); + + if (fullHdAvailable()) { screeninfo.xres_virtual=screeninfo.xres=nxRes; screeninfo.yres_virtual=screeninfo.yres=nyRes; screeninfo.height=0; @@ -272,3 +292,10 @@ int CFbAccelCSHD2::scaleFont(int size) return size; } + +bool CFbAccelCSHD2::fullHdAvailable() +{ + if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */ + return true; + return false; +} diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 9377d77da..0cdac8a39 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -350,8 +350,21 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) { printf("screen unblanking failed\n"); } + return 0; } + +void CFrameBuffer::setOsdResolutions() +{ + /* FIXME: Infos available in driver? */ + osd_resolution_t res; + osd_resolutions.clear(); + res.xRes = 1280; + res.yRes = 720; + res.bpp = 32; + osd_resolutions.push_back(res); +} + #if 0 //never used void CFrameBuffer::setTransparency( int /*tr*/ ) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 747424648..1269abead 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -39,6 +39,13 @@ typedef struct fb_var_screeninfo t_fb_var_screeninfo; +typedef struct osd_resolution_t +{ + uint32_t yRes; + uint32_t xRes; + uint32_t bpp; +} osd_resolution_struct_t; + typedef struct gradientData_t { fb_pixel_t* gradientBuf; @@ -271,6 +278,9 @@ class CFrameBuffer : public sigc::trackable virtual void mark(int x, int y, int dx, int dy); virtual int scaleFont(int size) { return size; }; + virtual bool fullHdAvailable() { return false; }; + virtual void setOsdResolutions(); + std::vector osd_resolutions; enum { diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8a31cf3c2..4e5128c67 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -389,12 +389,11 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } - #define OSD_PRESET_OPTIONS_COUNT 2 -const CMenuOptionChooser::keyval OSD_PRESET_OPTIONS[OSD_PRESET_OPTIONS_COUNT] = +const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] = { - { 0, LOCALE_COLORMENU_SD_PRESET }, - { 1, LOCALE_COLORMENU_HD_PRESET } + { COsdSetup::PRESET_CRT, NONEXISTANT_LOCALE, "CRT" }, + { COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" } }; #define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4 @@ -641,11 +640,37 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(GenericMenuSeparatorLine); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + // osd resolution + size_t resCount = frameBuffer->osd_resolutions.size(); + struct CMenuOptionChooser::keyval_ext kext[resCount]; + char valname[resCount][255]; + if (resCount > 0) { + for (size_t i = 0; i < resCount; i++) { + kext[i].key = i; + kext[i].value = NONEXISTANT_LOCALE; + snprintf(valname[i], sizeof(valname[resCount]), "%dx%d", frameBuffer->osd_resolutions[i].xRes, frameBuffer->osd_resolutions[i].yRes); + kext[i].valname = valname[i]; + } + } + else { + kext[0].key = 0; + kext[0].value = NONEXISTANT_LOCALE; + kext[0].valname = "-"; + resCount = 1; + } + CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this); + osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); + osd_menu->addItem(osd_res); +#endif + //monitor CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET); osd_menu->addItem(mc); + osd_menu->addItem(GenericMenuSeparatorLine); + // round corners mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS); @@ -1354,16 +1379,48 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) int preset = * (int *) data; printf("preset %d (setting %d)\n", preset, g_settings.screen_preset); - g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; - g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; - g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; - g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; + CNeutrinoApp::getInstance()->setScreenSettings(); osd_menu->hide(); if (g_InfoViewer == NULL) g_InfoViewer = new CInfoViewer; g_InfoViewer->changePB(); return true; } +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION)) + { + if (frameBuffer->fullHdAvailable()) { + if (frameBuffer->osd_resolutions.empty()) + return true; + + size_t index = (size_t)*(int*)data; + size_t resCount = frameBuffer->osd_resolutions.size(); + if (index >= resCount) + index = 0; + + uint32_t resW = frameBuffer->osd_resolutions[index].xRes; + uint32_t resH = frameBuffer->osd_resolutions[index].yRes; + uint32_t bpp = frameBuffer->osd_resolutions[index].bpp; + int switchFB = frameBuffer->setMode(resW, resH, bpp); + + if (switchFB == 0) { +//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp); + osd_menu->hide(); + frameBuffer->Clear(); + CNeutrinoApp::getInstance()->setScreenSettings(); + CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); + CVolumeHelper::getInstance()->refresh(); + CInfoClock::getInstance()->ClearDisplay(); + FileTimeOSD->Init(); + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); + if (g_InfoViewer) + g_InfoViewer->ResetModules(); + } + } + return true; + } +#endif else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_ROUNDED_CORNERS)) { osd_menu->hide(); g_settings.rounded_corners = * (int*) data; diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 18adc6311..cdea56535 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -96,6 +96,12 @@ class COsdSetup : public CMenuTarget, public CChangeObserver INFOBAR_LOGO_FRAMED, INFOBAR_LOGO_SHADED }; + + enum + { + PRESET_CRT, + PRESET_LCD + }; COsdSetup(int wizard_mode = SNeutrinoSettings::WIZARD_OFF); ~COsdSetup(); diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index b1327fed2..207020eab 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -109,27 +110,61 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) switch ( msg ) { - case CRCInput::RC_ok: + case CRCInput::RC_ok: { // abspeichern g_settings.screen_StartX = x_coord[0]; g_settings.screen_EndX = x_coord[1]; g_settings.screen_StartY = y_coord[0]; g_settings.screen_EndY = y_coord[1]; - if(g_settings.screen_preset) { - g_settings.screen_StartX_lcd = g_settings.screen_StartX; - g_settings.screen_StartY_lcd = g_settings.screen_StartY; - g_settings.screen_EndX_lcd = g_settings.screen_EndX; - g_settings.screen_EndY_lcd = g_settings.screen_EndY; - } else { - g_settings.screen_StartX_crt = g_settings.screen_StartX; - g_settings.screen_StartY_crt = g_settings.screen_StartY; - g_settings.screen_EndX_crt = g_settings.screen_EndX; - g_settings.screen_EndY_crt = g_settings.screen_EndY; + switch (g_settings.osd_resolution) { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + case 1: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX_crt_1 = g_settings.screen_StartX; + g_settings.screen_StartY_crt_1 = g_settings.screen_StartY; + g_settings.screen_EndX_crt_1 = g_settings.screen_EndX; + g_settings.screen_EndY_crt_1 = g_settings.screen_EndY; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX_lcd_1 = g_settings.screen_StartX; + g_settings.screen_StartY_lcd_1 = g_settings.screen_StartY; + g_settings.screen_EndX_lcd_1 = g_settings.screen_EndX; + g_settings.screen_EndY_lcd_1 = g_settings.screen_EndY; + break; + } + } + break; +#endif + case 0: + default: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX_crt_0 = g_settings.screen_StartX; + g_settings.screen_StartY_crt_0 = g_settings.screen_StartY; + g_settings.screen_EndX_crt_0 = g_settings.screen_EndX; + g_settings.screen_EndY_crt_0 = g_settings.screen_EndY; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX_lcd_0 = g_settings.screen_StartX; + g_settings.screen_StartY_lcd_0 = g_settings.screen_StartY; + g_settings.screen_EndX_lcd_0 = g_settings.screen_EndX; + g_settings.screen_EndY_lcd_0 = g_settings.screen_EndY; + break; + } + } + break; } + if (g_InfoViewer) /* recalc infobar position */ g_InfoViewer->start(); loop = false; break; + } case CRCInput::RC_home: if ( ( ( g_settings.screen_StartX != x_coord[0] ) || diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7861c9228..f9a21a22f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -225,6 +225,7 @@ CNeutrinoApp::CNeutrinoApp() : configfile('\t') { standby_pressed_at.tv_sec = 0; + osd_resolution_tmp = -1; frameBuffer = CFrameBuffer::getInstance(); frameBuffer->setIconBasePath(ICONSDIR); @@ -305,15 +306,6 @@ static SNeutrinoSettings::usermenu_t usermenu_default[] = { /************************************************************************************** * CNeutrinoApp - loadSetup, load the application-settings * **************************************************************************************/ -#define DEFAULT_X_START_SD 60 -#define DEFAULT_Y_START_SD 20 -#define DEFAULT_X_END_SD 1220 -#define DEFAULT_Y_END_SD 560 - -#define DEFAULT_X_START_HD 40 //5 -#define DEFAULT_Y_START_HD 25 //5 -#define DEFAULT_X_END_HD 1235 //1275 -#define DEFAULT_Y_END_HD 690 //715 std::string ttx_font_file = ""; @@ -721,29 +713,31 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1); //screen configuration - g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD); - g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD ); - g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD); - g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD); - g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD); - g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD ); - g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD); - g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD); - g_settings.screen_preset = configfile.getInt32( "screen_preset", 1); - - g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; - g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; - g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; - g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; - - g_settings.screen_width = frameBuffer->getScreenWidth(true); - g_settings.screen_height = frameBuffer->getScreenHeight(true); + g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; + g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); + g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); + g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1199); + g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 674); + g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40); + g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 22); + g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1193); + g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 697); + g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80); + g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45); + g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1839); + g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 1034); + g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40); + g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 22); + g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1879); + g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1057); + g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD); + setScreenSettings(); // avoid configuration mismatch - if (g_settings.screen_EndX > g_settings.screen_width) - g_settings.screen_EndX = g_settings.screen_width; - if (g_settings.screen_EndY > g_settings.screen_height) - g_settings.screen_EndY = g_settings.screen_height; + if (g_settings.screen_EndX >= g_settings.screen_width) + g_settings.screen_EndX = g_settings.screen_width - 1; + if (g_settings.screen_EndY >= g_settings.screen_height) + g_settings.screen_EndY = g_settings.screen_height - 1; g_settings.bigFonts = configfile.getInt32("bigFonts", 0); g_settings.window_size = configfile.getInt32("window_size", 100); @@ -947,6 +941,56 @@ int CNeutrinoApp::loadSetup(const char * fname) return erg; } +void CNeutrinoApp::setScreenSettings() +{ + g_settings.screen_width = frameBuffer->getScreenWidth(true); + g_settings.screen_height = frameBuffer->getScreenHeight(true); + + switch (g_settings.osd_resolution) { +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + case 1: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX = g_settings.screen_StartX_crt_1; + g_settings.screen_StartY = g_settings.screen_StartY_crt_1; + g_settings.screen_EndX = g_settings.screen_EndX_crt_1; + g_settings.screen_EndY = g_settings.screen_EndY_crt_1; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX = g_settings.screen_StartX_lcd_1; + g_settings.screen_StartY = g_settings.screen_StartY_lcd_1; + g_settings.screen_EndX = g_settings.screen_EndX_lcd_1; + g_settings.screen_EndY = g_settings.screen_EndY_lcd_1; + break; + } + } + break; +#endif + case 0: + default: + { + switch (g_settings.screen_preset) { + case COsdSetup::PRESET_CRT: + g_settings.screen_StartX = g_settings.screen_StartX_crt_0; + g_settings.screen_StartY = g_settings.screen_StartY_crt_0; + g_settings.screen_EndX = g_settings.screen_EndX_crt_0; + g_settings.screen_EndY = g_settings.screen_EndY_crt_0; + break; + case COsdSetup::PRESET_LCD: + default: + g_settings.screen_StartX = g_settings.screen_StartX_lcd_0; + g_settings.screen_StartY = g_settings.screen_StartY_lcd_0; + g_settings.screen_EndX = g_settings.screen_EndX_lcd_0; + g_settings.screen_EndY = g_settings.screen_EndY_lcd_0; + break; + } + } + break; + } +} + void CNeutrinoApp::upgradeSetup(const char * fname) { dprintf(DEBUG_NORMAL, "upgrade/cleanup %s\n", fname); @@ -1310,15 +1354,24 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd ); - configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd ); - configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd ); - configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd ); - configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt ); - configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt ); - configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt ); - configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt ); - configfile.setInt32( "screen_preset", g_settings.screen_preset ); + configfile.setInt32("osd_resolution" , g_settings.osd_resolution); + configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); + configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); + configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); + configfile.setInt32("screen_EndY_lcd_0" , g_settings.screen_EndY_lcd_0); + configfile.setInt32("screen_StartX_crt_0", g_settings.screen_StartX_crt_0); + configfile.setInt32("screen_StartY_crt_0", g_settings.screen_StartY_crt_0); + configfile.setInt32("screen_EndX_crt_0" , g_settings.screen_EndX_crt_0); + configfile.setInt32("screen_EndY_crt_0" , g_settings.screen_EndY_crt_0); + configfile.setInt32("screen_StartX_lcd_1", g_settings.screen_StartX_lcd_1); + configfile.setInt32("screen_StartY_lcd_1", g_settings.screen_StartY_lcd_1); + configfile.setInt32("screen_EndX_lcd_1" , g_settings.screen_EndX_lcd_1); + configfile.setInt32("screen_EndY_lcd_1" , g_settings.screen_EndY_lcd_1); + configfile.setInt32("screen_StartX_crt_1", g_settings.screen_StartX_crt_1); + configfile.setInt32("screen_StartY_crt_1", g_settings.screen_StartY_crt_1); + configfile.setInt32("screen_EndX_crt_1" , g_settings.screen_EndX_crt_1); + configfile.setInt32("screen_EndY_crt_1" , g_settings.screen_EndY_crt_1); + configfile.setInt32("screen_preset" , g_settings.screen_preset); //Software-update configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode ); @@ -1815,10 +1868,37 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); - /* Parameters only valid for hd2 hardware and new fb drivers, - all other hardware ignores these parameters */ -// if (frameBuffer->setMode(1280, 720, 8 * sizeof(fb_pixel_t)) == -1) { - if (frameBuffer->setMode(1920, 1080, 8 * sizeof(fb_pixel_t)) == -1) { + int setFbMode = 0; + osd_resolution_tmp = -1; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + frameBuffer->setOsdResolutions(); + if (frameBuffer->osd_resolutions.empty()) { + dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); + exit(-1); + } + + uint32_t ort; + configfile.loadConfig(NEUTRINO_SETTINGS_FILE); + ort = configfile.getInt32("osd_resolution", 0); + + size_t resCount = frameBuffer->osd_resolutions.size(); + + if (ort > (resCount - 1)) + osd_resolution_tmp = ort = 0; + + if (resCount == 1) + ort = 0; + + setFbMode = frameBuffer->setMode(frameBuffer->osd_resolutions[ort].xRes, + frameBuffer->osd_resolutions[ort].yRes, + frameBuffer->osd_resolutions[ort].bpp); + +#else + /* all other hardware ignores setMode parameters */ + setFbMode = frameBuffer->setMode(0, 0, 0); +#endif + + if (setFbMode == -1) { dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); exit(-1); } diff --git a/src/neutrino.h b/src/neutrino.h index 1b15140ea..291a018ea 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -108,6 +108,7 @@ private: bool channelList_allowed; bool channelList_painted; int first_mode_found; + int osd_resolution_tmp; void SDT_ReloadChannels(); void setupNetwork( bool force= false ); @@ -162,6 +163,7 @@ public: void saveSetup(const char * fname); int loadSetup(const char * fname); + void setScreenSettings(); void upgradeSetup(const char * fname); void loadKeys(const char * fname = NULL); void saveKeys(const char * fname = NULL); diff --git a/src/system/locals.h b/src/system/locals.h index b74b90eb8..74403d860 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -349,10 +349,9 @@ typedef enum LOCALE_COLORMENU_FADE, LOCALE_COLORMENU_FONT, LOCALE_COLORMENU_FONT_TTX, - LOCALE_COLORMENU_HD_PRESET, LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, - LOCALE_COLORMENU_SD_PRESET, + LOCALE_COLORMENU_OSD_RESOLUTION, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1271,6 +1270,7 @@ typedef enum LOCALE_MENU_HINT_OSD, LOCALE_MENU_HINT_OSD_LANGUAGE, LOCALE_MENU_HINT_OSD_PRESET, + LOCALE_MENU_HINT_OSD_RESOLUTION, LOCALE_MENU_HINT_OSD_TIMING, LOCALE_MENU_HINT_OTHER_FONTS, LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b3b18075b..4c822ed47 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -349,10 +349,9 @@ const char * locale_real_names[] = "colormenu.fade", "colormenu.font", "colormenu.font_ttx", - "colormenu.hd_preset", "colormenu.menucolors", "colormenu.osd_preset", - "colormenu.sd_preset", + "colormenu.osd_resolution", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1271,6 +1270,7 @@ const char * locale_real_names[] = "menu.hint_osd", "menu.hint_osd_language", "menu.hint_osd_preset", + "menu.hint_osd_resolution", "menu.hint_osd_timing", "menu.hint_other_fonts", "menu.hint_parentallock_changepin", diff --git a/src/system/settings.h b/src/system/settings.h index 2c91416f6..3b605f557 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -608,14 +608,23 @@ struct SNeutrinoSettings int screen_StartY; int screen_EndX; int screen_EndY; - int screen_StartX_crt; - int screen_StartY_crt; - int screen_EndX_crt; - int screen_EndY_crt; - int screen_StartX_lcd; - int screen_StartY_lcd; - int screen_EndX_lcd; - int screen_EndY_lcd; + int screen_StartX_crt_0; + int screen_StartY_crt_0; + int screen_EndX_crt_0; + int screen_EndY_crt_0; + int screen_StartX_lcd_0; + int screen_StartY_lcd_0; + int screen_EndX_lcd_0; + int screen_EndY_lcd_0; + int screen_StartX_crt_1; + int screen_StartY_crt_1; + int screen_EndX_crt_1; + int screen_EndY_crt_1; + int screen_StartX_lcd_1; + int screen_StartY_lcd_1; + int screen_EndX_lcd_1; + int screen_EndY_lcd_1; + int osd_resolution; int screen_preset; int screen_width; int screen_height; From 168e359e2a1b83b26cd1280cc46d3565763c2aef Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 21:21:11 +0100 Subject: [PATCH 06/10] migrate users settings; screen_StartX_crt/lcd -> screen_StartX_crt/lcd_0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9792b47666f5a45973693e384e0b0c0cd7526b14 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - migrate users settings; screen_StartX_crt/lcd -> screen_StartX_crt/lcd_0 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f9a21a22f..7fac51f5f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4895,11 +4895,7 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) } /* - * commit 523b273a changed the names of config file entries: - * casystem_display => infobar_casystem_display - * casystem_dotmatrix => infobar_casystem_dotmatrix - * casystem_frame => infobar_casystem_frame - * convert these, so that users do not need to set up their system again + * convert config keys, so that users do not need to set up their system again */ struct __key_rename { const char *from; @@ -4910,6 +4906,14 @@ static struct __key_rename key_rename[] = { { "casystem_display", "infobar_casystem_display" }, { "casystem_dotmatrix", "infobar_casystem_dotmatrix"}, { "casystem_frame", "infobar_casystem_frame" }, + { "screen_StartX_crt", "screen_StartX_crt_0" }, + { "screen_StartY_crt", "screen_StartY_crt_0" }, + { "screen_EndX_crt", "screen_EndX_crt_0" }, + { "screen_EndY_crt", "screen_EndY_crt_0" }, + { "screen_StartX_lcd", "screen_StartX_lcd_0" }, + { "screen_StartY_lcd", "screen_StartY_lcd_0" }, + { "screen_EndX_lcd", "screen_EndX_lcd_0" }, + { "screen_EndY_lcd", "screen_EndY_lcd_0" }, { NULL, NULL } }; @@ -4932,9 +4936,8 @@ void CNeutrinoApp::migrateConfig(const char *fname) /* only set new key to old value if the new key does not yet exist */ if (configfile.getInt32(to, magic) == magic) configfile.setInt32(to, tmp); - /* always remove old key*/ + /* always remove old key */ configfile.deleteKey(from); } /* more complex migration, including converting values etc. could be done here */ } - From b19560e56ca4d2ba082ab4819ca9ee0c91d365ae Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 21:34:01 +0100 Subject: [PATCH 07/10] fix keywords in strange try-to-detect-bad-config-file if-statement Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6964b62c6f17b39b7a9b2269b1840a0940e1f407 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - fix keywords in strange try-to-detect-bad-config-file if-statement ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7fac51f5f..41559a5b9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -321,10 +321,10 @@ int CNeutrinoApp::loadSetup(const char * fname) erg = 1; } else { /* try to detect bad / broken config file */ - if (!configfile.getInt32("screen_EndX_crt", 0) || - !configfile.getInt32("screen_EndY_crt", 0) || - !configfile.getInt32("screen_EndX_lcd", 0) || - !configfile.getInt32("screen_EndY_lcd", 0)) { + if (!configfile.getInt32("screen_EndX_crt_0", 0) || + !configfile.getInt32("screen_EndY_crt_0", 0) || + !configfile.getInt32("screen_EndX_lcd_0", 0) || + !configfile.getInt32("screen_EndY_lcd_0", 0)) { printf("[neutrino] config file %s is broken, using defaults\n", fname); configfile.clear(); } else { From eb335c16388b29afc7e6131e14aa70ac8d68812a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 22:50:48 +0100 Subject: [PATCH 08/10] set new osd-presets closer to old values; auto-calc screenEnd-values Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/145c0d41b45e4f32a28e2039f2d04000e4e5feb0 Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - set new osd-presets closer to old values; auto-calc screenEnd-values ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 41559a5b9..dfc1e5190 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -716,20 +716,20 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); - g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1199); - g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 674); + g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); + g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 580 - g_settings.screen_StartY_crt_0 - 1); g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40); - g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 22); - g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1193); - g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 697); + g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 25); + g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1280 - g_settings.screen_StartX_lcd_0 - 1); + g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 720 - g_settings.screen_StartY_lcd_0 - 1); g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80); g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45); - g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1839); - g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 1034); + g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1920 - g_settings.screen_StartX_crt_1 - 1); + g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 870 - g_settings.screen_StartY_crt_1 - 1); g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40); - g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 22); - g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1879); - g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1057); + g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 25); + g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1920 - g_settings.screen_StartX_lcd_1 - 1); + g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1080 - g_settings.screen_StartY_lcd_1 - 1); g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD); setScreenSettings(); From d8f0038ef2396adf1f5c035a89cef9d61cb539d2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 23:15:25 +0100 Subject: [PATCH 09/10] ni-menu; fix build; OSD-Scart-Fix needs fixes, as it seems Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/477ed4a017e027a8e9131a51632fbb626b5e4f9c Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - ni-menu; fix build; OSD-Scart-Fix needs fixes, as it seems ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/ni_menu.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/ni_menu.cpp b/src/gui/ni_menu.cpp index 5226862f4..494fa0568 100644 --- a/src/gui/ni_menu.cpp +++ b/src/gui/ni_menu.cpp @@ -218,17 +218,17 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data) if (strstr(filename, "scart_osd_fix")) { //change to scart-osd-fix values - g_settings.screen_StartX_crt = 29; - g_settings.screen_StartY_crt = 43; - g_settings.screen_EndX_crt = 693; - g_settings.screen_EndY_crt = 535; + g_settings.screen_StartX_crt_0 = 29; + g_settings.screen_StartY_crt_0 = 43; + g_settings.screen_EndX_crt_0 = 693; + g_settings.screen_EndY_crt_0 = 535; g_settings.screen_preset = 0; //set values - 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_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd_0 : g_settings.screen_StartX_crt_0; + g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd_0 : g_settings.screen_StartY_crt_0; + g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd_0 : g_settings.screen_EndX_crt_0; + g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd_0 : g_settings.screen_EndY_crt_0; CFrameBuffer::getInstance()->Clear(); @@ -273,16 +273,16 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data) if (strstr(filename, "scart_osd_fix")) { //reset to defaults - g_settings.screen_StartX_crt = 60; - g_settings.screen_StartY_crt = 20; - g_settings.screen_EndX_crt = 1220; - g_settings.screen_EndY_crt = 560; + g_settings.screen_StartX_crt_0 = 60; + g_settings.screen_StartY_crt_0 = 20; + g_settings.screen_EndX_crt_0 = 1220; + g_settings.screen_EndY_crt_0 = 560; //set values - 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_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd_0 : g_settings.screen_StartX_crt_0; + g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd_0 : g_settings.screen_StartY_crt_0; + g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd_0 : g_settings.screen_EndX_crt_0; + g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd_0 : g_settings.screen_EndY_crt_0; CFrameBuffer::getInstance()->Clear(); From 5b537a782fee782c245c1e5bee107a79b9aef51a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Feb 2017 23:19:58 +0100 Subject: [PATCH 10/10] align new osd-presets to good old NI-values Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/af883139464f78328be7963891e504856ce2b7af Author: vanhofen Date: 2017-02-13 (Mon, 13 Feb 2017) Origin message was: ------------------ - align new osd-presets to good old NI-values ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e46e7e994..d20e9b980 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -776,16 +776,16 @@ int CNeutrinoApp::loadSetup(const char * fname) 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); 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", 25); + g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 45); //NI + g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 30); //NI 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" , 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", 25); + g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 50); //NI + g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 45); //NI 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);