added {durationhours} and {durationminutes} tokens in several view elements

This commit is contained in:
louis 2014-10-05 17:03:38 +02:00
parent e14982a4be
commit 797e33441e
17 changed files with 124 additions and 12 deletions

View File

@ -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

View File

@ -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
-->
<epginfo>

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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
-->
<epginfo>

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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 = "";

View File

@ -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);
}

View File

@ -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) {