From 797e33441e1026c5d71ac824700207dd6464348f Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 5 Oct 2014 17:03:38 +0200 Subject: [PATCH] added {durationhours} and {durationminutes} tokens in several view elements --- HISTORY | 1 + skins/metrixhd/xmlfiles/displaychannel.xml | 4 ++++ .../metrixhd/xmlfiles/displaymenuchannels.xml | 6 ++++- .../xmlfiles/displaymenudetailepg.xml | 4 ++++ .../xmlfiles/displaymenudetailrecording.xml | 12 ++++++++-- .../xmlfiles/displaymenurecordings.xml | 8 +++++++ .../xmlfiles/displaymenuschedules.xml | 4 ++++ skinskeleton/xmlfiles/displaychannel.xml | 4 ++++ skinskeleton/xmlfiles/displaymenuchannels.xml | 6 ++++- .../xmlfiles/displaymenudetailepg.xml | 4 ++++ .../xmlfiles/displaymenudetailrecording.xml | 16 ++++++++++---- .../xmlfiles/displaymenurecordings.xml | 9 +++++++- .../xmlfiles/displaymenuschedules.xml | 4 ++++ views/displaychannelview.c | 10 ++++++++- views/displaymenudetailview.c | 22 ++++++++++++++++++- views/displaymenuitemcurrentview.c | 16 +++++++++++++- views/displaymenuitemview.c | 6 +++++ 17 files changed, 124 insertions(+), 12 deletions(-) diff --git a/HISTORY b/HISTORY index f4b2260..7d41cab 100644 --- a/HISTORY +++ b/HISTORY @@ -13,3 +13,4 @@ Version 0.0.2 - changed skin handling so that every skin is directly shown in VDR OSD Menu - added Theme support, each skin can now have various themes - fixed a crash if no skindesigner skins are found and plugin setup menu is called from another skin +- added {durationhours} and {durationminutes} tokens in several view elements diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index adda3a7..ba8c347 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -41,6 +41,8 @@ {currentstart} Start of current Schedule in hh:mm {currentstop} End of current Schedule in hh:mm {currentduration} Duration of current Schedule in min + {currentdurationhours} Duration, full hours + {currentdurationminutes} Duration, rest of minutes {currentelapsed} Elapsed time of current Schedule in min {currentremaining} Remaining time of current Schedule in min {currentrecording} true if current Schedule is recorded @@ -50,6 +52,8 @@ {nextstart} Start of next Schedule in hh:mm {nextstop} Stop of next Schedule in hh:mm {nextduration} Duration of next Schedule in min + {nextdurationhours} Duration, full hours + {nextdurationminutes} Duration, rest of minutes {nextrecording} true if next Schedule will be recorded --> diff --git a/skins/metrixhd/xmlfiles/displaymenuchannels.xml b/skins/metrixhd/xmlfiles/displaymenuchannels.xml index cba4cf8..b55fadb 100644 --- a/skins/metrixhd/xmlfiles/displaymenuchannels.xml +++ b/skins/metrixhd/xmlfiles/displaymenuchannels.xml @@ -59,6 +59,8 @@ {presenteventdate} present event date in dd:mm:yy {presenteventelapsed} present event elapsed time {presenteventduration} present event duration + {presenteventdurationhours} duration, full hours + {presenteventdurationminutes} duration, rest of minutes {hasposter} true if a scraped poster is available for this elements present evemt {posterwidth} width of scraped poster {posterheight} height of scraped poster @@ -70,7 +72,9 @@ {nexteventdescription} next event description {nexteventday} next event name of day {nexteventdate} next event date in dd:mm:yy - {nexteventdate} next event duration + {nexteventduration} next event duration + {nexteventdurationhours} duration, full hours + {nexteventdurationminutes} duration, rest of minutes {schedule[]} array with following 10 schedules {schedule[title]} title of event {schedule[shorttext]} shorttext of event diff --git a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml index 7c8c399..8dc473b 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml @@ -95,6 +95,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {ismovie} true if event is scraped as a movie {isseries} true if event is scraped as a series @@ -143,6 +145,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {hasreruns} true if reruns of this event are found {reruns[]} array with reruns diff --git a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml index 2342ecc..47da2cb 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml @@ -91,7 +91,11 @@ {date} date of recording in dd.mm.yy {time} time of current event in hh:mm {duration} real duration of recording in minutes - {durationevent} duration of according event 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 {isseries} true if event is scraped as a series {posteravailable} true if a poster is available @@ -134,7 +138,11 @@ {date} date of recording in dd.mm.yy {time} time of recording in hh:mm {duration} real duration of recording in minutes - {durationevent} duration of according event 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 {recordingsize} size of recording (automatically in GB / MB) {recordingsizecutted} size of cutted recording (automatically in GB / MB) diff --git a/skins/metrixhd/xmlfiles/displaymenurecordings.xml b/skins/metrixhd/xmlfiles/displaymenurecordings.xml index f7d1097..3cd7b28 100644 --- a/skins/metrixhd/xmlfiles/displaymenurecordings.xml +++ b/skins/metrixhd/xmlfiles/displaymenurecordings.xml @@ -5,7 +5,11 @@ {date} Date of recording {time} Time of recording {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 {current} true if item is currently selected {new} true if recording is new {cutted} true if recording is cutted @@ -46,7 +50,11 @@ {date} Date of recording {time} Time of recording {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 {new} true if recording is new {cutted} true if recording is cutted {folder} true if item is a folder diff --git a/skins/metrixhd/xmlfiles/displaymenuschedules.xml b/skins/metrixhd/xmlfiles/displaymenuschedules.xml index 5cc2e76..b24a853 100644 --- a/skins/metrixhd/xmlfiles/displaymenuschedules.xml +++ b/skins/metrixhd/xmlfiles/displaymenuschedules.xml @@ -29,6 +29,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {current} true if item is currently selected {separator} true if item is a list separator {channelname} Channel Name (for what's on now and next) @@ -110,6 +112,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {hasposter} true if a scraped poster is available for this element {posterwidth} width of scraped poster diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml index d46aeb2..d9ce5eb 100644 --- a/skinskeleton/xmlfiles/displaychannel.xml +++ b/skinskeleton/xmlfiles/displaychannel.xml @@ -22,6 +22,8 @@ {currentstart} Start of current Schedule in hh:mm {currentstop} End of current Schedule in hh:mm {currentduration} Duration of current Schedule in min + {currentdurationhours} Duration, full hours + {currentdurationminutes} Duration, rest of minutes {currentelapsed} Elapsed time of current Schedule in min {currentremaining} Remaining time of current Schedule in min {currentrecording} true if current Schedule is recorded @@ -31,6 +33,8 @@ {nextstart} Start of next Schedule in hh:mm {nextstop} Stop of next Schedule in hh:mm {nextduration} Duration of next Schedule in min + {nextdurationhours} Duration, full hours + {nextdurationminutes} Duration, rest of minutes {nextrecording} true if next Schedule will be recorded --> diff --git a/skinskeleton/xmlfiles/displaymenuchannels.xml b/skinskeleton/xmlfiles/displaymenuchannels.xml index 242a754..be8ea3b 100644 --- a/skinskeleton/xmlfiles/displaymenuchannels.xml +++ b/skinskeleton/xmlfiles/displaymenuchannels.xml @@ -48,6 +48,8 @@ {presenteventdate} present event date in dd:mm:yy {presenteventelapsed} present event elapsed time {presenteventduration} present event duration + {presenteventdurationhours} duration, full hours + {presenteventdurationminutes} duration, rest of minutes {hasposter} true if a scraped poster is available for this elements present evemt {posterwidth} width of scraped poster {posterheight} height of scraped poster @@ -59,7 +61,9 @@ {nexteventdescription} next event description {nexteventday} next event name of day {nexteventdate} next event date in dd:mm:yy - {nexteventdate} next event duration + {nexteventduration} next event duration + {nexteventdurationhours} duration, full hours + {nexteventdurationminutes} duration, rest of minutes {schedule[]} array with following 10 schedules {schedule[title]} title of event {schedule[shorttext]} shorttext of event diff --git a/skinskeleton/xmlfiles/displaymenudetailepg.xml b/skinskeleton/xmlfiles/displaymenudetailepg.xml index 66d5399..dcfcb2a 100644 --- a/skinskeleton/xmlfiles/displaymenudetailepg.xml +++ b/skinskeleton/xmlfiles/displaymenudetailepg.xml @@ -9,6 +9,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {ismovie} true if event is scraped as a movie {isseries} true if event is scraped as a series @@ -37,6 +39,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {hasreruns} true if reruns of this event are found {reruns[]} array with reruns diff --git a/skinskeleton/xmlfiles/displaymenudetailrecording.xml b/skinskeleton/xmlfiles/displaymenudetailrecording.xml index 0587e55..972d72e 100644 --- a/skinskeleton/xmlfiles/displaymenudetailrecording.xml +++ b/skinskeleton/xmlfiles/displaymenudetailrecording.xml @@ -4,8 +4,12 @@ {shorttext} shorttext of recording {date} date of recording in dd.mm.yy {time} time of current event in hh:mm - {duration} real duration of recording in minutes - {durationevent} duration of according event in minutes + {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 {isseries} true if event is scraped as a series {posteravailable} true if a poster is available @@ -27,8 +31,12 @@ {description} description of recording {date} date of recording in dd.mm.yy {time} time of recording in hh:mm - {duration} real duration of recording in minutes - {durationevent} duration of according event in minutes + {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 {recordingsize} size of recording (automatically in GB / MB) {recordingsizecutted} size of cutted recording (automatically in GB / MB) diff --git a/skinskeleton/xmlfiles/displaymenurecordings.xml b/skinskeleton/xmlfiles/displaymenurecordings.xml index ca4023d..832bd3f 100644 --- a/skinskeleton/xmlfiles/displaymenurecordings.xml +++ b/skinskeleton/xmlfiles/displaymenurecordings.xml @@ -5,7 +5,11 @@ {date} Date of recording {time} Time of recording {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 {current} true if item is currently selected {new} true if recording is new {cutted} true if recording is cutted @@ -31,8 +35,11 @@ {date} Date of recording {time} Time of recording {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 - {new} true if recording is new + {durationeventhours} event duration, full hours + {durationeventminutes} event duration, rest of minutes {new} true if recording is new {cutted} true if recording is cutted {folder} true if item is a folder {numrecordingsfolder} if item is a folder, number of recordings in this folder diff --git a/skinskeleton/xmlfiles/displaymenuschedules.xml b/skinskeleton/xmlfiles/displaymenuschedules.xml index 0144bfd..39ab906 100644 --- a/skinskeleton/xmlfiles/displaymenuschedules.xml +++ b/skinskeleton/xmlfiles/displaymenuschedules.xml @@ -24,6 +24,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {current} true if item is currently selected {separator} true if item is a list separator {channelname} Channel Name (for what's on now and next) @@ -52,6 +54,8 @@ {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event + {durationhours} duration, full hours + {durationminutes} duration, rest of minutes {channelid} ChannelID as path to display channel logo {hasposter} true if a scraped poster is available for this element {posterwidth} width of scraped poster 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("currentstop", *present->GetEndTimeString())); intTokens.insert(pair("currentduration", present->Duration() / 60)); + intTokens.insert(pair("currentdurationhours", present->Duration() / 3600)); + stringTokens.insert(pair("currentdurationminutes", *cString::sprintf("%.2d", (present->Duration() / 60)%60))); intTokens.insert(pair("currentelapsed", (int)round((time(NULL) - present->StartTime())/60))); intTokens.insert(pair("currentremaining", (int)round((present->EndTime() - time(NULL))/60))); intTokens.insert(pair("currentrecording", presentRecording ? 1 : 0)); - intTokens.insert(pair("hasVPS", present->Vps())); + intTokens.insert(pair("hasVPS", (bool)present->Vps())); } else { stringTokens.insert(pair("currenttitle", "")); stringTokens.insert(pair("currentsubtitle", "")); @@ -143,6 +145,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next, stringTokens.insert(pair("currentstop", "")); intTokens.insert(pair("currentduration", 0)); + intTokens.insert(pair("currentdurationhours", 0)); + stringTokens.insert(pair("currentdurationminutes", "")); intTokens.insert(pair("currentelapsed", 0)); intTokens.insert(pair("currentremaining", 0)); intTokens.insert(pair("currentrecording", 0)); @@ -156,6 +160,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next, stringTokens.insert(pair("nextstop", *next->GetEndTimeString())); intTokens.insert(pair("nextduration", next->Duration() / 60)); + intTokens.insert(pair("nextdurationhours", next->Duration() / 3600)); + stringTokens.insert(pair("nextdurationminutes", *cString::sprintf("%.2d", (next->Duration() / 60)%60))); intTokens.insert(pair("nextrecording", nextRecording ? 1 : 0)); } else { stringTokens.insert(pair("nexttitle", "")); @@ -164,6 +170,8 @@ void cDisplayChannelView::DrawEPGInfo(const cEvent *present, const cEvent *next, stringTokens.insert(pair("nextstop", "")); intTokens.insert(pair("nextduration", 0)); + intTokens.insert(pair("nextdurationhours", 0)); + stringTokens.insert(pair("nextdurationminutes", "")); intTokens.insert(pair("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("elapsed", 0)); } intTokens.insert(pair("duration", event->Duration() / 60)); - + intTokens.insert(pair("durationhours", event->Duration() / 3600)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60))); + vector< map< string, string > > reruns; bool hasReruns = LoadReruns(&reruns); loopTokens.insert(pair > >("reruns", reruns)); @@ -151,7 +153,11 @@ void cDisplayMenuDetailView::SetTokens(void) { stringTokens.insert(pair("date", recDate.c_str())); stringTokens.insert(pair("time", recTime.c_str())); intTokens.insert(pair("duration", recDuration)); + intTokens.insert(pair("durationhours", recDuration / 60)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); intTokens.insert(pair("durationevent", duration)); + intTokens.insert(pair("durationeventhours", duration / 60)); + stringTokens.insert(pair("durationeventminutes", *cString::sprintf("%.2d", duration%60))); } } else { stringTokens.insert(pair("shorttext", "")); @@ -161,7 +167,11 @@ void cDisplayMenuDetailView::SetTokens(void) { stringTokens.insert(pair("date", "")); stringTokens.insert(pair("time", "")); intTokens.insert(pair("duration", recDuration)); + intTokens.insert(pair("durationhours", recDuration / 60)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); intTokens.insert(pair("durationevent", 0)); + intTokens.insert(pair("durationeventhours", 0)); + stringTokens.insert(pair("durationeventminutes", "")); } LoadRecordingInformation(); SetScraperTokens(); @@ -804,6 +814,8 @@ void cDisplayMenuDetailView::DrawHeader(void) { headerIntTokens.insert(pair("elapsed", 0)); } headerIntTokens.insert(pair("duration", event->Duration() / 60)); + headerIntTokens.insert(pair("durationhours", event->Duration() / 3600)); + headerStringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60))); stringstream epgImageName; epgImageName << event->EventID(); @@ -846,7 +858,11 @@ void cDisplayMenuDetailView::DrawHeader(void) { headerStringTokens.insert(pair("date", recDate.c_str())); headerStringTokens.insert(pair("time", recTime.c_str())); headerIntTokens.insert(pair("duration", recDuration)); + headerIntTokens.insert(pair("durationhours", recDuration / 60)); + headerStringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); headerIntTokens.insert(pair("durationevent", duration)); + headerIntTokens.insert(pair("durationeventhours", duration / 60)); + headerStringTokens.insert(pair("durationeventminutes", *cString::sprintf("%.2d", duration%60))); } } else { headerStringTokens.insert(pair("shorttext", "")); @@ -855,7 +871,11 @@ void cDisplayMenuDetailView::DrawHeader(void) { headerStringTokens.insert(pair("date", "")); headerStringTokens.insert(pair("time", "")); headerIntTokens.insert(pair("duration", recDuration)); + headerIntTokens.insert(pair("durationhours", recDuration / 60)); + headerStringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); headerIntTokens.insert(pair("durationevent", 0)); + headerIntTokens.insert(pair("durationeventhours", 0)); + headerStringTokens.insert(pair("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("elapsed", 0)); } intTokens.insert(pair("duration", event->Duration() / 60)); + intTokens.insert(pair("durationhours", event->Duration() / 3600)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60))); SetScraperPoster(event); } if (channel) { @@ -266,6 +268,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) { stringTokens.insert(pair("presenteventdate", *ShortDateString(presentEvent->StartTime()))); intTokens.insert(pair("presenteventelapsed", (time(0) - presentEvent->StartTime())/60)); intTokens.insert(pair("presenteventduration", presentEvent->Duration() / 60)); + intTokens.insert(pair("presenteventdurationhours", presentEvent->Duration() / 3600)); + stringTokens.insert(pair("presenteventdurationminutes", *cString::sprintf("%.2d", (presentEvent->Duration() / 60)%60))); SetScraperPoster(presentEvent); } else { stringTokens.insert(pair("presenteventtitle", "")); @@ -276,7 +280,9 @@ void cDisplayMenuItemCurrentChannelView::Render(void) { stringTokens.insert(pair("presenteventday", "")); stringTokens.insert(pair("presenteventdate", "")); intTokens.insert(pair("presenteventelapsed", 0)); - intTokens.insert(pair("presenteventduration", 0)); + intTokens.insert(pair("presenteventduration", 0)); + intTokens.insert(pair("presenteventdurationhours", 0)); + stringTokens.insert(pair("presenteventdurationminutes", "")); } const cList *events = schedule->Events(); bool inserted = false; @@ -291,6 +297,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) { stringTokens.insert(pair("nexteventday", *WeekDayName(nextEvent->StartTime()))); stringTokens.insert(pair("nexteventdate", *ShortDateString(nextEvent->StartTime()))); intTokens.insert(pair("nexteventduration", nextEvent->Duration() / 60)); + intTokens.insert(pair("nexteventdurationhours", nextEvent->Duration() / 3600)); + stringTokens.insert(pair("nexteventdurationminutes", *cString::sprintf("%.2d", (nextEvent->Duration() / 60)%60))); inserted = true; } } @@ -303,6 +311,8 @@ void cDisplayMenuItemCurrentChannelView::Render(void) { stringTokens.insert(pair("nexteventday", "")); stringTokens.insert(pair("nexteventdate", "")); intTokens.insert(pair("nexteventduration", 0)); + intTokens.insert(pair("nexteventdurationhours", 0)); + stringTokens.insert(pair("nexteventdurationminutes", "")); } } @@ -535,7 +545,11 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) { stringTokens.insert(pair("date", recDate.c_str())); stringTokens.insert(pair("time", recTime.c_str())); intTokens.insert(pair("duration", recDuration)); + intTokens.insert(pair("durationhours", recDuration / 60)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); intTokens.insert(pair("durationevent", duration)); + intTokens.insert(pair("durationeventhours", duration / 60)); + stringTokens.insert(pair("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("elapsed", 0)); } intTokens.insert(pair("duration", event->Duration() / 60)); + intTokens.insert(pair("durationhours", event->Duration() / 3600)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", (event->Duration() / 60)%60))); intTokens.insert(pair("hasVPS", (bool)event->Vps())); } else { stringTokens.insert(pair("title", event->Title() ? ParseSeparator(event->Title()) : "")); @@ -642,7 +644,11 @@ void cDisplayMenuItemRecordingView::SetTokens(void) { stringTokens.insert(pair("date", recDate.c_str())); stringTokens.insert(pair("time", recTime.c_str())); intTokens.insert(pair("duration", recDuration)); + intTokens.insert(pair("durationhours", recDuration / 60)); + stringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); intTokens.insert(pair("durationevent", duration)); + intTokens.insert(pair("durationeventhours", duration / 60)); + stringTokens.insert(pair("durationeventminutes", *cString::sprintf("%.2d", duration%60))); static cPlugin *pScraper = GetScraperPlugin(); if (!pScraper || !recording) {