1.1 --- a/HISTORY Sat Dec 29 11:19:01 2007 +0100
1.2 +++ b/HISTORY Sat Dec 29 11:19:20 2007 +0100
1.3 @@ -1,6 +1,10 @@
1.4 VDR Plugin 'premiereepg' Revision History
1.5 -----------------------------------------
1.6
1.7 +6.11.2005: Version 0.0.4
1.8 +- Added parsing for order & parental rating information (as in
1.9 + premiereepg2vdr-0.0.4). Both options can be switched in the plugin setup menu.
1.10 +
1.11 17.09.2005: Version 0.0.3
1.12 - Added glue for vdr 1.3.32
1.13
2.1 --- a/README Sat Dec 29 11:19:01 2007 +0100
2.2 +++ b/README Sat Dec 29 11:19:20 2007 +0100
2.3 @@ -19,7 +19,7 @@
2.4 This work is based on the premiereepg2vdr commandline tool, which was written
2.5 by Axel Katzur software@katzur.de.
2.6 premiereepg2vdr can be found at:
2.7 -<http://www.katzur.de/download/premiereepg2vdr-0.0.3.tar.gz>
2.8 +<http://www.katzur.de/download/premiereepg2vdr-0.0.4.tar.gz>
2.9
2.10 Note: the EPG entries created with this plugin aren't fully compatible with
2.11 entries created by premiereepg2vdr. This plugin used a different sheme (IMO more
2.12 @@ -29,6 +29,8 @@
2.13 The plugin can tag option events i.e. the same event with the same time on
2.14 different channels e.g. F1 sub channels. The tagging format (e.g. before or
2.15 after event name) can be selected in the plugin setup menu.
2.16 +In addition there are two switches in the plugin setup menu to control inclusion
2.17 +of order and parental rating information into the event description.
2.18
2.19 Beside this, there is nothing big to say:
2.20
3.1 --- a/premiereepg.c Sat Dec 29 11:19:01 2007 +0100
3.2 +++ b/premiereepg.c Sat Dec 29 11:19:20 2007 +0100
3.3 @@ -49,7 +49,7 @@
3.4 #define PMT_SCAN_TIMEOUT 10 // seconds
3.5 #define PMT_SCAN_IDLE 300 // seconds
3.6
3.7 -static const char *VERSION = "0.0.3";
3.8 +static const char *VERSION = "0.0.4";
3.9 static const char *DESCRIPTION = "Parses extended Premiere EPG data";
3.10
3.11 // --- cSetupPremiereEpg -------------------------------------------------------
3.12 @@ -66,6 +66,8 @@
3.13 class cSetupPremiereEpg {
3.14 public:
3.15 int OptPat;
3.16 + int OrderInfo;
3.17 + int RatingInfo;
3.18 public:
3.19 cSetupPremiereEpg(void);
3.20 };
3.21 @@ -75,6 +77,8 @@
3.22 cSetupPremiereEpg::cSetupPremiereEpg(void)
3.23 {
3.24 OptPat=1;
3.25 + OrderInfo=1;
3.26 + RatingInfo=1;
3.27 }
3.28
3.29 // --- i18n --------------------------------------------------------------------
3.30 @@ -133,6 +137,160 @@
3.31 "", // TODO
3.32 "", // TODO
3.33 },
3.34 + { "Show order information",
3.35 + "Bestellhinweise anzeigen",
3.36 + "", // TODO
3.37 + "", // TODO
3.38 + "", // TODO
3.39 + "", // TODO
3.40 + "", // TODO
3.41 + "", // TODO
3.42 + "", // TODO
3.43 + "", // TODO
3.44 + "", // TODO
3.45 + "", // TODO
3.46 + "", // TODO
3.47 + "", // TODO
3.48 + "", // TODO
3.49 + "", // TODO
3.50 + },
3.51 + { "Show rating information",
3.52 + "Altersfreigaben anzeigen",
3.53 + "", // TODO
3.54 + "", // TODO
3.55 + "", // TODO
3.56 + "", // TODO
3.57 + "", // TODO
3.58 + "", // TODO
3.59 + "", // TODO
3.60 + "", // TODO
3.61 + "", // TODO
3.62 + "", // TODO
3.63 + "", // TODO
3.64 + "", // TODO
3.65 + "", // TODO
3.66 + "", // TODO
3.67 + },
3.68 +
3.69 + { "Ordernumber",
3.70 + "Bestellnummer",
3.71 + "", // TODO
3.72 + "", // TODO
3.73 + "", // TODO
3.74 + "", // TODO
3.75 + "", // TODO
3.76 + "", // TODO
3.77 + "", // TODO
3.78 + "", // TODO
3.79 + "", // TODO
3.80 + "", // TODO
3.81 + "", // TODO
3.82 + "", // TODO
3.83 + "", // TODO
3.84 + "", // TODO
3.85 + },
3.86 + { "Price",
3.87 + "Preis",
3.88 + "", // TODO
3.89 + "", // TODO
3.90 + "", // TODO
3.91 + "", // TODO
3.92 + "", // TODO
3.93 + "", // TODO
3.94 + "", // TODO
3.95 + "", // TODO
3.96 + "", // TODO
3.97 + "", // TODO
3.98 + "", // TODO
3.99 + "", // TODO
3.100 + "", // TODO
3.101 + "", // TODO
3.102 + },
3.103 + { "Ordering",
3.104 + "Bestellen",
3.105 + "", // TODO
3.106 + "", // TODO
3.107 + "", // TODO
3.108 + "", // TODO
3.109 + "", // TODO
3.110 + "", // TODO
3.111 + "", // TODO
3.112 + "", // TODO
3.113 + "", // TODO
3.114 + "", // TODO
3.115 + "", // TODO
3.116 + "", // TODO
3.117 + "", // TODO
3.118 + "", // TODO
3.119 + },
3.120 + { "SMS",
3.121 + "SMS",
3.122 + "", // TODO
3.123 + "", // TODO
3.124 + "", // TODO
3.125 + "", // TODO
3.126 + "", // TODO
3.127 + "", // TODO
3.128 + "", // TODO
3.129 + "", // TODO
3.130 + "", // TODO
3.131 + "", // TODO
3.132 + "", // TODO
3.133 + "", // TODO
3.134 + "", // TODO
3.135 + "", // TODO
3.136 + },
3.137 + { "WWW",
3.138 + "WWW",
3.139 + "", // TODO
3.140 + "", // TODO
3.141 + "", // TODO
3.142 + "", // TODO
3.143 + "", // TODO
3.144 + "", // TODO
3.145 + "", // TODO
3.146 + "", // TODO
3.147 + "", // TODO
3.148 + "", // TODO
3.149 + "", // TODO
3.150 + "", // TODO
3.151 + "", // TODO
3.152 + "", // TODO
3.153 + },
3.154 + { "Rating",
3.155 + "Altersfreigabe",
3.156 + "", // TODO
3.157 + "", // TODO
3.158 + "", // TODO
3.159 + "", // TODO
3.160 + "", // TODO
3.161 + "", // TODO
3.162 + "", // TODO
3.163 + "", // TODO
3.164 + "", // TODO
3.165 + "", // TODO
3.166 + "", // TODO
3.167 + "", // TODO
3.168 + "", // TODO
3.169 + "", // TODO
3.170 + },
3.171 + { "years",
3.172 + "Jahre",
3.173 + "", // TODO
3.174 + "", // TODO
3.175 + "", // TODO
3.176 + "", // TODO
3.177 + "", // TODO
3.178 + "", // TODO
3.179 + "", // TODO
3.180 + "", // TODO
3.181 + "", // TODO
3.182 + "", // TODO
3.183 + "", // TODO
3.184 + "", // TODO
3.185 + "", // TODO
3.186 + "", // TODO
3.187 + },
3.188
3.189 { NULL }
3.190 };
3.191 @@ -160,12 +318,16 @@
3.192 optDisp[i]=buff[i];
3.193 }
3.194 Add(new cMenuEditStraItem(tr("Tag option events"),&data.OptPat,NUM_PATS,optDisp));
3.195 + Add(new cMenuEditBoolItem(tr("Show order information"),&data.OrderInfo));
3.196 + Add(new cMenuEditBoolItem(tr("Show rating information"),&data.RatingInfo));
3.197 }
3.198
3.199 void cMenuSetupPremiereEpg::Store(void)
3.200 {
3.201 SetupPE=data;
3.202 SetupStore("OptionPattern",SetupPE.OptPat);
3.203 + SetupStore("OrderInfo",SetupPE.OrderInfo);
3.204 + SetupStore("RatingInfo",SetupPE.RatingInfo);
3.205 }
3.206
3.207 // --- CIT ---------------------------------------------------------------------
3.208 @@ -422,9 +584,42 @@
3.209 bool UseExtendedEventDescriptor=false;
3.210 SI::ExtendedEventDescriptors *ExtendedEventDescriptors=0;
3.211 SI::ShortEventDescriptor *ShortEventDescriptor=0;
3.212 + char *order=0, *rating=0;
3.213 for(SI::Loop::Iterator it; (d=cit.eventDescriptors.getNext(it)); ) {
3.214 switch(d->getDescriptorTag()) {
3.215 - case 0xF2:
3.216 + case 0xF0: // order information
3.217 + if(SetupPE.OrderInfo) {
3.218 + static const char *text[] = {
3.219 + "Ordernumber",
3.220 + "Price",
3.221 + "Ordering",
3.222 + "SMS",
3.223 + "WWW"
3.224 + };
3.225 + char buff[512];
3.226 + int p=0;
3.227 + const unsigned char *data=d->getData().getData()+2;
3.228 + for(int i=0; i<5; i++) {
3.229 + int l=data[0];
3.230 + if(l>0) p+=snprintf(&buff[p],sizeof(buff)-p,"\n%s: %.*s",tr(text[i]),l,&data[1]);
3.231 + data+=l+1;
3.232 + }
3.233 + if(p>0) order=strdup(buff);
3.234 + }
3.235 + break;
3.236 + case 0xF1: // parental rating
3.237 + if(SetupPE.RatingInfo) {
3.238 + char buff[512];
3.239 + int p=0;
3.240 + const unsigned char *data=d->getData().getData()+2;
3.241 + p+=snprintf(&buff[p],sizeof(buff)-p,"\n%s: %d %s",tr("Rating"),data[0]+3,tr("years"));
3.242 + data+=7;
3.243 + int l=data[0];
3.244 + if(l>0) p+=snprintf(&buff[p],sizeof(buff)-p," (%.*s)",l,&data[1]);
3.245 + if(p>0) rating=strdup(buff);
3.246 + }
3.247 + break;
3.248 + case 0xF2: // transmisions
3.249 if(nCount>=0) {
3.250 nCount++;
3.251 cDescrF2 f2(d);
3.252 @@ -548,6 +743,17 @@
3.253 char buffer[ExtendedEventDescriptors->getMaximumTextLength(": ")+1];
3.254 pEvent->SetDescription(ExtendedEventDescriptors->getText(buffer,sizeof(buffer),": "));
3.255 }
3.256 + if(order || rating) {
3.257 + int len=(pEvent->Description() ? strlen(pEvent->Description()) : 0) +
3.258 + (order ? strlen(order) : 0) +
3.259 + (rating ? strlen(rating) : 0);
3.260 + char buffer[len+32];
3.261 + buffer[0]=0;
3.262 + if(pEvent->Description()) strcat(buffer,pEvent->Description());
3.263 + if(rating) strcat(buffer,rating);
3.264 + if(order) strcat(buffer,order);
3.265 + pEvent->SetDescription(buffer);
3.266 + }
3.267
3.268 if(newEvent) pSchedule->AddEvent(pEvent);
3.269 pEvent->SetComponents(NULL);
3.270 @@ -563,6 +769,8 @@
3.271 }
3.272 delete ExtendedEventDescriptors;
3.273 delete ShortEventDescriptor;
3.274 + free(order);
3.275 + free(rating);
3.276 }
3.277 }
3.278 }
3.279 @@ -623,7 +831,9 @@
3.280
3.281 bool cPluginPremiereEpg::SetupParse(const char *Name, const char *Value)
3.282 {
3.283 - if (!strcasecmp(Name, "OptionPattern")) SetupPE.OptPat = atoi(Value);
3.284 + if (!strcasecmp(Name, "OptionPattern")) SetupPE.OptPat = atoi(Value);
3.285 + else if (!strcasecmp(Name, "OrderInfo")) SetupPE.OrderInfo = atoi(Value);
3.286 + else if (!strcasecmp(Name, "RatingInfo")) SetupPE.RatingInfo = atoi(Value);
3.287 else return false;
3.288 return true;
3.289 }