added numeric day, month and year tokens in different view elements

This commit is contained in:
louis 2014-10-07 17:36:33 +02:00
parent 82f2bbd5c4
commit ebe8ac563b
12 changed files with 129 additions and 30 deletions

View File

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

View File

@ -92,6 +92,9 @@
{stop} event stop time {stop} event stop time
{day} day of current event {day} day of current event
{date} date of current event in dd.mm.yy {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event
@ -140,8 +143,11 @@
{description} description of event {description} description of event
{start} event start time in hh::mm {start} event start time in hh::mm
{stop} event stop time {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 {date} Date of event
{daynumeric} day as number
{month} month as number
{year} year as number
{running} true if event is currently running {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event

View File

@ -89,7 +89,10 @@
{name} name of recording {name} name of recording
{shorttext} shorttext of recording {shorttext} shorttext of recording
{date} date of recording in dd.mm.yy {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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes
@ -137,6 +140,9 @@
{description} description of recording {description} description of recording
{date} date of recording in dd.mm.yy {date} date of recording in dd.mm.yy
{time} time of recording in hh:mm {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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes

View File

@ -4,6 +4,9 @@
{name} Name of recording {name} Name of recording
{date} Date of recording {date} Date of recording
{time} Time 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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes
@ -49,6 +52,9 @@
{description} Descrption of recording {description} Descrption of recording
{date} Date of recording {date} Date of recording
{time} Time 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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes

View File

@ -24,8 +24,11 @@
{shorttext} shorttext of event {shorttext} shorttext of event
{start} event start time in hh::mm {start} event start time in hh::mm
{stop} event stop time {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 {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event
@ -109,6 +112,9 @@
{stop} event stop time {stop} event stop time
{day} day of current event {day} day of current event
{date} date of current event in dd.mm.yy {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event

View File

@ -4,8 +4,11 @@
{shorttext} shorttext of event {shorttext} shorttext of event
{start} event start time in hh::mm {start} event start time in hh::mm
{stop} event stop time {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 {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event
@ -34,8 +37,11 @@
{description} description of event {description} description of event
{start} event start time in hh::mm {start} event start time in hh::mm
{stop} event stop time {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 {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event

View File

@ -3,7 +3,10 @@
{name} name of recording {name} name of recording
{shorttext} shorttext of recording {shorttext} shorttext of recording
{date} date of recording in dd.mm.yy {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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes
@ -30,7 +33,10 @@
{shorttext} shorttext of recording {shorttext} shorttext of recording
{description} description of recording {description} description of recording
{date} date of recording in dd.mm.yy {date} date of recording in dd.mm.yy
{time} time of recording 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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes

View File

@ -4,6 +4,9 @@
{name} Name of recording {name} Name of recording
{date} Date of recording {date} Date of recording
{time} Time 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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes
@ -34,6 +37,9 @@
{description} Descrption of recording {description} Descrption of recording
{date} Date of recording {date} Date of recording
{time} Time 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 {duration} real duration of recording in minutes
{durationhours} real duration, full hours {durationhours} real duration, full hours
{durationminutes} real duration, rest of minutes {durationminutes} real duration, rest of minutes

View File

@ -21,6 +21,9 @@
{stop} event stop time {stop} event stop time
{day} day of current event {day} day of current event
{date} date of current event in dd.mm.yy {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event
@ -51,6 +54,9 @@
{stop} event stop time {stop} event stop time
{day} day of current event {day} day of current event
{date} date of current event in dd.mm.yy {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 {running} true if event is currently running
{elapsed} elapsed time of event, if not running 0 {elapsed} elapsed time of event, if not running 0
{duration} duration of event {duration} duration of event

View File

@ -103,8 +103,14 @@ void cDisplayMenuDetailView::SetTokens(void) {
stringTokens.insert(pair<string,string>("description", event->Description() ? event->Description() : "")); stringTokens.insert(pair<string,string>("description", event->Description() ? event->Description() : ""));
stringTokens.insert(pair<string,string>("start", *(event->GetTimeString()))); stringTokens.insert(pair<string,string>("start", *(event->GetTimeString())));
stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString()))); stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString())));
stringTokens.insert(pair<string,string>("day", *WeekDayName(event->StartTime()))); time_t startTime = event->StartTime();
stringTokens.insert(pair<string,string>("date", *ShortDateString(event->StartTime()))); stringTokens.insert(pair<string,string>("day", *WeekDayName(startTime)));
stringTokens.insert(pair<string,string>("date", *ShortDateString(startTime)));
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
stringTokens.insert(pair<string,string>("channelid", *(event->ChannelID().ToString()))); stringTokens.insert(pair<string,string>("channelid", *(event->ChannelID().ToString())));
bool isRunning = false; bool isRunning = false;
@ -147,11 +153,16 @@ void cDisplayMenuDetailView::SetTokens(void) {
recDate = *DateString(start); recDate = *DateString(start);
recTime = *TimeString(start); recTime = *TimeString(start);
} }
stringTokens.insert(pair<string,string>("date", recDate.c_str()));
stringTokens.insert(pair<string,string>("time", recTime.c_str()));
time_t startTime = event->StartTime();
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
int duration = event->Duration() / 60; int duration = event->Duration() / 60;
int recDuration = recording->LengthInSeconds(); int recDuration = recording->LengthInSeconds();
recDuration = (recDuration>0)?(recDuration / 60):0; recDuration = (recDuration>0)?(recDuration / 60):0;
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>("duration", recDuration));
intTokens.insert(pair<string,int>("durationhours", recDuration / 60)); intTokens.insert(pair<string,int>("durationhours", recDuration / 60));
stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60))); stringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60)));
@ -799,8 +810,15 @@ void cDisplayMenuDetailView::DrawHeader(void) {
headerStringTokens.insert(pair<string,string>("shorttext", event->ShortText() ? event->ShortText() : "")); headerStringTokens.insert(pair<string,string>("shorttext", event->ShortText() ? event->ShortText() : ""));
headerStringTokens.insert(pair<string,string>("start", *(event->GetTimeString()))); headerStringTokens.insert(pair<string,string>("start", *(event->GetTimeString())));
headerStringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString()))); headerStringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString())));
headerStringTokens.insert(pair<string,string>("day", *WeekDayName(event->StartTime())));
headerStringTokens.insert(pair<string,string>("date", *ShortDateString(event->StartTime()))); time_t startTime = event->StartTime();
headerStringTokens.insert(pair<string,string>("day", *WeekDayName(startTime)));
headerStringTokens.insert(pair<string,string>("date", *ShortDateString(startTime)));
struct tm * sStartTime = localtime(&startTime);
headerIntTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
headerIntTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
headerIntTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
headerStringTokens.insert(pair<string,string>("channelid", *(event->ChannelID().ToString()))); headerStringTokens.insert(pair<string,string>("channelid", *(event->ChannelID().ToString())));
bool isRunning = false; bool isRunning = false;
@ -857,6 +875,11 @@ void cDisplayMenuDetailView::DrawHeader(void) {
recDuration = (recDuration>0)?(recDuration / 60):0; recDuration = (recDuration>0)?(recDuration / 60):0;
headerStringTokens.insert(pair<string,string>("date", recDate.c_str())); headerStringTokens.insert(pair<string,string>("date", recDate.c_str()));
headerStringTokens.insert(pair<string,string>("time", recTime.c_str())); headerStringTokens.insert(pair<string,string>("time", recTime.c_str()));
time_t startTime = event->StartTime();
struct tm * sStartTime = localtime(&startTime);
headerIntTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
headerIntTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
headerIntTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
headerIntTokens.insert(pair<string,int>("duration", recDuration)); headerIntTokens.insert(pair<string,int>("duration", recDuration));
headerIntTokens.insert(pair<string,int>("durationhours", recDuration / 60)); headerIntTokens.insert(pair<string,int>("durationhours", recDuration / 60));
headerStringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60))); headerStringTokens.insert(pair<string,string>("durationminutes", *cString::sprintf("%.2d", recDuration%60)));

