add --enable-fastscan configure option

The #define in src/gui/scan_setup.h did not work (undefining
ENABLE_FASTSCAN caused really strange side effects wrt background
scanning in standby mode), and all the unused code was still built.
With this configure option, people who really want this obscure feature
can enable it for their builds.
This commit is contained in:
Stefan Seyfried
2017-02-04 12:09:47 +01:00
parent ffa3fdd6c8
commit 6525d1164a
6 changed files with 32 additions and 6 deletions

View File

@@ -165,6 +165,12 @@ AC_ARG_ENABLE(viasatepg,
[ --enable-viasatepg enable ViaSat EPG code (experimental)], [ --enable-viasatepg enable ViaSat EPG code (experimental)],
[AC_DEFINE(ENABLE_VIASATEPG,1,[enable ViaSat EPG code])]) [AC_DEFINE(ENABLE_VIASATEPG,1,[enable ViaSat EPG code])])
AC_ARG_ENABLE(fastscan,
[ --enable-fastscan enable Fastscan code)],
[AC_DEFINE(ENABLE_FASTSCAN,1,[enable fastscan code])])
AM_CONDITIONAL(ENABLE_FASTSCAN, test "$enable_fastscan" = "yes")
AC_ARG_ENABLE(giflib, AC_ARG_ENABLE(giflib,
AS_HELP_STRING(--enable-giflib,use giflib instead of libungif), AS_HELP_STRING(--enable-giflib,use giflib instead of libungif),
,[enable_giflib=no]) ,[enable_giflib=no])

View File

@@ -2,7 +2,7 @@
Neutrino-GUI - DBoxII-Project Neutrino-GUI - DBoxII-Project
Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2001 Steffen Hehn 'McClean'
Copyright (C) 2011-2012 Stefan Seyfried Copyright (C) 2011-2013,2015,2017 Stefan Seyfried
License: GPL License: GPL
@@ -169,6 +169,13 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
bool test = actionKey == "test"; bool test = actionKey == "test";
bool manual = (actionKey == "manual") || test; bool manual = (actionKey == "manual") || test;
bool fast = (actionKey == "fast"); bool fast = (actionKey == "fast");
#if !ENABLE_FASTSCAN
if (fast) {
/* popup message? But this *should* be impossible to happen anyway */
fprintf(stderr, "CScanTs::exec: fastscan disabled at build-time!\n");
return menu_return::RETURN_REPAINT;
}
#endif
if (CFrontend::isSat(delsys)) if (CFrontend::isSat(delsys))
pname = scansettings.satName; pname = scansettings.satName;
@@ -299,8 +306,10 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
} else if(manual) } else if(manual)
success = g_Zapit->scan_TP(TP); success = g_Zapit->scan_TP(TP);
else if(fast) { else if(fast) {
#if ENABLE_FASTSCAN
CServiceScan::getInstance()->QuietFastScan(false); CServiceScan::getInstance()->QuietFastScan(false);
success = CZapit::getInstance()->StartFastScan(scansettings.fast_type, scansettings.fast_op); success = CZapit::getInstance()->StartFastScan(scansettings.fast_type, scansettings.fast_op);
#endif
} }
else else
success = g_Zapit->startScan(scan_flags); success = g_Zapit->startScan(scan_flags);

View File

@@ -42,8 +42,6 @@
#define scansettings CNeutrinoApp::getInstance()->getScanSettings() #define scansettings CNeutrinoApp::getInstance()->getScanSettings()
//#define ENABLE_FASTSCAN //don't define this to remove fast scan menu
class CScanSetup : public CMenuTarget, public CChangeObserver class CScanSetup : public CMenuTarget, public CChangeObserver
{ {
protected: protected:

View File

@@ -4,7 +4,7 @@
Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys and some other guys
Copyright (C) 2006-2016 Stefan Seyfried Copyright (C) 2006-2017 Stefan Seyfried
Copyright (C) 2011 CoolStream International Ltd Copyright (C) 2011 CoolStream International Ltd
@@ -4852,6 +4852,7 @@ void CNeutrinoApp::Cleanup()
#endif #endif
} }
#if ENABLE_FASTSCAN
void CNeutrinoApp::CheckFastScan(bool standby, bool reload) void CNeutrinoApp::CheckFastScan(bool standby, bool reload)
{ {
if (scansettings.fst_update) { if (scansettings.fst_update) {
@@ -4883,6 +4884,11 @@ void CNeutrinoApp::CheckFastScan(bool standby, bool reload)
} }
} }
} }
#else
void CNeutrinoApp::CheckFastScan(bool, bool)
{
}
#endif
bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id)
{ {

View File

@@ -109,6 +109,7 @@ class CServiceScan : public OpenThreads::Thread
uint32_t tune_tp_index; uint32_t tune_tp_index;
unsigned char fst_version; unsigned char fst_version;
#if ENABLE_FASTSCAN
bool quiet_fastscan; bool quiet_fastscan;
void InitFastscanLnb(int id); void InitFastscanLnb(int id);
bool FastscanTune(int id); bool FastscanTune(int id);
@@ -120,7 +121,7 @@ class CServiceScan : public OpenThreads::Thread
void process_satellite_delivery_system_descriptor(const unsigned char * const buffer, FrontendParameters * feparams, t_satellite_position * satellitePosition); void process_satellite_delivery_system_descriptor(const unsigned char * const buffer, FrontendParameters * feparams, t_satellite_position * satellitePosition);
bool ScanFast(); bool ScanFast();
void ReportFastScan(FrontendParameters &feparams, t_satellite_position satellitePosition); void ReportFastScan(FrontendParameters &feparams, t_satellite_position satellitePosition);
#endif
void run(); void run();
CFrontend * frontend; CFrontend * frontend;
@@ -151,12 +152,14 @@ class CServiceScan : public OpenThreads::Thread
bool isFtaOnly() { return flags & SCAN_FTA; } bool isFtaOnly() { return flags & SCAN_FTA; }
int GetFlags() { return flags; } int GetFlags() { return flags; }
bool SatHaveChannels() { return satHaveChannels; } bool SatHaveChannels() { return satHaveChannels; }
#if ENABLE_FASTSCAN
/* fast-scan */ /* fast-scan */
bool TestDiseqcConfig(int num); bool TestDiseqcConfig(int num);
bool ReadFstVersion(int num); bool ReadFstVersion(int num);
unsigned char GetFstVersion() { return fst_version; } unsigned char GetFstVersion() { return fst_version; }
void QuietFastScan(bool enable) { quiet_fastscan = enable; } void QuietFastScan(bool enable) { quiet_fastscan = enable; }
bool ScanFast(int num, bool reload = true); bool ScanFast(int num, bool reload = true);
#endif
}; };
#endif /* __scan_h__ */ #endif /* __scan_h__ */

View File

@@ -20,7 +20,6 @@ libzapit_a_SOURCES = \
bouquets.cpp \ bouquets.cpp \
capmt.cpp \ capmt.cpp \
channel.cpp \ channel.cpp \
fastscan.cpp \
femanager.cpp \ femanager.cpp \
frontend.cpp \ frontend.cpp \
getservices.cpp \ getservices.cpp \
@@ -33,6 +32,11 @@ libzapit_a_SOURCES = \
transponder.cpp \ transponder.cpp \
zapit.cpp zapit.cpp
if ENABLE_FASTSCAN
libzapit_a_SOURCES += \
fastscan.cpp
endif
bin_PROGRAMS = pzapit bin_PROGRAMS = pzapit
sbin_PROGRAMS = udpstreampes sbin_PROGRAMS = udpstreampes