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 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(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); }; 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 --> 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 --> 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 *intTokens, map *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 *intTokens, map *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); } }