premiereepg.c
branchtrunk
changeset 14 feccb11658b1
parent 12 5213337a6614
child 18 b55e482869c7
equal deleted inserted replaced
13:967cdf186c96 14:feccb11658b1
     1 /*
     1 /*
     2  * PremiereEpg plugin to VDR (C++)
     2  * PremiereEpg plugin to VDR (C++)
     3  *
     3  *
     4  * (C) 2005-2006 Stefan Huelswitt <s.huelswitt@gmx.de>
     4  * (C) 2005-2007 Stefan Huelswitt <s.huelswitt@gmx.de>
     5  *
     5  *
     6  * This code is base on the commandline tool premiereepg2vdr
     6  * This code is base on the commandline tool premiereepg2vdr
     7  * (C) 2004-2005 by Axel Katzur software@katzur.de
     7  * (C) 2004-2005 by Axel Katzur software@katzur.de
     8  * but has been rewritten from scratch
     8  * but has been rewritten from scratch
     9  *
     9  *
    31 #include <vdr/i18n.h>
    31 #include <vdr/i18n.h>
    32 #include <vdr/config.h>
    32 #include <vdr/config.h>
    33 #include <libsi/section.h>
    33 #include <libsi/section.h>
    34 #include <libsi/descriptor.h>
    34 #include <libsi/descriptor.h>
    35 
    35 
       
    36 #if APIVERSNUM < 10401
       
    37 #error You need at least VDR API version 1.4.1 for this plugin
       
    38 #endif
       
    39 #if APIVERSNUM < 10507
       
    40 #define trNOOP(s) (s)
       
    41 #endif
       
    42 
    36 //#define DEBUG
    43 //#define DEBUG
    37 //#define DEBUG2
    44 //#define DEBUG2
    38 
    45 
    39 #ifdef DEBUG
    46 #ifdef DEBUG
    40 #define d(x) { (x); }
    47 #define d(x) { (x); }
    48 #endif
    55 #endif
    49 
    56 
    50 #define PMT_SCAN_TIMEOUT  10  // seconds
    57 #define PMT_SCAN_TIMEOUT  10  // seconds
    51 #define PMT_SCAN_IDLE     300 // seconds
    58 #define PMT_SCAN_IDLE     300 // seconds
    52 
    59 
    53 static const char *VERSION        = "0.0.7";
    60 static const char *VERSION        = "0.0.8";
    54 static const char *DESCRIPTION    = "Parses extended Premiere EPG data";
    61 static const char *DESCRIPTION    = trNOOP("Parses extended Premiere EPG data");
    55 
       
    56 #if APIVERSNUM < 10401
       
    57 #error You need at least VDR API version 1.4.1 for this plugin
       
    58 #endif
       
    59 
    62 
    60 // --- cSetupPremiereEpg -------------------------------------------------------
    63 // --- cSetupPremiereEpg -------------------------------------------------------
    61 
    64 
    62 const char *optPats[] = {
    65 const char *optPats[] = {
    63   "%s",
    66   "%s",
    88   FixEpg=0;
    91   FixEpg=0;
    89 }
    92 }
    90 
    93 
    91 // --- i18n --------------------------------------------------------------------
    94 // --- i18n --------------------------------------------------------------------
    92 
    95 
       
    96 #if APIVERSNUM < 10507
    93 const tI18nPhrase Phrases[] = {
    97 const tI18nPhrase Phrases[] = {
    94 /*
       
    95 */
       
    96   { "PremiereEPG",
    98   { "PremiereEPG",
    97     "PremiereEPG",
    99     "PremiereEPG",
    98     "", // TODO
   100     "", // TODO
    99     "", // TODO
   101     "", // TODO
   100     "", // TODO
   102     "", // TODO
   125     "", // TODO
   127     "", // TODO
   126     "", // TODO
   128     "", // TODO
   127     "", // TODO
   129     "", // TODO
   128     "", // TODO
   130     "", // TODO
   129   },
   131   },
       
   132   { "off",
       
   133     "aus",
       
   134     "", // TODO
       
   135     "", // TODO
       
   136     "", // TODO
       
   137     "", // TODO
       
   138     "", // TODO
       
   139     "", // TODO
       
   140     "", // TODO
       
   141     "", // TODO
       
   142     "", // TODO
       
   143     "", // TODO
       
   144     "", // TODO
       
   145     "", // TODO
       
   146     "", // TODO
       
   147     "", // TODO
       
   148   },
   130   { "Tag option events",
   149   { "Tag option events",
   131     "Options Events markieren",
   150     "Options Events markieren",
   132     "", // TODO
   151     "", // TODO
   133     "", // TODO
   152     "", // TODO
   134     "", // TODO
   153     "", // TODO
   316     "", // TODO
   335     "", // TODO
   317   },
   336   },
   318 
   337 
   319   { NULL }
   338   { NULL }
   320   };
   339   };
       
   340 #endif
   321 
   341 
   322 // --- cMenuSetupPremiereEpg ------------------------------------------------------------
   342 // --- cMenuSetupPremiereEpg ------------------------------------------------------------
   323 
   343 
   324 class cMenuSetupPremiereEpg : public cMenuSetupPage {
   344 class cMenuSetupPremiereEpg : public cMenuSetupPage {
   325 private:
   345 private:
   507         for(SI::Loop::Iterator it; (d=cit.eventDescriptors.getNext(it)); ) {
   527         for(SI::Loop::Iterator it; (d=cit.eventDescriptors.getNext(it)); ) {
   508           switch(d->getDescriptorTag()) {
   528           switch(d->getDescriptorTag()) {
   509             case 0xF0: // order information
   529             case 0xF0: // order information
   510               if(SetupPE.OrderInfo) {
   530               if(SetupPE.OrderInfo) {
   511                 static const char *text[] = {
   531                 static const char *text[] = {
   512                   "Ordernumber",
   532                   trNOOP("Ordernumber"),
   513                   "Price",
   533                   trNOOP("Price"),
   514                   "Ordering",
   534                   trNOOP("Ordering"),
   515                   "SMS",
   535                   trNOOP("SMS"),
   516                   "WWW"
   536                   trNOOP("WWW")
   517                   };
   537                   };
   518                 char buff[512];
   538                 char buff[512];
   519                 int p=0;
   539                 int p=0;
   520                 const unsigned char *data=d->getData().getData()+2;
   540                 const unsigned char *data=d->getData().getData()+2;
   521                 for(int i=0; i<5; i++) {
   541                 for(int i=0; i<5; i++) {
   740   memset(epg,0,sizeof(epg));
   760   memset(epg,0,sizeof(epg));
   741 }
   761 }
   742 
   762 
   743 bool cPluginPremiereEpg::Start(void)
   763 bool cPluginPremiereEpg::Start(void)
   744 {
   764 {
       
   765 #if APIVERSNUM < 10507
   745   RegisterI18n(Phrases);
   766   RegisterI18n(Phrases);
       
   767 #endif
   746   for(int i=0; i<MAXDVBDEVICES; i++) {
   768   for(int i=0; i<MAXDVBDEVICES; i++) {
   747     cDevice *dev=cDevice::GetDevice(i);
   769     cDevice *dev=cDevice::GetDevice(i);
   748     if(dev) {
   770     if(dev) {
   749       epg[i].device=dev;
   771       epg[i].device=dev;
   750       dev->AttachFilter(epg[i].filter=new cFilterPremiereEpg);
   772       dev->AttachFilter(epg[i].filter=new cFilterPremiereEpg);