Version 0.0.4

This commit is contained in:
louis 2013-05-24 16:23:23 +02:00
parent c611e00458
commit 9f47ab764e
25 changed files with 886 additions and 496 deletions

View File

@ -11,7 +11,7 @@ VDR Plugin 'tvguide' Revision History
- Changed channelheader to display transparent logos properly
- Added "style nOpacity" for backgrounds and theme nOpacity
Version 0.0.3
2013-05-13: Version 0.0.3
- Added dummy grids if no EPG information is available for a certain
time
@ -19,3 +19,8 @@ Version 0.0.3
- Completely rewrote code for scrolling forward and backward in time
- Added status header with epg information of currently selected
schedule and scaled video picture
2013-05-24: Version 0.0.4
- Introduced horizontal display
- Added Theme DarkRed

View File

@ -105,7 +105,11 @@ void cChannelColumn::drawGrids() {
}
int cChannelColumn::getX() {
return tvguideConfig.timeColWidth + num*tvguideConfig.colWidth;
return tvguideConfig.timeLineWidth + num*tvguideConfig.colWidth;
}
int cChannelColumn::getY() {
return tvguideConfig.statusHeaderHeight + tvguideConfig.timeLineHeight + num*tvguideConfig.rowHeight;
}
cGrid * cChannelColumn::getActive() {

View File

@ -26,6 +26,7 @@ public:
bool readGrids();
void drawGrids();
int getX();
int getY();
int Start() { return myTime->GetStart(); };
int Stop() { return myTime->GetEnd(); };
const char* Name() { return channel->Name(); };

222
config.c
View File

@ -5,100 +5,141 @@ enum {
e24Hours
};
enum {
eVertical,
eHorizontal
};
cTvguideConfig::cTvguideConfig() {
osdWidth = 0;
osdHeight = 0;
displayMode = eHorizontal;
colWidth = 0;
rowHeight = 0;
channelCols = 5;
channelRows = 10;
displayTime = 160;
minuteHeight = 0;
minutePixel = 0;
displayStatusHeader = 1;
statusHeaderPercent = 20;
statusHeaderHeight = 0;
scaleVideo = 1;
timeColWidth = 120;
headerHeight = 150;
decorateVideo = 1;
timeLineWidthPercent = 8;
timeLineHeightPercent = 4;
displayChannelName = 1;
channelHeaderWidthPercent = 20;
channelHeaderHeightPercent = 15;
footerHeight = 80;
stepMinutes = 30;
bigStepHours = 3;
hugeStepHours = 24;
jumpChannels = 5;
jumpChannels = 10;
hideChannelLogos = 0;
logoWidth = 130;
logoHeight = 100;
logoWidthRatio = 13;
logoHeightRatio = 10;
logoExtension = 0;
hideEpgImages = 0;
epgImageWidth = 315;
epgImageHeight = 240;
fontIndex = 0;
fontNameDefault = "VDRSymbols Sans:Book";
fontHeaderSize = 33;
fontStatusHeaderSize = 27;
fontStatusHeaderLargeSize = 33;
fontGridSize = 27;
fontGridSmallSize = 24;
fontTimeLineWeekdaySize = 40;
fontTimeLineDateSize = 33;
fontTimeLineTimeSize = 0;
fontTimeLineTimeSizeDef12 = 24;
fontTimeLineTimeSizeDef24 = 33;
fontButtonSize = 33;
fontDetailViewSize = 33;
fontDetailHeaderSize = 40;
fontMessageBoxSize = 33;
fontMessageBoxLargeSize = 40;
FontHeader = NULL;
FontGrid = NULL;
FontGridSmall = NULL;
FontTimeLineWeekday = NULL;
FontTimeLineDate = NULL;
FontTimeLineTime = NULL;
FontButtonDelta = 0;
FontDetailViewDelta = 0;
FontDetailHeaderDelta = 0;
FontMessageBoxDelta = 0;
FontMessageBoxLargeDelta = 0;
FontStatusHeaderDelta = 0;
FontStatusHeaderLargeDelta = 0;
FontChannelHeaderDelta = 0;
FontGridDelta = 0;
FontGridSmallDelta = 0;
FontTimeLineWeekdayDelta = 0;
FontTimeLineDateDelta = 0;
FontTimeLineTimeDelta = 0;
FontChannelHeaderHorizontalDelta = 0;
FontGridHorizontalDelta = 0;
FontGridHorizontalSmallDelta = 0;
FontTimeLineDateHorizontalDelta = 0;
FontTimeLineTimeHorizontalDelta = 0;
//Common Fonts
FontButton = NULL;
FontDetailView = NULL;
FontDetailHeader = NULL;
FontMessageBox = NULL;
FontMessageBoxLarge = NULL;
FontStatusHeader = NULL;
FontStatusHeaderLarge = NULL;
//Fonts for vertical Display
FontChannelHeader = NULL;
FontGrid = NULL;
FontGridSmall = NULL;
FontTimeLineWeekday = NULL;
FontTimeLineDate = NULL;
FontTimeLineTime = NULL;
//Fonts for horizontal Display
FontChannelHeaderHorizontal = NULL;
FontGridHorizontal = NULL;
FontGridHorizontalSmall = NULL;
FontTimeLineDateHorizontal = NULL;
FontTimeLineTimeHorizontal = NULL;
timeFormat = 1;
themeIndex = 0;
useBlending = 1;
themeIndex = 4;
useBlending = 2;
roundedCorners = 0;
}
cTvguideConfig::~cTvguideConfig() {
delete FontHeader;
delete FontStatusHeader;
delete FontStatusHeaderLarge;
delete FontGrid;
delete FontGridSmall;
delete FontTimeLineWeekday;
delete FontTimeLineDate;
delete FontTimeLineTime;
delete FontButton;
delete FontDetailView;
delete FontDetailHeader;
delete FontMessageBox;
delete FontMessageBoxLarge;
delete FontStatusHeader;
delete FontStatusHeaderLarge;
delete FontChannelHeader;
delete FontGrid;
delete FontGridSmall;
delete FontTimeLineWeekday;
delete FontTimeLineDate;
delete FontTimeLineTime;
delete FontChannelHeaderHorizontal;
delete FontGridHorizontal;
delete FontGridHorizontalSmall;
delete FontTimeLineDateHorizontal;
delete FontTimeLineTimeHorizontal;
}
void cTvguideConfig::setDynamicValues(int width, int height) {
SetGeometry(width, height);
SetFonts();
}
void cTvguideConfig::SetGeometry(int width, int height) {
osdWidth = width;
osdHeight = height;
colWidth = (osdWidth - timeColWidth) / channelCols;
statusHeaderHeight = (displayStatusHeader)?(statusHeaderPercent * osdHeight / 100):0;
minuteHeight = (osdHeight - statusHeaderHeight - headerHeight - footerHeight) / displayTime;
channelHeaderWidth = channelHeaderWidthPercent * osdWidth / 100;
channelHeaderHeight = channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = timeLineWidthPercent * osdWidth / 100;
timeLineHeight = timeLineHeightPercent * osdHeight / 100;
if (!fontTimeLineTimeSize) {
if (timeFormat == e12Hours) {
fontTimeLineTimeSize = fontTimeLineTimeSizeDef12;
} else if (timeFormat == e24Hours) {
fontTimeLineTimeSize = fontTimeLineTimeSizeDef24;
}
} else if ((fontTimeLineTimeSize == fontTimeLineTimeSizeDef12) && (timeFormat == e24Hours)) {
fontTimeLineTimeSize = fontTimeLineTimeSizeDef24;
} else if ((fontTimeLineTimeSize == fontTimeLineTimeSizeDef24) && (timeFormat == e12Hours)) {
fontTimeLineTimeSize = fontTimeLineTimeSizeDef12;
if (displayMode == eVertical) {
colWidth = (osdWidth - timeLineWidth) / channelCols;
rowHeight = 0;
minutePixel = (osdHeight - statusHeaderHeight - channelHeaderHeight - footerHeight) / displayTime;
} else if (displayMode == eHorizontal) {
colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / channelRows;
minutePixel = (osdWidth - channelHeaderWidth) / displayTime;
}
numGrids = (displayMode == eVertical)?channelCols:channelRows;
}
void cTvguideConfig::SetFonts(void){
cString fontname;
if (fontIndex == 0) {
fontname = fontNameDefault;
@ -111,24 +152,34 @@ void cTvguideConfig::setDynamicValues(int width, int height) {
fontname = fontNameDefault;
}
cFont *test = NULL;
test = cFont::CreateFont(*fontname, fontHeaderSize);
test = cFont::CreateFont(*fontname, 30);
if (!test) {
fontname = DefaultFontSml;
}
delete test;
FontHeader = cFont::CreateFont(*fontname, fontHeaderSize);
FontStatusHeader = cFont::CreateFont(*fontname, fontStatusHeaderSize);
FontStatusHeaderLarge = cFont::CreateFont(*fontname, fontStatusHeaderLargeSize);
FontGrid = cFont::CreateFont(*fontname, fontGridSize);
FontGridSmall = cFont::CreateFont(*fontname, fontGridSmallSize);
FontTimeLineWeekday = cFont::CreateFont(*fontname, fontTimeLineWeekdaySize);
FontTimeLineDate = cFont::CreateFont(*fontname, fontTimeLineDateSize);
FontTimeLineTime = cFont::CreateFont(*fontname, fontTimeLineTimeSize);
FontButton = cFont::CreateFont(*fontname, fontButtonSize);
FontDetailView = cFont::CreateFont(*fontname, fontDetailViewSize);
FontDetailHeader = cFont::CreateFont(*fontname, fontDetailHeaderSize);
FontMessageBox = cFont::CreateFont(*fontname, fontMessageBoxSize);
FontMessageBoxLarge = cFont::CreateFont(*fontname, fontMessageBoxLargeSize);
//Common Fonts
FontButton = cFont::CreateFont(*fontname, footerHeight/3 + 4 + FontButtonDelta);
FontDetailView = cFont::CreateFont(*fontname, osdHeight/30 + FontDetailViewDelta);
FontDetailHeader = cFont::CreateFont(*fontname, osdHeight/25 + FontDetailHeaderDelta);
FontMessageBox = cFont::CreateFont(*fontname, osdHeight/33 + FontMessageBoxDelta);
FontMessageBoxLarge = cFont::CreateFont(*fontname, osdHeight/30 + FontMessageBoxLargeDelta);
FontStatusHeader = cFont::CreateFont(*fontname, statusHeaderHeight/6 - 4 + FontStatusHeaderDelta);
FontStatusHeaderLarge = cFont::CreateFont(*fontname, statusHeaderHeight/5 + FontStatusHeaderLargeDelta);
//Fonts for vertical Display
FontChannelHeader = cFont::CreateFont(*fontname, colWidth/10 + FontChannelHeaderDelta);
FontGrid = cFont::CreateFont(*fontname, colWidth/12 + FontGridDelta);
FontGridSmall = cFont::CreateFont(*fontname, colWidth/12 + FontGridSmallDelta);
FontTimeLineWeekday = cFont::CreateFont(*fontname, timeLineWidth/3 + FontTimeLineWeekdayDelta);
FontTimeLineDate = cFont::CreateFont(*fontname, timeLineWidth/4 + FontTimeLineDateDelta);
FontTimeLineTime = cFont::CreateFont(*fontname, timeLineWidth/4 + FontTimeLineTimeDelta);
//Fonts for horizontal Display
FontChannelHeaderHorizontal = cFont::CreateFont(*fontname, rowHeight/3 + FontChannelHeaderHorizontalDelta);
FontGridHorizontal = cFont::CreateFont(*fontname, rowHeight/3 + 5 + FontGridHorizontalDelta);
FontGridHorizontalSmall = cFont::CreateFont(*fontname, rowHeight/4 + FontGridHorizontalSmallDelta);
FontTimeLineDateHorizontal = cFont::CreateFont(*fontname, timeLineHeight/2 + 5 + FontTimeLineDateHorizontalDelta);
FontTimeLineTimeHorizontal = cFont::CreateFont(*fontname, timeLineHeight/2 + FontTimeLineTimeHorizontalDelta);
}
void cTvguideConfig::SetLogoPath(cString path) {
@ -151,40 +202,51 @@ void cTvguideConfig::loadTheme() {
bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "timeFormat") == 0) timeFormat = atoi(Value);
else if (strcmp(Name, "themeIndex") == 0) themeIndex = atoi(Value);
else if (strcmp(Name, "displayMode") == 0) displayMode = atoi(Value);
else if (strcmp(Name, "displayStatusHeader") == 0) displayStatusHeader = atoi(Value);
else if (strcmp(Name, "statusHeaderPercent") == 0) statusHeaderPercent = atoi(Value);
else if (strcmp(Name, "scaleVideo") == 0) scaleVideo = atoi(Value);
else if (strcmp(Name, "decorateVideo") == 0) decorateVideo = atoi(Value);
else if (strcmp(Name, "useBlending") == 0) useBlending = atoi(Value);
else if (strcmp(Name, "roundedCorners") == 0) roundedCorners = atoi(Value);
else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value);
else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value);
else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value);
else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value);
else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(Value);
else if (strcmp(Name, "logoWidth") == 0) logoWidth = atoi(Value);
else if (strcmp(Name, "logoHeight") == 0) logoHeight = atoi(Value);
else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value);
else if (strcmp(Name, "logoHeightRatio") == 0) logoHeightRatio = atoi(Value);
else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value);
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "jumpChannels") == 0) jumpChannels = atoi(Value);
else if (strcmp(Name, "hideEpgImages") == 0) hideEpgImages = atoi(Value);
else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value);
else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value);
else if (strcmp(Name, "timeColWidth") == 0) timeColWidth = atoi(Value);
else if (strcmp(Name, "headerHeight") == 0) headerHeight = atoi(Value);
else if (strcmp(Name, "timeLineWidthPercent") == 0) timeLineWidthPercent = atoi(Value);
else if (strcmp(Name, "timeLineHeightPercent") == 0) timeLineHeightPercent = atoi(Value);
else if (strcmp(Name, "displayChannelName") == 0) displayChannelName = atoi(Value);
else if (strcmp(Name, "channelHeaderWidthPercent") == 0) channelHeaderWidthPercent = atoi(Value);
else if (strcmp(Name, "channelHeaderHeightPercent") == 0) channelHeaderHeightPercent = atoi(Value);
else if (strcmp(Name, "footerHeight") == 0) footerHeight = atoi(Value);
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
else if (strcmp(Name, "fontHeaderSize") == 0) fontHeaderSize = atoi(Value);
else if (strcmp(Name, "fontStatusHeaderSize") == 0) fontStatusHeaderSize = atoi(Value);
else if (strcmp(Name, "fontStatusHeaderLargeSize") == 0) fontStatusHeaderLargeSize = atoi(Value);
else if (strcmp(Name, "fontGridSize") == 0) fontGridSize = atoi(Value);
else if (strcmp(Name, "fontGridSmallSize") == 0) fontGridSmallSize = atoi(Value);
else if (strcmp(Name, "fontTimeLineWeekdaySize") == 0) fontTimeLineWeekdaySize = atoi(Value);
else if (strcmp(Name, "fontTimeLineDateSize") == 0) fontTimeLineDateSize = atoi(Value);
else if (strcmp(Name, "fontTimeLineTimeSize") == 0) fontTimeLineTimeSize = atoi(Value);
else if (strcmp(Name, "fontButtonSize") == 0) fontButtonSize = atoi(Value);
else if (strcmp(Name, "fontDetailViewSize") == 0) fontDetailViewSize = atoi(Value);
else if (strcmp(Name, "fontDetailHeaderSize") == 0) fontDetailHeaderSize = atoi(Value);
else if (strcmp(Name, "fontMessageBoxSize") == 0) fontMessageBoxSize = atoi(Value);
else if (strcmp(Name, "fontMessageBoxLargeSize") == 0) fontMessageBoxLargeSize = atoi(Value);
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);
else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value);
else if (strcmp(Name, "FontDetailHeaderDelta") == 0) FontDetailHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxDelta") == 0) FontMessageBoxDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxLargeDelta") == 0) FontMessageBoxLargeDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderDelta") == 0) FontStatusHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderLargeDelta") == 0) FontStatusHeaderLargeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderDelta") == 0) FontChannelHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontGridDelta") == 0) FontGridDelta = atoi(Value);
else if (strcmp(Name, "FontGridSmallDelta") == 0) FontGridSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineWeekdayDelta") == 0) FontTimeLineWeekdayDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateDelta") == 0) FontTimeLineDateDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeDelta") == 0) FontTimeLineTimeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderHorizontalDelta") == 0) FontChannelHeaderHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalDelta") == 0) FontGridHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalSmallDelta") == 0) FontGridHorizontalSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateHorizontalDelta") == 0) FontTimeLineDateHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeHorizontalDelta") == 0) FontTimeLineTimeHorizontalDelta = atoi(Value);
else return false;
return true;
}

