Am Mittwoch, den 06.01.2010, 13:34 +0100 schrieb Klaus Schmidinger:
> VDR developer version 1.7.11 is now available at

...

> The changes since version 1.7.10:
> 
 ...
> - Implemented handling the "Content Descriptor" (based on a patch from Rolf
>   Ahrenberg). The 'classic', 'sttng' and 'curses' skins display the textual
>   representation of the content descriptors as "genre". The epg.data file 
> stores
>   the genre using the tag character 'G'.

Believe it or not, I was working on this patch this afternoon. I should
have checked my emails earlier. But how about changing all these
#defines in enumeration in epg.h? I also changed the names the way, that
they fit better to the rest of vdr's source code (patch attached).
ARD also sends some kind of user defined Content Descriptor, but
unfortunately it's nowhere documented.

Regards,

Joachim

diff -ruN ./vdr-1.7.11/eit.c ./vdr-1.7.11-patched/eit.c
--- ./vdr-1.7.11/eit.c	2010-01-03 16:35:21.000000000 +0100
+++ ./vdr-1.7.11-patched/eit.c	2010-01-06 19:30:21.355386156 +0100
@@ -157,9 +157,9 @@
                  SI::ContentDescriptor *cd = (SI::ContentDescriptor *)d;
                  SI::ContentDescriptor::Nibble Nibble;
                  int NumContents = 0;
-                 uchar Contents[MAXEVCONTENTS] = { 0 };
+                 uchar Contents[MaxEventContents] = { 0 };
                  for (SI::Loop::Iterator it3; cd->nibbleLoop.getNext(Nibble, it3); ) {
-                     if (NumContents < MAXEVCONTENTS) {
+                     if (NumContents < MaxEventContents) {
                         Contents[NumContents] = ((Nibble.getContentNibbleLevel1() & 0xF) << 4) | (Nibble.getContentNibbleLevel2() & 0xF);
                         NumContents++;
                         }
diff -ruN ./vdr-1.7.11/epg.c ./vdr-1.7.11-patched/epg.c
--- ./vdr-1.7.11/epg.c	2010-01-03 15:10:20.000000000 +0100
+++ ./vdr-1.7.11-patched/epg.c	2010-01-06 19:29:43.625386276 +0100
@@ -190,7 +190,7 @@
 
 void cEvent::SetContents(uchar *Contents)
 {
-  for (int i = 0; i < MAXEVCONTENTS; i++)
+  for (int i = 0; i < MaxEventContents; i++)
       contents[i] = Contents[i];
 }
 
@@ -250,7 +250,7 @@
 const char *cEvent::ContentToString(uchar Content)
 {
   switch (Content & 0xF0) {
-    case EVCONTENTMASK_MOVIEDRAMA:
+    case ecmMovieDrama:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Movie/Drama");
@@ -264,7 +264,7 @@
            case 0x08: return tr("Content$Adult Movie/Drama");
            }
          break;
-    case EVCONTENTMASK_NEWSCURRENTAFFAIRS:
+    case ecmNewsCurrentAffairs:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$News/Current Affairs");
@@ -274,7 +274,7 @@
            case 0x04: return tr("Content$Discussion/Inverview/Debate");
            }
          break;
-    case EVCONTENTMASK_SHOW:
+    case ecmShow:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Show/Game Show");
@@ -283,7 +283,7 @@
            case 0x03: return tr("Content$Talk Show");
            }
          break;
-    case EVCONTENTMASK_SPORTS:
+    case ecmSports:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Sports");
@@ -300,7 +300,7 @@
            case 0x0B: return tr("Content$Martial Sports");
            }
          break;
-    case EVCONTENTMASK_CHILDRENYOUTH:
+    case ecmChildrenYouth:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Children's/Youth Programme");
@@ -311,7 +311,7 @@
            case 0x05: return tr("Content$Cartoons/Puppets");
            }
          break;
-    case EVCONTENTMASK_MUSICBALLETDANCE:
+    case ecmMusicBalletDance:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Music/Ballet/Dance");
@@ -323,7 +323,7 @@
            case 0x06: return tr("Content$Ballet");
            }
          break;
