diff options
-rw-r--r-- | filter.cpp | 4 | ||||
-rw-r--r-- | global.h | 1 | ||||
-rw-r--r-- | infosatepg.cpp | 65 | ||||
-rw-r--r-- | infosatepg.h | 1 | ||||
-rw-r--r-- | po/de_DE.po | 252 | ||||
-rw-r--r-- | po/it_IT.po | 252 | ||||
-rw-r--r-- | process.cpp | 594 | ||||
-rw-r--r-- | process.h | 38 |
8 files changed, 1127 insertions, 80 deletions
@@ -102,7 +102,7 @@ void cFilterInfosatepg::Process(u_short Pid, u_char Tid, const u_char *Data, int // Check IP checksum if (IPChecksum(ip_hdr)!=0) { - dsyslog("infosatepg: ip checksum error"); + esyslog("infosatepg: ip checksum error"); return; } @@ -112,7 +112,7 @@ void cFilterInfosatepg::Process(u_short Pid, u_char Tid, const u_char *Data, int // Check UDP checksum if (UDPChecksum(ip_hdr,udp_hdr)!=0) { - dsyslog("infosatepg: udp checksum error"); + esyslog("infosatepg: udp checksum error"); return; } @@ -125,7 +125,6 @@ public: cGlobalInfosatdata Infosatdata[EPG_DAYS+1]; void SetWakeupTime(int Time) { - dsyslog("infosatepg: time=%i",Time); if (Time==-1) return; if (wakeuptime!=-1) return; // already set wakeuptime=Time; diff --git a/infosatepg.cpp b/infosatepg.cpp index 955d0dd..4cb1811 100644 --- a/infosatepg.cpp +++ b/infosatepg.cpp @@ -26,6 +26,7 @@ cPluginInfosatepg::cPluginInfosatepg(void) // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! statusMonitor=NULL; global=new cGlobalInfosatepg; + numprocessed=0; mac=EPG_FIRST_DAY_MAC; } @@ -120,34 +121,38 @@ void cPluginInfosatepg::Stop(void) void cPluginInfosatepg::Housekeeping(void) { // Perform any cleanup or other regular tasks. - if (!global->ReceivedAll()) return; - if (global->ProcessedAll) return; - - if (!global->Infosatdata[mac].Processed) - { - isyslog ("infosatepg: janitor found data to be processed: day=%i month=%i", - global->Infosatdata[mac].Day(),global->Infosatdata[mac].Month()); - cProcessInfosatepg process(mac,global); - } - mac++; +} - int numprocessed=0; - for (int pmac=EPG_FIRST_DAY_MAC; pmac<=EPG_LAST_DAY_MAC; pmac++) +void cPluginInfosatepg::MainThreadHook(void) +{ + // Perform actions in the context of the main program thread. + if (!global->WaitOk()) return; + if (global->ReceivedAll() && !global->ProcessedAll) { - if (global->Infosatdata[pmac].Processed) numprocessed++; + if (!global->Infosatdata[mac].Processed) + { + isyslog ("infosatepg: found data to be processed: day=%i month=%i", + global->Infosatdata[mac].Day(),global->Infosatdata[mac].Month()); + cProcessInfosatepg process(mac,global); + global->SetWaitTimer(); + } + if (global->Infosatdata[mac].Processed) + { + numprocessed++; + mac++; + } + if (numprocessed==EPG_DAYS) + { + global->ProcessedAll=true; + } } - if (numprocessed==EPG_DAYS) + else { - global->ProcessedAll=true; + numprocessed=0; mac=EPG_FIRST_DAY_MAC; } -} -void cPluginInfosatepg::MainThreadHook(void) -{ - // Perform actions in the context of the main program thread. - if ((!global->WaitOk()) || (global->Switched()) || (global->ReceivedAll()) || - (global->Channel()==-1)) return; + if ((global->Switched()) || (global->ReceivedAll()) || (global->Channel()==-1)) return; cChannel *chan=Channels.GetByNumber(global->Channel()); if (!chan) return; @@ -283,8 +288,12 @@ const char **cPluginInfosatepg::SVDRPHelpPages(void) // Returns help text for SVDRP static const char *HelpPages[] = { - "STATE\n" + "STAT\n" " Return actual state of the plugin", + "RESR\n" + " Reset received all", + "REPR\n" + " Reprocess again", NULL }; return HelpPages; @@ -294,7 +303,17 @@ cString cPluginInfosatepg::SVDRPCommand(const char *Command, const char *Option, { // Process SVDRP commands char *output=NULL; - if (!strcasecmp(Command,"STATE")) + if (!strcasecmp(Command,"RESR")) + { + global->ResetReceivedAll(); + asprintf(&output,"OK\n"); + } + if (!strcasecmp(Command,"REPR")) + { + global->ResetProcessed(); + asprintf(&output,"OK\n"); + } + if (!strcasecmp(Command,"STAT")) { int day,month; asprintf(&output,"InfosatEPG state:\n"); diff --git a/infosatepg.h b/infosatepg.h index e1f51b2..7b4d80e 100644 --- a/infosatepg.h +++ b/infosatepg.h @@ -20,6 +20,7 @@ private: // Add any member variables or functions you may need here. cGlobalInfosatepg *global; cStatusInfosatepg *statusMonitor; + int numprocessed; int mac; public: cPluginInfosatepg(void); diff --git a/po/de_DE.po b/po/de_DE.po index 7f2879d..d93d283 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-1.6.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2009-02-01 12:25+0100\n" +"POT-Creation-Date: 2009-02-08 00:59+0100\n" "PO-Revision-Date: 2008-05-02 16:20+0200\n" "Last-Translator: Jochen Dolze <infosatepg@dolze.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -18,6 +18,255 @@ msgstr "" msgid "Infosat plugin still working" msgstr "Infosat Plugin ist noch nicht fertig" +msgid "Content$Movie/Drama" +msgstr "" + +msgid "Content$News/Current Affairs" +msgstr "" + +msgid "Content$Show/Game Show" +msgstr "" + +msgid "Content$Sports" +msgstr "" + +msgid "Content$Children's/Youth Programmes" +msgstr "" + +msgid "Content$Music/Ballet/Dance" +msgstr "" + +msgid "Content$Arts/Culture" +msgstr "" + +msgid "Content$Social/Political/Economics" +msgstr "" + +msgid "Content$Education/Science/Factual" +msgstr "" + +msgid "Content$Leisure/Hobbies" +msgstr "" + +msgid "Content$Special" +msgstr "" + +msgid "Content$Userdefined" +msgstr "" + +msgid "Content$Detective/Thriller" +msgstr "" + +msgid "Content$Adventure/Western/War" +msgstr "" + +msgid "Content$Science Fiction/Fantasy/Horror" +msgstr "" + +msgid "Content$Comedy" +msgstr "" + +msgid "Content$Soap/Melodrama/Folkloric" +msgstr "" + +msgid "Content$Romance" +msgstr "" + +msgid "Content$Serious/Classical/Religious/Historical Movie/Drama" +msgstr "" + +msgid "Content$Adult Movie/Drama" +msgstr "" + +msgid "Content$News/Weather Report" +msgstr "" + +msgid "Content$News Magazine" +msgstr "" + +msgid "Content$Documentary" +msgstr "" + +msgid "Content$Discussion/Inverview/Debate" +msgstr "" + +msgid "Content$Game Show/Quiz/Contest" +msgstr "" + +msgid "Content$Variety Show" +msgstr "" + +msgid "Content$Talk Show" +msgstr "" + +msgid "Content$Special Event" +msgstr "" + +msgid "Content$Sport Magazine" +msgstr "" + +msgid "Content$Football" +msgstr "" + +msgid "Content$Tennis/Squash" +msgstr "" + +msgid "Content$Team Sports" +msgstr "" + +msgid "Content$Athletics" +msgstr "" + +msgid "Content$Motor Sport" +msgstr "" + +msgid "Content$Water Sport" +msgstr "" + +msgid "Content$Winter Sports" +msgstr "" + +msgid "Content$Equestrian" +msgstr "" + +msgid "Content$Martial Sports" +msgstr "" + +msgid "Content$Pre-school Children's Programmes" +msgstr "" + +msgid "Content$Entertainment Programmes for 6 to 14" +msgstr "" + +msgid "Content$Entertainment Programmes for 10 to 16" +msgstr "" + +msgid "Content$Informational/Educational/School Programme" +msgstr "" + +msgid "Content$Cartoons/Puppets" +msgstr "" + +msgid "Content$Rock/Pop" +msgstr "" + +msgid "Content$Serious/Classical Music" +msgstr "" + +msgid "Content$Folk/Tradional Music" +msgstr "" + +msgid "Content$Jazz" +msgstr "" + +msgid "Content$Musical/Opera" +msgstr "" + +msgid "Content$Ballet" +msgstr "" + +msgid "Content$Performing Arts" +msgstr "" + +msgid "Content$Fine Arts" +msgstr "" + +msgid "Content$Religion" +msgstr "" + +msgid "Content$Popular Culture/Traditional Arts" +msgstr "" + +msgid "Content$Literature" +msgstr "" + +msgid "Content$Film/Cinema" +msgstr "" + +msgid "Content$Experimental Film/Video" +msgstr "" + +msgid "Content$Broadcasting/Press" +msgstr "" + +msgid "Content$New Media" +msgstr "" + +msgid "Content$Arts/Culture Magazines" +msgstr "" + +msgid "Content$Fashion" +msgstr "" + +msgid "Content$Magazines/Reports/Documentary" +msgstr "" + +msgid "Content$Economics/Social Advisory" +msgstr "" + +msgid "Content$Remarkable People" +msgstr "" + +msgid "Content$Nature/Animals/Environment" +msgstr "" + +msgid "Content$Technology/Natural Sciences" +msgstr "" + +msgid "Content$Medicine/Physiology/Psychology" +msgstr "" + +msgid "Content$Foreign Countries/Expeditions" +msgstr "" + +msgid "Content$Social/Spiritual Sciences" +msgstr "" + +msgid "Content$Further Education" +msgstr "" + +msgid "Content$Languages" +msgstr "" + +msgid "Content$Tourism/Travel" +msgstr "" + +msgid "Content$Handicraft" +msgstr "" + +msgid "Content$Motoring" +msgstr "" + +msgid "Content$Fitness & Health" +msgstr "" + +msgid "Content$Cooking" +msgstr "" + +msgid "Content$Advertisement/Shopping" +msgstr "" + +msgid "Content$Gardening" +msgstr "" + +msgid "Content$Original Language" +msgstr "" + +msgid "Content$Black & White" +msgstr "" + +msgid "Content$Unpublished" +msgstr "" + +msgid "Content$Live Broadcast" +msgstr "" + +msgid "Content$Special Characteristics" +msgstr "" + +msgid "Content$Drama" +msgstr "" + msgid "Infosat channellist available" msgstr "Infosat Kanalliste verfügbar" @@ -86,4 +335,3 @@ msgstr "Erstelle neue Ereignisse" msgid "Read EPG info from infosat" msgstr "Liest EPG infos von Infosat" - diff --git a/po/it_IT.po b/po/it_IT.po index a6f131e..84282ca 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-1.6.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2009-02-01 12:25+0100\n" +"POT-Creation-Date: 2009-02-08 00:59+0100\n" "PO-Revision-Date: 2008-12-24 19:16+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -20,6 +20,255 @@ msgstr "" msgid "Infosat plugin still working" msgstr "Il plugin Infosat è ancora in funzione" +msgid "Content$Movie/Drama" +msgstr "" + +msgid "Content$News/Current Affairs" +msgstr "" + +msgid "Content$Show/Game Show" +msgstr "" + +msgid "Content$Sports" +msgstr "" + +msgid "Content$Children's/Youth Programmes" +msgstr "" + +msgid "Content$Music/Ballet/Dance" +msgstr "" + +msgid "Content$Arts/Culture" +msgstr "" + +msgid "Content$Social/Political/Economics" +msgstr "" + +msgid "Content$Education/Science/Factual" +msgstr "" + +msgid "Content$Leisure/Hobbies" +msgstr "" + +msgid "Content$Special" +msgstr "" + +msgid "Content$Userdefined" +msgstr "" + +msgid "Content$Detective/Thriller" +msgstr "" + +msgid "Content$Adventure/Western/War" +msgstr "" + +msgid "Content$Science Fiction/Fantasy/Horror" +msgstr "" + +msgid "Content$Comedy" +msgstr "" + +msgid "Content$Soap/Melodrama/Folkloric" +msgstr "" + +msgid "Content$Romance" +msgstr "" + +msgid "Content$Serious/Classical/Religious/Historical Movie/Drama" +msgstr "" + +msgid "Content$Adult Movie/Drama" +msgstr "" + +msgid "Content$News/Weather Report" +msgstr "" + +msgid "Content$News Magazine" +msgstr "" + +msgid "Content$Documentary" +msgstr "" + +msgid "Content$Discussion/Inverview/Debate" +msgstr "" + +msgid "Content$Game Show/Quiz/Contest" +msgstr "" + +msgid "Content$Variety Show" +msgstr "" + +msgid "Content$Talk Show" +msgstr "" + +msgid "Content$Special Event" +msgstr "" + +msgid "Content$Sport Magazine" +msgstr "" + +msgid "Content$Football" +msgstr "" + +msgid "Content$Tennis/Squash" +msgstr "" + +msgid "Content$Team Sports" +msgstr "" + +msgid "Content$Athletics" +msgstr "" + +msgid "Content$Motor Sport" +msgstr "" + +msgid "Content$Water Sport" +msgstr "" + +msgid "Content$Winter Sports" +msgstr "" + +msgid "Content$Equestrian" +msgstr "" + +msgid "Content$Martial Sports" +msgstr "" + +msgid "Content$Pre-school Children's Programmes" +msgstr "" + +msgid "Content$Entertainment Programmes for 6 to 14" +msgstr "" + +msgid "Content$Entertainment Programmes for 10 to 16" +msgstr "" + +msgid "Content$Informational/Educational/School Programme" +msgstr "" + +msgid "Content$Cartoons/Puppets" +msgstr "" + +msgid "Content$Rock/Pop" +msgstr "" + +msgid "Content$Serious/Classical Music" +msgstr "" + +msgid "Content$Folk/Tradional Music" +msgstr "" + +msgid "Content$Jazz" +msgstr "" + +msgid "Content$Musical/Opera" +msgstr "" + +msgid "Content$Ballet" +msgstr "" + +msgid "Content$Performing Arts" +msgstr "" + +msgid "Content$Fine Arts" +msgstr "" + +msgid "Content$Religion" +msgstr "" + +msgid "Content$Popular Culture/Traditional Arts" +msgstr "" + +msgid "Content$Literature" +msgstr "" + +msgid "Content$Film/Cinema" +msgstr "" + +msgid "Content$Experimental Film/Video" +msgstr "" + +msgid "Content$Broadcasting/Press" +msgstr "" + +msgid "Content$New Media" +msgstr "" + +msgid "Content$Arts/Culture Magazines" +msgstr "" + +msgid "Content$Fashion" +msgstr "" + +msgid "Content$Magazines/Reports/Documentary" +msgstr "" + +msgid "Content$Economics/Social Advisory" +msgstr "" + +msgid "Content$Remarkable People" +msgstr "" + +msgid "Content$Nature/Animals/Environment" +msgstr "" + +msgid "Content$Technology/Natural Sciences" +msgstr "" + +msgid "Content$Medicine/Physiology/Psychology" +msgstr "" + +msgid "Content$Foreign Countries/Expeditions" +msgstr "" + +msgid "Content$Social/Spiritual Sciences" +msgstr "" + +msgid "Content$Further Education" +msgstr "" + +msgid "Content$Languages" +msgstr "" + +msgid "Content$Tourism/Travel" +msgstr "" + +msgid "Content$Handicraft" +msgstr "" + +msgid "Content$Motoring" +msgstr "" + +msgid "Content$Fitness & Health" +msgstr "" + +msgid "Content$Cooking" +msgstr "" + +msgid "Content$Advertisement/Shopping" +msgstr "" + +msgid "Content$Gardening" +msgstr "" + +msgid "Content$Original Language" +msgstr "" + +msgid "Content$Black & White" +msgstr "" + +msgid "Content$Unpublished" +msgstr "" + +msgid "Content$Live Broadcast" +msgstr "" + +msgid "Content$Special Characteristics" +msgstr "" + +msgid "Content$Drama" +msgstr "" + msgid "Infosat channellist available" msgstr "Lista canale Infosat disponibile" @@ -88,4 +337,3 @@ msgstr "" msgid "Read EPG info from infosat" msgstr "Legge info EPG da Infosat" - diff --git a/process.cpp b/process.cpp index 8d9d6b3..6a7e47d 100644 --- a/process.cpp +++ b/process.cpp @@ -34,18 +34,21 @@ char *strcatrealloc(char *dest, const char *src) // --- cInfosatevent cInfosatevent::cInfosatevent() { - title = NULL; - shortText = NULL; - description = NULL; + title=NULL; + shorttext=NULL; + description=NULL; announcement=NULL; country=NULL; genre=NULL; original=NULL; extepg=NULL; episode=NULL; + category=NULL; + addition=NULL; + rating=NULL; year=-1; fsk=-1; - category=-1; + content=0; startTime = 0; duration = 0; } @@ -53,14 +56,17 @@ cInfosatevent::cInfosatevent() cInfosatevent::~cInfosatevent() { free(title); - free(shortText); + free(shorttext); free(description); free(announcement); free(country); + free(category); free(genre); free(original); free(extepg); free(episode); + free(addition); + free(rating); } void cInfosatevent::SetOriginal(const char *Original) @@ -75,6 +81,12 @@ void cInfosatevent::SetGenre(const char *Genre) genre = compactspace(genre); } +void cInfosatevent::SetCategory(const char *Category) +{ + category = strcpyrealloc(category, Category); + category = compactspace(category); +} + void cInfosatevent::SetCountry(const char *Country) { country = strcpyrealloc(country, Country); @@ -87,6 +99,18 @@ void cInfosatevent::SetAnnouncement(const char *Announcement) announcement = compactspace(announcement); } +void cInfosatevent::SetAddition(const char *Addition) +{ + addition = strcpyrealloc(addition, Addition); + addition = compactspace(addition); +} + +void cInfosatevent::SetRating(const char *Rating) +{ + rating = strcpyrealloc(rating, Rating); + rating = compactspace(rating); +} + void cInfosatevent::SetTitle(const char *Title) { title = strcpyrealloc(title, Title); @@ -101,29 +125,398 @@ void cInfosatevent::SetEpisode(const char *Episode) void cInfosatevent::SetShortText(const char *ShortText) { - if (!ShortText) return; + shorttext=strcpyrealloc(shorttext,ShortText); + shorttext=compactspace(shorttext); +} - char *tmpText=strcpyrealloc(shortText,ShortText); - if (!tmpText) return; - tmpText=compactspace(tmpText); +void cInfosatevent::SetDescription(const char *Description) +{ + description = strcpyrealloc(description, Description); + description = compactspace(description); +} - if (title) +void cInfosatevent::SetCategoryByID(int i) +{ + i>>=4; + switch (i & 0xF0) { - if (!strcmp(title,tmpText)) - { - free(tmpText); - return; // ShortText same as title -> ignore - } + case EVCONTENTMASK_MOVIEDRAMA: + SetCategory(tr("Content$Movie/Drama")); + break; + case EVCONTENTMASK_NEWSCURRENTAFFAIRS: + SetCategory(tr("Content$News/Current Affairs")); + break; + case EVCONTENTMASK_SHOW: + SetCategory(tr("Content$Show/Game Show")); + break; + case EVCONTENTMASK_SPORTS: + SetCategory(tr("Content$Sports")); + break; + case EVCONTENTMASK_CHILDRENYOUTH: + SetCategory(tr("Content$Children's/Youth Programmes")); + break; + case EVCONTENTMASK_MUSICBALLETDANCE: + SetCategory(tr("Content$Music/Ballet/Dance")); + break; + case EVCONTENTMASK_ARTSCULTURE: + SetCategory(tr("Content$Arts/Culture")); + break; + case EVCONTENTMASK_SOCIALPOLITICALECONOMICS: + SetCategory(tr("Content$Social/Political/Economics")); + break; + case EVCONTENTMASK_EDUCATIONALSCIENCE: + SetCategory(tr("Content$Education/Science/Factual")); + break; + case EVCONTENTMASK_LEISUREHOBBIES: + SetCategory(tr("Content$Leisure/Hobbies")); + break; + case EVCONTENTMASK_SPECIAL: + SetCategory(tr("Content$Special")); + break; + case EVCONTENTMASK_USERDEFINED: + SetCategory(tr("Content$Userdefined")); + break; } - shortText = tmpText; } -void cInfosatevent::SetDescription(const char *Description) +void cInfosatevent::SetGenreByID(int i) { - description = strcpyrealloc(description, Description); - description = compactspace(description); + i >>= 4; + switch (i & 0xF0) + { + case EVCONTENTMASK_MOVIEDRAMA: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Movie/Drama")); + break; + case 0x01: + SetGenre(tr("Content$Detective/Thriller")); + break; + case 0x02: + SetGenre(tr("Content$Adventure/Western/War")); + break; + case 0x03: + SetGenre(tr("Content$Science Fiction/Fantasy/Horror")); + break; + case 0x04: + SetGenre(tr("Content$Comedy")); + break; + case 0x05: + SetGenre(tr("Content$Soap/Melodrama/Folkloric")); + break; + case 0x06: + SetGenre(tr("Content$Romance")); + break; + case 0x07: + SetGenre(tr("Content$Serious/Classical/Religious/Historical Movie/Drama")); + break; + case 0x08: + SetGenre(tr("Content$Adult Movie/Drama")); + break; + } + break; + + case EVCONTENTMASK_NEWSCURRENTAFFAIRS: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$News/Current Affairs")); + break; + case 0x01: + SetGenre(tr("Content$News/Weather Report")); + break; + case 0x02: + SetGenre(tr("Content$News Magazine")); + break; + case 0x03: + SetGenre(tr("Content$Documentary")); + break; + case 0x04: + SetGenre(tr("Content$Discussion/Inverview/Debate")); + break; + } + break; + + case EVCONTENTMASK_SHOW: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Show/Game Show")); + break; + case 0x01: + SetGenre(tr("Content$Game Show/Quiz/Contest")); + break; + case 0x02: + SetGenre(tr("Content$Variety Show")); + break; + case 0x03: + SetGenre(tr("Content$Talk Show")); + break; + } + break; + + case EVCONTENTMASK_SPORTS: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Sports")); + break; + case 0x01: + SetGenre(tr("Content$Special Event")); + break; + case 0x02: + SetGenre(tr("Content$Sport Magazine")); + break; + case 0x03: + SetGenre(tr("Content$Football")); + break; + case 0x04: + SetGenre(tr("Content$Tennis/Squash")); + break; + case 0x05: + SetGenre(tr("Content$Team Sports")); + break; + case 0x06: + SetGenre(tr("Content$Athletics")); + break; + case 0x07: + SetGenre(tr("Content$Motor Sport")); + break; + case 0x08: + SetGenre(tr("Content$Water Sport")); + break; + case 0x09: + SetGenre(tr("Content$Winter Sports")); + break; + case 0x0A: + SetGenre(tr("Content$Equestrian")); + break; + case 0x0B: + SetGenre(tr("Content$Martial Sports")); + break; + } + break; + + case EVCONTENTMASK_CHILDRENYOUTH: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Children's/Youth Programmes")); + break; + case 0x01: + SetGenre(tr("Content$Pre-school Children's Programmes")); + break; + case 0x02: + SetGenre(tr("Content$Entertainment Programmes for 6 to 14")); + break; + case 0x03: + SetGenre(tr("Content$Entertainment Programmes for 10 to 16")); + break; + case 0x04: + SetGenre(tr("Content$Informational/Educational/School Programme")); + break; + case 0x05: + SetGenre(tr("Content$Cartoons/Puppets")); + break; + } + break; + + case EVCONTENTMASK_MUSICBALLETDANCE: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Music/Ballet/Dance")); + break; + case 0x01: + SetGenre(tr("Content$Rock/Pop")); + break; + case 0x02: + SetGenre(tr("Content$Serious/Classical Music")); + break; + case 0x03: + SetGenre(tr("Content$Folk/Tradional Music")); + break; + case 0x04: + SetGenre(tr("Content$Jazz")); + break; + case 0x05: + SetGenre(tr("Content$Musical/Opera")); + break; + case 0x06: + SetGenre(tr("Content$Ballet")); + break; + } + break; + + case EVCONTENTMASK_ARTSCULTURE: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Arts/Culture")); + break; + case 0x01: + SetGenre(tr("Content$Performing Arts")); + break; + case 0x02: + SetGenre(tr("Content$Fine Arts")); + break; + case 0x03: + SetGenre(tr("Content$Religion")); + break; + case 0x04: + SetGenre(tr("Content$Popular Culture/Traditional Arts")); + break; + case 0x05: + SetGenre(tr("Content$Literature")); + break; + case 0x06: + SetGenre(tr("Content$Film/Cinema")); + break; + case 0x07: + SetGenre(tr("Content$Experimental Film/Video")); + break; + case 0x08: + SetGenre(tr("Content$Broadcasting/Press")); + break; + case 0x09: + SetGenre(tr("Content$New Media")); + break; + case 0x0A: + SetGenre(tr("Content$Arts/Culture Magazines")); + break; + case 0x0B: + SetGenre(tr("Content$Fashion")); + break; + } + break; + + case EVCONTENTMASK_SOCIALPOLITICALECONOMICS: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Social/Political/Economics")); + break; + case 0x01: + SetGenre(tr("Content$Magazines/Reports/Documentary")); + break; + case 0x02: + SetGenre(tr("Content$Economics/Social Advisory")); + break; + case 0x03: + SetGenre(tr("Content$Remarkable People")); + break; + } + break; + + case EVCONTENTMASK_EDUCATIONALSCIENCE: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Education/Science/Factual")); + break; + case 0x01: + SetGenre(tr("Content$Nature/Animals/Environment")); + break; + case 0x02: + SetGenre(tr("Content$Technology/Natural Sciences")); + break; + case 0x03: + SetGenre(tr("Content$Medicine/Physiology/Psychology")); + break; + case 0x04: + SetGenre(tr("Content$Foreign Countries/Expeditions")); + break; + case 0x05: + SetGenre(tr("Content$Social/Spiritual Sciences")); + break; + case 0x06: + SetGenre(tr("Content$Further Education")); + break; + case 0x07: + SetGenre(tr("Content$Languages")); + break; + } + break; + + case EVCONTENTMASK_LEISUREHOBBIES: + switch (i & 0x0F) + { + default: + case 0x00: + SetGenre(tr("Content$Leisure/Hobbies")); + break; + case 0x01: + SetGenre(tr("Content$Tourism/Travel")); + break; + case 0x02: + SetGenre(tr("Content$Handicraft")); + break; + case 0x03: + SetGenre(tr("Content$Motoring")); + break; + case 0x04: + SetGenre(tr("Content$Fitness & Health")); + break; + case 0x05: + SetGenre(tr("Content$Cooking")); + break; + case 0x06: + SetGenre(tr("Content$Advertisement/Shopping")); + break; + case 0x07: + SetGenre(tr("Content$Gardening")); + break; + } + break; + + case EVCONTENTMASK_SPECIAL: + switch (i & 0x0F) + { + case 0x00: + SetGenre(tr("Content$Original Language")); + break; + case 0x01: + SetGenre(tr("Content$Black & White")); + break; + case 0x02: + SetGenre(tr("Content$Unpublished")); + break; + case 0x03: + SetGenre(tr("Content$Live Broadcast")); + break; + default: + SetGenre(tr("Content$Special Characteristics")); + break; + } + break; + + case EVCONTENTMASK_USERDEFINED: + switch (i & 0x0F) + { + case 0x00: + SetGenre(tr("Content$Drama")); // UK Freeview + break; + default: + break; + } + break; + + default: + break; + } } + const char *cInfosatevent::ExtEPG(void) { // Returns Category:, Genre:, Year:, Country:, Originaltitle:, FSK: , Rating: [if available] ... @@ -135,12 +528,19 @@ const char *cInfosatevent::ExtEPG(void) extepg=NULL; } - extepg=strcatrealloc(extepg,"\n\n"); + extepg=strcatrealloc(extepg,"\n"); - if (category!=-1) + if (content) { - sprintf(fmt,"Category: %i\n",category); - extepg=strcatrealloc(extepg,fmt); + SetCategoryByID(content); + SetGenreByID(content); + } + + if (category) + { + extepg=strcatrealloc(extepg,"Category: "); + extepg=strcatrealloc(extepg,category); + extepg=strcatrealloc(extepg,"\n"); } if (genre) { @@ -176,13 +576,37 @@ const char *cInfosatevent::ExtEPG(void) extepg=strcatrealloc(extepg,episode); extepg=strcatrealloc(extepg,"\n"); } - if (announcement) + if (rating) { extepg=strcatrealloc(extepg,"Rating: "); + extepg=strcatrealloc(extepg,rating); + extepg=strcatrealloc(extepg,"\n"); + } + + + if (announcement) + { + extepg=strcatrealloc(extepg,"Announcement: "); extepg=strcatrealloc(extepg,announcement); extepg=strcatrealloc(extepg,"\n"); } + if (addition) + { + extepg=strcatrealloc(extepg,"Addition: "); + extepg=strcatrealloc(extepg,addition); + extepg=strcatrealloc(extepg,"\n"); + } + int len=strlen(extepg); + if (len<=1) + { + free(extepg); + extepg=NULL; + } + else + { + extepg[len-1]=0; // cut of last linefeed + } return (const char*) extepg; } @@ -296,6 +720,25 @@ bool cProcessInfosatepg::AddInfosatEvent(cChannel *channel, cInfosatevent *iEven if ((iEvent->Usage() & USE_SHORTTEXT) == USE_SHORTTEXT) { + if (!iEvent->ShortText()) + { + // no short text + if (iEvent->Original()) + { + // use original if it exists + iEvent->SetShortText(iEvent->Original()); + } + } + + // if shorttext is the same as the title -> skip short text + // this skips additional bug reporting in epg.c + if (Event->ShortText() && Event->Title()) + { + if (!strcmp(iEvent->ShortText(),iEvent->Title())) + { + iEvent->SetShortText(NULL); + } + } Event->SetShortText(iEvent->ShortText()); } @@ -384,10 +827,67 @@ cChannel *cProcessInfosatepg::GetVDRChannel(int frequency, int sid) return NULL; } -bool cProcessInfosatepg::CheckOriginal(char *s,cInfosatevent *iEvent,cCharSetConv *conv) +bool cProcessInfosatepg::CheckOriginal_and_Episode(char **s,cInfosatevent *iEvent,cCharSetConv *conv) { + if (!strcmp(*s,"Blockbuster")) + { + iEvent->SetRating("Tipp"); + (*s)+=11; + return false; + } + + if (!strcmp(*s,"LIVE")) + { + iEvent->SetAnnouncement("LIVE"); + (*s)+=4; + return false; + } + + if (!strcmp(*s,"SAT.1-REIHE")) + { + // just ignore + (*s)+=11; + return false; + } + if (!strcmp(*s,"NIGHT ACTION")) + { + iEvent->SetAnnouncement("Action"); + (*s)+=12; + return false; + } + if (!strcmp(*s,"FILME DER FILMEMACHER")) + { + iEvent->SetAnnouncement("Filme der Filmemacher"); + (*s)+=21; + return false; + } + if (!strcmp(*s,"DIE BESTEN FILME ALLER ZEITEN")) + { + iEvent->SetRating("Tipp"); + (*s)+=29; + return false; + } + + if (!strncmp(*s,"Folge ",6)) + { + (*s)+=6; + char *episode=*s; + // ok, overread Numbers and / + while (isdigit(**s) | **s=='/') (*s)++; + if (**s==0) + { + iEvent->SetEpisode(episode); + return false; + } + (**s)=0; + iEvent->SetEpisode(episode); + (*s)++; // advance to subtitle + if (**s=='-') (*s)++; // overread hyphen, if it exists + while (**s==' ') (*s)++; // overread spaces + } + char *pOT,*pEOT; - pOT=strchr(s,'('); + pOT=strchr(*s,'('); if (!pOT) return false; pEOT=strrchr(pOT,')'); if (!pEOT) return false; @@ -438,20 +938,24 @@ bool cProcessInfosatepg::CheckAnnouncement(char *s,cInfosatevent *iEvent) } else if ((strlen(s)>=9) && (!strncmp(s,"Highlight",9))) { - iEvent->SetAnnouncement("Tipp"); + iEvent->SetRating("Tipp"); } else if ((strlen(s)>=9) && (!strncmp(s,"TAGESTIPP",9))) { - iEvent->SetAnnouncement("Tipp"); + iEvent->SetRating("Tipp"); } else if ((strlen(s)>=10) && (!strncmp(s,"Tagestipp!",10))) { - iEvent->SetAnnouncement("Tipp"); + iEvent->SetRating("Tipp"); } else if ((strlen(s)>=15) && (!strncmp(s,"CARTOON NETWORK",15))) { // just ignore this } + else if ((strlen(s)>=11) && (!strncmp(s,"SAT.1-SERIE",11))) + { + // just ignore this + } else ret=false; return ret; } @@ -483,12 +987,12 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) { if (ievent) { - int category,fsk; - fields=sscanf(s,"%d %d",&category,&fsk); - if (fields==1) ievent->SetCategory(category); + int content_descr,fsk; + fields=sscanf(s,"%x %d",&content_descr,&fsk); + if (fields==1) ievent->SetContentDescriptor(content_descr); if (fields==2) { - ievent->SetCategory(category); + ievent->SetContentDescriptor(content_descr); ievent->SetFSK(fsk); } } @@ -605,11 +1109,7 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) if (p8A) { *p8A=0; - // check for special announcements: - // Erstausstrahlung - // Deutschland-Premiere - // Free-TV-Premiere - // Highlight + // check for special announcements pSA=strrchr(s,','); if (pSA) { @@ -618,14 +1118,14 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) // announcement was added to short description *pSA=0; } - CheckOriginal(s,ievent,conv); + CheckOriginal_and_Episode(&s,ievent,conv); ievent->SetShortText(conv->Convert(s)); } else { if (!CheckAnnouncement(s,ievent)) { - CheckOriginal(s,ievent,conv); + CheckOriginal_and_Episode(&s,ievent,conv); ievent->SetShortText(conv->Convert(s)); } } @@ -636,7 +1136,7 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) if (pDU) { *pDU=0; - // with genre + // with additional info if (CheckAnnouncement(s,ievent)) { char *tp8A; @@ -665,7 +1165,7 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) pSP++; // country and year (check!!) int year = atoi(pSP); - if (year!=0) ievent->SetYear(year); + if (year>1900) ievent->SetYear(year); ievent->SetCountry(conv->Convert(pCY)); } else @@ -675,7 +1175,15 @@ bool cProcessInfosatepg::ParseInfosatepg(FILE *f,int *firststarttime) } } } - ievent->SetGenre(conv->Convert(s)); + year=atoi(s); + if (year>1900) + { + ievent->SetYear(year); + } + else + { + ievent->SetAddition(conv->Convert(s)); + } s=++pDU; } int len; @@ -14,23 +14,39 @@ // --- cInfosatevent class cInfosatevent { +#define EVCONTENTMASK_MOVIEDRAMA 0x10 +#define EVCONTENTMASK_NEWSCURRENTAFFAIRS 0x20 +#define EVCONTENTMASK_SHOW 0x30 +#define EVCONTENTMASK_SPORTS 0x40 +#define EVCONTENTMASK_CHILDRENYOUTH 0x50 +#define EVCONTENTMASK_MUSICBALLETDANCE 0x60 +#define EVCONTENTMASK_ARTSCULTURE 0x70 +#define EVCONTENTMASK_SOCIALPOLITICALECONOMICS 0x80 +#define EVCONTENTMASK_EDUCATIONALSCIENCE 0x90 +#define EVCONTENTMASK_LEISUREHOBBIES 0xA0 +#define EVCONTENTMASK_SPECIAL 0xB0 +#define EVCONTENTMASK_USERDEFINED 0xF0 + private: int duration; time_t startTime; char *title; - char *shortText; + char *shorttext; char *description; char *announcement; char *country; char *genre; char *original; char *episode; - int category; + char *category; + char *extepg; + char *addition; + char *rating; + int content; int fsk; int year; int usage; int days; - char *extepg; tEventID eventID; public: cInfosatevent(); @@ -44,25 +60,33 @@ public: void SetEventDays(int Days) { days=Days; } void SetYear(int Year) { year=Year; } void SetEventID(tEventID EventID) { eventID=EventID; } - void SetCategory(int Category) { category=Category; } + void SetContentDescriptor(int Content) { content=Content; } void SetFSK(int FSK) { fsk=FSK; } + void SetRating(const char *Rating); void SetAnnouncement(const char *Announcement); void SetCountry(const char *Country); + void SetCategory(const char *Category); + void SetCategoryByID(int i); void SetGenre(const char *Genre); + void SetGenreByID(int i); void SetOriginal(const char *Original); void SetEpisode(const char *Episode); + void SetAddition(const char *Addition); const char *Description(void) const { return description; } const char *Title(void) const { return title; } - const char *ShortText(void) const { return shortText; } + const char *ShortText(void) const { return shorttext; } const char *Announcement(void) const { return announcement; } + const char *Category(void) const { return category; } const char *Genre(void) const { return genre; } const char *Country(void) const { return country; } const char *Original(void) const { return original; } const char *Episode(void) const { return episode; } + const char *Addition(void) const { return addition; } + const char *Rating(void) const { return rating; } + int Content(void) const { return content; } int Year(void) const { return year; } int Duration(void) const { return duration; } int FSK(void) const { return fsk; } - int Category(void) const { return category; } time_t StartTime(void) const { return startTime; } int Usage() { return usage; } int Days() { return days; } @@ -76,7 +100,7 @@ class cProcessInfosatepg //: public cThread private: cGlobalInfosatepg *global; bool AddInfosatEvent(cChannel *channel, cInfosatevent *iEvent); - bool CheckOriginal(char *s,cInfosatevent *iEvent,cCharSetConv *conv); + bool CheckOriginal_and_Episode(char **s,cInfosatevent *iEvent,cCharSetConv *conv); bool CheckAnnouncement(char *s,cInfosatevent *iEvent); bool ParseInfosatepg(FILE *f,int *firststarttime); cChannel *GetVDRChannel(int frequency, int sid); |