show Saving EPG info on CVFD

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2149 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2012-03-15 14:26:43 +00:00
parent f13a3203af
commit 0167d227b2
2 changed files with 13 additions and 5 deletions

View File

@@ -2911,7 +2911,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg");
if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) {
saveEpg(); saveEpg(true);// true CVFD::MODE_SHUTDOWN
} }
stop_daemons(retcode);//need here for timer_is_rec before saveSetup stop_daemons(retcode);//need here for timer_is_rec before saveSetup
@@ -3052,18 +3052,26 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
} }
} }
void CNeutrinoApp::saveEpg() void CNeutrinoApp::saveEpg(bool cvfd_mode)
{ {
struct stat my_stat; struct stat my_stat;
if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){ if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){
printf("Saving EPG to %s....\n", g_settings.epg_dir.c_str()); const char *save_txt = "Saving EPG";
printf("%s to %s....\n",save_txt, g_settings.epg_dir.c_str());
neutrino_msg_t msg; neutrino_msg_t msg;
neutrino_msg_data_t data; neutrino_msg_data_t data;
CVFD::getInstance()->Clear();
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance ()->ShowText(save_txt);
g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str()); g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str());
while( true ) { while( true ) {
g_RCInput->getMsg(&msg, &data, 1200); // 120 secs.. g_RCInput->getMsg(&msg, &data, 1200); // 120 secs..
if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) { if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) {
//printf("Msg %x timeout %d EVT_SI_FINISHED %x\n", msg, CRCInput::RC_timeout, NeutrinoMessages::EVT_SI_FINISHED); //printf("Msg %x timeout %d EVT_SI_FINISHED %x\n", msg, CRCInput::RC_timeout, NeutrinoMessages::EVT_SI_FINISHED);
CVFD::getInstance()->Clear();
CVFD::getInstance()->setMode(cvfd_mode ? CVFD::MODE_SHUTDOWN : CVFD::MODE_STANDBY);// true CVFD::MODE_SHUTDOWN , false CVFD::MODE_STANDBY
break; break;
} }
} }
@@ -3359,7 +3367,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff )
if(!CRecordManager::getInstance()->RecordingStatus()) { if(!CRecordManager::getInstance()->RecordingStatus()) {
//only save epg when not recording //only save epg when not recording
if(g_settings.epg_save) { if(g_settings.epg_save) {
saveEpg(); saveEpg(false);//false CVFD::MODE_STANDBY
} }
} }

View File

@@ -156,7 +156,7 @@ private:
void standbyMode( bool bOnOff ); void standbyMode( bool bOnOff );
void AudioMute( int newValue, bool isEvent= false ); void AudioMute( int newValue, bool isEvent= false );
void setvol(int vol); void setvol(int vol);
void saveEpg(); void saveEpg(bool cvfd_mode);
void ExitRun(const bool write_si = true, int retcode = 0); void ExitRun(const bool write_si = true, int retcode = 0);
void RealRun(CMenuWidget &mainSettings); void RealRun(CMenuWidget &mainSettings);