From ebe8ac563b1a393ce4b2e90d3d4ec64fd14a6f2b Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 7 Oct 2014 17:36:33 +0200 Subject: [PATCH] added numeric day, month and year tokens in different view elements --- HISTORY | 1 + .../xmlfiles/displaymenudetailepg.xml | 10 ++++-- .../xmlfiles/displaymenudetailrecording.xml | 8 ++++- .../xmlfiles/displaymenurecordings.xml | 6 ++++ .../xmlfiles/displaymenuschedules.xml | 8 ++++- .../xmlfiles/displaymenudetailepg.xml | 10 ++++-- .../xmlfiles/displaymenudetailrecording.xml | 34 ++++++++++-------- .../xmlfiles/displaymenurecordings.xml | 6 ++++ .../xmlfiles/displaymenuschedules.xml | 6 ++++ views/displaymenudetailview.c | 35 +++++++++++++++---- views/displaymenuitemcurrentview.c | 18 ++++++++-- views/displaymenuitemview.c | 17 +++++++-- 12 files changed, 129 insertions(+), 30 deletions(-) diff --git a/HISTORY b/HISTORY index 319bfe9..36ebb19 100644 --- a/HISTORY +++ b/HISTORY @@ -15,3 +15,4 @@ Version 0.0.2 - 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 - added discusage icons to menu header view element so that it discusage can be displayed in every menu view +- added numeric day, month and year tokens in different view elements diff --git a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml index 8dc473b..2bc4458 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml @@ -92,6 +92,9 @@ {stop} event stop time {day} day of current event {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event @@ -140,8 +143,11 @@ {description} description of event {start} event start time in hh::mm {stop} event stop time - {day} day of current event - {date} date of current event in dd.mm.yy + {day} Day of event as three letter abrivation + {date} Date of event + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event diff --git a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml index 47da2cb..815014a 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml @@ -89,7 +89,10 @@ {name} name of recording {shorttext} shorttext of recording {date} date of recording in dd.mm.yy - {time} time of current event in hh:mm + {time} time of current recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes @@ -137,6 +140,9 @@ {description} description of recording {date} date of recording in dd.mm.yy {time} time of recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes diff --git a/skins/metrixhd/xmlfiles/displaymenurecordings.xml b/skins/metrixhd/xmlfiles/displaymenurecordings.xml index 3cd7b28..1275779 100644 --- a/skins/metrixhd/xmlfiles/displaymenurecordings.xml +++ b/skins/metrixhd/xmlfiles/displaymenurecordings.xml @@ -4,6 +4,9 @@ {name} Name of recording {date} Date of recording {time} Time of recording + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes @@ -49,6 +52,9 @@ {description} Descrption of recording {date} Date of recording {time} Time of recording + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes diff --git a/skins/metrixhd/xmlfiles/displaymenuschedules.xml b/skins/metrixhd/xmlfiles/displaymenuschedules.xml index b24a853..ad608dc 100644 --- a/skins/metrixhd/xmlfiles/displaymenuschedules.xml +++ b/skins/metrixhd/xmlfiles/displaymenuschedules.xml @@ -24,8 +24,11 @@ {shorttext} shorttext of event {start} event start time in hh::mm {stop} event stop time - {day} day of current event + {day} day of current event as three letter abrivation {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event @@ -109,6 +112,9 @@ {stop} event stop time {day} day of current event {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event diff --git a/skinskeleton/xmlfiles/displaymenudetailepg.xml b/skinskeleton/xmlfiles/displaymenudetailepg.xml index dcfcb2a..c8ecf6d 100644 --- a/skinskeleton/xmlfiles/displaymenudetailepg.xml +++ b/skinskeleton/xmlfiles/displaymenudetailepg.xml @@ -4,8 +4,11 @@ {shorttext} shorttext of event {start} event start time in hh::mm {stop} event stop time - {day} day of current event + {day} Day of event as three letter abrivation {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event @@ -34,8 +37,11 @@ {description} description of event {start} event start time in hh::mm {stop} event stop time - {day} day of current event + {day} Day of event as three letter abrivation {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event diff --git a/skinskeleton/xmlfiles/displaymenudetailrecording.xml b/skinskeleton/xmlfiles/displaymenudetailrecording.xml index 972d72e..3905ebb 100644 --- a/skinskeleton/xmlfiles/displaymenudetailrecording.xml +++ b/skinskeleton/xmlfiles/displaymenudetailrecording.xml @@ -3,13 +3,16 @@ {name} name of recording {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 - {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 + {time} time of current recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number + {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 @@ -30,13 +33,16 @@ {shorttext} shorttext of recording {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 - {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 + {time} time of current recording in hh:mm + {daynumeric} day as number + {month} month as number + {year} year as number + {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 832bd3f..4898026 100644 --- a/skinskeleton/xmlfiles/displaymenurecordings.xml +++ b/skinskeleton/xmlfiles/displaymenurecordings.xml @@ -4,6 +4,9 @@ {name} Name of recording {date} Date of recording {time} Time of recording + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes @@ -34,6 +37,9 @@ {description} Descrption of recording {date} Date of recording {time} Time of recording + {daynumeric} day as number + {month} month as number + {year} year as number {duration} real duration of recording in minutes {durationhours} real duration, full hours {durationminutes} real duration, rest of minutes diff --git a/skinskeleton/xmlfiles/displaymenuschedules.xml b/skinskeleton/xmlfiles/displaymenuschedules.xml index 39ab906..b96aaf4 100644 --- a/skinskeleton/xmlfiles/displaymenuschedules.xml +++ b/skinskeleton/xmlfiles/displaymenuschedules.xml @@ -21,6 +21,9 @@ {stop} event stop time {day} day of current event {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event @@ -51,6 +54,9 @@ {stop} event stop time {day} day of current event {date} date of current event in dd.mm.yy + {daynumeric} day as number + {month} month as number + {year} year as number {running} true if event is currently running {elapsed} elapsed time of event, if not running 0 {duration} duration of event diff --git a/views/displaymenudetailview.c b/views/displaymenudetailview.c index 3554f97..e87c0bb 100644 --- a/views/displaymenudetailview.c +++ b/views/displaymenudetailview.c @@ -103,8 +103,14 @@ void cDisplayMenuDetailView::SetTokens(void) { stringTokens.insert(pair("description", event->Description() ? event->Description() : "")); stringTokens.insert(pair("start", *(event->GetTimeString()))); stringTokens.insert(pair("stop", *(event->GetEndTimeString()))); - stringTokens.insert(pair("day", *WeekDayName(event->StartTime()))); - stringTokens.insert(pair("date", *ShortDateString(event->StartTime()))); + time_t startTime = event->StartTime(); + stringTokens.insert(pair("day", *WeekDayName(startTime))); + stringTokens.insert(pair("date", *ShortDateString(startTime))); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); + stringTokens.insert(pair("channelid", *(event->ChannelID().ToString()))); bool isRunning = false; @@ -147,11 +153,16 @@ void cDisplayMenuDetailView::SetTokens(void) { recDate = *DateString(start); recTime = *TimeString(start); } + stringTokens.insert(pair("date", recDate.c_str())); + stringTokens.insert(pair("time", recTime.c_str())); + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); int duration = event->Duration() / 60; int recDuration = recording->LengthInSeconds(); recDuration = (recDuration>0)?(recDuration / 60):0; - 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))); @@ -799,8 +810,15 @@ void cDisplayMenuDetailView::DrawHeader(void) { headerStringTokens.insert(pair("shorttext", event->ShortText() ? event->ShortText() : "")); headerStringTokens.insert(pair("start", *(event->GetTimeString()))); headerStringTokens.insert(pair("stop", *(event->GetEndTimeString()))); - headerStringTokens.insert(pair("day", *WeekDayName(event->StartTime()))); - headerStringTokens.insert(pair("date", *ShortDateString(event->StartTime()))); + + time_t startTime = event->StartTime(); + headerStringTokens.insert(pair("day", *WeekDayName(startTime))); + headerStringTokens.insert(pair("date", *ShortDateString(startTime))); + struct tm * sStartTime = localtime(&startTime); + headerIntTokens.insert(pair("year", sStartTime->tm_year + 1900)); + headerIntTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + headerIntTokens.insert(pair("month", sStartTime->tm_mon+1)); + headerStringTokens.insert(pair("channelid", *(event->ChannelID().ToString()))); bool isRunning = false; @@ -857,6 +875,11 @@ void cDisplayMenuDetailView::DrawHeader(void) { recDuration = (recDuration>0)?(recDuration / 60):0; headerStringTokens.insert(pair("date", recDate.c_str())); headerStringTokens.insert(pair("time", recTime.c_str())); + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + headerIntTokens.insert(pair("year", sStartTime->tm_year + 1900)); + headerIntTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + headerIntTokens.insert(pair("month", sStartTime->tm_mon+1)); headerIntTokens.insert(pair("duration", recDuration)); headerIntTokens.insert(pair("durationhours", recDuration / 60)); headerStringTokens.insert(pair("durationminutes", *cString::sprintf("%.2d", recDuration%60))); diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c index 13f27c7..7ef9cc0 100644 --- a/views/displaymenuitemcurrentview.c +++ b/views/displaymenuitemcurrentview.c @@ -138,8 +138,15 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) { stringTokens.insert(pair("description", event->Description() ? event->Description() : "")); stringTokens.insert(pair("start", *(event->GetTimeString()))); stringTokens.insert(pair("stop", *(event->GetEndTimeString()))); - stringTokens.insert(pair("day", *WeekDayName(event->StartTime()))); - stringTokens.insert(pair("date", *ShortDateString(event->StartTime()))); + + time_t startTime = event->StartTime(); + stringTokens.insert(pair("day", *WeekDayName(startTime))); + stringTokens.insert(pair("date", *ShortDateString(startTime))); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); + bool isRunning = false; time_t now = time(NULL); if ((now >= event->StartTime()) && (now <= event->EndTime())) @@ -539,6 +546,13 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) { recDate = *DateString(start); recTime = *TimeString(start); } + + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); + int duration = event->Duration() / 60; int recDuration = recording->LengthInSeconds(); recDuration = (recDuration>0)?(recDuration / 60):0; diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index bbc8a96..64e8eab 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -301,8 +301,14 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) { stringTokens.insert(pair("shorttext", event->ShortText() ? event->ShortText() : "")); stringTokens.insert(pair("start", *(event->GetTimeString()))); stringTokens.insert(pair("stop", *(event->GetEndTimeString()))); - stringTokens.insert(pair("day", *WeekDayName(event->StartTime()))); - stringTokens.insert(pair("date", *ShortDateString(event->StartTime()))); + time_t startTime = event->StartTime(); + stringTokens.insert(pair("day", *WeekDayName(startTime))); + stringTokens.insert(pair("date", *ShortDateString(startTime))); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); + bool isRunning = false; time_t now = time(NULL); if ((now >= event->StartTime()) && (now <= event->EndTime())) @@ -638,6 +644,13 @@ void cDisplayMenuItemRecordingView::SetTokens(void) { recDate = *DateString(start); recTime = *TimeString(start); } + + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair("month", sStartTime->tm_mon+1)); + int duration = event->Duration() / 60; int recDuration = recording->LengthInSeconds(); recDuration = (recDuration>0)?(recDuration / 60):0;