From fc3b402d430f513635edaf2f7ee7ab5b32a3247f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 3 Jan 2010 14:28:33 +0100 Subject: Implemented handling the "Parental Rating Descriptor" --- epg.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'epg.c') diff --git a/epg.c b/epg.c index 83376ac8..e1cfe18d 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 2.3 2010/01/03 11:28:38 kls Exp $ + * $Id: epg.c 2.4 2010/01/03 14:10:20 kls Exp $ */ #include "epg.h" @@ -113,6 +113,7 @@ cEvent::cEvent(tEventID EventID) description = NULL; components = NULL; memset(contents, 0, sizeof(contents)); + parentalRating = 0; startTime = 0; duration = 0; vps = 0; @@ -193,6 +194,11 @@ void cEvent::SetContents(uchar *Contents) contents[i] = Contents[i]; } +void cEvent::SetParentalRating(int ParentalRating) +{ + parentalRating = ParentalRating; +} + void cEvent::SetStartTime(time_t StartTime) { if (startTime != StartTime) { @@ -383,6 +389,13 @@ const char *cEvent::ContentToString(uchar Content) return ""; } +cString cEvent::GetParentalRatingString(void) const +{ + if (parentalRating) + return cString::sprintf(tr("ParentalRating$from %d"), parentalRating); + return NULL; +} + cString cEvent::GetDateString(void) const { return DateString(startTime); @@ -425,6 +438,8 @@ void cEvent::Dump(FILE *f, const char *Prefix, bool InfoOnly) const fprintf(f, " %02X", Contents(i)); fprintf(f, "\n"); } + if (parentalRating) + fprintf(f, "%sR %d\n", Prefix, parentalRating); if (components) { for (int i = 0; i < components->NumComponents(); i++) { tComponent *p = components->Component(i); @@ -465,6 +480,8 @@ bool cEvent::Parse(char *s) } } break; + case 'R': SetParentalRating(atoi(t)); + break; case 'X': if (!components) components = new cComponents; components->SetComponent(components->NumComponents(), t); -- cgit v1.2.3