mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-11 15:41:00 +02:00
zapit/src/getservices.cpp: add UpdateSatTransponders()
to add/replace satellite transponder list from transponders
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4082cf3fe2
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-04-17 (Tue, 17 Apr 2012)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -164,6 +164,7 @@ class CServiceManager
|
|||||||
void FreeNumber(int number, bool radio);
|
void FreeNumber(int number, bool radio);
|
||||||
void UseNumber(int number, bool radio);
|
void UseNumber(int number, bool radio);
|
||||||
void SetServicesChanged(bool changed) { services_changed = changed; }
|
void SetServicesChanged(bool changed) { services_changed = changed; }
|
||||||
|
void UpdateSatTransponders(t_satellite_position satellitePosition);
|
||||||
|
|
||||||
bool GetTransponder(transponder &t);
|
bool GetTransponder(transponder &t);
|
||||||
transponder_list_t & GetSatelliteTransponders(t_satellite_position position) { return satelliteTransponders[position]; }
|
transponder_list_t & GetSatelliteTransponders(t_satellite_position position) { return satelliteTransponders[position]; }
|
||||||
|
@@ -328,7 +328,7 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
|
|||||||
|
|
||||||
ret = transponders.insert(transponder_pair_t(tid, t));
|
ret = transponders.insert(transponder_pair_t(tid, t));
|
||||||
if (ret.second == false)
|
if (ret.second == false)
|
||||||
t.dump("[zapit] duplicate");
|
t.dump("[zapit] duplicate in all transponders:");
|
||||||
|
|
||||||
/* read channels that belong to the current transponder */
|
/* read channels that belong to the current transponder */
|
||||||
ParseChannels(node->xmlChildrenNode, transport_stream_id, original_network_id, satellitePosition, freq, polarization);
|
ParseChannels(node->xmlChildrenNode, transport_stream_id, original_network_id, satellitePosition, freq, polarization);
|
||||||
@@ -336,6 +336,7 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
|
|||||||
/* hop to next transponder */
|
/* hop to next transponder */
|
||||||
node = node->xmlNextNode;
|
node = node->xmlNextNode;
|
||||||
}
|
}
|
||||||
|
UpdateSatTransponders(satellitePosition);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1064,3 +1065,20 @@ bool CServiceManager::GetTransponder(transponder &t)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServiceManager::UpdateSatTransponders(t_satellite_position satellitePosition)
|
||||||
|
{
|
||||||
|
pair<map<transponder_id_t, transponder>::iterator,bool> ret;
|
||||||
|
transponder_list_t & stransponders = satelliteTransponders[satellitePosition];
|
||||||
|
for (transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); tI++) {
|
||||||
|
for (stiterator stI = stransponders.begin(); stI != stransponders.end(); ++stI) {
|
||||||
|
if (stI->second.compare(tI->second)) {
|
||||||
|
stransponders.erase(stI);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = stransponders.insert(transponder_pair_t(tI->first, tI->second));
|
||||||
|
if (ret.second == false)
|
||||||
|
tI->second.dump("[zapit] duplicate in sat transponders:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user