mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
added Token {timers[isremotetimer]} to <timers> in main menu
This commit is contained in:
parent
495c222234
commit
25505767d3
1
HISTORY
1
HISTORY
@ -255,3 +255,4 @@ Version 0.3.3
|
|||||||
if recording is replayed. New token {islivetv} indicates this.
|
if recording is replayed. New token {islivetv} indicates this.
|
||||||
- added Token {percentseen} to listelements in menurecordings. For
|
- added Token {percentseen} to listelements in menurecordings. For
|
||||||
VDR Version < 2.1.8 {percentseen} is set to -1.
|
VDR Version < 2.1.8 {percentseen} is set to -1.
|
||||||
|
- added Token {timers[isremotetimer]} to <timers> in main menu
|
||||||
|
@ -9,6 +9,7 @@ static int CompareTimers(const void *a, const void *b) {
|
|||||||
cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector<const cTimer *>(Timers.Count()) {
|
cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector<const cTimer *>(Timers.Count()) {
|
||||||
static bool initial = true;
|
static bool initial = true;
|
||||||
static cRemoteTimerRefresh *remoteTimerRefresh = NULL;
|
static cRemoteTimerRefresh *remoteTimerRefresh = NULL;
|
||||||
|
localTimer = NULL;
|
||||||
|
|
||||||
if (forceRefresh)
|
if (forceRefresh)
|
||||||
initial = true;
|
initial = true;
|
||||||
@ -41,10 +42,43 @@ cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector<const cTim
|
|||||||
|
|
||||||
Sort(CompareTimers);
|
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))
|
if (pRemoteTimers && (remoteTimerRefresh == NULL))
|
||||||
remoteTimerRefresh = new cRemoteTimerRefresh();
|
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 cGlobalSortedTimers::NumTimerConfilicts(void) {
|
||||||
int numConflicts = 0;
|
int numConflicts = 0;
|
||||||
cPlugin *p = cPluginManager::GetPlugin("epgsearch");
|
cPlugin *p = cPluginManager::GetPlugin("epgsearch");
|
||||||
|
@ -5,8 +5,12 @@
|
|||||||
#include <vdr/plugin.h>
|
#include <vdr/plugin.h>
|
||||||
|
|
||||||
class cGlobalSortedTimers : public cVector<const cTimer *> {
|
class cGlobalSortedTimers : public cVector<const cTimer *> {
|
||||||
|
private:
|
||||||
|
bool *localTimer;
|
||||||
public:
|
public:
|
||||||
cGlobalSortedTimers(bool forceRefresh = false);
|
cGlobalSortedTimers(bool forceRefresh = false);
|
||||||
|
virtual ~cGlobalSortedTimers(void);
|
||||||
|
bool IsRemoteTimer(int i);
|
||||||
int NumTimerConfilicts(void);
|
int NumTimerConfilicts(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@
|
|||||||
{timers[channelnumber]} number of channel
|
{timers[channelnumber]} number of channel
|
||||||
{timers[channelid]} ChannelID of channel
|
{timers[channelid]} ChannelID of channel
|
||||||
{timers[channellogoexists]} true if channel logo exists
|
{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">
|
<timers detached="true" delay="100" fadetime="0">
|
||||||
<area x="0" y="75%" width="{areawidth}/8 - 5" height="25%" layer="1">
|
<area x="0" y="75%" width="{areawidth}/8 - 5" height="25%" layer="1">
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
{timers[channelnumber]} number of channel
|
{timers[channelnumber]} number of channel
|
||||||
{timers[channelid]} ChannelID of channel
|
{timers[channelid]} ChannelID of channel
|
||||||
{timers[channellogoexists]} true if channel logo exists
|
{timers[channellogoexists]} true if channel logo exists
|
||||||
|
{timers[isremotetimer]} true if timer is a remote timer from remotetimers plugin
|
||||||
-->
|
-->
|
||||||
<timers>
|
<timers>
|
||||||
</timers>
|
</timers>
|
||||||
|
@ -557,6 +557,7 @@ void cViewHelpers::SetTimers(map<string,int> *intTokens, map<string,string> *str
|
|||||||
break;
|
break;
|
||||||
map< string, string > timerVals;
|
map< string, string > timerVals;
|
||||||
const cTimer *Timer = SortedTimers[i];
|
const cTimer *Timer = SortedTimers[i];
|
||||||
|
string isRemoteTimer = SortedTimers.IsRemoteTimer(i) ? "1" : "0";
|
||||||
const cEvent *event = Timer->Event();
|
const cEvent *event = Timer->Event();
|
||||||
if (event) {
|
if (event) {
|
||||||
timerVals.insert(pair< string, string >("timers[title]", event->Title()));
|
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);
|
timerDate = cString::sprintf("VPS %s", *timerDate);
|
||||||
}
|
}
|
||||||
timerVals.insert(pair< string, string >("timers[datetime]", *timerDate));
|
timerVals.insert(pair< string, string >("timers[datetime]", *timerDate));
|
||||||
|
timerVals.insert(pair< string, string >("timers[isremotetimer]", isRemoteTimer));
|
||||||
|
|
||||||
timers->push_back(timerVals);
|
timers->push_back(timerVals);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user