From bcd0b697d5953b286878542fb4c33238d65c6cb2 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Fri, 18 May 2012 09:19:32 +0200 Subject: eepghandler for new vdr eit api --- epghandler.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 epghandler.c (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c new file mode 100644 index 0000000..51074ad --- /dev/null +++ b/epghandler.c @@ -0,0 +1,86 @@ +/* + * cEEpgHandler.c + * + * Created on: 11.3.2012 + * Author: d.petrovski + */ + +#include "epghandler.h" + +cEEpgHandler::cEEpgHandler() { + // TODO Auto-generated constructor stub + +} + +cEEpgHandler::~cEEpgHandler() { + // TODO Auto-generated destructor stub +} + +bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule, + const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) { + return true; +} + +bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { + Event->SetEventID(EventID); + return true; +} + +bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { + if (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title))) + Event->SetTitle(Title); + return true; +} + +bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { + if (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText))) + Event->SetShortText(ShortText); + return true; +} + +bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { + if (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description))) + Event->SetDescription(Description); + return true; +} + +bool cEEpgHandler::SetContents(cEvent* Event, uchar* Contents) { + Event->SetContents(Contents); + return true; +} + +bool cEEpgHandler::SetParentalRating(cEvent* Event, int ParentalRating) { + Event->SetParentalRating(ParentalRating); + return true; +} + +bool cEEpgHandler::SetStartTime(cEvent* Event, time_t StartTime) { + Event->SetStartTime(StartTime); + return true; +} + +bool cEEpgHandler::SetDuration(cEvent* Event, int Duration) { + Event->SetDuration(Duration); + return true; +} + +bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { + Event->SetVps(Vps); + return true; +} + +bool cEEpgHandler::HandleEvent(cEvent* Event) { + return true; +} + +bool cEEpgHandler::SortSchedule(cSchedule* Schedule) { + Schedule->Sort(); + return true; +} + +bool cEEpgHandler::DropOutdated(cSchedule* Schedule, time_t SegmentStart, + time_t SegmentEnd, uchar TableID, uchar Version) { + return false; +} + + -- cgit v1.2.3 From 46f6510bb78a19f862bd3c1ffff6ac322ca6d6b4 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Tue, 8 May 2012 18:27:16 +0200 Subject: modified logging and added logging to epghandler.c --- epghandler.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index 51074ad..abc4c38 100644 --- a/epghandler.c +++ b/epghandler.c @@ -6,6 +6,7 @@ */ #include "epghandler.h" +#include "log.h" cEEpgHandler::cEEpgHandler() { // TODO Auto-generated constructor stub @@ -27,13 +28,17 @@ bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { } bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { + LogD(1, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); + if (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title))) Event->SetTitle(Title); return true; } bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { - if (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText))) + LogD(1, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); + + if (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText))) Event->SetShortText(ShortText); return true; } -- cgit v1.2.3 From 5bbab08c9ff074509d2c7efe1d17e5b5254c7f9f Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Wed, 9 May 2012 14:51:23 +0200 Subject: more debug logging --- epghandler.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index abc4c38..b9057c1 100644 --- a/epghandler.c +++ b/epghandler.c @@ -10,6 +10,7 @@ cEEpgHandler::cEEpgHandler() { // TODO Auto-generated constructor stub + LogD(1, prep("cEEpgHandler()")); } @@ -19,6 +20,7 @@ cEEpgHandler::~cEEpgHandler() { bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule, const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) { + LogD(1, prep("HandleEitEvent")); return true; } @@ -75,6 +77,7 @@ bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { } bool cEEpgHandler::HandleEvent(cEvent* Event) { + LogD(1, prep("HandleEvent")); return true; } -- cgit v1.2.3 From 3b57ef95c261d53f21fb7db1a283cca1aca64f0f Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Wed, 9 May 2012 16:54:35 +0200 Subject: change conditions --- epghandler.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index b9057c1..68f68d5 100644 --- a/epghandler.c +++ b/epghandler.c @@ -20,8 +20,9 @@ cEEpgHandler::~cEEpgHandler() { bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule, const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) { - LogD(1, prep("HandleEitEvent")); - return true; + //LogD(1, prep("HandleEitEvent")); + return false; +// return true; } bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { @@ -32,23 +33,25 @@ bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { LogD(1, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); - if (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title))) - Event->SetTitle(Title); - return true; + if (!Event->Title() || Title && (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title)))) + Event->SetTitle(Title); + return true; } bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { LogD(1, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); - if (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText))) - Event->SetShortText(ShortText); - return true; + if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) + Event->SetShortText(ShortText); + return true; } bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { - if (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description))) - Event->SetDescription(Description); - return true; + LogD(1, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); + + if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) + Event->SetDescription(Description); + return true; } bool cEEpgHandler::SetContents(cEvent* Event, uchar* Contents) { @@ -77,7 +80,7 @@ bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { } bool cEEpgHandler::HandleEvent(cEvent* Event) { - LogD(1, prep("HandleEvent")); + //LogD(1, prep("HandleEvent")); return true; } -- cgit v1.2.3 From 68eb397f7d419c4caf58220b62de22ac3244d682 Mon Sep 17 00:00:00 2001 From: Dime Date: Sun, 13 May 2012 13:31:03 +0200 Subject: use the original eepg Short Text and Description if missing in EIT --- epghandler.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index 68f68d5..5bed74f 100644 --- a/epghandler.c +++ b/epghandler.c @@ -41,15 +41,25 @@ bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { LogD(1, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); - if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) + if (Event->ShortText() && !strcmp(Event->ShortText(),"")) + origShortText = Event->ShortText(); + else + origShortText.clear(); + + //if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) Event->SetShortText(ShortText); return true; } bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { LogD(1, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); + + if (Event->Description() && !strcmp(Event->Description(),"")) + origDescription = Event->Description(); + else + origDescription.clear(); - if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) + //if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) Event->SetDescription(Description); return true; } @@ -81,6 +91,18 @@ bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { bool cEEpgHandler::HandleEvent(cEvent* Event) { //LogD(1, prep("HandleEvent")); + + //After FixEpgBugs of cEvent set the original Short Text if empty + if (!Event->ShortText() && !strcmp(Event->ShortText(),"")) + Event->SetShortText(origShortText.c_str()); + + //TODO just to see the difference + if (!origDescription.empty() && !origDescription.compare(Event->Description())) { + origDescription.append(" | EIT: "); + origDescription.append(Event->Description()); + Event->SetDescription(origDescription.c_str()); + } + return true; } -- cgit v1.2.3 From 23260abbe50c8315663b4f63fdaed38c26372a29 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Sun, 13 May 2012 18:20:18 +0200 Subject: corected epghandler --- epghandler.c | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index 5bed74f..2c25268 100644 --- a/epghandler.c +++ b/epghandler.c @@ -10,7 +10,7 @@ cEEpgHandler::cEEpgHandler() { // TODO Auto-generated constructor stub - LogD(1, prep("cEEpgHandler()")); + LogD(4, prep("cEEpgHandler()")); } @@ -31,7 +31,7 @@ bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { } bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { - LogD(1, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); + LogD(3, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); if (!Event->Title() || Title && (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title)))) Event->SetTitle(Title); @@ -39,12 +39,14 @@ bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { } bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { - LogD(1, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); + LogD(3, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); - if (Event->ShortText() && !strcmp(Event->ShortText(),"")) - origShortText = Event->ShortText(); - else + if (Event->ShortText() && strcmp(Event->ShortText(),"") != 0) { + origShortText = std::string(Event->ShortText()); + } + else { origShortText.clear(); + } //if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) Event->SetShortText(ShortText); @@ -52,9 +54,9 @@ bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { } bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { - LogD(1, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); + LogD(3, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); - if (Event->Description() && !strcmp(Event->Description(),"")) + if (Event->Description() && strcmp(Event->Description(),"") != 0) origDescription = Event->Description(); else origDescription.clear(); @@ -90,18 +92,22 @@ bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { } bool cEEpgHandler::HandleEvent(cEvent* Event) { - //LogD(1, prep("HandleEvent")); - - //After FixEpgBugs of cEvent set the original Short Text if empty - if (!Event->ShortText() && !strcmp(Event->ShortText(),"")) - Event->SetShortText(origShortText.c_str()); - - //TODO just to see the difference - if (!origDescription.empty() && !origDescription.compare(Event->Description())) { - origDescription.append(" | EIT: "); - origDescription.append(Event->Description()); - Event->SetDescription(origDescription.c_str()); - } + + LogD(3, prep("HandleEvent st:%s ost:%s desc:%s odesc:%s"),Event->ShortText(),origShortText.c_str(),Event->Description(),origDescription.c_str()); + + //After FixEpgBugs of cEvent set the original Short Text if empty + if (!Event->ShortText() || !strcmp(Event->ShortText(),"")) + Event->SetShortText(origShortText.c_str()); + + if (!Event->Description() && !origDescription.empty()) { + Event->SetDescription(origDescription.c_str()); + } + //TODO just to see the difference + //else if (!origDescription.empty() && !origDescription.compare(Event->Description())) { +// origDescription.append(" | EIT: "); +// origDescription.append(Event->Description()); +// Event->SetDescription(origDescription.c_str()); + // } return true; } -- cgit v1.2.3 From aa7d6a705d56f11c327ebe4c09a8a0a0f517e8fd Mon Sep 17 00:00:00 2001 From: Dime Date: Wed, 16 May 2012 13:24:24 +0200 Subject: add defines to compile wit VDR < 1.7.26 --- epghandler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index 2c25268..36aaf74 100644 --- a/epghandler.c +++ b/epghandler.c @@ -5,6 +5,7 @@ * Author: d.petrovski */ +#if APIVERSNUM > 10725 #include "epghandler.h" #include "log.h" @@ -122,4 +123,4 @@ bool cEEpgHandler::DropOutdated(cSchedule* Schedule, time_t SegmentStart, return false; } - +#endif -- cgit v1.2.3 From 4ce3841972c23d31a1dfb64f068ceeb6e8d35cd9 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Thu, 17 May 2012 14:15:55 +0200 Subject: removed EIT filter for NA since it should be done by epg-handler modified indentation --- epghandler.c | 132 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'epghandler.c') diff --git a/epghandler.c b/epghandler.c index 36aaf74..29f092b 100644 --- a/epghandler.c +++ b/epghandler.c @@ -5,122 +5,122 @@ * Author: d.petrovski */ -#if APIVERSNUM > 10725 #include "epghandler.h" +#if APIVERSNUM > 10725 #include "log.h" cEEpgHandler::cEEpgHandler() { - // TODO Auto-generated constructor stub - LogD(4, prep("cEEpgHandler()")); + // TODO Auto-generated constructor stub + LogD(4, prep("cEEpgHandler()")); } cEEpgHandler::~cEEpgHandler() { - // TODO Auto-generated destructor stub + // TODO Auto-generated destructor stub } bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule, - const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) { - //LogD(1, prep("HandleEitEvent")); - return false; -// return true; + const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) { + //LogD(1, prep("HandleEitEvent")); + return false; + // return true; } bool cEEpgHandler::SetEventID(cEvent* Event, tEventID EventID) { - Event->SetEventID(EventID); - return true; + Event->SetEventID(EventID); + return true; } bool cEEpgHandler::SetTitle(cEvent* Event, const char* Title) { - LogD(3, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); + LogD(3, prep("Event id:%d title:%s new title:%s"), Event->EventID(), Event->Title(), Title); - if (!Event->Title() || Title && (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title)))) - Event->SetTitle(Title); - return true; + if (!Event->Title() || Title && (!strcmp(Event->Title(),"") || (strcmp(Title,"") && strcmp(Event->Title(),Title)))) + Event->SetTitle(Title); + return true; } bool cEEpgHandler::SetShortText(cEvent* Event, const char* ShortText) { - LogD(3, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); - - if (Event->ShortText() && strcmp(Event->ShortText(),"") != 0) { - origShortText = std::string(Event->ShortText()); - } - else { - origShortText.clear(); - } - - //if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) - Event->SetShortText(ShortText); - return true; + LogD(3, prep("Event id:%d ShortText:%s new ShortText:%s"), Event->EventID(), Event->ShortText(), ShortText); + + if (Event->ShortText() && strcmp(Event->ShortText(),"") != 0) { + origShortText = std::string(Event->ShortText()); + } + else { + origShortText.clear(); + } + + //if (!Event->ShortText() || ShortText && (!strcmp(Event->ShortText(),"") || (strcmp(ShortText,"") && strcmp(Event->ShortText(),ShortText)))) + Event->SetShortText(ShortText); + return true; } bool cEEpgHandler::SetDescription(cEvent* Event, const char* Description) { - LogD(3, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); - - if (Event->Description() && strcmp(Event->Description(),"") != 0) - origDescription = Event->Description(); - else - origDescription.clear(); - - //if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) - Event->SetDescription(Description); - return true; + LogD(3, prep("Event id:%d Description:%s new Description:%s"), Event->EventID(), Event->Description(), Description); + + if (Event->Description() && strcmp(Event->Description(),"") != 0) + origDescription = Event->Description(); + else + origDescription.clear(); + + //if (!Event->Description() || Description && (!strcmp(Event->Description(),"") || (strcmp(Description,"") && strcmp(Event->Description(),Description)))) + Event->SetDescription(Description); + return true; } bool cEEpgHandler::SetContents(cEvent* Event, uchar* Contents) { - Event->SetContents(Contents); - return true; + Event->SetContents(Contents); + return true; } bool cEEpgHandler::SetParentalRating(cEvent* Event, int ParentalRating) { - Event->SetParentalRating(ParentalRating); - return true; + Event->SetParentalRating(ParentalRating); + return true; } bool cEEpgHandler::SetStartTime(cEvent* Event, time_t StartTime) { - Event->SetStartTime(StartTime); - return true; + Event->SetStartTime(StartTime); + return true; } bool cEEpgHandler::SetDuration(cEvent* Event, int Duration) { - Event->SetDuration(Duration); - return true; + Event->SetDuration(Duration); + return true; } bool cEEpgHandler::SetVps(cEvent* Event, time_t Vps) { - Event->SetVps(Vps); - return true; + Event->SetVps(Vps); + return true; } bool cEEpgHandler::HandleEvent(cEvent* Event) { - - LogD(3, prep("HandleEvent st:%s ost:%s desc:%s odesc:%s"),Event->ShortText(),origShortText.c_str(),Event->Description(),origDescription.c_str()); - - //After FixEpgBugs of cEvent set the original Short Text if empty - if (!Event->ShortText() || !strcmp(Event->ShortText(),"")) - Event->SetShortText(origShortText.c_str()); - - if (!Event->Description() && !origDescription.empty()) { - Event->SetDescription(origDescription.c_str()); - } - //TODO just to see the difference - //else if (!origDescription.empty() && !origDescription.compare(Event->Description())) { -// origDescription.append(" | EIT: "); -// origDescription.append(Event->Description()); -// Event->SetDescription(origDescription.c_str()); + + LogD(3, prep("HandleEvent st:%s ost:%s desc:%s odesc:%s"),Event->ShortText(),origShortText.c_str(),Event->Description(),origDescription.c_str()); + + //After FixEpgBugs of cEvent set the original Short Text if empty + if (!Event->ShortText() || !strcmp(Event->ShortText(),"")) + Event->SetShortText(origShortText.c_str()); + + if (!Event->Description() && !origDescription.empty()) { + Event->SetDescription(origDescription.c_str()); + } + //TODO just to see the difference + //else if (!origDescription.empty() && !origDescription.compare(Event->Description())) { + // origDescription.append(" | EIT: "); + // origDescription.append(Event->Description()); + // Event->SetDescription(origDescription.c_str()); // } - return true; + return true; } bool cEEpgHandler::SortSchedule(cSchedule* Schedule) { - Schedule->Sort(); - return true; + Schedule->Sort(); + return true; } bool cEEpgHandler::DropOutdated(cSchedule* Schedule, time_t SegmentStart, - time_t SegmentEnd, uchar TableID, uchar Version) { - return false; + time_t SegmentEnd, uchar TableID, uchar Version) { + return false; } #endif -- cgit v1.2.3