From 98f3934a583790b2119ff5a09d63cb3ede4e78f4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 22 Feb 2004 14:14:55 +0100 Subject: Added 'CheckRunningStatus' when getting present/following event --- epg.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'epg.c') diff --git a/epg.c b/epg.c index 82810789..05a8713a 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.11 2004/02/22 13:18:01 kls Exp $ + * $Id: epg.c 1.12 2004/02/22 13:55:12 kls Exp $ */ #include "epg.h" @@ -460,22 +460,25 @@ cEvent *cSchedule::AddEvent(cEvent *Event) return Event; } -const cEvent *cSchedule::GetPresentEvent(void) const +const cEvent *cSchedule::GetPresentEvent(bool CheckRunningStatus) const { 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()) + if (p->StartTime() <= now && now < p->StartTime() + p->Duration()) { pe = p; - if (p->RunningStatus() >= SI::RunningStatusPausing) + if (!CheckRunningStatus) + break; + } + if (CheckRunningStatus && p->RunningStatus() >= SI::RunningStatusPausing) return p; } return pe; } -const cEvent *cSchedule::GetFollowingEvent(void) const +const cEvent *cSchedule::GetFollowingEvent(bool CheckRunningStatus) const { - const cEvent *p = GetPresentEvent(); + const cEvent *p = GetPresentEvent(CheckRunningStatus); if (p) p = events.Next(p); return p; -- cgit v1.2.3