diff --git a/data/locale/english.locale b/data/locale/english.locale index 0d34a6e5d..a0170a16e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -951,6 +951,12 @@ videomenu.dbdr_none none videomenu.dbdr_deblock de-block videomenu.dbdr_both de-block+de-ring videomenu.enabled_modes VF key enabled modes +videomenu.adjust Adjust video settings +videomenu.contrast Contrast +videomenu.brightness Brightness +videomenu.sharpness Sharpness +videomenu.saturation Saturation +videomenu.hue Hue zaptotimer.announce Zapto timer in one minute extra.dboxinfo Box Info extra.scan_mode Scan mode diff --git a/lib/libcoolstream/video_cs.h b/lib/libcoolstream/video_cs.h index d4be2eb49..d2416ad48 100644 --- a/lib/libcoolstream/video_cs.h +++ b/lib/libcoolstream/video_cs.h @@ -100,6 +100,16 @@ typedef enum { VIDEO_HDMI_CEC_MODE_RECORDER } VIDEO_HDMI_CEC_MODE; +typedef enum +{ + VIDEO_CONTROL_BRIGHTNESS = 0, + VIDEO_CONTROL_CONTRAST, + VIDEO_CONTROL_SATURATION, + VIDEO_CONTROL_HUE, + VIDEO_CONTROL_SHARPNESS, + VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS +} VIDEO_CONTROL; + #ifndef CS_VIDEO_PDATA #define CS_VIDEO_PDATA void #endif @@ -200,7 +210,7 @@ class cVideo void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); - void SetContrast(int val); + void SetControl(int num, int val); bool ReceivedDRMDelay(void) { return receivedDRMDelay; } bool ReceivedVideoDelay(void) { return receivedVideoDelay; } void SetReceivedDRMDelay(bool Received) { receivedDRMDelay = Received; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c89c619c7..3e298662c 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -164,6 +164,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) { neutrino_msg_t msg; neutrino_msg_data_t data; + bool bAllowRepeatLR = false; int pos = 0; exit_pressed = false; @@ -201,8 +202,12 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) int retval = menu_return::RETURN_REPAINT; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + do { - g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); + if(hasItem() && selected >= 0) + bAllowRepeatLR = items[selected]->can_arrow; + + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, bAllowRepeatLR); if ( msg <= CRCInput::RC_MaxRC ) { timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f62db144c..a959f2d33 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2427,7 +2427,6 @@ int CNeutrinoApp::run(int argc, char **argv) videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby == 1); videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1); videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); - videoDecoder->SetAutoModes(g_settings.enabled_video_modes); // trigger a change audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 691fd6a10..a590caa6c 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -244,7 +244,7 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_ }; /* numbers corresponding to video.cpp from zapit */ -const CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_OPTION_COUNT] = +CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_OPTION_COUNT] = { { VIDEO_STD_SECAM, NONEXISTANT_LOCALE, "SECAM" }, { VIDEO_STD_PAL, NONEXISTANT_LOCALE, "PAL" }, @@ -300,6 +300,8 @@ CVideoSettings::CVideoSettings() : CMenuWidget(LOCALE_VIDEOMENU_HEAD, NEUTRINO_I for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) menu->addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, anotify)); + anotify->changeNotify(NONEXISTANT_LOCALE, 0); + addItem(new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, menu, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED )); addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_VIDEOMENU_HDMI_CEC)); @@ -323,6 +325,16 @@ CVideoSettings::CVideoSettings() : CMenuWidget(LOCALE_VIDEOMENU_HEAD, NEUTRINO_I changeNotify(LOCALE_VIDEOMENU_SCART, NULL); changeNotify(LOCALE_VIDEOMENU_CINCH, NULL); } +#if 0 /* Analog output only. suspended. */ + menu = new CMenuWidget(LOCALE_VIDEOMENU_ADJUST, NEUTRINO_ICON_SETTINGS); + static int tmp1 = 0, tmp2 = 0, tmp3 = 0, tmp4 = 0, tmp5 = 0; + menu->addItem(new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_BRIGHTNESS, &tmp2, true, -128, 127, this)); + menu->addItem(new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_CONTRAST, &tmp1, true, -128, 127, this)); + menu->addItem(new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_SHARPNESS, &tmp3, true, -128, 127, this)); + menu->addItem(new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_SATURATION, &tmp4, true, -128, 127, this)); + menu->addItem(new CMenuOptionNumberChooser(LOCALE_VIDEOMENU_HUE, &tmp5, true, -128, 127, this)); + addItem(new CMenuForwarder(LOCALE_VIDEOMENU_ADJUST, true, NULL, menu, NULL)); +#endif } void CVideoSettings::nextMode(void) @@ -423,8 +435,12 @@ void CVideoSettings::SwitchFormat(void) ShowHintUTF(LOCALE_VIDEOMENU_VIDEOFORMAT, g_Locale->getText(text), 450, 2); } -bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void *) +bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void * data) { + int val = 0; + if(data) + val = * (int *) data; + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_ANALOG_MODE)) { videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode1); @@ -479,7 +495,28 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void *) prev_video_mode = g_settings.video_Mode; } } - +#if 1 + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_CONTRAST)) + { + videoDecoder->SetControl(VIDEO_CONTROL_CONTRAST, val); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_BRIGHTNESS)) + { + videoDecoder->SetControl(VIDEO_CONTROL_BRIGHTNESS, val); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_SHARPNESS)) + { + videoDecoder->SetControl(VIDEO_CONTROL_SHARPNESS, val); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_SATURATION)) + { + videoDecoder->SetControl(VIDEO_CONTROL_SATURATION, val); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HUE)) + { + videoDecoder->SetControl(VIDEO_CONTROL_HUE, val); + } +#endif return true; } diff --git a/src/system/locals.h b/src/system/locals.h index 501c9e010..dfebb04c4 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1220,6 +1220,12 @@ typedef enum { LOCALE_VIDEOMENU_DBDR_DEBLOCK, LOCALE_VIDEOMENU_DBDR_BOTH, LOCALE_VIDEOMENU_ENABLED_MODES, + LOCALE_VIDEOMENU_ADJUST, + LOCALE_VIDEOMENU_CONTRAST, + LOCALE_VIDEOMENU_BRIGHTNESS, + LOCALE_VIDEOMENU_SHARPNESS, + LOCALE_VIDEOMENU_SATURATION, + LOCALE_VIDEOMENU_HUE, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index c10a5e0d0..377d32b05 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1220,6 +1220,12 @@ const char *locale_real_names[] = { "videomenu.dbdr_deblock", "videomenu.dbdr_both", "videomenu.enabled_modes", + "videomenu.adjust", + "videomenu.contrast", + "videomenu.brightness", + "videomenu.sharpness", + "videomenu.saturation", + "videomenu.hue", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 77c111080..e3c157f98 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -1026,8 +1026,17 @@ printf("CAllUsalsNotifier::changeNotify: %s\n", onoff ? "ON" : "OFF"); return true; } +extern CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[]; bool CAutoModeNotifier::changeNotify(const neutrino_locale_t /*OptionName*/, void * /* data */) { - videoDecoder->SetAutoModes(g_settings.enabled_video_modes); + int i; + int modes[VIDEO_STD_MAX+1]; + + memset(modes, 0, sizeof(int)*VIDEO_STD_MAX+1); + + for(i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_video_modes[i]; + } + videoDecoder->SetAutoModes(modes); return true; } diff --git a/src/system/settings.h b/src/system/settings.h index 26315f33f..52ff9dc5b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -38,7 +38,7 @@ #include -#define VIDEOMENU_VIDEOMODE_OPTION_COUNT 12 /* warning, must be same as VIDEO_STD_MAX */ +#define VIDEOMENU_VIDEOMODE_OPTION_COUNT 12 struct SNeutrinoSettings {