From 25505767d320c43ab803c2546d9aee0dc74bb1d5 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 1 Apr 2015 11:21:00 +0200 Subject: added Token {timers[isremotetimer]} to in main menu --- libcore/timers.c | 34 ++++++++++++++++++++++++++++++++++ libcore/timers.h | 4 ++++ 2 files changed, 38 insertions(+) (limited to 'libcore') diff --git a/libcore/timers.c b/libcore/timers.c index 3e80ec7..b93aada 100644 --- a/libcore/timers.c +++ b/libcore/timers.c @@ -9,6 +9,7 @@ static int CompareTimers(const void *a, const void *b) { cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector(Timers.Count()) { static bool initial = true; static cRemoteTimerRefresh *remoteTimerRefresh = NULL; + localTimer = NULL; if (forceRefresh) initial = true; @@ -41,10 +42,43 @@ cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector 0) { + localTimer = new bool[numTimers]; + for (int i=0; i < numTimers; i++) { + if (!pRemoteTimers) { + localTimer[i] = true; + } else { + localTimer[i] = false; + for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { + if (Timer == At(i)) { + localTimer[i] = true; + break; + } + } + } + } + } + if (pRemoteTimers && (remoteTimerRefresh == NULL)) remoteTimerRefresh = new cRemoteTimerRefresh(); } +cGlobalSortedTimers::~cGlobalSortedTimers(void) { + if (localTimer) { + delete[] localTimer; + } +} + +bool cGlobalSortedTimers::IsRemoteTimer(int i) { + if (!localTimer) + return true; + if (i >= Size()) + return true; + return !(localTimer[i]); +} + + int cGlobalSortedTimers::NumTimerConfilicts(void) { int numConflicts = 0; cPlugin *p = cPluginManager::GetPlugin("epgsearch"); diff --git a/libcore/timers.h b/libcore/timers.h index 81d988a..aba873c 100644 --- a/libcore/timers.h +++ b/libcore/timers.h @@ -5,8 +5,12 @@ #include class cGlobalSortedTimers : public cVector { + private: + bool *localTimer; public: cGlobalSortedTimers(bool forceRefresh = false); + virtual ~cGlobalSortedTimers(void); + bool IsRemoteTimer(int i); int NumTimerConfilicts(void); }; -- cgit v1.2.3