View File

@ -7,26 +7,40 @@ class cTvguideConfig {
~cTvguideConfig();
void SetLogoPath(cString path);
void SetImagesPath(cString path);
void SetGeometry(int width, int height);
void SetFonts(void);
int osdWidth;
int osdHeight;
int displayMode;
int colWidth;
int rowHeight;
int channelCols;
int channelRows;
int numGrids;
int displayTime;
int minuteHeight;
int minutePixel;
int displayStatusHeader;
int statusHeaderPercent;
int statusHeaderHeight;
int scaleVideo;
int timeColWidth;
int headerHeight;
int decorateVideo;
int timeLineWidthPercent;
int timeLineHeightPercent;
int timeLineWidth;
int timeLineHeight;
int displayChannelName;
int channelHeaderWidthPercent;
int channelHeaderHeightPercent;
int channelHeaderWidth;
int channelHeaderHeight;
int footerHeight;
int stepMinutes;
int bigStepHours;
int hugeStepHours;
int jumpChannels;
int hideChannelLogos;
int logoWidth;
int logoHeight;
int logoWidthRatio;
int logoHeightRatio;
cString logoPath;
int logoExtension;
int hideEpgImages;
@ -35,29 +49,37 @@ class cTvguideConfig {
cString epgImagePath;
int fontIndex;
const char *fontNameDefault;
int fontHeaderSize;
int fontStatusHeaderSize;
int fontStatusHeaderLargeSize;
int fontGridSize;
int fontGridSmallSize;
int fontTimeLineWeekdaySize;
int fontTimeLineDateSize;
int fontTimeLineTimeSize;
int fontTimeLineTimeSizeDef12;
int fontTimeLineTimeSizeDef24;
int fontButtonSize;
int fontDetailViewSize;
int fontDetailHeaderSize;
int fontMessageBoxSize;
int fontMessageBoxLargeSize;
const cFont *FontHeader;
int FontButtonDelta;
int FontDetailViewDelta;
int FontDetailHeaderDelta;
int FontMessageBoxDelta;
int FontMessageBoxLargeDelta;
int FontStatusHeaderDelta;
int FontStatusHeaderLargeDelta;
int FontChannelHeaderDelta;
int FontGridDelta;
int FontGridSmallDelta;
int FontTimeLineWeekdayDelta;
int FontTimeLineDateDelta;
int FontTimeLineTimeDelta;
int FontChannelHeaderHorizontalDelta;
int FontGridHorizontalDelta;
int FontGridHorizontalSmallDelta;
int FontTimeLineDateHorizontalDelta;
int FontTimeLineTimeHorizontalDelta;
const cFont *FontChannelHeader;
const cFont *FontChannelHeaderHorizontal;
const cFont *FontStatusHeader;
const cFont *FontStatusHeaderLarge;
const cFont *FontGrid;
const cFont *FontGridSmall;
const cFont *FontGridHorizontal;
const cFont *FontGridHorizontalSmall;
const cFont *FontTimeLineWeekday;
const cFont *FontTimeLineDate;
const cFont *FontTimeLineDateHorizontal;
const cFont *FontTimeLineTime;
const cFont *FontTimeLineTimeHorizontal;
const cFont *FontButton;
const cFont *FontDetailView;
const cFont *FontDetailHeader;

View File

@ -7,8 +7,8 @@ cDetailView::cDetailView(cGrid *grid) {
FrameTime = 40; // ms
FadeTime = 500; // ms
borderWidth = 100; //px
headerHeight = max (80 + tvguideConfig.logoHeight + 3 * tvguideConfig.FontDetailHeader->Height(), // border + logo + 3 Lines
80 + tvguideConfig.epgImageHeight);
headerHeight = max (40 + 3 * tvguideConfig.FontDetailHeader->Height(), // border + 3 Lines
40 + tvguideConfig.epgImageHeight);
description.Set(event->Description(), tvguideConfig.FontDetailView, tvguideConfig.osdWidth-2*borderWidth - 50 - 40);
contentScrollable = setContentDrawportHeight();
createPixmaps();
@ -61,19 +61,17 @@ void cDetailView::createPixmaps() {
void cDetailView::drawHeader() {
header->drawBackground();
header->drawBoldBorder();
int logoHeight = header->Height() / 2;
int logoWidth = logoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int lineHeight = tvguideConfig.FontDetailHeader->Height();
int offset = 30;
cImageLoader imgLoader;
if (tvguideConfig.hideChannelLogos) {
header->DrawText(cPoint(20, offset + 10), grid->column->getChannel()->Name(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailHeader);
offset += lineHeight + 10;
} else {
if (imgLoader.LoadLogo(grid->column->getChannel()->Name())) {
bool logoDrawn = false;
if (!tvguideConfig.hideChannelLogos) {
if (imgLoader.LoadLogo(grid->column->getChannel()->Name(), logoWidth, logoHeight)) {
cImage logo = imgLoader.GetImage();
headerLogo->DrawImage(cPoint(20, 20), logo);
headerLogo->DrawImage(cPoint(10, (header->Height() - logoHeight)/2), logo);
logoDrawn = true;
}
offset += tvguideConfig.logoHeight;
}
if (!tvguideConfig.hideEpgImages) {
@ -85,11 +83,12 @@ void cDetailView::drawHeader() {
header->DrawImage(cPoint(epgImageX, epgImageY), epgImage);
}
}
header->DrawText(cPoint(20, offset), event->Title(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailHeader);
int textX = logoDrawn?(20 + logoWidth):20;
int textY = (header->Height() - 2*lineHeight)/2;
header->DrawText(cPoint(textX, textY), event->Title(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailHeader);
cString datetime = cString::sprintf("%s, %s - %s (%d min)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60);
header->DrawText(cPoint(20, offset + lineHeight), *datetime, theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView);
header->DrawText(cPoint(20, offset + 2 * lineHeight), event->ShortText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView);
header->DrawText(cPoint(textX, textY + lineHeight), *datetime, theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView);
header->DrawText(cPoint(textX, textY + 2 * lineHeight), event->ShortText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView);
}
void cDetailView::drawContent() {

View File

@ -12,38 +12,63 @@ cDummyGrid::~cDummyGrid(void) {
void cDummyGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight;
viewportHeight = Duration() / 60 * tvguideConfig.minuteHeight;
viewportHeight = Duration() / 60 * tvguideConfig.minutePixel;
if (viewportHeight != viewportHeightOld)
dirty = true;
}
void cDummyGrid::PositionPixmap() {
int x0 = column->getX();
int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight;
int x0, y0;
if (tvguideConfig.displayMode == eVertical) {
x0 = column->getX();
y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight;
if ( column->Start() < StartTime() ) {
y0 += (StartTime() - column->Start())/60*tvguideConfig.minuteHeight;
y0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight), cRect::Null);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight));
} else if (dirty) {
osdManager.releasePixmap(pixmap);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight), cRect::Null);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, tvguideConfig.colWidth, viewportHeight));
}
} else if (tvguideConfig.displayMode == eHorizontal) {
x0 = tvguideConfig.channelHeaderWidth;
y0 = column->getY();
if ( column->Start() < StartTime() ) {
x0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight));
} else if (dirty) {
osdManager.releasePixmap(pixmap);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight));
}
}
}
void cDummyGrid::setText() {
text->Set(*(strText), tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth);
if (tvguideConfig.displayMode == eVertical) {
text->Set(*strText, tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth);
}
}
void cDummyGrid::drawText() {
if (Height()/tvguideConfig.minuteHeight < 6)
if (tvguideConfig.displayMode == eVertical) {
if (Height()/tvguideConfig.minutePixel < 6)
return;
int textHeight = tvguideConfig.FontGrid->Height();
int textLines = text->Lines();
for (int i=0; i<textLines; i++) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGrid);
}
} else if (tvguideConfig.displayMode == eHorizontal) {
int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth, titleY), *strText, theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridHorizontal);
}
}
cString cDummyGrid::getText(void) {

View File

@ -24,34 +24,55 @@ void cEpgGrid::SetViewportHeight() {
} else {
viewportHeight = Duration() / 60;
}
viewportHeight *= tvguideConfig.minuteHeight;
viewportHeight *= tvguideConfig.minutePixel;
if (viewportHeight != viewportHeightOld)
dirty = true;
}
void cEpgGrid::PositionPixmap() {
int x0, y0;
if (tvguideConfig.displayMode == eVertical) {
int x0 = column->getX();
int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight;
int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight;
if ( column->Start() < StartTime() ) {
y0 += (StartTime() - column->Start())/60*tvguideConfig.minuteHeight;
y0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight),
cRect(0, 0, tvguideConfig.colWidth, Duration()/60*tvguideConfig.minuteHeight));
cRect(0, 0, tvguideConfig.colWidth, Duration()/60*tvguideConfig.minutePixel));
} else {
pixmap->SetViewPort(cRect(x0, y0, tvguideConfig.colWidth, viewportHeight));
}
} else if (tvguideConfig.displayMode == eHorizontal) {
int x0 = tvguideConfig.channelHeaderWidth;
int y0 = column->getY();
if ( column->Start() < StartTime() ) {
x0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight),
cRect(0, 0, Duration()/60*tvguideConfig.minutePixel, tvguideConfig.rowHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight ));
}
}
}
void cEpgGrid::setText() {
if (tvguideConfig.displayMode == eVertical) {
cString strText;
strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title());
text->Set(*(strText), tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth);
extText->Set(event->ShortText(), tvguideConfig.FontGridSmall, tvguideConfig.colWidth-2*borderWidth);
} else if (tvguideConfig.displayMode == eHorizontal) {
timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
}
void cEpgGrid::drawText() {
if (Height()/tvguideConfig.minuteHeight < 6)
if (tvguideConfig.displayMode == eVertical) {
if (Height()/tvguideConfig.minutePixel < 6)
return;
int textHeight = tvguideConfig.FontGrid->Height();
int textLines = text->Lines();
@ -68,6 +89,17 @@ void cEpgGrid::drawText() {
}
if (hasTimer)
drawRecIcon();
} else if (tvguideConfig.displayMode == eHorizontal) {
if (Width()/tvguideConfig.minutePixel < 10) {
int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridHorizontal);
return;
}
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridHorizontalSmall);
cString strTitle = CutText(event->Title(), viewportHeight, tvguideConfig.FontGridHorizontal).c_str();
int titleY = tvguideConfig.FontGridHorizontalSmall->Height() + (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontalSmall->Height() - tvguideConfig.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridHorizontal);
}
}
void cEpgGrid::drawRecIcon() {

View File

@ -7,6 +7,7 @@ class cEpgGrid : public cGrid {
private:
const cEvent *event;
cTextWrapper *extText;
cString timeString;
bool hasTimer;
void drawText();
void drawRecIcon();

View File

@ -2,13 +2,13 @@
cFooter::cFooter() {
buttonBorder = 20;
buttonWidth = (tvguideConfig.osdWidth - tvguideConfig.timeColWidth - 5*buttonBorder)/4;
buttonWidth = (tvguideConfig.osdWidth - tvguideConfig.timeLineWidth - 5*buttonBorder)/4;
buttonHeight= tvguideConfig.footerHeight - 2*buttonBorder;
buttonY = (tvguideConfig.footerHeight - buttonHeight)/2;
footer = osdManager.requestPixmap(2, cRect( tvguideConfig.timeColWidth,
footer = osdManager.requestPixmap(2, cRect( tvguideConfig.timeLineWidth,
tvguideConfig.osdHeight - tvguideConfig.footerHeight,
tvguideConfig.osdWidth - tvguideConfig.timeColWidth,
tvguideConfig.osdWidth - tvguideConfig.timeLineWidth,
tvguideConfig.footerHeight),
cRect::Null);
footer->Fill(clrTransparent);

View File

@ -12,20 +12,21 @@ cHeaderGrid::~cHeaderGrid(void) {
void cHeaderGrid::createBackground(int num) {
color = theme.Color(clrHeader);
colorBlending = theme.Color(clrHeaderBlending);
pixmap = osdManager.requestPixmap(2, cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.colWidth,
tvguideConfig.headerHeight)
, cRect::Null);
if (!pixmap) {
return;
int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) {
x = tvguideConfig.timeLineWidth + num*tvguideConfig.colWidth;
y = tvguideConfig.statusHeaderHeight;
width = tvguideConfig.colWidth;
height = tvguideConfig.channelHeaderHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = 0;
y = tvguideConfig.statusHeaderHeight + tvguideConfig.timeLineHeight + num*tvguideConfig.rowHeight;
width = tvguideConfig.channelHeaderWidth;
height = tvguideConfig.rowHeight;
}
pixmapLogo = osdManager.requestPixmap(3, cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.colWidth,
tvguideConfig.headerHeight)
, cRect::Null);
if (!pixmapLogo) {
pixmap = osdManager.requestPixmap(2, cRect(x, y, width, height));
pixmapLogo = osdManager.requestPixmap(3, cRect(x, y, width, height));
if ((!pixmap) || (!pixmapLogo)){
return;
}
pixmapLogo->Fill(clrTransparent);
@ -33,38 +34,93 @@ void cHeaderGrid::createBackground(int num) {
}
void cHeaderGrid::drawChannel(const cChannel *channel) {
cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
tw.Set(*headerText, tvguideConfig.FontHeader, tvguideConfig.colWidth - 8);
int lines = tw.Lines();
int lineHeight = tvguideConfig.FontHeader->Height();
int yStart = (tvguideConfig.headerHeight - lines*lineHeight)/2 + 8;
if (!tvguideConfig.hideChannelLogos) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel->Name())) {
cImage logo = imgLoader.GetImage();
int logoX = (tvguideConfig.colWidth - tvguideConfig.logoWidth)/2;
pixmapLogo->DrawImage(cPoint(logoX, 5), logo);
}
yStart = tvguideConfig.logoHeight + 8;
}
for (int i=0; i<lines; i++) {
int textWidth = tvguideConfig.FontHeader->Width(tw.GetLine(i));
int xText = (tvguideConfig.colWidth - textWidth) / 2;
if (xText < 0)
xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontHeader);
if (tvguideConfig.displayMode == eVertical) {
drawChannelVertical(channel);
} else if (tvguideConfig.displayMode == eHorizontal) {
drawChannelHorizontal(channel);
}
drawBorder();
}
void cHeaderGrid::setPosition(int num) {
pixmap->SetViewPort(cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.colWidth,
tvguideConfig.headerHeight));
pixmapLogo->SetViewPort(cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.colWidth,
tvguideConfig.headerHeight));
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int logoWidth = Height() * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoX = tvguideConfig.displayChannelName?2:(Width()-logoWidth)/2;
int textX = 5;
int textY = (Height() - tvguideConfig.FontChannelHeaderHorizontal->Height())/2;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel->Name(), logoWidth, Height())) {
cImage logo = imgLoader.GetImage();
pixmapLogo->DrawImage(cPoint(logoX, 0), logo);
logoFound = true;
}
}
bool drawText = false;
int textWidthMax = Width() - 10;
if (!logoFound) {
drawText = true;
} else if (tvguideConfig.displayChannelName) {
drawText = true;
textX += logoWidth;
textWidthMax -= logoWidth;
}
if (drawText) {
cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name());
strChannel = CutText(*strChannel, textWidthMax, tvguideConfig.FontChannelHeaderHorizontal).c_str();
pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeaderHorizontal);
}
}
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int logoWidth = Width()/2 - 15;
int logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
tw.Set(*headerText, tvguideConfig.FontChannelHeader, tvguideConfig.colWidth - 8);
int lines = tw.Lines();
int lineHeight = tvguideConfig.FontChannelHeader->Height();
int yStart = (tvguideConfig.channelHeaderHeight - lines*lineHeight)/2 + 8;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel->Name(), logoWidth, logoHeight)) {
cImage logo = imgLoader.GetImage();
pixmapLogo->DrawImage(cPoint((Width() - logoWidth)/2, 4), logo);
logoFound = true;
}
}
bool drawText = false;
if (!logoFound) {
drawText = true;
} else if (tvguideConfig.displayChannelName) {
drawText = true;
yStart = logoHeight;
}
if (!drawText)
return;
for (int i=0; i<lines; i++) {
int textWidth = tvguideConfig.FontChannelHeader->Width(tw.GetLine(i));
int xText = (tvguideConfig.colWidth - textWidth) / 2;
if (xText < 0)
xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeader);
}
}
void cHeaderGrid::setPosition(int num) {
int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) {
x = tvguideConfig.timeLineWidth + num*tvguideConfig.colWidth;
y = tvguideConfig.statusHeaderHeight;
width = tvguideConfig.colWidth;
height = tvguideConfig.channelHeaderHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = 0;
y = tvguideConfig.statusHeaderHeight + tvguideConfig.timeLineHeight + num*tvguideConfig.rowHeight;
width = tvguideConfig.channelHeaderWidth;
height = tvguideConfig.rowHeight;
}
pixmap->SetViewPort(cRect(x, y, width, height));
pixmapLogo->SetViewPort(cRect(x, y, width, height));
}

