summaryrefslogtreecommitdiff
path: root/epg.c
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 /epg.c
parent340d9bcb0fdf49fbe2740dde29af37f46887c122 (diff)
downloadvdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.gz
vdr-c969c77d9c5faed74e429a60c9eaa00b4b84ec1f.tar.bz2
Now using the 'running status' in the channel display
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c23
1 files changed, 12 insertions, 11 deletions
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