2015-03-28 11:57:51 +01:00
|
|
|
#include "displayviewelements.h"
|
|
|
|
|
2015-04-01 13:26:36 +02:00
|
|
|
cViewElementDevices::cViewElementDevices(bool light, cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
|
|
|
this->light = light;
|
2015-03-28 11:57:51 +01:00
|
|
|
init = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementDevices::Render(void) {
|
|
|
|
ClearTokens();
|
2015-05-10 12:55:23 +02:00
|
|
|
map < string, vector<stringmap> > deviceLoopTokens;
|
|
|
|
vector<stringmap> devices;
|
2015-03-28 11:57:51 +01:00
|
|
|
|
|
|
|
if (init)
|
|
|
|
InitDevices();
|
2015-04-01 13:26:36 +02:00
|
|
|
bool changed = SetDevices(init, light, &intTokens, &devices);
|
2015-03-28 11:57:51 +01:00
|
|
|
init = false;
|
|
|
|
|
|
|
|
if (!changed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
deviceLoopTokens.insert(pair< string, vector< map< string, string > > >("devices", devices));
|
|
|
|
|
|
|
|
ClearViewElement(veDevices);
|
|
|
|
DrawViewElement(veDevices, &stringTokens, &intTokens, &deviceLoopTokens);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
|
|
|
cViewElementScraperContent::cViewElementScraperContent(const cEvent *event, ScraperContentType type, cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
|
|
|
this->event = event;
|
|
|
|
this->type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementScraperContent::Render(void) {
|
|
|
|
ClearTokens();
|
|
|
|
SetPosterBanner(event, stringTokens, intTokens);
|
|
|
|
ClearViewElement(veScraperContent);
|
|
|
|
DrawViewElement(veScraperContent, &stringTokens, &intTokens);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
|
|
|
cViewElementCustomTokens::cViewElementCustomTokens(cTemplateViewElement *tmplViewElement, cTemplateView *tmplView) : cViewElement(tmplViewElement) {
|
|
|
|
this->tmplView = tmplView;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementCustomTokens::Render(void) {
|
|
|
|
ClearTokens();
|
|
|
|
if (!tmplView)
|
|
|
|
return false;
|
|
|
|
stringTokens = tmplView->GetCustomStringTokens();
|
|
|
|
intTokens = tmplView->GetCustomIntTokens();
|
|
|
|
|
|
|
|
ClearViewElement(veCustomTokens);
|
|
|
|
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
|
|
|
cViewElementTimers::cViewElementTimers(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementTimers::Render(void) {
|
|
|
|
ClearTokens();
|
|
|
|
map < string, vector< map< string, string > > > timerLoopTokens;
|
|
|
|
vector< map< string, string > > timers;
|
|
|
|
|
|
|
|
SetTimers(&intTokens, &stringTokens, &timers);
|
|
|
|
timerLoopTokens.insert(pair< string, vector< map< string, string > > >("timers", timers));
|
|
|
|
|
|
|
|
ClearViewElement(veTimers);
|
|
|
|
DrawViewElement(veTimers, &stringTokens, &intTokens, &timerLoopTokens);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
2015-03-29 13:29:59 +02:00
|
|
|
cViewElementLastRecordings::cViewElementLastRecordings(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementLastRecordings::Render(void) {
|
|
|
|
ClearTokens();
|
|
|
|
map < string, vector< map< string, string > > > recordingLoopTokens;
|
|
|
|
vector< map< string, string > > lastRecordings;
|
|
|
|
|
|
|
|
SetLastRecordings(&intTokens, &stringTokens, &lastRecordings);
|
|
|
|
recordingLoopTokens.insert(pair< string, vector< map< string, string > > >("recordings", lastRecordings));
|
|
|
|
|
|
|
|
ClearViewElement(veLastRecordings);
|
|
|
|
DrawViewElement(veLastRecordings, &stringTokens, &intTokens, &recordingLoopTokens);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
2015-05-10 12:55:23 +02:00
|
|
|
cViewElementCurrentSchedule::cViewElementCurrentSchedule(cTemplateViewElement *tmplViewElement, string currentRecording) : cViewElement(tmplViewElement) {
|
|
|
|
this->currentRecording = currentRecording;
|
2015-03-28 11:57:51 +01:00
|
|
|
}
|
|
|
|
|
2015-05-10 12:55:23 +02:00
|
|
|
bool cViewElementCurrentSchedule::Render(void) {
|
2015-03-28 11:57:51 +01:00
|
|
|
ClearTokens();
|
2015-05-10 12:55:23 +02:00
|
|
|
SetCurrentSchedule(currentRecording, stringTokens, intTokens);
|
|
|
|
ClearViewElement(veCurrentSchedule);
|
|
|
|
DrawViewElement(veCurrentSchedule, &stringTokens, &intTokens);
|
2015-03-28 11:57:51 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
2015-05-10 12:55:23 +02:00
|
|
|
cViewElementMenuHeader::cViewElementMenuHeader(cTemplateViewElement *tmplViewElement, eMenuCategory cat, string menuTitle) : cViewElement(tmplViewElement) {
|
|
|
|
this->cat = cat;
|
|
|
|
this->menuTitle = menuTitle;
|
2015-03-28 11:57:51 +01:00
|
|
|
}
|
|
|
|
|
2015-05-10 12:55:23 +02:00
|
|
|
bool cViewElementMenuHeader::Render(void) {
|
2015-03-28 11:57:51 +01:00
|
|
|
ClearTokens();
|
2015-05-10 12:55:23 +02:00
|
|
|
SetMenuHeader(cat, menuTitle, stringTokens, intTokens);
|
|
|
|
ClearViewElement(veHeader);
|
|
|
|
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
2015-03-28 11:57:51 +01:00
|
|
|
return true;
|
|
|
|
}
|
2015-05-14 11:26:30 +02:00
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
|
|
|
cViewElementMenuMessage::cViewElementMenuMessage(cTemplateViewElement *tmplViewElement, eMessageType type, string text) : cViewElement(tmplViewElement) {
|
|
|
|
this->type = type;
|
|
|
|
this->text = text;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cViewElementMenuMessage::Render(void) {
|
|
|
|
ClearTokens();
|
|
|
|
SetMenuMessage(type, text, stringTokens, intTokens);
|
|
|
|
ClearViewElement(veMessage);
|
|
|
|
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
|
|
|
return true;
|
|
|
|
}
|