zapit/src/getservices.cpp: add GetTransponder() by id

This commit is contained in:
[CST] Focus
2012-04-17 18:32:54 +04:00
parent 58d6ba7f40
commit 0225c97cc2
2 changed files with 7 additions and 7 deletions

View File

@@ -166,7 +166,8 @@ class CServiceManager
void SetServicesChanged(bool changed) { services_changed = changed; }
void UpdateSatTransponders(t_satellite_position satellitePosition);
bool GetTransponder(transponder &t);
bool GetTransponder(transponder_id_t tid, transponder &t);
transponder_list_t & GetTransponders() { return transponders; }
transponder_list_t & GetSatelliteTransponders(t_satellite_position position) { return satelliteTransponders[position]; }
};
#endif /* __getservices_h__ */

View File

@@ -1055,13 +1055,12 @@ void CServiceManager::UseNumber(int number, bool radio)
channel_numbers->insert(number);
}
bool CServiceManager::GetTransponder(transponder &t)
bool CServiceManager::GetTransponder(transponder_id_t tid, transponder &t)
{
for (transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); tI++) {
if (t == tI->second) {
t = tI->second;
return true;
}
stiterator tI = transponders.find(tid);
if(tI != transponders.end()) {
t = tI->second;
return true;
}
return false;
}