diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 19672652f..a8b48165f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -754,6 +754,7 @@ int CNeutrinoApp::loadSetup(const char * fname) prev_video_mode = g_settings.video_Mode; g_settings.analog_mode1 = configfile.getInt32("analog_mode1", 0); // default RGB g_settings.analog_mode2 = configfile.getInt32("analog_mode2", 0); // default RGB + g_settings.hdmi_cec_mode = configfile.getInt32("hdmi_cec_mode", 0); // default off g_settings.video_Format = configfile.getInt32("video_Format", 3); g_settings.video_43mode = configfile.getInt32("video_43mode", 0); @@ -1292,6 +1293,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "analog_mode2", g_settings.analog_mode2 ); configfile.setInt32( "video_Format", g_settings.video_Format ); configfile.setInt32( "video_43mode", g_settings.video_43mode ); + configfile.setInt32( "hdmi_cec_mode", g_settings.hdmi_cec_mode ); + configfile.setInt32( "current_volume", g_settings.current_volume ); configfile.setInt32( "channel_mode", g_settings.channel_mode ); configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 543d774e2..16a45fe2a 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -238,6 +238,14 @@ const CMenuOptionChooser::keyval VIDEOMENU_43MODE_OPTIONS[VIDEOMENU_43MODE_OPTIO //{ 2, LOCALE_VIDEOMENU_AUTO } // whatever is this auto mode, it seems its totally broken }; +#define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3 +const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] = +{ + { VIDEO_HDMI_CEC_MODE_OFF , LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF }, + { VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER }, + { VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER }, +}; + /* numbers corresponding to video.cpp from zapit */ //#define VIDEOMENU_VIDEOMODE_OPTION_COUNT 11 const CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_OPTION_COUNT] = @@ -287,6 +295,7 @@ CVideoSettings::CVideoSettings() : CMenuWidget(LOCALE_VIDEOMENU_HEAD, NEUTRINO_I addItem(new CMenuOptionChooser(LOCALE_VIDEOMENU_43MODE, &g_settings.video_43mode, VIDEOMENU_43MODE_OPTIONS, VIDEOMENU_43MODE_OPTION_COUNT, true, this)); addItem(new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOMODE, &g_settings.video_Mode, VIDEOMENU_VIDEOMODE_OPTIONS, VIDEOMENU_VIDEOMODE_OPTION_COUNT, true, this, CRCInput::RC_nokey, "", true)); addItem(new CMenuOptionChooser(LOCALE_VIDEOMENU_DBDR, &g_settings.video_dbdr, VIDEOMENU_DBDR_OPTIONS, VIDEOMENU_DBDR_OPTION_COUNT, true, this)); + addItem(new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this)); CMenuWidget* menu = new CMenuWidget(LOCALE_VIDEOMENU_ENABLED_MODES, NEUTRINO_ICON_SETTINGS); for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) @@ -415,6 +424,10 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void *) { videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode2); } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE)) + { + videoDecoder->SetCEC((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); + } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_DBDR)) { videoDecoder->SetDBDR(g_settings.video_dbdr); diff --git a/src/system/locals.h b/src/system/locals.h index b7665e719..c90056abd 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1194,6 +1194,10 @@ typedef enum { LOCALE_VIDEOMENU_ANALOG_MODE_HD_YPRPB_CINCH, LOCALE_VIDEOMENU_SCART, LOCALE_VIDEOMENU_CINCH, + LOCALE_VIDEOMENU_HDMI_CEC_MODE, + LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF, + LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER, + LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER, LOCALE_VIDEOMENU_DBDR, LOCALE_VIDEOMENU_DBDR_NONE, LOCALE_VIDEOMENU_DBDR_DEBLOCK, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d164af67f..d883fd162 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1194,6 +1194,10 @@ const char *locale_real_names[] = { "videomenu.analog_hd_yprpb_cinch", "videomenu.scart", "videomenu.cinch", + "videomenu.hdmi_cec_mode", + "videomenu.hdmi_cec_mode_off", + "videomenu.hdmi_cec_mode_tuner", + "videomenu.hdmi_cec_mode_recorder", "videomenu.dbdr", "videomenu.dbdr_none", "videomenu.dbdr_deblock", diff --git a/src/system/settings.h b/src/system/settings.h index 2544c4f4e..8c73f8955 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -84,7 +84,9 @@ struct SNeutrinoSettings int hdmi_dd; int spdif_dd; int analog_out; + //video int video_dbdr; + int hdmi_cec_mode; int enabled_video_modes[VIDEOMENU_VIDEOMODE_OPTION_COUNT]; int cpufreq; int standby_cpufreq;