summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-10 13:33:54 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-11 17:34:23 +0100
commit538d59ca4e83733c6e0b35c21a65d3efe198d176 (patch)
tree851d3e8b659677b7f87ad1ac0bd1ea0e4c0bcd5b
parent78d424d2562350d77bbbce00910b2e4a01483bbe (diff)
downloadvdr-plugin-skindesigner-538d59ca4e83733c6e0b35c21a65d3efe198d176.tar.gz
vdr-plugin-skindesigner-538d59ca4e83733c6e0b35c21a65d3efe198d176.tar.bz2
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.
-rw-r--r--coreengine/definitions.h1
-rw-r--r--coreengine/viewelementsdisplaychannel.c10
-rw-r--r--coreengine/viewelementsdisplaychannel.h3
-rw-r--r--skins/estuary4vdr/xmlfiles/displaychannel.xml7
-rw-r--r--skins/metrixhd/xmlfiles/displaychannel.xml4
-rw-r--r--skinskeleton/xmlfiles/displaychannel.xml3
6 files changed, 22 insertions, 6 deletions
diff --git a/coreengine/definitions.h b/coreengine/definitions.h
index a995907..b7a3022 100644
--- a/coreengine/definitions.h
+++ b/coreengine/definitions.h
@@ -433,6 +433,7 @@ enum class eDCProgressBarIT {
remaining,
permashift,
livebuffer,
+ currentremaining,
count
};
diff --git a/coreengine/viewelementsdisplaychannel.c b/coreengine/viewelementsdisplaychannel.c
index 4b71970..9a307a7 100644
--- a/coreengine/viewelementsdisplaychannel.c
+++ b/coreengine/viewelementsdisplaychannel.c
@@ -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;
}
diff --git a/coreengine/viewelementsdisplaychannel.h b/coreengine/viewelementsdisplaychannel.h
index b1a7691..fbae6d2 100644
--- a/coreengine/viewelementsdisplaychannel.h
+++ b/coreengine/viewelementsdisplaychannel.h
@@ -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 \ No newline at end of file
+#endif //__VIEWELEMENTSDC_H
diff --git a/skins/estuary4vdr/xmlfiles/displaychannel.xml b/skins/estuary4vdr/xmlfiles/displaychannel.xml
index cdc9c10..e38773d 100644
--- a/skins/estuary4vdr/xmlfiles/displaychannel.xml
+++ b/skins/estuary4vdr/xmlfiles/displaychannel.xml
@@ -37,9 +37,6 @@
<drawtext condition="isset{currentsubtitle}" x="0" y="{areaheight}*{epgsubtextposy}/100" fontsize="{areaheight}*{epgsubtextfontsize}/100" width="{areawidth} - {width(startstop)} - 10" font="{regular}" color="{fontdefault}" text="{currentsubtitle}" />
<drawtext condition="empty{currentsubtitle}" x="0" valign="center" fontsize="{areaheight}*{epgtextfontsizelarge}/100" width="{areawidth} - {width(startstop)} - 10" font="{regular}" color="{fontdefault}" text="{currenttitle}" />
</area>
- <area x="70%" y="83%" width="10%" height="3%" layer="2">
- <drawtext align="right" y="0" fontsize="100%" font="{regular}" color="{fontactive}" text="+{currentremaining} min" />
- </area>
<!-- next schedule -->
<area x="20%" y="88%" width="60%" height="10%" layer="2">
<drawtext name="startstop" align="right" valign="center" fontsize="{areaheight}*{startstopfontsize}/100" font="{bold}" color="{fontdefault}" text="{nextstart} - {nextstop}" />
@@ -58,6 +55,10 @@
<drawrectangle condition="{permashift}" x="{elapsed}/{duration}*{areawidth} - {livebuffer}/{duration}*{areawidth}" y="0" width="{livebuffer}/{duration}*{areawidth}" height="100%" color="{progressbartimeshift}" />
<drawrectangle condition="{permashift}" x="0" y="{areaheight}*0.2" width="{areawidth}*{elapsed}/{duration} - 1" height="{areaheight}*0.6" color="{progressbar}" />
</area>
+ <!-- time remaining -->
+ <area x="70%" y="83%" width="10%" height="3%" layer="2">
+ <drawtext align="right" y="0" fontsize="100%" font="{regular}" color="{fontactive}" text="+{currentremaining} min" />
+ </area>
</progressbar>
<statusinfo>
diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml
index a057b88..b2466c4 100644
--- a/skins/metrixhd/xmlfiles/displaychannel.xml
+++ b/skins/metrixhd/xmlfiles/displaychannel.xml
@@ -28,7 +28,6 @@
<area x="22%" y="80%" width="76%" height="7%" layer="2">
<drawtext name="title" x="0" valign="center" font="{light}" fontsize="99%" color="{fontdefault}" text="{currenttitle}" width="{areawidth} - {width(startstop)}"/>
<drawtext name="startstop" align="right" y="0" font="{light}" fontsize="60%" color="{fontdefault}" text="{currentstart} - {currentstop}" />
- <drawtext align="right" y="45%" font="{light}" fontsize="60%" color="{fontdefault}" text="+ {currentremaining} min" />
</area>
<area x="22%" y="87%" width="76%" height="7%" layer="2">
<drawtext x="0" valign="center" font="{light}" fontsize="80%" color="{fontdefault}" text="{nexttitle}" width="{areawidth} - {width(startstop)}"/>
@@ -47,6 +46,9 @@
<drawrectangle x="{elapsed}/{duration}*{areawidth} - {livebuffer}/{duration}*{areawidth}" y="0" width="{livebuffer}/{duration}*{areawidth}" height="5" color="{clrRed}" />
<drawrectangle x="0" y="1" width="{elapsed}/{duration}*{areawidth}" height="3" color="{menuheader}" />
</area>
+ <area x="22%" y="80%" width="76%" height="7%" layer="2">
+ <drawtext align="right" y="45%" font="{light}" fontsize="60%" color="{fontdefault}" text="+ {currentremaining} min" />
+ </area>
</progressbar>
<statusinfo>
diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml
index 393a30e..ab2872f 100644
--- a/skinskeleton/xmlfiles/displaychannel.xml
+++ b/skinskeleton/xmlfiles/displaychannel.xml
@@ -25,7 +25,7 @@
{currentdurationhours} Duration, full hours
{currentdurationminutes} Duration, rest of minutes
{currentelapsed} Elapsed time of current Schedule in min
- {currentremaining} Remaining time of current Schedule in min
+ {currentremaining} Remaining time of current Schedule in min -> DEPRECATED, it doesn't work as expected
{currentrecording} true if current Schedule is recorded
{hasVPS} true if current Schedule has VPS
{nexttitle} Title of next Schedule
@@ -48,6 +48,7 @@
{remaining} Remaining time of current Schedule in seconds
{permashift} true if permashift plugin is in use
{livebuffer} current buffered data in seconds
+ {currentremaining} Remaining time of current Schedule in min
-->
<progressbar>
</progressbar>