mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
added viewelement <endtime> in displayreplay to display the time the currently replayed recording ends
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include "../libcore/helpers.h"
|
||||
|
||||
cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) {
|
||||
length = 0;
|
||||
endLast = "";
|
||||
onPauseView = NULL;
|
||||
numMarksLast = 0;
|
||||
lastMarks = NULL;
|
||||
@@ -226,6 +228,25 @@ void cDisplayReplayView::DrawTotal(const char *total) {
|
||||
DrawViewElement(veRecTotal, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
void cDisplayReplayView::DrawEndTime(int current, int total) {
|
||||
if (!current)
|
||||
return;
|
||||
double rest = (double)(total - current) / (double)total;
|
||||
time_t end = time(0) + rest*length;
|
||||
string endTime = *TimeString(end);
|
||||
if (!endTime.compare(endLast)) {
|
||||
return;
|
||||
}
|
||||
endLast = endTime;
|
||||
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
stringTokens.insert(pair<string,string>("recend", endTime));
|
||||
|
||||
ClearViewElement(veRecEnd);
|
||||
DrawViewElement(veRecEnd, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
void cDisplayReplayView::DrawProgressBar(int current, int total) {
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
|
@@ -7,6 +7,8 @@
|
||||
|
||||
class cDisplayReplayView : public cView, public cViewHelpers {
|
||||
private:
|
||||
int length;
|
||||
string endLast;
|
||||
cDisplayReplayOnPauseView *onPauseView;
|
||||
int numMarksLast;
|
||||
int *lastMarks;
|
||||
@@ -18,6 +20,7 @@ public:
|
||||
cDisplayReplayView(cTemplateView *tmplView);
|
||||
virtual ~cDisplayReplayView();
|
||||
bool createOsd(void);
|
||||
void SetRecordingLength(int length) { this->length = length; };
|
||||
void DrawBackground(bool modeOnly);
|
||||
void DrawDate(void);
|
||||
void DrawTime(void);
|
||||
@@ -27,6 +30,7 @@ public:
|
||||
void DrawScraperContent(const cRecording *recording);
|
||||
void DrawCurrent(const char *current);
|
||||
void DrawTotal(const char *total);
|
||||
void DrawEndTime(int current, int total);
|
||||
void DrawProgressBar(int current, int total);
|
||||
void DrawMarks(const cMarks *marks, int current, int total);
|
||||
void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);
|
||||
|
Reference in New Issue
Block a user