-    case EVCONTENTMASK_ARTSCULTURE:
+    case ecmArtsCulture:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Arts/Culture");
@@ -340,7 +340,7 @@
            case 0x0B: return tr("Content$Fashion");
            }
          break;
-    case EVCONTENTMASK_SOCIALPOLITICALECONOMICS:
+    case ecmSocialPoliticalEconomics:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Social/Political/Economics");
@@ -349,7 +349,7 @@
            case 0x03: return tr("Content$Remarkable People");
            }
          break;
-    case EVCONTENTMASK_EDUCATIONALSCIENCE:
+    case ecmEducationalScience:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Education/Science/Factual");
@@ -362,7 +362,7 @@
            case 0x07: return tr("Content$Languages");
            }
          break;
-    case EVCONTENTMASK_LEISUREHOBBIES:
+    case ecmLeisureHobbies:
          switch (Content & 0x0F) {
            default:
            case 0x00: return tr("Content$Leisure/Hobbies");
@@ -375,7 +375,7 @@
            case 0x07: return tr("Content$Gardening");
            }
          break;
-    case EVCONTENTMASK_SPECIAL:
+    case ecmSpecial:
          switch (Content & 0x0F) {
            case 0x00: return tr("Content$Original Language");
            case 0x01: return tr("Content$Black & White");
@@ -468,7 +468,7 @@
               break;
     case 'G': {
                 memset(contents, 0, sizeof(contents));
-                for (int i = 0; i < MAXEVCONTENTS; i++) {
+                for (int i = 0; i < MaxEventContents; i++) {
                     char *tail = NULL;
                     int c = strtol(t, &tail, 16);
                     if (0x00 < c && c <= 0xFF) {
diff -ruN ./vdr-1.7.11/epg.h ./vdr-1.7.11-patched/epg.h
--- ./vdr-1.7.11/epg.h	2010-01-03 15:39:14.000000000 +0100
+++ ./vdr-1.7.11-patched/epg.h	2010-01-06 19:30:01.405386428 +0100
@@ -19,19 +19,22 @@
 
 #define MAXEPGBUGFIXLEVEL 3
 
-#define MAXEVCONTENTS                          4
-#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
+enum {MaxEventContents=4};
+
+enum eEventContentMask {
+  ecmMovieDrama              = 0x10,
+  ecmNewsCurrentAffairs      = 0x20,
+  ecmShow                    = 0x30,
+  ecmSports                  = 0x40,
+  ecmChildrenYouth           = 0x50,
+  ecmMusicBalletDance        = 0x60,
+  ecmArtsCulture             = 0x70,
+  ecmSocialPoliticalEconomics= 0x80,
+  ecmEducationalScience      = 0x90,
+  ecmLeisureHobbies          = 0xA0,
+  ecmSpecial                 = 0xB0,
+  ecmUserDefined             = 0xF0
+};
 
 enum eDumpMode { dmAll, dmPresent, dmFollowing, dmAtTime };
 
@@ -78,7 +81,7 @@
   char *shortText;         // Short description of this event (typically the episode name in case of a series)
   char *description;       // Description of this event
   cComponents *components; // The stream components of this event
-  uchar contents[MAXEVCONTENTS]; // Contents of this event
+  uchar contents[MaxEventContents]; // Contents of this event
   time_t startTime;        // Start time of this event
   int duration;            // Duration of this event in seconds
   time_t vps;              // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL)
@@ -97,7 +100,7 @@
   const char *ShortText(void) const { return shortText; }
   const char *Description(void) const { return description; }
   const cComponents *Components(void) const { return components; }
-  uchar Contents(int i = 0) const { return (0 <= i && i < MAXEVCONTENTS) ? contents[i] : 0; }
+  uchar Contents(int i = 0) const { return (0 <= i && i < MaxEventContents) ? contents[i] : 0; }
   int ParentalRating(void) const { return parentalRating; }
   time_t StartTime(void) const { return startTime; }
   time_t EndTime(void) const { return startTime + duration; }

_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to