remove new found flags when do a automatic scan and "clear before scan" was
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 14 Sep 2007 23:28:08 +0000 (23:28 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 14 Sep 2007 23:28:08 +0000 (23:28 +0000)
not checked

lib/components/scan.cpp

index 79fe2ef5df858e3174454d3c46a43368304e9091..a863d92323695db6ddda03041bc720002043309f 100644 (file)
@@ -106,11 +106,48 @@ int eComponentScan::start(int feid, int flags)
        }
 
        std::list<ePtr<iDVBFrontendParameters> > list;
-
        m_scan = new eDVBScan(channel);
        m_scan->connectEvent(slot(*this, &eComponentScan::scanEvent), m_scan_event_connection);
+
+       if (!(flags & scanRemoveServices))
+       {
+               ePtr<iDVBChannelList> db;
+               ePtr<eDVBResourceManager> res;
+               int err;
+               if ((err = eDVBResourceManager::getInstance(res)) != 0)
+                       eDebug("no resource manager");
+               else if ((err = res->getChannelList(db)) != 0)
+                       eDebug("no channel list");
+               else
+               {
+                       if (m_initial.size() > 1)
+                       {
+                               iDVBFrontendParameters *tp = m_initial.first();
+                               int type;
+                               if (tp && !tp->getSystem(type))
+                               {
+                                       switch(type)
+                                       {
+                                               case iDVBFrontend::feSatellite:
+                                               {
+                                                       eDVBFrontendParametersSatellite parm;
+                                                       tp->getDVBS(parm);
+                                                       db->removeFlags(eDVBService::dxNewFound, -1, -1, -1, parm.orbital_position);
+                                                       break;
+                                               }
+                                               case iDVBFrontend::feCable:
+                                                       db->removeFlags(eDVBService::dxNewFound, 0xFFFF0000, -1, -1, -1);
+                                                       break;
+                                               case iDVBFrontend::feTerrestrial:
+                                                       db->removeFlags(eDVBService::dxNewFound, 0xEEEE0000, -1, -1, -1);
+                                                       break;
+                                       }
+                               }
+                       }
+               }
+       }
        m_scan->start(m_initial, flags);
-       
+
        return 0;
 }