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

@@ -645,7 +645,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str());
strcpy(g_settings.softupdate_proxyusername, configfile.getString("softupdate_proxyusername", "" ).c_str());
strcpy(g_settings.softupdate_proxypassword, configfile.getString("softupdate_proxypassword", "" ).c_str());
//
//
strcpy( g_settings.font_file, configfile.getString( "font_file", FONTDIR"/neutrino.ttf" ).c_str() );
strcpy( g_settings.ttx_font_file, configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf" ).c_str() );
ttx_font_file = g_settings.ttx_font_file;
@@ -1008,7 +1008,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "auto_timeshift", g_settings.auto_timeshift );
configfile.setInt32( "auto_delete", g_settings.auto_delete );
configfile.setInt32( "record_hours", g_settings.record_hours );
//printf("set: key_unlock =============== %d\n", g_settings.key_unlock);
//printf("set: key_unlock =============== %d\n", g_settings.key_unlock);
configfile.setInt32( "screenshot_count", g_settings.screenshot_count );
configfile.setInt32( "screenshot_format", g_settings.screenshot_format );
configfile.setInt32( "screenshot_cover", g_settings.screenshot_cover );
@@ -1202,7 +1202,7 @@ void CNeutrinoApp::channelsInit(bool bOnly)
getActiveChannelNumber used to get index for direct access too ?
*/
int tvi = 0, ri = 0, hi = 0;
int tvi = 0, ri = 0;
ZapitChannelList zapitList;
@@ -1227,20 +1227,7 @@ void CNeutrinoApp::channelsInit(bool bOnly)
RADIOchannelList->SetChannelList(&zapitList);
#endif
CBouquet* hdBouquet = NULL;
/* 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);
printf("[neutrino] got %d TV and %d RADIO channels\n", tvi, ri); fflush(stdout);
TIMER_STOP("[neutrino] all channels took");
/* 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);
TIMER_STOP("[neutrino] tv took");
if(g_settings.make_hd_list) {
if(hi)
/* all HD channels */
if (g_settings.make_hd_list) {
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);
else
delete hdBouquet;
printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout);
}
}
/* 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 */
bnum = 0;
@@ -1347,6 +1356,22 @@ void CNeutrinoApp::channelsInit(bool bOnly)
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);
TIMER_STOP("[neutrino] took");
@@ -2888,7 +2913,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
if(do_shutdown) {
if(SDTreloadChannels){
SDT_ReloadChannels();
SDTreloadChannels = false;
//SDTreloadChannels = false;
}
CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN);
@@ -3166,7 +3191,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff )
StopSubtitles();
if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){
SDT_ReloadChannels();
SDTreloadChannels = false;
//SDTreloadChannels = false;
}
frameBuffer->useBackground(false);
frameBuffer->paintBackground();
@@ -3810,9 +3835,11 @@ void CNeutrinoApp::SelectSubtitles()
}
}
}
void CNeutrinoApp::SDT_ReloadChannels()
{
g_Zapit->reinitChannels();
SDTreloadChannels = false;
//g_Zapit->reinitChannels();
channelsInit();
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ?
@@ -3821,5 +3848,4 @@ void CNeutrinoApp::SDT_ReloadChannels()
old_b_id = -1;
g_RCInput->postMsg(CRCInput::RC_ok, 0);
}
}