View File

@ -6,6 +6,8 @@
class cHeaderGrid : public cGrid {
private:
cPixmap *pixmapLogo;
void drawChannelHorizontal(const cChannel *channel);
void drawChannelVertical(const cChannel *channel);
public:
cHeaderGrid(void);
virtual ~cHeaderGrid(void);

View File

@ -13,7 +13,8 @@ cImageLoader::cImageLoader() {
cImageLoader::~cImageLoader() {
}
bool cImageLoader::LoadLogo(const char *logo, int width = tvguideConfig.logoWidth, int height = tvguideConfig.logoHeight) {
bool cImageLoader::LoadLogo(const char *logo, int width, int height) {
if ((width == 0)||(height==0))
return false;
std::string logoLower = logo;
@ -26,9 +27,7 @@ bool cImageLoader::LoadLogo(const char *logo, int width = tvguideConfig.logoWidt
}
if (!LoadImage(logoLower.c_str(), tvguideConfig.logoPath, extension))
return false;
if (height != 0 || width != 0) {
buffer.sample( Geometry(width, height));
}
return true;
}
@ -46,7 +45,7 @@ bool cImageLoader::LoadEPGImage(int eventID) {
}
bool cImageLoader::DrawBackground(tColor back, tColor blend, int width, int height) {
if ((width == 0) || (height == 0))
if ((width < 1) || (height < 1))
return false;
Color Back = Argb2Color(back);
Color Blend = Argb2Color(blend);

View File

@ -37,7 +37,8 @@ bool cOsdManager::setOsd() {
void cOsdManager::setBackground() {
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) {
osd->DrawRectangle(0, 0, cOsd::OsdWidth() - tvguideConfig.statusHeaderHeight * 16 / 9, tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD));
int widthStatus = cOsd::OsdWidth() - tvguideConfig.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, tvguideConfig.statusHeaderHeight, cOsd::OsdWidth(), cOsd::OsdHeight() - tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD));
}
else

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: 2013-05-20 11:27+0200\n"
"POT-Creation-Date: 2013-05-24 14:53+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -36,14 +36,20 @@ msgstr "Anzeigeoptionen"
msgid "Fonts and Fontsizes"
msgstr "Schriften und Schriftgrößen"
msgid "Number of Channels / Columns"
msgstr "Anzahl der Kanäle bzw. Spalten"
msgid "Theme"
msgstr "Theme"
msgid "Use color gradients"
msgstr "Farbverläufe verwenden"
msgid "Rounded Corners"
msgstr "Abgerundete Ecken"
msgid "Channels to Jump (Keys Green / Yellow)"
msgstr "Kanalsprung (Tasten Grün / Gelb)"
msgid "Time to display vertically in minutes"
msgstr "Vertikal angezeigte Zeit (in Minuten)"
msgid "Time to display in minutes"
msgstr "Angezeigte Zeitspanne in Minuten"
msgid "Big Step (Keys 1 / 3) in hours"
msgstr "Großer Sprung (Tasten 1 / 3) in Stunden"
@ -54,32 +60,41 @@ msgstr "Sehr großer Sprung (Tasten 4 / 6) in Stunden"
msgid "Time Format (12h/24h)"
msgstr "Zeitformat (12h/24h)"
msgid "Theme"
msgstr "Theme"
msgid "Display Mode"
msgstr "Anzeigemodus"
msgid "Height of Channel Header (Perc. of osd height)"
msgstr "Höhe des Kanalheaders (% der OSD Höhe)"
msgid "Width of Timeline (Perc. of osd width)"
msgstr "Breite der Zeitleiste (% der OSD Breite)"
msgid "Number of Channels to display"
msgstr "Anzahl der angezeigten Kanäle"
msgid "Width of Channel Header (Perc. of osd width)"
msgstr "Breite des Kanalheaders (% der OSD Breite)"
msgid "Height of Timeline (Perc. of osd height)"
msgstr "Höhe der Zeitleiste (% der OSD Höhe)"
msgid "Height of Footer"
msgstr "Höhe des Footers"
msgid "Display status header"
msgstr "Status Header anzeigen"
msgid "Scale video to upper right corner"
msgstr "Video in obere rechte Ecke skalieren"
msgid "Height of status header (Perc. of osd height)"
msgstr "Höhe des Status Headers (% der OSD Höhe)"
msgid "Use color gradients"
msgstr "Farbverläufe verwenden"
msgid "Scale video to upper right corner"
msgstr "Video in obere rechte Ecke skalieren"
msgid "Rounded Corners"
msgstr "Abgerundete Ecken"
msgid "Rounded corners around video frame"
msgstr "Abgerundete Ecken um Videofenster"
msgid "Width of Timeline"
msgstr "Breite der Zeitleiste"
msgid "Height of Header"
msgstr "Höhe des Headers"
msgid "Height of Footer"
msgstr "Höhe des Footers"
msgid "Display Channel Names in Header"
msgstr "Kanalnamen im Header anzeigen"
msgid "Show Channel Logos"
msgstr "Kanallogos anzeigen"
@ -90,11 +105,11 @@ msgstr "Benutzer Pfad für Kanallogos"
msgid "Logo Extension"
msgstr "Logo Extension"
msgid "Logo width"
msgstr "Breite der Logos"
msgid "Logo width ratio"
msgstr "Logo Breitenverhältnis"
msgid "Logo height"
msgstr "Höhe der Logos"
msgid "Logo height ratio"
msgstr "Logo Höhenverhältnis"
msgid "Show EPG Images"
msgstr "EPG Bilder anzeigen"
@ -111,11 +126,26 @@ msgstr "Höhe der EPG Bilder"
msgid "Font"
msgstr "Schriftart"
msgid "Status Header Font Size"
msgstr "Status Header Schriftgröße"
msgid "Status Header Large Font Size"
msgstr "Status Header große Schriftgröße"
msgid "Status Header Font Size"
msgstr "Status Header Schriftgröße"
msgid "Detail EPG View Font Size"
msgstr "Detailierte EPG Ansicht Schriftgröße"
msgid "Detail EPG View Header Font Size"
msgstr "Detailierte EPG Ansicht Header Schriftgröße"
msgid "Message Font Size"
msgstr "Nachrichten Schriftgröße"
msgid "Message Large Font Size"
msgstr "Nachrichten große Schriftgröße"
msgid "Button Font Size"
msgstr "Button Schriftgröße"
msgid "Channel Header Font Size"
msgstr "Kanal Header Schriftgröße"
@ -135,21 +165,6 @@ msgstr "Zeitleiste Datum Schriftgröße"
msgid "Timeline Time Font Size"
msgstr "Zeitleiste Zeit Schriftgröße"
msgid "Button Font Size"
msgstr "Button Schriftgröße"
msgid "Detail EPG View Font Size"
msgstr "Detailierte EPG Ansicht Schriftgröße"
msgid "Detail EPG View Header Font Size"
msgstr "Detailierte EPG Ansicht Header Schriftgröße"
msgid "Message Font Size"
msgstr "Nachrichten Schriftgröße"
msgid "Message Large Font Size"
msgstr "Nachrichten große Schriftgröße"
msgid "Timer not set! There is already a timer for this item."
msgstr "Timer wurde nicht gesetzt! Es existiert bereits ein Timer für diese Sendung"

128
setup.c
View File

@ -46,42 +46,53 @@ void cTvguideSetup::Store(void) {
tvguideConfig = tmpTvguideConfig;
SetupStore("themeIndex", tvguideConfig.themeIndex);
SetupStore("displayMode", tvguideConfig.displayMode);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader);
SetupStore("statusHeaderPercent", tvguideConfig.statusHeaderPercent);
SetupStore("scaleVideo", tvguideConfig.scaleVideo);
SetupStore("decorateVideo", tvguideConfig.decorateVideo);
SetupStore("useBlending", tvguideConfig.useBlending);
SetupStore("roundedCorners", tvguideConfig.roundedCorners);
SetupStore("timeFormat", tvguideConfig.timeFormat);
SetupStore("channelCols", tvguideConfig.channelCols);
SetupStore("channelRows", tvguideConfig.channelRows);
SetupStore("displayTime", tvguideConfig.displayTime);
SetupStore("bigStepHours", tvguideConfig.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
SetupStore("jumpChannels", tvguideConfig.jumpChannels);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension);
SetupStore("logoWidth", tvguideConfig.logoWidth);
SetupStore("logoHeight", tvguideConfig.logoHeight);
SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio);
SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("timeColWidth", tvguideConfig.timeColWidth);
SetupStore("headerHeight", tvguideConfig.headerHeight);
SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent);
SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent);
SetupStore("displayChannelName", tvguideConfig.displayChannelName);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent);
SetupStore("footerHeight", tvguideConfig.footerHeight);
SetupStore("fontIndex", tvguideConfig.fontIndex);
SetupStore("fontHeaderSize", tvguideConfig.fontHeaderSize);
SetupStore("fontStatusHeaderSize", tvguideConfig.fontStatusHeaderSize);
SetupStore("fontStatusHeaderLargeSize", tvguideConfig.fontStatusHeaderLargeSize);
SetupStore("fontGridSize", tvguideConfig.fontGridSize);
SetupStore("fontGridSmallSize", tvguideConfig.fontGridSmallSize);
SetupStore("fontTimeLineWeekdaySize", tvguideConfig.fontTimeLineWeekdaySize);
SetupStore("fontTimeLineDateSize", tvguideConfig.fontTimeLineDateSize);
SetupStore("fontTimeLineTimeSize", tvguideConfig.fontTimeLineTimeSize);
SetupStore("fontButtonSize", tvguideConfig.fontButtonSize);
SetupStore("fontDetailViewSize", tvguideConfig.fontDetailViewSize);
SetupStore("fontDetailHeaderSize", tvguideConfig.fontDetailHeaderSize);
SetupStore("fontMessageBoxSize", tvguideConfig.fontMessageBoxSize);
SetupStore("fontMessageBoxLargeSize", tvguideConfig.fontMessageBoxLargeSize);
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta);
SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta);
SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta);
SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta);
SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta);
SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta);
SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta);
SetupStore("FontGridDelta", tvguideConfig.FontGridDelta);
SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta);
SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta);
SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta);
SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta);
SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta);
SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta);
SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta);
SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta);
}
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 30) {
@ -111,19 +122,25 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) {
//------------------------------------------------------------------------------------------------------------------
cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
themes.Load(*cString("tvguide"));
timeFormatItems[0] = "12h";
timeFormatItems[1] = "24h";
blendingMethods[0] = "none";
blendingMethods[1] = "classic";
blendingMethods[2] = "nOpacity style";
Set();
}
void cMenuSetupGeneral::Set(void) {
int currentItem = Current();
Clear();
if (themes.NumThemes())
Add(new cMenuEditStraItem(tr("Theme"), &tmpTvguideConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
Add(new cMenuEditStraItem(tr("Use color gradients"), &tmpTvguideConfig->useBlending, 3, blendingMethods));
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
Add(new cMenuEditIntItem(tr("Number of Channels / Columns"), &tmpTvguideConfig->channelCols, 3, 8));
Add(new cMenuEditIntItem(tr("Channels to Jump (Keys Green / Yellow)"), &tmpTvguideConfig->jumpChannels, 2, 30));
Add(new cMenuEditIntItem(tr("Time to display vertically in minutes"), &tmpTvguideConfig->displayTime, 120, 320));
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 120, 320));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpTvguideConfig->hugeStepHours, 13, 48));
Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpTvguideConfig->timeFormat, 2, timeFormatItems));
@ -135,14 +152,12 @@ void cMenuSetupGeneral::Set(void) {
//------------------------------------------------------------------------------------------------------------------
cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
themes.Load(*cString("tvguide"));
displayModeItems[0] = "vertical";
displayModeItems[1] = "horizontal";
hideChannelLogosItems[0] = trVDR("yes");
hideChannelLogosItems[1] = trVDR("no");
logoExtensionItems[0] = "png";
logoExtensionItems[1] = "jpg";
blendingMethods[0] = "none";
blendingMethods[1] = "classic";
blendingMethods[2] = "nOpacity style";
Set();
}
@ -150,26 +165,33 @@ void cMenuSetupScreenLayout::Set(void) {
const char *indent = " ";
int currentItem = Current();
Clear();
if (themes.NumThemes())
Add(new cMenuEditStraItem(tr("Theme"), &tmpTvguideConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
Add(new cMenuEditStraItem(tr("Display Mode"), &tmpTvguideConfig->displayMode, 2, displayModeItems));
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Height of Channel Header (Perc. of osd height)")), &tmpTvguideConfig->channelHeaderHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Width of Timeline (Perc. of osd width)")), &tmpTvguideConfig->timeLineWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelCols, 3, 12));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Width of Channel Header (Perc. of osd width)")), &tmpTvguideConfig->channelHeaderWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Height of Timeline (Perc. of osd height)")), &tmpTvguideConfig->timeLineHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelRows, 3, 12));
}
Add(new cMenuEditIntItem(tr("Height of Footer"), &tmpTvguideConfig->footerHeight, 50, 300));
Add(new cMenuEditBoolItem(tr("Display status header"), &tmpTvguideConfig->displayStatusHeader));
if (tmpTvguideConfig->displayStatusHeader) {
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", indent, tr("Scale video to upper right corner")), &tmpTvguideConfig->scaleVideo));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Height of status header (Perc. of osd height)")), &tmpTvguideConfig->statusHeaderPercent, 5, 50));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", indent, tr("Scale video to upper right corner")), &tmpTvguideConfig->scaleVideo));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", indent, tr("Rounded corners around video frame")), &tmpTvguideConfig->decorateVideo));
}
Add(new cMenuEditStraItem(tr("Use color gradients"), &tmpTvguideConfig->useBlending, 3, blendingMethods));
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
Add(new cMenuEditIntItem(tr("Width of Timeline"), &tmpTvguideConfig->timeColWidth, 50, 300));
Add(new cMenuEditIntItem(tr("Height of Header"), &tmpTvguideConfig->headerHeight, 50, 300));
Add(new cMenuEditIntItem(tr("Height of Footer"), &tmpTvguideConfig->footerHeight, 50, 300));
Add(new cMenuEditBoolItem(tr("Display Channel Names in Header"), &tmpTvguideConfig->displayChannelName));
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath));
Add(new cMenuEditStraItem(*cString::sprintf("%s%s", indent, tr("Logo Extension")), &tmpTvguideConfig->logoExtension, 2, logoExtensionItems));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Logo width")), &tmpTvguideConfig->logoWidth, 0, 350));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Logo height")), &tmpTvguideConfig->logoHeight, 0, 250));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Logo width ratio")), &tmpTvguideConfig->logoWidthRatio, 1, 1000));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", indent, tr("Logo height ratio")), &tmpTvguideConfig->logoHeightRatio, 1, 1000));
}
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpTvguideConfig->hideEpgImages, 2, hideChannelLogosItems));
@ -206,19 +228,31 @@ void cMenuSetupFont::Set(void) {
Clear();
Add(new cMenuEditStraItem(tr("Font"), &tmpTvguideConfig->fontIndex, fontNames.Size(), &fontNames[0]));
Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->fontStatusHeaderLargeSize, 10, 70));
Add(new cMenuEditIntItem(tr("Status Header Font Size"), &tmpTvguideConfig->fontStatusHeaderSize, 10, 70));
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->fontHeaderSize, 10, 70));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->fontGridSize, 10, 70));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->fontGridSmallSize, 10, 70));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->fontTimeLineWeekdaySize, 10, 70));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->fontTimeLineDateSize, 10, 70));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->fontTimeLineTimeSize, 10, 70));
Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->fontButtonSize, 10, 70));
Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->fontDetailViewSize, 10, 70));
Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpTvguideConfig->fontDetailHeaderSize, 10, 70));
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->fontMessageBoxSize, 10, 70));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->fontMessageBoxLargeSize, 10, 70));
Add(new cMenuEditIntItem(tr("Status Header Font Size"), &tmpTvguideConfig->FontStatusHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->FontStatusHeaderLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->FontDetailViewDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpTvguideConfig->FontDetailHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->FontMessageBoxDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->FontMessageBoxLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->FontButtonDelta, -30, 30));
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->FontTimeLineWeekdayDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeDelta, -30, 30));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridHorizontalSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeHorizontalDelta, -30, 30));
}
SetCurrent(Get(currentItem));
Display();

