From 59115888cc574a44abdd97ad1b191245a0af2a73 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 6 Mar 2017 10:51:43 +0100 Subject: [PATCH 1/2] Fix osd mode switch in videosystem auto mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1bb9fc6687390a429bd8db89a6c4ec2a339aa627 Author: Michael Liebmann Date: 2017-03-06 (Mon, 06 Mar 2017) --- 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 b9472250c3690de5dd1bcc73ecf3e822fc8724e3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 6 Mar 2017 13:20:02 +0100 Subject: [PATCH 2/2] allow to force given osd resolution in "videosystem = auto" mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fc24e990b3923d72c571477110102c9e3ddbbfa Author: vanhofen Date: 2017-03-06 (Mon, 06 Mar 2017) Origin message was: ------------------ - allow to force given osd resolution in "videosystem = auto" mode --- 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;