zapit/src/getservices.cpp: add flag to enable/disable persistent channel numbers

Origin commit data
------------------
Branch: ni/coolstream
Commit: efe2d026fb
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-04-27 (Fri, 27 Apr 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-04-27 16:09:56 +04:00
parent 0b07217df8
commit 8776f832d5
2 changed files with 8 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ class CServiceManager
service_number_map_t radio_numbers;
bool services_changed;
bool keep_numbers;
bool have_numbers;
bool dup_numbers;
@@ -171,5 +172,6 @@ class CServiceManager
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]; }
void KeepNumbers(bool enable) { keep_numbers = enable; };
};
#endif /* __getservices_h__ */

View File

@@ -40,6 +40,7 @@ CServiceManager::CServiceManager()
scanInputParser = NULL;
service_count = 0;
services_changed = false;
keep_numbers = false;
}
CServiceManager::~CServiceManager()
@@ -136,7 +137,7 @@ void CServiceManager::ResetChannelNumbers(bool bouquets, bool numbers)
it->second.number = 0;
}
#endif
if(numbers)
if(!keep_numbers || numbers)
it->second.number = 0;
if(bouquets)
it->second.has_bouquet = 0;
@@ -386,6 +387,9 @@ void CServiceManager::ParseChannels(xmlNodePtr node, const t_transport_stream_id
service_number_map_t * channel_numbers = (service_type == ST_DIGITAL_RADIO_SOUND_SERVICE) ? &radio_numbers : &tv_numbers;
if(!keep_numbers)
number = 0;
if(number) {
have_numbers = true;
service_number_map_t::iterator it = channel_numbers->find(number);
@@ -677,7 +681,7 @@ do_current:
}
}
/* if no numbers, zapit will save after loading bouquets, with numbers */
if(!have_numbers || dup_numbers)
if(service_count && keep_numbers && (!have_numbers || dup_numbers))
services_changed = true;
return true;