summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-05-26 11:38:05 +0200
committerlouis <louis.braun@gmx.de>2013-05-26 11:38:05 +0200
commit812fd1b7a5aeb67d4139255a6df8230c420ea57e (patch)
tree36e0408bf9f4191b37cf11bd9dd01e381d105f6e /timer.c
parent9f47ab764efc83d8bf94f25c4badeb6e4c91c649 (diff)
downloadvdr-plugin-tvguide-812fd1b7a5aeb67d4139255a6df8230c420ea57e.tar.gz
vdr-plugin-tvguide-812fd1b7a5aeb67d4139255a6df8230c420ea57e.tar.bz2
whitespace cleanup
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/timer.c b/timer.c
index 1acd3bf..74d4ff4 100644
--- a/timer.c
+++ b/timer.c
@@ -11,10 +11,10 @@ cString cMyTime::printTime(time_t displayTime) {
}
-void cMyTime::Now() {
- t = time(0);
- tStart = t;
- tStart = GetRounded();
+void cMyTime::Now() {
+ t = time(0);
+ tStart = t;
+ tStart = GetRounded();
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)/tvguideConfig.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
@@ -23,21 +23,21 @@ void cMyTime::Now() {
}
void cMyTime::AddStep(int step) {
- tStart += step*60;
- tEnd += step*60;
+ tStart += step*60;
+ tEnd += step*60;
}
bool cMyTime::DelStep(int step) {
- if ((tStart - step*60)+30*60 < t) {
- return true;
- }
- tStart -= step*60;
- tEnd -= step*60;
- return false;
+ if ((tStart - step*60)+30*60 < t) {
+ return true;
+ }
+ tStart -= step*60;
+ tEnd -= step*60;
+ return false;
}
void cMyTime::SetTime(time_t newTime) {
- tStart = newTime;
+ tStart = newTime;
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)/tvguideConfig.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
@@ -46,77 +46,77 @@ void cMyTime::SetTime(time_t newTime) {
}
time_t cMyTime::getPrevPrimetime(time_t current) {
- tm *st = localtime(&current);
- if (st->tm_hour < 21) {
- current -= 24 * 60* 60;
- st = localtime(&current);
- }
- st->tm_hour = 20;
- st->tm_min = 0;
- time_t primeTime = mktime(st);
- return primeTime;
+ tm *st = localtime(&current);
+ if (st->tm_hour < 21) {
+ current -= 24 * 60* 60;
+ st = localtime(&current);
+ }
+ st->tm_hour = 20;
+ st->tm_min = 0;
+ time_t primeTime = mktime(st);
+ return primeTime;
}
time_t cMyTime::getNextPrimetime(time_t current){
- tm *st = localtime(&current);
- if (st->tm_hour > 19) {
- current += 24 * 60* 60;
- st = localtime(&current);
- }
- st->tm_hour = 20;
- st->tm_min = 0;
- time_t primeTime = mktime(st);
- return primeTime;
+ tm *st = localtime(&current);
+ if (st->tm_hour > 19) {
+ current += 24 * 60* 60;
+ st = localtime(&current);
+ }
+ st->tm_hour = 20;
+ st->tm_min = 0;
+ time_t primeTime = mktime(st);
+ return primeTime;
}
bool cMyTime::tooFarInPast(time_t current) {
- if (current < t) {
- return true;
- }
- return false;
+ if (current < t) {
+ return true;
+ }
+ return false;
}
cString cMyTime::GetCurrentTime() {
- char buf[25];
- t = time(0);
- tm *st = localtime(&t);
- //snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
- if (tvguideConfig.timeFormat == e12Hours) {
- strftime(buf, sizeof(buf), "%I:%M %p", st);
- } else if (tvguideConfig.timeFormat == e24Hours)
- strftime(buf, sizeof(buf), "%H:%M", st);
- return buf;
-
+ char buf[25];
+ t = time(0);
+ tm *st = localtime(&t);
+ //snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
+ if (tvguideConfig.timeFormat == e12Hours) {
+ strftime(buf, sizeof(buf), "%I:%M %p", st);
+ } else if (tvguideConfig.timeFormat == e24Hours)
+ strftime(buf, sizeof(buf), "%H:%M", st);
+ return buf;
+
}
cString cMyTime::GetDate() {
- char text[6];
- tm *st = localtime(&tStart);
- snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1);
- return text;
+ char text[6];
+ tm *st = localtime(&tStart);
+ snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1);
+ return text;
}
cString cMyTime::GetWeekday() {
- return WeekDayName(tStart);
+ return WeekDayName(tStart);
}
int cMyTime::GetTimelineOffset() {
- tm *st = localtime(&tStart);
- int offset = st->tm_hour*60;
- offset += st->tm_min;
- return offset;
+ tm *st = localtime(&tStart);
+ int offset = st->tm_hour*60;
+ offset += st->tm_min;
+ return offset;
}
time_t cMyTime::GetRounded() {
- tm *rounded = localtime ( &tStart );
- rounded->tm_sec = 0;
- if (rounded->tm_min > 29)
- rounded->tm_min = 30;
- else
- rounded->tm_min = 0;
- return mktime(rounded);
+ tm *rounded = localtime ( &tStart );
+ rounded->tm_sec = 0;
+ if (rounded->tm_min > 29)
+ rounded->tm_min = 30;
+ else
+ rounded->tm_min = 0;
+ return mktime(rounded);
}
void cMyTime::debug() {
- esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
+ esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
}