summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-08-26 15:02:00 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-08-26 15:02:00 +0200
commitf4d75d4141c9cb09dc09688cbc5f4a79015a318e (patch)
tree39ca3d175521f520f5ae9ed2f018102d73acb3d3 /config.c
parent6f6891082885d6c68f1a7efd80f99a0c907a9a4b (diff)
downloadvdr-f4d75d4141c9cb09dc09688cbc5f4a79015a318e.tar.gz
vdr-f4d75d4141c9cb09dc09688cbc5f4a79015a318e.tar.bz2
Implemented GetNextActiveTimer()
Diffstat (limited to 'config.c')
-rw-r--r--config.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/config.c b/config.c
index 367b1075..ad4b9dad 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.58 2001/08/26 14:11:29 kls Exp $
+ * $Id: config.c 1.59 2001/08/26 14:46:43 kls Exp $
*/
#include "config.h"
@@ -422,13 +422,6 @@ int cTimer::TimeToInt(int t)
return (t / 100 * 60 + t % 100) * 60;
}
-time_t cTimer::Day(time_t t)
-{
- struct tm d = *localtime(&t);
- d.tm_hour = d.tm_min = d.tm_sec = 0;
- return mktime(&d);
-}
-
int cTimer::ParseDay(const char *s)
{
char *tail;
@@ -605,21 +598,6 @@ void cTimer::SetPending(bool Pending)
pending = Pending;
}
-cTimer *cTimer::GetMatch(void)
-{
- time_t t = time(NULL); // all timers must be checked against the exact same time to correctly handle Priority!
- cTimer *t0 = NULL;
- cTimer *ti = (cTimer *)Timers.First();
- while (ti) {
- if (!ti->recording && ti->Matches(t)) {
- if (!t0 || ti->priority > t0->priority)
- t0 = ti;
- }
- ti = (cTimer *)ti->Next();
- }
- return t0;
-}
-
// --- cCommand -------------------------------------------------------------
char *cCommand::result = NULL;
@@ -783,6 +761,33 @@ cTimer *cTimers::GetTimer(cTimer *Timer)
return NULL;
}
+cTimer *cTimers::GetMatch(void)
+{
+ time_t t = time(NULL); // all timers must be checked against the exact same time to correctly handle Priority!
+ cTimer *t0 = NULL;
+ cTimer *ti = First();
+ while (ti) {
+ if (!ti->recording && ti->Matches(t)) {
+ if (!t0 || ti->priority > t0->priority)
+ t0 = ti;
+ }
+ ti = (cTimer *)ti->Next();
+ }
+ return t0;
+}
+
+cTimer *cTimers::GetNextActiveTimer(void)
+{
+ cTimer *t0 = NULL;
+ cTimer *ti = First();
+ while (ti) {
+ if (ti->active && (!t0 || *ti < *t0))
+ t0 = ti;
+ ti = (cTimer *)ti->Next();
+ }
+ return t0;
+}
+
// -- cSetup -----------------------------------------------------------------
cSetup Setup;