From a68f704a5e513c5d0f48c151ac06424d4b9e14d9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sun, 22 Apr 2012 15:20:21 +0400 Subject: [PATCH] neutrino.cpp: create new/removed channel lists if options set Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e4957ce1e0d42b6137355838ab04accc8670b75e Author: [CST] Focus Date: 2012-04-22 (Sun, 22 Apr 2012) --- src/neutrino.cpp | 62 +++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 23fc05cfb..bcadaa14b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -369,6 +369,8 @@ int CNeutrinoApp::loadSetup(const char * fname) #endif g_settings.make_hd_list = configfile.getInt32("make_hd_list", 1); + g_settings.make_new_list = configfile.getInt32("make_new_list", 1); + g_settings.make_removed_list = configfile.getInt32("make_removed_list", 1); //misc g_settings.power_standby = configfile.getInt32( "power_standby", 0); @@ -813,6 +815,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("ci_clock", g_settings.ci_clock); configfile.setInt32( "make_hd_list", g_settings.make_hd_list); + configfile.setInt32( "make_new_list", g_settings.make_new_list); + configfile.setInt32( "make_removed_list", g_settings.make_removed_list); //led configfile.setInt32( "led_tv_mode", g_settings.led_tv_mode); configfile.setInt32( "led_standby_mode", g_settings.led_standby_mode); @@ -1278,33 +1282,37 @@ void CNeutrinoApp::channelsInit(bool bOnly) } #if 1 /* new channels */ - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); + if (g_settings.make_new_list) { + CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); + } + CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + RADIOallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); + } } - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); - } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); - } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout); + if (g_settings.make_removed_list) { + CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); + } + CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + RADIOallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout); + } } #endif TIMER_STOP("[neutrino] sats took"); @@ -2350,7 +2358,7 @@ _repeat: g_bouquetManager->saveBouquets(); g_bouquetManager->saveUBouquets(); g_bouquetManager->renumServices(); - channelsInit(true); + channelsInit(/*true*/); t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? bouquetList->activateBouquet(old_b_id, false);