mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
*neutrino scansettings: moved scan setup into it's own modul
this was a port of original tuxbox neutrino as a as similar for stand alone modules, hope it' works, but bugs are not excluded git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1331 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
#include "gui/pluginlist.h"
|
||||
#include "gui/plugins.h"
|
||||
#include "gui/record_setup.h"
|
||||
#include "gui/scan.h"
|
||||
#include "gui/scan_setup.h"
|
||||
#include "gui/sleeptimer.h"
|
||||
#include <gui/streaminfo2.h>
|
||||
#ifdef TEST_MENU
|
||||
@@ -231,518 +231,6 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings
|
||||
#endif
|
||||
}
|
||||
|
||||
#define SCANTS_BOUQUET_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval SCANTS_BOUQUET_OPTIONS[SCANTS_BOUQUET_OPTION_COUNT] =
|
||||
{
|
||||
{ CZapitClient::BM_DELETEBOUQUETS , LOCALE_SCANTS_BOUQUET_ERASE },
|
||||
/*{ CZapitClient::BM_CREATEBOUQUETS , LOCALE_SCANTS_BOUQUET_CREATE },*/
|
||||
{ CZapitClient::BM_DONTTOUCHBOUQUETS , LOCALE_SCANTS_BOUQUET_LEAVE },
|
||||
{ CZapitClient::BM_UPDATEBOUQUETS , LOCALE_SCANTS_BOUQUET_UPDATE }
|
||||
/*{ CZapitClient::BM_CREATESATELLITEBOUQUET, LOCALE_SCANTS_BOUQUET_SATELLITE }*/
|
||||
};
|
||||
|
||||
#define SCANTS_ZAPIT_SCANTYPE_COUNT 4
|
||||
const CMenuOptionChooser::keyval SCANTS_ZAPIT_SCANTYPE[SCANTS_ZAPIT_SCANTYPE_COUNT] =
|
||||
{
|
||||
{ CZapitClient::ST_TVRADIO , LOCALE_ZAPIT_SCANTYPE_TVRADIO },
|
||||
{ CZapitClient::ST_TV , LOCALE_ZAPIT_SCANTYPE_TV },
|
||||
{ CZapitClient::ST_RADIO , LOCALE_ZAPIT_SCANTYPE_RADIO },
|
||||
{ CZapitClient::ST_ALL , LOCALE_ZAPIT_SCANTYPE_ALL }
|
||||
};
|
||||
|
||||
#define SATSETUP_DISEQC_OPTION_COUNT 6
|
||||
const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_COUNT] =
|
||||
{
|
||||
{ NO_DISEQC, LOCALE_SATSETUP_NODISEQC },
|
||||
{ MINI_DISEQC, LOCALE_SATSETUP_MINIDISEQC },
|
||||
{ DISEQC_1_0, LOCALE_SATSETUP_DISEQC10 },
|
||||
{ DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 },
|
||||
/*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/
|
||||
{ DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED },
|
||||
{ SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE }
|
||||
};
|
||||
|
||||
#define SATSETUP_SCANTP_FEC_COUNT 21
|
||||
#define CABLESETUP_SCANTP_FEC_COUNT 5
|
||||
const CMenuOptionChooser::keyval SATSETUP_SCANTP_FEC[SATSETUP_SCANTP_FEC_COUNT] =
|
||||
{
|
||||
{ FEC_AUTO, LOCALE_EXTRA_FEC_AUTO },
|
||||
{ FEC_S2_AUTO, LOCALE_EXTRA_FEC_AUTO_S2 },
|
||||
|
||||
{ FEC_1_2, LOCALE_EXTRA_FEC_1_2 },
|
||||
{ FEC_2_3, LOCALE_EXTRA_FEC_2_3 },
|
||||
{ FEC_3_4, LOCALE_EXTRA_FEC_3_4 },
|
||||
{ FEC_5_6, LOCALE_EXTRA_FEC_5_6 },
|
||||
{ FEC_7_8, LOCALE_EXTRA_FEC_7_8 },
|
||||
|
||||
{ FEC_S2_QPSK_1_2, LOCALE_EXTRA_FEC_S2_QPSK_1_2 },
|
||||
{ FEC_S2_QPSK_2_3, LOCALE_EXTRA_FEC_S2_QPSK_2_3 },
|
||||
{ FEC_S2_QPSK_3_4, LOCALE_EXTRA_FEC_S2_QPSK_3_4 },
|
||||
{ FEC_S2_QPSK_5_6, LOCALE_EXTRA_FEC_S2_QPSK_5_6 },
|
||||
//{ FEC_S2_QPSK_7_8, LOCALE_EXTRA_FEC_S2_QPSK_7_8 },
|
||||
{ FEC_S2_QPSK_8_9, LOCALE_EXTRA_FEC_S2_QPSK_8_9 },
|
||||
{ FEC_S2_QPSK_3_5, LOCALE_EXTRA_FEC_S2_QPSK_3_5 },
|
||||
{ FEC_S2_QPSK_4_5, LOCALE_EXTRA_FEC_S2_QPSK_4_5 },
|
||||
{ FEC_S2_QPSK_9_10, LOCALE_EXTRA_FEC_S2_QPSK_9_10 },
|
||||
|
||||
//{ FEC_S2_8PSK_1_2, LOCALE_EXTRA_FEC_S2_8PSK_1_2 },
|
||||
{ FEC_S2_8PSK_2_3, LOCALE_EXTRA_FEC_S2_8PSK_2_3 },
|
||||
{ FEC_S2_8PSK_3_4, LOCALE_EXTRA_FEC_S2_8PSK_3_4 },
|
||||
{ FEC_S2_8PSK_3_5, LOCALE_EXTRA_FEC_S2_8PSK_3_5 },
|
||||
{ FEC_S2_8PSK_5_6, LOCALE_EXTRA_FEC_S2_8PSK_5_6 },
|
||||
//{ FEC_S2_8PSK_7_8, LOCALE_EXTRA_FEC_S2_8PSK_7_8 },
|
||||
{ FEC_S2_8PSK_8_9, LOCALE_EXTRA_FEC_S2_8PSK_8_9 },
|
||||
//{ FEC_S2_8PSK_4_5, LOCALE_EXTRA_FEC_S2_8PSK_4_5 },
|
||||
{ FEC_S2_8PSK_9_10, LOCALE_EXTRA_FEC_S2_8PSK_9_10 }
|
||||
};
|
||||
|
||||
#define SATSETUP_SCANTP_MOD_COUNT 5
|
||||
const CMenuOptionChooser::keyval SATSETUP_SCANTP_MOD[SATSETUP_SCANTP_MOD_COUNT] =
|
||||
{
|
||||
{ 1, LOCALE_EXTRA_TP_MOD_16 },
|
||||
{ 2, LOCALE_EXTRA_TP_MOD_32 },
|
||||
{ 3, LOCALE_EXTRA_TP_MOD_64 },
|
||||
{ 4, LOCALE_EXTRA_TP_MOD_128},
|
||||
{ 5, LOCALE_EXTRA_TP_MOD_256}
|
||||
};
|
||||
#define SATSETUP_SCANTP_POL_COUNT 2
|
||||
const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT] =
|
||||
{
|
||||
{ 0, LOCALE_EXTRA_TP_POL_H },
|
||||
{ 1, LOCALE_EXTRA_TP_POL_V }
|
||||
};
|
||||
|
||||
#if 0
|
||||
/*Cable*/
|
||||
#define CABLESETUP_SCANTP_MOD_COUNT 7
|
||||
const CMenuOptionChooser::keyval CABLESETUP_SCANTP_MOD[CABLESETUP_SCANTP_MOD_COUNT] =
|
||||
{
|
||||
{0, LOCALE_EXTRA_TP_MOD_QPSK } ,
|
||||
{1, LOCALE_EXTRA_TP_MOD_QAM_16 } ,
|
||||
{2, LOCALE_EXTRA_TP_MOD_QAM_32 } ,
|
||||
{3, LOCALE_EXTRA_TP_MOD_QAM_64 } ,
|
||||
{4, LOCALE_EXTRA_TP_MOD_QAM_128 } ,
|
||||
{5, LOCALE_EXTRA_TP_MOD_QAM_256 } ,
|
||||
{6, LOCALE_EXTRA_TP_MOD_QAM_AUTO }
|
||||
};
|
||||
#endif
|
||||
|
||||
#define SECTIONSD_SCAN_OPTIONS_COUNT 3
|
||||
const CMenuOptionChooser::keyval SECTIONSD_SCAN_OPTIONS[SECTIONSD_SCAN_OPTIONS_COUNT] =
|
||||
{
|
||||
{ 0, LOCALE_OPTIONS_OFF },
|
||||
{ 1, LOCALE_OPTIONS_ON },
|
||||
{ 2, LOCALE_OPTIONS_ON_WITHOUT_MESSAGES }
|
||||
};
|
||||
#define DISEQC_ORDER_OPTION_COUNT 2
|
||||
const CMenuOptionChooser::keyval DISEQC_ORDER_OPTIONS[DISEQC_ORDER_OPTION_COUNT] =
|
||||
{
|
||||
{ COMMITED_FIRST, LOCALE_SATSETUP_DISEQC_COM_UNCOM },
|
||||
{ UNCOMMITED_FIRST, LOCALE_SATSETUP_DISEQC_UNCOM_COM }
|
||||
};
|
||||
|
||||
class CTPSelectHandler : public CMenuTarget
|
||||
{
|
||||
public:
|
||||
int exec(CMenuTarget* parent, const std::string &actionkey);
|
||||
};
|
||||
|
||||
extern CZapitChannel *g_current_channel;
|
||||
extern std::map<transponder_id_t, transponder> select_transponders;
|
||||
int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
|
||||
{
|
||||
transponder_list_t::iterator tI;
|
||||
sat_iterator_t sit;
|
||||
t_satellite_position position = 0;
|
||||
std::map<int, transponder> tmplist;
|
||||
std::map<int, transponder>::iterator tmpI;
|
||||
int i;
|
||||
char cnt[5];
|
||||
int select = -1;
|
||||
static int old_selected = 0;
|
||||
static t_satellite_position old_position = 0;
|
||||
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
if (!strcmp(sit->second.name.c_str(), CNeutrinoApp::getInstance()->getScanSettings().satNameNoDiseqc)) {
|
||||
position = sit->first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (old_position != position) {
|
||||
old_selected = 0;
|
||||
old_position = position;
|
||||
}
|
||||
|
||||
CMenuWidget* menu = new CMenuWidget(LOCALE_SCANTS_SELECT_TP, NEUTRINO_ICON_SETTINGS);
|
||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||
menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); //add cancel button, ensures that we have enought space left from item caption
|
||||
i = 0;
|
||||
for (tI = select_transponders.begin(); tI != select_transponders.end(); tI++) {
|
||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
||||
satpos = -satpos;
|
||||
if (satpos != position)
|
||||
continue;
|
||||
|
||||
char buf[128];
|
||||
sprintf(cnt, "%d", i);
|
||||
char * f, *s, *m;
|
||||
switch (frontend->getInfo()->type) {
|
||||
case FE_QPSK:
|
||||
frontend->getDelSys(tI->second.feparams.u.qpsk.fec_inner, dvbs_get_modulation(tI->second.feparams.u.qpsk.fec_inner), f, s, m);
|
||||
snprintf(buf, sizeof(buf), "%d %c %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.polarization ? 'V' : 'H', tI->second.feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||
break;
|
||||
case FE_QAM:
|
||||
frontend->getDelSys(tI->second.feparams.u.qam.fec_inner, tI->second.feparams.u.qam.modulation, f, s, m);
|
||||
snprintf(buf, sizeof(buf), "%d %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.feparams.u.qam.symbol_rate/1000, f, s, m);
|
||||
break;
|
||||
case FE_OFDM:
|
||||
case FE_ATSC:
|
||||
break;
|
||||
}
|
||||
if(!old_selected && g_current_channel && g_current_channel->getSatellitePosition() == position) {
|
||||
if(g_current_channel->getFreqId() == GET_FREQ_FROM_TPID(tI->first)) {
|
||||
old_selected = i;
|
||||
}
|
||||
}
|
||||
|
||||
CMenuForwarderNonLocalized * ts_item = new CMenuForwarderNonLocalized(buf, true, NULL, selector, cnt, CRCInput::RC_nokey, NULL)/*, false*/;
|
||||
|
||||
ts_item->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
|
||||
menu->addItem(ts_item, old_selected == i);
|
||||
|
||||
tmplist.insert(std::pair <int, transponder>(i, tI->second));
|
||||
i++;
|
||||
}
|
||||
if (i == 0) {
|
||||
std::string text = "No transponders found for ";
|
||||
text += CNeutrinoApp::getInstance()->getScanSettings().satNameNoDiseqc;
|
||||
ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, text.c_str(), 450, 2);
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
menu->setSelected(old_selected);
|
||||
int retval = menu->exec(NULL, "");
|
||||
delete menu;
|
||||
delete selector;
|
||||
if (select >= 0) {
|
||||
old_selected = select;
|
||||
|
||||
tmpI = tmplist.find(select);
|
||||
printf("CTPSelectHandler::exec: selected TP: freq %d pol %d SR %d\n", tmpI->second.feparams.frequency,
|
||||
tmpI->second.polarization, tmpI->second.feparams.u.qpsk.symbol_rate);
|
||||
sprintf(get_set.TP_freq, "%d", tmpI->second.feparams.frequency);
|
||||
switch (frontend->getInfo()->type) {
|
||||
case FE_QPSK:
|
||||
sprintf(get_set.TP_rate, "%d", tmpI->second.feparams.u.qpsk.symbol_rate);
|
||||
get_set.TP_fec = tmpI->second.feparams.u.qpsk.fec_inner;
|
||||
get_set.TP_pol = tmpI->second.polarization;
|
||||
break;
|
||||
case FE_QAM:
|
||||
sprintf(get_set.TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate);
|
||||
get_set.TP_fec = tmpI->second.feparams.u.qam.fec_inner;
|
||||
get_set.TP_mod = tmpI->second.feparams.u.qam.modulation;
|
||||
break;
|
||||
case FE_OFDM:
|
||||
case FE_ATSC:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (retval == menu_return::RETURN_EXIT_ALL)
|
||||
return menu_return::RETURN_EXIT_ALL;
|
||||
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
extern int scan_pids;
|
||||
|
||||
#define FAST_SCAN_OPTIONS_COUNT 2
|
||||
const CMenuOptionChooser::keyval FAST_SCAN_OPTIONS[FAST_SCAN_OPTIONS_COUNT] =
|
||||
{
|
||||
{ FAST_SCAN_SD, LOCALE_SATSETUP_FASTSCAN_SD },
|
||||
{ FAST_SCAN_HD, LOCALE_SATSETUP_FASTSCAN_HD }
|
||||
/*{ FAST_SCAN_ALL, LOCALE_SATSETUP_FASTSCAN_ALL }*/
|
||||
};
|
||||
|
||||
#define FAST_SCAN_PROV_OPTIONS_COUNT 3
|
||||
const CMenuOptionChooser::keyval FAST_SCAN_PROV_OPTIONS[FAST_SCAN_PROV_OPTIONS_COUNT] =
|
||||
{
|
||||
{ OPERATOR_CD, LOCALE_SATSETUP_FASTSCAN_PROV_CD },
|
||||
{ OPERATOR_TVV, LOCALE_SATSETUP_FASTSCAN_PROV_TVV },
|
||||
{ OPERATOR_TELESAT, LOCALE_SATSETUP_FASTSCAN_PROV_TELESAT }
|
||||
};
|
||||
|
||||
void CNeutrinoApp::InitScanSettings(CMenuWidget &settings)
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "init scansettings\n");
|
||||
int sfound = 0;
|
||||
int dmode = scanSettings.diseqcMode;
|
||||
int shortcut = 1;
|
||||
static int all_usals = 1;
|
||||
|
||||
//scale to max sat/cable name lenght
|
||||
unsigned int sat_txt_w = 0, max_txt_w = 0;
|
||||
sat_iterator_t sit;
|
||||
|
||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
sat_txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(sit->second.name.c_str(), true);
|
||||
max_txt_w = std::max(max_txt_w,sat_txt_w);
|
||||
}
|
||||
|
||||
int w, h;
|
||||
const unsigned int mini_w = 30;//mini width 30%
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &w, &h);
|
||||
max_txt_w += (w*2) +30;
|
||||
max_txt_w = std::min(max_txt_w, frameBuffer->getScreenWidth());
|
||||
max_txt_w = max_txt_w*100/frameBuffer->getScreenWidth();
|
||||
max_txt_w = std::max(max_txt_w,mini_w);
|
||||
|
||||
CTPSelectHandler * tpSelect = new CTPSelectHandler();
|
||||
|
||||
CSatelliteSetupNotifier * satNotify = new CSatelliteSetupNotifier();
|
||||
|
||||
CMenuOptionChooser* ojScantype = new CMenuOptionChooser(LOCALE_ZAPIT_SCANTYPE, (int *)&scanSettings.scanType, SCANTS_ZAPIT_SCANTYPE, SCANTS_ZAPIT_SCANTYPE_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
CMenuOptionChooser* ojBouquets = new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET, (int *)&scanSettings.bouquetMode, SCANTS_BOUQUET_OPTIONS, SCANTS_BOUQUET_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
|
||||
CMenuOptionChooser* useNit = new CMenuOptionChooser(LOCALE_SATSETUP_USE_NIT, (int *)&scanSettings.scan_mode, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
|
||||
CMenuOptionChooser* scanPids = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_SCANPIDS, &scan_pids, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
|
||||
|
||||
// Please lets keep shortcuts which used for a long time - unchanged. -- focus
|
||||
//CMenuOptionChooser* ftaFlag = new CMenuOptionChooser(LOCALE_SATSETUP_USE_FTA_FLAG, (int *)&scanSettings.scan_fta_flag, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
||||
CMenuOptionChooser* ftaFlag = new CMenuOptionChooser(LOCALE_SATSETUP_USE_FTA_FLAG, (int *)&scanSettings.scan_fta_flag, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(0));
|
||||
|
||||
CMenuWidget* satSetup = new CMenuWidget(LOCALE_SATSETUP_SAT_SETUP, NEUTRINO_ICON_SETTINGS);
|
||||
satSetup->addItem(GenericMenuSeparator);
|
||||
satSetup->addItem(GenericMenuBack);
|
||||
|
||||
satSetup->addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savescansettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
satSetup->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
CMenuWidget* satfindMenu = new CMenuWidget(LOCALE_MOTORCONTROL_HEAD, NEUTRINO_ICON_SETTINGS);
|
||||
|
||||
satfindMenu->addIntroItems();
|
||||
|
||||
CMenuOptionStringChooser *satSelect = NULL;
|
||||
CMenuWidget* satOnOff = NULL;
|
||||
|
||||
//t_satellite_position currentSatellitePosition = frontend->getCurrentSatellitePosition();
|
||||
if (g_info.delivery_system == DVB_S) {
|
||||
satSelect = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||
satOnOff = new CMenuWidget(LOCALE_SATSETUP_SATELLITE, NEUTRINO_ICON_SETTINGS);
|
||||
satOnOff->addIntroItems();
|
||||
|
||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
/* printf("Adding sat menu for %s position %d\n", sit->second.name.c_str(), sit->first); */
|
||||
|
||||
satSelect->addOption(sit->second.name.c_str());
|
||||
if (strcmp(scanSettings.satNameNoDiseqc,sit->second.name.c_str()) == 0) {
|
||||
sfound = 1;
|
||||
}
|
||||
|
||||
CMenuWidget* tempsat = new CMenuWidget(sit->second.name.c_str(), NEUTRINO_ICON_SETTINGS);
|
||||
tempsat->addIntroItems();
|
||||
|
||||
CMenuOptionChooser * inuse = new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
CMenuOptionNumberChooser * diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &sit->second.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
CMenuOptionNumberChooser * comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &sit->second.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
CMenuOptionNumberChooser * uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &sit->second.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
//CMenuOptionNumberChooser * motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &sit->second.motor_position, dmode == DISEQC_ADVANCED, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
||||
CMenuOptionNumberChooser * motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &sit->second.motor_position, true, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
||||
//CMenuOptionChooser * usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &sit->second.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, dmode == DISEQC_ADVANCED);
|
||||
CMenuOptionChooser * usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &sit->second.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
if(!sit->second.use_usals)
|
||||
all_usals = 0;
|
||||
|
||||
satNotify->addItem(1, diseqc);
|
||||
satNotify->addItem(0, comm);
|
||||
satNotify->addItem(0, uncomm);
|
||||
//satNotify->addItem(0, motor); //FIXME testing motor with not DISEQC_ADVANCED
|
||||
//satNotify->addItem(0, usals);
|
||||
|
||||
CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int&) sit->second.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) sit->second.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) sit->second.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
|
||||
satOnOff->addItem(inuse);
|
||||
tempsat->addItem(diseqc);
|
||||
tempsat->addItem(comm);
|
||||
tempsat->addItem(uncomm);
|
||||
tempsat->addItem(motor);
|
||||
tempsat->addItem(usals);
|
||||
tempsat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL));
|
||||
tempsat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH));
|
||||
tempsat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFS, true, lofS->getValue(), lofS));
|
||||
satSetup->addItem(new CMenuForwarderNonLocalized(sit->second.name.c_str(), true, NULL, tempsat));
|
||||
|
||||
}
|
||||
} else if (g_info.delivery_system == DVB_C) {
|
||||
satSelect = new CMenuOptionStringChooser(LOCALE_CABLESETUP_PROVIDER, (char*)scanSettings.satNameNoDiseqc, true);
|
||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
printf("Adding cable menu for %s position %d\n", sit->second.name.c_str(), sit->first);
|
||||
satSelect->addOption(sit->second.name.c_str());
|
||||
if (strcmp(scanSettings.satNameNoDiseqc,sit->second.name.c_str()) == 0) {
|
||||
sfound = 1;
|
||||
}
|
||||
dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str());
|
||||
}
|
||||
}
|
||||
satfindMenu->addItem(satSelect);
|
||||
satfindMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, tpSelect, "test"));
|
||||
|
||||
int freq_length = (g_info.delivery_system == DVB_S) ? 8 : 6;
|
||||
|
||||
CStringInput* freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scanSettings.TP_freq, freq_length, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
|
||||
CStringInput* rate = new CStringInput(LOCALE_EXTRA_TP_RATE, (char *) scanSettings.TP_rate, 8, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
|
||||
CMenuForwarder * Freq = new CMenuForwarder(LOCALE_EXTRA_TP_FREQ, true, scanSettings.TP_freq, freq, "", CRCInput::convertDigitToKey(1));
|
||||
CMenuForwarder * Rate = new CMenuForwarder(LOCALE_EXTRA_TP_RATE, true, scanSettings.TP_rate, rate, "", CRCInput::convertDigitToKey(2));
|
||||
|
||||
int fec_count = (g_info.delivery_system == DVB_S) ? SATSETUP_SCANTP_FEC_COUNT : CABLESETUP_SCANTP_FEC_COUNT;
|
||||
|
||||
CMenuOptionChooser* fec = new CMenuOptionChooser(LOCALE_EXTRA_TP_FEC, (int *)&scanSettings.TP_fec, SATSETUP_SCANTP_FEC, fec_count, true, NULL, CRCInput::convertDigitToKey(3), "", true);
|
||||
CMenuOptionChooser* mod_pol = NULL;
|
||||
|
||||
if (g_info.delivery_system == DVB_S)
|
||||
mod_pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_POL, (int *)&scanSettings.TP_pol, SATSETUP_SCANTP_POL, SATSETUP_SCANTP_POL_COUNT, true, NULL, CRCInput::convertDigitToKey(4));
|
||||
else if (g_info.delivery_system == DVB_C)
|
||||
mod_pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_MOD, (int *)&scanSettings.TP_mod, SATSETUP_SCANTP_MOD, SATSETUP_SCANTP_MOD_COUNT, true, NULL, CRCInput::convertDigitToKey(4));
|
||||
|
||||
satfindMenu->addItem(Freq);
|
||||
satfindMenu->addItem(Rate);
|
||||
satfindMenu->addItem(fec);
|
||||
satfindMenu->addItem(mod_pol);
|
||||
|
||||
CMenuWidget* motorMenu = NULL;
|
||||
if (g_info.delivery_system == DVB_S) {
|
||||
satfindMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, new CMotorControl(), "", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
|
||||
motorMenu = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS);
|
||||
motorMenu->addItem(GenericMenuSeparator);
|
||||
motorMenu->addItem(GenericMenuBack);
|
||||
motorMenu->addItem(new CMenuForwarder(LOCALE_SATSETUP_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
//motorMenu->addItem(new CMenuForwarder(LOCALE_SATSETUP_MOTORCONTROL , true, NULL, new CMotorControl()));
|
||||
motorMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, satfindMenu, "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
motorMenu->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
motorMenu->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&zapitCfg.motorRotationSpeed, true, 0, 64, NULL) );
|
||||
motorMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&zapitCfg.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
//motorMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, (int *)&zapitCfg.useGotoXX, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
|
||||
CStringInput * toff;
|
||||
sprintf(zapit_lat, "%02.6f", zapitCfg.gotoXXLatitude);
|
||||
sprintf(zapit_long, "%02.6f", zapitCfg.gotoXXLongitude);
|
||||
|
||||
motorMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LADIRECTION, (int *)&zapitCfg.gotoXXLaDirection, OPTIONS_SOUTH0_NORTH1_OPTIONS, OPTIONS_SOUTH0_NORTH1_OPTION_COUNT, true));
|
||||
toff = new CStringInput(LOCALE_EXTRA_LATITUDE, (char *) zapit_lat, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
||||
motorMenu->addItem(new CMenuForwarder(LOCALE_EXTRA_LATITUDE, true, zapit_lat, toff));
|
||||
|
||||
motorMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LODIRECTION, (int *)&zapitCfg.gotoXXLoDirection, OPTIONS_EAST0_WEST1_OPTIONS, OPTIONS_EAST0_WEST1_OPTION_COUNT, true));
|
||||
toff = new CStringInput(LOCALE_EXTRA_LONGITUDE, (char *) zapit_long, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
||||
motorMenu->addItem(new CMenuForwarder(LOCALE_EXTRA_LONGITUDE, true, zapit_long, toff));
|
||||
motorMenu->addItem(new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF) );
|
||||
CAllUsalsNotifier * usalsNotify = new CAllUsalsNotifier();
|
||||
CMenuOptionChooser * allusals = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, usalsNotify);
|
||||
motorMenu->addItem(allusals);
|
||||
}
|
||||
|
||||
if (!sfound && satellitePositions.size()) {
|
||||
sit = satellitePositions.begin();
|
||||
snprintf(scanSettings.satNameNoDiseqc, sizeof(scanSettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
||||
}
|
||||
|
||||
CMenuWidget* manualScan = new CMenuWidget(LOCALE_SATSETUP_MANUAL_SCAN, NEUTRINO_ICON_SETTINGS, max_txt_w);
|
||||
|
||||
CScanTs * scanTs = new CScanTs();
|
||||
|
||||
manualScan->addIntroItems();
|
||||
|
||||
manualScan->addItem(satSelect);
|
||||
manualScan->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, tpSelect, "test"));
|
||||
manualScan->addItem(Freq);
|
||||
manualScan->addItem(Rate);
|
||||
manualScan->addItem(fec);
|
||||
manualScan->addItem(mod_pol);
|
||||
manualScan->addItem(useNit);
|
||||
manualScan->addItem(ftaFlag);
|
||||
manualScan->addItem(GenericMenuSeparatorLine);
|
||||
manualScan->addItem(new CMenuForwarder(LOCALE_SCANTS_TEST, true, NULL, scanTs, "test", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
manualScan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, scanTs, "manual", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
|
||||
CMenuWidget* autoScan = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN, NEUTRINO_ICON_SETTINGS, max_txt_w);
|
||||
autoScan->addIntroItems();
|
||||
autoScan->addItem(satSelect);
|
||||
autoScan->addItem(useNit);
|
||||
autoScan->addItem(scanPids);
|
||||
autoScan->addItem(ftaFlag);
|
||||
autoScan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, scanTs, "auto", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
|
||||
CMenuOptionChooser* ojDiseqc = NULL;
|
||||
CMenuOptionNumberChooser * ojDiseqcRepeats = NULL;
|
||||
CMenuForwarder *fsatSetup = NULL;
|
||||
CMenuForwarder *fmotorMenu = NULL;
|
||||
CMenuForwarder *fautoScanAll = NULL;
|
||||
|
||||
if (g_info.delivery_system == DVB_S) {
|
||||
ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&scanSettings.diseqcMode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, true, satNotify, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scanSettings.diseqcRepeat, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL);
|
||||
|
||||
satNotify->addItem(1, ojDiseqcRepeats);
|
||||
|
||||
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, satSetup, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
//fmotorMenu = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED_MOTOR, (dmode == DISEQC_ADVANCED), NULL, motorMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
//satNotify->addItem(0, fmotorMenu); //FIXME testing motor with not DISEQC_ADVANCED
|
||||
fmotorMenu = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED_MOTOR, true, NULL, motorMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
|
||||
CMenuWidget* autoScanAll = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN_ALL, NEUTRINO_ICON_SETTINGS);
|
||||
fautoScanAll = new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, (dmode != NO_DISEQC), NULL, autoScanAll, "", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
||||
satNotify->addItem(2, fautoScanAll);
|
||||
|
||||
|
||||
autoScanAll->addIntroItems();
|
||||
autoScanAll->addItem(new CMenuForwarder(LOCALE_SATSETUP_SATELLITE, true, NULL, satOnOff, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
autoScanAll->addItem(useNit);
|
||||
autoScanAll->addItem(scanPids);
|
||||
autoScanAll->addItem(ftaFlag);
|
||||
autoScanAll->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, scanTs, "all", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
}
|
||||
|
||||
settings.addItem(GenericMenuSeparator);
|
||||
settings.addItem(GenericMenuBack);
|
||||
settings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
settings.addItem(GenericMenuSeparatorLine);
|
||||
|
||||
settings.addItem(ojScantype);
|
||||
settings.addItem(ojBouquets);
|
||||
|
||||
if (g_info.delivery_system == DVB_S) {
|
||||
settings.addItem(ojDiseqc);
|
||||
settings.addItem(ojDiseqcRepeats);
|
||||
settings.addItem(fsatSetup);
|
||||
settings.addItem(fmotorMenu);
|
||||
}
|
||||
settings.addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_FE_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 6, 100) );
|
||||
|
||||
settings.addItem(new CMenuForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
settings.addItem(new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN, true, NULL, autoScan, "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
|
||||
if (g_info.delivery_system == DVB_S) {
|
||||
settings.addItem(fautoScanAll);
|
||||
|
||||
CMenuWidget* fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS);
|
||||
fastScanMenu->addIntroItems();
|
||||
|
||||
CMenuOptionChooser* fastProv = new CMenuOptionChooser(LOCALE_SATSETUP_FASTSCAN_PROV, (int *)&scanSettings.fast_op, FAST_SCAN_PROV_OPTIONS, FAST_SCAN_PROV_OPTIONS_COUNT, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||
CMenuOptionChooser* fastType = new CMenuOptionChooser(LOCALE_SATSETUP_FASTSCAN_TYPE, (int *)&scanSettings.fast_type, FAST_SCAN_OPTIONS, FAST_SCAN_OPTIONS_COUNT, true, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN, true);
|
||||
|
||||
fastScanMenu->addItem(fastProv);
|
||||
fastScanMenu->addItem(fastType);
|
||||
fastScanMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, scanTs, "fast", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
settings.addItem(new CMenuForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::convertDigitToKey(0)));
|
||||
}
|
||||
}
|
||||
|
||||
#define FLASHUPDATE_UPDATEMODE_OPTION_COUNT 2
|
||||
const CMenuOptionChooser::keyval FLASHUPDATE_UPDATEMODE_OPTIONS[FLASHUPDATE_UPDATEMODE_OPTION_COUNT] =
|
||||
{
|
||||
@@ -751,10 +239,10 @@ const CMenuOptionChooser::keyval FLASHUPDATE_UPDATEMODE_OPTIONS[FLASHUPDATE_UPDA
|
||||
};
|
||||
|
||||
void getZapitConfig(Zapit_config *Cfg);
|
||||
void CNeutrinoApp::InitServiceSettings(CMenuWidget &service, CMenuWidget &_scanSettings)
|
||||
void CNeutrinoApp::InitServiceSettings(CMenuWidget &service/*, CMenuWidget &_scanSettings*/)
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "init serviceSettings\n");
|
||||
getZapitConfig(&zapitCfg);
|
||||
getZapitConfig(&zapitCfg);
|
||||
|
||||
#if 0
|
||||
CZapitDestExec * zexec = new CZapitDestExec();
|
||||
@@ -787,9 +275,10 @@ void CNeutrinoApp::InitServiceSettings(CMenuWidget &service, CMenuWidget &_scanS
|
||||
#endif
|
||||
|
||||
service.addIntroItems();
|
||||
service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_SCANTS , true, NULL, &_scanSettings, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED) );
|
||||
|
||||
service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_SCANTS , true, NULL, CScanSetup::getInstance(), "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED) );
|
||||
// service.addItem(new CMenuForwarder(LOCALE_EXTRA_ZAPIT_MENU , true, NULL, zapit_menu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RELOAD , true, NULL, this, "reloadchannels", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ));
|
||||
service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RELOAD , true, NULL, CScanSetup::getInstance(), "reloadchannels", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ));
|
||||
service.addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_NAME , true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ));
|
||||
|
||||
CDataResetNotifier * resetNotifier = new CDataResetNotifier();
|
||||
|
Reference in New Issue
Block a user