1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Now using the 'running status' in the channel display

This commit is contained in:
Klaus Schmidinger 2004-02-21 14:52:37 +01:00
parent 340d9bcb0f
commit c969c77d9c
2 changed files with 19 additions and 13 deletions

View File

@ -2684,3 +2684,8 @@ Video Disk Recorder Revision History
- The EPG data is now always kept sorted chronologically in the internal data - 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 structures. This also means that any EPG data retrieved through the SVRDP
command LSTE is guaranteed to be sorted by start time. 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.

27
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * 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" #include "epg.h"
@ -443,22 +443,23 @@ cEvent *cSchedule::AddEvent(cEvent *Event)
const cEvent *cSchedule::GetPresentEvent(void) const const cEvent *cSchedule::GetPresentEvent(void) const
{ {
return GetEventAround(time(NULL)); const cEvent *pe = NULL;
time_t now = time(NULL);
for (cEvent *p = events.First(); p; p = events.Next(p)) {
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 *cSchedule::GetFollowingEvent(void) const
{ {
const cEvent *pe = NULL; const cEvent *p = GetPresentEvent();
time_t now = time(NULL); if (p)
time_t delta = INT_MAX; p = events.Next(p);
for (cEvent *p = events.First(); p; p = events.Next(p)) { return p;
time_t dt = p->StartTime() - now;
if (dt > 0 && dt < delta) {
delta = dt;
pe = p;
}
}
return pe;
} }
const cEvent *cSchedule::GetEvent(u_int16_t EventID, time_t StartTime) const const cEvent *cSchedule::GetEvent(u_int16_t EventID, time_t StartTime) const