void CEpgScan::AddBouquet(CChannelList * clist) { for (unsigned i = 0; i < clist->Size(); i++) { CZapitChannel * chan = clist->getChannelFromIndex(i); if (!IS_WEBTV(chan->getChannelID()) && scanned.find(chan->getTransponderId()) == scanned.end()) scanmap.insert(eit_scanmap_pair_t(chan->getTransponderId(), chan->getChannelID())); } }
int CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) { if (!g_settings.epg_scan || (!standby && (CFEManager::getInstance()->getEnabledCount() <= 1))) { if ((msg == NeutrinoMessages::EVT_EIT_COMPLETE) || (msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE)) return messages_return::handled; return messages_return::unhandled; } CZapitChannel * newchan; if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { AddTransponders(); INFO("EVT_ZAP_COMPLETE, scan map size: %d\n", scanmap.size()); return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_EIT_COMPLETE) { t_channel_id chid = *(t_channel_id *)data; newchan = CServiceManager::getInstance()->FindChannel(chid); if (newchan) { scanned.insert(newchan->getTransponderId()); scanmap.erase(newchan->getTransponderId()); } INFO("EIT read complete [" PRINTF_CHANNEL_ID_TYPE "], scan map size: %d", chid, scanmap.size()); Next(); return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE) { t_channel_id chid = *(t_channel_id *)data; INFO("EVT_BACK_ZAP_COMPLETE [" PRINTF_CHANNEL_ID_TYPE "]", chid); if (next_chid) { newchan = CServiceManager::getInstance()->FindChannel(next_chid); if (newchan) { if(chid) { if (!CRecordManager::getInstance()->RecordingStatus()) { INFO("try to scan [%s]", newchan->getName().c_str()); if (standby && !g_Sectionsd->getIsScanningActive()) g_Sectionsd->setPauseScanning(false); g_Sectionsd->setServiceChanged(newchan->getChannelID(), false, newchan->getRecordDemux()); } } else { INFO("tune failed [%s]", newchan->getName().c_str()); scanmap.erase(newchan->getTransponderId()); Next(); } } } return messages_return::handled; } return messages_return::unhandled; }
int CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) { if ((msg == NeutrinoMessages::EVT_TIMER) && (data == rescan_timer)) { INFO("rescan timer in %s mode, scanning %d", standby ? "standby" : "live", scan_in_progress); scanned.clear(); Clear(); g_RCInput->killTimer(rescan_timer); if (CheckMode()) { if (standby) CNeutrinoApp::getInstance()->wakeupFromStandby(); Start(standby); } else { AddTimer(); } return messages_return::handled; } if (!CheckMode()) { int ret = messages_return::handled; if (msg == NeutrinoMessages::EVT_EIT_COMPLETE) scan_in_progress = false; else if (msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE) scan_in_progress = true; else ret = messages_return::unhandled; return ret; } CZapitChannel * newchan; if (msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { /* live channel changed, block scan channel change by timer */ scan_in_progress = true; AddTransponders(); INFO("EVT_ZAP_COMPLETE, scan map size: %d\n", scanmap.size()); #if 0 t_channel_id chid = *(t_channel_id *)data; if (IS_WEBTV(chid)) Next(); #endif return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_EIT_COMPLETE) { scan_in_progress = false; t_channel_id chid = *(t_channel_id *)data; newchan = CServiceManager::getInstance()->FindChannel(chid); if (newchan) { scanned.insert(newchan->getTransponderId()); scanmap.erase(newchan->getTransponderId()); } INFO("EIT read complete [" PRINTF_CHANNEL_ID_TYPE "], scan map size: %d", chid, scanmap.size()); Next(); return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE) { scan_in_progress = true; t_channel_id chid = *(t_channel_id *)data; INFO("EVT_BACK_ZAP_COMPLETE [" PRINTF_CHANNEL_ID_TYPE "]", chid); if (next_chid) { newchan = CServiceManager::getInstance()->FindChannel(next_chid); if (newchan) { if(chid) { if (!CRecordManager::getInstance()->RecordingStatus()) { INFO("try to scan [%s]", newchan->getName().c_str()); if (standby && !g_Sectionsd->getIsScanningActive()) g_Sectionsd->setPauseScanning(false); g_Sectionsd->setServiceChanged(newchan->getChannelID(), false, newchan->getRecordDemux()); } } else { INFO("tune failed [%s]", newchan->getName().c_str()); scanmap.erase(newchan->getTransponderId()); Next(); } } } return messages_return::handled; } return messages_return::unhandled; }