summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2018-02-24 17:29:07 +0100
committerhorchi <vdr@jwendel.de>2018-02-24 18:34:40 +0100
commitfb6de12636c538ab4ddaae0cc32089eac9584ed9 (patch)
tree6d769d1f32770fa90323028b4609c490a9a1cb86 /timer.c
parent49e5a4dd952d1fe444d40f107d5300132cef5eeb (diff)
downloadvdr-plugin-epg2vdr-fb6de12636c538ab4ddaae0cc32089eac9584ed9.tar.gz
vdr-plugin-epg2vdr-fb6de12636c538ab4ddaae0cc32089eac9584ed9.tar.bz2
2018-02-23 version 1.1.89 (horchi)\n - change: Improved switch timer 'timing'\n\n
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/timer.c b/timer.c
index 80cdbba..a0d6aab 100644
--- a/timer.c
+++ b/timer.c
@@ -31,7 +31,7 @@ int cUpdate::checkSwitchTimer()
{
char* buf;
asprintf(&buf, "Switching in %ld seconds to '%s'", swTimer->start-time(0), swTimer->channelId.c_str());
- Skins.Message(mtInfo, buf);
+ Skins.QueueMessage(mtInfo, buf);
free(buf);
swTimer->notified = yes;
}
@@ -86,6 +86,8 @@ int cUpdate::checkSwitchTimer()
it = switchTimers.erase(it);
}
+ switchTimerTrigger = no;
+
return done;
}
@@ -513,9 +515,21 @@ int cUpdate::takeSwitchTimer()
switchTimers[timerid].eventId = timerDb->getIntValue("EVENTID");
switchTimers[timerid].channelId = timerDb->getStrValue("CHANNELID");
- switchTimers[timerid].start = timerDb->getIntValue("_STARTTIME");
+ switchTimers[timerid].start = (timerDb->getIntValue("_STARTTIME") / 60) * 60; // cut seconds
switchTimers[timerid].notified = no;
+ // and register timer for it
+
+ timerThreads.push_back(new cTimerThread(&sendEvent, evtSwitchTimer,
+ switchTimers[timerid].start, this));
+
+ if (Epg2VdrConfig.switchTimerNotifyTime)
+ timerThreads.push_back(new cTimerThread(&sendEvent, evtSwitchTimer,
+ switchTimers[timerid].start - Epg2VdrConfig.switchTimerNotifyTime,
+ this));
+
+ // at last confirm it
+
timerDb->setCharValue("ACTION", taAssumed);
timerDb->setCharValue("STATE", tsPending);
timerDb->store();