mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
neutrino: show epg infos on announce recording, ported from tuxcvs
This commit is contained in:
@@ -1085,7 +1085,8 @@ printf("[neutrino] CSectionsdClient::EVT_GOT_CN_EPG\n");
|
||||
break;
|
||||
case CTimerdClient::EVT_ANNOUNCE_ZAPTO :
|
||||
*msg = NeutrinoMessages::ANNOUNCE_ZAPTO;
|
||||
*data = 0;
|
||||
*data = (neutrino_msg_data_t)p;
|
||||
dont_delete_p = true;
|
||||
break;
|
||||
case CTimerdClient::EVT_ANNOUNCE_SHUTDOWN :
|
||||
*msg = NeutrinoMessages::ANNOUNCE_SHUTDOWN;
|
||||
|
@@ -2630,8 +2630,7 @@ _repeat:
|
||||
return res;
|
||||
}
|
||||
else if( msg == NeutrinoMessages::ZAPTO) {
|
||||
CTimerd::EventInfo * eventinfo;
|
||||
eventinfo = (CTimerd::EventInfo *) data;
|
||||
CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data;
|
||||
if(recordingstatus==0) {
|
||||
bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id);
|
||||
|
||||
@@ -2653,52 +2652,19 @@ _repeat:
|
||||
standbyMode( false );
|
||||
}
|
||||
if( mode != mode_scart ) {
|
||||
CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data;
|
||||
std::string name = g_Locale->getText(LOCALE_ZAPTOTIMER_ANNOUNCE);
|
||||
|
||||
CTimerd::TimerList tmpTimerList;
|
||||
CTimerdClient tmpTimerdClient;
|
||||
|
||||
tmpTimerList.clear();
|
||||
tmpTimerdClient.getTimerList( tmpTimerList );
|
||||
|
||||
if( !tmpTimerList.empty() ) {
|
||||
sort( tmpTimerList.begin(), tmpTimerList.end() );
|
||||
|
||||
CTimerd::responseGetTimer &timer = tmpTimerList[0];
|
||||
|
||||
name += "\n";
|
||||
|
||||
std::string zAddData = CServiceManager::getInstance()->GetServiceName(timer.channel_id);
|
||||
if( zAddData.empty()) {
|
||||
zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN);
|
||||
}
|
||||
|
||||
if(timer.epgID!=0) {
|
||||
CEPGData epgdata;
|
||||
zAddData += " :\n";
|
||||
if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) {
|
||||
zAddData += epgdata.title;
|
||||
}
|
||||
else if(strlen(timer.epgTitle)!=0) {
|
||||
zAddData += timer.epgTitle;
|
||||
}
|
||||
}
|
||||
else if(strlen(timer.epgTitle)!=0) {
|
||||
zAddData += timer.epgTitle;
|
||||
}
|
||||
|
||||
name += zAddData;
|
||||
}
|
||||
getAnnounceEpgName( eventinfo, name);
|
||||
ShowHintUTF( LOCALE_MESSAGEBOX_INFO, name.c_str() );
|
||||
}
|
||||
|
||||
delete [] (unsigned char*) data;
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) {
|
||||
my_system(NEUTRINO_RECORDING_TIMER_SCRIPT);
|
||||
|
||||
CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data;
|
||||
if (g_settings.recording_type == RECORDING_FILE) {
|
||||
char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir;
|
||||
char * recordingDir = eventinfo->recordingDir;
|
||||
for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) {
|
||||
if (strcmp(g_settings.network_nfs_local_dir[i],recordingDir) == 0) {
|
||||
printf("[neutrino] waking up %s (%s)\n",g_settings.network_nfs_ip[i].c_str(),recordingDir);
|
||||
@@ -2717,13 +2683,16 @@ _repeat:
|
||||
CRecordManager::getInstance()->StopAutoRecord();
|
||||
if(!CRecordManager::getInstance()->RecordingStatus()) {
|
||||
dvbsub_stop(); //FIXME if same channel ?
|
||||
t_channel_id channel_id=((CTimerd::RecordingInfo*)data)->channel_id;
|
||||
t_channel_id channel_id=eventinfo->channel_id;
|
||||
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
|
||||
}
|
||||
}
|
||||
if(( mode != mode_scart ) && ( mode != mode_standby )){
|
||||
std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE);
|
||||
getAnnounceEpgName(eventinfo, name);
|
||||
ShowHintUTF(LOCALE_MESSAGEBOX_INFO, name.c_str());
|
||||
}
|
||||
delete[] (unsigned char*) data;
|
||||
if( mode != mode_scart )
|
||||
ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE));
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) {
|
||||
@@ -3870,6 +3839,33 @@ void CNeutrinoApp::SDT_ReloadChannels()
|
||||
}
|
||||
}
|
||||
|
||||
void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name)
|
||||
{
|
||||
|
||||
name += "\n";
|
||||
|
||||
std::string zAddData = CServiceManager::getInstance()->GetServiceName(eventinfo->channel_id);
|
||||
if( zAddData.empty()) {
|
||||
zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN);
|
||||
}
|
||||
|
||||
if(eventinfo->epgID!=0) {
|
||||
CEPGData epgdata;
|
||||
zAddData += " :\n";
|
||||
if (CEitManager::getInstance()->getEPGid(eventinfo->epgID, eventinfo->epg_starttime, &epgdata)) {
|
||||
zAddData += epgdata.title;
|
||||
}
|
||||
else if(strlen(eventinfo->epgTitle)!=0) {
|
||||
zAddData += eventinfo->epgTitle;
|
||||
}
|
||||
}
|
||||
else if(strlen(eventinfo->epgTitle)!=0) {
|
||||
zAddData += eventinfo->epgTitle;
|
||||
}
|
||||
|
||||
name += zAddData;
|
||||
}
|
||||
|
||||
void CNeutrinoApp::Cleanup()
|
||||
{
|
||||
#ifdef EXIT_CLEANUP
|
||||
|
@@ -136,6 +136,7 @@ private:
|
||||
void scartMode( bool bOnOff );
|
||||
void standbyMode( bool bOnOff, bool fromDeepStandby = false );
|
||||
void saveEpg(bool cvfd_mode);
|
||||
void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name);
|
||||
|
||||
void ExitRun(const bool write_si = true, int retcode = 0);
|
||||
void RealRun(CMenuWidget &mainSettings);
|
||||
|
Reference in New Issue
Block a user