diff options
| author | louis <louis.braun@gmx.de> | 2015-03-31 11:53:25 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2015-03-31 11:53:25 +0200 |
| commit | 43422fac91d7c67d1cb69e2add4abce49e89ca90 (patch) | |
| tree | 9cfc5ed0efb1f7c45c5ed21640171942e0f2c95d | |
| parent | a0f86bdc0d4e61338ede7ebd53da56563f2998bf (diff) | |
| download | vdr-plugin-skindesigner-43422fac91d7c67d1cb69e2add4abce49e89ca90.tar.gz vdr-plugin-skindesigner-43422fac91d7c67d1cb69e2add4abce49e89ca90.tar.bz2 | |
added viewelement <endtime> in displayreplay to display the time the currently replayed recording ends
| -rw-r--r-- | HISTORY | 2 | ||||
| -rw-r--r-- | designer.c | 1 | ||||
| -rw-r--r-- | displayreplay.c | 3 | ||||
| -rw-r--r-- | dtd/displayreplay.dtd | 8 | ||||
| -rw-r--r-- | libtemplate/templateview.c | 6 | ||||
| -rw-r--r-- | libtemplate/templateviewelement.h | 1 | ||||
| -rw-r--r-- | skins/metrixhd/globals.xml | 4 | ||||
| -rw-r--r-- | skins/metrixhd/xmlfiles/displayreplay.xml | 8 | ||||
| -rw-r--r-- | skinskeleton/xmlfiles/displayreplay.xml | 6 | ||||
| -rw-r--r-- | views/displayreplayview.c | 21 | ||||
| -rw-r--r-- | views/displayreplayview.h | 4 |
11 files changed, 62 insertions, 2 deletions
@@ -246,5 +246,7 @@ Version 0.3.3 - fixed bug also for loops - added possibility to draw vertical text bottomum and topdown - translate drawtextvertical +- added viewelement <endtime> in displayreplay to display the time + the currently replayed recording ends @@ -112,7 +112,6 @@ cSkinDisplayPlugin *cSkinDesigner::DisplayPlugin(string pluginName, int viewID, if (useBackupSkin) return NULL; Init(); - cSkinDisplayPlugin *displayPlugin = NULL; map< string, map <int, cTemplate*> >::iterator hit = pluginTemplates.find(pluginName); if (hit == pluginTemplates.end()) return NULL; diff --git a/displayreplay.c b/displayreplay.c index f82f1cc..4080407 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -27,6 +27,8 @@ cSDDisplayReplay::~cSDDisplayReplay() { void cSDDisplayReplay::SetRecording(const cRecording *Recording) { if (!doOutput || !Recording) return; + if (initial) + replayView->SetRecordingLength(Recording->LengthInSeconds()); replayView->DrawTitle(Recording); replayView->DrawRecordingInformation(Recording); replayView->DrawScraperContent(Recording); @@ -62,6 +64,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) { replayView->DelayOnPause(); replayView->DrawProgressBar(Current, Total); replayView->DrawMarks(marks, Current, Total); + replayView->DrawEndTime(Current, Total); } void cSDDisplayReplay::SetCurrent(const char *Current) { diff --git a/dtd/displayreplay.dtd b/dtd/displayreplay.dtd index bb52937..217df11 100644 --- a/dtd/displayreplay.dtd +++ b/dtd/displayreplay.dtd @@ -4,7 +4,7 @@ <!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
scrapercontent | rectitle | recinfo | currenttime |
- totaltime | progressbar | cutmarks | controlicons |
+ totaltime | endtime | progressbar | cutmarks | controlicons |
controliconsmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay
@@ -71,6 +71,12 @@ condition CDATA #IMPLIED
>
+<!ELEMENT endtime (area|areascroll)*>
+<!ATTLIST endtime
+ debug CDATA #IMPLIED
+ condition CDATA #IMPLIED
+>
+
<!ELEMENT progressbar (area|areascroll)*>
<!ATTLIST progressbar
debug CDATA #IMPLIED
diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c index d475b2d..380c965 100644 --- a/libtemplate/templateview.c +++ b/libtemplate/templateview.c @@ -1606,6 +1606,7 @@ void cTemplateViewReplay::SetViewElements(void) { viewElementsAllowed.insert("scrapercontent"); viewElementsAllowed.insert("currenttime"); viewElementsAllowed.insert("totaltime"); + viewElementsAllowed.insert("endtime"); viewElementsAllowed.insert("progressbar"); viewElementsAllowed.insert("cutmarks"); viewElementsAllowed.insert("controlicons"); @@ -1641,6 +1642,9 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) { case veRecTotal: name = "Recording total Time"; break; + case veRecEnd: + name = "Recording end Time"; + break; case veRecProgressBar: name = "Rec Progress Bar"; break; @@ -1697,6 +1701,8 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, v ve = veRecCurrent; } else if (!sViewElement.compare("totaltime")) { ve = veRecTotal; + } else if (!sViewElement.compare("endtime")) { + ve = veRecEnd; } else if (!sViewElement.compare("progressbar")) { ve = veRecProgressBar; } else if (!sViewElement.compare("cutmarks")) { diff --git a/libtemplate/templateviewelement.h b/libtemplate/templateviewelement.h index 6f1adcc..6d3b921 100644 --- a/libtemplate/templateviewelement.h +++ b/libtemplate/templateviewelement.h @@ -60,6 +60,7 @@ enum eViewElement { veRecInfo,
veRecCurrent,
veRecTotal,
+ veRecEnd,
veRecProgressBar,
veCuttingMarks,
veControlIcons,
diff --git a/skins/metrixhd/globals.xml b/skins/metrixhd/globals.xml index 1b2386c..bc22e4c 100644 --- a/skins/metrixhd/globals.xml +++ b/skins/metrixhd/globals.xml @@ -258,6 +258,10 @@ <trans lang="en_EN">for</trans> <trans lang="de_DE">für</trans> </token> + <token name="tr(endsat)"> + <trans lang="en_EN">ends at</trans> + <trans lang="de_DE">endet um</trans> + </token> </translations> <!-- The three Fonts FontOSD, FontFix and FontSml configured in VDR diff --git a/skins/metrixhd/xmlfiles/displayreplay.xml b/skins/metrixhd/xmlfiles/displayreplay.xml index 8853fad..6f92b74 100644 --- a/skins/metrixhd/xmlfiles/displayreplay.xml +++ b/skins/metrixhd/xmlfiles/displayreplay.xml @@ -119,6 +119,14 @@ </area> </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: {current} current frame of recording {total} total frames of recording diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index 8cef153..19ad6a2 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -74,6 +74,12 @@ <totaltime> </totaltime> + <!-- Available Variables endtime: + {recend} End Time in hh:mm + --> + <endtime> + </endtime> + <!-- Available Variables progressbar: {current} current frame of recording {total} total frames of recording diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 90b49ba..690eb96 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -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; diff --git a/views/displayreplayview.h b/views/displayreplayview.h index 77c2eb4..3b7c3e9 100644 --- a/views/displayreplayview.h +++ b/views/displayreplayview.h @@ -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); |
