summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-10-13 14:13:41 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-10-19 15:10:06 +0200
commitcd62a9bd6bdeda23387033c48023389b4e32d9e8 (patch)
tree80d222bff7d5e21b3b7b170205abbcaa078aeb8f
parent3f0bd7501120e3e670fb489ce75826e6881fd654 (diff)
downloadvdr-plugin-tvguide-cd62a9bd6bdeda23387033c48023389b4e32d9e8.tar.gz
vdr-plugin-tvguide-cd62a9bd6bdeda23387033c48023389b4e32d9e8.tar.bz2
Diplay the current TimeBase throughout the whole timeline
-rw-r--r--timeline.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/timeline.c b/timeline.c
index c13a7c0..149ba51 100644
--- a/timeline.c
+++ b/timeline.c
@@ -4,6 +4,7 @@
cTimeLine::cTimeLine(cTimeManager *timeManager) {
this->timeManager = timeManager;
lastClock = "";
+ timeBase = NULL;
if (config.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight + geoManager.clockHeight,
@@ -16,11 +17,7 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
, cRect(0,
0,
geoManager.timeLineWidth,
- 1440*geoManager.minutePixel));
- timeBase = osdManager.requestPixmap(3, cRect(0,
- geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,
- geoManager.osdWidth,
- geoManager.timeLineGridHeight));
+ 1440 * geoManager.minutePixel));
} else if (config.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight,
@@ -32,14 +29,9 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
geoManager.timeLineHeight)
, cRect(0,
0,
- 1440*geoManager.minutePixel,
+ 1440 * geoManager.minutePixel,
geoManager.timeLineHeight));
- timeBase = osdManager.requestPixmap(3, cRect(geoManager.channelGroupsWidth + geoManager.channelHeaderWidth,
- geoManager.statusHeaderHeight,
- geoManager.timeLineGridWidth,
- geoManager.timeLineHeight + config.channelRows * geoManager.rowHeight));
}
- timeBase->Fill(clrTransparent);
int clockY;
int clockX;
if (config.displayMode == eVertical) {
@@ -57,10 +49,11 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
}
cTimeLine::~cTimeLine(void) {
- delete dateViewer;
- osdManager.releasePixmap(timeline);
if (clock)
delete clock;
+ osdManager.releasePixmap(timeBase);
+ osdManager.releasePixmap(timeline);
+ delete dateViewer;
}
void cTimeLine::drawDateViewer() {
@@ -207,19 +200,30 @@ void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, in
}
void cTimeLine::drawCurrentTimeBase(void) {
- timeBase->Fill(clrTransparent);
- bool nowVisible = timeManager->NowVisible();
- if (!nowVisible)
- return;
+ if (!timeManager->NowVisible()) {
+ if (timeBase)
+ timeBase->Fill(clrTransparent);
+ return;
+ }
+ osdManager.releasePixmap(timeBase);
int deltaTime = (timeManager->GetNow() - timeManager->GetStart()) / 60 * geoManager.minutePixel;
+ int x1, x2, y1, y2;
if (config.displayMode == eVertical) {
- timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase));
+ x1 = 0;
+ y1 = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight + deltaTime - 2;
+ x2 = geoManager.osdWidth;
+ y2 = 4;
} else {
- timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
+ x1 = geoManager.channelGroupsWidth + geoManager.channelHeaderWidth + deltaTime - 2;
+ y1 = geoManager.statusHeaderHeight;
+ x2 = 4;
+ y2 = geoManager.timeLineHeight + config.channelRows * geoManager.rowHeight;
}
+ timeBase = osdManager.requestPixmap(3, cRect(x1, y1, x2, y2));
+ timeBase->Fill(clrTransparent);
+ timeBase->DrawRectangle(cRect(0, 0, timeBase->ViewPort().Width(), timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
}
-
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL;
if (config.style == eStyleBlendingDefault) {