diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 2dc1cd0dc..bfc4e0014 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -123,6 +123,7 @@ class CServiceManager void ResetChannelNumbers(bool bouquets = true, bool numbers = false); void RemoveChannel(const t_channel_id channel_id); + void RemovePosition(t_satellite_position satellitePosition); void RemoveAllChannels(); void RemoveCurrentChannels(); void RemoveNVODChannels(); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 289e2f67b..af134fa52 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -164,6 +164,21 @@ void CServiceManager::RemoveAllChannels() { allchans.clear(); } + +void CServiceManager::RemovePosition(t_satellite_position satellitePosition) +{ + INFO("delete %d, size before: %d", satellitePosition, allchans.size()); + t_channel_id live_id = CZapit::getInstance()->GetCurrentChannelID(); + for (channel_map_iterator_t it = allchans.begin(); it != allchans.end();) { + if (it->second.getSatellitePosition() == satellitePosition && live_id != it->first) + allchans.erase(it++); + else + ++it; + } + services_changed = true; + INFO("delete %d, size after: %d", satellitePosition, allchans.size()); +} + #if 0 //never used void CServiceManager::RemoveNVODChannels()