summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-02-21 14:52:37 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-02-21 14:52:37 +0100
commitc969c77d9c5faed74e429a60c9eaa00b4b84ec1f (patch)
tree7f14b9629a163bb97fa9b4f3e947622488f555a0
parent340d9bcb0fdf49fbe2740dde29af37f46887c122 (diff)
downloadvdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.gz
vdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.bz2
Now using the 'running status' in the channel display
-rw-r--r--HISTORY5
-rw-r--r--epg.c23
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 <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