added viewelement <endtime> in displayreplay to display the time the currently replayed recording ends

This commit is contained in:
louis 2015-03-31 11:53:25 +02:00
parent a0f86bdc0d
commit 43422fac91
11 changed files with 62 additions and 2 deletions

View File

@ -246,5 +246,7 @@ Version 0.3.3
- fixed bug also for loops - fixed bug also for loops
- added possibility to draw vertical text bottomum and topdown - added possibility to draw vertical text bottomum and topdown
- translate drawtextvertical - translate drawtextvertical
- added viewelement <endtime> in displayreplay to display the time
the currently replayed recording ends

View File

@ -112,7 +112,6 @@ cSkinDisplayPlugin *cSkinDesigner::DisplayPlugin(string pluginName, int viewID,
if (useBackupSkin) if (useBackupSkin)
return NULL; return NULL;
Init(); Init();
cSkinDisplayPlugin *displayPlugin = NULL;
map< string, map <int, cTemplate*> >::iterator hit = pluginTemplates.find(pluginName); map< string, map <int, cTemplate*> >::iterator hit = pluginTemplates.find(pluginName);
if (hit == pluginTemplates.end()) if (hit == pluginTemplates.end())
return NULL; return NULL;

View File

@ -27,6 +27,8 @@ cSDDisplayReplay::~cSDDisplayReplay() {
void cSDDisplayReplay::SetRecording(const cRecording *Recording) { void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
if (!doOutput || !Recording) if (!doOutput || !Recording)
return; return;
if (initial)
replayView->SetRecordingLength(Recording->LengthInSeconds());
replayView->DrawTitle(Recording); replayView->DrawTitle(Recording);
replayView->DrawRecordingInformation(Recording); replayView->DrawRecordingInformation(Recording);
replayView->DrawScraperContent(Recording); replayView->DrawScraperContent(Recording);
@ -62,6 +64,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) {
replayView->DelayOnPause(); replayView->DelayOnPause();
replayView->DrawProgressBar(Current, Total); replayView->DrawProgressBar(Current, Total);
replayView->DrawMarks(marks, Current, Total); replayView->DrawMarks(marks, Current, Total);
replayView->DrawEndTime(Current, Total);
} }
void cSDDisplayReplay::SetCurrent(const char *Current) { void cSDDisplayReplay::SetCurrent(const char *Current) {

View File

@ -4,7 +4,7 @@
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time | <!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
scrapercontent | rectitle | recinfo | currenttime | scrapercontent | rectitle | recinfo | currenttime |
totaltime | progressbar | cutmarks | controlicons | totaltime | endtime | progressbar | cutmarks | controlicons |
controliconsmodeonly | jump | message | onpause | controliconsmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*> onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay <!ATTLIST displayreplay
@ -71,6 +71,12 @@
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT endtime (area|areascroll)*>
<!ATTLIST endtime
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT progressbar (area|areascroll)*> <!ELEMENT progressbar (area|areascroll)*>
<!ATTLIST progressbar <!ATTLIST progressbar
debug CDATA #IMPLIED debug CDATA #IMPLIED

View File

@ -1606,6 +1606,7 @@ void cTemplateViewReplay::SetViewElements(void) {
viewElementsAllowed.insert("scrapercontent"); viewElementsAllowed.insert("scrapercontent");
viewElementsAllowed.insert("currenttime"); viewElementsAllowed.insert("currenttime");
viewElementsAllowed.insert("totaltime"); viewElementsAllowed.insert("totaltime");
viewElementsAllowed.insert("endtime");
viewElementsAllowed.insert("progressbar"); viewElementsAllowed.insert("progressbar");
viewElementsAllowed.insert("cutmarks"); viewElementsAllowed.insert("cutmarks");
viewElementsAllowed.insert("controlicons"); viewElementsAllowed.insert("controlicons");
@ -1641,6 +1642,9 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) {
case veRecTotal: case veRecTotal:
name = "Recording total Time"; name = "Recording total Time";
break; break;
case veRecEnd:
name = "Recording end Time";
break;
case veRecProgressBar: case veRecProgressBar:
name = "Rec Progress Bar"; name = "Rec Progress Bar";
break; break;
@ -1697,6 +1701,8 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, v
ve = veRecCurrent; ve = veRecCurrent;
} else if (!sViewElement.compare("totaltime")) { } else if (!sViewElement.compare("totaltime")) {
ve = veRecTotal; ve = veRecTotal;
} else if (!sViewElement.compare("endtime")) {
ve = veRecEnd;
} else if (!sViewElement.compare("progressbar")) { } else if (!sViewElement.compare("progressbar")) {
ve = veRecProgressBar; ve = veRecProgressBar;
} else if (!sViewElement.compare("cutmarks")) { } else if (!sViewElement.compare("cutmarks")) {

View File

@ -60,6 +60,7 @@ enum eViewElement {
veRecInfo, veRecInfo,
veRecCurrent, veRecCurrent,
veRecTotal, veRecTotal,
veRecEnd,
veRecProgressBar, veRecProgressBar,
veCuttingMarks, veCuttingMarks,
veControlIcons, veControlIcons,

View File

@ -258,6 +258,10 @@
<trans lang="en_EN">for</trans> <trans lang="en_EN">for</trans>
<trans lang="de_DE">für</trans> <trans lang="de_DE">für</trans>
</token> </token>
<token name="tr(endsat)">
<trans lang="en_EN">ends at</trans>
<trans lang="de_DE">endet um</trans>
</token>
</translations> </translations>
<!-- <!--
The three Fonts FontOSD, FontFix and FontSml configured in VDR The three Fonts FontOSD, FontFix and FontSml configured in VDR

View File

@ -119,6 +119,14 @@
</area> </area>
</totaltime> </totaltime>
<!-- Available Variables endtime:
{recend} End Time in hh:mm
-->
<endtime>
<area x="63%" y="92%" width="20%" height="7%" layer="2">
<drawtext align="center" valign="bottom" font="{light}" fontsize="60%" color="{clrWhite}" text="{tr(endsat)}: {recend}" />
</area>
</endtime>
<!-- Available Variables progressbar: <!-- Available Variables progressbar:
{current} current frame of recording {current} current frame of recording
{total} total frames of recording {total} total frames of recording

View File

@ -74,6 +74,12 @@
<totaltime> <totaltime>
</totaltime> </totaltime>
<!-- Available Variables endtime:
{recend} End Time in hh:mm
-->
<endtime>
</endtime>
<!-- Available Variables progressbar: <!-- Available Variables progressbar:
{current} current frame of recording {current} current frame of recording
{total} total frames of recording {total} total frames of recording

View File

@ -5,6 +5,8 @@
#include "../libcore/helpers.h" #include "../libcore/helpers.h"
cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) { cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) {
length = 0;
endLast = "";
onPauseView = NULL; onPauseView = NULL;
numMarksLast = 0; numMarksLast = 0;
lastMarks = NULL; lastMarks = NULL;
@ -226,6 +228,25 @@ void cDisplayReplayView::DrawTotal(const char *total) {
DrawViewElement(veRecTotal, &stringTokens, &intTokens); 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) { void cDisplayReplayView::DrawProgressBar(int current, int total) {
map < string, string > stringTokens; map < string, string > stringTokens;
map < string, int > intTokens; map < string, int > intTokens;

View File

@ -7,6 +7,8 @@
class cDisplayReplayView : public cView, public cViewHelpers { class cDisplayReplayView : public cView, public cViewHelpers {
private: private:
int length;
string endLast;
cDisplayReplayOnPauseView *onPauseView; cDisplayReplayOnPauseView *onPauseView;
int numMarksLast; int numMarksLast;
int *lastMarks; int *lastMarks;
@ -18,6 +20,7 @@ public:
cDisplayReplayView(cTemplateView *tmplView); cDisplayReplayView(cTemplateView *tmplView);
virtual ~cDisplayReplayView(); virtual ~cDisplayReplayView();
bool createOsd(void); bool createOsd(void);
void SetRecordingLength(int length) { this->length = length; };
void DrawBackground(bool modeOnly); void DrawBackground(bool modeOnly);
void DrawDate(void); void DrawDate(void);
void DrawTime(void); void DrawTime(void);
@ -27,6 +30,7 @@ public:
void DrawScraperContent(const cRecording *recording); void DrawScraperContent(const cRecording *recording);
void DrawCurrent(const char *current); void DrawCurrent(const char *current);
void DrawTotal(const char *total); void DrawTotal(const char *total);
void DrawEndTime(int current, int total);
void DrawProgressBar(int current, int total); void DrawProgressBar(int current, int total);
void DrawMarks(const cMarks *marks, int current, int total); void DrawMarks(const cMarks *marks, int current, int total);
void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly); void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);