void CServiceManager::FindTransponder(xmlNodePtr search) { t_satellite_position satellitePosition = 0; while (search) { bool cable = false; if (!(strcmp(xmlGetName(search), "cable"))) cable = true; else if ((strcmp(xmlGetName(search), "sat"))) { search = search->xmlNextNode; continue; } satellitePosition = xmlGetSignedNumericAttribute(search, "position", 10); DBG("going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, "name")); ParseTransponders(search->xmlChildrenNode, satellitePosition, cable); newfound++; search = search->xmlNextNode; } }
// scan services.xml void FindTransponder(xmlNodePtr search) { t_satellite_position satellitePosition = 0; uint8_t Source; newtpid = 0xC000; bool have_s = false; bool have_c = false; bool have_t = false; // frontend type for(int i = 0; i < FrontendCount; i++) { CFrontend * fe = getFE(i); if( fe->getDeliverySystem() == DVB_S ) have_s = true; if( fe->getDeliverySystem() == DVB_C ) have_c = true; if( fe->getDeliverySystem() == DVB_T ) have_t = true; } // satip if(g_settings.satip_allow_satip) { if(g_settings.satip_serverbox_type == DVB_C) have_c = true; else if(g_settings.satip_serverbox_type == DVB_S) have_s = true; else if(g_settings.satip_serverbox_type == DVB_T) have_t = true; } while (search) { if ( !(strcmp(xmlGetName(search), "cable")) && have_c) { Source = DVB_C; for (sat_iterator_t spos_it = satellitePositions.begin(); spos_it != satellitePositions.end(); spos_it++) { if( !strcmp(spos_it->second.name.c_str(), xmlGetAttribute(search, "name")) ) { satellitePosition = spos_it->first; break; } } dprintf(DEBUG_NORMAL, "getservices:FindTransponder: going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, "name")); } else if ( !(strcmp(xmlGetName(search), "terrestrial")) && have_t) { Source = DVB_T; for (sat_iterator_t spos_it = satellitePositions.begin(); spos_it != satellitePositions.end(); spos_it++) { if( !strcmp(spos_it->second.name.c_str(), xmlGetAttribute(search, "name")) ) { satellitePosition = spos_it->first; break; } } dprintf(DEBUG_NORMAL, "getservices:FindTransponder: going to parse dvb-%c provider %s\n", xmlGetName(search)[0], xmlGetAttribute(search, "name")); } else if ( !(strcmp(xmlGetName(search), "sat")) && have_s) { Source = DVB_S; satellitePosition = xmlGetSignedNumericAttribute(search, "position", 10); dprintf(DEBUG_NORMAL, "getservices:FindTransponder: going to parse dvb-%c provider %s position %d\n", xmlGetName(search)[0], xmlGetAttribute(search, "name"), satellitePosition); } else // unknow { search = search->xmlNextNode; continue; } // parse TP ParseTransponders(search->xmlChildrenNode, satellitePosition, Source ); newfound++; search = search->xmlNextNode; } }