diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-03 14:28:33 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-03 14:28:33 +0100 |
commit | fc3b402d430f513635edaf2f7ee7ab5b32a3247f (patch) | |
tree | 40a6615566bfe150601887de7db0b8328adef778 /epg.c | |
parent | 56627cd12d9e01379d9104300fec837a4db8df48 (diff) | |
download | vdr-fc3b402d430f513635edaf2f7ee7ab5b32a3247f.tar.gz vdr-fc3b402d430f513635edaf2f7ee7ab5b32a3247f.tar.bz2 |
Implemented handling the "Parental Rating Descriptor"
Diffstat (limited to 'epg.c')
-rw-r--r-- | epg.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $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); |