mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
added progressmodeonly viewelement in displayreplay
This commit is contained in:
parent
d9c5219f43
commit
6e0f56e56c
3
HISTORY
3
HISTORY
@ -397,3 +397,6 @@ Version 0.6.1
|
|||||||
- added version check for skinrepositiries
|
- added version check for skinrepositiries
|
||||||
|
|
||||||
Version 0.6.2
|
Version 0.6.2
|
||||||
|
|
||||||
|
- added progressmodeonly viewelement in displayreplay
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
|
|||||||
} else {
|
} else {
|
||||||
replayView->ClearOnPause();
|
replayView->ClearOnPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
replayView->DrawControlIcons(Play, Forward, Speed, modeOnly);
|
replayView->DrawControlIcons(Play, Forward, Speed, modeOnly);
|
||||||
initialModeSet = true;
|
initialModeSet = true;
|
||||||
}
|
}
|
||||||
@ -103,7 +104,16 @@ void cSDDisplayReplay::Flush(void) {
|
|||||||
replayView->DrawDate();
|
replayView->DrawDate();
|
||||||
replayView->DrawTime();
|
replayView->DrawTime();
|
||||||
}
|
}
|
||||||
|
if (modeOnly) {
|
||||||
|
cControl *control = cControl::Control();
|
||||||
|
if (control) {
|
||||||
|
double fps = control->FramesPerSecond();
|
||||||
|
int current = 0;
|
||||||
|
int total = 0;
|
||||||
|
if (control->GetIndex(current, total))
|
||||||
|
replayView->DrawProgressModeOnly(fps, current, total);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (initial && initialModeSet) {
|
if (initial && initialModeSet) {
|
||||||
replayView->DrawBackground(modeOnly);
|
replayView->DrawBackground(modeOnly);
|
||||||
replayView->DrawCustomTokens();
|
replayView->DrawCustomTokens();
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
|
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
|
||||||
scrapercontent | rectitle | recinfo | currenttime |
|
scrapercontent | rectitle | recinfo | currenttime |
|
||||||
totaltime | endtime | progressbar | cutmarks | controlicons |
|
totaltime | endtime | progressbar | cutmarks | controlicons |
|
||||||
controliconsmodeonly | jump | message | onpause |
|
controliconsmodeonly | progressmodeonly | jump | message | onpause |
|
||||||
onpausemodeonly | customtokens)*>
|
onpausemodeonly | customtokens)*>
|
||||||
<!ATTLIST displayreplay
|
<!ATTLIST displayreplay
|
||||||
x CDATA #REQUIRED
|
x CDATA #REQUIRED
|
||||||
@ -115,6 +115,12 @@
|
|||||||
condition CDATA #IMPLIED
|
condition CDATA #IMPLIED
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<!ELEMENT progressmodeonly (areacontainer|area|areascroll)*>
|
||||||
|
<!ATTLIST progressmodeonly
|
||||||
|
debug CDATA #IMPLIED
|
||||||
|
condition CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
<!ELEMENT jump (areacontainer|area|areascroll)*>
|
<!ELEMENT jump (areacontainer|area|areascroll)*>
|
||||||
<!ATTLIST jump
|
<!ATTLIST jump
|
||||||
debug CDATA #IMPLIED
|
debug CDATA #IMPLIED
|
||||||
|
@ -213,6 +213,19 @@ void cStopWatch::Stop(const char* message) {
|
|||||||
dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start));
|
dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string GetTimeString(int seconds) {
|
||||||
|
time_t sec(seconds);
|
||||||
|
tm *p = gmtime(&sec);
|
||||||
|
int hours = p->tm_hour;
|
||||||
|
int mins = p->tm_min;
|
||||||
|
int secs = p->tm_sec;
|
||||||
|
if (hours > 0) {
|
||||||
|
return *cString::sprintf("%d:%02d:%02d", hours, mins, secs);
|
||||||
|
}
|
||||||
|
return *cString::sprintf("%02d:%02d", mins, secs);;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//View Helpers
|
//View Helpers
|
||||||
string GetScreenResolutionString(int width, int height, bool *isHD) {
|
string GetScreenResolutionString(int width, int height, bool *isHD) {
|
||||||
string name = "";
|
string name = "";
|
||||||
|
@ -41,6 +41,8 @@ public:
|
|||||||
void Stop(const char* message);
|
void Stop(const char* message);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string GetTimeString(int seconds);
|
||||||
|
|
||||||
string GetScreenResolutionString(int width, int height, bool *isHD);
|
string GetScreenResolutionString(int width, int height, bool *isHD);
|
||||||
string GetScreenAspectString(double aspect, bool *isWideScreen);
|
string GetScreenAspectString(double aspect, bool *isWideScreen);
|
||||||
|
|
||||||
|
@ -1739,6 +1739,7 @@ void cTemplateViewReplay::SetViewElements(void) {
|
|||||||
viewElementsAllowed.insert("cutmarks");
|
viewElementsAllowed.insert("cutmarks");
|
||||||
viewElementsAllowed.insert("controlicons");
|
viewElementsAllowed.insert("controlicons");
|
||||||
viewElementsAllowed.insert("controliconsmodeonly");
|
viewElementsAllowed.insert("controliconsmodeonly");
|
||||||
|
viewElementsAllowed.insert("progressmodeonly");
|
||||||
viewElementsAllowed.insert("jump");
|
viewElementsAllowed.insert("jump");
|
||||||
viewElementsAllowed.insert("message");
|
viewElementsAllowed.insert("message");
|
||||||
viewElementsAllowed.insert("onpause");
|
viewElementsAllowed.insert("onpause");
|
||||||
@ -1785,6 +1786,9 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) {
|
|||||||
case veControlIconsModeOnly:
|
case veControlIconsModeOnly:
|
||||||
name = "Control Icons Mode only";
|
name = "Control Icons Mode only";
|
||||||
break;
|
break;
|
||||||
|
case veProgressModeOnly:
|
||||||
|
name = "Progress Mode only";
|
||||||
|
break;
|
||||||
case veBackgroundModeOnly:
|
case veBackgroundModeOnly:
|
||||||
name = "Background Mode only";
|
name = "Background Mode only";
|
||||||
break;
|
break;
|
||||||
@ -1839,6 +1843,8 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmapNode *pi
|
|||||||
ve = veControlIcons;
|
ve = veControlIcons;
|
||||||
} else if (!sViewElement.compare("controliconsmodeonly")) {
|
} else if (!sViewElement.compare("controliconsmodeonly")) {
|
||||||
ve = veControlIconsModeOnly;
|
ve = veControlIconsModeOnly;
|
||||||
|
} else if (!sViewElement.compare("progressmodeonly")) {
|
||||||
|
ve = veProgressModeOnly;
|
||||||
} else if (!sViewElement.compare("backgroundmodeonly")) {
|
} else if (!sViewElement.compare("backgroundmodeonly")) {
|
||||||
ve = veBackgroundModeOnly;
|
ve = veBackgroundModeOnly;
|
||||||
} else if (!sViewElement.compare("jump")) {
|
} else if (!sViewElement.compare("jump")) {
|
||||||
|
@ -68,6 +68,7 @@ enum eViewElement {
|
|||||||
veCuttingMarks,
|
veCuttingMarks,
|
||||||
veControlIcons,
|
veControlIcons,
|
||||||
veControlIconsModeOnly,
|
veControlIconsModeOnly,
|
||||||
|
veProgressModeOnly,
|
||||||
veBackgroundModeOnly,
|
veBackgroundModeOnly,
|
||||||
veRecJump,
|
veRecJump,
|
||||||
veOnPause,
|
veOnPause,
|
||||||
|
@ -122,11 +122,21 @@
|
|||||||
<controliconsmodeonly>
|
<controliconsmodeonly>
|
||||||
</controliconsmodeonly>
|
</controliconsmodeonly>
|
||||||
|
|
||||||
|
<!-- Available Variables progressmodeonly:
|
||||||
|
{current} current frame of recording
|
||||||
|
{total} total frames of recording
|
||||||
|
{timecurrent} current time in hh:mm:ss or mm:ss if shorter that one hour
|
||||||
|
{timetotal} total time in hh:mm:ss or mm:ss if shorter that one hour
|
||||||
|
-->
|
||||||
|
<progressmodeonly>
|
||||||
|
</progressmodeonly>
|
||||||
|
|
||||||
<!-- Available Variables jump:
|
<!-- Available Variables jump:
|
||||||
{jump} time to jump to in hh:mm
|
{jump} time to jump to in hh:mm
|
||||||
-->
|
-->
|
||||||
<jump>
|
<jump>
|
||||||
</jump>
|
</jump>
|
||||||
|
|
||||||
<!-- Available Variables message:
|
<!-- Available Variables message:
|
||||||
{text} message text
|
{text} message text
|
||||||
{status} true if message is a status message
|
{status} true if message is a status message
|
||||||
|
@ -349,6 +349,20 @@ void cDisplayReplayView::DrawControlIcons(bool play, bool forward, int speed, bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cDisplayReplayView::DrawProgressModeOnly(double fps, int current, int total) {
|
||||||
|
string cur = GetTimeString((double)current / fps);
|
||||||
|
string tot = GetTimeString((double)total / fps);
|
||||||
|
map < string, string > stringTokens;
|
||||||
|
map < string, int > intTokens;
|
||||||
|
intTokens.insert(pair<string,int>("current", current));
|
||||||
|
intTokens.insert(pair<string,int>("total", total));
|
||||||
|
stringTokens.insert(pair<string,string>("timecurrent", cur));
|
||||||
|
stringTokens.insert(pair<string,string>("timetotal", tot));
|
||||||
|
ClearViewElement(veProgressModeOnly);
|
||||||
|
DrawViewElement(veProgressModeOnly, &stringTokens, &intTokens);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void cDisplayReplayView::DrawJump(const char *jump) {
|
void cDisplayReplayView::DrawJump(const char *jump) {
|
||||||
if (!jump) {
|
if (!jump) {
|
||||||
ClearViewElement(veRecJump);
|
ClearViewElement(veRecJump);
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
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);
|
||||||
|
void DrawProgressModeOnly(double fps, int current, int total);
|
||||||
void DrawJump(const char *jump);
|
void DrawJump(const char *jump);
|
||||||
void DrawMessage(eMessageType type, const char *text);
|
void DrawMessage(eMessageType type, const char *text);
|
||||||
void DrawOnPause(string recFileName, bool modeOnly);
|
void DrawOnPause(string recFileName, bool modeOnly);
|
||||||
|
Loading…
Reference in New Issue
Block a user