diff --git a/data/locale/english.locale b/data/locale/english.locale index f8e1327a2..0ff7fe518 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2195,7 +2195,7 @@ timerlist.standby SB mode timerlist.standby.off Leave standby timerlist.standby.on Enter standby timerlist.stoptime Stop time -timerlist.type Timer typ +timerlist.type Timer type timerlist.type.execplugin Execute plugin timerlist.type.nextprogram Next program timerlist.type.record Record diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 8a5d2d5f6..f3d071fb2 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -1,7 +1,7 @@ #ifndef __sectionsdclient__ #define __sectionsdclient__ /* - Client-Interface für zapit - DBoxII-Project + Client-Interface for zapit - DBoxII-Project $Id: sectionsdclient.h,v 1.42 2007/01/12 22:57:57 houdini Exp $ @@ -230,8 +230,13 @@ class CEPGData std::vector items; char fsk; unsigned char table_id; +#ifdef FULL_CONTENT_CLASSIFICATION std::string contentClassification; std::string userClassification; +#else + unsigned char contentClassification; + unsigned char userClassification; +#endif CEPGData() { diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index 5a9b68e97..afd342b81 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -247,10 +247,53 @@ int CTimerdClient::addTimerEvent( CTimerEventTypes evType, void* data , int min, addTimerEvent(evType,true,data,0,mktime(actTime),0); } */ +bool CTimerdClient::checkDouble(CTimerd::CTimerEventTypes evType, void* data, time_t announcetime, time_t alarmtime,time_t stoptime, + CTimerd::CTimerEventRepeat evrepeat, uint32_t repeatcount) +{ + if (evType != CTimerd::TIMER_RECORD && evType != CTimerd::TIMER_ZAPTO) + return false;//skip check not zap and record timer + + CTimerd::TimerList timerlist; + getTimerList(timerlist); + for (CTimerd::TimerList::iterator it = timerlist.begin(); it != timerlist.end();++it) + { + if ( (it->eventType == CTimerd::TIMER_RECORD || it->eventType == CTimerd::TIMER_ZAPTO ) && + (it->alarmTime == alarmtime && it->announceTime == announcetime && it->stopTime == stoptime && it->eventRepeat == evrepeat && it->repeatCount == repeatcount ) ) + { + if( it->eventType == CTimerd::TIMER_ZAPTO ) + { + CTimerd::EventInfo *ei=static_cast(data); + if( ei->channel_id == it->channel_id ) + { + if(( ei->epgID != 0 && ei->epgID != it->epgID ) || ( ei->epg_starttime != 0 && it->epg_starttime != ei->epg_starttime) ) + { + return false;//not double + } + return true; + } + } + else if(it->eventType == CTimerd::TIMER_RECORD) + { + CTimerd::RecordingInfo *ri=static_cast(data); + if(ri->channel_id == it->channel_id && ri->apids == it->apids && !strncmp(ri->recordingDir, it->recordingDir, RECORD_DIR_MAXLEN-1) ) + { + if( ( ri->epgID != 0 && ri->epgID != it->epgID ) || ( ri->epg_starttime != 0 && it->epg_starttime != ri->epg_starttime) ) + { + return false;//not double + } + return true; + } + } + } + } + return false;//not double +} //------------------------------------------------------------------------- int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, time_t announcetime, time_t alarmtime,time_t stoptime, CTimerd::CTimerEventRepeat evrepeat, uint32_t repeatcount,bool forceadd) { + if(checkDouble(evType, data, announcetime, alarmtime, stoptime, evrepeat, repeatcount))//check if timer is add double + return -1; if (!forceadd) { diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 59a41b260..157c8f0f0 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -66,6 +66,7 @@ class CTimerdClient:private CBasicClient bool isTimerdAvailable(); // check if timerd is running CTimerd::TimerList getOverlappingTimers(time_t& announcetime, time_t& stoptime); + bool checkDouble(CTimerd::CTimerEventTypes evType, void* data, time_t announcetime, time_t alarmtime,time_t stoptime, CTimerd::CTimerEventRepeat /*evrepeat*/, uint32_t repeatcount); int addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, time_t alarmtime,time_t announcetime = 0, time_t stoptime = 0, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE, uint32_t repeatcount = 0, bool forceadd=true); diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 022c4f553..3f73ae03e 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -111,15 +111,23 @@ std::string CPictureViewer::DownloadImage(std::string url) FILE *tmpFile = fopen(tmpname.c_str(), "wb"); if (tmpFile) { CURL *ch = curl_easy_init(); - curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L); - curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); - curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, NULL); - curl_easy_setopt(ch, CURLOPT_WRITEDATA, tmpFile); - curl_easy_setopt(ch, CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(ch, CURLOPT_URL, url.c_str()); - curl_easy_perform(ch); - curl_easy_cleanup(ch); + if(ch) + { + curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L); + curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, NULL); + curl_easy_setopt(ch, CURLOPT_WRITEDATA, tmpFile); + curl_easy_setopt(ch, CURLOPT_FAILONERROR, 1L); + curl_easy_setopt(ch, CURLOPT_URL, url.c_str()); + curl_easy_setopt(ch, CURLOPT_CONNECTTIMEOUT, 3); + curl_easy_setopt(ch, CURLOPT_TIMEOUT, 4); + CURLcode res = curl_easy_perform(ch); + if (res != CURLE_OK){ + printf("[%s] curl_easy_perform() failed:%s\n",__func__, curl_easy_strerror(res)); + } + curl_easy_cleanup(ch); + } fclose(tmpFile); url = true; } diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 114eba3da..6311cc607 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -580,8 +580,13 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis info2 = epgdata.info2; recMovieInfo->parentalLockAge = epgdata.fsk; +#ifdef FULL_CONTENT_CLASSIFICATION if( !epgdata.contentClassification.empty() ) recMovieInfo->genreMajor = epgdata.contentClassification[0]; +#else + if(epgdata.contentClassification) + recMovieInfo->genreMajor = epgdata.contentClassification; +#endif recMovieInfo->length = epgdata.epg_times.dauer / 60; diff --git a/src/dt.c b/src/dt.c index eb82b2228..ddec4f7f9 100644 --- a/src/dt.c +++ b/src/dt.c @@ -129,14 +129,14 @@ int main(int argc, char **argv) } else if (sscanf(argv[x], "-ls%X", &b) == 1) { - if ((b > 0) || (b <= 8)) { + if ((b > 0) && (b <= 8)) { if (ioctl(fd, IOC_FP_LED_CTRL, b | 0x80)) perror("IOC_FP_LED_CTRL"); } } else if (sscanf(argv[x], "-lc%X", &b) == 1) { - if ((b > 0) || (b <= 8)) { + if ((b > 0) && (b <= 8)) { if (ioctl(fd, IOC_FP_LED_CTRL, b)) perror("IOC_FP_LED_CTRL"); } diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index 2c182e6ef..932d338ff 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -248,11 +248,17 @@ void SIevent::parse(Event &event) const ContentDescriptor * d = (ContentDescriptor *) *dit; const ContentClassificationList *clist = d->getClassifications(); if (clist->size()) { +#ifdef FULL_CONTENT_CLASSIFICATION ssize_t off = classifications.reserve(clist->size() * 2); for (ContentClassificationConstIterator cit = clist->begin(); cit != clist->end(); ++cit) off = classifications.set(off, (*cit)->getContentNibbleLevel1() << 4 | (*cit)->getContentNibbleLevel2(), (*cit)->getUserNibble1() << 4 | (*cit)->getUserNibble2()); +#else + ContentClassificationConstIterator cit = clist->begin(); + classifications.content = (*cit)->getContentNibbleLevel1() << 4 | (*cit)->getContentNibbleLevel2(); + classifications.user = (*cit)->getUserNibble1() << 4 | (*cit)->getUserNibble2(); +#endif } break; } @@ -414,8 +420,14 @@ void SIevent::parseContentDescriptor(const uint8_t *buf, unsigned maxlen) return; if(!cont->descriptor_length) return; +#ifdef FULL_CONTENT_CLASSIFICATION ssize_t off = classifications.reserve(cont->descriptor_length); classifications.set(off, buf + sizeof(struct descr_generic_header), cont->descriptor_length); +#else + classifications.content = buf[sizeof(struct descr_generic_header)]; + if (cont->descriptor_length > 1) + classifications.user = buf[sizeof(struct descr_generic_header)+1]; +#endif } void SIevent::parseComponentDescriptor(const uint8_t *buf, unsigned maxlen) @@ -651,6 +663,7 @@ int SIevent::saveXML2(FILE *file) const } } for_each(times.begin(), times.end(), saveSItimeXML(file)); +#ifdef FULL_CONTENT_CLASSIFICATION std::string contentClassification, userClassification; classifications.get(contentClassification, userClassification); for(unsigned i=0; i\n", contentClassification[i], userClassification[i]); } +#else + if (classifications.content || classifications.user) + fprintf(file, "\t\t\t\n", classifications.content, classifications.user); +#endif + for_each(components.begin(), components.end(), saveSIcomponentXML(file)); for_each(ratings.begin(), ratings.end(), saveSIparentalRatingXML(file)); for_each(linkage_descs.begin(), linkage_descs.end(), saveSIlinkageXML(file)); @@ -685,6 +703,7 @@ void SIevent::dump(void) const printf("Extended-Text (%s): %s\n", langIndex[it->lang].c_str(), it->text[SILangData::langExtendedText].c_str()); } +#ifdef FULL_CONTENT_CLASSIFICATION std::string contentClassification, userClassification; classifications.get(contentClassification, userClassification); if(!contentClassification.empty()) { @@ -699,6 +718,12 @@ void SIevent::dump(void) const printf(" 0x%02hhx", userClassification[i]); printf("\n"); } +#else + if (classifications.content || classifications.user) { + printf("Content classification: 0x%02hhx\n", classifications.content); + printf("User classification: 0x%02hhx\n", classifications.user); + } +#endif for_each(times.begin(), times.end(), printSItime()); for_each(components.begin(), components.end(), printSIcomponent()); diff --git a/src/eitd/SIevents.hpp b/src/eitd/SIevents.hpp index 0031853ce..7d4c00338 100644 --- a/src/eitd/SIevents.hpp +++ b/src/eitd/SIevents.hpp @@ -376,6 +376,7 @@ class SIevent #endif struct SIeventClassifications { +#ifdef FULL_CONTENT_CLASSIFICATION uint8_t *data; unsigned int size; @@ -486,6 +487,16 @@ class SIevent memcpy (data + off, _data, len); return off + len; } +#else + uint8_t content; + uint8_t user; + + SIeventClassifications() + { + content = 0; + user = 0; + } +#endif }; SIeventClassifications classifications; diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 0585170e3..7ee435513 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2650,7 +2650,12 @@ bool CEitManager::getEPGid(const event_id_t epgID, const time_t startzeit, CEPGD epgdata->info1 = evt.getText(); epgdata->info2 = evt.getExtendedText(); /* FIXME printf("itemDescription: %s\n", evt.itemDescription.c_str()); */ +#ifdef FULL_CONTENT_CLASSIFICATION evt.classifications.get(epgdata->contentClassification, epgdata->userClassification); +#else + epgdata->contentClassification = evt.classifications.content; + epgdata->userClassification = evt.classifications.user; +#endif epgdata->fsk = evt.getFSK(); epgdata->table_id = evt.table_id; @@ -2711,7 +2716,13 @@ bool CEitManager::getActualEPGServiceKey(const t_channel_id channel_id, CEPGData epgdata->info1 = evt.getText(); epgdata->info2 = evt.getExtendedText(); /* FIXME printf("itemDescription: %s\n", evt.itemDescription.c_str());*/ +#ifdef FULL_CONTENT_CLASSIFICATION evt.classifications.get(epgdata->contentClassification, epgdata->userClassification); +#else + epgdata->contentClassification = evt.classifications.content; + epgdata->userClassification = evt.classifications.user; +#endif + epgdata->fsk = evt.getFSK(); epgdata->table_id = evt.table_id; diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 1d624523c..5087cc0d8 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -439,10 +439,15 @@ void *insertEventsfromFile(void * data) } if (!contentClassification.empty()) { +#ifdef FULL_CONTENT_CLASSIFICATION ssize_t off = e.classifications.reserve(2 * contentClassification.size()); if (off > -1) for (unsigned i = 0; i < contentClassification.size(); i++) off = e.classifications.set(off, contentClassification.at(i), userClassification.at(i)); +#else + e.classifications.content = contentClassification.at(0); + e.classifications.user = userClassification.at(0); +#endif } addEvent(e, 0); ev_count++; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 4784ac99b..246ce4df5 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -436,7 +436,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* } } */ - else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode || CRCInput::RC_tv ) { + else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode || msg==CRCInput::RC_tv ) { if (mode == CZapitClient::MODE_TV) mode = CZapitClient::MODE_RADIO; else @@ -455,7 +455,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* if (state == beDefault) { if (selected < Channels->size()) /* Channels.size() might be 0 */ - g_Zapit->zapTo_serviceID((*Channels)[selected]->channel_id); + g_Zapit->zapTo_serviceID((*Channels)[selected]->getChannelID()); } else if (state == beMoving) { finishMoveChannel(); @@ -494,7 +494,7 @@ void CBEChannelWidget::deleteChannel() if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Channels)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) return; - g_bouquetManager->Bouquets[bouquet]->removeService((*Channels)[selected]->channel_id); + g_bouquetManager->Bouquets[bouquet]->removeService((*Channels)[selected]->getChannelID()); Channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels); diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 746f05850..83b658534 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -92,7 +92,7 @@ bool CBEChannelSelectWidget::isChannelInBouquet( int index) { for (unsigned int i=0; i< bouquetChannels->size(); i++) { - if ((*bouquetChannels)[i]->channel_id == Channels[index]->channel_id) + if ((*bouquetChannels)[i]->getChannelID() == Channels[index]->getChannelID()) return true; } return false; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 132af30e3..a8f6e2e7f 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -550,9 +550,9 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) CZapitChannel * channel = (*this->channelList)[i]; 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)); +//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); CChannelEventList channelEventList; - CEitManager::getInstance()->getEventsServiceKey(channel->channel_id, channelEventList); + CEitManager::getInstance()->getEventsServiceKey(channel->getChannelID(), channelEventList); //printf("channelEventList size %d\n", channelEventList.size()); int xPosEventEntry = this->eventsTableX; @@ -563,13 +563,13 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) //for (CChannelEventList::const_iterator It = channelEventList.begin(); (It != channelEventList.end()) && (It->startTime < (this->startTime + this->duration)); ++It) for (CChannelEventList::const_iterator It = channelEventList.begin(); It != channelEventList.end(); ++It) { -//if(0x2bc000b004b7ULL == (channel->channel_id & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration)); +//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration)); if (!(It->startTime < (this->startTime + this->duration)) ) continue; if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime)) { int startTimeDiff = It->startTime - this->startTime; int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration); -//if(0x2bc000b004b7ULL == (channel->channel_id & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str()); +//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str()); if ((startTimeDiff >= 0) && (endTimeDiff >= 0)) { // channel event fits completely in the visible part of time line startTimeDiff = 0; @@ -583,10 +583,10 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) // channel event ends after visible part of the time line but starts in the visible part startTimeDiff = 0; } else if (startTimeDiff > 0) { // channel event starts and ends after visible part of the time line => break the loop -//if(0x2bc000b004b7ULL == (channel->channel_id & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n"); +//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n"); break; } else { // channel event starts and ends after visible part of the time line => ignore the channel event -//if(0x2bc000b004b7ULL == (channel->channel_id & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff); +//if(0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff); continue; } @@ -927,7 +927,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } else if (msg == CRCInput::RC_ok) { if (selectedChannelEntry) - CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->channel_id); + CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->getChannelID()); current_bouquet = bouquetList->getActiveBouquetNumber(); } else if (CRCInput::isNumeric (msg)) { @@ -1110,7 +1110,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu this->hide(); time_t startTime2 = (*It)->channelEvent.startTime; - res = g_EpgData->show (this->selectedChannelEntry->channel->channel_id, (*It)->channelEvent.eventID, &startTime2); + res = g_EpgData->show (this->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.eventID, &startTime2); if (res == menu_return::RETURN_EXIT_ALL) { loop = false; @@ -1286,7 +1286,7 @@ int EpgPlus::MenuTargetAddReminder::exec (CMenuTarget * /*parent*/, const std::s && (!(*It)->channelEvent.description.empty()) ) { if (g_Timerd->isTimerdAvailable()) { - g_Timerd->addZaptoTimerEvent (this->epgPlus->selectedChannelEntry->channel->channel_id, (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); + g_Timerd->addZaptoTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); ShowMsg (LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTTIMED_MSG) , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 @@ -1309,7 +1309,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std ) { if (g_Timerd->isTimerdAvailable()) { - g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->channel_id, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime - (ANNOUNCETIME + 120) + g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime, (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime - (ANNOUNCETIME + 120) , TIMERD_APIDS_CONF, true); ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG) , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 6278cb098..78cb8f550 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -612,9 +612,14 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } // Show genre information +#ifdef FULL_CONTENT_CLASSIFICATION if (!epgData.contentClassification.empty()) processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(epgData.contentClassification[0])); // UTF-8 // processTextToArray( epgData.userClassification.c_str() ); +#else + if (epgData.contentClassification) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(epgData.contentClassification)); // UTF-8 +#endif // -- display more screenings on the same channel // -- 2002-05-03 rasc diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index e5d3a3342..de7d321a9 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -567,22 +567,22 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c unsigned int tmp_channel = 0; for(unsigned int channel = 0; channel < channel_nr; channel++) { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); if(channel_id_tmp == channel_id){ if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { channel = (channel+1) %channel_nr; }else { //RC_rewind channel = (channel == 0) ? channel_nr -1 : channel - 1; } - _channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id; + _channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); current_channel_name = CServiceManager::getInstance()->GetServiceName(_channel_id); tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->channel_id; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); tmp_channel = (channel+1) %channel_nr; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->channel_id; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); break; } @@ -1078,7 +1078,7 @@ bool CNeutrinoEventList::findEvents(void) int channel_nr = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getSize(); for(int channel = 0; channel < channel_nr; channel++) { - channel_id = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id; + channel_id = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); CEitManager::getInstance()->getEventsServiceKey(channel_id, evtlist, m_search_epg_item,m_search_keyword); } } @@ -1090,7 +1090,7 @@ bool CNeutrinoEventList::findEvents(void) std::vector v; int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio for(int channel = 0; channel < channel_nr; channel++){ - channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; + channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->getChannelID(); v.push_back(channel_id); } diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 0bad83d7d..752cd5656 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -262,7 +262,6 @@ CTimerList::CTimerList() liststart = 0; listmaxshow = 0; Timer = new CTimerdClient(); - skipEventID=0; timerNew_message = ""; timerNew_pluginName = ""; @@ -434,16 +433,6 @@ void CTimerList::updateEvents(void) { timerlist.clear(); Timer->getTimerList (timerlist); - //Remove last deleted event from List - CTimerd::TimerList::iterator timer = timerlist.begin(); - for (; timer != timerlist.end(); ++timer) - { - if (timer->eventID==skipEventID) - { - timerlist.erase(timer); - break; - } - } sort(timerlist.begin(), timerlist.end()); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -613,7 +602,6 @@ int CTimerList::show() } if (killTimer) { Timer->removeTimerEvent(timerlist[selected].eventID); - skipEventID=timerlist[selected].eventID; update = true; } } @@ -1194,7 +1182,7 @@ int CTimerList::newTimer() g_bouquetManager->Bouquets[i]->getTvChannels(channels); for (int j = 0; j < (int) channels.size(); j++) { char cChannelId[3+16+1+1]; - sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", channels[j]->channel_id); + sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", channels[j]->getChannelID()); mwtv->addItem(new CMenuForwarder(channels[j]->getName(), true, NULL, this, (std::string(cChannelId) + channels[j]->getName()).c_str(), CRCInput::RC_nokey, NULL, channels[j]->scrambled ? NEUTRINO_ICON_SCRAMBLED : (channels[j]->getUrl().empty() ? NULL : NEUTRINO_ICON_STREAMING))); } @@ -1205,7 +1193,7 @@ int CTimerList::newTimer() g_bouquetManager->Bouquets[i]->getRadioChannels(channels); for (int j = 0; j < (int) channels.size(); j++) { char cChannelId[3+16+1+1]; - sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", channels[j]->channel_id); + sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", channels[j]->getChannelID()); mwradio->addItem(new CMenuForwarder(channels[j]->getName(), true, NULL, this, (std::string(cChannelId) + channels[j]->getName()).c_str(), CRCInput::RC_nokey, NULL, channels[j]->scrambled ? NEUTRINO_ICON_SCRAMBLED : (channels[j]->getUrl().empty() ? NULL : NEUTRINO_ICON_STREAMING))); } if (!channels.empty()) @@ -1239,7 +1227,7 @@ int CTimerList::newTimer() &timerSettings_stopTime.getValue()); CMenuOptionChooser* m0; if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, TIMERLIST_TYPE_OPTIONS, TIMERLIST_TYPE_OPTION_COUNT, true, ¬ifier2); + m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, TIMERLIST_TYPE_OPTIONS, TIMERLIST_TYPE_OPTION_COUNT, true, ¬ifier2, CRCInput::RC_nokey, "", false, true); else m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, &TIMERLIST_TYPE_OPTIONS[1], TIMERLIST_TYPE_OPTION_COUNT-1, true, ¬ifier2); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 137eb6286..1139bd3b7 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -73,8 +73,6 @@ class CTimerList : public CMenuTarget int timer_apids_ac3; int timer_apids_alt; - int skipEventID; - void paintItem(int pos); void paint(); void paintHead(); diff --git a/src/gui/zapit_setup.cpp b/src/gui/zapit_setup.cpp index 411ec8aea..51880c1d8 100644 --- a/src/gui/zapit_setup.cpp +++ b/src/gui/zapit_setup.cpp @@ -176,7 +176,7 @@ int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode for(int j = 0; j < (int) channels.size(); j++) { CZapitChannel * channel = channels[j]; char cChannelId[60] = {0}; - snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode==CZapitClient::MODE_TV)?'T':'R', channel->number, channel->channel_id); + snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode==CZapitClient::MODE_TV)?'T':'R', channel->number, channel->getChannelID()); CMenuForwarder * chan_item = new CMenuForwarder(channel->getName(), true, NULL, this, (std::string(cChannelId) + channel->getName()).c_str(), CRCInput::RC_nokey, NULL, diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 63e6b64b3..22c4093cd 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -832,13 +832,13 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; if (event) { int percentage = 100; if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); timestr = timeString(event->startTime); firstEPG += hh->outPair("startTime", timestr, true); @@ -857,7 +857,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann } } - result += hh->outPair("isActiveChannel", (channel->channel_id == current_channel) ? "true" : "false", (!firstEPG.empty())); + result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", (!firstEPG.empty())); if(!firstEPG.empty()) { result += hh->outCollection("firstEPG", firstEPG); } @@ -875,10 +875,10 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * bool isEPGdetails = !(hh->ParamList["epg"].empty()); if (hh->outType == json || hh->outType == xml) { result += hh->outPair("number", string_printf("%u", nr), true); - result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->channel_id), true); - result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->channel_id&0xFFFFFFFFFFFFULL), true); + result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); + result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true); result += hh->outPair("name", hh->outValue(channel->getName()), true); - result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id)), true); + result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), true); result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), isEPGdetails); if(isEPGdetails) result += _GetBouquetActualEPGItem(hh, channel); @@ -886,21 +886,21 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * } else { CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; if (event && isEPGdetails) { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s (%s)\n", nr, - channel->channel_id, + channel->getChannelID(), channel->getName().c_str(), event->description.c_str()); } else { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", nr, - channel->channel_id, + channel->getChannelID(), channel->getName().c_str()); } } @@ -1296,7 +1296,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { for (int j = 0, csize = (int) channels.size(); j < csize; j++) { CZapitChannel * channel = channels[j]; - res_channels += hh->outArrayItem("channel", channelEPGformated(hh, j + 1, channel->channel_id, max, stoptime), joutArrayItem("channel", channelEPGformated(hh, j + 1, channel->getChannelID(), max, stoptime), joutPair("number", string_printf("%d", i + 1), true) + @@ -1357,7 +1357,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) std::vector v; int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio for(int channel = 0; channel < channel_nr; channel++){ - channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; + channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->getChannelID(); v.push_back(channel_id); } std::map ch_id_map; @@ -1404,11 +1404,19 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str()); if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { hh->printf("\t\t%u\n", longepg.fsk); +#ifdef FULL_CONTENT_CLASSIFICATION if (!longepg.contentClassification.empty()){ genere = GetGenre(longepg.contentClassification[0]); genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); hh->printf("\t\t%s\n", genere.c_str()); } +#else + if (longepg.contentClassification) { + genere = GetGenre(longepg.contentClassification); + genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); + hh->printf("\t\t%s\n", genere.c_str()); + } +#endif } strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); hh->printf("\t\t%s\n", tmpstr); @@ -1438,11 +1446,19 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) hh->WriteLn(epg.info2); if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { hh->printf("fsk:%u\n", longepg.fsk); +#ifdef FULL_CONTENT_CLASSIFICATION if (!longepg.contentClassification.empty()){ genere = GetGenre(longepg.contentClassification[0]); genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); hh->WriteLn(genere); } +#else + if (longepg.contentClassification) { + genere = GetGenre(longepg.contentClassification); + genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); + hh->WriteLn(genere); + } +#endif } hh->WriteLn("----------------------------------------------------------"); @@ -1493,15 +1509,15 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; if (event) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", channel->channel_id, event->eventID, event->description.c_str()); + " %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str()); } else { // ext output hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %ld %u %llu %s\n", channel->channel_id, event->startTime, event->duration, event->eventID, event->description.c_str()); + " %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str()); } } } @@ -1769,14 +1785,14 @@ void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP) CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - if(!currentTP || (channel->channel_id >>16) == current_channel){ + if(!currentTP || (channel->getChannelID() >>16) == current_channel){ - size_t pos = std::find(v.begin(), v.end(), channel->channel_id) - v.begin(); + size_t pos = std::find(v.begin(), v.end(), channel->getChannelID()) - v.begin(); if( pos < v.size() ) continue; - v.push_back(channel->channel_id); + v.push_back(channel->getChannelID()); - hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->channel_id, channel->getName().c_str()); + hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->getChannelID(), channel->getName().c_str()); } } } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 5cc68137b..d8373f243 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -300,11 +300,11 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, st CEPGData epg; CZapitChannel * channel = channels[j]; char buf[100],id[20]; - sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); + sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->getChannelID()); std::string _sid = std::string(id); sel = (_sid == achannel_id) ? "selected=\"selected\"" : ""; - CEitManager::getInstance()->getActualEPGServiceKey(channel->channel_id, &epg); - sprintf(buf,"\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str()); + CEitManager::getInstance()->getActualEPGServiceKey(channel->getChannelID(), &epg); + sprintf(buf,"\n", channel->getChannelID(), sel.c_str(), channel->getName().c_str(),epg.title.c_str()); yresult += buf; } } @@ -357,10 +357,10 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: { CZapitChannel * channel = channels[j]; CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; + event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; classname = (i++ & 1) ? 'a' : 'b'; - if (channel->channel_id == current_channel) + if (channel->getChannelID() == current_channel) classname = 'c'; std::string bouquetstr = (BouquetNr >= 0) ? ("&bouquet=" + itoa(BouquetNr)) : ""; @@ -369,8 +369,8 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if(have_logos) yresult += string_printf("", classname, channel->channel_id, - (NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id)).c_str()); + "')\">", classname, channel->getChannelID(), + (NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())).c_str()); /* timer slider */ if(event && event->duration > 0) @@ -408,16 +408,16 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: "','" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "')\">%s\n", - ((channel->channel_id == current_channel) ? "" : " "), - channel->channel_id, + ((channel->getChannelID() == current_channel) ? "" : " "), + channel->getChannelID(), channel->number /* num + j */, channel->getName().c_str(), (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", - channel->channel_id, - channel->channel_id & 0xFFFFFFFFFFFFULL, - ((NeutrinoAPI->ChannelListEvents[channel->channel_id]) ? "\"Program" : "")); + channel->getChannelID(), + channel->getChannelID() & 0xFFFFFFFFFFFFULL, + ((NeutrinoAPI->ChannelListEvents[channel->getChannelID()]) ? "\"Program" : "")); - if (channel->channel_id == current_channel) + if (channel->getChannelID() == current_channel) yresult += string_printf("\n  \"Streaminfo\""); yresult += string_printf("\n\n\n"); @@ -425,7 +425,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) { CSectionsdClient::NVODTimesList nvod_list; - if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id, nvod_list)) + if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->getChannelID(), nvod_list)) { CZapitClient::subServiceList subServiceList; @@ -465,10 +465,10 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } } - else if ((event = NeutrinoAPI->ChannelListEvents[channel->channel_id])) + else if ((event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()])) { bool has_current_next = true; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); timestr = timeString(event->startTime); yresult += string_printf("",classname); @@ -1070,23 +1070,23 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin for (; !(cit.EndOfChannels()); cit++) { if (((*cit)->flags & CZapitChannel::REMOVED) || (*cit)->flags & CZapitChannel::NOT_FOUND) continue; - sel = ((*cit)->channel_id == current_channel) ? "selected=\"selected\"" : ""; + sel = ((*cit)->getChannelID() == current_channel) ? "selected=\"selected\"" : ""; hh->ParamList["program_row"] += string_printf("\n", - (*cit)->channel_id, sel.c_str(), (*cit)->getName().c_str()); + (*cit)->getChannelID(), sel.c_str(), (*cit)->getName().c_str()); } cit = g_bouquetManager->radioChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { if (((*cit)->flags & CZapitChannel::REMOVED) || (*cit)->flags & CZapitChannel::NOT_FOUND) continue; - sel = ((*cit)->channel_id == current_channel) ? "selected=\"selected\"" : ""; + sel = ((*cit)->getChannelID() == current_channel) ? "selected=\"selected\"" : ""; hh->ParamList["program_row"] += string_printf("\n", - (*cit)->channel_id, sel.c_str(), (*cit)->getName().c_str()); + (*cit)->getChannelID(), sel.c_str(), (*cit)->getName().c_str()); } // recordingDir hh->ParamList["RECORD_DIR_MAXLEN"] = itoa(RECORD_DIR_MAXLEN-1); @@ -1174,7 +1174,7 @@ std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std string_printf("\n", - (*channels)[j]->channel_id, + (*channels)[j]->getChannelID(), (*channels)[j]->getName().c_str()); } ZapitChannelList Channels; @@ -1187,12 +1187,12 @@ std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std sort(Channels.begin(), Channels.end(), CmpChannelByChName()); for (int i = 0; i < (int) Channels.size(); i++) { - if (!g_bouquetManager->existsChannelInBouquet(selected, Channels[i]->channel_id)){ + if (!g_bouquetManager->existsChannelInBouquet(selected, Channels[i]->getChannelID())){ hh->ParamList["all_channels"] += string_printf("\n", - Channels[i]->channel_id, + Channels[i]->getChannelID(), Channels[i]->getName().c_str()); } } diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 60590e7ee..a9ae4bc52 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -59,6 +59,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) case CTimerdMsg::CMD_GETSLEEPTIMER: rspGetSleeptimer.eventID = 0; + CTimerManager::getInstance()->lockEvents(); if (CTimerManager::getInstance()->listEvents(events)) { for (pos = events.begin(); pos != events.end(); ++pos) @@ -71,6 +72,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) } } } + CTimerManager::getInstance()->unlockEvents(); CBasicServer::send_data(connfd, &rspGetSleeptimer, sizeof(rspGetSleeptimer)); break; @@ -78,6 +80,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CTimerdMsg::commandGetTimer msgGetTimer; CTimerd::responseGetTimer resp; CBasicServer::receive_data(connfd,&msgGetTimer, sizeof(msgGetTimer)); + CTimerManager::getInstance()->lockEvents(); if(CTimerManager::getInstance()->listEvents(events)) { if(events[msgGetTimer.eventID]) @@ -134,11 +137,13 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) } } } + CTimerManager::getInstance()->unlockEvents(); CBasicServer::send_data(connfd, &resp, sizeof(CTimerd::responseGetTimer)); break; case CTimerdMsg::CMD_GETTIMERLIST: CTimerdMsg::generalInteger responseInteger; + CTimerManager::getInstance()->lockEvents(); responseInteger.number = (CTimerManager::getInstance()->listEvents(events)) ? events.size() : 0; if (CBasicServer::send_data(connfd, &responseInteger, sizeof(responseInteger)) == true) @@ -200,6 +205,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CBasicServer::send_data(connfd, &lresp, sizeof(CTimerd::responseGetTimer)); } } + CTimerManager::getInstance()->unlockEvents(); break; case CTimerdMsg::CMD_RESCHEDULETIMER: // event nach vorne oder hinten schieben diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index ad6262ead..f46a05bc8 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -277,12 +277,24 @@ bool CTimerManager::stopEvent(int peventID) } //------------------------------------------------------------ +int CTimerManager::lockEvents() +{ + return pthread_mutex_lock(&tm_eventsMutex); +} + +//------------------------------------------------------------ +int CTimerManager::unlockEvents() +{ + return pthread_mutex_unlock(&tm_eventsMutex); +} + +//------------------------------------------------------------ + bool CTimerManager::listEvents(CTimerEventMap &Events) { if(!&Events) return false; - pthread_mutex_lock(&tm_eventsMutex); Events.clear(); for (CTimerEventMap::iterator pos = events.begin(); pos != events.end(); ++pos) @@ -290,7 +302,6 @@ bool CTimerManager::listEvents(CTimerEventMap &Events) pos->second->Refresh(); Events[pos->second->eventID] = pos->second; } - pthread_mutex_unlock(&tm_eventsMutex); return true; } //------------------------------------------------------------ @@ -339,13 +350,19 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi break; case CTimerd::TIMER_RECORD: { - (static_cast(event))->recordingDir = data.recordingDir; - (static_cast(event))->getEpgId(); + CTimerEvent_Record *event_record = static_cast(event); + event_record->recordingDir = data.recordingDir; + event_record->eventInfo.epgID = 0; + event_record->eventInfo.epg_starttime = 0; + event_record->getEpgId(); break; } case CTimerd::TIMER_ZAPTO: { - (static_cast(event))->getEpgId(); + CTimerEvent_Zapto *event_zapto = static_cast(event); + event_zapto->eventInfo.epgID = 0; + event_zapto->eventInfo.epg_starttime = 0; + event_zapto->getEpgId(); break; } default: diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h index 708171d3e..7d9a18b22 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -237,6 +237,8 @@ public: bool removeEvent(int eventID); bool stopEvent(int eventID); CTimerEvent* getNextEvent(); + int lockEvents(); + int unlockEvents(); bool listEvents(CTimerEventMap &Events); CTimerd::CTimerEventTypes *getEventType(int eventID); // int modifyEvent(int eventID, time_t announceTime, time_t alarmTime, time_t stopTime, uint32_t repeatcount, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE); diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 57dd00220..83bae3028 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -173,6 +173,7 @@ class CZapitChannel void Init(); friend class CChannelList; + t_channel_id channel_id; public: typedef enum channel_flags { @@ -193,7 +194,6 @@ class CZapitChannel int number; CChannelEvent currentEvent,nextEvent; int type; - t_channel_id channel_id; unsigned char scrambled; char * pname; bool has_bouquet; diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index d08a9072c..1265ef664 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -293,7 +293,7 @@ bool CFEManager::loadSettings() satellite_map_t & satmap = fe->getSatellites(); satmap.clear(); - satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); + satellite_map_t &satlist = CServiceManager::getInstance()->SatelliteList(); for(sat_iterator_t sit = satlist.begin(); sit != satlist.end(); ++sit) { if (!fe->supportsDelivery(sit->second.delsys)) @@ -321,6 +321,8 @@ bool CFEManager::loadSettings() if(getSatelliteConfig(fe, satconfig)) satmap[position] = satconfig; // overwrite if exist + if (satconfig.use_in_scan) + sit->second.use_in_scan = satconfig.use_in_scan; } } @@ -331,6 +333,7 @@ bool CFEManager::loadSettings() void CFEManager::saveSettings(bool write) { configfile.clear(); + satellite_map_t &satlist = CServiceManager::getInstance()->SatelliteList(); for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * fe = it->second; frontend_config_t & fe_config = fe->getConfig(); @@ -355,6 +358,9 @@ void CFEManager::saveSettings(bool write) satellite_map_t satellites = fe->getSatellites(); for(sat_iterator_t sit = satellites.begin(); sit != satellites.end(); ++sit) { if (sit->second.configured) { + sat_iterator_t tit = satlist.find(sit->first); + if (tit != satlist.end()) + sit->second.use_in_scan = tit->second.use_in_scan; satList.push_back(sit->first); setSatelliteConfig(fe, sit->second); }