diff --git a/src/gui/cec_setup.cpp b/src/gui/cec_setup.cpp index 8c05e1f5f..6f02dae18 100644 --- a/src/gui/cec_setup.cpp +++ b/src/gui/cec_setup.cpp @@ -47,15 +47,7 @@ #include #include -#if HAVE_SH4_HARDWARE -#include -#include -#include -#include -#include -#else extern cVideo *videoDecoder; -#endif CCECSetup::CCECSetup() { @@ -83,16 +75,6 @@ int CCECSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/) return res; } - -#if HAVE_SH4_HARDWARE -#define VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT 3 -const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_STANDBY_OPTIONS[VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT] = -{ - { 0 , LOCALE_OPTIONS_OFF }, - { 1 , LOCALE_OPTIONS_ON }, - { 2 , LOCALE_VIDEOMENU_HDMI_CEC_STANDBY_NOT_TIMER } -}; -#else #define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3 const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] = { @@ -100,6 +82,7 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_ { VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER }, { VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER } }; + #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE #define VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT 3 const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_VOL_OPTIONS[VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT] = @@ -109,7 +92,6 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_VOL_OPTIONS[VIDEOMENU_HDMI_C { VIDEO_HDMI_CEC_VOL_TV , LOCALE_VIDEOMENU_HDMI_CEC_VOL_TV } }; #endif -#endif int CCECSetup::showMenu() { @@ -118,13 +100,6 @@ int CCECSetup::showMenu() cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC); //cec -#if HAVE_SH4_HARDWARE - CKernelOptions ko; - g_settings.hdmi_cec_mode = ko.isEnabled("cec"); - CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); - cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, &g_settings.hdmi_cec_standby, VIDEOMENU_HDMI_CEC_STANDBY_OPTIONS, VIDEOMENU_HDMI_CEC_STANDBY_OPTION_COUNT, g_settings.hdmi_cec_mode != 0, this); - cec2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_BROADCAST, &g_settings.hdmi_cec_broadcast, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); -#else CMenuOptionChooser *cec_ch = 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); cec_ch->setHint("", LOCALE_MENU_HINT_CEC_MODE); cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, &g_settings.hdmi_cec_view_on, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); @@ -134,13 +109,10 @@ int CCECSetup::showMenu() #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE cec3 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VOLUME, &g_settings.hdmi_cec_volume, VIDEOMENU_HDMI_CEC_VOL_OPTIONS, VIDEOMENU_HDMI_CEC_VOL_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); cec3->setHint("", LOCALE_MENU_HINT_CEC_VOLUME); -#endif #endif cec->addItem(cec_ch); -#if !HAVE_SH4_HARDWARE cec->addItem(GenericMenuSeparatorLine); -#endif //------------------------------------------------------- cec->addItem(cec1); cec->addItem(cec2); @@ -154,32 +126,6 @@ int CCECSetup::showMenu() return res; } -#if HAVE_SH4_HARDWARE -void CCECSetup::setCECSettings(bool b) -{ - printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__); - if (b) { - // wakeup - if (g_settings.hdmi_cec_mode && - ((g_settings.hdmi_cec_standby == 1) || - (g_settings.hdmi_cec_standby == 2 && !CNeutrinoApp::getInstance()->timer_wakeup))) { - int otp = ::open("/proc/stb/cec/onetouchplay", O_WRONLY); - if (otp > -1) { - write(otp, g_settings.hdmi_cec_broadcast ? "f\n" : "0\n", 2); - close(otp); - } - } - } else { - if (g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby) { - int otp = ::open("/proc/stb/cec/systemstandby", O_WRONLY); - if (otp > -1) { - write(otp, g_settings.hdmi_cec_broadcast ? "f\n" : "0\n", 2); - close(otp); - } - } - } -} -#else void CCECSetup::setCECSettings() { printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__); @@ -190,22 +136,9 @@ void CCECSetup::setCECSettings() #endif videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); } -#endif bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) { -#if HAVE_SH4_HARDWARE - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE)) - { - printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__); - cec1->setActive(g_settings.hdmi_cec_mode != 0); - cec2->setActive(g_settings.hdmi_cec_mode != 0); - CKernelOptions ko; - ko.Enable("cec", g_settings.hdmi_cec_mode != 0); - g_settings.hdmi_cec_mode = ko.isEnabled("cec"); - } -#else - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE)) { printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__); @@ -233,7 +166,6 @@ bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/ } #endif } -#endif return false; } diff --git a/src/gui/cec_setup.h b/src/gui/cec_setup.h index 4c41de252..c5aa3f1b5 100644 --- a/src/gui/cec_setup.h +++ b/src/gui/cec_setup.h @@ -46,11 +46,7 @@ class CCECSetup : public CMenuTarget, CChangeObserver public: CCECSetup(); ~CCECSetup(); -#if HAVE_SH4_HARDWARE - void setCECSettings(bool); -#else void setCECSettings(); -#endif int exec(CMenuTarget* parent, const std::string & actionKey); virtual bool changeNotify(const neutrino_locale_t OptionName, void * data); };