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 @@ - - - @@ -58,6 +55,10 @@ + + + + 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 @@ - @@ -47,6 +46,9 @@ + + + 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 -->