From faf98f43d37ea20fe6dbf74264993909d3b1ce4a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 27 Mar 2012 19:20:47 +0400 Subject: [PATCH] zapit/src/getservices.cpp: add helpers --- src/zapit/include/zapit/getservices.h | 4 +++- src/zapit/src/getservices.cpp | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 2b3eda64f..abb622e6b 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -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__ */ diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 63db30293..7223b775c 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -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); +}