diff options
| author | louis <louis.braun@gmx.de> | 2014-10-05 17:03:38 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2014-10-05 17:03:38 +0200 |
| commit | 797e33441e1026c5d71ac824700207dd6464348f (patch) | |
| tree | 75a6332d24bea47eea0465f842633fb308b11ec7 /views/displaymenuitemcurrentview.c | |
| parent | e14982a4be688e39bb727c91c7545b2c152d5f71 (diff) | |
| download | vdr-plugin-skindesigner-797e33441e1026c5d71ac824700207dd6464348f.tar.gz vdr-plugin-skindesigner-797e33441e1026c5d71ac824700207dd6464348f.tar.bz2 | |
added {durationhours} and {durationminutes} tokens in several view elements
Diffstat (limited to 'views/displaymenuitemcurrentview.c')
| -rw-r--r-- | views/displaymenuitemcurrentview.c | 16 |
1 files changed, 15 insertions, 1 deletions
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); } |