View File

@ -26,6 +26,8 @@ class cMenuSetupSubMenu : public cOsdMenu {
class cMenuSetupGeneral : public cMenuSetupSubMenu {
protected:
cThemes themes;
const char * blendingMethods[3];
const char * timeFormatItems[2];
void Set(void);
public:
@ -35,10 +37,9 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
class cMenuSetupScreenLayout : public cMenuSetupSubMenu {
protected:
virtual eOSState ProcessKey(eKeys Key);
cThemes themes;
const char * displayModeItems[2];
const char * hideChannelLogosItems[2];
const char * logoExtensionItems[2];
const char * blendingMethods[3];
void Set(void);
public:
cMenuSetupScreenLayout(cTvguideConfig *data);

View File

@ -10,14 +10,27 @@ cStatusHeader::cStatusHeader(void) {
} else {
width = tvguideConfig.osdWidth;
}
int tvFrameWidth = tvguideConfig.osdWidth - width;
int radius = tvguideConfig.statusHeaderHeight / 8;
pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height));
pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height));
pixmapText->Fill(clrTransparent);
pixmapTVFrame = osdManager.requestPixmap(1, cRect(width, 0, tvFrameWidth, height));
pixmapTVFrame->Fill(clrTransparent);
if (tvguideConfig.decorateVideo) {
pixmapTVFrame->DrawEllipse(cRect(0,0,radius,radius), theme.Color(clrBackground), -2);
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius, 0, radius, radius), theme.Color(clrBackground), -1);
pixmapTVFrame->DrawEllipse(cRect(0, height - radius, radius, radius), theme.Color(clrBackground), -3);
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius, height - radius, radius, radius), theme.Color(clrBackground), -4);
}
drawBackground();
drawBorder();
}
cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame);
if (tvguideConfig.scaleVideo) {
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null);
cDevice::PrimaryDevice()->ScaleVideo(vidWin);

