diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-22 14:14:55 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-22 14:14:55 +0100 |
commit | 98f3934a583790b2119ff5a09d63cb3ede4e78f4 (patch) | |
tree | 714048fa8f8a677dc7c8a93d6e393bd73214e71c /epg.c | |
parent | 5f0a84d1bf891cb5f09757c52557e012a9dd6ea2 (diff) | |
download | vdr-98f3934a583790b2119ff5a09d63cb3ede4e78f4.tar.gz vdr-98f3934a583790b2119ff5a09d63cb3ede4e78f4.tar.bz2 |
Added 'CheckRunningStatus' when getting present/following event
Diffstat (limited to 'epg.c')
-rw-r--r-- | epg.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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.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; |