summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-02-22 13:33:20 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-02-22 13:33:20 +0100
commit8e616636526b9d7f7530d96dcb69efa1d9e011d2 (patch)
tree1c57f6a9592ba1f3a98f262655c5b3701ca1b523
parent45eac6d94694aa9081bdd0e06794942c49818ff1 (diff)
downloadvdr-8e616636526b9d7f7530d96dcb69efa1d9e011d2.tar.gz
vdr-8e616636526b9d7f7530d96dcb69efa1d9e011d2.tar.bz2
Implemented handling the VPS timestamps
-rw-r--r--HISTORY4
-rw-r--r--eit.c17
-rw-r--r--epg.c21
-rw-r--r--epg.h6
-rwxr-xr-xepg2html.pl10
-rw-r--r--menu.c9
-rw-r--r--vdr.54
7 files changed, 62 insertions, 9 deletions
diff --git a/HISTORY b/HISTORY
index f1d04034..84878be6 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2692,3 +2692,7 @@ Video Disk Recorder Revision History
- Implemented an "EPG linger time", which can be set to have older EPG information
still displayed in the "Schedule" menu (thanks to Jaakko Hyvätti).
- Added PDCDescriptor handling to 'libsi'.
+- Implemented handling the VPS timestamps (aka "Programme Identification Label")
+ in preparation for full VPS support for timers (provided the tv stations
+ actually broadcast this information). Currently these are just displayed in
+ the event page if they exist and are different than the event's start time.
diff --git a/eit.c b/eit.c
index 0ef3590b..e1f4509a 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
*
- * $Id: eit.c 1.88 2004/02/21 13:26:52 kls Exp $
+ * $Id: eit.c 1.89 2004/02/22 13:17:52 kls Exp $
*/
#include "eit.h"
@@ -124,6 +124,21 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
break;
case SI::ParentalRatingDescriptorTag:
break;
+ case SI::PDCDescriptorTag: {
+ SI::PDCDescriptor *pd = (SI::PDCDescriptor *)d;
+ time_t now = time(NULL);
+ struct tm tm_r;
+ struct tm t = *localtime_r(&now, &tm_r); // this initializes the time zone in 't'
+ t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
+ t.tm_mon = pd->getMonth() - 1;
+ t.tm_mday = pd->getDay();
+ t.tm_hour = pd->getHour();
+ t.tm_min = pd->getMinute();
+ t.tm_sec = 0;
+ time_t vps = mktime(&t);
+ pEvent->SetVps(vps);
+ }
+ break;
case SI::TimeShiftedEventDescriptorTag: {
SI::TimeShiftedEventDescriptor *tsed = (SI::TimeShiftedEventDescriptor *)d;
cSchedule *rSchedule = (cSchedule *)Schedules->GetSchedule(tChannelID(Source, 0, 0, tsed->getReferenceServiceId()));
diff --git a/epg.c b/epg.c
index 1cd0d446..82810789 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 <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.10 2004/02/21 15:15:47 kls Exp $
+ * $Id: epg.c 1.11 2004/02/22 13:18:01 kls Exp $
*/
#include "epg.h"
@@ -29,6 +29,7 @@ cEvent::cEvent(tChannelID ChannelID, u_int16_t EventID)
description = NULL;
startTime = 0;
duration = 0;
+ vps = 0;
}
cEvent::~cEvent()
@@ -89,6 +90,11 @@ void cEvent::SetDuration(int Duration)
duration = Duration;
}
+void cEvent::SetVps(time_t Vps)
+{
+ vps = Vps;
+}
+
const char *cEvent::GetDateString(void) const
{
static char buf[25];
@@ -114,6 +120,14 @@ const char *cEvent::GetEndTimeString(void) const
return buf;
}
+const char *cEvent::GetVpsString(void) const
+{
+ static char buf[25];
+ struct tm tm_r;
+ strftime(buf, sizeof(buf), "%d.%m %R", localtime_r(&vps, &tm_r));
+ return buf;
+}
+
void cEvent::Dump(FILE *f, const char *Prefix) const
{
if (startTime + duration >= time(NULL)) {
@@ -124,6 +138,8 @@ void cEvent::Dump(FILE *f, const char *Prefix) const
fprintf(f, "%sS %s\n", Prefix, shortText);
if (!isempty(description))
fprintf(f, "%sD %s\n", Prefix, description);
+ if (vps)
+ fprintf(f, "%sV %ld\n", Prefix, vps);
fprintf(f, "%se\n", Prefix);
}
}
@@ -163,6 +179,9 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
case 'D': if (Event)
Event->SetDescription(t);
break;
+ case 'V': if (Event)
+ Event->SetVps(atoi(t));
+ break;
case 'e': Event = NULL;
break;
case 'c': // to keep things simple we react on 'c' here
diff --git a/epg.h b/epg.h
index 73d0f2f0..55c37d5b 100644
--- a/epg.h
+++ b/epg.h
@@ -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.h 1.7 2004/02/21 13:46:18 kls Exp $
+ * $Id: epg.h 1.8 2004/02/22 13:18:14 kls Exp $
*/
#ifndef __EPG_H
@@ -33,6 +33,7 @@ private:
char *description; // Description 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)
public:
cEvent(tChannelID ChannelID, u_int16_t EventID);
~cEvent();
@@ -47,9 +48,11 @@ public:
const char *Description(void) const { return description; }
time_t StartTime(void) const { return startTime; }
int Duration(void) const { return duration; }
+ time_t Vps(void) const { return vps; }
const char *GetDateString(void) const;
const char *GetTimeString(void) const;
const char *GetEndTimeString(void) const;
+ const char *GetVpsString(void) const;
void SetEventID(u_int16_t EventID);
void SetTableID(uchar TableID);
void SetVersion(uchar Version);
@@ -59,6 +62,7 @@ public:
void SetDescription(const char *Description);
void SetStartTime(time_t StartTime);
void SetDuration(int Duration);
+ void SetVps(time_t Vps);
void Dump(FILE *f, const char *Prefix = "") const;
static bool Read(FILE *f, cSchedule *Schedule);
void FixEpgBugs(void);
diff --git a/epg2html.pl b/epg2html.pl
index 6b7b8c94..c6e6f9cf 100755
--- a/epg2html.pl
+++ b/epg2html.pl
@@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: epg2html.pl 1.4 2002/05/30 09:46:46 kls Exp $
+# $Id: epg2html.pl 1.5 2004/02/22 13:18:27 kls Exp $
@Index = ();
@@ -47,13 +47,14 @@ while (<>) {
while (<>) {
if (/^E (.*?) (.*?) ([^ ]*)/) {
(my $Time, $Duration) = ($2, $3);
- my $Title = "", $Subtitle = "", $Description = "";
+ my $Title = "", $Subtitle = "", $Description = "", $Vps = 0;
while (<>) {
if (/^T (.*)/) { $Title = Tags($1); }
elsif (/^S (.*)/) { $Subtitle = Tags($1); }
elsif (/^D (.*)/) { $Description = Tags($1); }
+ elsif (/^V (.*)/) { $Vps = $1; }
elsif (/^e/) {
- $Events{$Time} = [($Duration, $Title, $Subtitle, $Description)];
+ $Events{$Time} = [($Duration, $Title, $Subtitle, $Description, $Vps)];
last;
}
}
@@ -62,7 +63,7 @@ while (<>) {
my @Schedule = ();
my $Day = "";
for $t (sort keys %Events) {
- (my $Duration, $Title, $Subtitle, $Description) = @{$Events{$t}};
+ (my $Duration, $Title, $Subtitle, $Description, $Vps) = @{$Events{$t}};
my $d = GetDay($t);
if ($d ne $Day) {
push(@Schedule, "</table>\n") if ($Day && @Schedule);
@@ -73,6 +74,7 @@ while (<>) {
my $Entry = $Title;
$Entry .= "<br><i>$Subtitle</i>" if $Subtitle;
$Entry .= "<br>$Description" if $Description;
+ $Entry .= "<br>(VPS = " . scalar localtime($Vps) . ")" if $Vps && $Vps != $t;
push(@Schedule, "<tr><td valign=top>" . GetTime($t) . "</td><td>$Entry</td></tr>\n");
}
push(@Schedule, "</table>\n") if (@Schedule);
diff --git a/menu.c b/menu.c
index e9eb30d5..a2fb6e75 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.289 2004/02/21 15:40:35 kls Exp $
+ * $Id: menu.c 1.290 2004/02/22 13:32:07 kls Exp $
*/
#include "menu.h"
@@ -1168,6 +1168,13 @@ cMenuEvent::cMenuEvent(const cEvent *Event, bool CanSwitch)
Add(item = new cMenuTextItem(Subtitle, 1, Line, Setup.OSDwidth - 2, -1, clrYellow));
Line += item->Height() + 1;
}
+ if (Event->Vps() && Event->Vps() != Event->StartTime()) {
+ char *buffer;
+ asprintf(&buffer, "VPS: %s", Event->GetVpsString());
+ Add(item = new cMenuTextItem(buffer, 1, Line, Setup.OSDwidth - 2, -1, clrYellow));
+ free(buffer);
+ Line += item->Height() + 1;
+ }
if (!isempty(ExtendedDescription))
Add(new cMenuTextItem(ExtendedDescription, 1, Line, Setup.OSDwidth - 2, Height() - Line - 2, clrCyan), true);
SetHelp(tr("Record"), NULL, NULL, CanSwitch ? tr("Switch") : NULL);
diff --git a/vdr.5 b/vdr.5
index c0a6b74a..7ced5507 100644
--- a/vdr.5
+++ b/vdr.5
@@ -8,7 +8,7 @@
.\" License as specified in the file COPYING that comes with the
.\" vdr distribution.
.\"
-.\" $Id: vdr.5 1.24 2004/02/13 14:55:09 kls Exp $
+.\" $Id: vdr.5 1.25 2004/02/22 13:18:48 kls Exp $
.\"
.TH vdr 5 "1 Jun 2003" "1.2.0" "Video Disk Recorder Files"
.SH NAME
@@ -561,6 +561,7 @@ l l.
\fBT\fR@<title>
\fBS\fR@<short text>
\fBD\fR@<description>
+\fBV\fR@<vps time>
\fBe\fR@
\fBc\fR@
.TE
@@ -583,6 +584,7 @@ l l.
<title> @is the title of the event
<short text> @is the short text of the event (typically the name of the episode etc.)
<description> @is the description of the event (any '|' characters will be interpreted as newlines)
+<vps time> @is the Video Programming Service time of this event
.TE
This file will be read at program startup in order to restore the results of