neutrino.cpp: fix indents; create new/removed channel lists in favorites (WIP, for testing

This commit is contained in:
[CST] Focus
2012-04-03 20:44:38 +04:00
parent ee40edbe41
commit 5754baebe5

View File

@@ -1202,7 +1202,7 @@ void CNeutrinoApp::channelsInit(bool bOnly)
getActiveChannelNumber used to get index for direct access too ? getActiveChannelNumber used to get index for direct access too ?
*/ */
int tvi = 0, ri = 0, hi = 0; int tvi = 0, ri = 0;
ZapitChannelList zapitList; ZapitChannelList zapitList;
@@ -1227,20 +1227,7 @@ void CNeutrinoApp::channelsInit(bool bOnly)
RADIOchannelList->SetChannelList(&zapitList); RADIOchannelList->SetChannelList(&zapitList);
#endif #endif
CBouquet* hdBouquet = NULL; printf("[neutrino] got %d TV and %d RADIO channels\n", tvi, ri); fflush(stdout);
/* all HD channels */
if(g_settings.make_hd_list) {
hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true);
CServiceManager::getInstance()->GetAllHDChannels(zapitList);
hi = zapitList.size();
hdBouquet->channelList->SetChannelList(&zapitList);
if(hi)
hdBouquet->channelList->SortSat();
}
printf("[neutrino] got %d TV (%d is HD) and %d RADIO channels\n", tvi, hi, ri); fflush(stdout);
TIMER_STOP("[neutrino] all channels took"); TIMER_STOP("[neutrino] all channels took");
/* unless we will do real channel delete from allchans, needed once ? */ /* unless we will do real channel delete from allchans, needed once ? */
@@ -1324,13 +1311,35 @@ void CNeutrinoApp::channelsInit(bool bOnly)
} }
printf("[neutrino] got %d TV bouquets\n", bnum); fflush(stdout); printf("[neutrino] got %d TV bouquets\n", bnum); fflush(stdout);
TIMER_STOP("[neutrino] tv took"); /* all HD channels */
if (g_settings.make_hd_list) { if (g_settings.make_hd_list) {
if(hi) CServiceManager::getInstance()->GetAllHDChannels(zapitList);
if (!zapitList.empty()) {
CBouquet* hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true);
hdBouquet->channelList->SetChannelList(&zapitList);
hdBouquet->channelList->SortSat();
TVfavList->Bouquets.push_back(hdBouquet); TVfavList->Bouquets.push_back(hdBouquet);
else printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout);
delete hdBouquet;
} }
}
/* 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);
TVfavList->Bouquets.push_back(newBouquet);
printf("[neutrino] got %d new TV 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);
TVfavList->Bouquets.push_back(newBouquet);
printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout);
}
TIMER_STOP("[neutrino] tv took");
/* Favorites and provides RADIO bouquets */ /* Favorites and provides RADIO bouquets */
bnum = 0; bnum = 0;
@@ -1347,6 +1356,22 @@ void CNeutrinoApp::channelsInit(bool bOnly)
bnum++; bnum++;
} }
} }
/* new channels */
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);
RADIOfavList->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);
RADIOfavList->Bouquets.push_back(newBouquet);
printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout);
}
printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout); printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout);
TIMER_STOP("[neutrino] took"); TIMER_STOP("[neutrino] took");
@@ -2888,7 +2913,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
if(do_shutdown) { if(do_shutdown) {
if(SDTreloadChannels){ if(SDTreloadChannels){
SDT_ReloadChannels(); SDT_ReloadChannels();
SDTreloadChannels = false; //SDTreloadChannels = false;
} }
CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN);
@@ -3166,7 +3191,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff )
StopSubtitles(); StopSubtitles();
if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){ if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){
SDT_ReloadChannels(); SDT_ReloadChannels();
SDTreloadChannels = false; //SDTreloadChannels = false;
} }
frameBuffer->useBackground(false); frameBuffer->useBackground(false);
frameBuffer->paintBackground(); frameBuffer->paintBackground();
@@ -3810,9 +3835,11 @@ void CNeutrinoApp::SelectSubtitles()
} }
} }
} }
void CNeutrinoApp::SDT_ReloadChannels() void CNeutrinoApp::SDT_ReloadChannels()
{ {
g_Zapit->reinitChannels(); SDTreloadChannels = false;
//g_Zapit->reinitChannels();
channelsInit(); channelsInit();
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ?
@@ -3821,5 +3848,4 @@ void CNeutrinoApp::SDT_ReloadChannels()
old_b_id = -1; old_b_id = -1;
g_RCInput->postMsg(CRCInput::RC_ok, 0); g_RCInput->postMsg(CRCInput::RC_ok, 0);
} }
} }