summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/timers.c b/timers.c
index 2ec387a4..02765800 100644
--- a/timers.c
+++ b/timers.c
@@ -4,14 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: timers.c 1.10 2004/02/29 14:20:48 kls Exp $
+ * $Id: timers.c 1.11 2004/03/06 11:22:57 kls Exp $
*/
#include "timers.h"
#include <ctype.h>
#include "channels.h"
#include "i18n.h"
-#include "libsi/si.h"
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
// format characters in order to allow any number of blanks after a numeric
@@ -333,8 +332,8 @@ bool cTimer::Matches(time_t t, bool Directly)
if (HasFlags(tfActive)) {
if (HasFlags(tfVps) && !Directly && event && event->Vps()) {
startTime = event->StartTime();
- stopTime = startTime + event->Duration();
- return event->RunningStatus() > SI::RunningStatusNotRunning;
+ stopTime = event->EndTime();
+ return event->IsRunning(true);
}
return startTime <= t && t < stopTime; // must stop *before* stopTime to allow adjacent timers
}
@@ -350,9 +349,14 @@ int cTimer::Matches(const cEvent *Event)
bool m1 = Matches(t1, true);
bool m2 = UseVps ? m1 : Matches(t2, true);
startTime = stopTime = 0;
- if (m1 && m2)
+ if (m1 && m2) {
+ if (UseVps && Event->IsRunning(true))
+ return tmFull;
+ if (time(NULL) > Event->EndTime())
+ return tmNone;
return tmFull;
- if (m1 || m2)
+ }
+ if ((m1 || m2) && time(NULL) <= Event->EndTime())
return tmPartial;
}
return tmNone;
@@ -381,6 +385,8 @@ void cTimer::SetEvent(const cEvent *Event)
sprintf(vpsbuf, "(VPS: %s) ", Event->GetVpsString());
isyslog("timer %d (%d %04d-%04d '%s') set to event %s %s-%s %s'%s'", Index() + 1, Channel()->Number(), start, stop, file, Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString(), vpsbuf, Event->Title());
}
+ else
+ isyslog("timer %d (%d %04d-%04d '%s') set to no event", Index() + 1, Channel()->Number(), start, stop, file);
event = Event;
}
}