diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 62eb2728f..59b9c4036 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -235,9 +235,15 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) TP.feparams.delsys = (delivery_system_t)scansettings.sat_TP_delsys; TP.feparams.modulation = (fe_modulation_t) scansettings.sat_TP_mod; TP.feparams.pilot = (zapit_pilot_t) scansettings.sat_TP_pilot; - TP.feparams.plp_id = atoi(scansettings.sat_TP_pli.c_str()); - TP.feparams.pls_code = atoi(scansettings.sat_TP_plc.c_str()); + TP.feparams.plp_id = (unsigned int)atoi(scansettings.sat_TP_pli.c_str()); + if (TP.feparams.plp_id == 0) + TP.feparams.plp_id = NO_STREAM_ID_FILTER; + TP.feparams.pls_code = (uint32_t)atoi(scansettings.sat_TP_plc.c_str()); + if (TP.feparams.pls_code == 0) + TP.feparams.pls_code = PLS_Default_Gold_Code; TP.feparams.pls_mode = (fe_pls_mode_t) scansettings.sat_TP_plm; + if (TP.feparams.pls_mode == 0) + TP.feparams.pls_mode = PLS_Gold; } else if (CFrontend::isTerr(delsys)) { /* DVB-T. TODO: proper menu and parameter setup, not all "AUTO" */ TP.feparams.frequency = atoi(scansettings.terrestrial_TP_freq.c_str()); @@ -253,7 +259,9 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) TP.feparams.guard_interval = (fe_guard_interval_t)scansettings.terrestrial_TP_guard; TP.feparams.hierarchy = (fe_hierarchy_t)scansettings.terrestrial_TP_hierarchy; TP.feparams.delsys = (delivery_system_t)scansettings.terrestrial_TP_delsys; - TP.feparams.plp_id = atoi(scansettings.terrestrial_TP_pli.c_str()); + TP.feparams.plp_id = (unsigned int)atoi(scansettings.terrestrial_TP_pli.c_str()); + if (TP.feparams.plp_id == 0) + TP.feparams.plp_id = NO_STREAM_ID_FILTER; } else if (CFrontend::isCable(delsys)) { TP.feparams.frequency = atoi(scansettings.cable_TP_freq.c_str()); TP.feparams.symbol_rate = atoi(scansettings.cable_TP_rate.c_str()); diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index af18a8978..b07123466 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1826,7 +1826,7 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc coderateLP->setHint("", LOCALE_MENU_HINT_SCAN_FEC); tm = new CMenuOptionChooser(LOCALE_EXTRA_TP_TRANSMIT_MODE, (int *)&scansettings.terrestrial_TP_transmit_mode, TERRSETUP_SCANTP_TRANSMIT_MODE, TERRSETUP_SCANTP_TRANSMIT_MODE_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++)); tm->setHint("", LOCALE_MENU_HINT_SCAN_TRANSMIT_MODE); - CStringInput *pli = new CStringInput(LOCALE_EXTRA_TP_PLI, &scansettings.terrestrial_TP_pli, 1, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789"); + CStringInput *pli = new CStringInput(LOCALE_EXTRA_TP_PLI, &scansettings.terrestrial_TP_pli, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789"); Pli = new CMenuDForwarder(LOCALE_EXTRA_TP_PLI, true, scansettings.terrestrial_TP_pli, pli, "", CRCInput::convertDigitToKey(shortCut++)); } @@ -2051,7 +2051,7 @@ void CScanSetup::updateManualSettings() scansettings.sat_TP_delsys = tI->second.feparams.delsys; scansettings.sat_TP_mod = tI->second.feparams.modulation; scansettings.satName = CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()); - scansettings.sat_TP_pli = to_string(tI->second.feparams.plp_id); + scansettings.sat_TP_pli = (tI->second.feparams.plp_id == NO_STREAM_ID_FILTER ? "0" : to_string(tI->second.feparams.plp_id)); scansettings.sat_TP_plc = to_string(tI->second.feparams.pls_code); scansettings.sat_TP_plm = tI->second.feparams.pls_mode; } else if (CFrontend::isCable(tI->second.feparams.delsys)) { @@ -2070,7 +2070,7 @@ void CScanSetup::updateManualSettings() scansettings.terrestrial_TP_transmit_mode = tI->second.feparams.transmission_mode; scansettings.terrestrial_TP_coderate_HP = tI->second.feparams.code_rate_HP; scansettings.terrestrial_TP_coderate_LP = tI->second.feparams.code_rate_LP; - scansettings.terrestrial_TP_pli = to_string(tI->second.feparams.plp_id); + scansettings.terrestrial_TP_pli = (tI->second.feparams.plp_id == NO_STREAM_ID_FILTER ? "0" : to_string(tI->second.feparams.plp_id)); scansettings.terrestrialName = CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()); } @@ -2176,7 +2176,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) scansettings.sat_TP_delsys = tmpI->second.feparams.delsys; scansettings.sat_TP_mod = tmpI->second.feparams.modulation; scansettings.sat_TP_pilot = tmpI->second.feparams.pilot; - scansettings.sat_TP_pli = to_string(tmpI->second.feparams.plp_id); + scansettings.sat_TP_pli = (tmpI->second.feparams.plp_id == NO_STREAM_ID_FILTER ? "0" : to_string(tmpI->second.feparams.plp_id)); scansettings.sat_TP_plc = to_string(tmpI->second.feparams.pls_code); scansettings.sat_TP_plm = tmpI->second.feparams.pls_mode; } @@ -2195,7 +2195,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) scansettings.terrestrial_TP_transmit_mode = tmpI->second.feparams.transmission_mode; scansettings.terrestrial_TP_coderate_HP = tmpI->second.feparams.code_rate_HP; scansettings.terrestrial_TP_coderate_LP = tmpI->second.feparams.code_rate_LP; - scansettings.terrestrial_TP_pli = to_string(tmpI->second.feparams.plp_id); + scansettings.terrestrial_TP_pli = (tmpI->second.feparams.plp_id == NO_STREAM_ID_FILTER ? "0" : to_string(tmpI->second.feparams.plp_id)); //scansettings.terrestrialName = CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()); } } diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 122728a73..547fe2662 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -153,7 +153,7 @@ bool CScanSettings::loadSettings(const char * const fileName) sat_TP_delsys = configfile.getInt32("sat_TP_delsys", DVB_S); sat_TP_pilot = configfile.getInt32("sat_TP_pilot", ZPILOT_AUTO); sat_TP_pli = configfile.getString("sat_TP_pli", "0"); - sat_TP_plc = configfile.getString("sat_TP_plc", "1"); + sat_TP_plc = configfile.getString("sat_TP_plc", "0"); sat_TP_plm = configfile.getInt32("sat_TP_plm", 0); cableName = configfile.getString("cableName", cableName); @@ -214,9 +214,18 @@ bool CScanSettings::saveSettings(const char * const fileName) configfile.setInt32("sat_TP_delsys", sat_TP_delsys); configfile.setInt32("sat_TP_mod", sat_TP_mod); configfile.setInt32("sat_TP_pilot", sat_TP_pilot); - configfile.setString("sat_TP_pli", sat_TP_pli); - configfile.setString("sat_TP_plc", sat_TP_plc); - configfile.setInt32("sat_TP_plm", sat_TP_plm); + if (atoi(sat_TP_pli.c_str()) == 0) + { + configfile.setString("sat_TP_pli", "0"); + configfile.setString("sat_TP_plc", "0"); + configfile.setInt32("sat_TP_plm", 0); + } + else + { + configfile.setString("sat_TP_pli", sat_TP_pli); + configfile.setString("sat_TP_plc", sat_TP_plc); + configfile.setInt32("sat_TP_plm", sat_TP_plm); + } configfile.setString("cableName", cableName); configfile.setInt32("cable_TP_fec", cable_TP_fec); @@ -235,7 +244,10 @@ bool CScanSettings::saveSettings(const char * const fileName) configfile.setInt32("terrestrial_TP_guard", terrestrial_TP_guard); configfile.setInt32("terrestrial_TP_transmit_mode", terrestrial_TP_transmit_mode); configfile.setInt32("terrestrial_TP_delsys", terrestrial_TP_delsys); - configfile.setString("terrestrial_TP_pli", terrestrial_TP_pli); + if (atoi(terrestrial_TP_pli.c_str()) == 0) + configfile.setString("terrestrial_TP_pli", "0"); + else + configfile.setString("terrestrial_TP_pli", terrestrial_TP_pli); if(configfile.getModifiedFlag()) configfile.saveConfig(fileName);