mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Diplay the current TimeBase throughout the whole timeline
This commit is contained in:
parent
3f0bd75011
commit
cd62a9bd6b
36
timeline.c
36
timeline.c
@ -4,6 +4,7 @@
|
|||||||
cTimeLine::cTimeLine(cTimeManager *timeManager) {
|
cTimeLine::cTimeLine(cTimeManager *timeManager) {
|
||||||
this->timeManager = timeManager;
|
this->timeManager = timeManager;
|
||||||
lastClock = "";
|
lastClock = "";
|
||||||
|
timeBase = NULL;
|
||||||
if (config.displayMode == eVertical) {
|
if (config.displayMode == eVertical) {
|
||||||
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
|
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
|
||||||
geoManager.statusHeaderHeight + geoManager.clockHeight,
|
geoManager.statusHeaderHeight + geoManager.clockHeight,
|
||||||
@ -17,10 +18,6 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
|
|||||||
0,
|
0,
|
||||||
geoManager.timeLineWidth,
|
geoManager.timeLineWidth,
|
||||||
1440 * geoManager.minutePixel));
|
1440 * geoManager.minutePixel));
|
||||||
timeBase = osdManager.requestPixmap(3, cRect(0,
|
|
||||||
geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,
|
|
||||||
geoManager.osdWidth,
|
|
||||||
geoManager.timeLineGridHeight));
|
|
||||||
} else if (config.displayMode == eHorizontal) {
|
} else if (config.displayMode == eHorizontal) {
|
||||||
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
|
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
|
||||||
geoManager.statusHeaderHeight,
|
geoManager.statusHeaderHeight,
|
||||||
@ -34,12 +31,7 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
|
|||||||
0,
|
0,
|
||||||
1440 * geoManager.minutePixel,
|
1440 * geoManager.minutePixel,
|
||||||
geoManager.timeLineHeight));
|
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 clockY;
|
||||||
int clockX;
|
int clockX;
|
||||||
if (config.displayMode == eVertical) {
|
if (config.displayMode == eVertical) {
|
||||||
@ -57,10 +49,11 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cTimeLine::~cTimeLine(void) {
|
cTimeLine::~cTimeLine(void) {
|
||||||
delete dateViewer;
|
|
||||||
osdManager.releasePixmap(timeline);
|
|
||||||
if (clock)
|
if (clock)
|
||||||
delete clock;
|
delete clock;
|
||||||
|
osdManager.releasePixmap(timeBase);
|
||||||
|
osdManager.releasePixmap(timeline);
|
||||||
|
delete dateViewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTimeLine::drawDateViewer() {
|
void cTimeLine::drawDateViewer() {
|
||||||
@ -207,19 +200,30 @@ void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cTimeLine::drawCurrentTimeBase(void) {
|
void cTimeLine::drawCurrentTimeBase(void) {
|
||||||
|
if (!timeManager->NowVisible()) {
|
||||||
|
if (timeBase)
|
||||||
timeBase->Fill(clrTransparent);
|
timeBase->Fill(clrTransparent);
|
||||||
bool nowVisible = timeManager->NowVisible();
|
|
||||||
if (!nowVisible)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
osdManager.releasePixmap(timeBase);
|
||||||
int deltaTime = (timeManager->GetNow() - timeManager->GetStart()) / 60 * geoManager.minutePixel;
|
int deltaTime = (timeManager->GetNow() - timeManager->GetStart()) / 60 * geoManager.minutePixel;
|
||||||
|
int x1, x2, y1, y2;
|
||||||
if (config.displayMode == eVertical) {
|
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 {
|
} 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 *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
|
||||||
cImage *image = NULL;
|
cImage *image = NULL;
|
||||||
if (config.style == eStyleBlendingDefault) {
|
if (config.style == eStyleBlendingDefault) {
|
||||||
|
Loading…
Reference in New Issue
Block a user