timerd/timermanager.cpp: remove CSectionsdClient, use direct call

This commit is contained in:
[CST] Focus
2012-02-16 20:37:41 +04:00
parent 81159fb655
commit e6866f92f8

View File

@@ -55,6 +55,9 @@ bool timer_is_rec;
bool timer_wakeup; bool timer_wakeup;
static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata);
//------------------------------------------------------------ //------------------------------------------------------------
CTimerManager::CTimerManager() CTimerManager::CTimerManager()
{ {
@@ -1140,11 +1143,11 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time,
eventInfo.channel_id = channel_id; eventInfo.channel_id = channel_id;
eventInfo.apids = apids; eventInfo.apids = apids;
recordingDir = recDir; recordingDir = recDir;
CSectionsdClient sdc;
epgTitle=""; epgTitle="";
CShortEPGData epgdata; CShortEPGData epgdata;
if (sdc.getEPGidShort(epgID, &epgdata)) if (sectionsd_getEPGidShort(epgID, &epgdata))
epgTitle=epgdata.title; epgTitle=epgdata.title;
} }
//------------------------------------------------------------ //------------------------------------------------------------
CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId):
@@ -1249,8 +1252,9 @@ void CTimerEvent_Record::Reschedule()
//------------------------------------------------------------ //------------------------------------------------------------
void CTimerEvent_Record::getEpgId() void CTimerEvent_Record::getEpgId()
{ {
CSectionsdClient sdc; //TODO: Record/Zapto getEpgId code almost identical !
CChannelEventList evtlist = sdc.getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL); CChannelEventList evtlist;
sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist);
// we check for a time in the middle of the recording // we check for a time in the middle of the recording
time_t check_time=alarmTime/2 + stopTime/2; time_t check_time=alarmTime/2 + stopTime/2;
for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e )
@@ -1265,7 +1269,7 @@ void CTimerEvent_Record::getEpgId()
if(eventInfo.epgID != 0) if(eventInfo.epgID != 0)
{ {
CShortEPGData epgdata; CShortEPGData epgdata;
if (sdc.getEPGidShort(eventInfo.epgID, &epgdata)) if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata))
epgTitle=epgdata.title; epgTitle=epgdata.title;
} }
} }
@@ -1296,8 +1300,9 @@ void CTimerEvent_Zapto::fireEvent()
//------------------------------------------------------------ //------------------------------------------------------------
void CTimerEvent_Zapto::getEpgId() void CTimerEvent_Zapto::getEpgId()
{ {
CSectionsdClient sdc; //TODO: Record/Zapto getEpgId code almost identical !
CChannelEventList evtlist = sdc.getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL); CChannelEventList evtlist;
sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist);
// we check for a time 5 min after zap // we check for a time 5 min after zap
time_t check_time=alarmTime + 300; time_t check_time=alarmTime + 300;
for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e )
@@ -1312,8 +1317,8 @@ void CTimerEvent_Zapto::getEpgId()
if(eventInfo.epgID != 0) if(eventInfo.epgID != 0)
{ {
CShortEPGData epgdata; CShortEPGData epgdata;
if (sdc.getEPGidShort(eventInfo.epgID, &epgdata)) if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata))
epgTitle=epgdata.title; epgTitle=epgdata.title;
} }
} }
//============================================================= //=============================================================