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 - added "temperatures" view element in displaymenumainview to display
cpu and gpu temperature in main menu (scripts to get temperatures 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 - added "time" view element in displaychannelview, displayreplay view
and displaymenuviews to display current time with seconds precision and displaymenuviews to display current time with seconds precision
- added {currenttab}, {prevtab}, {nexttab} Tokens in <tablabels> view - added {currenttab}, {prevtab}, {nexttab} Tokens in <tablabels> view
@ -131,5 +132,6 @@ Version 0.1.1
correctly correctly
- fixed some minor bugs - fixed some minor bugs
- added skin "blackhole" - added skin "blackhole"
- added customtokens view element in displayreplay
Version 0.1.2 Version 0.1.2

View File

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

View File

@ -5,7 +5,8 @@
<!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 | progressbar | cutmarks | controlicons |
controliconsmodeonly | jump | message | onpause | onpausemodeonly)*> controliconsmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay <!ATTLIST displayreplay
x CDATA #REQUIRED x CDATA #REQUIRED
y CDATA #REQUIRED y CDATA #REQUIRED
@ -107,4 +108,9 @@
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
> >
<!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens
debug CDATA #IMPLIED
>
%functions; %functions;

View File

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

View File

@ -241,4 +241,12 @@
<onpausemodeonly delay="30" fadetime="0"> <onpausemodeonly delay="30" fadetime="0">
</onpausemodeonly> </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> </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 * Private Functions
*****************************************************************************************/ *****************************************************************************************/

View File

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