added customtokens view element in displayreplay

This commit is contained in:
louis 2015-01-06 06:23:36 +01:00
parent acd552d5f3
commit 0bcdb0f386
7 changed files with 38 additions and 2 deletions

View File

@ -122,7 +122,8 @@ Version 0.1.1
- added "temperatures" view element in displaymenumainview to display
cpu and gpu temperature in main menu (scripts to get temperatures
borrowed from skinflatplus)
borrowed from skinflatplus). scripts to get temperatures have to be
adapted according the system setup.
- added "time" view element in displaychannelview, displayreplay view
and displaymenuviews to display current time with seconds precision
- added {currenttab}, {prevtab}, {nexttab} Tokens in <tablabels> view
@ -131,5 +132,6 @@ Version 0.1.1
correctly
- fixed some minor bugs
- added skin "blackhole"
- added customtokens view element in displayreplay
Version 0.1.2

View File

@ -81,7 +81,9 @@ void cSDDisplayReplay::Flush(void) {
replayView->DrawDate();
replayView->DrawTime();
}
if (initial) {
replayView->DrawCustomTokens();
replayView->DoFadeIn();
initial = false;
} else {

View File

@ -5,7 +5,8 @@
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
scrapercontent | rectitle | recinfo | currenttime |
totaltime | progressbar | cutmarks | controlicons |
controliconsmodeonly | jump | message | onpause | onpausemodeonly)*>
controliconsmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay
x CDATA #REQUIRED
y CDATA #REQUIRED
@ -107,4 +108,9 @@
fadetime CDATA #IMPLIED
>
<!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens
debug CDATA #IMPLIED
>
%functions;

View File

@ -1429,6 +1429,7 @@ void cTemplateViewReplay::SetViewElements(void) {
viewElementsAllowed.insert("message");
viewElementsAllowed.insert("onpause");
viewElementsAllowed.insert("onpausemodeonly");
viewElementsAllowed.insert("customtokens");
}
string cTemplateViewReplay::GetViewElementName(eViewElement ve) {
@ -1482,6 +1483,9 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) {
case veOnPauseModeOnly:
name = "On Pause Mode Only";
break;
case veCustomTokens:
name = "Custom Tokens";
break;
default:
name = "Unknown";
break;
@ -1526,6 +1530,8 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, v
ve = veOnPause;
} else if (!sViewElement.compare("onpausemodeonly")) {
ve = veOnPauseModeOnly;
} else if (!sViewElement.compare("customtokens")) {
ve = veCustomTokens;
}
if (ve == veUndefined) {

View File

@ -241,4 +241,12 @@
<onpausemodeonly delay="30" fadetime="0">
</onpausemodeonly>
<!-- Available Variables customtokens:
all custom tokens set by the svdrp command SCTK are available in this viewelement
For instance, use an appropriate script which runs periodically as cronjob and
sets these custom tokens with svdrpsend or dbus2vdr
-->
<customtokens>
</customtokens>
</displayreplay>

View File

@ -379,6 +379,17 @@ void cDisplayReplayView::ClearOnPause(void) {
}
}
void cDisplayReplayView::DrawCustomTokens(void) {
if (!ViewElementImplemented(veCustomTokens)) {
return;
}
if (!tmplView)
return;
map < string, string > stringTokens = tmplView->GetCustomStringTokens();
map < string, int > intTokens = tmplView->GetCustomIntTokens();
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
}
/****************************************************************************************
* Private Functions
*****************************************************************************************/

View File

@ -33,6 +33,7 @@ public:
void DrawMessage(eMessageType type, const char *text);
void DrawOnPause(bool modeOnly);
void ClearOnPause(void);
void DrawCustomTokens(void);
void DoFadeIn(void) { Start(); };
void Flush(void) { DoFlush(); };
};