From 7d550ed88efe264773a0fd29034de5bb158b6a04 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 8 Jan 2013 20:35:53 +0100 Subject: [PATCH 01/11] neutrino: -add unicabel menu option --- data/locale/deutsch.locale | 5 + data/locale/english.locale | 5 + src/gui/scan_setup.cpp | 152 +++++++++++++++----- src/gui/scan_setup.h | 2 + src/system/locals.h | 5 + src/system/locals_intern.h | 5 + src/zapit/include/zapit/client/zapittypes.h | 3 +- src/zapit/include/zapit/frontend_c.h | 1 - src/zapit/include/zapit/frontend_types.h | 1 + src/zapit/include/zapit/zapit.h | 3 +- src/zapit/src/femanager.cpp | 6 +- src/zapit/src/frontend.cpp | 44 +++--- src/zapit/src/zapit.cpp | 5 - 13 files changed, 175 insertions(+), 62 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1f2f4f965..13c0cb219 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1568,6 +1568,8 @@ satsetup.satellite Satellit satsetup.select_sat Auswahl Satellit satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommitted +satsetup.uni_settings Unicable Einstellungen +satsetup.unicable Unicable satsetup.usals_repeat USALS wiederholen satsetup.use_bat Benutze BAT satsetup.use_fta_flag nur FTA Kanäle @@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (Filmwiedergabe) timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten +unicable.lnb Unicable Eingang +unicable.qrg Unicable Frequenz +unicable.scr Unicable SCR upnpbrowser.head UPnP Browser upnpbrowser.noservers Kein UPnP-Server gefunden upnpbrowser.rescan Neue Suche diff --git a/data/locale/english.locale b/data/locale/english.locale index 222ab4da6..f49f35c98 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1568,6 +1568,8 @@ satsetup.satellite Satellite satsetup.select_sat Select satellites satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommited input +satsetup.uni_settings Unicable Settings +satsetup.unicable Unicable satsetup.usals_repeat USALS command repeat satsetup.use_bat Use BAT satsetup.use_fta_flag just free Channels @@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (movie mode) timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap +unicable.lnb Unicable Input +unicable.qrg Unicable Frequency +unicable.scr Unicable SCR upnpbrowser.head UPnP Browser upnpbrowser.noservers No UPnP servers found upnpbrowser.rescan Scan again diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index fbf007e41..b335afb79 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -96,7 +96,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_ { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, - { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } + { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE } +// { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } }; #define SATSETUP_SCANTP_FEC_COUNT 21 @@ -268,6 +269,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) { return showScanMenuLnbSetup(); } + else if(actionKey=="unisetup") + { + return showUnicableSetup(); + } else if(actionKey=="satfind") { return showScanMenuSatFind(); @@ -481,7 +486,6 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu) setupMenu->addIntroItems(); int count = CFEManager::getInstance()->getFrontendCount(); - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE, (int *)&femode, SATSETUP_FRONTEND_MODE, SATSETUP_FRONTEND_MODE_COUNT, allow_start && (count > 1), this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true); mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE); setupMenu->addItem(mc); @@ -491,13 +495,14 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu) for(int i = 0; i < count; i++) { CFrontend * fe = CFEManager::getInstance()->getFE(i); + frontend_config_t & fe_config = fe->getConfig(); char tmp[32]; snprintf(tmp, sizeof(tmp), "config_frontend%d", i); char name[255]; snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name); - mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE)), NULL, this, tmp, + mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE) || (fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN)), NULL, this, tmp, (i == 0) ? CRCInput::RC_green : CRCInput::RC_yellow, (i == 0) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_YELLOW); mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE); setupMenu->addItem(mf); @@ -550,12 +555,14 @@ int CScanSetup::showFrontendSetup(int number) CMenuWidget * setupMenu = new CMenuWidget(name, NEUTRINO_ICON_SETTINGS, width); setupMenu->setSelected(feselected); setupMenu->addIntroItems(); - - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start, this, CRCInput::convertDigitToKey(shortcut++), "", true); + + bool option_onoff = (number > 0 && fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN) ? false : true; + + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start && option_onoff, this, CRCInput::convertDigitToKey(shortcut++), "", true); mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE); setupMenu->addItem(mc); - ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL); + ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED) && (dmode != DISEQC_UNICABLE), 0, 2, NULL); ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT); setupMenu->addItem(ojDiseqcRepeats); @@ -570,29 +577,32 @@ int CScanSetup::showFrontendSetup(int number) mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE); satToSelect.addItem(mc); } - CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, true, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); + CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, option_onoff, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATADD); setupMenu->addItem(mf); //FIXME why fsatSetup not local variable ? - fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++)); + fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, option_onoff, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++)); fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); setupMenu->addItem(fsatSetup); + uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); + setupMenu->addItem(uniSetup); + setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR)); - CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL); + CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, option_onoff, 0, 64, NULL); nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED); setupMenu->addItem(nc); - mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff); mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V); setupMenu->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff, this); mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL); setupMenu->addItem(mc); - mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, option_onoff, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND); setupMenu->addItem(mf); @@ -606,6 +616,35 @@ int CScanSetup::showFrontendSetup(int number) return res; } +int CScanSetup::showUnicableSetup() +{ + printf("[neutrino] CScanSetup call %s fe %d\n", __func__, fenumber); + + int res = menu_return::RETURN_REPAINT; + CFrontend *fe = CFEManager::getInstance()->getFE(fenumber); + frontend_config_t &fe_config = fe->getConfig(); + int unicable_scr = fe_config.uni_scr; + int unicable_qrg = fe_config.uni_qrg; + + CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7); + CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + + CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); + uni_setup->addIntroItems(); + + uni_setup->addItem(uniscr); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); + uni_setup->addItem(mf); + res = uni_setup->exec(NULL, ""); + delete uni_setup; + if (res) { + fe_config.uni_scr = unicable_scr; + fe_config.uni_qrg = unicable_qrg; + printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg); + } + return res; +} + int CScanSetup::showScanMenuLnbSetup() { printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber); @@ -783,18 +822,31 @@ int CScanSetup::showScanMenuSatFind() void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) { temp_sat->addIntroItems(); + CMenuOptionNumberChooser *diseqc; + CMenuOptionNumberChooser *comm; + CMenuOptionNumberChooser *uncomm; + CMenuOptionNumberChooser *unilnb; + CMenuOptionNumberChooser *motor; + CMenuOptionChooser *usals; + CMenuForwarder *mf; + bool unicable = (dmode == DISEQC_UNICABLE); - CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); - CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); - CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); - CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); - motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); - CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); - usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); - + if (!unicable) { + diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); + comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); + uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); + motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); + motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); + usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); + usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); + }else{ + if (satconfig.diseqc < 0) + satconfig.diseqc = 0; + unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1); + } if(!satconfig.use_usals) all_usals = 0; @@ -802,13 +854,17 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - temp_sat->addItem(diseqc); - temp_sat->addItem(comm); - temp_sat->addItem(uncomm); - temp_sat->addItem(motor); - temp_sat->addItem(usals); + if (!unicable) { + temp_sat->addItem(diseqc); + temp_sat->addItem(comm); + temp_sat->addItem(uncomm); + temp_sat->addItem(motor); + temp_sat->addItem(usals); + } else { + temp_sat->addItem(unilnb); + } - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); + mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL); temp_sat->addItem(mf); mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH); @@ -1110,26 +1166,50 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* } } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) { - printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode); - //FIXME 2 frontends ?? + printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber); + CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); + fe->setDiseqcType((diseqc_t) dmode); + + if(femode != CFEManager::FE_MODE_ALONE) + CFEManager::getInstance()->saveSettings(true); + fautoScanAll->setActive(dmode != NO_DISEQC); - if(dmode == NO_DISEQC) { + uniSetup->setActive(dmode == DISEQC_UNICABLE); + if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) { ojDiseqcRepeats->setActive(false); + if(frontendSetup){ + if(femode == CFEManager::FE_MODE_TWIN && dmode == DISEQC_UNICABLE){ + frontendSetup->setActive(true); + } + else if( femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } + } } else if(dmode < DISEQC_ADVANCED) { ojDiseqcRepeats->setActive(true); + if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } } else if(dmode == DISEQC_ADVANCED) { + if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } ojDiseqcRepeats->setActive(true); } - CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); - fe->setDiseqcType((diseqc_t) dmode); + } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_FE_MODE)) { printf("[neutrino] CScanSetup::%s: fe mode %d \n", __FUNCTION__, femode); /* cable dont have this menu */ - if(frontendSetup) - frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE); + bool twin_unicabel = false; + if(frontendSetup){ + CFrontend * fe = CFEManager::getInstance()->getLiveFE(); + frontend_config_t & fe_config = fe->getConfig(); + twin_unicabel = (femode == CFEManager::FE_MODE_TWIN && fe_config.diseqcType == DISEQC_UNICABLE); + frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE || twin_unicabel); + } CFEManager::getInstance()->setMode((CFEManager::fe_mode_t) femode); /* to copy settings from fe0 */ if(femode != CFEManager::FE_MODE_ALONE) diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index bdc7655e8..e201fc78c 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver CMenuForwarder *fautoScanAll; CMenuForwarder *frontendSetup; CMenuForwarder *fsatSetup; + CMenuForwarder *uniSetup; CMenuOptionNumberChooser * ojDiseqcRepeats; CIntInput * nid; CMenuOptionChooser * lcnhd; @@ -84,6 +85,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver int showFrontendSetup(int number); int showScanMenuLnbSetup(); + int showUnicableSetup(); int showScanMenuSatFind(); void fillSatSelect(CMenuOptionStringChooser *select); void fillCableSelect(CMenuOptionStringChooser *select); diff --git a/src/system/locals.h b/src/system/locals.h index 19f72a907..0ecf8dd6f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1595,6 +1595,8 @@ typedef enum LOCALE_SATSETUP_SELECT_SAT, LOCALE_SATSETUP_SMATVREMOTE, LOCALE_SATSETUP_UNCOMM_INPUT, + LOCALE_SATSETUP_UNI_SETTINGS, + LOCALE_SATSETUP_UNICABLE, LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_FTA_FLAG, @@ -1785,6 +1787,9 @@ typedef enum LOCALE_TIMING_INFOBAR_RADIO, LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, + LOCALE_UNICABLE_LNB, + LOCALE_UNICABLE_QRG, + LOCALE_UNICABLE_SCR, LOCALE_UPNPBROWSER_HEAD, LOCALE_UPNPBROWSER_NOSERVERS, LOCALE_UPNPBROWSER_RESCAN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bebeabfbb..81125c8cf 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1595,6 +1595,8 @@ const char * locale_real_names[] = "satsetup.select_sat", "satsetup.smatvremote", "satsetup.uncomm_input", + "satsetup.uni_settings", + "satsetup.unicable", "satsetup.usals_repeat", "satsetup.use_bat", "satsetup.use_fta_flag", @@ -1785,6 +1787,9 @@ const char * locale_real_names[] = "timing.infobar_radio", "timing.menu", "timing.numericzap", + "unicable.lnb", + "unicable.qrg", + "unicable.scr", "upnpbrowser.head", "upnpbrowser.noservers", "upnpbrowser.rescan", diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index 50d7a0859..3c472f14e 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -39,7 +39,8 @@ typedef enum { DISEQC_1_0, DISEQC_1_1, DISEQC_1_2, - DISEQC_ADVANCED + DISEQC_ADVANCED, + DISEQC_UNICABLE #if 0 , DISEQC_2_0, DISEQC_2_1, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 43cce1eb0..ecafd8b5b 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -184,7 +184,6 @@ class CFrontend }; void configRotor(int _motorRotationSpeed, bool _highVoltage) { config.motorRotationSpeed = _motorRotationSpeed; config.highVoltage = _highVoltage; }; - void configUnicable(int scr, int qrg) { config.uni_scr = scr; config.uni_qrg = qrg; }; frontend_config_t& getConfig() { return config; }; void setConfig(frontend_config_t cfg) { setDiseqcType((diseqc_t) cfg.diseqcType); config = cfg; }; diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h index e703f9b52..1e8fa6a88 100644 --- a/src/zapit/include/zapit/frontend_types.h +++ b/src/zapit/include/zapit/frontend_types.h @@ -34,6 +34,7 @@ typedef struct frontend_config { int diseqcType; int uni_scr; int uni_qrg; + int uni_lnb; int motorRotationSpeed; int highVoltage; } frontend_config_t; diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index aa32ae0b9..7325d8c53 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -70,7 +70,8 @@ typedef struct Zapit_config { int highVoltage; int motorRotationSpeed; int uni_scr; - int uni_qrg; + int uni_qrg; /* the unicable frequency in MHz */ + int uni_lnb; /* the input (0/1) of a twin-position switch */ } t_zapit_config; diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index cabfe7127..f8fa390f2 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -236,8 +236,12 @@ void CFEManager::saveSettings(bool write) INFO("fe%d", fe->fenumber); if(fe->fenumber && mode != FE_MODE_ALONE) { CFrontend * fe0 = getFE(0); - fe->setConfig(fe0->getConfig()); fe->setSatellites(fe0->getSatellites()); + //fe->setConfig(fe0->getConfig()); + fe->config.diseqcType = fe0->config.diseqcType; + fe->config.diseqcRepeats = fe0->config.diseqcRepeats; + fe->config.motorRotationSpeed = fe0->config.motorRotationSpeed; + fe->config.highVoltage = fe0->config.highVoltage; } setConfigValue(fe, "diseqcType", fe_config.diseqcType); diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index c3b6a6a13..d7a948d45 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -159,8 +159,9 @@ CFrontend::CFrontend(int Number, int Adapter) config.diseqcType = NO_DISEQC; config.diseqcRepeats = 0; - config.uni_scr = -1; /* the unicable SCR address, -1 == no unicable */ - config.uni_qrg = 0; /* the unicable frequency in MHz, 0 == from spec */ + config.uni_scr = 0; /* the unicable SCR address 0-7 */ + config.uni_qrg = 0; /* the unicable frequency in MHz */ + config.uni_lnb = 0; /* for two-position switches */ config.highVoltage = false; config.motorRotationSpeed = 0; //in 0.1 degrees per second @@ -699,11 +700,11 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p } - if (config.uni_scr >= 0) + if (config.diseqcType == DISEQC_UNICABLE) cmdseq.props[FREQUENCY].u.data = sendEN50494TuningCommand(feparams->dvb_feparams.frequency, currentToneMode == SEC_TONE_ON, currentVoltage == SEC_VOLTAGE_18, - 0); /* bank 0/1, like mini-diseqc a/b, not impl.*/ + !!config.uni_lnb); cmdseq.num += nrOfProps; @@ -767,7 +768,7 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms) if (currentToneMode == toneMode) return; - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* this is too ugly for words. the "currentToneMode" is the only place where the global "highband" state is saved. So we need to fake it for unicable and still set the tone on... */ @@ -796,7 +797,7 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms) return; printf("[fe%d] voltage %s\n", fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18"); - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* see my comment in secSetTone... */ currentVoltage = voltage; /* need to know polarization for unicable */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */ @@ -854,6 +855,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) case DISEQC_ADVANCED: INFO("fe%d: DISEQC_ADVANCED", fenumber); break; + case DISEQC_UNICABLE: + INFO("fe%d: DISEQC_UNICABLE", fenumber); + break; #if 0 case DISEQC_2_0: INFO("DISEQC_2_0"); @@ -870,7 +874,11 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) + if (newDiseqcType == DISEQC_UNICABLE) { + secSetTone(SEC_TONE_OFF, 0); + secSetVoltage(SEC_VOLTAGE_13, 0); + } + else if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) && (newDiseqcType > MINI_DISEQC))) { secSetTone(SEC_TONE_OFF, 15); sendDiseqcPowerOn(); @@ -972,7 +980,14 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque { sat_iterator_t sit = satellites.find(satellitePosition); + /* unicable uses diseqc parameter for input selection */ + config.uni_lnb = sit->second.diseqc; + setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); + if (config.diseqcType == DISEQC_UNICABLE) + return; + + if (config.diseqcType != DISEQC_ADVANCED) { setDiseqc(sit->second.diseqc, polarization, frequency); return; @@ -994,24 +1009,19 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank) { - uint32_t uni_qrgs[] = { 1284, 1400, 1516, 1632, 1748, 1864, 1980, 2096 }; - uint32_t bpf; - if (config.uni_qrg == 0) - bpf = uni_qrgs[config.uni_scr]; - else - bpf = config.uni_qrg; - + uint32_t bpf = config.uni_qrg; struct dvb_diseqc_master_cmd cmd = { {0xe0, 0x10, 0x5a, 0x00, 0x00, 0x00}, 5 }; unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350; if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8) { - INFO("VOLT18=%d TONE_ON=%d, freq=%d bpf=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, (t + 350) * 4000 - frequency); + uint32_t ret = (t + 350) * 4000 - frequency; + INFO("[unicable] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret); if (!slave && info.type == FE_QPSK) { cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */ (config.uni_scr << 5) | /* adress */ - (bank << 4) | /* not implemented yet */ + (bank << 4) | /* input 0/1 */ (horizontal << 3) | /* horizontal == 0x08 */ (high_band) << 2; /* high_band == 0x04 */ cmd.msg[4] = t & 0xFF; @@ -1020,7 +1030,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); } - return (t + 350) * 4000 - frequency; + return ret; } WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); return 0; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index a50342ec4..896cb9f9d 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -192,8 +192,6 @@ void CZapit::SaveSettings(bool write) configfile.setInt32("diseqcRepeats", live_fe->getDiseqcRepeats()); configfile.setInt32("diseqcType", live_fe->getDiseqcType()); configfile.setInt32("motorRotationSpeed", config.motorRotationSpeed); - configfile.setInt32("uni_scr", config.uni_scr); - configfile.setInt32("uni_qrg", config.uni_qrg); #endif if (configfile.getModifiedFlag()) configfile.saveConfig(CONFIGFILE); @@ -309,8 +307,6 @@ void CZapit::LoadSettings() /* FIXME FE specific, to be removed */ diseqcType = (diseqc_t)configfile.getInt32("diseqcType", NO_DISEQC); config.motorRotationSpeed = configfile.getInt32("motorRotationSpeed", 18); // default: 1.8 degrees per second - config.uni_scr = configfile.getInt32("uni_scr", -1); - config.uni_qrg = configfile.getInt32("uni_qrg", 0); printf("[zapit.cpp] diseqc type = %d\n", diseqcType); @@ -336,7 +332,6 @@ void CZapit::ConfigFrontend() if(!CFEManager::getInstance()->configExist()) { INFO("New frontend config not exist"); fe->configRotor(config.motorRotationSpeed, config.highVoltage); - fe->configUnicable(config.uni_scr, config.uni_qrg); fe->setDiseqcType(diseqcType); fe->setDiseqcRepeats(configfile.getInt32("diseqcRepeats", 0)); fe->setRotorSatellitePosition(configfile.getInt32("lastSatellitePosition", 0)); From f912b7096c1d886c9670834d7350cabb5e10f750 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 9 Jan 2013 17:37:36 +0100 Subject: [PATCH 02/11] bouqueteditor:-fix paint infox box --- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 86cf9a28d..e951bbed3 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -222,7 +222,7 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) //infobox if (ibox == NULL) ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false); - ibox->paint(false); + ibox->paint(false,true); } } diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 9eadfe56c..7abb90115 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -254,7 +254,7 @@ void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) //infobox if (ibox == NULL) ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false); - ibox->paint(false); + ibox->paint(false,true); } } From 28c0525e14b9f599e5e55df91c4b6b9350929787 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 22 Oct 2012 19:15:07 +0100 Subject: [PATCH 03/11] * yWeb: Update timer sync for tvinfo.de --- src/nhttpd/web/Y_EPG.js | 2 +- src/nhttpd/web/Y_Tools_Timer_Sync.js | 70 ++++++++++++++-------------- src/nhttpd/web/scripts/Y_Tools.sh | 2 +- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js index fbac42d1e..ba6db44ca 100644 --- a/src/nhttpd/web/Y_EPG.js +++ b/src/nhttpd/web/Y_EPG.js @@ -64,7 +64,7 @@ function show_epg_item(_index){ var logo =epg_data[_index][7]; $('d_logo').update( (logo!="")?"":"" ); var imdb_link = 'IMDb'; - var klack_link = 'klack.de'; + var klack_link = 'klack.de'; var tvinfo_link = 'tvinfo.de'; $('d_lookup').update(imdb_link+" "+klack_link+" "+tvinfo_link); diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.js b/src/nhttpd/web/Y_Tools_Timer_Sync.js index 2a049bdb4..b21a68398 100644 --- a/src/nhttpd/web/Y_Tools_Timer_Sync.js +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.js @@ -72,44 +72,38 @@ function processReqChange() if (document.f.planer[0].checked == true) { var xml = g_req.responseXML; - var recProg_NodeList = xml.getElementsByTagName('recProg'); + var recProg_NodeList = xml.getElementsByTagName('epg_schedule')[0].childNodes; - for(i=0;i0) - sLog_addRow(sLog_body, "green", "Analyze "+recProg_NodeList.length+" Timers", "finished"); + if(counter > 0) + sLog_addRow(sLog_body, "green", "Analyze "+counter+" Timers", "finished"); else sLog_addRow(sLog_body, "yellow", "No Timers found", "finished"); } @@ -274,20 +268,24 @@ function do_set_timer() if(Ergebnis) channel_name = RegExp.$1; } + + var tmpTime = rowNode.childNodes[2].firstChild.nodeValue; + var alTime = tmpTime.replace(/:/gi,"."); + tmpTime = rowNode.childNodes[4].firstChild.nodeValue; + var stTime = tmpTime.replace(/:/gi,"."); + var _urlt = "/control/timer?action=new&alDate="+rowNode.childNodes[1].firstChild.nodeValue - +"&alTime="+rowNode.childNodes[2].firstChild.nodeValue + +"&alTime="+alTime +"&stDate="+rowNode.childNodes[3].firstChild.nodeValue - +"&stTime="+rowNode.childNodes[4].firstChild.nodeValue + +"&stTime="+stTime +"&channel_name="+channel_name +"&rec_dir="+document.f.rec_dir.value +"&rs=1" +"&update=1"; -// _url = _urlt.replace(/:/gi,"."); _url = encodeURI(_urlt); loadSyncURL(_url); channels++; if(document.f.debug.checked) - /*sLog_addRow(sLog_body, "green", "Sync Timer to box: "+channel_name+" "+rowNode.childNodes[6].firstChild.nodeValue, "added");*/ sLog_addRow(sLog_body, "green", "Sync Timer to box url: "+_url, "added"); } } diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index 06925d3bc..5d5eb37e9 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -560,7 +560,7 @@ case "$1" in timer_get_tvinfo) shift 1 rm -r /tmp/tvinfo.xml - res=`wget -O /tmp/tvinfo.xml "http://www.tvinfo.de/share/vidac/rec_info.php?username=$1&password=$2" 2>&1` + res=$(wget -O /tmp/tvinfo.xml "http://www.tvinfo.de/share/openepg/schedule.php?username=$1&password=$2" 2>&1) if ! [ -s /tmp/tvinfo.xml ] then res="$res File empty!" From 6b9045def9512295cbb2172e9ef3743f3df200de Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Fri, 11 Jan 2013 18:58:34 +0100 Subject: [PATCH 04/11] * yWeb: Because of format changes klack.de temporarily disabled --- src/nhttpd/web/Y_Settings_Timer.yhtm | 6 ++++-- src/nhttpd/web/Y_Tools_Timer_Sync.yhtm | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index bd9a69344..e7897b78c 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -5,8 +5,8 @@ // @@ -31,6 +31,7 @@ function do_submit() { {=L:set.timer.password=} + {=L:set.timer.channel_name_replacelist=} diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm index d4159530a..5b75bedd3 100644 --- a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm @@ -14,9 +14,8 @@
- TVInfo
- Klack - + TVInfo
+