View File

@ -138,8 +138,15 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) {
stringTokens.insert(pair<string,string>("description", event->Description() ? event->Description() : "")); stringTokens.insert(pair<string,string>("description", event->Description() ? event->Description() : ""));
stringTokens.insert(pair<string,string>("start", *(event->GetTimeString()))); stringTokens.insert(pair<string,string>("start", *(event->GetTimeString())));
stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString()))); stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString())));
stringTokens.insert(pair<string,string>("day", *WeekDayName(event->StartTime())));
stringTokens.insert(pair<string,string>("date", *ShortDateString(event->StartTime()))); time_t startTime = event->StartTime();
stringTokens.insert(pair<string,string>("day", *WeekDayName(startTime)));
stringTokens.insert(pair<string,string>("date", *ShortDateString(startTime)));
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
bool isRunning = false; bool isRunning = false;
time_t now = time(NULL); time_t now = time(NULL);
if ((now >= event->StartTime()) && (now <= event->EndTime())) if ((now >= event->StartTime()) && (now <= event->EndTime()))
@ -539,6 +546,13 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) {
recDate = *DateString(start); recDate = *DateString(start);
recTime = *TimeString(start); recTime = *TimeString(start);
} }
time_t startTime = event->StartTime();
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
int duration = event->Duration() / 60; int duration = event->Duration() / 60;
int recDuration = recording->LengthInSeconds(); int recDuration = recording->LengthInSeconds();
recDuration = (recDuration>0)?(recDuration / 60):0; recDuration = (recDuration>0)?(recDuration / 60):0;

View File

@ -301,8 +301,14 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
stringTokens.insert(pair<string,string>("shorttext", event->ShortText() ? event->ShortText() : "")); stringTokens.insert(pair<string,string>("shorttext", event->ShortText() ? event->ShortText() : ""));
stringTokens.insert(pair<string,string>("start", *(event->GetTimeString()))); stringTokens.insert(pair<string,string>("start", *(event->GetTimeString())));
stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString()))); stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString())));
stringTokens.insert(pair<string,string>("day", *WeekDayName(event->StartTime()))); time_t startTime = event->StartTime();
stringTokens.insert(pair<string,string>("date", *ShortDateString(event->StartTime()))); stringTokens.insert(pair<string,string>("day", *WeekDayName(startTime)));
stringTokens.insert(pair<string,string>("date", *ShortDateString(startTime)));
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
bool isRunning = false; bool isRunning = false;
time_t now = time(NULL); time_t now = time(NULL);
if ((now >= event->StartTime()) && (now <= event->EndTime())) if ((now >= event->StartTime()) && (now <= event->EndTime()))
@ -638,6 +644,13 @@ void cDisplayMenuItemRecordingView::SetTokens(void) {
recDate = *DateString(start); recDate = *DateString(start);
recTime = *TimeString(start); recTime = *TimeString(start);
} }
time_t startTime = event->StartTime();
struct tm * sStartTime = localtime(&startTime);
intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900));
intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday));
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
int duration = event->Duration() / 60; int duration = event->Duration() / 60;
int recDuration = recording->LengthInSeconds(); int recDuration = recording->LengthInSeconds();
recDuration = (recDuration>0)?(recDuration / 60):0; recDuration = (recDuration>0)?(recDuration / 60):0;