From c969c77d9c5faed74e429a60c9eaa00b4b84ec1f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 21 Feb 2004 14:52:37 +0100 Subject: Now using the 'running status' in the channel display --- HISTORY | 5 +++++ epg.c | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/HISTORY b/HISTORY index e021d812..5749d91a 100644 --- a/HISTORY +++ b/HISTORY @@ -2684,3 +2684,8 @@ Video Disk Recorder Revision History - The EPG data is now always kept sorted chronologically in the internal data structures. This also means that any EPG data retrieved through the SVRDP command LSTE is guaranteed to be sorted by start time. +- Now using the 'running status' in the channel display, so that a programme + that has an end time that is before the current time, but is still running, + will still be shown in the display (provided the broadcasters handle the + 'running status' flag correctly). This also applies to programmes that have + a start time that is in the future, but are already running. diff --git a/epg.c b/epg.c index 1c392b98..fc5cc830 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 and Rolf Hakenes . * - * $Id: epg.c 1.8 2004/02/21 13:46:23 kls Exp $ + * $Id: epg.c 1.9 2004/02/21 14:33:11 kls Exp $ */ #include "epg.h" @@ -442,25 +442,26 @@ cEvent *cSchedule::AddEvent(cEvent *Event) } const cEvent *cSchedule::GetPresentEvent(void) const -{ - return GetEventAround(time(NULL)); -} - -const cEvent *cSchedule::GetFollowingEvent(void) const { const cEvent *pe = NULL; time_t now = time(NULL); - time_t delta = INT_MAX; for (cEvent *p = events.First(); p; p = events.Next(p)) { - time_t dt = p->StartTime() - now; - if (dt > 0 && dt < delta) { - delta = dt; + if (p->StartTime() <= now && now < p->StartTime() + p->Duration()) pe = p; - } + if (p->RunningStatus() >= SI::RunningStatusPausing) + return p; } return pe; } +const cEvent *cSchedule::GetFollowingEvent(void) const +{ + const cEvent *p = GetPresentEvent(); + if (p) + p = events.Next(p); + return p; +} + const cEvent *cSchedule::GetEvent(u_int16_t EventID, time_t StartTime) const { // Returns either the event info with the given EventID or, if that one can't -- cgit v1.2.3