Display baseline for current time

This commit is contained in:
louis 2014-01-15 18:25:37 +01:00
parent 88bb260f4d
commit 02b1fba742
20 changed files with 69 additions and 7 deletions

View File

@ -106,3 +106,4 @@ Version 1.1.0
- restructured detailöed EPG View that tv frame and status buttons
are displayed
- Favorites menu with EPG Search favorite timers with blue key
- Display baseline for current time

View File

@ -12,6 +12,7 @@ cTvguideConfig::cTvguideConfig() {
displayTime = 160;
displayStatusHeader = 1;
displayChannelGroups = 1;
displayTimeBase = 1;
headerHeightPercent = 20;
channelGroupsPercent = 5;
epgViewBorder = 50;
@ -216,6 +217,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "showTimeInGrid") == 0) showTimeInGrid = atoi(Value);
else if (strcmp(Name, "displayStatusHeader") == 0) displayStatusHeader = atoi(Value);
else if (strcmp(Name, "displayChannelGroups") == 0) displayChannelGroups = atoi(Value);
else if (strcmp(Name, "displayTimeBase") == 0) displayTimeBase = atoi(Value);
else if (strcmp(Name, "headerHeightPercent") == 0) headerHeightPercent = atoi(Value);
else if (strcmp(Name, "channelGroupsPercent") == 0) channelGroupsPercent = atoi(Value);
else if (strcmp(Name, "epgViewBorder") == 0) epgViewBorder = atoi(Value);

View File

@ -54,6 +54,7 @@ class cTvguideConfig {
int displayTime;
int displayStatusHeader;
int displayChannelGroups;
int displayTimeBase;
int headerHeightPercent;
int channelGroupsPercent;
int epgViewBorder;
@ -190,6 +191,7 @@ THEME_CLR(theme, clrTimeline1, clrWhite);
THEME_CLR(theme, clrTimeline1Blending, 0xFF828282);
THEME_CLR(theme, clrTimeline2, clrBlack);
THEME_CLR(theme, clrTimeline2Blending, 0xFF3F3F3F);
THEME_CLR(theme, clrTimeBase, 0xA0FF0000);
THEME_CLR(theme, clrButtonRed, 0x00000000);
THEME_CLR(theme, clrButtonRedBorder, 0x00000000);
THEME_CLR(theme, clrButtonGreen, 0x00000000);

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"POT-Creation-Date: 2014-01-15 18:19+0100\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@ -648,6 +648,9 @@ msgstr "Alçada dels grups de canals (% alçada OSD)"
msgid "Width of channel groups (Perc. of osd width)"
msgstr "Amplada dels grups de canals (% amplada OSD)"
msgid "Display current time baseline"
msgstr ""
msgid "Show Channel Logos"
msgstr "Mosta Logotip del canal"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"POT-Creation-Date: 2014-01-15 18:19+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -645,6 +645,9 @@ msgstr "Höhe der Kanalgruppen (% der OSD Höhe)"
msgid "Width of channel groups (Perc. of osd width)"
msgstr "Breite der Kanalgruppen (% der OSD Breite)"
msgid "Display current time baseline"
msgstr "Linie für aktuelle Uhrzeit anzeigen"
msgid "Show Channel Logos"
msgstr "Kanallogos anzeigen"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"POT-Creation-Date: 2014-01-15 18:19+0100\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -645,6 +645,9 @@ msgstr "Высота группы каналов (% от высоты OSD)"
msgid "Width of channel groups (Perc. of osd width)"
msgstr "Ширина группы каналов (% от ширины OSD)"
msgid "Display current time baseline"
msgstr ""
msgid "Show Channel Logos"
msgstr "Показывать логотипы каналов"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"POT-Creation-Date: 2014-01-15 18:19+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@ -645,6 +645,9 @@ msgstr "V
msgid "Width of channel groups (Perc. of osd width)"
msgstr "©írka skupiny kanála (% z OSD ¹írky)"
msgid "Display current time baseline"
msgstr ""
msgid "Show Channel Logos"
msgstr "Zobrazi» logá kanálov"

View File

@ -63,6 +63,7 @@ void cTvguideSetup::Store(void) {
SetupStore("showTimeInGrid", tvguideConfig.showTimeInGrid);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader);
SetupStore("displayChannelGroups", tvguideConfig.displayChannelGroups);
SetupStore("displayTimeBase", tvguideConfig.displayTimeBase);
SetupStore("headerHeightPercent", tvguideConfig.headerHeightPercent);
SetupStore("channelGroupsPercent", tvguideConfig.channelGroupsPercent);
SetupStore("epgViewBorder", tvguideConfig.epgViewBorder);
@ -263,6 +264,7 @@ void cMenuSetupScreenLayout::Set(void) {
}
}
Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpTvguideConfig->displayTimeBase));
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath));

