From d446be1f95ae81eeb6e80fdfa60d7cac5813c752 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 15 Apr 2014 15:10:58 +0400 Subject: [PATCH] gui/videosettings.cpp: add option to enable/disable SD OSD on apollo --- data/locale/english.locale | 2 ++ src/gui/videosettings.cpp | 15 +++++++++++++++ src/neutrino.cpp | 3 ++- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 55c98d8ec..253cbbd98 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1233,6 +1233,7 @@ menu.hint_video_modes VF key will cycle between enabled modes menu.hint_video_pip Picture in picture size and position menu.hint_video_saturation Change picture saturation menu.hint_video_scart_mode Select analog output mode for SCART connectors +menu.hint_video_sdosd Enable/disable OSD display on SD output (scart, cinch) menu.hint_volume Configure Volume GUI options menu.hint_volume_digits Numeric display of the volumebar on/off menu.hint_volume_pos Select volume indicator position @@ -2093,6 +2094,7 @@ videomenu.pip_error PiP start failed videomenu.saturation Saturation videomenu.scart Scart videomenu.screensetup Screen Setup +videomenu.sdosd SD OSD videomenu.sharpness Sharpness videomenu.tv-scart Video videomenu.vcrsignal VCR Output Signal Type diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 67b17e33b..47e720359 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -54,6 +54,8 @@ #include #include +#include + extern cVideo *videoDecoder; #ifdef ENABLE_PIP extern cVideo *pipDecoder; @@ -324,6 +326,10 @@ int CVideoSettings::showVideoSetup() videosetup->addItem(bcont); videosetup->addItem(ccont); videosetup->addItem(scont); + + CMenuOptionChooser * sd = new CMenuOptionChooser(LOCALE_VIDEOMENU_SDOSD, &g_settings.enable_sd_osd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + sd->setHint("", LOCALE_MENU_HINT_VIDEO_SDOSD); + videosetup->addItem(sd); } #endif #ifdef ENABLE_PIP @@ -380,6 +386,7 @@ void CVideoSettings::setVideoSettings() changeNotify(LOCALE_VIDEOMENU_BRIGHTNESS, NULL); changeNotify(LOCALE_VIDEOMENU_CONTRAST, NULL); changeNotify(LOCALE_VIDEOMENU_SATURATION, NULL); + changeNotify(LOCALE_VIDEOMENU_SDOSD, NULL); #endif #ifdef ENABLE_PIP pipDecoder->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); @@ -462,6 +469,14 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void * /* { videoDecoder->SetControl(VIDEO_CONTROL_SATURATION, g_settings.saturation*3); } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_SDOSD)) + { + int val = g_settings.enable_sd_osd; + printf("SD OSD enable: %d\n", val); + int fd = CFrameBuffer::getInstance()->getFileHandle(); + if (ioctl(fd, FBIO_SCALE_SD_OSD, &val)) + perror("FBIO_SCALE_SD_OSD"); + } #endif #if 0 else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_SHARPNESS)) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 13f4c08c5..3fdac45a3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -833,6 +833,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.brightness = configfile.getInt32("brightness", 0); g_settings.contrast = configfile.getInt32("contrast", 0); g_settings.saturation = configfile.getInt32("saturation", 0); + g_settings.enable_sd_osd = configfile.getInt32("enable_sd_osd", 1); #endif #ifdef ENABLE_PIP g_settings.pip_x = configfile.getInt32("pip_x", 50); @@ -1271,7 +1272,7 @@ void CNeutrinoApp::saveSetup(const char * fname) #ifdef BOXMODEL_APOLLO configfile.setInt32("brightness", g_settings.brightness ); configfile.setInt32("contrast", g_settings.contrast ); - configfile.setInt32("saturation", g_settings.saturation ); + configfile.setInt32("enable_sd_osd", g_settings.enable_sd_osd ); #endif #ifdef ENABLE_PIP configfile.setInt32("pip_x", g_settings.pip_x); diff --git a/src/system/locals.h b/src/system/locals.h index 5b07e212e..27cf674ef 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1260,6 +1260,7 @@ typedef enum LOCALE_MENU_HINT_VIDEO_PIP, LOCALE_MENU_HINT_VIDEO_SATURATION, LOCALE_MENU_HINT_VIDEO_SCART_MODE, + LOCALE_MENU_HINT_VIDEO_SDOSD, LOCALE_MENU_HINT_VOLUME, LOCALE_MENU_HINT_VOLUME_DIGITS, LOCALE_MENU_HINT_VOLUME_POS, @@ -2120,6 +2121,7 @@ typedef enum LOCALE_VIDEOMENU_SATURATION, LOCALE_VIDEOMENU_SCART, LOCALE_VIDEOMENU_SCREENSETUP, + LOCALE_VIDEOMENU_SDOSD, LOCALE_VIDEOMENU_SHARPNESS, LOCALE_VIDEOMENU_TV_SCART, LOCALE_VIDEOMENU_VCRSIGNAL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 4f79e8204..efd4de360 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1260,6 +1260,7 @@ const char * locale_real_names[] = "menu.hint_video_pip", "menu.hint_video_saturation", "menu.hint_video_scart_mode", + "menu.hint_video_sdosd", "menu.hint_volume", "menu.hint_volume_digits", "menu.hint_volume_pos", @@ -2120,6 +2121,7 @@ const char * locale_real_names[] = "videomenu.saturation", "videomenu.scart", "videomenu.screensetup", + "videomenu.sdosd", "videomenu.sharpness", "videomenu.tv-scart", "videomenu.vcrsignal", diff --git a/src/system/settings.h b/src/system/settings.h index f16fcfaee..c40510f51 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -59,6 +59,7 @@ struct SNeutrinoSettings int brightness; int contrast; int saturation; + int enable_sd_osd; #endif char current_volume; int current_volume_step;