summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-05 17:03:38 +0200
committerlouis <louis.braun@gmx.de>2014-10-05 17:03:38 +0200
commit797e33441e1026c5d71ac824700207dd6464348f (patch)
tree75a6332d24bea47eea0465f842633fb308b11ec7 /views
parente14982a4be688e39bb727c91c7545b2c152d5f71 (diff)
downloadvdr-plugin-skindesigner-797e33441e1026c5d71ac824700207dd6464348f.tar.gz
vdr-plugin-skindesigner-797e33441e1026c5d71ac824700207dd6464348f.tar.bz2
added {durationhours} and {durationminutes} tokens in several view elements
Diffstat (limited to 'views')
-rw-r--r--views/displaychannelview.c10
-rw-r--r--views/displaymenudetailview.c22
-rw-r--r--views/displaymenuitemcurrentview.c16
-rw-r--r--views/displaymenuitemview.c6
4 files changed, 51 insertions, 3 deletions
diff --git a/views/displaychannelview.c b/views/displaychannelview.c
index 79b6bee..da24a5a 100644
--- a/views/displaychannelview.c
+++ b/views/displaychannelview.c
@@ -132,10 +132,12 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next,
stringTokens.insert(pair<string,string>("currentstop", *present->GetEndTimeString()));
intTokens.insert(pair<string,int>("currentduration", present->Duration() / 60));
+ intTokens.insert(pair<string,int>("currentdurationhours", present->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("currentdurationminutes", *cString::sprintf("%.2d", (present->Duration() / 60)%60)));
intTokens.insert(pair<string,int>("currentelapsed", (int)round((time(NULL) - present->StartTime())/60)));
intTokens.insert(pair<string,int>("currentremaining", (int)round((present->EndTime() - time(NULL))/60)));
intTokens.insert(pair<string,int>("currentrecording", presentRecording ? 1 : 0));
- intTokens.insert(pair<string,int>("hasVPS", present->Vps()));
+ intTokens.insert(pair<string,int>("hasVPS", (bool)present->Vps()));
} else {
stringTokens.insert(pair<string,string>("currenttitle", ""));
stringTokens.insert(pair<string,string>("currentsubtitle", ""));
@@ -143,6 +145,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next,
stringTokens.insert(pair<string,string>("currentstop", ""));
intTokens.insert(pair<string,int>("currentduration", 0));
+ intTokens.insert(pair<string,int>("currentdurationhours", 0));
+ stringTokens.insert(pair<string,string>("currentdurationminutes", ""));
intTokens.insert(pair<string,int>("currentelapsed", 0));
intTokens.insert(pair<string,int>("currentremaining", 0));
intTokens.insert(pair<string,int>("currentrecording", 0));
@@ -156,6 +160,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next,
stringTokens.insert(pair<string,string>("nextstop", *next->GetEndTimeString()));
intTokens.insert(pair<string,int>("nextduration", next->Duration() / 60));
+ intTokens.insert(pair<string,int>("nextdurationhours", next->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("nextdurationminutes", *cString::sprintf("%.2d", (next->Duration() / 60)%60)));
intTokens.insert(pair<string,int>("nextrecording", nextRecording ? 1 : 0));
} else {
stringTokens.insert(pair<string,string>("nexttitle", ""));
@@ -164,6 +170,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next,
stringTokens.insert(pair<string,string>("nextstop", ""));
intTokens.insert(pair<string,int>("nextduration", 0));
+ intTokens.insert(pair<string,int>("nextdurationhours", 0));
+ stringTokens.insert(pair<string,string>("nextdurationminutes", ""));
intTokens.insert(pair<string,int>("nextrecording", 0));
}
DrawViewElement(veEpgInfo, &stringTokens, &intTokens);
diff --git a/views/displaymenudetailview.c b/views/displaymenudetailview.c
index acba9c6..3554f97 100644
--- a/views/displaymenudetailview.c
+++ b/views/displaymenudetailview.c
@@ -118,7 +118,9 @@ void cDisplayMenuDetailView::SetTokens(void) {
intTokens.insert(pair<string,int>("elapsed", 0));
}
intTokens.insert(pair<string,int>("duration", event->Duration() / 60));
-
+ intTokens.insert(pair<string,int>("durationhours", event->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60)));
+
vector< map< string, string > > reruns;
bool hasReruns = LoadReruns(&reruns);
loopTokens.insert(pair<string, vector< map< string, string > > >("reruns", reruns));
@@ -151,7 +153,11 @@ void cDisplayMenuDetailView::SetTokens(void) {
stringTokens.insert(pair<string,string>("date", recDate.c_str()));
stringTokens.insert(pair<string,string>("time", recTime.c_str()));
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", ""));
@@ -161,7 +167,11 @@ void cDisplayMenuDetailView::SetTokens(void) {
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", ""));
}
LoadRecordingInformation();
SetScraperTokens();
@@ -804,6 +814,8 @@ void cDisplayMenuDetailView::DrawHeader(void) {
headerIntTokens.insert(pair<string,int>("elapsed", 0));
}
headerIntTokens.insert(pair<string,int>("duration", event->Duration() / 60));
+ headerIntTokens.insert(pair<string,int>("durationhours", event->Duration() / 3600));
+ headerStringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60)));
stringstream epgImageName;
epgImageName << event->EventID();
@@ -846,7 +858,11 @@ void cDisplayMenuDetailView::DrawHeader(void) {
headerStringTokens.insert(pair<string,string>("date", recDate.c_str()));
headerStringTokens.insert(pair<string,string>("time", recTime.c_str()));
headerIntTokens.insert(pair<string,int>("duration", recDuration));
+ headerIntTokens.insert(pair<string,int>("durationhours", recDuration / 60));
+ headerStringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60)));
headerIntTokens.insert(pair<string,int>("durationevent", duration));
+ headerIntTokens.insert(pair<string,int>("durationeventhours", duration / 60));
+ headerStringTokens.insert(pair<string,string>("durationeventminutes", *cString::sprintf("%.2d", duration%60)));
}
} else {
headerStringTokens.insert(pair<string,string>("shorttext", ""));
@@ -855,7 +871,11 @@ void cDisplayMenuDetailView::DrawHeader(void) {
headerStringTokens.insert(pair<string,string>("date", ""));
headerStringTokens.insert(pair<string,string>("time", ""));
headerIntTokens.insert(pair<string,int>("duration", recDuration));
+ headerIntTokens.insert(pair<string,int>("durationhours", recDuration / 60));
+ headerStringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60)));
headerIntTokens.insert(pair<string,int>("durationevent", 0));
+ headerIntTokens.insert(pair<string,int>("durationeventhours", 0));
+ headerStringTokens.insert(pair<string,string>("durationeventminutes", ""));
}
string recImage = "";
diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c
index a615794..13f27c7 100644
--- a/views/displaymenuitemcurrentview.c
+++ b/views/displaymenuitemcurrentview.c
@@ -151,6 +151,8 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) {
intTokens.insert(pair<string,int>("elapsed", 0));
}
intTokens.insert(pair<string,int>("duration", event->Duration() / 60));
+ intTokens.insert(pair<string,int>("durationhours", event->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60)));
SetScraperPoster(event);
}
if (channel) {
@@ -266,6 +268,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) {
stringTokens.insert(pair<string,string>("presenteventdate", *ShortDateString(presentEvent->StartTime())));
intTokens.insert(pair<string,int>("presenteventelapsed", (time(0) - presentEvent->StartTime())/60));
intTokens.insert(pair<string,int>("presenteventduration", presentEvent->Duration() / 60));
+ intTokens.insert(pair<string,int>("presenteventdurationhours", presentEvent->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("presenteventdurationminutes", *cString::sprintf("%.2d", (presentEvent->Duration() / 60)%60)));
SetScraperPoster(presentEvent);
} else {
stringTokens.insert(pair<string,string>("presenteventtitle", ""));
@@ -276,7 +280,9 @@ void cDisplayMenuItemCurrentChannelView::Render(void) {
stringTokens.insert(pair<string,string>("presenteventday", ""));
stringTokens.insert(pair<string,string>("presenteventdate", ""));
intTokens.insert(pair<string,int>("presenteventelapsed", 0));
- intTokens.insert(pair<string,int>("presenteventduration", 0));
+ intTokens.insert(pair<string,int>("presenteventduration", 0));
+ intTokens.insert(pair<string,int>("presenteventdurationhours", 0));
+ stringTokens.insert(pair<string,string>("presenteventdurationminutes", ""));
}
const cList<cEvent> *events = schedule->Events();
bool inserted = false;
@@ -291,6 +297,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) {
stringTokens.insert(pair<string,string>("nexteventday", *WeekDayName(nextEvent->StartTime())));
stringTokens.insert(pair<string,string>("nexteventdate", *ShortDateString(nextEvent->StartTime())));
intTokens.insert(pair<string,int>("nexteventduration", nextEvent->Duration() / 60));
+ intTokens.insert(pair<string,int>("nexteventdurationhours", nextEvent->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("nexteventdurationminutes", *cString::sprintf("%.2d", (nextEvent->Duration() / 60)%60)));
inserted = true;
}
}
@@ -303,6 +311,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) {
stringTokens.insert(pair<string,string>("nexteventday", ""));
stringTokens.insert(pair<string,string>("nexteventdate", ""));
intTokens.insert(pair<string,int>("nexteventduration", 0));
+ intTokens.insert(pair<string,int>("nexteventdurationhours", 0));
+ stringTokens.insert(pair<string,string>("nexteventdurationminutes", ""));
}
}
@@ -535,7 +545,11 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) {
stringTokens.insert(pair<string,string>("date", recDate.c_str()));
stringTokens.insert(pair<string,string>("time", recTime.c_str()));
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)));
SetTokensPosMenuItem();
DrawViewElement(veMenuCurrentItemDetail, &stringTokens, &intTokens);
}
diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c
index 58473df..bbc8a96 100644
--- a/views/displaymenuitemview.c
+++ b/views/displaymenuitemview.c
@@ -314,6 +314,8 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
intTokens.insert(pair<string,int>("elapsed", 0));
}
intTokens.insert(pair<string,int>("duration", event->Duration() / 60));
+ intTokens.insert(pair<string,int>("durationhours", event->Duration() / 3600));
+ stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60)));
intTokens.insert(pair<string,int>("hasVPS", (bool)event->Vps()));
} else {
stringTokens.insert(pair<string,string>("title", event->Title() ? ParseSeparator(event->Title()) : ""));
@@ -642,7 +644,11 @@ void cDisplayMenuItemRecordingView::SetTokens(void) {
stringTokens.insert(pair<string,string>("date", recDate.c_str()));
stringTokens.insert(pair<string,string>("time", recTime.c_str()));
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)));
static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper || !recording) {