zapit/src/getservices.cpp: add helpers

This commit is contained in:
[CST] Focus
2012-03-27 19:20:47 +04:00
parent 2b37f84ef9
commit faf98f43d3
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); bool ReplaceProviderName(std::string &name, t_transport_stream_id tsid, t_original_network_id onid);
int GetFreeNumber(bool radio); int GetFreeNumber(bool radio);
int GetMaxNumber(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__ */ #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); feparams.frequency = xmlGetNumericAttribute(tps, "frequency", 0);
freq_id_t freq; freq_id_t freq = 0;
feparams.inversion = INVERSION_AUTO; feparams.inversion = INVERSION_AUTO;
@@ -1030,3 +1030,15 @@ int CServiceManager::GetMaxNumber(bool radio)
} }
return i+1; 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);
}