mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
An error with the remaining time in the channel display has been fixed
The remaining time in the channel display wasn't updated. A new token "currentremaining" was introduced in the Progressbar section of displaychannel.xml.
This commit is contained in:
@@ -433,6 +433,7 @@ enum class eDCProgressBarIT {
|
||||
remaining,
|
||||
permashift,
|
||||
livebuffer,
|
||||
currentremaining,
|
||||
count
|
||||
};
|
||||
|
||||
|
@@ -216,16 +216,19 @@ void cVeDcProgressBar::SetTokenContainer(void) {
|
||||
tokenContainer->DefineIntToken("{remaining}", (int)eDCProgressBarIT::remaining);
|
||||
tokenContainer->DefineIntToken("{permashift}", (int)eDCProgressBarIT::permashift);
|
||||
tokenContainer->DefineIntToken("{livebuffer}", (int)eDCProgressBarIT::livebuffer);
|
||||
tokenContainer->DefineIntToken("{currentremaining}", (int)eDCProgressBarIT::currentremaining);
|
||||
InheritTokenContainer();
|
||||
}
|
||||
|
||||
void cVeDcProgressBar::Set(const cEvent *p) {
|
||||
if (!p) {
|
||||
startTime = -1;
|
||||
endTime = -1;
|
||||
duration = -1;
|
||||
return;
|
||||
}
|
||||
startTime = p->StartTime();
|
||||
endTime = p-> EndTime();
|
||||
duration = p->Duration();
|
||||
|
||||
int current = 0;
|
||||
@@ -249,18 +252,24 @@ void cVeDcProgressBar::Set(const cEvent *p) {
|
||||
} else {
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0);
|
||||
}
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60));
|
||||
}
|
||||
|
||||
bool cVeDcProgressBar::Parse(bool force) {
|
||||
if (!cViewElement::Parse(force))
|
||||
return false;
|
||||
|
||||
int current = 0;
|
||||
time_t t = time(NULL);
|
||||
if (t > startTime)
|
||||
current = t - startTime;
|
||||
|
||||
if (!(current > currentLast + 3) && !force && !Dirty())
|
||||
return false;
|
||||
|
||||
currentLast = current;
|
||||
SetDirty();
|
||||
|
||||
if (duration <= 0) {
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::duration, 0);
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::elapsed, 0);
|
||||
@@ -276,6 +285,7 @@ bool cVeDcProgressBar::Parse(bool force) {
|
||||
} else {
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0);
|
||||
}
|
||||
tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -51,6 +51,7 @@ class cVeDcProgressBar : public cViewElement {
|
||||
private:
|
||||
int currentLast;
|
||||
int startTime;
|
||||
int endTime;
|
||||
int duration;
|
||||
int GetLiveBuffer(void);
|
||||
public:
|
||||
@@ -199,4 +200,4 @@ public:
|
||||
cVeDcGroupChannelListDetail(void) {};
|
||||
virtual ~cVeDcGroupChannelListDetail(void) {};
|
||||
};
|
||||
#endif //__VIEWELEMENTSDC_H
|
||||
#endif //__VIEWELEMENTSDC_H
|
||||
|
Reference in New Issue
Block a user