diff options
author | louis <louis.braun@gmx.de> | 2014-11-29 11:23:54 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-11-29 11:23:54 +0100 |
commit | 76ab3e4cef2ef37ea8e9f2ababfd4b8c98ceaf54 (patch) | |
tree | 7f13e052745e0fd2ac43e6ecd391247aa9889744 | |
parent | d684cec70e72c4f9cea35fda69c1baa32360b5e3 (diff) | |
download | vdr-plugin-skindesigner-76ab3e4cef2ef37ea8e9f2ababfd4b8c98ceaf54.tar.gz vdr-plugin-skindesigner-76ab3e4cef2ef37ea8e9f2ababfd4b8c98ceaf54.tar.bz2 |
added onpause and onpausemodeonly in displayreplay
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | displayreplay.c | 5 | ||||
-rw-r--r-- | dtd/displayreplay.dtd | 16 | ||||
-rw-r--r-- | libtemplate/templateview.c | 59 | ||||
-rw-r--r-- | libtemplate/templateview.h | 14 | ||||
-rw-r--r-- | libtemplate/templateviewelement.c | 7 | ||||
-rw-r--r-- | libtemplate/templateviewelement.h | 5 | ||||
-rw-r--r-- | libtemplate/xmlparser.c | 59 | ||||
-rw-r--r-- | libtemplate/xmlparser.h | 3 | ||||
-rw-r--r-- | skins/metrixhd/themes/default/globals.xml | 4 | ||||
-rw-r--r-- | skins/metrixhd/xmlfiles/displayreplay.xml | 131 | ||||
-rw-r--r-- | skins/nopacity/themes/darkred/globals.xml | 5 | ||||
-rw-r--r-- | skins/nopacity/themes/default/globals.xml | 5 | ||||
-rw-r--r-- | skins/nopacity/xmlfiles/displayreplay.xml | 124 | ||||
-rw-r--r-- | skinskeleton/xmlfiles/displayreplay.xml | 116 | ||||
-rw-r--r-- | views/displaymenudetailview.c | 210 | ||||
-rw-r--r-- | views/displaymenudetailview.h | 4 | ||||
-rw-r--r-- | views/displayreplayonpauseview.c | 93 | ||||
-rw-r--r-- | views/displayreplayonpauseview.h | 18 | ||||
-rw-r--r-- | views/displayreplayview.c | 20 | ||||
-rw-r--r-- | views/displayreplayview.h | 4 | ||||
-rw-r--r-- | views/view.c | 3 | ||||
-rw-r--r-- | views/viewhelpers.c | 206 | ||||
-rw-r--r-- | views/viewhelpers.h | 1 |
25 files changed, 829 insertions, 285 deletions
@@ -95,3 +95,4 @@ Version 0.0.6 epgsearch - using VDRs OSD Language instead of system language - added compatibility to librsvg >= 2.36.1 +- added onpause and onpausemodeonly in displayreplay @@ -94,6 +94,7 @@ OBJS = $(PLUGIN).o \ views/displaymenutabview.o \ views/displaymessageview.o \ views/displayreplayview.o \ + views/displayreplayonpauseview.o \ views/displayvolumeview.o \ views/displayaudiotracksview.o diff --git a/displayreplay.c b/displayreplay.c index 5a82eea..95a7235 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -35,6 +35,11 @@ void cSDDisplayReplay::SetRecording(const cRecording *Recording) { void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { if (!doOutput) return; + if (!Play && Speed < 0) { + replayView->DrawOnPause(modeOnly); + } else { + replayView->ClearOnPause(); + } replayView->DrawControlIcons(Play, Forward, Speed, modeOnly); } diff --git a/dtd/displayreplay.dtd b/dtd/displayreplay.dtd index baf06d2..5e492d8 100644 --- a/dtd/displayreplay.dtd +++ b/dtd/displayreplay.dtd @@ -5,7 +5,7 @@ <!ELEMENT displayreplay (background | backgroundmodeonly |datetime |
scrapercontent | rectitle | recinfo | currenttime |
totaltime | progressbar | cutmarks | controlicons |
- controliconsmodeonly | jump | message)*>
+ controliconsmodeonly | jump | message | onpause | onpausemodeonly)*>
<!ATTLIST displayreplay
x CDATA #REQUIRED
y CDATA #REQUIRED
@@ -88,4 +88,18 @@ debug CDATA #IMPLIED
>
+<!ELEMENT onpause (area|areascroll)*>
+<!ATTLIST onpause
+ debug CDATA #IMPLIED
+ delay CDATA #REQUIRED
+ fadetime CDATA #IMPLIED
+>
+
+<!ELEMENT onpausemodeonly (area|areascroll)*>
+<!ATTLIST onpausemodeonly
+ debug CDATA #IMPLIED
+ delay CDATA #REQUIRED
+ fadetime CDATA #IMPLIED
+>
+
%functions;
\ No newline at end of file diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c index 95b3286..4783d13 100644 --- a/libtemplate/templateview.c +++ b/libtemplate/templateview.c @@ -469,9 +469,16 @@ void cTemplateView::Debug(void) { void cTemplateView::SetFunctionDefinitions(void) { - string name = "area"; + string name = "viewelement"; set<string> attributes; attributes.insert("debug"); + attributes.insert("delay"); + attributes.insert("fadetime"); + funcsAllowed.insert(pair< string, set<string> >(name, attributes)); + + name = "area"; + attributes.clear(); + attributes.insert("debug"); attributes.insert("condition"); attributes.insert("x"); attributes.insert("y"); @@ -723,7 +730,7 @@ string cTemplateViewChannel::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -770,10 +777,9 @@ void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmap *pix, map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } @@ -1192,7 +1198,7 @@ void cTemplateViewMenu::AddPluginView(string plugName, int templNo, cTemplateVie } } -void cTemplateViewMenu::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewMenu::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1231,10 +1237,9 @@ void cTemplateViewMenu::AddPixmap(string sViewElement, cTemplatePixmap *pix, boo map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } @@ -1309,7 +1314,7 @@ string cTemplateViewMessage::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewMessage::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewMessage::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1328,10 +1333,9 @@ void cTemplateViewMessage::AddPixmap(string sViewElement, cTemplatePixmap *pix, map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } @@ -1357,6 +1361,14 @@ cTemplateViewReplay::cTemplateViewReplay(void) { attributes.insert("scaletvheight"); funcsAllowed.insert(pair< string, set<string> >(viewName, attributes)); + //definition of allowed parameters for onpause and onpausemodeonly viewelement + attributes.clear(); + attributes.insert("debug"); + attributes.insert("delay"); + attributes.insert("fadetime"); + funcsAllowed.insert(pair< string, set<string> >("onpause", attributes)); + funcsAllowed.insert(pair< string, set<string> >("onpausemodeonly", attributes)); + SetViewElements(); } @@ -1378,6 +1390,8 @@ void cTemplateViewReplay::SetViewElements(void) { viewElementsAllowed.insert("controliconsmodeonly"); viewElementsAllowed.insert("jump"); viewElementsAllowed.insert("message"); + viewElementsAllowed.insert("onpause"); + viewElementsAllowed.insert("onpausemodeonly"); } string cTemplateViewReplay::GetViewElementName(eViewElement ve) { @@ -1422,6 +1436,12 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) { case veScraperContent: name = "Scraper Content"; break; + case veOnPause: + name = "On Pause"; + break; + case veOnPauseModeOnly: + name = "On Pause Mode Only"; + break; default: name = "Unknown"; break; @@ -1429,7 +1449,7 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1460,6 +1480,10 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, b ve = veRecJump; } else if (!sViewElement.compare("message")) { ve = veMessage; + } else if (!sViewElement.compare("onpause")) { + ve = veOnPause; + } else if (!sViewElement.compare("onpausemodeonly")) { + ve = veOnPauseModeOnly; } if (ve == veUndefined) { @@ -1472,10 +1496,9 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, b map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } @@ -1529,7 +1552,7 @@ string cTemplateViewVolume::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewVolume::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewVolume::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1548,10 +1571,9 @@ void cTemplateViewVolume::AddPixmap(string sViewElement, cTemplatePixmap *pix, b map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } @@ -1634,7 +1656,7 @@ string cTemplateViewAudioTracks::GetViewListName(eViewList vl) { return name; } -void cTemplateViewAudioTracks::AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) { +void cTemplateViewAudioTracks::AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1653,10 +1675,9 @@ void cTemplateViewAudioTracks::AddPixmap(string sViewElement, cTemplatePixmap *p map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) { cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(viewElementattributes); viewElement->AddPixmap(pix); viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - if (debugViewElement) - viewElement->ActivateDebugTokens(); } else { (hit->second)->AddPixmap(pix); } diff --git a/libtemplate/templateview.h b/libtemplate/templateview.h index 828eb21..20f1c51 100644 --- a/libtemplate/templateview.h +++ b/libtemplate/templateview.h @@ -72,7 +72,7 @@ public: virtual string GetViewListName(eViewList vl) { return ""; }; virtual void AddSubView(string sSubView, cTemplateView *subView) {}; virtual void AddPluginView(string plugName, int templNo, cTemplateView *plugView) {}; - virtual void AddPixmap(string sViewElement, cTemplatePixmap *pix, bool debugViewElement) {}; + virtual void AddPixmap(string sViewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes) {}; virtual void AddViewList(string sViewList, cTemplateViewList *viewList) {}; virtual void AddViewTab(cTemplateViewTab *viewTab) {}; //Setter Functions @@ -129,7 +129,7 @@ public: cTemplateViewChannel(void); virtual ~cTemplateViewChannel(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); }; // --- cTemplateViewMenu ------------------------------------------------------------- @@ -147,7 +147,7 @@ public: string GetViewListName(eViewList vl); void AddSubView(string sSubView, cTemplateView *subView); void AddPluginView(string plugName, int templNo, cTemplateView *plugView); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); void AddViewList(string sViewList, cTemplateViewList *viewList); void AddViewTab(cTemplateViewTab *viewTab); }; @@ -161,7 +161,7 @@ public: cTemplateViewMessage(void); virtual ~cTemplateViewMessage(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); }; // --- cTemplateViewReplay ------------------------------------------------------------- @@ -173,7 +173,7 @@ public: cTemplateViewReplay(void); virtual ~cTemplateViewReplay(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); }; // --- cTemplateViewVolume ------------------------------------------------------------- @@ -185,7 +185,7 @@ public: cTemplateViewVolume(void); virtual ~cTemplateViewVolume(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); }; // --- cTemplateViewAudioTracks ------------------------------------------------------------- @@ -199,7 +199,7 @@ public: virtual ~cTemplateViewAudioTracks(void); string GetViewElementName(eViewElement ve); string GetViewListName(eViewList vl); - void AddPixmap(string viewElement, cTemplatePixmap *pix, bool debugViewElement); + void AddPixmap(string viewElement, cTemplatePixmap *pix, vector<pair<string, string> > &viewElementattributes); void AddViewList(string sViewList, cTemplateViewList *viewList); }; diff --git a/libtemplate/templateviewelement.c b/libtemplate/templateviewelement.c index 87aeade..1a2ef6e 100644 --- a/libtemplate/templateviewelement.c +++ b/libtemplate/templateviewelement.c @@ -118,6 +118,13 @@ cTemplateFunction *cTemplateViewElement::GetFunction(string name) { return NULL;
}
+bool cTemplateViewElement::DebugTokens(void) {
+ if (!parameters)
+ return false;
+ return parameters->DoDebug();
+}
+
+
void cTemplateViewElement::Debug(void) {
esyslog("skindesigner: viewelement container size x: %d, y: %d, width: %d, height %d", containerX, containerY, containerWidth, containerHeight);
if (parameters)
diff --git a/libtemplate/templateviewelement.h b/libtemplate/templateviewelement.h index 7fe78b9..6d148e7 100644 --- a/libtemplate/templateviewelement.h +++ b/libtemplate/templateviewelement.h @@ -60,6 +60,8 @@ enum eViewElement { veControlIconsModeOnly,
veBackgroundModeOnly,
veRecJump,
+ veOnPause,
+ veOnPauseModeOnly,
//DisplayVolume ViewElements
veVolume
};
@@ -93,8 +95,7 @@ public: void InitIterator(void);
cTemplatePixmap *GetNextPixmap(void);
cTemplateFunction *GetFunction(string name);
- void ActivateDebugTokens(void) {debugTokens = true; };
- bool DebugTokens(void) { return debugTokens; };
+ bool DebugTokens(void);
virtual void Debug(void);
};
diff --git a/libtemplate/xmlparser.c b/libtemplate/xmlparser.c index 0fede38..bdaf0bb 100644 --- a/libtemplate/xmlparser.c +++ b/libtemplate/xmlparser.c @@ -139,12 +139,18 @@ bool cXmlParser::ParseView(void) { node = node->next; continue; } - if (view->ValidSubView((const char*)node->name)) { ParseSubView(node); } else if (view->ValidViewElement((const char*)node->name)) { - bool debugViewElement = DebugViewElement(node); - ParseViewElement(node->name, node->xmlChildrenNode, debugViewElement); + xmlAttrPtr attr = node->properties; + vector<pair<string, string> > attribs; + ParseAttributes(attr, node, attribs); + /* + for (vector<pair<string, string> >::iterator it = attribs.begin(); it != attribs.end(); it++) { + esyslog("skindesigner: attribute %s value %s", (it->first).c_str(), (it->second).c_str()); + } + */ + ParseViewElement(node->name, node->xmlChildrenNode, attribs); } else if (view->ValidViewList((const char*)node->name)) { ParseViewList(node); } else { @@ -178,8 +184,8 @@ bool cXmlParser::ParsePluginView(string plugName, int templateNumber) { } if (plugView->ValidViewElement((const char*)childNode->name)) { - bool debugViewElement = DebugViewElement(childNode); - ParseViewElement(childNode->name, childNode->xmlChildrenNode, debugViewElement, plugView); + vector<pair<string, string> > attribs; + ParseViewElement(childNode->name, childNode->xmlChildrenNode, attribs, plugView); } else if (plugView->ValidViewList((const char*)childNode->name)) { ParseViewList(childNode, plugView); } else if (!xmlStrcmp(childNode->name, (const xmlChar *) "tab")) { @@ -508,8 +514,8 @@ bool cXmlParser::ParseSubView(xmlNodePtr node) { } if (subView->ValidViewElement((const char*)childNode->name)) { - bool debugViewElement = DebugViewElement(childNode); - ParseViewElement(childNode->name, childNode->xmlChildrenNode, debugViewElement, subView); + vector<pair<string, string> > attribs; + ParseViewElement(childNode->name, childNode->xmlChildrenNode, attribs, subView); } else if (subView->ValidViewList((const char*)childNode->name)) { ParseViewList(childNode, subView); } else if (!xmlStrcmp(childNode->name, (const xmlChar *) "tab")) { @@ -527,17 +533,13 @@ bool cXmlParser::ParseSubView(xmlNodePtr node) { } -void cXmlParser::ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, bool debugVE, cTemplateView *subView) { +void cXmlParser::ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, vector<pair<string, string> > &attributes, cTemplateView *subView) { if (!node) return; if (!view) return; - if (debugVE) { - dsyslog("skindesigner: activating debugging of viewElement %s", (const char*)viewElement); - } - while (node != NULL) { if (node->type != XML_ELEMENT_NODE) { @@ -562,9 +564,9 @@ void cXmlParser::ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, pix->SetParameters(attribs); ParseFunctionCalls(node->xmlChildrenNode, pix); if (subView) - subView->AddPixmap((const char*)viewElement, pix, debugVE); + subView->AddPixmap((const char*)viewElement, pix, attributes); else - view->AddPixmap((const char*)viewElement, pix, debugVE); + view->AddPixmap((const char*)viewElement, pix, attributes); node = node->next; } @@ -601,15 +603,6 @@ void cXmlParser::ParseViewList(xmlNodePtr parentNode, cTemplateView *subView) { ParseAttributes(attrCur, node, attribsCur); currentElement->SetGlobals(globals); currentElement->SetParameters(attribsCur); - bool debugCurrent = false; - for (vector<pair<string, string> >::iterator it = attribsCur.begin(); it != attribsCur.end(); it++) { - if (!(it->first).compare("debug")) { - debugCurrent = true; - break; - } - } - if (debugCurrent) - currentElement->ActivateDebugTokens(); while (childNode != NULL) { if (childNode->type != XML_ELEMENT_NODE) { childNode = childNode->next; @@ -631,13 +624,15 @@ void cXmlParser::ParseViewList(xmlNodePtr parentNode, cTemplateView *subView) { } viewList->AddCurrentElement(currentElement); } else if (!xmlStrcmp(node->name, (const xmlChar *) "listelement")) { - bool debugViewList = DebugViewElement(node); xmlNodePtr childNode = node->xmlChildrenNode; if (!childNode) continue; cTemplateViewElement *listElement = new cTemplateViewElement(); - if (debugViewList) - listElement->ActivateDebugTokens(); + xmlAttrPtr attrList = node->properties; + vector<pair<string, string> > attribsList; + ParseAttributes(attrList, node, attribsList); + listElement->SetGlobals(globals); + listElement->SetParameters(attribsList); while (childNode != NULL) { if (childNode->type != XML_ELEMENT_NODE) { childNode = childNode->next; @@ -775,6 +770,7 @@ bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<s xmlChar *value = NULL; value = xmlGetProp(node, attr->name); if (!view->ValidAttribute((const char*)node->name, (const char*)attr->name)) { + esyslog("skindesigner: unknown attribute %s in %s", (const char*)attr->name, (const char*)node->name); attr = attr->next; if (value) xmlFree(value); @@ -789,17 +785,6 @@ bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<s return true; } -bool cXmlParser::DebugViewElement(xmlNodePtr node) { - xmlAttrPtr attr = node->properties; - vector<pair<string, string> > attribs; - ParseAttributes(attr, node, attribs); - for (vector<pair<string, string> >::iterator it = attribs.begin(); it != attribs.end(); it++) { - if (!(it->first).compare("debug")) - return true; - } - return false; -} - void cXmlParser::InitLibXML() { xmlInitParser(); } diff --git a/libtemplate/xmlparser.h b/libtemplate/xmlparser.h index 18476e9..5ff829f 100644 --- a/libtemplate/xmlparser.h +++ b/libtemplate/xmlparser.h @@ -36,13 +36,12 @@ private: void ParseGlobalFonts(xmlNodePtr node); void ParseTranslations(xmlNodePtr node); bool ParseSubView(xmlNodePtr node); - void ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, bool debugVE, cTemplateView *subView = NULL); + void ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, vector<pair<string, string> > &attributes, cTemplateView *subView = NULL); void ParseViewList(xmlNodePtr parentNode, cTemplateView *subView = NULL); void ParseViewTab(xmlNodePtr parentNode, cTemplateView *subView); void ParseFunctionCalls(xmlNodePtr node, cTemplatePixmap *pix); void ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction *loopFunc); bool ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs); - bool DebugViewElement(xmlNodePtr node); public: cXmlParser(void); virtual ~cXmlParser(void); diff --git a/skins/metrixhd/themes/default/globals.xml b/skins/metrixhd/themes/default/globals.xml index 11c3e1f..3f54d56 100644 --- a/skins/metrixhd/themes/default/globals.xml +++ b/skins/metrixhd/themes/default/globals.xml @@ -190,6 +190,10 @@ <trans lang="en_EN">Volume</trans> <trans lang="de_DE">Lautstärke</trans> </token> + <token name="tr(pause)"> + <trans lang="en_EN">Pause</trans> + <trans lang="de_DE">Pause</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 b1d5609..889d51b 100644 --- a/skins/metrixhd/xmlfiles/displayreplay.xml +++ b/skins/metrixhd/xmlfiles/displayreplay.xml @@ -19,11 +19,6 @@ <area x="25%" y="85%" width="50%" height="10%" layer="1"> <fill color="{clrTransBlack}" /> </area> - <!-- background datetime --> - <area x="70%" y="0" width="30%" height="13%" layer="1"> - <fill color="{clrTransBlack}" /> - <drawrectangle x="0" y="0" width="45%" height="100%" color="{clrTransBlueLight}" /> - </area> </backgroundmodeonly> <!-- Available Variables datetime: @@ -231,6 +226,132 @@ <drawtext align="center" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{jump}" /> </area> </jump> + + <!-- Available Variables onpause and onpausemodeonly: + {name} title of recording + {shorttext} shorttext of recording + {description} description of recording + {date} date of recording in dd.mm.yy + {time} time of recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number + {duration} real duration of recording in minutes + {durationhours} real duration, full hours + {durationminutes} real duration, rest of minutes + {durationevent} duration of corresponding event in minutes + {durationeventhours} event duration, full hours + {durationeventminutes} event duration, rest of minutes + + {ismovie} true if event is scraped as a movie + Available variables for movies: + {movietitle} movie title from themoviedb + {movieoriginalTitle} movie original title from themoviedb + {movietagline} movie tagline from themoviedb + {movieoverview} movie overview from themoviedb + {movieadult} true if movie is rated as adult + {moviebudget} movie budget from themoviedb in $ + {movierevenue} movie revenue from themoviedb in $ + {moviegenres} movie genres from themoviedb + {moviehomepage} movie homepage from themoviedb + {moviereleasedate} movie release date from themoviedb + {movieruntime} movie runtime from themoviedb + {moviepopularity} movie popularity from themoviedb + {movievoteaverage} movie vote average from themoviedb + {posterwidth} width of scraped poster + {posterheight} height of scraped poster + {posterpath} absolute path of scraped poster + {fanartwidth} width of scraped fanart + {fanartheight} height of scraped fanart + {fanartpath} absolute path of scraped fanart + {movieiscollection} true if movie is part of a collection + {moviecollectionName} name of movie collection + {collectionposterwidth} width of scraped collection poster + {collectionposterheight} height of scraped collection poster + {collectionposterpath} absolute path of scraped collection poster + {collectionfanartwidth} width of scraped collection fanart + {collectionfanartheight} height of scraped collection fanart + {collectionfanartpath} absolute path of scraped collection fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + + {isseries} true if event is scraped as a series + Available variables for series: + {seriesname} name of series + {seriesoverview} series overview + {seriesfirstaired} first aired date + {seriesnetwork} network which produces series + {seriesgenre} series genre + {seriesrating} series thetvdb rating + {seriesstatus} status of series (running / finished) + {episodetitle} title of episode + {episodenumber} number of episode + {episodeseason} season of episode + {episodefirstaired} first aired date of episode + {episodegueststars} guest stars of episode + {episodeoverview} episode overview + {episoderating} user rating for episode + {episodeimagewidth} episode image width + {episodeimageheight} episode image height + {episodeimagepath} episode image path + {seasonposterwidth} episode season poster width + {seasonposterheight} episode season poster height + {seasonposterpath} episode season poster path + {seriesposter1width} width of 1st poster + {seriesposter1height} height of 1st poster + {seriesposter1path} path of 1st poster + {seriesposter2width} width of 2nd poster + {seriesposter2height} height of 2nd poster + {seriesposter2path} path of 2nd poster + {seriesposter3width} width of 3rd poster + {seriesposter3height} height of 3rd poster + {seriesposter3path} path of 3rd poster + {seriesfanart1width} width of 1st fanart + {seriesfanart1height} height of 1st fanart + {seriesfanart1path} path of 1st fanart + {seriesfanart2width} width of 2nd fanart + {seriesfanart2height} height of 2nd fanart + {seriesfanart2path} path of 2nd fanart + {seriesfanart3width} width of 3rd fanart + {seriesfanart3height} height of 3rd fanart + {seriesfanart3path} path of 3rd fanart + {seriesbanner1width} width of 1st banner + {seriesbanner1height} height of 1st banner + {seriesbanner1path} path of 1st banner + {seriesbanner2width} width of 2nd banner + {seriesbanner2height} height of 2nd banner + {seriesbanner2path} path of 2nd banner + {seriesbanner3width} width of 3rd banner + {seriesbanner3height} height of 3rd banner + {seriesbanner3path} path of 3rd fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + --> + <onpause delay="60" fadetime="{fadeTime}"> + <area x="0" y="0" width="100%" height="100%" layer="7"> + <fill color="{clrSemiTransBlack}" /> + </area> + </onpause> + + <onpausemodeonly delay="20" fadetime="{fadeTime}"> + <area x="0" y="0" width="100%" height="100%" layer="7"> + <fill color="{clrSemiTransBlack}" /> + </area> + <area x="0" y="0" width="100%" height="100%" layer="6"> + <drawtext align="center" valign="center" font="{semibold}" fontsize="25%" color="{clrWhite}" text="{tr(pause)}" /> + <drawimage condition="{isseries}" imagetype="image" path="{seriesbanner1path}" align="center" y="10" width="{areawidth}*0.5" height="{areawidth} * 0.5 * {seriesbanner1height} / {seriesbanner1width}"/> + <drawimage condition="{ismovie}" imagetype="image" path="{posterpath}" x="10" y="10" width="{areaheight} * 0.4 * {posterwidth} / {posterheight}" height="{areaheight} * 0.4"/> + </area> + </onpausemodeonly> + <!-- Available Variables message: {text} message text {status} true if message is a status message diff --git a/skins/nopacity/themes/darkred/globals.xml b/skins/nopacity/themes/darkred/globals.xml index e6b6afd..3fc9ed0 100644 --- a/skins/nopacity/themes/darkred/globals.xml +++ b/skins/nopacity/themes/darkred/globals.xml @@ -18,6 +18,7 @@ <color name="clrGray">FF858585</color> <color name="clrBackground">B0000000</color> <color name="clrTransBlack">99000000</color> + <color name="clrTransBlackDark">DF000000</color> <color name="clrTransRed">99FF0000</color> <color name="clrFontMenuItem">FFFFFFFF</color> <color name="clrFontMenuItemSelected">FFFFFFFF</color> @@ -188,6 +189,10 @@ <trans lang="en_EN">Volume</trans> <trans lang="de_DE">Lautstärke</trans> </token> + <token name="tr(pause)"> + <trans lang="en_EN">Pause</trans> + <trans lang="de_DE">Pause</trans> + </token> </translations> <!-- The three Fonts FontOSD, FontFix and FontSml configured in VDR diff --git a/skins/nopacity/themes/default/globals.xml b/skins/nopacity/themes/default/globals.xml index d3f95a3..9848249 100644 --- a/skins/nopacity/themes/default/globals.xml +++ b/skins/nopacity/themes/default/globals.xml @@ -18,6 +18,7 @@ <color name="clrGray">FF858585</color> <color name="clrBackground">B012273F</color> <color name="clrTransBlack">99000000</color> + <color name="clrTransBlackDark">CC000000</color> <color name="clrTransRed">99FF0000</color> <color name="clrFontMenuItem">FFFFFFFF</color> <color name="clrFontMenuItemSelected">FF363636</color> @@ -188,6 +189,10 @@ <trans lang="en_EN">Volume</trans> <trans lang="de_DE">Lautstärke</trans> </token> + <token name="tr(pause)"> + <trans lang="en_EN">Pause</trans> + <trans lang="de_DE">Pause</trans> + </token> </translations> <!-- The three Fonts FontOSD, FontFix and FontSml configured in VDR diff --git a/skins/nopacity/xmlfiles/displayreplay.xml b/skins/nopacity/xmlfiles/displayreplay.xml index fcc8fa8..cb6fd90 100644 --- a/skins/nopacity/xmlfiles/displayreplay.xml +++ b/skins/nopacity/xmlfiles/displayreplay.xml @@ -215,4 +215,128 @@ </area> </message> + <!-- Available Variables onpause and onpausemodeonly: + {name} title of recording + {shorttext} shorttext of recording + {description} description of recording + {date} date of recording in dd.mm.yy + {time} time of recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number + {duration} real duration of recording in minutes + {durationhours} real duration, full hours + {durationminutes} real duration, rest of minutes + {durationevent} duration of corresponding event in minutes + {durationeventhours} event duration, full hours + {durationeventminutes} event duration, rest of minutes + + {ismovie} true if event is scraped as a movie + Available variables for movies: + {movietitle} movie title from themoviedb + {movieoriginalTitle} movie original title from themoviedb + {movietagline} movie tagline from themoviedb + {movieoverview} movie overview from themoviedb + {movieadult} true if movie is rated as adult + {moviebudget} movie budget from themoviedb in $ + {movierevenue} movie revenue from themoviedb in $ + {moviegenres} movie genres from themoviedb + {moviehomepage} movie homepage from themoviedb + {moviereleasedate} movie release date from themoviedb + {movieruntime} movie runtime from themoviedb + {moviepopularity} movie popularity from themoviedb + {movievoteaverage} movie vote average from themoviedb + {posterwidth} width of scraped poster + {posterheight} height of scraped poster + {posterpath} absolute path of scraped poster + {fanartwidth} width of scraped fanart + {fanartheight} height of scraped fanart + {fanartpath} absolute path of scraped fanart + {movieiscollection} true if movie is part of a collection + {moviecollectionName} name of movie collection + {collectionposterwidth} width of scraped collection poster + {collectionposterheight} height of scraped collection poster + {collectionposterpath} absolute path of scraped collection poster + {collectionfanartwidth} width of scraped collection fanart + {collectionfanartheight} height of scraped collection fanart + {collectionfanartpath} absolute path of scraped collection fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + + {isseries} true if event is scraped as a series + Available variables for series: + {seriesname} name of series + {seriesoverview} series overview + {seriesfirstaired} first aired date + {seriesnetwork} network which produces series + {seriesgenre} series genre + {seriesrating} series thetvdb rating + {seriesstatus} status of series (running / finished) + {episodetitle} title of episode + {episodenumber} number of episode + {episodeseason} season of episode + {episodefirstaired} first aired date of episode + {episodegueststars} guest stars of episode + {episodeoverview} episode overview + {episoderating} user rating for episode + {episodeimagewidth} episode image width + {episodeimageheight} episode image height + {episodeimagepath} episode image path + {seasonposterwidth} episode season poster width + {seasonposterheight} episode season poster height + {seasonposterpath} episode season poster path + {seriesposter1width} width of 1st poster + {seriesposter1height} height of 1st poster + {seriesposter1path} path of 1st poster + {seriesposter2width} width of 2nd poster + {seriesposter2height} height of 2nd poster + {seriesposter2path} path of 2nd poster + {seriesposter3width} width of 3rd poster + {seriesposter3height} height of 3rd poster + {seriesposter3path} path of 3rd poster + {seriesfanart1width} width of 1st fanart + {seriesfanart1height} height of 1st fanart + {seriesfanart1path} path of 1st fanart + {seriesfanart2width} width of 2nd fanart + {seriesfanart2height} height of 2nd fanart + {seriesfanart2path} path of 2nd fanart + {seriesfanart3width} width of 3rd fanart + {seriesfanart3height} height of 3rd fanart + {seriesfanart3path} path of 3rd fanart + {seriesbanner1width} width of 1st banner + {seriesbanner1height} height of 1st banner + {seriesbanner1path} path of 1st banner + {seriesbanner2width} width of 2nd banner + {seriesbanner2height} height of 2nd banner + {seriesbanner2path} path of 2nd banner + {seriesbanner3width} width of 3rd banner + {seriesbanner3height} height of 3rd banner + {seriesbanner3path} path of 3rd fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + --> + <onpause delay="60" fadetime="{fadeTime}"> + <area x="0" y="0" width="100%" height="100%" layer="7"> + <fill color="{clrTransBlackDark}" /> + </area> + </onpause> + + <onpausemodeonly delay="20" fadetime="{fadeTime}"> + <area x="0" y="0" width="100%" height="100%" layer="7"> + <fill color="{clrTransBlackDark}" /> + </area> + <area x="0" y="0" width="100%" height="100%" layer="6"> + <drawtext align="center" valign="center" font="{vdrOsd}" fontsize="25%" color="{clrWhite}" text="{tr(pause)}" /> + <drawimage condition="{isseries}" imagetype="image" path="{seriesbanner1path}" align="center" y="10" width="{areawidth}*0.5" height="{areawidth} * 0.5 * {seriesbanner1height} / {seriesbanner1width}"/> + <drawimage condition="{ismovie}" imagetype="image" path="{posterpath}" x="10" y="10" width="{areaheight} * 0.4 * {posterwidth} / {posterheight}" height="{areaheight} * 0.4"/> + </area> + </onpausemodeonly> </displayreplay> diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index e9834fc..ee63f7a 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -125,4 +125,120 @@ <message> </message> + <!-- Available Variables onpause and onpausemodeonly: + {name} title of recording + {shorttext} shorttext of recording + {description} description of recording + {date} date of recording in dd.mm.yy + {time} time of recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number + {duration} real duration of recording in minutes + {durationhours} real duration, full hours + {durationminutes} real duration, rest of minutes + {durationevent} duration of corresponding event in minutes + {durationeventhours} event duration, full hours + {durationeventminutes} event duration, rest of minutes + + {ismovie} true if event is scraped as a movie + Available variables for movies: + {movietitle} movie title from themoviedb + {movieoriginalTitle} movie original title from themoviedb + {movietagline} movie tagline from themoviedb + {movieoverview} movie overview from themoviedb + {movieadult} true if movie is rated as adult + {moviebudget} movie budget from themoviedb in $ + {movierevenue} movie revenue from themoviedb in $ + {moviegenres} movie genres from themoviedb + {moviehomepage} movie homepage from themoviedb + {moviereleasedate} movie release date from themoviedb + {movieruntime} movie runtime from themoviedb + {moviepopularity} movie popularity from themoviedb + {movievoteaverage} movie vote average from themoviedb + {posterwidth} width of scraped poster + {posterheight} height of scraped poster + {posterpath} absolute path of scraped poster + {fanartwidth} width of scraped fanart + {fanartheight} height of scraped fanart + {fanartpath} absolute path of scraped fanart + {movieiscollection} true if movie is part of a collection + {moviecollectionName} name of movie collection + {collectionposterwidth} width of scraped collection poster + {collectionposterheight} height of scraped collection poster + {collectionposterpath} absolute path of scraped collection poster + {collectionfanartwidth} width of scraped collection fanart + {collectionfanartheight} height of scraped collection fanart + {collectionfanartpath} absolute path of scraped collection fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + + {isseries} true if event is scraped as a series + Available variables for series: + {seriesname} name of series + {seriesoverview} series overview + {seriesfirstaired} first aired date + {seriesnetwork} network which produces series + {seriesgenre} series genre + {seriesrating} series thetvdb rating + {seriesstatus} status of series (running / finished) + {episodetitle} title of episode + {episodenumber} number of episode + {episodeseason} season of episode + {episodefirstaired} first aired date of episode + {episodegueststars} guest stars of episode + {episodeoverview} episode overview + {episoderating} user rating for episode + {episodeimagewidth} episode image width + {episodeimageheight} episode image height + {episodeimagepath} episode image path + {seasonposterwidth} episode season poster width + {seasonposterheight} episode season poster height + {seasonposterpath} episode season poster path + {seriesposter1width} width of 1st poster + {seriesposter1height} height of 1st poster + {seriesposter1path} path of 1st poster + {seriesposter2width} width of 2nd poster + {seriesposter2height} height of 2nd poster + {seriesposter2path} path of 2nd poster + {seriesposter3width} width of 3rd poster + {seriesposter3height} height of 3rd poster + {seriesposter3path} path of 3rd poster + {seriesfanart1width} width of 1st fanart + {seriesfanart1height} height of 1st fanart + {seriesfanart1path} path of 1st fanart + {seriesfanart2width} width of 2nd fanart + {seriesfanart2height} height of 2nd fanart + {seriesfanart2path} path of 2nd fanart + {seriesfanart3width} width of 3rd fanart + {seriesfanart3height} height of 3rd fanart + {seriesfanart3path} path of 3rd fanart + {seriesbanner1width} width of 1st banner + {seriesbanner1height} height of 1st banner + {seriesbanner1path} path of 1st banner + {seriesbanner2width} width of 2nd banner + {seriesbanner2height} height of 2nd banner + {seriesbanner2path} path of 2nd banner + {seriesbanner3width} width of 3rd banner + {seriesbanner3height} height of 3rd banner + {seriesbanner3path} path of 3rd fanart + {actors[]} array with movie actors + {actors[name]} real name of actor + {actors[role]} actor role + {actors[thumb]} absolute path of scraped actor thumb + {actors[thumbwidth]} width of scraped actor thumb + {actors[thumbheight]} height of scraped actor thumb + --> + <!-- delay (in seconds) defines the time to wait till viewelement is displayed + fadetime in ms --> + <onpause delay="60" fadetime="0"> + </onpause> + + <onpausemodeonly delay="30" fadetime="0"> + </onpausemodeonly> + </displayreplay> diff --git a/views/displaymenudetailview.c b/views/displaymenudetailview.c index 2e3bf4c..c24fc6b 100644 --- a/views/displaymenudetailview.c +++ b/views/displaymenudetailview.c @@ -153,7 +153,7 @@ void cDisplayMenuDetailView::SetTokens(void) { intTokens.insert(pair<string,int>("hasreruns", hasReruns)); - SetScraperTokens(); + SetScraperTokens(event, recording, stringTokens, intTokens, loopTokens); SetEpgPictures(event->EventID()); } else if (recording) { @@ -205,7 +205,7 @@ void cDisplayMenuDetailView::SetTokens(void) { stringTokens.insert(pair<string,string>("durationeventminutes", "")); } LoadRecordingInformation(); - SetScraperTokens(); + SetScraperTokens(event, recording, stringTokens, intTokens, loopTokens); SetRecordingImages(recording->FileName()); } else if (text) { stringTokens.insert(pair<string,string>("text", text)); @@ -215,212 +215,6 @@ void cDisplayMenuDetailView::SetTokens(void) { } } -void cDisplayMenuDetailView::SetScraperTokens(void) { - static cPlugin *pScraper = GetScraperPlugin(); - if (!pScraper || (!event && !recording)) { - intTokens.insert(pair<string,int>("ismovie", false)); - intTokens.insert(pair<string,int>("isseries", false)); - return; - } - - ScraperGetEventType getType; - getType.event = event; - getType.recording = recording; - if (!pScraper->Service("GetEventType", &getType)) { - intTokens.insert(pair<string,int>("ismovie", false)); - intTokens.insert(pair<string,int>("isseries", false)); - return; - } - - if (getType.type == tMovie) { - cMovie movie; - movie.movieId = getType.movieId; - pScraper->Service("GetMovie", &movie); - intTokens.insert(pair<string,int>("ismovie", true)); - intTokens.insert(pair<string,int>("isseries", false)); - - stringTokens.insert(pair<string,string>("movietitle", movie.title)); - stringTokens.insert(pair<string,string>("movieoriginalTitle", movie.originalTitle)); - stringTokens.insert(pair<string,string>("movietagline", movie.tagline)); - stringTokens.insert(pair<string,string>("movieoverview", movie.overview)); - stringTokens.insert(pair<string,string>("moviegenres", movie.genres)); - stringTokens.insert(pair<string,string>("moviehomepage", movie.homepage)); - stringTokens.insert(pair<string,string>("moviereleasedate", movie.releaseDate)); - stringstream pop; - pop << movie.popularity; - stringTokens.insert(pair<string,string>("moviepopularity", pop.str())); - stringstream vote; - vote << movie.voteAverage; - stringTokens.insert(pair<string,string>("movievoteaverage", pop.str())); - stringTokens.insert(pair<string,string>("posterpath", movie.poster.path)); - stringTokens.insert(pair<string,string>("fanartpath", movie.fanart.path)); - stringTokens.insert(pair<string,string>("collectionposterpath", movie.collectionPoster.path)); - stringTokens.insert(pair<string,string>("collectionfanartpath", movie.collectionFanart.path)); - - intTokens.insert(pair<string,int>("movieadult", movie.adult)); - intTokens.insert(pair<string,int>("moviebudget", movie.budget)); - intTokens.insert(pair<string,int>("movierevenue", movie.revenue)); - intTokens.insert(pair<string,int>("movieruntime", movie.runtime)); - intTokens.insert(pair<string,int>("posterwidth", movie.poster.width)); - intTokens.insert(pair<string,int>("posterheight", movie.poster.height)); - intTokens.insert(pair<string,int>("fanartwidth", movie.fanart.width)); - intTokens.insert(pair<string,int>("fanartheight", movie.fanart.height)); - intTokens.insert(pair<string,int>("collectionposterwidth", movie.collectionPoster.width)); - intTokens.insert(pair<string,int>("collectionposterheight", movie.collectionPoster.height)); - intTokens.insert(pair<string,int>("collectionfanartwidth", movie.collectionFanart.width)); - intTokens.insert(pair<string,int>("collectionfanartheight", movie.collectionFanart.height)); - - vector< map< string, string > > actors; - for (vector<cActor>::iterator act = movie.actors.begin(); act != movie.actors.end(); act++) { - map< string, string > actor; - actor.insert(pair<string, string>("actors[name]", (*act).name)); - actor.insert(pair<string, string>("actors[role]", (*act).role)); - actor.insert(pair<string, string>("actors[thumb]", (*act).actorThumb.path)); - stringstream actWidth, actHeight; - actWidth << (*act).actorThumb.width; - actHeight << (*act).actorThumb.height; - actor.insert(pair<string, string>("actors[thumbwidth]", actWidth.str())); - actor.insert(pair<string, string>("actors[thumbheight]", actHeight.str())); - actors.push_back(actor); - } - loopTokens.insert(pair<string, vector< map< string, string > > >("actors", actors)); - - } else if (getType.type == tSeries) { - cSeries series; - series.seriesId = getType.seriesId; - series.episodeId = getType.episodeId; - pScraper->Service("GetSeries", &series); - intTokens.insert(pair<string,int>("ismovie", false)); - intTokens.insert(pair<string,int>("isseries", true)); - //Series Basics - stringTokens.insert(pair<string,string>("seriesname", series.name)); - stringTokens.insert(pair<string,string>("seriesoverview", series.overview)); - stringTokens.insert(pair<string,string>("seriesfirstaired", series.firstAired)); - stringTokens.insert(pair<string,string>("seriesnetwork", series.network)); - stringTokens.insert(pair<string,string>("seriesgenre", series.genre)); - stringstream rating; - rating << series.rating; - stringTokens.insert(pair<string,string>("seriesrating", rating.str())); - stringTokens.insert(pair<string,string>("seriesstatus", series.status)); - //Episode Information - intTokens.insert(pair<string,int>("episodenumber", series.episode.number)); - intTokens.insert(pair<string,int>("episodeseason", series.episode.season)); - stringTokens.insert(pair<string,string>("episodetitle", series.episode.name)); - stringTokens.insert(pair<string,string>("episodefirstaired", series.episode.firstAired)); - stringTokens.insert(pair<string,string>("episodegueststars", series.episode.guestStars)); - stringTokens.insert(pair<string,string>("episodeoverview", series.episode.overview)); - stringstream eprating; - eprating << series.episode.rating; - stringTokens.insert(pair<string,string>("episoderating", eprating.str())); - intTokens.insert(pair<string,int>("episodeimagewidth", series.episode.episodeImage.width)); - intTokens.insert(pair<string,int>("episodeimageheight", series.episode.episodeImage.height)); - stringTokens.insert(pair<string,string>("episodeimagepath", series.episode.episodeImage.path)); - //Seasonposter - intTokens.insert(pair<string,int>("seasonposterwidth", series.seasonPoster.width)); - intTokens.insert(pair<string,int>("seasonposterheight", series.seasonPoster.height)); - stringTokens.insert(pair<string,string>("seasonposterpath", series.seasonPoster.path)); - - //Posters - int current = 1; - for(vector<cTvMedia>::iterator poster = series.posters.begin(); poster != series.posters.end(); poster++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesposter" << current << "width"; - labelHeight << "seriesposter" << current << "height"; - labelPath << "seriesposter" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), (*poster).width)); - intTokens.insert(pair<string,int>(labelHeight.str(), (*poster).height)); - stringTokens.insert(pair<string,string>(labelPath.str(), (*poster).path)); - current++; - } - if (current < 3) { - for (; current < 4; current++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesposter" << current << "width"; - labelHeight << "seriesposter" << current << "height"; - labelPath << "seriesposter" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), 0)); - intTokens.insert(pair<string,int>(labelHeight.str(), 0)); - stringTokens.insert(pair<string,string>(labelPath.str(), "")); - } - } - - //Banners - current = 1; - for(vector<cTvMedia>::iterator banner = series.banners.begin(); banner != series.banners.end(); banner++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesbanner" << current << "width"; - labelHeight << "seriesbanner" << current << "height"; - labelPath << "seriesbanner" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), (*banner).width)); - intTokens.insert(pair<string,int>(labelHeight.str(), (*banner).height)); - stringTokens.insert(pair<string,string>(labelPath.str(), (*banner).path)); - current++; - } - if (current < 3) { - for (; current < 4; current++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesbanner" << current << "width"; - labelHeight << "seriesbanner" << current << "height"; - labelPath << "seriesbanner" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), 0)); - intTokens.insert(pair<string,int>(labelHeight.str(), 0)); - stringTokens.insert(pair<string,string>(labelPath.str(), "")); - } - } - - //Fanarts - current = 1; - for(vector<cTvMedia>::iterator fanart = series.fanarts.begin(); fanart != series.fanarts.end(); fanart++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesfanart" << current << "width"; - labelHeight << "seriesfanart" << current << "height"; - labelPath << "seriesfanart" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), (*fanart).width)); - intTokens.insert(pair<string,int>(labelHeight.str(), (*fanart).height)); - stringTokens.insert(pair<string,string>(labelPath.str(), (*fanart).path)); - current++; - } - if (current < 3) { - for (; current < 4; current++) { - stringstream labelWidth, labelHeight, labelPath; - labelWidth << "seriesfanart" << current << "width"; - labelHeight << "seriesfanart" << current << "height"; - labelPath << "seriesfanart" << current << "path"; - - intTokens.insert(pair<string,int>(labelWidth.str(), 0)); - intTokens.insert(pair<string,int>(labelHeight.str(), 0)); - stringTokens.insert(pair<string,string>(labelPath.str(), "")); - } - } - - //Actors - vector< map< string, string > > actors; - for (vector<cActor>::iterator act = series.actors.begin(); act != series.actors.end(); act++) { - map< string, string > actor; - actor.insert(pair<string, string>("actors[name]", (*act).name)); - actor.insert(pair<string, string>("actors[role]", (*act).role)); - actor.insert(pair<string, string>("actors[thumb]", (*act).actorThumb.path)); - stringstream actWidth, actHeight; - actWidth << (*act).actorThumb.width; - actHeight << (*act).actorThumb.height; - actor.insert(pair<string, string>("actors[thumbwidth]", actWidth.str())); - actor.insert(pair<string, string>("actors[thumbheight]", actHeight.str())); - actors.push_back(actor); - } - loopTokens.insert(pair<string, vector< map< string, string > > >("actors", actors)); - - } else { - intTokens.insert(pair<string,int>("ismovie", false)); - intTokens.insert(pair<string,int>("isseries", false)); - } - -} - void cDisplayMenuDetailView::InitTabs(void) { tmplView->InitViewTabIterator(); cTemplateViewTab *tmplTab = NULL; diff --git a/views/displaymenudetailview.h b/views/displaymenudetailview.h index 2387609..1b43687 100644 --- a/views/displaymenudetailview.h +++ b/views/displaymenudetailview.h @@ -4,9 +4,10 @@ #include <list> #include "../libtemplate/template.h" #include "view.h" +#include "viewhelpers.h" #include "displaymenutabview.h" -class cDisplayMenuDetailView : public cView { +class cDisplayMenuDetailView : public cView, public cViewHelpers { private: bool detailViewInit; bool isPluginTextView; @@ -21,7 +22,6 @@ private: map < string, int > intTokens; map < string, vector< map< string, string > > > loopTokens; void SetTokens(void); - void SetScraperTokens(void); void InitTabs(void); bool LoadReruns(vector< map< string, string > > *reruns); void LoadRecordingInformation(void); diff --git a/views/displayreplayonpauseview.c b/views/displayreplayonpauseview.c new file mode 100644 index 0000000..976d37b --- /dev/null +++ b/views/displayreplayonpauseview.c @@ -0,0 +1,93 @@ +#define __STL_CONFIG_H +#include <vdr/player.h> +#include "displayreplayonpauseview.h" + +cDisplayReplayOnPauseView::cDisplayReplayOnPauseView(cTemplateViewElement *tmplViewElement) : cView(tmplViewElement) { + tmplViewElement->SetPixOffset(0); + delay = tmplViewElement->GetNumericParameter(ptDelay) * 1000; + SetFadeTime(tmplViewElement->GetNumericParameter(ptFadeTime)); +} + +cDisplayReplayOnPauseView::~cDisplayReplayOnPauseView() { + CancelSave(); + FadeOut(); +} + +void cDisplayReplayOnPauseView::Render(void) { + map < string, string > stringTokens; + map < string, int > intTokens; + map < string, vector< map< string, string > > > loopTokens; + const cRecording *recording = NULL; + cControl *control = cControl::Control(); + if (control) { + recording = control->GetRecording(); + } + if (recording) { + string name = recording->Name() ? recording->Name() : ""; + stringTokens.insert(pair<string,string>("name", name)); + const cRecordingInfo *info = recording->Info(); + if (info) { + stringTokens.insert(pair<string,string>("shorttext", info->ShortText() ? info->ShortText() : "")); + stringTokens.insert(pair<string,string>("description", info->Description() ? info->Description() : "")); + const cEvent *event = info->GetEvent(); + if (event) { + string recDate = *(event->GetDateString()); + string recTime = *(event->GetTimeString()); + if (recDate.find("1970") != string::npos) { + time_t start = recording->Start(); + recDate = *DateString(start); + recTime = *TimeString(start); + } + stringTokens.insert(pair<string,string>("date", recDate.c_str())); + stringTokens.insert(pair<string,string>("time", recTime.c_str())); + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1)); + int duration = event->Duration() / 60; + int recDuration = recording->LengthInSeconds(); + recDuration = (recDuration>0)?(recDuration / 60):0; + intTokens.insert(pair<string,int>("duration", recDuration)); + intTokens.insert(pair<string,int>("durationhours", recDuration / 60)); + stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60))); + intTokens.insert(pair<string,int>("durationevent", duration)); + intTokens.insert(pair<string,int>("durationeventhours", duration / 60)); + stringTokens.insert(pair<string,string>("durationeventminutes", *cString::sprintf("%.2d", duration%60))); + } + } else { + stringTokens.insert(pair<string,string>("shorttext", "")); + stringTokens.insert(pair<string,string>("description", "")); + int recDuration = recording->LengthInSeconds(); + recDuration = (recDuration>0)?(recDuration / 60):0; + stringTokens.insert(pair<string,string>("date", "")); + stringTokens.insert(pair<string,string>("time", "")); + intTokens.insert(pair<string,int>("duration", recDuration)); + intTokens.insert(pair<string,int>("durationhours", recDuration / 60)); + stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60))); + intTokens.insert(pair<string,int>("durationevent", 0)); + intTokens.insert(pair<string,int>("durationeventhours", 0)); + stringTokens.insert(pair<string,string>("durationeventminutes", "")); + } + } else { + stringTokens.insert(pair<string,string>("name", "")); + stringTokens.insert(pair<string,string>("shorttext", "")); + stringTokens.insert(pair<string,string>("description", "")); + stringTokens.insert(pair<string,string>("date", "")); + stringTokens.insert(pair<string,string>("time", "")); + stringTokens.insert(pair<string,string>("durationminutes", "")); + stringTokens.insert(pair<string,string>("durationeventminutes", "")); + } + SetScraperTokens(NULL, recording, stringTokens, intTokens, loopTokens); + DrawViewElement(veOnPause, &stringTokens, &intTokens, &loopTokens); +} + +void cDisplayReplayOnPauseView::Action(void) { + DoSleep(delay); + if (!Running()) + return; + Render(); + SetInitFinished(); + FadeIn(); + DoFlush(); +} diff --git a/views/displayreplayonpauseview.h b/views/displayreplayonpauseview.h new file mode 100644 index 0000000..6c50ce6 --- /dev/null +++ b/views/displayreplayonpauseview.h @@ -0,0 +1,18 @@ +#ifndef __DISPLAYREPLAYONPAUSEVIEW_H +#define __DISPLAYREPLAYONPAUSEVIEW_H + +#include "../libtemplate/template.h" +#include "view.h" +#include "viewhelpers.h" + +class cDisplayReplayOnPauseView : public cView, public cViewHelpers { +private: + int delay; + virtual void Action(void); +public: + cDisplayReplayOnPauseView(cTemplateViewElement *tmplViewElement); + virtual ~cDisplayReplayOnPauseView(); + void Render(void); + void Flush(void) { DoFlush(); }; +}; +#endif //__DISPLAYREPLAYONPAUSEVIEW_H diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 680eea6..299978f 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -5,6 +5,7 @@ #include "../libcore/helpers.h" cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) { + onPauseView = NULL; lastDate = ""; numMarksLast = 0; lastMarks = NULL; @@ -17,6 +18,9 @@ cDisplayReplayView::~cDisplayReplayView() { if (lastMarks) { delete[] lastMarks; } + if (onPauseView) { + delete onPauseView; + } CancelSave(); FadeOut(); } @@ -369,6 +373,22 @@ void cDisplayReplayView::DrawMessage(eMessageType type, const char *text) { DrawViewElement(veMessage, &stringTokens, &intTokens); } +void cDisplayReplayView::DrawOnPause(bool modeOnly) { + eViewElement veTmplOnPause = modeOnly ? veOnPauseModeOnly : veOnPause; + cTemplateViewElement *tmplOnPause = tmplView->GetViewElement(veTmplOnPause); + if (!tmplOnPause) + return; + onPauseView = new cDisplayReplayOnPauseView(tmplOnPause); + onPauseView->Start(); +} + +void cDisplayReplayView::ClearOnPause(void) { + if (onPauseView) { + delete onPauseView; + onPauseView = NULL; + } +} + /**************************************************************************************** * Private Functions *****************************************************************************************/ diff --git a/views/displayreplayview.h b/views/displayreplayview.h index e637214..cf94a4a 100644 --- a/views/displayreplayview.h +++ b/views/displayreplayview.h @@ -3,9 +3,11 @@ #include "../libtemplate/template.h" #include "view.h" +#include "displayreplayonpauseview.h" class cDisplayReplayView : public cView { private: + cDisplayReplayOnPauseView *onPauseView; cString lastDate; int numMarksLast; int *lastMarks; @@ -29,6 +31,8 @@ public: void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly); void DrawJump(const char *jump); void DrawMessage(eMessageType type, const char *text); + void DrawOnPause(bool modeOnly); + void ClearOnPause(void); void DoFadeIn(void) { Start(); }; void Flush(void) { DoFlush(); }; }; diff --git a/views/view.c b/views/view.c index 864eb45..2b9c4bf 100644 --- a/views/view.c +++ b/views/view.c @@ -73,7 +73,7 @@ void cView::Stop(void) { void cView::DrawViewElement(eViewElement ve, map <string,string> *stringTokens, map <string,int> *intTokens, map < string, vector< map< string, string > > > *loopTokens) {
//setting correct ViewElement, depending which constructor was used
cTemplateViewElement *viewElement;
- if (tmplItem && ve == veMenuCurrentItemDetail) {
+ if (tmplItem && (ve == veMenuCurrentItemDetail || ve == veOnPause)) {
viewElement = tmplItem;
} else if (tmplView) {
viewElement = tmplView->GetViewElement(ve);
@@ -84,7 +84,6 @@ void cView::DrawViewElement(eViewElement ve, map <string,string> *stringTokens, if (viewElement->DebugTokens()) {
DebugTokens(tmplView ? (tmplView->GetViewElementName(ve)) : "current view", stringTokens, intTokens, loopTokens);
}
-
//iterate through pixmaps of viewelement
int pixCurrent = viewElement->GetPixOffset();
if (pixCurrent < 0)
diff --git a/views/viewhelpers.c b/views/viewhelpers.c index abb46a3..38a332d 100644 --- a/views/viewhelpers.c +++ b/views/viewhelpers.c @@ -1,4 +1,5 @@ #include <vdr/menu.h> +#include "../services/scraper2vdr.h" #include "../config.h" #include "../libcore/helpers.h" #include "viewhelpers.h" @@ -168,3 +169,208 @@ bool cViewHelpers::CheckNewMails(void) { return false; } +void cViewHelpers::SetScraperTokens(const cEvent *event, const cRecording *recording, map < string, string > &stringTokens, map < string, int > &intTokens, map < string, vector< map< string, string > > > &loopTokens) { + static cPlugin *pScraper = GetScraperPlugin(); + if (!pScraper || (!event && !recording)) { + intTokens.insert(pair<string,int>("ismovie", false)); + intTokens.insert(pair<string,int>("isseries", false)); + return; + } + + ScraperGetEventType getType; + getType.event = event; + getType.recording = recording; + if (!pScraper->Service("GetEventType", &getType)) { + intTokens.insert(pair<string,int>("ismovie", false)); + intTokens.insert(pair<string,int>("isseries", false)); + return; + } + + if (getType.type == tMovie) { + cMovie movie; + movie.movieId = getType.movieId; + pScraper->Service("GetMovie", &movie); + intTokens.insert(pair<string,int>("ismovie", true)); + intTokens.insert(pair<string,int>("isseries", false)); + + stringTokens.insert(pair<string,string>("movietitle", movie.title)); + stringTokens.insert(pair<string,string>("movieoriginalTitle", movie.originalTitle)); + stringTokens.insert(pair<string,string>("movietagline", movie.tagline)); + stringTokens.insert(pair<string,string>("movieoverview", movie.overview)); + stringTokens.insert(pair<string,string>("moviegenres", movie.genres)); + stringTokens.insert(pair<string,string>("moviehomepage", movie.homepage)); + stringTokens.insert(pair<string,string>("moviereleasedate", movie.releaseDate)); + stringstream pop; + pop << movie.popularity; + stringTokens.insert(pair<string,string>("moviepopularity", pop.str())); + stringstream vote; + vote << movie.voteAverage; + stringTokens.insert(pair<string,string>("movievoteaverage", pop.str())); + stringTokens.insert(pair<string,string>("posterpath", movie.poster.path)); + stringTokens.insert(pair<string,string>("fanartpath", movie.fanart.path)); + stringTokens.insert(pair<string,string>("collectionposterpath", movie.collectionPoster.path)); + stringTokens.insert(pair<string,string>("collectionfanartpath", movie.collectionFanart.path)); + + intTokens.insert(pair<string,int>("movieadult", movie.adult)); + intTokens.insert(pair<string,int>("moviebudget", movie.budget)); + intTokens.insert(pair<string,int>("movierevenue", movie.revenue)); + intTokens.insert(pair<string,int>("movieruntime", movie.runtime)); + intTokens.insert(pair<string,int>("posterwidth", movie.poster.width)); + intTokens.insert(pair<string,int>("posterheight", movie.poster.height)); + intTokens.insert(pair<string,int>("fanartwidth", movie.fanart.width)); + intTokens.insert(pair<string,int>("fanartheight", movie.fanart.height)); + intTokens.insert(pair<string,int>("collectionposterwidth", movie.collectionPoster.width)); + intTokens.insert(pair<string,int>("collectionposterheight", movie.collectionPoster.height)); + intTokens.insert(pair<string,int>("collectionfanartwidth", movie.collectionFanart.width)); + intTokens.insert(pair<string,int>("collectionfanartheight", movie.collectionFanart.height)); + + vector< map< string, string > > actors; + for (vector<cActor>::iterator act = movie.actors.begin(); act != movie.actors.end(); act++) { + map< string, string > actor; + actor.insert(pair<string, string>("actors[name]", (*act).name)); + actor.insert(pair<string, string>("actors[role]", (*act).role)); + actor.insert(pair<string, string>("actors[thumb]", (*act).actorThumb.path)); + stringstream actWidth, actHeight; + actWidth << (*act).actorThumb.width; + actHeight << (*act).actorThumb.height; + actor.insert(pair<string, string>("actors[thumbwidth]", actWidth.str())); + actor.insert(pair<string, string>("actors[thumbheight]", actHeight.str())); + actors.push_back(actor); + } + loopTokens.insert(pair<string, vector< map< string, string > > >("actors", actors)); + + } else if (getType.type == tSeries) { + cSeries series; + series.seriesId = getType.seriesId; + series.episodeId = getType.episodeId; + pScraper->Service("GetSeries", &series); + intTokens.insert(pair<string,int>("ismovie", false)); + intTokens.insert(pair<string,int>("isseries", true)); + //Series Basics + stringTokens.insert(pair<string,string>("seriesname", series.name)); + stringTokens.insert(pair<string,string>("seriesoverview", series.overview)); + stringTokens.insert(pair<string,string>("seriesfirstaired", series.firstAired)); + stringTokens.insert(pair<string,string>("seriesnetwork", series.network)); + stringTokens.insert(pair<string,string>("seriesgenre", series.genre)); + stringstream rating; + rating << series.rating; + stringTokens.insert(pair<string,string>("seriesrating", rating.str())); + stringTokens.insert(pair<string,string>("seriesstatus", series.status)); + //Episode Information + intTokens.insert(pair<string,int>("episodenumber", series.episode.number)); + intTokens.insert(pair<string,int>("episodeseason", series.episode.season)); + stringTokens.insert(pair<string,string>("episodetitle", series.episode.name)); + stringTokens.insert(pair<string,string>("episodefirstaired", series.episode.firstAired)); + stringTokens.insert(pair<string,string>("episodegueststars", series.episode.guestStars)); + stringTokens.insert(pair<string,string>("episodeoverview", series.episode.overview)); + stringstream eprating; + eprating << series.episode.rating; + stringTokens.insert(pair<string,string>("episoderating", eprating.str())); + intTokens.insert(pair<string,int>("episodeimagewidth", series.episode.episodeImage.width)); + intTokens.insert(pair<string,int>("episodeimageheight", series.episode.episodeImage.height)); + stringTokens.insert(pair<string,string>("episodeimagepath", series.episode.episodeImage.path)); + //Seasonposter + intTokens.insert(pair<string,int>("seasonposterwidth", series.seasonPoster.width)); + intTokens.insert(pair<string,int>("seasonposterheight", series.seasonPoster.height)); + stringTokens.insert(pair<string,string>("seasonposterpath", series.seasonPoster.path)); + + //Posters + int current = 1; + for(vector<cTvMedia>::iterator poster = series.posters.begin(); poster != series.posters.end(); poster++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesposter" << current << "width"; + labelHeight << "seriesposter" << current << "height"; + labelPath << "seriesposter" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), (*poster).width)); + intTokens.insert(pair<string,int>(labelHeight.str(), (*poster).height)); + stringTokens.insert(pair<string,string>(labelPath.str(), (*poster).path)); + current++; + } + if (current < 3) { + for (; current < 4; current++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesposter" << current << "width"; + labelHeight << "seriesposter" << current << "height"; + labelPath << "seriesposter" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), 0)); + intTokens.insert(pair<string,int>(labelHeight.str(), 0)); + stringTokens.insert(pair<string,string>(labelPath.str(), "")); + } + } + + //Banners + current = 1; + for(vector<cTvMedia>::iterator banner = series.banners.begin(); banner != series.banners.end(); banner++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesbanner" << current << "width"; + labelHeight << "seriesbanner" << current << "height"; + labelPath << "seriesbanner" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), (*banner).width)); + intTokens.insert(pair<string,int>(labelHeight.str(), (*banner).height)); + stringTokens.insert(pair<string,string>(labelPath.str(), (*banner).path)); + current++; + } + if (current < 3) { + for (; current < 4; current++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesbanner" << current << "width"; + labelHeight << "seriesbanner" << current << "height"; + labelPath << "seriesbanner" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), 0)); + intTokens.insert(pair<string,int>(labelHeight.str(), 0)); + stringTokens.insert(pair<string,string>(labelPath.str(), "")); + } + } + + //Fanarts + current = 1; + for(vector<cTvMedia>::iterator fanart = series.fanarts.begin(); fanart != series.fanarts.end(); fanart++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesfanart" << current << "width"; + labelHeight << "seriesfanart" << current << "height"; + labelPath << "seriesfanart" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), (*fanart).width)); + intTokens.insert(pair<string,int>(labelHeight.str(), (*fanart).height)); + stringTokens.insert(pair<string,string>(labelPath.str(), (*fanart).path)); + current++; + } + if (current < 3) { + for (; current < 4; current++) { + stringstream labelWidth, labelHeight, labelPath; + labelWidth << "seriesfanart" << current << "width"; + labelHeight << "seriesfanart" << current << "height"; + labelPath << "seriesfanart" << current << "path"; + + intTokens.insert(pair<string,int>(labelWidth.str(), 0)); + intTokens.insert(pair<string,int>(labelHeight.str(), 0)); + stringTokens.insert(pair<string,string>(labelPath.str(), "")); + } + } + + //Actors + vector< map< string, string > > actors; + for (vector<cActor>::iterator act = series.actors.begin(); act != series.actors.end(); act++) { + map< string, string > actor; + actor.insert(pair<string, string>("actors[name]", (*act).name)); + actor.insert(pair<string, string>("actors[role]", (*act).role)); + actor.insert(pair<string, string>("actors[thumb]", (*act).actorThumb.path)); + stringstream actWidth, actHeight; + actWidth << (*act).actorThumb.width; + actHeight << (*act).actorThumb.height; + actor.insert(pair<string, string>("actors[thumbwidth]", actWidth.str())); + actor.insert(pair<string, string>("actors[thumbheight]", actHeight.str())); + actors.push_back(actor); + } + loopTokens.insert(pair<string, vector< map< string, string > > >("actors", actors)); + + } else { + intTokens.insert(pair<string,int>("ismovie", false)); + intTokens.insert(pair<string,int>("isseries", false)); + } + +} diff --git a/views/viewhelpers.h b/views/viewhelpers.h index 7946b53..8e57bb4 100644 --- a/views/viewhelpers.h +++ b/views/viewhelpers.h @@ -11,6 +11,7 @@ protected: void InitDevices(void); bool SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices); bool CheckNewMails(void); + void SetScraperTokens(const cEvent *event, const cRecording *recording, map < string, string > &stringTokens, map < string, int > &intTokens, map < string, vector< map< string, string > > > &loopTokens); public: cViewHelpers(void); virtual ~cViewHelpers(void); |