View File

@ -21,6 +21,7 @@ clrTimeline1 = BBFFFFFF
clrTimeline1Blending = 90828282
clrTimeline2 = BB000000
clrTimeline2Blending = 903F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -21,6 +21,7 @@ clrTimeline1 = FFFFFFFF
clrTimeline1Blending = FF828282
clrTimeline2 = FF000000
clrTimeline2Blending = FF3F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -21,6 +21,7 @@ clrTimeline1 = BBFFFFFF
clrTimeline1Blending = 90828282
clrTimeline2 = BB000000
clrTimeline2Blending = 903F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -21,6 +21,7 @@ clrTimeline1 = FFFFFFFF
clrTimeline1Blending = 90828282
clrTimeline2 = FF000000
clrTimeline2Blending = 903F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -21,6 +21,7 @@ clrTimeline1 = FFFFFFFF
clrTimeline1Blending = FF828282
clrTimeline2 = FF000000
clrTimeline2Blending = FF3F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 00000000
clrButtonRedBorder = 00000000
clrButtonGreen = 00000000

View File

@ -21,6 +21,7 @@ clrTimeline1 = BBFFFFFF
clrTimeline1Blending = 90828282
clrTimeline2 = BB000000
clrTimeline2Blending = 903F3F3F
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -17,6 +17,7 @@ clrTimeline1 = FFDDDDDD
clrTimeline1Blending = 00000000
clrTimeline2 = FF000000
clrTimeline2Blending = 00000000
clrTimeBase = A0FF0000
clrButtonRed = FFBB0000
clrButtonRedBorder = FF000000
clrButtonGreen = FF00BB00

View File

@ -17,6 +17,7 @@ clrTimeline1 = FF737CA1
clrTimeline1Blending = 00000000
clrTimeline2 = FF2B3856
clrTimeline2Blending = 00000000
clrTimeBase = A0FF0000
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00

View File

@ -16,6 +16,10 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
0,
geoManager.timeLineWidth,
1440*geoManager.minutePixel));
timeBase = osdManager.requestPixmap(3, cRect(0,
geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,
geoManager.osdWidth,
geoManager.timeLineGridHeight));
} else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight,
@ -29,8 +33,12 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
0,
1440*geoManager.minutePixel,
geoManager.timeLineHeight));
timeBase = osdManager.requestPixmap(3, cRect(geoManager.channelGroupsWidth + geoManager.channelHeaderWidth,
geoManager.statusHeaderHeight,
geoManager.timeLineGridWidth,
geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight));
}
timeBase->Fill(clrTransparent);
int clockY = 10;
int clockX;
if (tvguideConfig.scaleVideo) {
@ -192,6 +200,20 @@ void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, in
}
}
void cTimeLine::drawCurrentTimeBase(void) {
timeBase->Fill(clrTransparent);
bool nowVisible = myTime->NowVisible();
if (!nowVisible)
return;
int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel;
if (tvguideConfig.displayMode == eVertical) {
timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase));
} else {
timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
}
}
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL;
if (tvguideConfig.style == eStyleBlendingDefault) {
@ -232,6 +254,8 @@ void cTimeLine::setTimeline() {
yNew = 0;
}
timeline->SetDrawPortPoint(cPoint(xNew, yNew));
if (tvguideConfig.displayTimeBase)
drawCurrentTimeBase();
}
void cTimeLine::drawClock() {

View File

@ -12,15 +12,17 @@ private:
cStyledPixmap *dateViewer;
cPixmap *timeline;
cStyledPixmap *clock;
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
cPixmap *timeBase;
void decorateTile(int posX, int posY, int tileWidth, int tileHeight);
void drawRoundedCorners(int posX, int posY, int width, int height, int radius);
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
void drawCurrentTimeBase(void);
public:
cTimeLine(cMyTime *myTime);
virtual ~cTimeLine(void);
void setTimeline();
void drawDateViewer();
void drawTimeline();
void setTimeline();
void drawClock();
};

View File

@ -120,6 +120,13 @@ time_t cMyTime::GetRounded() {
return mktime(rounded);
}
bool cMyTime::NowVisible(void) {
if (t > tStart)
return true;
return false;
}
void cMyTime::debug() {
esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
}

View File

@ -15,6 +15,7 @@ class cMyTime {
virtual ~cMyTime(void);
static cString printTime(time_t displayTime);
void Now();
time_t GetNow() { return t; };
void AddStep(int step);
bool DelStep(int step);
void SetTime(time_t newTime);
@ -29,6 +30,7 @@ class cMyTime {
bool tooFarInPast(time_t current);
int GetTimelineOffset();
time_t GetRounded();
bool NowVisible(void);
void debug();
};