mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-18 10:51: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:
@@ -74,6 +74,7 @@ libneutrino_gui_a_SOURCES = \
|
||||
rc_lock.cpp \
|
||||
record_setup.cpp \
|
||||
scan.cpp \
|
||||
scan_setup.cpp \
|
||||
screensetup.cpp \
|
||||
sleeptimer.cpp \
|
||||
streaminfo2.cpp \
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include <gui/customcolor.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <gui/motorcontrol.h>
|
||||
#include "gui/scan_setup.h"
|
||||
#include <gui/color.h>
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/widget/messagebox.h>
|
||||
@@ -123,9 +124,9 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
|
||||
|
||||
/* send satellite list to zapit */
|
||||
for(sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
if(!strcmp(sit->second.name.c_str(),get_set.satNameNoDiseqc)) {
|
||||
if(!strcmp(sit->second.name.c_str(),scansettings.satNameNoDiseqc)) {
|
||||
sat.position = sit->first;
|
||||
strncpy(sat.satName, get_set.satNameNoDiseqc, 50);
|
||||
strncpy(sat.satName, scansettings.satNameNoDiseqc, 50);
|
||||
satList.push_back(sat);
|
||||
if(sit->second.motor_position)
|
||||
motorPosition = sit->second.motor_position;
|
||||
@@ -136,10 +137,10 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
|
||||
|
||||
g_Zapit->setScanSatelliteList( satList);
|
||||
|
||||
TP.feparams.frequency = atoi(get_set.TP_freq);
|
||||
TP.feparams.u.qpsk.symbol_rate = atoi(get_set.TP_rate);
|
||||
TP.feparams.u.qpsk.fec_inner = (fe_code_rate_t)get_set.TP_fec;
|
||||
TP.polarization = get_set.TP_pol;
|
||||
TP.feparams.frequency = atoi(scansettings.TP_freq);
|
||||
TP.feparams.u.qpsk.symbol_rate = atoi(scansettings.TP_rate);
|
||||
TP.feparams.u.qpsk.fec_inner = (fe_code_rate_t)scansettings.TP_fec;
|
||||
TP.polarization = scansettings.TP_pol;
|
||||
#if 0
|
||||
CZapitClient::CCurrentServiceInfo si = g_Zapit->getCurrentServiceInfo ();
|
||||
TP.feparams.frequency = si.tsfrequency;
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <gui/scan.h>
|
||||
#include "gui/scan_setup.h"
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/screen_max.h>
|
||||
@@ -90,7 +91,7 @@ void CScanTs::prev_next_TP( bool up)
|
||||
t_satellite_position position = 0;
|
||||
|
||||
for (sat_iterator_t sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
if (!strcmp(sit->second.name.c_str(), CNeutrinoApp::getInstance()->getScanSettings().satNameNoDiseqc)) {
|
||||
if (!strcmp(sit->second.name.c_str(), scansettings.satNameNoDiseqc)) {
|
||||
position = sit->first;
|
||||
break;
|
||||
}
|
||||
@@ -150,10 +151,10 @@ void CScanTs::testFunc()
|
||||
frontend->getDelSys(TP.feparams.u.qpsk.fec_inner, dvbs_get_modulation((fe_code_rate_t)TP.feparams.u.qpsk.fec_inner), f, s, m);
|
||||
snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", TP.feparams.frequency/1000, TP.polarization == 0 ? 'H' : 'V', TP.feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||
} else if(frontend->getInfo()->type == FE_QAM) {
|
||||
frontend->getDelSys(get_set.TP_fec, get_set.TP_mod, f, s, m);
|
||||
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(get_set.TP_freq)/1000, atoi(get_set.TP_rate)/1000, f, s, m);
|
||||
frontend->getDelSys(scansettings.TP_fec, scansettings.TP_mod, f, s, m);
|
||||
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(scansettings.TP_freq)/1000, atoi(scansettings.TP_rate)/1000, f, s, m);
|
||||
}
|
||||
paintLine(xpos2, ypos_cur_satellite, w - 95, get_set.satNameNoDiseqc);
|
||||
paintLine(xpos2, ypos_cur_satellite, w - 95, scansettings.satNameNoDiseqc);
|
||||
paintLine(xpos2, ypos_frequency, w, buffer);
|
||||
success = g_Zapit->tune_TP(TP);
|
||||
|
||||
@@ -163,9 +164,9 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
diseqc_t diseqcType = NO_DISEQC;
|
||||
neutrino_msg_t msg;
|
||||
neutrino_msg_data_t data;
|
||||
//bool manual = (get_set.scan_mode == 2);
|
||||
int scan_mode = get_set.scan_mode;
|
||||
scan_fta_flag = get_set.scan_fta_flag;
|
||||
//bool manual = (scansettings.scan_mode == 2);
|
||||
int scan_mode = scansettings.scan_mode;
|
||||
scan_fta_flag = scansettings.scan_fta_flag;
|
||||
|
||||
sat_iterator_t sit;
|
||||
bool scan_all = actionKey == "all";
|
||||
@@ -205,20 +206,20 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8);
|
||||
|
||||
//printf("[neutrino] scan_mode %d TP_freq %s TP_rate %s TP_fec %d TP_pol %d\n", get_set.scan_mode, get_set.TP_freq, get_set.TP_rate, get_set.TP_fec, get_set.TP_pol);
|
||||
//printf("[neutrino] scan_mode %d TP_freq %s TP_rate %s TP_fec %d TP_pol %d\n", scansettings.scan_mode, scansettings.TP_freq, scansettings.TP_rate, scansettings.TP_fec, scansettings.TP_pol);
|
||||
|
||||
if(manual) {
|
||||
scan_pids = true;
|
||||
TP.scan_mode = get_set.scan_mode;
|
||||
TP.feparams.frequency = atoi(get_set.TP_freq);
|
||||
TP.scan_mode = scansettings.scan_mode;
|
||||
TP.feparams.frequency = atoi(scansettings.TP_freq);
|
||||
if(g_info.delivery_system == DVB_S) {
|
||||
TP.feparams.u.qpsk.symbol_rate = atoi(get_set.TP_rate);
|
||||
TP.feparams.u.qpsk.fec_inner = (fe_code_rate_t) get_set.TP_fec;
|
||||
TP.polarization = get_set.TP_pol;
|
||||
TP.feparams.u.qpsk.symbol_rate = atoi(scansettings.TP_rate);
|
||||
TP.feparams.u.qpsk.fec_inner = (fe_code_rate_t) scansettings.TP_fec;
|
||||
TP.polarization = scansettings.TP_pol;
|
||||
} else {
|
||||
TP.feparams.u.qam.symbol_rate = atoi(get_set.TP_rate);
|
||||
TP.feparams.u.qam.fec_inner = (fe_code_rate_t)get_set.TP_fec;
|
||||
TP.feparams.u.qam.modulation = (fe_modulation_t) get_set.TP_mod;
|
||||
TP.feparams.u.qam.symbol_rate = atoi(scansettings.TP_rate);
|
||||
TP.feparams.u.qam.fec_inner = (fe_code_rate_t)scansettings.TP_fec;
|
||||
TP.feparams.u.qam.modulation = (fe_modulation_t) scansettings.TP_mod;
|
||||
}
|
||||
//printf("[neutrino] freq %d rate %d fec %d pol %d\n", TP.feparams.frequency, TP.feparams.u.qpsk.symbol_rate, TP.feparams.u.qpsk.fec_inner, TP.polarization);
|
||||
}
|
||||
@@ -227,9 +228,9 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
}
|
||||
else if(manual || !scan_all) {
|
||||
for(sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||
if(!strcmp(sit->second.name.c_str(),get_set.satNameNoDiseqc)) {
|
||||
if(!strcmp(sit->second.name.c_str(),scansettings.satNameNoDiseqc)) {
|
||||
sat.position = sit->first;
|
||||
strncpy(sat.satName, get_set.satNameNoDiseqc, 50);
|
||||
strncpy(sat.satName, scansettings.satNameNoDiseqc, 50);
|
||||
satList.push_back(sat);
|
||||
break;
|
||||
}
|
||||
@@ -252,19 +253,19 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
}
|
||||
|
||||
/* send diseqc type to zapit */
|
||||
diseqcType = (diseqc_t) CNeutrinoApp::getInstance()->getScanSettings().diseqcMode;
|
||||
diseqcType = (diseqc_t) scansettings.diseqcMode;
|
||||
g_Zapit->setDiseqcType(diseqcType);
|
||||
|
||||
/* send diseqc repeat to zapit */
|
||||
g_Zapit->setDiseqcRepeat( CNeutrinoApp::getInstance()->getScanSettings().diseqcRepeat);
|
||||
g_Zapit->setScanBouquetMode( (CZapitClient::bouquetMode)CNeutrinoApp::getInstance()->getScanSettings().bouquetMode);
|
||||
g_Zapit->setDiseqcRepeat( scansettings.diseqcRepeat);
|
||||
g_Zapit->setScanBouquetMode( (CZapitClient::bouquetMode)scansettings.bouquetMode);
|
||||
|
||||
/* send satellite list to zapit */
|
||||
if(satList.size())
|
||||
g_Zapit->setScanSatelliteList( satList);
|
||||
|
||||
/* send scantype to zapit */
|
||||
g_Zapit->setScanType((CZapitClient::scanType) CNeutrinoApp::getInstance()->getScanSettings().scanType );
|
||||
g_Zapit->setScanType((CZapitClient::scanType) scansettings.scanType );
|
||||
|
||||
tuned = frontend->getStatus();
|
||||
paint(test);
|
||||
@@ -274,7 +275,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
} else if(manual)
|
||||
success = g_Zapit->scan_TP(TP);
|
||||
else if(fast) {
|
||||
success = !start_fast_scan(get_set.fast_type, get_set.fast_op);
|
||||
success = !start_fast_scan(scansettings.fast_type, scansettings.fast_op);
|
||||
}
|
||||
else
|
||||
success = g_Zapit->startScan(scan_mode);
|
||||
@@ -302,7 +303,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||
}
|
||||
|
||||
else if(msg == CRCInput::RC_home) {
|
||||
if(manual && get_set.scan_mode)
|
||||
if(manual && scansettings.scan_mode)
|
||||
continue;
|
||||
if (ShowLocalizedMessage(LOCALE_SCANTS_ABORT_HEADER, LOCALE_SCANTS_ABORT_BODY, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) {
|
||||
g_Zapit->stopScan();
|
||||
|
885
src/gui/scan_setup.cpp
Normal file
885
src/gui/scan_setup.cpp
Normal file
@@ -0,0 +1,885 @@
|
||||
/*
|
||||
scan_setup menue - Neutrino-GUI
|
||||
|
||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Reworked as similar to $Id: scan_setup.cpp,v 1.10 2010/12/05 22:32:12 tuxbox-cvs Exp $
|
||||
Copyright (C) 2011 T. Graf 'dbt'
|
||||
Homepage: http://www.dbox2-tuning.net/
|
||||
|
||||
License: GPL
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include <mymenu.h>
|
||||
|
||||
|
||||
#include "gui/scan.h"
|
||||
#include "gui/scan_setup.h"
|
||||
#include "gui/motorcontrol.h"
|
||||
#include "gui/bedit/bouqueteditor_bouquets.h"
|
||||
|
||||
#include "gui/widget/hintbox.h"
|
||||
#include "gui/widget/stringinput.h"
|
||||
#include "gui/widget/stringinput_ext.h"
|
||||
|
||||
#include <driver/screen_max.h>
|
||||
#include <driver/framebuffer.h>
|
||||
#include <system/debug.h>
|
||||
|
||||
#include <zapit/frontend_c.h>
|
||||
#include <zapit/getservices.h>
|
||||
#include <zapit/satconfig.h>
|
||||
#include <zapit/fastscan.h>
|
||||
|
||||
|
||||
extern CFrontend * frontend;
|
||||
extern int scan_pids;
|
||||
extern CZapitChannel *g_current_channel;
|
||||
extern std::map<transponder_id_t, transponder> select_transponders;
|
||||
extern Zapit_config zapitCfg;
|
||||
extern char zapit_lat[20];
|
||||
extern char zapit_long[20];
|
||||
extern int scan_pids;
|
||||
|
||||
static int all_usals = 1;
|
||||
sat_iterator_t sit;
|
||||
|
||||
void setZapitConfig(Zapit_config * Cfg);
|
||||
|
||||
#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 }
|
||||
};
|
||||
|
||||
|
||||
CScanSetup::CScanSetup(bool wizard_mode)
|
||||
{
|
||||
width = w_max (40, 10);
|
||||
selected = -1;
|
||||
dmode = scansettings.diseqcMode;
|
||||
sfound = 0;
|
||||
r_system = g_info.delivery_system;
|
||||
fec_count = (r_system == DVB_S) ? SATSETUP_SCANTP_FEC_COUNT : CABLESETUP_SCANTP_FEC_COUNT;
|
||||
freq_length = (r_system == DVB_S) ? 8 : 6;
|
||||
|
||||
is_wizard = wizard_mode;
|
||||
|
||||
//define caption of some forwarders and widgets depends of current receiver type
|
||||
satprov_locale = (r_system == DVB_S) ? LOCALE_SATSETUP_SATELLITE : LOCALE_CABLESETUP_PROVIDER;
|
||||
|
||||
satSelect = NULL;
|
||||
usalsNotify = NULL;
|
||||
satNotify = NULL;
|
||||
}
|
||||
|
||||
CScanSetup* CScanSetup::getInstance()
|
||||
{
|
||||
static CScanSetup* scs = NULL;
|
||||
|
||||
if(!scs)
|
||||
{
|
||||
scs = new CScanSetup();
|
||||
printf("[neutrino] ScanSetup Instance created\n");
|
||||
}
|
||||
return scs;
|
||||
}
|
||||
|
||||
CScanSetup::~CScanSetup()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
{
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
if(actionKey=="save_scansettings")
|
||||
{
|
||||
printf("[neutrino] CScanSetup::%s save_scansettings...\n", __FUNCTION__);
|
||||
saveScanSetup();
|
||||
return res;
|
||||
}
|
||||
else if(actionKey=="reloadchannels")
|
||||
{
|
||||
printf("[neutrino] CScanSetup::%s reloadchannels...\n", __FUNCTION__);
|
||||
g_Zapit->reinitChannels();
|
||||
return res;
|
||||
}
|
||||
|
||||
//starting scan
|
||||
std::string s_to_comp = "scan_";
|
||||
int l = s_to_comp.length();
|
||||
std::string scan_cmd = actionKey.substr(0, l); //returns content of "s_to_comp" if present, note: don't add new actionKeys which contains content of "s_to_comp"!
|
||||
if(!scan_cmd.empty())
|
||||
{
|
||||
printf("[neutrino] CScanSetup::%s %s...\n", __FUNCTION__, actionKey.c_str());
|
||||
//ensure that be saved all settings before scan...
|
||||
saveScanSetup();
|
||||
//...then start scan
|
||||
CScanTs scanTs;
|
||||
scanTs.exec(NULL, actionKey);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
printf("[neutrino] CScanSetup %s: init scan setup (Mode: %d)...\n",__FUNCTION__ , is_wizard);
|
||||
showScanMenu();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_FASTSCAN
|
||||
#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 }
|
||||
};
|
||||
#endif /*ENABLE_FASTSCAN*/
|
||||
|
||||
//scale to max sat/cable name lenght
|
||||
unsigned int CScanSetup::getSatMenuListWidth()
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
unsigned int sat_txt_w = 0, max_txt_w = 0;
|
||||
|
||||
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 = width;//mini width
|
||||
CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &w, &h);
|
||||
max_txt_w += (w*2) +30;
|
||||
max_txt_w = std::min(max_txt_w, CFrameBuffer::getInstance()->getScreenWidth());
|
||||
max_txt_w = max_txt_w*100/CFrameBuffer::getInstance()->getScreenWidth();
|
||||
max_txt_w = std::max(max_txt_w,mini_w);
|
||||
|
||||
return max_txt_w;
|
||||
}
|
||||
|
||||
void CScanSetup::showScanMenu()
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
int shortcut = 1;
|
||||
|
||||
CMenuWidget *settings = NULL;//main
|
||||
CMenuWidget *satSetup = NULL;//lnb config sub menu
|
||||
CMenuForwarder *fsatSetup = NULL;//lnb config
|
||||
CMenuWidget *motorMenu = NULL;//motor menu
|
||||
CMenuForwarder *fmotorMenu = NULL;//motor settings
|
||||
CMenuWidget *manualScan = NULL;//manual scan
|
||||
CMenuWidget *autoScanAll = NULL;//auto scan all
|
||||
CMenuForwarder *fautoScanAll = NULL;
|
||||
#ifdef ENABLE_FASTSCAN
|
||||
CMenuWidget *fastScanMenu = NULL;//fast scan
|
||||
#endif /*ENABLE_FASTSCAN*/
|
||||
CMenuWidget *autoScan = NULL;//auto scan
|
||||
|
||||
CMenuOptionChooser *ojDiseqc = NULL;//diseqc modes
|
||||
CMenuOptionNumberChooser *ojDiseqcRepeats = NULL;//diseqc repeats
|
||||
|
||||
satNotify = new CSatelliteSetupNotifier();
|
||||
usalsNotify = new CAllUsalsNotifier();
|
||||
|
||||
//main
|
||||
settings = new CMenuWidget(is_wizard ? LOCALE_SERVICEMENU_SCANTS : LOCALE_SERVICEMENU_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
||||
settings->setSelected(selected);
|
||||
settings->setWizardMode(is_wizard);
|
||||
|
||||
//back
|
||||
settings->addIntroItems(is_wizard ? NONEXISTANT_LOCALE : LOCALE_SERVICEMENU_SCANTS);
|
||||
//----------------------------------------------------------------------
|
||||
//save scan settings
|
||||
settings->addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "save_scansettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
//----------------------------------------------------------------------
|
||||
settings->addItem(GenericMenuSeparatorLine);
|
||||
//----------------------------------------------------------------------
|
||||
//service select mode
|
||||
settings->addItem(new CMenuOptionChooser(LOCALE_ZAPIT_SCANTYPE, (int *)&scansettings.scanType, SCANTS_ZAPIT_SCANTYPE, SCANTS_ZAPIT_SCANTYPE_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true));
|
||||
|
||||
//bouquet generate mode
|
||||
settings->addItem(new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET, (int *)&scansettings.bouquetMode, SCANTS_BOUQUET_OPTIONS, SCANTS_BOUQUET_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true));
|
||||
|
||||
//t_satellite_position currentSatellitePosition = frontend->getCurrentSatellitePosition();
|
||||
//sat/provider selector
|
||||
satSelect = new CMenuOptionStringChooser(satprov_locale, scansettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||
satSetup = new CMenuWidget(satprov_locale, NEUTRINO_ICON_SETTINGS, width);
|
||||
|
||||
if (r_system == DVB_S) //sat
|
||||
{
|
||||
settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_RECEIVING_SYSTEM));
|
||||
|
||||
//diseqc on/off
|
||||
ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&scansettings.diseqcMode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, true, satNotify, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
//diseqc type
|
||||
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scansettings.diseqcRepeat, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL);
|
||||
|
||||
satNotify->addItem(1, ojDiseqcRepeats);
|
||||
//--------------------------------------------------------------
|
||||
//add diseqc items
|
||||
settings->addItem(ojDiseqc);
|
||||
settings->addItem(ojDiseqcRepeats);
|
||||
//--------------------------------------------------------------
|
||||
settings->addItem(GenericMenuSeparatorLine);
|
||||
//--------------------------------------------------------------
|
||||
|
||||
//lnb settings
|
||||
addScanMenuLnbSetup(satSetup);
|
||||
|
||||
//motor settings
|
||||
motorMenu = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS, width);
|
||||
addScanMenuMotorMenu(motorMenu);
|
||||
}
|
||||
else if (r_system == DVB_C) //cable
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
settings->addItem(GenericMenuSeparatorLine);
|
||||
//--------------------------------------------------------------
|
||||
//fsatSetup = new CMenuForwarder(LOCALE_CABLESETUP_PROVIDER, true, NULL, satSetup, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
addScanMenuProvider(satSetup);
|
||||
}
|
||||
|
||||
//tune timeout
|
||||
settings->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_FE_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 6, 100) );
|
||||
|
||||
if (r_system == DVB_S)
|
||||
{
|
||||
fmotorMenu = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED_MOTOR, true, NULL, motorMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, satSetup, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
//--------------------------------------------------------------
|
||||
settings->addItem(GenericMenuSeparatorLine);
|
||||
//--------------------------------------------------------------
|
||||
settings->addItem(fmotorMenu); //motor settings
|
||||
settings->addItem(fsatSetup); //lnb satsetup setup
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_SCAN));
|
||||
//--------------------------------------------------------------
|
||||
|
||||
if (!sfound && satellitePositions.size())
|
||||
{
|
||||
sit = satellitePositions.begin();
|
||||
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
||||
}
|
||||
|
||||
int w = getSatMenuListWidth();
|
||||
|
||||
//auto scan
|
||||
char autoscan[64];
|
||||
std::string s_capt_part = g_Locale->getText(satprov_locale);
|
||||
snprintf(autoscan, 64, g_Locale->getText(LOCALE_SATSETUP_AUTO_SCAN), s_capt_part.c_str());
|
||||
autoScan = new CMenuWidget(LOCALE_SERVICEMENU_SCANTS, NEUTRINO_ICON_SETTINGS, w/*width*/);
|
||||
addScanMenuAutoScan(autoScan);
|
||||
settings->addItem(new CMenuForwarderNonLocalized(autoscan, true, NULL, autoScan, "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
|
||||
//manual scan
|
||||
manualScan = new CMenuWidget(LOCALE_SATSETUP_MANUAL_SCAN, NEUTRINO_ICON_SETTINGS, w/*width*/);
|
||||
addScanMenuManualScan(manualScan);
|
||||
settings->addItem(new CMenuForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
|
||||
if (r_system == DVB_S)
|
||||
{
|
||||
//auto scan all
|
||||
autoScanAll = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN_ALL, NEUTRINO_ICON_SETTINGS, w/*width*/);
|
||||
addScanMenuAutoScanAll(autoScanAll);
|
||||
fautoScanAll = new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, (dmode != NO_DISEQC), NULL, autoScanAll, "", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
||||
satNotify->addItem(2, fautoScanAll);
|
||||
settings->addItem(fautoScanAll);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FASTSCAN
|
||||
if (r_system == DVB_S)
|
||||
{
|
||||
//fast scan
|
||||
fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS);
|
||||
addScanMenuFastScan(fastScanMenu);
|
||||
settings->addItem(new CMenuForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::convertDigitToKey(shortcut++)));
|
||||
}
|
||||
#endif /*ENABLE_FASTSCAN*/
|
||||
|
||||
settings->exec(NULL, "");
|
||||
settings->hide();
|
||||
selected = settings->getSelected();
|
||||
delete satNotify;
|
||||
delete usalsNotify;
|
||||
delete satSelect;
|
||||
delete settings;
|
||||
}
|
||||
|
||||
//init sat setup menu
|
||||
void CScanSetup::addScanMenuLnbSetup(CMenuWidget *sat_setup)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
sat_setup->addIntroItems();
|
||||
|
||||
CMenuWidget *satToSelect = new CMenuWidget(LOCALE_SATSETUP_SATELLITE, NEUTRINO_ICON_SETTINGS, width);
|
||||
|
||||
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;
|
||||
|
||||
//create selectable sat item
|
||||
addScanMenuSatOnOff(satToSelect);
|
||||
|
||||
//sub menu for sat settings to selectable sat item
|
||||
CMenuWidget *tempsat = new CMenuWidget(sit->second.name.c_str(), NEUTRINO_ICON_SETTINGS, width);
|
||||
addScanMenuTempSat(tempsat);
|
||||
sat_setup->addItem(new CMenuForwarderNonLocalized(sit->second.name.c_str(), true, NULL, tempsat));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//init cable provider menu
|
||||
void CScanSetup::addScanMenuProvider(CMenuWidget *provider_setup)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
provider_setup->addIntroItems();
|
||||
|
||||
//don't misunderstand the name "satSelect", in this context it's actually for cable providers
|
||||
//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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//init sat find menu
|
||||
void CScanSetup::addScanMenuSatFind(CMenuWidget *sat_findMenu)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
sat_findMenu->addIntroItems();
|
||||
|
||||
sat_findMenu->addItem(satSelect);
|
||||
sat_findMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler()/*tpSelect*/, "test", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
|
||||
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
||||
//--------------------------------------------------------------
|
||||
addScanOptionsItems(sat_findMenu);
|
||||
//--------------------------------------------------------------
|
||||
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
sat_findMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, new CMotorControl(), "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
|
||||
if (!sfound && satellitePositions.size()) {
|
||||
sit = satellitePositions.begin();
|
||||
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
//init sat on off menu
|
||||
void CScanSetup::addScanMenuSatOnOff(CMenuWidget *sat_OnOff)
|
||||
{
|
||||
sat_OnOff->addIntroItems();
|
||||
//----------------------------------------------------------------------
|
||||
sat_OnOff->addItem(new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
}
|
||||
|
||||
//init tempsat menu
|
||||
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat)
|
||||
{
|
||||
temp_sat->addIntroItems();
|
||||
|
||||
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);
|
||||
|
||||
temp_sat->addItem(diseqc);
|
||||
temp_sat->addItem(comm);
|
||||
temp_sat->addItem(uncomm);
|
||||
temp_sat->addItem(motor);
|
||||
temp_sat->addItem(usals);
|
||||
temp_sat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL));
|
||||
temp_sat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH));
|
||||
temp_sat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFS, true, lofS->getValue(), lofS));
|
||||
}
|
||||
|
||||
//init motor settings
|
||||
void CScanSetup::addScanMenuMotorMenu(CMenuWidget *motor_Menu)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
motor_Menu->addIntroItems();
|
||||
|
||||
CMenuWidget* satfindMenu = new CMenuWidget(LOCALE_MOTORCONTROL_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
||||
addScanMenuSatFind(satfindMenu);
|
||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, satfindMenu, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
motor_Menu->addItem(GenericMenuSeparatorLine);
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
motor_Menu->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&zapitCfg.motorRotationSpeed, true, 0, 64, NULL) );
|
||||
motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&zapitCfg.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
//motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, (int *)&zapitCfg.useGotoXX, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
|
||||
CStringInput *toff = NULL;
|
||||
sprintf(zapit_lat, "%02.6f", zapitCfg.gotoXXLatitude);
|
||||
sprintf(zapit_long, "%02.6f", zapitCfg.gotoXXLongitude);
|
||||
|
||||
motor_Menu->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.");
|
||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_EXTRA_LATITUDE, true, zapit_lat, toff));
|
||||
|
||||
motor_Menu->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.");
|
||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_EXTRA_LONGITUDE, true, zapit_long, toff));
|
||||
|
||||
motor_Menu->addItem(new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF) );
|
||||
|
||||
CMenuOptionChooser * allusals = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, usalsNotify);
|
||||
motor_Menu->addItem(allusals);
|
||||
|
||||
}
|
||||
|
||||
//init manual scan menu
|
||||
void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
int shortCut = 1;
|
||||
|
||||
manual_Scan->addIntroItems();
|
||||
//----------------------------------------------------------------------
|
||||
manual_Scan->addItem(satSelect);
|
||||
manual_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler()/*tpSelect*/, "test", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
|
||||
manual_Scan->addItem(GenericMenuSeparatorLine);
|
||||
//----------------------------------------------------------------------
|
||||
shortCut = addScanOptionsItems(manual_Scan, shortCut);
|
||||
addListFlagsItems(manual_Scan, shortCut);
|
||||
//----------------------------------------------------------------------
|
||||
manual_Scan->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
manual_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_TEST, true, NULL, this, "scan_test", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
manual_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, this, "scan_manual", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
|
||||
}
|
||||
|
||||
//init auto scan all menu
|
||||
void CScanSetup::addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
auto_ScanAll->addIntroItems();
|
||||
//----------------------------------------------------------------------
|
||||
CMenuWidget* satInUse = new CMenuWidget(satprov_locale, NEUTRINO_ICON_SETTINGS, width);
|
||||
satInUse->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;
|
||||
|
||||
satInUse->addItem(new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||
}
|
||||
|
||||
auto_ScanAll->addItem(new CMenuForwarder(satprov_locale, true, NULL, satInUse, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
|
||||
auto_ScanAll->addItem(GenericMenuSeparatorLine);
|
||||
//----------------------------------------------------------------------
|
||||
addListFlagsItems(auto_ScanAll, 1);
|
||||
//----------------------------------------------------------------------
|
||||
auto_ScanAll->addItem(GenericMenuSeparatorLine);
|
||||
auto_ScanAll->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, this, "scan_all", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FASTSCAN
|
||||
//init fast scan menu
|
||||
void CScanSetup::addScanMenuFastScan(CMenuWidget *fast_ScanMenu)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
fast_ScanMenu->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);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
fast_ScanMenu->addItem(fastProv);
|
||||
fast_ScanMenu->addItem(fastType);
|
||||
//----------------------------------------------------------------------
|
||||
fast_ScanMenu->addItem(GenericMenuSeparatorLine);
|
||||
fast_ScanMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, this, "scan_fast", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
}
|
||||
#endif /*ENABLE_FASTSCAN*/
|
||||
|
||||
//init auto scan menu
|
||||
void CScanSetup::addScanMenuAutoScan(CMenuWidget *auto_Scan)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
auto_Scan->addIntroItems();
|
||||
|
||||
auto_Scan->addItem(satSelect);
|
||||
auto_Scan->addItem(GenericMenuSeparatorLine);
|
||||
//----------------------------------------------------------------------
|
||||
addListFlagsItems(auto_Scan, 1);
|
||||
//----------------------------------------------------------------------
|
||||
auto_Scan->addItem(GenericMenuSeparatorLine);
|
||||
auto_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, this, "scan_autoscan", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||
|
||||
}
|
||||
|
||||
//create scan options items
|
||||
int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortcut)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
int shortCut = shortcut;
|
||||
|
||||
CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.TP_freq, freq_length, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
|
||||
CMenuForwarder *Freq = new CMenuForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
|
||||
|
||||
CStringInput *rate = new CStringInput(LOCALE_EXTRA_TP_RATE, (char *) scansettings.TP_rate, 8, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
|
||||
CMenuForwarder *Rate = new CMenuForwarder(LOCALE_EXTRA_TP_RATE, true, scansettings.TP_rate, rate, "", CRCInput::convertDigitToKey(shortCut++));
|
||||
|
||||
CMenuOptionChooser *fec = new CMenuOptionChooser(LOCALE_EXTRA_TP_FEC, (int *)&scansettings.TP_fec, SATSETUP_SCANTP_FEC, fec_count, true, NULL, CRCInput::convertDigitToKey(shortCut++), "", true);
|
||||
|
||||
CMenuOptionChooser *mod_pol= NULL;
|
||||
if (r_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(shortCut++));
|
||||
else if (r_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(shortCut++));
|
||||
|
||||
options_menu->addItem(Freq);
|
||||
options_menu->addItem(Rate);
|
||||
options_menu->addItem(fec);
|
||||
options_menu->addItem(mod_pol);
|
||||
|
||||
return shortCut;
|
||||
}
|
||||
|
||||
//create list flag items
|
||||
int CScanSetup::addListFlagsItems(CMenuWidget *listflags_menu, const int &shortcut)
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
int shortCut = shortcut;
|
||||
|
||||
CMenuOptionChooser *useNit = new CMenuOptionChooser(LOCALE_SATSETUP_USE_NIT, (int *)&scansettings.scan_mode, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
|
||||
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(shortCut++));
|
||||
CMenuOptionChooser *scanPid = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_SCANPIDS, &scan_pids, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
|
||||
|
||||
listflags_menu->addItem(useNit);
|
||||
listflags_menu->addItem(ftaFlag);
|
||||
listflags_menu->addItem(scanPid);
|
||||
|
||||
return shortCut;
|
||||
}
|
||||
|
||||
//sets menu mode to "wizard" or "default"
|
||||
void CScanSetup::setWizardMode(bool mode)
|
||||
{
|
||||
printf("[neutrino] CScanSetup %s set scan-setup to mode %d...\n", __FUNCTION__, mode);
|
||||
is_wizard = mode;
|
||||
}
|
||||
|
||||
//save current settings
|
||||
void CScanSetup::saveScanSetup()
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||
SaveMotorPositions();
|
||||
zapitCfg.gotoXXLatitude = strtod(zapit_lat, NULL);
|
||||
zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
|
||||
|
||||
setZapitConfig(&zapitCfg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
|
||||
{
|
||||
transponder_list_t::iterator tI;
|
||||
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(), scansettings.satNameNoDiseqc))
|
||||
{
|
||||
position = sit->first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (old_position != position)
|
||||
{
|
||||
old_selected = 0;
|
||||
old_position = position;
|
||||
}
|
||||
|
||||
CMenuWidget menu(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 += scansettings.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 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(scansettings.TP_freq, "%d", tmpI->second.feparams.frequency);
|
||||
|
||||
switch (frontend->getInfo()->type)
|
||||
{
|
||||
case FE_QPSK:
|
||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qpsk.symbol_rate);
|
||||
scansettings.TP_fec = tmpI->second.feparams.u.qpsk.fec_inner;
|
||||
scansettings.TP_pol = tmpI->second.polarization;
|
||||
break;
|
||||
case FE_QAM:
|
||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate);
|
||||
scansettings.TP_fec = tmpI->second.feparams.u.qam.fec_inner;
|
||||
scansettings.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;
|
||||
}
|
||||
|
110
src/gui/scan_setup.h
Normal file
110
src/gui/scan_setup.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
scan_setup menue - Neutrino-GUI
|
||||
|
||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Reworked as similar to $Id: scan_setup.h,v 1.6 2010/12/05 22:32:12 tuxbox-cvs Exp $
|
||||
Copyright (C) 2011 T. Graf 'dbt'
|
||||
Homepage: http://www.dbox2-tuning.net/
|
||||
|
||||
License: GPL
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __SCAN_SETUP__
|
||||
#define __SCAN_SETUP__
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/widget/icons.h>
|
||||
|
||||
#include <system/setting_helpers.h>
|
||||
#include <system/settings.h>
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
#define scansettings CNeutrinoApp::getInstance()->getScanSettings()
|
||||
|
||||
#define ENABLE_FASTSCAN //don't define this to remove fast scan menu
|
||||
|
||||
class CScanSetup : public CMenuTarget
|
||||
{
|
||||
private:
|
||||
CSatelliteSetupNotifier *satNotify;
|
||||
CAllUsalsNotifier *usalsNotify;
|
||||
|
||||
CMenuOptionStringChooser *satSelect;
|
||||
|
||||
bool is_wizard;
|
||||
|
||||
int width, selected;
|
||||
int dmode;
|
||||
int sfound;
|
||||
int fec_count;
|
||||
int freq_length;
|
||||
int r_system;
|
||||
|
||||
neutrino_locale_t satprov_locale;
|
||||
|
||||
uint getSatMenuListWidth();
|
||||
|
||||
void showScanMenu();
|
||||
|
||||
void addScanMenuLnbSetup(CMenuWidget *sat_setup);
|
||||
void addScanMenuProvider(CMenuWidget *provider_setup);
|
||||
void addScanMenuSatFind(CMenuWidget *sat_findMenu);
|
||||
void addScanMenuSatOnOff(CMenuWidget *sat_OnOff);
|
||||
void addScanMenuTempSat(CMenuWidget *temp_sat);
|
||||
void addScanMenuMotorMenu(CMenuWidget *motor_Menu);
|
||||
void addScanMenuManualScan(CMenuWidget *manual_Scan);
|
||||
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);
|
||||
void addScanMenuFastScan(CMenuWidget *fast_ScanMenu);
|
||||
void addScanMenuAutoScan(CMenuWidget *auto_Scan);
|
||||
|
||||
int addScanOptionsItems(CMenuWidget *options_menu, const int &shortcut = 1);
|
||||
int addListFlagsItems(CMenuWidget *listflags_menu, const int &shortcut = 1);
|
||||
|
||||
void saveScanSetup();
|
||||
|
||||
public:
|
||||
enum SCAN_SETUP_MODE
|
||||
{
|
||||
SCAN_SETUP_MODE_WIZARD_NO = 0,
|
||||
SCAN_SETUP_MODE_WIZARD = 1
|
||||
};
|
||||
|
||||
CScanSetup(bool wizard_mode = SCAN_SETUP_MODE_WIZARD_NO);
|
||||
~CScanSetup();
|
||||
|
||||
static CScanSetup* getInstance();
|
||||
|
||||
bool getWizardMode() {return is_wizard;};
|
||||
void setWizardMode(bool mode);
|
||||
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey = "");
|
||||
};
|
||||
|
||||
class CTPSelectHandler : public CMenuTarget
|
||||
{
|
||||
public:
|
||||
int exec(CMenuTarget* parent, const std::string &actionkey);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -47,6 +47,7 @@
|
||||
|
||||
#include "gui/widget/hintbox.h"
|
||||
#include "gui/scan.h"
|
||||
#include "gui/scan_setup.h"
|
||||
|
||||
extern int cs_test_card(int unit, char * str);
|
||||
|
||||
@@ -253,19 +254,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
|
||||
int freq = (actionKey == "22kon") ? 12000*1000: 11000*1000;
|
||||
|
||||
sprintf(get_set.TP_freq, "%d", freq);
|
||||
sprintf(scansettings.TP_freq, "%d", freq);
|
||||
#if 0 // not needed ?
|
||||
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;
|
||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qpsk.symbol_rate);
|
||||
scansettings.TP_fec = tmpI->second.feparams.u.qpsk.fec_inner;
|
||||
scansettings.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;
|
||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate);
|
||||
scansettings.TP_fec = tmpI->second.feparams.u.qam.fec_inner;
|
||||
scansettings.TP_mod = tmpI->second.feparams.u.qam.modulation;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@@ -279,19 +280,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
CScanTs * scanTs = new CScanTs();
|
||||
|
||||
int freq = 12538000;
|
||||
sprintf(get_set.TP_freq, "%d", freq);
|
||||
sprintf(scansettings.TP_freq, "%d", freq);
|
||||
switch (frontend->getInfo()->type)
|
||||
{
|
||||
case FE_QPSK:
|
||||
sprintf(get_set.TP_rate, "%d", 41250*1000);
|
||||
get_set.TP_fec = 1;
|
||||
get_set.TP_pol = 1;
|
||||
sprintf(scansettings.TP_rate, "%d", 41250*1000);
|
||||
scansettings.TP_fec = 1;
|
||||
scansettings.TP_pol = 1;
|
||||
break;
|
||||
case FE_QAM:
|
||||
#if 0
|
||||
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;
|
||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate);
|
||||
scansettings.TP_fec = tmpI->second.feparams.u.qam.fec_inner;
|
||||
scansettings.TP_mod = tmpI->second.feparams.u.qam.modulation;
|
||||
#endif
|
||||
break;
|
||||
case FE_OFDM:
|
||||
|
156
src/neutrino.cpp
156
src/neutrino.cpp
@@ -62,84 +62,86 @@
|
||||
#include <daemonc/remotecontrol.h>
|
||||
|
||||
#include <driver/encoding.h>
|
||||
#include <driver/framebuffer.h>
|
||||
#include <driver/fontrenderer.h>
|
||||
#include <driver/framebuffer.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/shutdown_count.h>
|
||||
#include <driver/stream2file.h>
|
||||
#include <driver/vcrcontrol.h>
|
||||
#include <driver/shutdown_count.h>
|
||||
|
||||
#if HAVE_TRIPLEDRAGON
|
||||
#include <driver/lcdd.h>
|
||||
#include "gui/widget/lcdcontroler.h"
|
||||
#endif
|
||||
#include <gui/epgplus.h>
|
||||
#include <gui/streaminfo2.h>
|
||||
|
||||
#include "gui/alphasetup.h"
|
||||
#include "gui/audioplayer.h"
|
||||
#include "gui/bouquetlist.h"
|
||||
#include "gui/cam_menu.h"
|
||||
#include "gui/cec_setup.h"
|
||||
#include "gui/channellist.h"
|
||||
#include "gui/color.h"
|
||||
#include "gui/customcolor.h"
|
||||
#include "gui/epg_menu.h"
|
||||
#include "gui/epgview.h"
|
||||
#include "gui/eventlist.h"
|
||||
#include "gui/favorites.h"
|
||||
#include "gui/filebrowser.h"
|
||||
#include "gui/hdd_menu.h"
|
||||
#include "gui/imageinfo.h"
|
||||
#include "gui/infoviewer.h"
|
||||
#include "gui/mediaplayer.h"
|
||||
#include "gui/motorcontrol.h"
|
||||
#include "gui/movieplayer.h"
|
||||
#include "gui/nfs.h"
|
||||
#include "gui/osd_setup.h"
|
||||
#include "gui/osdlang_setup.h"
|
||||
#include "gui/pictureviewer.h"
|
||||
#include "gui/pluginlist.h"
|
||||
#include "gui/plugins.h"
|
||||
#include "gui/rc_lock.h"
|
||||
#include "gui/scan.h"
|
||||
#include "gui/scan_setup.h"
|
||||
#include "gui/screensetup.h"
|
||||
#include "gui/sleeptimer.h"
|
||||
#include "gui/timerlist.h"
|
||||
#include "gui/update.h"
|
||||
#include "gui/upnpbrowser.h"
|
||||
#include "gui/videosettings.h"
|
||||
#include "gui/widget/colorchooser.h"
|
||||
#include "gui/widget/menue.h"
|
||||
#include "gui/widget/messagebox.h"
|
||||
#include "gui/widget/hintbox.h"
|
||||
#include "gui/widget/icons.h"
|
||||
#include "gui/widget/keychooser.h"
|
||||
#include "gui/widget/menue.h"
|
||||
#include "gui/widget/messagebox.h"
|
||||
#include "gui/widget/mountchooser.h"
|
||||
#include "gui/widget/stringinput.h"
|
||||
#include "gui/widget/stringinput_ext.h"
|
||||
#include "gui/epgplus.h"
|
||||
#include "gui/streaminfo2.h"
|
||||
|
||||
#if HAVE_COOL_HARDWARE
|
||||
#include "gui/widget/vfdcontroler.h"
|
||||
#include "gui/widget/progressbar.h"
|
||||
#endif
|
||||
#include "gui/widget/keychooser.h"
|
||||
#include "gui/widget/stringinput.h"
|
||||
#include "gui/widget/stringinput_ext.h"
|
||||
#include "gui/widget/mountchooser.h"
|
||||
#include "gui/videosettings.h"
|
||||
#include "gui/osdlang_setup.h"
|
||||
#include "gui/osd_setup.h"
|
||||
#include "gui/color.h"
|
||||
#include "gui/customcolor.h"
|
||||
#include "gui/mediaplayer.h"
|
||||
|
||||
#include "gui/bedit/bouqueteditor_bouquets.h"
|
||||
#include "gui/bouquetlist.h"
|
||||
#include "gui/eventlist.h"
|
||||
#include "gui/channellist.h"
|
||||
#include "gui/screensetup.h"
|
||||
#include "gui/pluginlist.h"
|
||||
#include "gui/plugins.h"
|
||||
#include "gui/infoviewer.h"
|
||||
#include "gui/epgview.h"
|
||||
#include "gui/epg_menu.h"
|
||||
#include "gui/update.h"
|
||||
#include "gui/scan.h"
|
||||
#include "gui/favorites.h"
|
||||
#include "gui/sleeptimer.h"
|
||||
#include "gui/rc_lock.h"
|
||||
#include "gui/timerlist.h"
|
||||
#include "gui/alphasetup.h"
|
||||
#include "gui/audioplayer.h"
|
||||
#include "gui/imageinfo.h"
|
||||
#include "gui/movieplayer.h"
|
||||
#include "gui/nfs.h"
|
||||
#include "gui/pictureviewer.h"
|
||||
#include "gui/motorcontrol.h"
|
||||
#include "gui/filebrowser.h"
|
||||
#include "gui/cam_menu.h"
|
||||
#include "gui/hdd_menu.h"
|
||||
#include "gui/upnpbrowser.h"
|
||||
#include <audio.h>
|
||||
#include <ca_cs.h>
|
||||
#include <cs_api.h>
|
||||
#include <video.h>
|
||||
#include <pwrmngr.h>
|
||||
|
||||
#include <system/setting_helpers.h>
|
||||
#include <system/settings.h>
|
||||
#include <system/debug.h>
|
||||
#include <system/flashtool.h>
|
||||
#include <system/fsmounter.h>
|
||||
#include <system/setting_helpers.h>
|
||||
#include <system/settings.h>
|
||||
|
||||
#include <timerdclient/timerdmsg.h>
|
||||
#include <zapit/satconfig.h>
|
||||
#include <zapit/getservices.h>
|
||||
|
||||
#include <cs_api.h>
|
||||
#include <video.h>
|
||||
#include <audio.h>
|
||||
#include <zapit/frontend_c.h>
|
||||
#include <pwrmngr.h>
|
||||
#include <ca_cs.h>
|
||||
#include <zapit/getservices.h>
|
||||
#include <zapit/satconfig.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <linux/reboot.h>
|
||||
@@ -187,7 +189,7 @@ void * zapit_main_thread(void *data);
|
||||
extern t_channel_id live_channel_id; //zapit
|
||||
extern t_channel_id rec_channel_id; //zapit
|
||||
extern CZapitChannel *g_current_channel;
|
||||
void setZapitConfig(Zapit_config * Cfg);
|
||||
// void setZapitConfig(Zapit_config * Cfg);
|
||||
void getZapitConfig(Zapit_config *Cfg);
|
||||
|
||||
void * nhttpd_main_thread(void *data);
|
||||
@@ -2224,13 +2226,12 @@ int CNeutrinoApp::run(int argc, char **argv)
|
||||
//Main settings
|
||||
CMenuWidget mainMenu (LOCALE_MAINMENU_HEAD , NEUTRINO_ICON_MAINMENU/*, 22*/);
|
||||
CMenuWidget mainSettings (LOCALE_MAINSETTINGS_HEAD , NEUTRINO_ICON_SETTINGS);
|
||||
CMenuWidget _scanSettings (LOCALE_SERVICEMENU_SCANTS , NEUTRINO_ICON_SETTINGS);
|
||||
CMenuWidget service (LOCALE_SERVICEMENU_HEAD , NEUTRINO_ICON_SETTINGS);
|
||||
|
||||
InitMainMenu(mainMenu, mainSettings, service);
|
||||
|
||||
InitServiceSettings(service, _scanSettings);
|
||||
InitScanSettings(_scanSettings);
|
||||
InitServiceSettings(service);
|
||||
|
||||
|
||||
dprintf( DEBUG_NORMAL, "registering as event client\n");
|
||||
|
||||
@@ -2324,9 +2325,9 @@ int CNeutrinoApp::run(int argc, char **argv)
|
||||
}
|
||||
if(ret != menu_return::RETURN_EXIT_ALL)
|
||||
{
|
||||
_scanSettings.setWizardMode(true);
|
||||
_scanSettings.exec(NULL, "");
|
||||
_scanSettings.setWizardMode(false);
|
||||
CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD);
|
||||
ret = CScanSetup::getInstance()->exec(NULL, "");
|
||||
CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO);
|
||||
}
|
||||
|
||||
videoDecoder->StopPicture();
|
||||
@@ -2749,22 +2750,22 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
||||
if(g_current_channel) {
|
||||
sat_iterator_t sit = satellitePositions.find(g_current_channel->getSatellitePosition());
|
||||
if(sit != satellitePositions.end())
|
||||
strncpy(get_set.satNameNoDiseqc, sit->second.name.c_str(), 50);
|
||||
strncpy(scanSettings.satNameNoDiseqc, sit->second.name.c_str(), 50);
|
||||
|
||||
transponder_list_t::iterator tI;
|
||||
tI = transponders.find(g_current_channel->getTransponderId());
|
||||
if(tI != transponders.end()) {
|
||||
sprintf(get_set.TP_freq, "%d", tI->second.feparams.frequency);
|
||||
sprintf(scanSettings.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;
|
||||
sprintf(scanSettings.TP_rate, "%d", tI->second.feparams.u.qpsk.symbol_rate);
|
||||
scanSettings.TP_fec = tI->second.feparams.u.qpsk.fec_inner;
|
||||
scanSettings.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;
|
||||
sprintf(scanSettings.TP_rate, "%d", tI->second.feparams.u.qam.symbol_rate);
|
||||
scanSettings.TP_fec = tI->second.feparams.u.qam.fec_inner;
|
||||
scanSettings.TP_mod = tI->second.feparams.u.qam.modulation;
|
||||
break;
|
||||
case FE_OFDM:
|
||||
case FE_ATSC:
|
||||
@@ -4172,24 +4173,18 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
g_RCInput->postMsg( NeutrinoMessages::VCR_ON, 0 );
|
||||
returnval = menu_return::RETURN_EXIT_ALL;
|
||||
}
|
||||
else if(actionKey=="savescansettings") {
|
||||
SaveMotorPositions();
|
||||
}
|
||||
else if(actionKey=="savesettings") {
|
||||
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8
|
||||
hintBox->paint();
|
||||
|
||||
saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||
SaveMotorPositions();
|
||||
|
||||
zapitCfg.gotoXXLatitude = strtod(zapit_lat, NULL);
|
||||
zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
|
||||
|
||||
setZapitConfig(&zapitCfg);
|
||||
if(g_settings.cacheTXT) {
|
||||
tuxtxt_init();
|
||||
} else
|
||||
tuxtxt_close();
|
||||
|
||||
CScanSetup::getInstance()->exec(NULL, "save_scansettings");
|
||||
|
||||
//g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60));
|
||||
//g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24));
|
||||
@@ -4200,17 +4195,6 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
else if(actionKey=="recording") {
|
||||
setupRecordingDevice();
|
||||
}
|
||||
else if(actionKey=="reloadchannels") {
|
||||
//reloadhintBox->paint();
|
||||
g_Zapit->reinitChannels();
|
||||
#if 0
|
||||
system(mode == mode_radio
|
||||
? "wget -q -O /dev/null http://127.0.0.1/control/setmode?radio > /dev/null 2>&1"
|
||||
: "wget -q -O /dev/null http://127.0.0.1/control/setmode?tv > /dev/null 2>&1");
|
||||
#endif
|
||||
//reloadhintBox->hide();
|
||||
|
||||
}
|
||||
else if(actionKey=="reloadplugins") {
|
||||
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT));
|
||||
hintBox->paint();
|
||||
|
@@ -170,9 +170,8 @@ private:
|
||||
void ExitRun(const bool write_si = true, int retcode = 0);
|
||||
void RealRun(CMenuWidget &mainSettings);
|
||||
void InitZapper();
|
||||
void InitServiceSettings(CMenuWidget &, CMenuWidget &);
|
||||
void InitServiceSettings(CMenuWidget &);
|
||||
void InitScreenSettings(CMenuWidget &);
|
||||
void InitScanSettings(CMenuWidget &);
|
||||
void InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings, CMenuWidget &service);
|
||||
|
||||
void SetupFrameBuffer();
|
||||
|
@@ -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();
|
||||
|
@@ -1254,6 +1254,8 @@ typedef enum
|
||||
LOCALE_SCANTS_NUMBEROFRADIOSERVICES,
|
||||
LOCALE_SCANTS_NUMBEROFTOTALSERVICES,
|
||||
LOCALE_SCANTS_NUMBEROFTVSERVICES,
|
||||
LOCALE_SCANTS_PREVERENCES_RECEIVING_SYSTEM,
|
||||
LOCALE_SCANTS_PREVERENCES_SCAN,
|
||||
LOCALE_SCANTS_PROVIDER,
|
||||
LOCALE_SCANTS_SELECT_TP,
|
||||
LOCALE_SCANTS_STARTNOW,
|
||||
|
@@ -1254,6 +1254,8 @@ const char * locale_real_names[] =
|
||||
"scants.numberofradioservices",
|
||||
"scants.numberoftotalservices",
|
||||
"scants.numberoftvservices",
|
||||
"scants.preverences_receiving_system",
|
||||
"scants.preverences_scan",
|
||||
"scants.provider",
|
||||
"scants.select_tp",
|
||||
"scants.startnow",
|
||||
|
@@ -558,8 +558,6 @@ const int PARENTALLOCK_PROMPT_ONSTART = 1;
|
||||
const int PARENTALLOCK_PROMPT_CHANGETOLOCKED = 2;
|
||||
const int PARENTALLOCK_PROMPT_ONSIGNAL = 3;
|
||||
|
||||
#define MAX_SATELLITES 80
|
||||
#define get_set CNeutrinoApp::getInstance()->getScanSettings()
|
||||
|
||||
class CScanSettings
|
||||
{
|
||||
|
@@ -2354,6 +2354,7 @@ void send_ca_id(int caid)
|
||||
|
||||
void setZapitConfig(Zapit_config * Cfg)
|
||||
{
|
||||
printf("[zapit] %s...\n", __FUNCTION__);
|
||||
motorRotationSpeed = Cfg->motorRotationSpeed;
|
||||
config.setInt32("motorRotationSpeed", motorRotationSpeed);
|
||||
config.setBool("writeChannelsNames", Cfg->writeChannelsNames);
|
||||
@@ -2380,7 +2381,7 @@ void setZapitConfig(Zapit_config * Cfg)
|
||||
void sendConfig(int connfd)
|
||||
{
|
||||
Zapit_config Cfg;
|
||||
|
||||
printf("[zapit] %s...\n", __FUNCTION__);
|
||||
Cfg.motorRotationSpeed = motorRotationSpeed;
|
||||
Cfg.writeChannelsNames = config.getBool("writeChannelsNames", true);
|
||||
Cfg.makeRemainingChannelsBouquet = config.getBool("makeRemainingChannelsBouquet", true);
|
||||
@@ -2404,6 +2405,7 @@ void sendConfig(int connfd)
|
||||
|
||||
void getZapitConfig(Zapit_config *Cfg)
|
||||
{
|
||||
printf("[zapit] %s...\n", __FUNCTION__);
|
||||
Cfg->motorRotationSpeed = motorRotationSpeed;
|
||||
Cfg->writeChannelsNames = config.getBool("writeChannelsNames", true);
|
||||
Cfg->makeRemainingChannelsBouquet = config.getBool("makeRemainingChannelsBouquet", true);
|
||||
|
Reference in New Issue
Block a user