X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/59efe28a00e5713ad5279ed976430da31292a129..377116c3e006c0feee1b84af9285ce027bb92115:/lib/service/event.cpp diff --git a/lib/service/event.cpp b/lib/service/event.cpp index 19df5fc6..2704ff0f 100644 --- a/lib/service/event.cpp +++ b/lib/service/event.cpp @@ -78,7 +78,13 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang) m_extended_description += convertDVBUTF8(eed->getText()); retval=1; } - // TODO handling for extended event items? ( producer... ) + const ExtendedEventList *itemlist = eed->getItems(); + for (ExtendedEventConstIterator it = itemlist->begin(); it != itemlist->end(); ++it) + { + m_extended_description += convertDVBUTF8((*it)->getItemDescription()); + m_extended_description += ' '; + m_extended_description += convertDVBUTF8((*it)->getItem()); + } break; } default: @@ -92,7 +98,7 @@ RESULT eServiceEvent::parseFrom(Event *evt) { uint16_t stime_mjd = evt->getStartTimeMjd(); uint32_t stime_bcd = evt->getStartTimeBcd(); - uint16_t duration = evt->getDuration(); + uint32_t duration = evt->getDuration(); m_begin = parseDVBtime( stime_mjd >> 8, stime_mjd&0xFF, @@ -100,7 +106,7 @@ RESULT eServiceEvent::parseFrom(Event *evt) (stime_bcd >> 8)&0xFF, stime_bcd & 0xFF ); - m_duration = ((duration & 0xFF) + (duration >> 8) & 0xFF) * 24 * 60; + m_duration = fromBCD(duration>>16)*3600+fromBCD(duration>>8)*60+fromBCD(duration); std::string country="de_DE"; // TODO use local data here for (int i=0; i < MAX_LANG; i++) if (country==ISOtbl[i][0]) @@ -113,4 +119,15 @@ RESULT eServiceEvent::parseFrom(Event *evt) return 0; } +std::string eServiceEvent::getBeginTimeString() +{ + tm t; + localtime_r(&m_begin, &t); + char tmp[13]; + snprintf(tmp, 13, "%02d.%02d, %02d:%02d", + t.tm_mday, t.tm_mon+1, + t.tm_hour, t.tm_min); + return std::string(tmp, 12); +} + DEFINE_REF(eDebugClass);