diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-21 14:52:37 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-21 14:52:37 +0100 |
commit | c969c77d9c5faed74e429a60c9eaa00b4b84ec1f (patch) | |
tree | 7f14b9629a163bb97fa9b4f3e947622488f555a0 | |
parent | 340d9bcb0fdf49fbe2740dde29af37f46887c122 (diff) | |
download | vdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.gz vdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.bz2 |
Now using the 'running status' in the channel display
-rw-r--r-- | HISTORY | 5 | ||||
-rw-r--r-- | epg.c | 23 |
2 files changed, 17 insertions, 11 deletions
@@ -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. @@ -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.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" @@ -443,24 +443,25 @@ 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 |