zapit/src/getservices.cpp: add helpers

Origin commit data
------------------
Commit: faf98f43d3
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-03-27 (Tue, 27 Mar 2012)
This commit is contained in:
[CST] Focus
2012-03-27 19:20:47 +04:00
parent d5f9bfe34b
commit b9c62da1f0
2 changed files with 16 additions and 2 deletions

View File

@@ -193,6 +193,8 @@ class CServiceManager
bool ReplaceProviderName(std::string &name, t_transport_stream_id tsid, t_original_network_id onid);
int GetFreeNumber(bool radio);
int GetMaxNumber(bool radio);
void SetServiceChanged(bool changed) { services_changed = changed; }
void FreeNumber(int number, bool radio);
void UseNumber(int number, bool radio);
void SetServicesChanged(bool changed) { services_changed = changed; }
};
#endif /* __getservices_h__ */

View File

@@ -452,7 +452,7 @@ void CServiceManager::ParseSatTransponders(fe_type_t fType, xmlNodePtr search, t
feparams.frequency = xmlGetNumericAttribute(tps, "frequency", 0);
freq_id_t freq;
freq_id_t freq = 0;
feparams.inversion = INVERSION_AUTO;
@@ -1030,3 +1030,15 @@ int CServiceManager::GetMaxNumber(bool radio)
}
return i+1;
}
void CServiceManager::FreeNumber(int number, bool radio)
{
service_number_map_t * channel_numbers = radio ? &radio_numbers : &tv_numbers;
channel_numbers->erase(number);
}
void CServiceManager::UseNumber(int number, bool radio)
{
service_number_map_t * channel_numbers = radio ? &radio_numbers : &tv_numbers;
channel_numbers->insert(number);
}