scansetup: add DVB-T

Conflicts:
	src/gui/scan_setup.cpp
	src/gui/scan_setup.h


Origin commit data
------------------
Commit: 1a4f65302e
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-05-12 (Sun, 12 May 2013)
This commit is contained in:
Stefan Seyfried
2013-05-12 02:47:00 +02:00
committed by [CST] Focus
parent 2bfe31821f
commit 02fc993e74
3 changed files with 79 additions and 25 deletions

View File

@@ -310,7 +310,12 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
std::string scants_key[] = {"all", "manual", "test", "fast", "auto"/*doesn't exists in CScanTs!*/};
if (actionKey.size() > 1) {
int delsys = actionKey[0] == 's' ? FE_QPSK : FE_QAM;
int delsys;
switch (actionKey[0]) {
case 's': delsys = FE_QPSK; break;
case 't': delsys = FE_OFDM; break;
default: delsys = FE_QAM; break;
}
std::string as = actionKey.substr(1);
printf("[neutrino] CScanSetup::%s scan %c in %s mode...\n", __FUNCTION__, actionKey[0], as.c_str());
for (uint i=0; i< (sizeof(scants_key)/sizeof(scants_key[0])); i++)
@@ -368,6 +373,7 @@ int CScanSetup::showScanMenu()
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
int shortcut = 1;
int w = getSatMenuListWidth();
printf("C: %d S: %d T: %d\n", CFEManager::getInstance()->haveCable(),CFEManager::getInstance()->haveSat(), CFEManager::getInstance()->haveTerr());
CMenuForwarder * mf;
CMenuOptionChooser * mc;
@@ -956,17 +962,20 @@ void CScanSetup::fillSatSelect(CMenuOptionStringChooser * select)
//init cable provider menu
void CScanSetup::fillCableSelect(CMenuOptionStringChooser * select)
{
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
const char *what = r_system == DVB_C ? "cable" : "terrestrial";
printf("[neutrino] CScanSetup call %s (%s)...\n", __func__, what);
//don't misunderstand the name "satSelect", in this context it's actually for cable providers
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
bool sfound = false;
std::string fname;
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); sit++)
{
if (sit->second.deltype != FE_QAM)
if (r_system == DVB_C && sit->second.deltype != FE_QAM)
continue;
if (r_system == DVB_T && sit->second.deltype != FE_OFDM)
continue;
printf("Adding cable menu for %s position %d\n", sit->second.name.c_str(), sit->first);
printf("Adding %s menu for %s position %d\n", what, sit->second.name.c_str(), sit->first);
select->addOption(sit->second.name.c_str());
if (fname.empty())
@@ -975,10 +984,14 @@ void CScanSetup::fillCableSelect(CMenuOptionStringChooser * select)
if (!sfound && (scansettings.cableName == sit->second.name))
sfound = true;
dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str());
dprintf(DEBUG_DEBUG, "got scanprovider (%s): %s\n", what, sit->second.name.c_str());
}
if (!sfound && !fname.empty()) {
if (r_system == DVB_C)
scansettings.cableName = fname;
if (r_system == DVB_T)
scansettings.terrName = fname;
}
if (!sfound && !fname.empty())
scansettings.cableName = fname;
}
int CScanSetup::showScanMenuSatFind()
@@ -1062,7 +1075,7 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon
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{
} else {
if (satconfig.diseqc < 0)
satconfig.diseqc = 0;
unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1);
@@ -1102,8 +1115,10 @@ void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
CMenuForwarder * mf;
manual_Scan->addIntroItems();
const char *act_test, *act_manual;
//----------------------------------------------------------------------
if (r_system == DVB_C) {
act_test = "ctest"; act_manual = "cmanual";
CMenuOptionStringChooser * cableSelect = new CMenuOptionStringChooser(LOCALE_CABLESETUP_PROVIDER, &scansettings.cableName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
cableSelect->setHint("", LOCALE_MENU_HINT_SCAN_CABLE);
fillCableSelect(cableSelect);
@@ -1112,7 +1127,15 @@ void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
mf->setHint("", LOCALE_MENU_HINT_SCAN_NID);
manual_Scan->addItem(mf);
mf = new CMenuDForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler(), "cable", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
} else if (r_system == DVB_T) {
act_test = "ttest"; act_manual = "tmanual";
CMenuOptionStringChooser * terrSelect = new CMenuOptionStringChooser(LOCALE_TERRESTRIALSETUP_PROVIDER, &scansettings.terrName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
//terrSelect->setHint("", LOCALE_MENU_HINT_SCAN_CABLE);
fillCableSelect(terrSelect);
manual_Scan->addItem(terrSelect);
mf = new CMenuDForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler(), "terrestrial", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
} else {
act_test = "stest"; act_manual = "smanual";
CMenuOptionStringChooser * satSelect = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, &scansettings.satName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
satSelect->setHint("", LOCALE_MENU_HINT_SCAN_SATELLITE);
/* add configured satellites to satSelect */
@@ -1131,11 +1154,11 @@ void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
//----------------------------------------------------------------------
manual_Scan->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_SCANTS_TEST, allow_start, NULL, this, r_system == DVB_C ? "ctest" : "stest", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
mf = new CMenuForwarder(LOCALE_SCANTS_TEST, allow_start, NULL, this, act_test, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
mf->setHint("", LOCALE_MENU_HINT_SCAN_TEST);
manual_Scan->addItem(mf);
mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, r_system == DVB_C ? "cmanual" : "smanual", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, act_manual, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
mf->setHint("", LOCALE_MENU_HINT_SCAN_START);
manual_Scan->addItem(mf);
}
@@ -1206,6 +1229,7 @@ void CScanSetup::addScanMenuAutoScan(CMenuWidget *auto_Scan)
CMenuForwarder * mf;
auto_Scan->addIntroItems();
const char *action;
if (r_system == DVB_C) { //cable
CMenuOptionStringChooser * cableSelect = new CMenuOptionStringChooser(LOCALE_CABLESETUP_PROVIDER, &scansettings.cableName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
cableSelect->setHint("", LOCALE_MENU_HINT_SCAN_CABLE);
@@ -1214,12 +1238,20 @@ void CScanSetup::addScanMenuAutoScan(CMenuWidget *auto_Scan)
mf = new CMenuForwarder(LOCALE_SATSETUP_CABLE_NID, true, nid->getValue(), nid);
mf->setHint("", LOCALE_MENU_HINT_SCAN_NID);
auto_Scan->addItem(mf);
action = "cauto";
} else if (r_system == DVB_T) {
CMenuOptionStringChooser * terrSelect = new CMenuOptionStringChooser(LOCALE_TERRESTRIALSETUP_PROVIDER, &scansettings.terrName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
//terrSelect->setHint("", LOCALE_MENU_HINT_SCAN_CABLE);
fillCableSelect(terrSelect);
auto_Scan->addItem(terrSelect);
action = "tauto";
} else {
CMenuOptionStringChooser * satSelect = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, &scansettings.satName, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
satSelect->setHint("", LOCALE_MENU_HINT_SCAN_SATELLITE);
/* add configured satellites to satSelect */
fillSatSelect(satSelect);
auto_Scan->addItem(satSelect);
action = "sauto";
}
auto_Scan->addItem(GenericMenuSeparatorLine);
@@ -1227,7 +1259,7 @@ void CScanSetup::addScanMenuAutoScan(CMenuWidget *auto_Scan)
addListFlagsItems(auto_Scan, 1);
//----------------------------------------------------------------------
auto_Scan->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, r_system == DVB_C ? "cauto" : "sauto", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
mf = new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, action, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
mf->setHint("", LOCALE_MENU_HINT_SCAN_START);
auto_Scan->addItem(mf);
}
@@ -1322,10 +1354,10 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
Rate->setHint("", LOCALE_MENU_HINT_SCAN_RATE);
mod_pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_MOD, (int *)&scansettings.cable_TP_mod, SATSETUP_SCANTP_MOD, SATSETUP_SCANTP_MOD_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
mod_pol->setHint("", LOCALE_MENU_HINT_SCAN_MOD);
} else if (r_system == DVB_T) {
CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, &scansettings.terr_TP_freq, 6, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
Freq = new CMenuDForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.terr_TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
Freq->setHint("", LOCALE_MENU_HINT_SCAN_FREQ);
} else if (r_system == DVB_T) {
CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, &scansettings.terr_TP_freq, 6, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
Freq = new CMenuDForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.terr_TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
Freq->setHint("", LOCALE_MENU_HINT_SCAN_FREQ);
}
options_menu->addItem(Freq);
@@ -1547,6 +1579,8 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey)
std::string name;
if (actionkey == "sat")
name = scansettings.satName;
else if (actionkey == "terrestrial")
name = scansettings.terrName;
else
name = scansettings.cableName;
@@ -1619,6 +1653,8 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey)
scansettings.cable_TP_mod = tmpI->second.feparams.dvb_feparams.u.qam.modulation;
break;
case FE_OFDM:
scansettings.terr_TP_freq = to_string(tmpI->second.feparams.dvb_feparams.frequency);
break;
case FE_ATSC:
break;
}