summaryrefslogtreecommitdiff
path: root/timers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'timers.cpp')
-rw-r--r--timers.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/timers.cpp b/timers.cpp
index 83067d2..a6be49e 100644
--- a/timers.cpp
+++ b/timers.cpp
@@ -204,6 +204,21 @@ string TimerManager::GetError( TimerPair const& timerData )
return "";
}
+const cTimer* TimerManager::GetTimer(tEventID eventid, tChannelID channelid)
+{
+ cMutexLock timersLock( &LiveTimerManager() );
+ SortedTimers& timers = LiveTimerManager().GetTimers();
+
+ for ( SortedTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer )
+ if (timer->Channel() && timer->Channel()->GetChannelID() == channelid)
+ {
+ if (!timer->Event()) timer->SetEventFromSchedule();
+ if (timer->Event() && timer->Event()->EventID() == eventid)
+ return &*timer;
+ }
+ return NULL;
+}
+
TimerManager& LiveTimerManager()
{
static TimerManager instance;