View File

@ -6,6 +6,7 @@
class cStatusHeader : public cStyledPixmap {
private:
cPixmap *pixmapText;
cPixmap *pixmapTVFrame;
public:
cStatusHeader(void);
virtual ~cStatusHeader(void);

View File

@ -0,0 +1,28 @@
Description = nOpacity Dark Red
clrBackground = FF000000
clrBackgroundOSD = FF000000
clrGrid1 = EE555555
clrGrid1Blending = 90000000
clrGrid2 = DD333333
clrGrid2Blending = 90000000
clrHighlight = DDBB0000
clrHighlightBlending = DD000000
clrFont = FFFFFFFF
clrFontHeader = FFFFFFFF
clrFontButtons = FFFFFFFF
clrHeader = EE888888
clrHeaderBlending = 90000000
clrBorder = AABB0000
clrTimeline1 = BBFFFFFF
clrTimeline1Blending = 90828282
clrTimeline2 = BB000000
clrTimeline2Blending = 903F3F3F
clrButtonRed = 99BB0000
clrButtonRedBorder = FFBB0000
clrButtonGreen = 9900BB00
clrButtonGreenBorder = FF00BB00
clrButtonYellow = 99BBBB00
clrButtonYellowBorder = FFBBBB00
clrButtonBlue = 990000BB
clrButtonBlueBorder = FF0000BB
clrButtonBlend = DD000000

View File

@ -2,45 +2,65 @@
cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime;
if (tvguideConfig.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
tvguideConfig.statusHeaderHeight,
tvguideConfig.timeColWidth,
tvguideConfig.headerHeight)
, cRect::Null));
tvguideConfig.timeLineWidth,
tvguideConfig.channelHeaderHeight)));
timeline = osdManager.requestPixmap(2, cRect(0,
tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight,
tvguideConfig.timeColWidth,
tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.headerHeight - tvguideConfig.footerHeight)
tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight,
tvguideConfig.timeLineWidth,
tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)
, cRect(0,
0,
tvguideConfig.timeColWidth,
1440*tvguideConfig.minuteHeight));
tvguideConfig.timeLineWidth,
1440*tvguideConfig.minutePixel));
} else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
tvguideConfig.statusHeaderHeight,
tvguideConfig.channelHeaderWidth,
tvguideConfig.timeLineHeight)));
timeline = osdManager.requestPixmap(2, cRect(tvguideConfig.channelHeaderWidth,
tvguideConfig.statusHeaderHeight,
tvguideConfig.osdWidth - tvguideConfig.channelHeaderWidth,
tvguideConfig.timeLineHeight)
, cRect(0,
0,
1440*tvguideConfig.minutePixel,
tvguideConfig.timeLineWidth));
}
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
tvguideConfig.osdHeight- tvguideConfig.footerHeight,
tvguideConfig.timeColWidth,
tvguideConfig.footerHeight-9)
, cRect::Null));
tvguideConfig.timeLineWidth,
tvguideConfig.footerHeight-9)));
}
cTimeLine::~cTimeLine(void) {
delete dateViewer;
osdManager.releasePixmap(timeline);
if (clock)
delete clock;
}
void cTimeLine::drawDateViewer() {
cString weekDay = myTime->GetWeekday();
cString date = myTime->GetDate();
int textHeight = tvguideConfig.FontTimeLineWeekday->Height();
int weekdayWidth = tvguideConfig.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = tvguideConfig.FontTimeLineDate->Width(*date);
dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground();
dateViewer->drawBorder();
dateViewer->DrawText(cPoint((tvguideConfig.timeColWidth-weekdayWidth)/2, (tvguideConfig.headerHeight-2*textHeight)/2), *weekDay, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((tvguideConfig.timeColWidth-dateWidth)/2, (tvguideConfig.headerHeight-2*textHeight)/2 + textHeight + 5), *date, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineDate);
if (tvguideConfig.displayMode == eVertical) {
int textHeight = tvguideConfig.FontTimeLineWeekday->Height();
int weekdayWidth = tvguideConfig.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = tvguideConfig.FontTimeLineDate->Width(*date);
dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-weekdayWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2), *weekDay, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-dateWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2 + textHeight + 5), *date, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineDate);
} else if (tvguideConfig.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date);
int x = (dateViewer->Width() - tvguideConfig.FontTimeLineDateHorizontal->Width(*strDate))/2;
int y = (dateViewer->Height() - tvguideConfig.FontTimeLineDateHorizontal->Height())/2;
dateViewer->DrawText(cPoint(x, y), *strDate, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineDateHorizontal);
}
}
void cTimeLine::drawTimeline() {
@ -48,11 +68,19 @@ void cTimeLine::drawTimeline() {
timeline->Fill(theme.Color(clrBackground));
tColor colorFont;
const cImage *img1 = createBackgroundImage(tvguideConfig.timeColWidth-4, tvguideConfig.minuteHeight*30, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending));
const cImage *img2 = createBackgroundImage(tvguideConfig.timeColWidth-4, tvguideConfig.minuteHeight*30, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending));
int imgWidth, imgHeight;
if (tvguideConfig.displayMode == eVertical) {
imgWidth = tvguideConfig.timeLineWidth-4;
imgHeight = tvguideConfig.minutePixel*30;
} else if (tvguideConfig.displayMode == eHorizontal) {
imgWidth = tvguideConfig.minutePixel*30;
imgHeight = tvguideConfig.timeLineHeight-4;
}
const cImage *img1 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending));
const cImage *img2 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending));
const cImage *img = NULL;
int textWidth, posY;
int textWidth, posX, posY;
char timetext[10];
for (int i=0; i<48; i++) {
@ -83,10 +111,16 @@ void cTimeLine::drawTimeline() {
sprintf(timetext, "%d:30", i/2);
}
}
posY = i*tvguideConfig.minuteHeight*30;
if (tvguideConfig.displayMode == eVertical) {
posY = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(2, posY), *img);
textWidth = tvguideConfig.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((tvguideConfig.timeColWidth-textWidth)/2, posY + 5), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTime);
timeline->DrawText(cPoint((tvguideConfig.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTime);
} else if (tvguideConfig.displayMode == eHorizontal) {
posX = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(posX, 2), *img);
timeline->DrawText(cPoint(posX + 2, (dateViewer->Height() - tvguideConfig.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTimeHorizontal);
}
}
setTimeline();
delete img1;
@ -124,7 +158,15 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t
void cTimeLine::setTimeline() {
int offset = myTime->GetTimelineOffset();
timeline->SetDrawPortPoint(cPoint(0, -offset*tvguideConfig.minuteHeight));
int xNew, yNew;
if (tvguideConfig.displayMode == eVertical) {
xNew = 0;
yNew = -offset*tvguideConfig.minutePixel;
} else if (tvguideConfig.displayMode == eHorizontal) {
xNew = -offset*tvguideConfig.minutePixel;
yNew = 0;
}
timeline->SetDrawPortPoint(cPoint(xNew, yNew));
}
void cTimeLine::drawClock() {
@ -134,5 +176,5 @@ void cTimeLine::drawClock() {
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
clock->drawBackground();
clock->drawBorder();
clock->DrawText(cPoint((tvguideConfig.timeColWidth-clockWidth)/2, (tvguideConfig.footerHeight-textHeight)/2), *currentTime, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineTime);
clock->DrawText(cPoint((tvguideConfig.timeLineWidth-clockWidth)/2, (tvguideConfig.footerHeight-textHeight)/2), *currentTime, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineTime);
}

12
timer.c
View File

@ -15,7 +15,11 @@ void cMyTime::Now() {
t = time(0);
tStart = t;
tStart = GetRounded();
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.headerHeight - tvguideConfig.footerHeight)/tvguideConfig.minuteHeight*60;
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)/tvguideConfig.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
tEnd = tStart + (tvguideConfig.osdWidth - tvguideConfig.channelHeaderWidth)/tvguideConfig.minutePixel*60;
}
}
void cMyTime::AddStep(int step) {
@ -34,7 +38,11 @@ bool cMyTime::DelStep(int step) {
void cMyTime::SetTime(time_t newTime) {
tStart = newTime;
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.headerHeight - tvguideConfig.footerHeight)/tvguideConfig.minuteHeight*60;
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)/tvguideConfig.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
tEnd = tStart + (tvguideConfig.osdWidth - tvguideConfig.channelHeaderWidth)/tvguideConfig.minutePixel*60;
}
}
time_t cMyTime::getPrevPrimetime(time_t current) {

View File

@ -14,13 +14,13 @@
#include "tvguideosd.c"
#if defined(APIVERSNUM) && APIVERSNUM < 10717
#error "VDR-1.7.17 API version or greater is required!"
#if defined(APIVERSNUM) && APIVERSNUM < 20000
#error "VDR-2.0.0 API version or greater is required!"
#endif
static const char *VERSION = "0.0.3";
static const char *VERSION = "0.0.4";
static const char *DESCRIPTION = "A fancy 2d EPG Viewer";
static const char *MAINMENUENTRY = "Tvguide";

View File

@ -129,7 +129,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
delete column;
}
}
if (i == tvguideConfig.channelCols)
if (i == tvguideConfig.numGrids)
break;
}
}
@ -187,91 +187,46 @@ void cTvGuideOsd::setNextActiveGrid(cGrid *next) {
}
}
void cTvGuideOsd::processKeyUp() {
if (!activeGrid) {
return;
}
if (detailViewActive) {
detailView->scrollUp();
void cTvGuideOsd::channelForward() {
cChannelColumn *colRight = columns.Next(activeGrid->column);
if (!colRight) {
const cChannel *channelRight = activeGrid->column->getChannel();
while (channelRight = Channels.Next(channelRight)) {
if (!channelRight->GroupSep()) {
colRight = new cChannelColumn(tvguideConfig.numGrids - 1, channelRight, myTime);
if (colRight->readGrids()) {
break;
} else {
bool actionDone = false;
if ( (activeGrid->StartTime() - myTime->GetStart())/60 < 30 ) {
ScrollBack();
actionDone = true;
}
cGrid *prev = activeGrid->column->getPrev(activeGrid);
if (prev) {
if ( (prev->StartTime() > myTime->GetStart())
|| ( (prev->EndTime() - myTime->GetStart())/60 > 30 )
|| ( prev->isFirst()) ) {
setNextActiveGrid(prev);
actionDone = true;
delete colRight;
colRight = NULL;
}
}
if (!actionDone) {
ScrollBack();
}
if (colRight) {
if (columns.Count() == tvguideConfig.numGrids) {
cChannelColumn *cFirst = columns.First();
columns.Del(cFirst);
}
osdManager.flush();
}
void cTvGuideOsd::ScrollBack() {
bool tooFarInPast = myTime->DelStep(tvguideConfig.stepMinutes);
if (tooFarInPast)
return;
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtStart();
column->ClearOutdatedEnd();
column->SetNum(column->GetNum() - 1);
column->drawHeader();
column->drawGrids();
}
}
void cTvGuideOsd::processKeyDown() {
if (!activeGrid) {
return;
}
if (detailViewActive) {
detailView->scrollDown();
} else {
bool actionDone = false;
if ( (myTime->GetEnd() - activeGrid->EndTime())/60 < 30 ) {
ScrollForward();
actionDone = true;
}
cGrid *next = activeGrid->column->getNext(activeGrid);
if (next) {
if ( (next->EndTime() < myTime->GetEnd())
|| ( (myTime->GetEnd() - next->StartTime())/60 > 30 ) ) {
setNextActiveGrid(next);
actionDone = true;
columns.Add(colRight);
colRight->createHeader();
colRight->drawGrids();
}
}
if (!actionDone) {
ScrollForward();
if (colRight) {
cGrid *right = colRight->getNeighbor(activeGrid);
if (right) {
setNextActiveGrid(right);
}
}
osdManager.flush();
}
void cTvGuideOsd::ScrollForward() {
myTime->AddStep(tvguideConfig.stepMinutes);
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtEnd();
column->ClearOutdatedStart();
column->drawGrids();
}
}
void cTvGuideOsd::processKeyLeft() {
if (detailViewActive)
return;
if (activeGrid == NULL)
return;
void cTvGuideOsd::channelBack() {
cChannelColumn *colLeft = columns.Prev(activeGrid->column);
if (!colLeft) {
const cChannel *channelLeft = activeGrid->column->getChannel();
@ -287,7 +242,7 @@ void cTvGuideOsd::processKeyLeft() {
}
}
if (colLeft) {
if (columns.Count() == tvguideConfig.channelCols) {
if (columns.Count() == tvguideConfig.numGrids) {
cChannelColumn *cLast = columns.Last();
columns.Del(cLast);
}
@ -311,47 +266,127 @@ void cTvGuideOsd::processKeyLeft() {
osdManager.flush();
}
void cTvGuideOsd::timeForward() {
bool actionDone = false;
if ( (myTime->GetEnd() - activeGrid->EndTime())/60 < 30 ) {
ScrollForward();
actionDone = true;
}
cGrid *next = activeGrid->column->getNext(activeGrid);
if (next) {
if ( (next->EndTime() < myTime->GetEnd())
|| ( (myTime->GetEnd() - next->StartTime())/60 > 30 ) ) {
setNextActiveGrid(next);
actionDone = true;
}
}
if (!actionDone) {
ScrollForward();
}
osdManager.flush();
}
void cTvGuideOsd::ScrollForward() {
myTime->AddStep(tvguideConfig.stepMinutes);
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtEnd();
column->ClearOutdatedStart();
column->drawGrids();
}
}
void cTvGuideOsd::timeBack() {
bool actionDone = false;
if ( (activeGrid->StartTime() - myTime->GetStart())/60 < 30 ) {
ScrollBack();
actionDone = true;
}
cGrid *prev = activeGrid->column->getPrev(activeGrid);
if (prev) {
if ( (prev->StartTime() > myTime->GetStart())
|| ( (prev->EndTime() - myTime->GetStart())/60 > 30 )
|| ( prev->isFirst()) ) {
setNextActiveGrid(prev);
actionDone = true;
}
}
if (!actionDone) {
ScrollBack();
}
osdManager.flush();
}
void cTvGuideOsd::ScrollBack() {
bool tooFarInPast = myTime->DelStep(tvguideConfig.stepMinutes);
if (tooFarInPast)
return;
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtStart();
column->ClearOutdatedEnd();
column->drawGrids();
}
}
void cTvGuideOsd::processKeyUp() {
if (!activeGrid) {
return;
}
if (detailViewActive) {
detailView->scrollUp();
osdManager.flush();
} else {
if (tvguideConfig.displayMode == eVertical) {
timeBack();
} else if (tvguideConfig.displayMode == eHorizontal) {
channelBack();
}
}
}
void cTvGuideOsd::processKeyDown() {
if (!activeGrid) {
return;
}
if (detailViewActive) {
detailView->scrollDown();
osdManager.flush();
} else {
if (tvguideConfig.displayMode == eVertical) {
timeForward();
} else if (tvguideConfig.displayMode == eHorizontal) {
channelForward();
}
}
}
void cTvGuideOsd::processKeyLeft() {
if (detailViewActive)
return;
if (activeGrid == NULL)
return;
if (tvguideConfig.displayMode == eVertical) {
channelBack();
} else if (tvguideConfig.displayMode == eHorizontal) {
timeBack();
}
}
void cTvGuideOsd::processKeyRight() {
if (detailViewActive)
return;
if (activeGrid == NULL)
return;
cChannelColumn *colRight = columns.Next(activeGrid->column);
if (!colRight) {
const cChannel *channelRight = activeGrid->column->getChannel();
while (channelRight = Channels.Next(channelRight)) {
if (!channelRight->GroupSep()) {
colRight = new cChannelColumn(tvguideConfig.channelCols - 1, channelRight, myTime);
if (colRight->readGrids()) {
break;
} else {
delete colRight;
colRight = NULL;
if (tvguideConfig.displayMode == eVertical) {
channelForward();
} else if (tvguideConfig.displayMode == eHorizontal) {
timeForward();
}
}
}
if (colRight) {
if (columns.Count() == tvguideConfig.channelCols) {
cChannelColumn *cFirst = columns.First();
columns.Del(cFirst);
}
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->SetNum(column->GetNum() - 1);
column->drawHeader();
column->drawGrids();
}
columns.Add(colRight);
colRight->createHeader();
colRight->drawGrids();
}
}
if (colRight) {
cGrid *right = colRight->getNeighbor(activeGrid);
if (right) {
setNextActiveGrid(right);
}
}
osdManager.flush();
}
void cTvGuideOsd::processKeyOk() {
@ -370,7 +405,7 @@ void cTvGuideOsd::processKeyOk() {
}
void cTvGuideOsd::processKeyRed() {
if (activeGrid == NULL)
if ((activeGrid == NULL) || activeGrid->isDummy())
return;
cTimer *timer = new cTimer(activeGrid->GetEvent());
cTimer *t = Timers.GetTimer(timer);

View File

@ -33,6 +33,10 @@ private:
void processKey7();
void processKey9();
void setNextActiveGrid(cGrid *next);
void channelForward();
void channelBack();
void timeForward();
void timeBack();
void ScrollForward();
void ScrollBack();
void dump();