added Token {timers[isremotetimer]} to <timers> in main menu

This commit is contained in:
louis 2015-04-01 11:21:00 +02:00
parent 495c222234
commit 25505767d3
6 changed files with 44 additions and 1 deletions

View File

@ -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

View File

@ -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");

View File

@ -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);
};

View File

@ -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">

View File

@ -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>

View File

@ -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);
}
}