summaryrefslogtreecommitdiff
path: root/libcore
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-04-01 11:21:00 +0200
committerlouis <louis.braun@gmx.de>2015-04-01 11:21:00 +0200
commit25505767d320c43ab803c2546d9aee0dc74bb1d5 (patch)
tree62b9ae095f0a93c0386857a1ab4ab390d28b5d07 /libcore
parent495c2222340bd552d3264c26d290c8716b1dddb4 (diff)
downloadvdr-plugin-skindesigner-25505767d320c43ab803c2546d9aee0dc74bb1d5.tar.gz
vdr-plugin-skindesigner-25505767d320c43ab803c2546d9aee0dc74bb1d5.tar.bz2
added Token {timers[isremotetimer]} to <timers> in main menu
Diffstat (limited to 'libcore')
-rw-r--r--libcore/timers.c34
-rw-r--r--libcore/timers.h4
2 files changed, 38 insertions, 0 deletions
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<const cTimer *>(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<const cTim
Sort(CompareTimers);
+ int numTimers = Size();
+ if (numTimers > 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 <vdr/plugin.h>
class cGlobalSortedTimers : public cVector<const cTimer *> {
+ private:
+ bool *localTimer;
public:
cGlobalSortedTimers(bool forceRefresh = false);
+ virtual ~cGlobalSortedTimers(void);
+ bool IsRemoteTimer(int i);
int NumTimerConfilicts(void);
};