summaryrefslogtreecommitdiff
path: root/timemanager.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-10-14 16:51:52 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-10-14 16:51:52 +0200
commitcdb5a461457dd9123bb13996649509309b1a1127 (patch)
treea26a974395faab305fce01f95452cb3b850f1f1b /timemanager.c
parentfc784f34e54f126969d81b4ab83f573ff2adda2d (diff)
downloadvdr-plugin-tvguide-cdb5a461457dd9123bb13996649509309b1a1127.tar.gz
vdr-plugin-tvguide-cdb5a461457dd9123bb13996649509309b1a1127.tar.bz2
Revert "Diplay the current TimeBase throughout the whole timeline"
This reverts commit b707292 because of a segfault.
Diffstat (limited to 'timemanager.c')
-rw-r--r--timemanager.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/timemanager.c b/timemanager.c
index a12b450..a38e57a 100644
--- a/timemanager.c
+++ b/timemanager.c
@@ -9,7 +9,7 @@ cTimeManager::~cTimeManager(void) {
cString cTimeManager::printTime(time_t displayTime) {
struct tm *ts;
ts = localtime(&displayTime);
- cString strTime = cString::sprintf("%d.%d-%d:%d.%d", ts->tm_mday, ts->tm_mon + 1, ts->tm_hour, ts->tm_min, ts->tm_sec);
+ cString strTime = cString::sprintf("%d.%d-%d:%d.%d", ts->tm_mday, ts->tm_mon+1, ts->tm_hour, ts->tm_min, ts->tm_sec);
return strTime;
}
@@ -19,43 +19,43 @@ void cTimeManager::Now() {
tStart = t;
tStart = GetRounded();
if (config.displayMode == eVertical) {
- tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) / geoManager.minutePixel * 60;
+ tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
- tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth) / geoManager.minutePixel * 60;
+ tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
void cTimeManager::AddStep(int step) {
- tStart += step * 60;
- tEnd += step * 60;
+ tStart += step*60;
+ tEnd += step*60;
}
bool cTimeManager::DelStep(int step) {
- if ((tStart - step * 60) + 30 * 60 < t) {
+ if ((tStart - step*60)+30*60 < t) {
return true;
}
- tStart -= step * 60;
- tEnd -= step * 60;
+ tStart -= step*60;
+ tEnd -= step*60;
return false;
}
void cTimeManager::SetTime(time_t newTime) {
tStart = newTime;
if (config.displayMode == eVertical) {
- tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) / geoManager.minutePixel * 60;
+ tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
- tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth) / geoManager.minutePixel * 60;
+ tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
time_t cTimeManager::getPrevPrimetime(time_t current) {
tm *st = localtime(&current);
if (st->tm_hour < 21) {
- current -= 24 * 60 * 60;
+ current -= 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
- st->tm_min = 0;
+ st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
@@ -63,11 +63,11 @@ time_t cTimeManager::getPrevPrimetime(time_t current) {
time_t cTimeManager::getNextPrimetime(time_t current){
tm *st = localtime(&current);
if (st->tm_hour > 19) {
- current += 24 * 60 * 60;
+ current += 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
- st->tm_min = 0;
+ st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
@@ -105,7 +105,7 @@ cString cTimeManager::GetWeekday() {
int cTimeManager::GetTimelineOffset() {
tm *st = localtime(&tStart);
- int offset = st->tm_hour * 60;
+ int offset = st->tm_hour*60;
offset += st->tm_min;
return offset;
}
@@ -126,6 +126,7 @@ bool cTimeManager::NowVisible(void) {
return false;
}
+
void cTimeManager::debug() {
esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
}