From 8ebd8cc69af900affea2a3e737ae19e68dde2302 Mon Sep 17 00:00:00 2001 From: focus Date: Fri, 28 May 2010 09:16:03 +0000 Subject: [PATCH] More cec options for future, not ready git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@604 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/daemonc/remotecontrol.cpp | 2 +- src/gui/infoviewer.cpp | 2 -- src/gui/motorcontrol.cpp | 1 - src/gui/scan.cpp | 1 - src/neutrino.cpp | 36 ++++++++++++++++++++ src/neutrino_menue.cpp | 62 ++++++++++++++++++++++++++++----- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/setting_helpers.h | 1 + src/system/settings.cpp | 64 ----------------------------------- src/system/settings.h | 4 ++- src/videosettings.h | 1 + 12 files changed, 99 insertions(+), 79 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 98a492f3b..b238151fb 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -290,7 +290,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data #endif t_channel_id * p = new t_channel_id; *p = current_channel_id; - g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTPIDS, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory + g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTPIDS, (const neutrino_msg_data_t)p, false); processAPIDnames(); } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f4ebd68a6..1efcc163b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1105,8 +1105,6 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch return info; } -#define get_set CNeutrinoApp::getInstance()->getScanSettings() - void CInfoViewer::showSNR () { char percent[10]; diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index f8ff4961e..a76f23cdf 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -60,7 +60,6 @@ static int moving = 0; #define BAR_WIDTH 100 #define BAR_HEIGHT 16 //(13 + BAR_BORDER*2) -#define get_set CNeutrinoApp::getInstance()->getScanSettings() CMotorControl::CMotorControl() { Init(); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 4d82d264f..509f04b8f 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -85,7 +85,6 @@ extern int scan_pids; extern int scan_fta_flag;//in zapit descriptors definiert extern int start_fast_scan(int scan_mode, int opid); -#define get_set CNeutrinoApp::getInstance()->getScanSettings() int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) { diseqc_t diseqcType = NO_DISEQC; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a8b48165f..358c00f08 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -125,6 +125,7 @@ #include #include +#include #include #include @@ -176,6 +177,7 @@ extern int zapit_ready; static pthread_t zapit_thread ; void * zapit_main_thread(void *data); extern t_channel_id live_channel_id; //zapit +extern CZapitChannel *channel; void setZapitConfig(Zapit_config * Cfg); void getZapitConfig(Zapit_config *Cfg); @@ -191,6 +193,7 @@ extern bool timeset; // sectionsd extern cVideo * videoDecoder; extern cAudio * audioDecoder; +extern CFrontend * frontend; cPowerManager *powerManager; cCpuFreqManager * cpuFreq; @@ -755,6 +758,8 @@ int CNeutrinoApp::loadSetup(const char * fname) 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.hdmi_cec_view_on = configfile.getInt32("hdmi_cec_view_on", 0); // default off + g_settings.hdmi_cec_standby = configfile.getInt32("hdmi_cec_standby", 0); // default off g_settings.video_Format = configfile.getInt32("video_Format", 3); g_settings.video_43mode = configfile.getInt32("video_43mode", 0); @@ -1294,6 +1299,8 @@ void CNeutrinoApp::saveSetup(const char * fname) 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( "hdmi_cec_view_on", g_settings.hdmi_cec_view_on ); + configfile.setInt32( "hdmi_cec_standby", g_settings.hdmi_cec_standby ); configfile.setInt32( "current_volume", g_settings.current_volume ); configfile.setInt32( "channel_mode", g_settings.channel_mode ); @@ -2988,6 +2995,7 @@ printf("[neutrino] direct record\n"); } } +extern CZapitChannel *channel; int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -3023,6 +3031,34 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) SelectSubtitles(); if(!g_InfoViewer->is_visible) StartSubtitles(); + + /* update scan settings for manual scan to current channel */ + if(channel) { + sat_iterator_t sit = satellitePositions.find(channel->getSatellitePosition()); + if(sit != satellitePositions.end()) + strncpy(get_set.satNameNoDiseqc, sit->second.name.c_str(), 50); + + transponder_list_t::iterator tI; + tI = transponders.find(channel->getTransponderId()); + if(tI != transponders.end()) { + sprintf(get_set.TP_freq, "%d", tI->second.feparams.frequency); + switch (frontend->getInfo()->type) { + case FE_QPSK: + sprintf(get_set.TP_rate, "%d", tI->second.feparams.u.qpsk.symbol_rate); + get_set.TP_fec = tI->second.feparams.u.qpsk.fec_inner; + get_set.TP_pol = tI->second.polarization; + break; + case FE_QAM: + sprintf(get_set.TP_rate, "%d", tI->second.feparams.u.qam.symbol_rate); + get_set.TP_fec = tI->second.feparams.u.qam.fec_inner; + get_set.TP_mod = tI->second.feparams.u.qam.modulation; + break; + case FE_OFDM: + case FE_ATSC: + break; + } + } + } } if ((msg == NeutrinoMessages::EVT_TIMER)) { if(data == shift_timer) { diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 16a45fe2a..ef3e388d1 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -164,8 +164,6 @@ extern bool autoshift; static CTimingSettingsNotifier timingsettingsnotifier; -#define get_set CNeutrinoApp::getInstance()->getScanSettings() - int safe_mkdir(char * path); #define OPTIONS_OFF0_ON1_OPTION_COUNT 2 @@ -297,6 +295,12 @@ CVideoSettings::CVideoSettings() : CMenuWidget(LOCALE_VIDEOMENU_HEAD, NEUTRINO_I 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)); + 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); + cec2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, &g_settings.hdmi_cec_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this); + + addItem(cec1); + addItem(cec2); + CMenuWidget* menu = new CMenuWidget(LOCALE_VIDEOMENU_ENABLED_MODES, NEUTRINO_ICON_SETTINGS); 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)); @@ -333,10 +337,11 @@ void CVideoSettings::nextMode(void) text = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].valname; while(1) { + CVFD::getInstance()->ShowText((char *)text); int res = ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); if(disp_cur && res != messages_return::handled) - return; + break; disp_cur = 0; @@ -349,21 +354,25 @@ void CVideoSettings::nextMode(void) if (g_settings.enabled_video_modes[curmode]) break; i++; - if (i >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) + if (i >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) { + CVFD::getInstance()->showServicename(g_RemoteControl->getCurrentChannelName()); return; + } } text = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].valname; } else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; - CVFD::getInstance()->ShowText((char *)text); + //CVFD::getInstance()->ShowText((char *)text); videoDecoder->SetVideoSystem(g_settings.video_Mode); - return; + //return; + disp_cur = 1; } else - return; + break; } + CVFD::getInstance()->showServicename(g_RemoteControl->getCurrentChannelName()); //ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); } @@ -426,8 +435,20 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void *) } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE)) { + cec1->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF); + cec2->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF); videoDecoder->SetCEC((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); } +#if 0 + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_STANDBY)) + { + videoDecoder->enableCECStandby(g_settings.hdmi_cec_standby); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON)) + { + videoDecoder->enableCECView(g_settings.hdmi_cec_view_on); + } +#endif else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_DBDR)) { videoDecoder->SetDBDR(g_settings.video_dbdr); @@ -691,7 +712,10 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings { #ifdef TEST_MENU - TestMenu = new CMenuWidget("Test menu"); + char rev[255]; + sprintf(rev, "Test menu, System revision %d %s\n", system_rev, system_rev == 0 ? "WARNING - INVALID" : ""); + + TestMenu = new CMenuWidget(rev /*"Test menu"*/); CTestMenu * testHandler = new CTestMenu(); TestMenu->addItem(new CMenuForwarderNonLocalized("VFD", true, NULL, testHandler, "vfd")); TestMenu->addItem(new CMenuForwarderNonLocalized("Network", true, NULL, testHandler, "network")); @@ -793,6 +817,15 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); CDataResetNotifier * resetNotifier = new CDataResetNotifier(); + CMenuWidget * mset = new CMenuWidget(LOCALE_MAINSETTINGS_MANAGE, NEUTRINO_ICON_SETTINGS); + addMenueIntroItems(*mset); + + mset->addItem(new CMenuForwarder(LOCALE_RESET_SETTINGS , true, NULL, resetNotifier, "settings")); + mset->addItem(new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig")); + mset->addItem(new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig")); + + mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, mset)); + //mainSettings.addItem(new CMenuForwarder(LOCALE_RESET_SETTINGS , true, NULL, resetNotifier, "settings")); mainSettings.addItem(GenericMenuSeparatorLine); @@ -823,6 +856,7 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainSettings.addItem(new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, new CHDDMenuHandler())); //mainSettings.addItem(new CMenuForwarder(LOCALE_CAM_SETTINGS, true, NULL, g_CamHandler)); +#if 0 CMenuWidget * mset = new CMenuWidget(LOCALE_MAINSETTINGS_MANAGE, NEUTRINO_ICON_SETTINGS); addMenueIntroItems(*mset); @@ -832,6 +866,7 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mset->addItem(new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig")); mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, mset)); +#endif #ifdef TEST_MENU mainMenu.addItem(new CMenuForwarderNonLocalized("Test menu", true, NULL, TestMenu)); #endif @@ -976,6 +1011,7 @@ public: int exec(CMenuTarget* parent, const std::string &actionkey); }; +extern CZapitChannel *channel; extern std::map select_transponders; int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { @@ -1030,7 +1066,14 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ case FE_ATSC: break; } - menu->addItem(new CMenuForwarderNonLocalized(buf, true, NULL, selector, cnt), old_selected == i); + if(!old_selected && channel && channel->getSatellitePosition() == position) { + if(channel->getFreqId() == GET_FREQ_FROM_TPID(tI->first)) { + old_selected = i; + } + } + + //menu->addItem(new CMenuForwarderNonLocalized(buf, true, NULL, selector, cnt), old_selected == i); + menu->addItem(new CMenuForwarderNonLocalized(buf, true, NULL, selector, cnt), false); tmplist.insert(std::pair (i, tI->second)); i++; } @@ -1040,6 +1083,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, text, 450, 2); return menu_return::RETURN_REPAINT; } + menu->setSelected(old_selected); int retval = menu->exec(NULL, ""); delete menu; delete selector; diff --git a/src/system/locals.h b/src/system/locals.h index c90056abd..5eb105410 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1198,6 +1198,8 @@ typedef enum { LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF, LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER, LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER, + LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, + LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, 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 d883fd162..e7f405312 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1198,6 +1198,8 @@ const char *locale_real_names[] = { "videomenu.hdmi_cec_mode_off", "videomenu.hdmi_cec_mode_tuner", "videomenu.hdmi_cec_mode_recorder", + "videomenu.hdmi_cec_standby", + "videomenu.hdmi_cec_view_on", "videomenu.dbdr", "videomenu.dbdr_none", "videomenu.dbdr_deblock", diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index e458b8cdf..0b12f2977 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -317,4 +317,5 @@ class CAllUsalsNotifier : public CChangeObserver public: bool changeNotify(const neutrino_locale_t, void * data); }; + #endif diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 3f777a26b..8c290bcff 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -55,70 +55,6 @@ CScanSettings::CScanSettings(void) satNameNoDiseqc[0] = 0; } -void CScanSettings::toSatList( CZapitClient::ScanSatelliteList& /*satList*/) const -{ -#if 0 - satList.clear(); - CZapitClient::commandSetScanSatelliteList sat; - - sat.diseqc = 0; - strncpy(sat.satName, satNameNoDiseqc, 30); - - if(diseqcMode == DISEQC_1_2) - sat.diseqc = -1; - - if((scan_mode == 2) || (diseqcMode == DISEQC_1_2)) { - for (int i = 0; i < MAX_SATELLITES; i++) { - if (!strcmp(satName[i], satNameNoDiseqc)) { - if (satDiseqc[i] != -1) - sat.diseqc = satDiseqc[i]; - break; - } - } - } - satList.push_back(sat); -#endif -#if 0 - if (scan_mode == 2) { - strncpy(sat.satName, satNameNoDiseqc, 30); - sat.diseqc = 0; - for (int i = 0; i < MAX_SATELLITES; i++) { - if (!strcmp(satName[i], satNameNoDiseqc)) { - if (satDiseqc[i] != -1) - sat.diseqc = satDiseqc[i]; - break; - } - } - satList.push_back(sat); - } - else if (diseqcMode == NO_DISEQC) { - strncpy(sat.satName, satNameNoDiseqc, 30); - sat.diseqc = 0; - satList.push_back(sat); - } - else if (diseqcMode == DISEQC_1_2) { - strncpy(sat.satName, satNameNoDiseqc, 30); - sat.diseqc = -1; - for (int i = 0; i < MAX_SATELLITES; i++) { - if (!strcmp(satName[i], satNameNoDiseqc)) { - if (satDiseqc[i] != -1) - sat.diseqc = satDiseqc[i]; - break; - } - } - satList.push_back(sat); - } else { // scan all sats with configured diseqc - for( int i = 0; i < MAX_SATELLITES; i++) { - if (satDiseqc[i] != -1) { - strncpy(sat.satName, satName[i], 30); - sat.diseqc = satDiseqc[i]; - satList.push_back(sat); - } - } - } -#endif -} - void CScanSettings::useDefaults(const delivery_system_t _delivery_system) { delivery_system = _delivery_system; diff --git a/src/system/settings.h b/src/system/settings.h index 8c73f8955..bd964640f 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -87,6 +87,8 @@ struct SNeutrinoSettings //video int video_dbdr; int hdmi_cec_mode; + int hdmi_cec_view_on; + int hdmi_cec_standby; int enabled_video_modes[VIDEOMENU_VIDEOMODE_OPTION_COUNT]; int cpufreq; int standby_cpufreq; @@ -532,6 +534,7 @@ const int PARENTALLOCK_PROMPT_CHANGETOLOCKED = 2; const int PARENTALLOCK_PROMPT_ONSIGNAL = 3; #define MAX_SATELLITES 80 +#define get_set CNeutrinoApp::getInstance()->getScanSettings() class CScanSettings { @@ -556,7 +559,6 @@ public: CScanSettings(); - void toSatList( CZapitClient::ScanSatelliteList& ) const; void useDefaults(const delivery_system_t _delivery_system); bool loadSettings(const char * const fileName, const delivery_system_t _delivery_system); bool saveSettings(const char * const fileName); diff --git a/src/videosettings.h b/src/videosettings.h index ba2252431..ab0978019 100644 --- a/src/videosettings.h +++ b/src/videosettings.h @@ -4,6 +4,7 @@ class CVideoSettings : public CMenuWidget, CChangeObserver { CMenuForwarder * SyncControlerForwarder; + CMenuOptionChooser * cec1, *cec2; CMenuOptionChooser * VcrVideoOutSignalOptionChooser; /*CRGBCSyncControler RGBCSyncControler;*/ int vcr_video_out_signal;