diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index d6659148d..fbc608f64 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #define ZAP_GUARD_TIME 2000 // ms @@ -55,11 +56,6 @@ extern CBouquetManager *g_bouquetManager; extern uint32_t scrambled_timer; -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); -void sectionsd_setPrivatePid(unsigned short pid); - CSubService::CSubService(const t_original_network_id anoriginal_network_id, const t_service_id aservice_id, const t_transport_stream_id atransport_stream_id, const std::string &asubservice_name) { service.original_network_id = anoriginal_network_id; @@ -293,8 +289,6 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data { CVFD::getInstance()->showServicename(current_channel_name); // UTF-8 g_Zapit->getPIDS( current_PIDs ); - //g_Sectionsd->setPrivatePid( current_PIDs.PIDs.privatepid ); - sectionsd_setPrivatePid( current_PIDs.PIDs.privatepid ); //tuxtxt #if 1 tuxtxt_stop(); @@ -369,8 +363,7 @@ void CRemoteControl::getSubChannels() if ( subChannels.empty() ) { CSectionsdClient::LinkageDescriptorList linkedServices; - //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) - if ( sectionsd_getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices)) { if ( linkedServices.size()> 1 ) { @@ -403,8 +396,7 @@ void CRemoteControl::getNVODs() if ( subChannels.empty() ) { CSectionsdClient::NVODTimesList NVODs; - //if ( g_Sectionsd->getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) - if ( sectionsd_getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) + if (CEitManager::getInstance()->getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs)) { are_subchannels = false; //printf("CRemoteControl::getNVODs NVODs.size %d\n", NVODs.size()); @@ -534,8 +526,7 @@ void CRemoteControl::processAPIDnames() if ( current_EPGid != 0 ) { CSectionsdClient::ComponentTagList tags; - //if ( g_Sectionsd->getComponentTagsUniqueKey( current_EPGid, tags ) ) - if ( sectionsd_getComponentTagsUniqueKey( current_EPGid, tags ) ) + if (CEitManager::getInstance()->getComponentTagsUniqueKey(current_EPGid, tags)) { has_unresolved_ctags = false; diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 269a4b442..2436db6b3 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -54,6 +54,7 @@ #include #include #include +#include /* TODO: * nextRecording / pending recordings - needs testing @@ -63,11 +64,6 @@ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); - extern "C" { #include } @@ -353,7 +349,7 @@ void CRecordInstance::ProcessAPIDnames() if(has_unresolved_ctags && (epgid != 0)) { CSectionsdClient::ComponentTagList tags; - if(sectionsd_getComponentTagsUniqueKey(epgid, tags)) { + if(CEitManager::getInstance()->getComponentTagsUniqueKey(epgid, tags)) { for(unsigned int i=0; i< tags.size(); i++) { for(unsigned int j=0; j< allpids.APIDs.size(); j++) { if(allpids.APIDs[j].component_tag == tags[i].componentTag) { @@ -403,7 +399,7 @@ record_error_msg_t CRecordInstance::Record() CEPGData epgData; epgData.epg_times.startzeit = 0; epgData.epg_times.dauer = 0; - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { g_Timerd->getRecordingSafety(pre, post); if (epgData.epg_times.startzeit > 0) record_end = epgData.epg_times.startzeit + epgData.epg_times.dauer + post; @@ -508,7 +504,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = "not available"; if (epgid != 0) { CEPGData epgdata; - if (sectionsd_getEPGid(epgid, epg_time, &epgdata)) { + if (CEitManager::getInstance()->getEPGid(epgid, epg_time, &epgdata)) { tmpstring = epgdata.title; info1 = epgdata.info1; info2 = epgdata.info2; @@ -614,7 +610,7 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) if (g_settings.recording_epg_for_filename) { if(epgid != 0) { CShortEPGData epgdata; - if(sectionsd_getEPGidShort(epgid, &epgdata)) { + if(CEitManager::getInstance()->getEPGidShort(epgid, &epgdata)) { if (!(epgdata.title.empty())) { strcpy(&(filename[pos]), epgdata.title.c_str()); ZapitTools::replace_char(&filename[pos]); @@ -803,7 +799,7 @@ bool CRecordManager::Record(const t_channel_id channel_id, const char * dir, boo eventinfo.eventID = 0; eventinfo.channel_id = channel_id; - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { eventinfo.epgID = epgData.eventID; eventinfo.epg_starttime = epgData.epg_times.startzeit; strncpy(eventinfo.epgTitle, epgData.title.c_str(), EPG_TITLE_MAXLEN-1); diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 7aea07577..c24ca5437 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -345,8 +346,6 @@ bool CScreenShot::SaveBmp() return true; } -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); /* * create filename member from channel name and its current EPG data, @@ -370,9 +369,9 @@ void CScreenShot::MakeFileName(const t_channel_id channel_id) } pos = strlen(fname); - if(sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData)) { + if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData)) { CShortEPGData epgdata; - if(sectionsd_getEPGidShort(epgData.eventID, &epgdata)) { + if(CEitManager::getInstance()->getEPGidShort(epgData.eventID, &epgdata)) { if (!(epgdata.title.empty())) { strcpy(&(fname[pos]), epgdata.title.c_str()); ZapitTools::replace_char(&fname[pos]); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7a4d42231..0d52faf6e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -73,6 +73,8 @@ #include #include +#include + extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -88,10 +90,6 @@ extern CBouquetList * RADIOallList; extern bool autoshift; extern CBouquetManager *g_bouquetManager; -void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen); -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); - extern int old_b_id; CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) @@ -175,7 +173,7 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) unsigned int count; for (count = from; count < to; count++) { events.clear(); - sectionsd_getEventsServiceKey(chanlist[count]->channel_id, events); + CEitManager::getInstance()->getEventsServiceKey(chanlist[count]->channel_id, events); chanlist[count]->nextEvent.startTime = (long)0x7fffffff; for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) { if ((long)e->startTime > atime && @@ -198,7 +196,7 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) p_requested_channels[count] = chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL; } CChannelEventList levents; - sectionsd_getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); + CEitManager::getInstance()->getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); for (uint32_t count=0; count < chanlist_size; count++) { chanlist[count]->currentEvent = CChannelEvent(); for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { @@ -1544,7 +1542,7 @@ void CChannelList::paintDetails(int index) char buf[128] = {0}; char cFrom[50] = {0}; // UTF-8 CSectionsdClient::CurrentNextInfo CurrentNext; - sectionsd_getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext); if (!CurrentNext.next_name.empty()) { struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 35bbcaca7..386285bcf 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -290,7 +291,6 @@ bool EpgPlus::ChannelEventEntry::isSelected (time_t selectedTime) const return (selectedTime >= this->channelEvent.startTime) && (selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); } -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) { this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight() @@ -315,7 +315,8 @@ void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) CShortEPGData shortEpgData; - this->footer->paintEventDetails (this->channelEvent.description, sectionsd_getEPGidShort(this->channelEvent.eventID, &shortEpgData) ? shortEpgData.info1 : ""); + bool ret = CEitManager::getInstance()->getEPGidShort(this->channelEvent.eventID, &shortEpgData); + this->footer->paintEventDetails (this->channelEvent.description, ret ? shortEpgData.info1 : ""); this->timeLine->paintGrid(); } @@ -522,8 +523,6 @@ EpgPlus::~EpgPlus() this->free(); } -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); - void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) { for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); @@ -557,9 +556,8 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) ChannelEntry *channelEntry = new ChannelEntry (channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX + 2, yPosChannelEntry, this->channelsTableWidth); //printf("Going to get getEventsServiceKey for %llx\n", (channel->channel_id & 0xFFFFFFFFFFFFULL)); - //CChannelEventList channelEventList = g_Sectionsd->getEventsServiceKey (channel->channel->channel_id & 0xFFFFFFFFFFFFULL); CChannelEventList channelEventList; - sectionsd_getEventsServiceKey(channel->channel_id, channelEventList); + CEitManager::getInstance()->getEventsServiceKey(channel->channel_id, channelEventList); //printf("channelEventList size %d\n", channelEventList.size()); int xPosEventEntry = this->eventsTableX; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 40f6616be..9bf54faa6 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -55,6 +55,7 @@ #include #include +#include extern CPictureViewer * g_PicViewer; @@ -445,9 +446,6 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) return a.startTime< b.startTime; } -//extern char recDir[255]; -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop ) { int res = menu_return::RETURN_REPAINT; @@ -470,9 +468,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } bigFonts = g_settings.bigFonts; start(); - //evtlist = g_Sectionsd->getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL); - evtlist.clear(); - sectionsd_getEventsServiceKey(channel_id, evtlist); + CEitManager::getInstance()->getEventsServiceKey(channel_id, evtlist); // Houdini added for Private Premiere EPG start sorted by start date/time 2005-08-15 sort(evtlist.begin(),evtlist.end(),sortByDateTime); } @@ -640,7 +636,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int dummy_h,dummy_w; frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); if (dummy_h == 16 && dummy_w == 26){ // show only standard icon size - if ( sectionsd_getComponentTagsUniqueKey( epgData.eventID, tags ) ) + if (CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -941,9 +937,6 @@ void CEpgData::hide() showTimerEventBar (false); } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); - void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear ) { if(clear) @@ -953,11 +946,9 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* st bool res; if ( id!= 0 ) - //res = g_Sectionsd->getEPGid( id, *startzeit, &epgData ); - res = sectionsd_getEPGid(id, *startzeit, &epgData); + res = CEitManager::getInstance()->getEPGid(id, *startzeit, &epgData); else - //res = g_Sectionsd->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); - res = sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); + res = CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); if ( res ) { @@ -1057,7 +1048,6 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st char tmpstr[256]={0}; screening_dates = screening_nodual = ""; - // alredy read: evtlist = g_Sectionsd->getEventsServiceKey( channel_id&0xFFFFFFFFFFFFULL ); for (e = followlist.begin(); e != followlist.end(); ++e) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 496f545cf..141631200 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include @@ -65,10 +66,6 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); - #if 0 // sort operators bool sortById (const CChannelEvent& a, const CChannelEvent& b) @@ -151,9 +148,7 @@ bool CNeutrinoEventList::HasTimerConflicts(time_t starttime, time_t duration, ev void CNeutrinoEventList::readEvents(const t_channel_id channel_id) { - //evtlist = g_Sectionsd->getEventsServiceKey(channel_id &0xFFFFFFFFFFFFULL); - evtlist.clear(); - sectionsd_getEventsServiceKey(channel_id , evtlist); + CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); time_t azeit=time(NULL); CChannelEventList::iterator e; @@ -161,14 +156,12 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) CEPGData epgData; // todo: what if there are more than one events in the Portal - //if (g_Sectionsd->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { // epgData.eventID; // epgData.epg_times.startzeit; CSectionsdClient::LinkageDescriptorList linkedServices; - //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) - if ( sectionsd_getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) { if ( linkedServices.size()> 1 ) { @@ -193,9 +186,7 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) // do not add parent events if (channel_id != channel_id2) { - //evtlist2 = g_Sectionsd->getEventsServiceKey(channel_id2); - evtlist2.clear(); - sectionsd_getEventsServiceKey(channel_id2 , evtlist2); + CEitManager::getInstance()->getEventsServiceKey(channel_id2 , evtlist2); for (unsigned int loop=0 ; loopgetEventsServiceKeySearchAdd(evtlist,m_search_channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(m_search_channel_id, evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(m_search_channel_id, evtlist, m_search_epg_item,m_search_keyword); } else if(m_search_list == SEARCH_LIST_BOUQUET) { @@ -1035,8 +1024,7 @@ bool CNeutrinoEventList::findEvents(void) for(int channel = 0; channel < channel_nr; channel++) { channel_id = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id; - //g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(channel_id, evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(channel_id, evtlist, m_search_epg_item,m_search_keyword); } } else if(m_search_list == SEARCH_LIST_ALL) @@ -1050,8 +1038,7 @@ bool CNeutrinoEventList::findEvents(void) for(int channel = 0; channel < channel_nr; channel++) { channel_id = bouquetList->Bouquets[bouquet]->channelList->getChannelFromIndex(channel)->channel_id; - //g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(channel_id,evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(channel_id,evtlist, m_search_epg_item,m_search_keyword); } } box.hide(); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 595044fc6..ab75da82b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -62,11 +62,9 @@ #include #include #include +#include #include -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); - extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -386,8 +384,7 @@ void CInfoViewer::paintBackground(int col_NumBox) void CInfoViewer::show_current_next(bool new_chan, int epgpos) { - //info_CurrentNext = getEPG (channel_id); - sectionsd_getCurrentNextServiceKey(channel_id & 0xFFFFFFFFFFFFULL, info_CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(channel_id & 0xFFFFFFFFFFFFULL, info_CurrentNext); if (!evtlist.empty()) { if (new_chan) { for ( eli=evtlist.begin(); eli!=evtlist.end(); ++eli ) { @@ -600,9 +597,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con col_NumBoxText = COL_MENUHEAD; } if ((channel_id != new_channel_id) || (evtlist.empty())) { - evtlist.clear(); - //evtlist = g_Sectionsd->getEventsServiceKey(new_channel_id & 0xFFFFFFFFFFFFULL); - sectionsd_getEventsServiceKey(new_channel_id, evtlist); + CEitManager::getInstance()->getEventsServiceKey(new_channel_id, evtlist); if (!evtlist.empty()) sort(evtlist.begin(),evtlist.end(), sortByDateTime); new_chan = true; @@ -1270,8 +1265,7 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch { static CSectionsdClient::CurrentNextInfo oldinfo; - //g_Sectionsd->getCurrentNextServiceKey (for_channel_id & 0xFFFFFFFFFFFFULL, info); - sectionsd_getCurrentNextServiceKey(for_channel_id & 0xFFFFFFFFFFFFULL, info); + CEitManager::getInstance()->getCurrentNextServiceKey(for_channel_id & 0xFFFFFFFFFFFFULL, info); //printf("CInfoViewer::getEPG: old uniqueKey %llx new %llx\n", oldinfo.current_uniqueKey, info.current_uniqueKey); diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index 5e07e270c..7aec3d37d 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -50,6 +50,7 @@ #include #include +#include @@ -240,8 +241,6 @@ bool COsdLangSetup::changeNotify(const neutrino_locale_t, void *) return true; } -void sectionsd_set_languages(const std::vector& newLanguages); - bool CLangSelectNotifier::changeNotify(const neutrino_locale_t, void *) { std::vector v_languages; @@ -267,8 +266,7 @@ bool CLangSelectNotifier::changeNotify(const neutrino_locale_t, void *) } } } - //if(found) - sectionsd_set_languages(v_languages); + CEitManager::getInstance()->setLanguages(v_languages); return false; } diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 45803538a..b5c2605c0 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -51,7 +51,6 @@ #include #include - #include #include #include @@ -69,6 +68,8 @@ #include #include +#include + extern CBouquetManager *g_bouquetManager; #include @@ -648,7 +649,6 @@ void CTimerList::hide() } } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); void CTimerList::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight*2; @@ -744,8 +744,7 @@ void CTimerList::paintItem(int pos) if (timer.epgID!=0) { CEPGData epgdata; - //if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) - if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { zAddData += " : "; zAddData += epgdata.title; @@ -1227,8 +1226,7 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) if (it->epgID != 0) { CEPGData epgdata; - //if (g_Sectionsd->getEPGid(it->epgID, it->epg_starttime, &epgdata)) - if (sectionsd_getEPGid(it->epgID, it->epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata)) { timerbuf += ":"; timerbuf += epgdata.title; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3ea3be5cf..3b333b3e7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -140,12 +140,6 @@ void * nhttpd_main_thread(void *data); static pthread_t nhttpd_thread ; //#define DISABLE_SECTIONSD -extern int sectionsd_stop; -#ifndef DISABLE_SECTIONSD -//static pthread_t sections_thread; -#endif -void * sectionsd_main_thread(void *data); -extern bool timeset; // sectionsd extern cVideo * videoDecoder; extern cDemux *videoDemux; @@ -1575,9 +1569,6 @@ void CNeutrinoApp::SetupTiming() } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_isReady(void); - #define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000) #define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000) @@ -2669,8 +2660,7 @@ _repeat: if(timer.epgID!=0) { CEPGData epgdata; zAddData += " :\n"; - //if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) - if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { + if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { zAddData += epgdata.title; } else if(strlen(timer.epgTitle)!=0) { @@ -3550,7 +3540,6 @@ bool CNeutrinoApp::changeNotify(const neutrino_locale_t OptionName, void * /*dat void stop_daemons(bool stopall) { streamts_stop = 1; - sectionsd_stop = 1; dvbsub_close(); tuxtxt_stop(); tuxtxt_close(); @@ -3568,7 +3557,6 @@ void stop_daemons(bool stopall) } #ifndef DISABLE_SECTIONSD printf("sectionsd shutdown\n"); - //pthread_join(sections_thread, NULL); CEitManager::getInstance()->Stop(); printf("sectionsd shutdown done\n"); #endif diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index e53469824..f5e496eaa 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -45,13 +46,6 @@ #include "neutrinoapi.h" #include "controlapi.h" -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); - extern CPlugins *g_PluginList;//for relodplugins extern CBouquetManager *g_bouquetManager; #define EVENTDEV "/dev/input/input0" @@ -899,7 +893,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann if (event) { if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; - sectionsd_getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo); timestr = timeString(event->startTime); firstEPG += hh->outPair("startTime", timestr, true); @@ -1198,7 +1192,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) { std::string result = ""; std::string channelData = ""; - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false); @@ -1232,7 +1226,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ if (!(hh->ParamList["details"].empty())) { CShortEPGData epg; - if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { prog += hh->outPair("info1", hh->outValue(epg.info1), true); prog += hh->outPair("info2", hh->outValue(epg.info2), true); } @@ -1389,7 +1383,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { uint64_t epgid; sscanf(hh->ParamList["eventid"].c_str(), "%llu", &epgid); CShortEPGData epg; - if (sectionsd_getEPGidShort(epgid, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) { hh->WriteLn(epg.title); hh->WriteLn(epg.info1); hh->WriteLn(epg.info2); @@ -1402,7 +1396,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { sscanf(hh->ParamList["fskid"].c_str(), "%llu", &epgid); sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; - if (sectionsd_getEPGid(epgid, starttime, &longepg)) { + if (CEitManager::getInstance()->getEPGid(epgid, starttime, &longepg)) { hh->printf("%u\n", longepg.fsk); return; } @@ -1413,11 +1407,11 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (!(hh->ParamList["id"].empty())) { t_channel_id channel_id; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) { CShortEPGData epg; - if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration); hh->printf("%s\n", epg.title.c_str()); hh->printf("%s\n", epg.info1.c_str()); @@ -1508,8 +1502,8 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) { for(unsigned int i=0; i< desc.size(); i++) { @@ -1583,7 +1577,7 @@ void CControlAPI::LCDAction(CyhookHandler *hh) void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { int pos = 0; - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++) @@ -1648,8 +1642,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -1896,7 +1890,7 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) std::string title = timer->epgTitle; if(timer->epgID!=0) { CEPGData epgdata; - if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) title = epgdata.title; } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index ddef565df..2ca05cfd4 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -39,6 +39,7 @@ #include #include #include +#include extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; @@ -54,8 +55,6 @@ extern CZapitClient::SatelliteList satList; // nhttpd #include "neutrinoapi.h" -void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = true, t_channel_id *chidlist = NULL, int clen = 0); - //============================================================================= // No Class Helpers //============================================================================= @@ -259,7 +258,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { - sectionsd_getChannelEvents(eList); + CEitManager::getInstance()->getChannelEvents(eList); CChannelEventList::iterator eventIterator; ChannelListEvents.clear(); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index a7b5d0653..0ce62cf6d 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -29,16 +29,12 @@ #include #include #include +#include #include #include extern CBouquetManager *g_bouquetManager; -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); //============================================================================= // Constructor & Destructor & Initialization //============================================================================= @@ -291,7 +287,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, st sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); std::string _sid = std::string(id); sel = (_sid == achannel_id) ? "selected=\"selected\"" : ""; - sectionsd_getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg); + CEitManager::getInstance()->getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg); sprintf(buf,"\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str()); yresult += buf; } @@ -396,7 +392,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) { CSectionsdClient::NVODTimesList nvod_list; - if (sectionsd_getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) + if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) { CZapitClient::subServiceList subServiceList; @@ -413,7 +409,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: t_channel_id channel_id = CREATE_CHANNEL_ID(cmd.service_id, cmd.original_network_id, cmd.transport_stream_id); timestr = timeString(ni->zeit.startzeit); // FIXME: time is wrong (at least on little endian)! - sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!! + CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!! yresult += string_printf("\n ", classname); yresult += string_printf("%s ", classname, timestr.c_str()); yresult += string_printf("%sChannelListEvents[channel->channel_id])) { bool has_current_next = true; - sectionsd_getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); timestr = timeString(event->startTime); yresult += string_printf("",classname); @@ -547,8 +543,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -811,7 +807,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string if(timer->epgID!=0) { CEPGData epgdata; - if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) sAddData+="
" + epgdata.title; else sAddData+=std::string("
")+timer->epgTitle; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 9a34d4f89..83227c53c 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,6 @@ time_t timer_minutes; bool timer_is_rec; 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() { @@ -1113,7 +1111,7 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, recordingDir = recDir; epgTitle=""; CShortEPGData epgdata; - if (sectionsd_getEPGidShort(epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) epgTitle=epgdata.title; } @@ -1222,7 +1220,7 @@ void CTimerEvent_Record::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); // we check for a time in the middle of the recording time_t check_time=alarmTime/2 + stopTime/2; for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) @@ -1237,7 +1235,7 @@ void CTimerEvent_Record::getEpgId() if(eventInfo.epgID != 0) { CShortEPGData epgdata; - if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(eventInfo.epgID, &epgdata)) epgTitle=epgdata.title; } } @@ -1270,7 +1268,7 @@ void CTimerEvent_Zapto::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); // we check for a time 5 min after zap time_t check_time=alarmTime + 300; for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) @@ -1285,7 +1283,7 @@ void CTimerEvent_Zapto::getEpgId() if(eventInfo.epgID != 0) { CShortEPGData epgdata; - if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(eventInfo.epgID, &epgdata)) epgTitle=epgdata.title; } }