summaryrefslogtreecommitdiff
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
parent495c2222340bd552d3264c26d290c8716b1dddb4 (diff)
downloadvdr-plugin-skindesigner-25505767d320c43ab803c2546d9aee0dc74bb1d5.tar.gz
vdr-plugin-skindesigner-25505767d320c43ab803c2546d9aee0dc74bb1d5.tar.bz2
added Token {timers[isremotetimer]} to <timers> in main menu
-rw-r--r--HISTORY1
-rw-r--r--libcore/timers.c34
-rw-r--r--libcore/timers.h4
-rw-r--r--skins/metrixhd/xmlfiles/displaymenumain.xml1
-rw-r--r--skinskeleton/xmlfiles/displaymenumain.xml1
-rw-r--r--views/viewhelpers.c4
6 files changed, 44 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index b154fdc..95263a6 100644
--- a/HISTORY
+++ b/HISTORY
@@ -255,3 +255,4 @@ Version 0.3.3
if recording is replayed. New token {islivetv} indicates this.
- added Token {percentseen} to listelements in menurecordings. For
VDR Version < 2.1.8 {percentseen} is set to -1.
+- added Token {timers[isremotetimer]} to <timers> in main menu
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);
};
diff --git a/skins/metrixhd/xmlfiles/displaymenumain.xml b/skins/metrixhd/xmlfiles/displaymenumain.xml
index 58088dd..5818cef 100644
--- a/skins/metrixhd/xmlfiles/displaymenumain.xml
+++ b/skins/metrixhd/xmlfiles/displaymenumain.xml
@@ -119,6 +119,7 @@
{timers[channelnumber]} number of channel
{timers[channelid]} ChannelID of channel
{timers[channellogoexists]} true if channel logo exists
+ {timers[isremotetimer]} true if timer is a remote timer from remotetimers plugin
-->
<timers detached="true" delay="100" fadetime="0">
<area x="0" y="75%" width="{areawidth}/8 - 5" height="25%" layer="1">
diff --git a/skinskeleton/xmlfiles/displaymenumain.xml b/skinskeleton/xmlfiles/displaymenumain.xml
index 13af71f..f9275cb 100644
--- a/skinskeleton/xmlfiles/displaymenumain.xml
+++ b/skinskeleton/xmlfiles/displaymenumain.xml
@@ -15,6 +15,7 @@
{timers[channelnumber]} number of channel
{timers[channelid]} ChannelID of channel
{timers[channellogoexists]} true if channel logo exists
+ {timers[isremotetimer]} true if timer is a remote timer from remotetimers plugin
-->
<timers>
</timers>
diff --git a/views/viewhelpers.c b/views/viewhelpers.c
index 9ad437b..0e59faa 100644
--- a/views/viewhelpers.c
+++ b/views/viewhelpers.c
@@ -557,6 +557,7 @@ void cViewHelpers::SetTimers(map<string,int> *intTokens, map<string,string> *str
break;
map< string, string > timerVals;
const cTimer *Timer = SortedTimers[i];
+ string isRemoteTimer = SortedTimers.IsRemoteTimer(i) ? "1" : "0";
const cEvent *event = Timer->Event();
if (event) {
timerVals.insert(pair< string, string >("timers[title]", event->Title()));
@@ -607,7 +608,8 @@ void cViewHelpers::SetTimers(map<string,int> *intTokens, map<string,string> *str
timerDate = cString::sprintf("VPS %s", *timerDate);
}
timerVals.insert(pair< string, string >("timers[datetime]", *timerDate));
-
+ timerVals.insert(pair< string, string >("timers[isremotetimer]", isRemoteTimer));
+
timers->push_back(timerVals);
}
}