aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/scan.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-08 12:55:10 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-08 12:55:10 +0000
commit9df197b0346cdea53967bf9ed578ff30e2424100 (patch)
tree3a8401ade97504263a480a5a170a338cf332edb3 /lib/dvb/scan.cpp
parent4eff668d8019ed9255d72b4373f6b1053231f129 (diff)
downloadenigma2-9df197b0346cdea53967bf9ed578ff30e2424100.tar.gz
enigma2-9df197b0346cdea53967bf9ed578ff30e2424100.zip
add ability to select in scan what is todo with existing services (Clear before scan)
a) "yes" means remove all services and transponders for this sat position / all selected sat positions b) "no" means hold all services and transponders for this sat position / all selected sat positions this resets all old new found flags (incremental scan) c) "yes (hold feeds) means the same as a) but hold all feed services/transponders
Diffstat (limited to 'lib/dvb/scan.cpp')
-rw-r--r--lib/dvb/scan.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp
index e722b3c5..01b3cd32 100644
--- a/lib/dvb/scan.cpp
+++ b/lib/dvb/scan.cpp
@@ -15,6 +15,7 @@
#include <lib/base/eerror.h>
#include <lib/base/estring.h>
#include <errno.h>
+#include <set>
#define SCAN_eDebug(x...) eDebug(x)
#define SCAN_eDebugNoNewLine(x...) eDebugNoNewLine(x)
@@ -422,6 +423,86 @@ void eDVBScan::start(const eSmartPtrList<iDVBFrontendParameters> &known_transpon
void eDVBScan::insertInto(iDVBChannelList *db)
{
+ if (m_flags & scanRemoveServices)
+ {
+ bool clearTerrestrial=false;
+ bool clearCable=false;
+ std::set<unsigned int> scanned_sat_positions;
+
+ std::list<ePtr<iDVBFrontendParameters> >::iterator it(m_ch_scanned.begin());
+ for (;it != m_ch_scanned.end(); ++it)
+ {
+ int system;
+ (*it)->getSystem(system);
+ switch(system)
+ {
+ case iDVBFrontend::feSatellite:
+ {
+ eDVBFrontendParametersSatellite sat_parm;
+ (*it)->getDVBS(sat_parm);
+ scanned_sat_positions.insert(sat_parm.orbital_position);
+ break;
+ }
+ case iDVBFrontend::feTerrestrial:
+ {
+ clearTerrestrial=true;
+ break;
+ }
+ case iDVBFrontend::feCable:
+ {
+ clearCable=true;
+ break;
+ }
+ }
+ }
+
+ for (it=m_ch_unavailable.begin();it != m_ch_unavailable.end(); ++it)
+ {
+ int system;
+ (*it)->getSystem(system);
+ switch(system)
+ {
+ case iDVBFrontend::feSatellite:
+ {
+ eDVBFrontendParametersSatellite sat_parm;
+ (*it)->getDVBS(sat_parm);
+ scanned_sat_positions.insert(sat_parm.orbital_position);
+ break;
+ }
+ case iDVBFrontend::feTerrestrial:
+ {
+ clearTerrestrial=true;
+ break;
+ }
+ case iDVBFrontend::feCable:
+ {
+ clearCable=true;
+ break;
+ }
+ }
+ }
+
+ if (clearTerrestrial)
+ {
+ eDVBChannelID chid;
+ chid.dvbnamespace=0xEEEE0000;
+ db->removeServices(chid);
+ }
+ if (clearCable)
+ {
+ eDVBChannelID chid;
+ chid.dvbnamespace=0xFFFF0000;
+ db->removeServices(chid);
+ }
+ for (std::set<unsigned int>::iterator x(scanned_sat_positions.begin()); x != scanned_sat_positions.end(); ++x)
+ {
+ eDVBChannelID chid;
+ if (m_flags & scanDontRemoveFeed)
+ chid.dvbnamespace = eDVBNamespace((*it)<<16));
+ db->removeServices(chid, *it);
+ }
+ }
+
for (std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> >::const_iterator
ch(m_new_channels.begin()); ch != m_new_channels.end(); ++ch)
db->addChannelToList(ch->first, ch->second);