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 - Changed channelheader to display transparent logos properly
- Added "style nOpacity" for backgrounds and theme nOpacity - 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 - Added dummy grids if no EPG information is available for a certain
time time
@ -19,3 +19,8 @@ Version 0.0.3
- Completely rewrote code for scrolling forward and backward in time - Completely rewrote code for scrolling forward and backward in time
- Added status header with epg information of currently selected - Added status header with epg information of currently selected
schedule and scaled video picture 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() { 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() { cGrid * cChannelColumn::getActive() {

View File

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

240
config.c
View File

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

View File

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

View File

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

View File

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

View File

@ -24,50 +24,82 @@ void cEpgGrid::SetViewportHeight() {
} else { } else {
viewportHeight = Duration() / 60; viewportHeight = Duration() / 60;
} }
viewportHeight *= tvguideConfig.minuteHeight; viewportHeight *= tvguideConfig.minutePixel;
if (viewportHeight != viewportHeightOld) if (viewportHeight != viewportHeightOld)
dirty = true; dirty = true;
} }
void cEpgGrid::PositionPixmap() { void cEpgGrid::PositionPixmap() {
int x0 = column->getX(); int x0, y0;
int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight; if (tvguideConfig.displayMode == eVertical) {
if ( column->Start() < StartTime() ) { int x0 = column->getX();
y0 += (StartTime() - column->Start())/60*tvguideConfig.minuteHeight; int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight;
} if ( column->Start() < StartTime() ) {
if (!pixmap) { y0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel;
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight), }
cRect(0, 0, tvguideConfig.colWidth, Duration()/60*tvguideConfig.minuteHeight)); if (!pixmap) {
} else { pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight),
pixmap->SetViewPort(cRect(x0, y0, tvguideConfig.colWidth, viewportHeight)); 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() { void cEpgGrid::setText() {
cString strText; if (tvguideConfig.displayMode == eVertical) {
strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title()); cString strText;
text->Set(*(strText), tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth); strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title());
extText->Set(event->ShortText(), tvguideConfig.FontGridSmall, tvguideConfig.colWidth-2*borderWidth); 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() { void cEpgGrid::drawText() {
if (Height()/tvguideConfig.minuteHeight < 6) if (tvguideConfig.displayMode == eVertical) {
return; if (Height()/tvguideConfig.minutePixel < 6)
int textHeight = tvguideConfig.FontGrid->Height(); return;
int textLines = text->Lines(); int textHeight = tvguideConfig.FontGrid->Height();
for (int i=0; i<textLines; i++) { int textLines = text->Lines();
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGrid); for (int i=0; i<textLines; i++) {
} pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGrid);
int extTextLines = extText->Lines(); }
int offset = (textLines+1)*textHeight - 0.5*textHeight; int extTextLines = extText->Lines();
textHeight = tvguideConfig.FontGridSmall->Height(); int offset = (textLines+1)*textHeight - 0.5*textHeight;
if ((Height()-textHeight-10) > offset) { textHeight = tvguideConfig.FontGridSmall->Height();
for (int i=0; i<extTextLines; i++) { if ((Height()-textHeight-10) > offset) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridSmall); for (int i=0; i<extTextLines; i++) {
} pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridSmall);
} }
if (hasTimer) }
drawRecIcon(); 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() { void cEpgGrid::drawRecIcon() {

View File

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

View File

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

View File

@ -12,20 +12,21 @@ cHeaderGrid::~cHeaderGrid(void) {
void cHeaderGrid::createBackground(int num) { void cHeaderGrid::createBackground(int num) {
color = theme.Color(clrHeader); color = theme.Color(clrHeader);
colorBlending = theme.Color(clrHeaderBlending); colorBlending = theme.Color(clrHeaderBlending);
pixmap = osdManager.requestPixmap(2, cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth, int x, y, width, height;
tvguideConfig.statusHeaderHeight, if (tvguideConfig.displayMode == eVertical) {
tvguideConfig.colWidth, x = tvguideConfig.timeLineWidth + num*tvguideConfig.colWidth;
tvguideConfig.headerHeight) y = tvguideConfig.statusHeaderHeight;
, cRect::Null); width = tvguideConfig.colWidth;
if (!pixmap) { height = tvguideConfig.channelHeaderHeight;
return; } else if (tvguideConfig.displayMode == eHorizontal) {
} x = 0;
pixmapLogo = osdManager.requestPixmap(3, cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth, y = tvguideConfig.statusHeaderHeight + tvguideConfig.timeLineHeight + num*tvguideConfig.rowHeight;
tvguideConfig.statusHeaderHeight, width = tvguideConfig.channelHeaderWidth;
tvguideConfig.colWidth, height = tvguideConfig.rowHeight;
tvguideConfig.headerHeight) }
, cRect::Null); pixmap = osdManager.requestPixmap(2, cRect(x, y, width, height));
if (!pixmapLogo) { pixmapLogo = osdManager.requestPixmap(3, cRect(x, y, width, height));
if ((!pixmap) || (!pixmapLogo)){
return; return;
} }
pixmapLogo->Fill(clrTransparent); pixmapLogo->Fill(clrTransparent);
@ -33,38 +34,93 @@ void cHeaderGrid::createBackground(int num) {
} }
void cHeaderGrid::drawChannel(const cChannel *channel) { void cHeaderGrid::drawChannel(const cChannel *channel) {
cTextWrapper tw; if (tvguideConfig.displayMode == eVertical) {
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name()); drawChannelVertical(channel);
tw.Set(*headerText, tvguideConfig.FontHeader, tvguideConfig.colWidth - 8); } else if (tvguideConfig.displayMode == eHorizontal) {
int lines = tw.Lines(); drawChannelHorizontal(channel);
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);
}
drawBorder(); drawBorder();
} }
void cHeaderGrid::setPosition(int num) { void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
pixmap->SetViewPort(cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth, int logoWidth = Height() * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
tvguideConfig.statusHeaderHeight, int logoX = tvguideConfig.displayChannelName?2:(Width()-logoWidth)/2;
tvguideConfig.colWidth, int textX = 5;
tvguideConfig.headerHeight)); int textY = (Height() - tvguideConfig.FontChannelHeaderHorizontal->Height())/2;
pixmapLogo->SetViewPort(cRect( tvguideConfig.timeColWidth + num*tvguideConfig.colWidth, bool logoFound = false;
tvguideConfig.statusHeaderHeight, if (!tvguideConfig.hideChannelLogos) {
tvguideConfig.colWidth, cImageLoader imgLoader;
tvguideConfig.headerHeight)); 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 { class cHeaderGrid : public cGrid {
private: private:
cPixmap *pixmapLogo; cPixmap *pixmapLogo;
void drawChannelHorizontal(const cChannel *channel);
void drawChannelVertical(const cChannel *channel);
public: public:
cHeaderGrid(void); cHeaderGrid(void);
virtual ~cHeaderGrid(void); virtual ~cHeaderGrid(void);

View File

@ -13,7 +13,8 @@ cImageLoader::cImageLoader() {
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)) if ((width == 0)||(height==0))
return false; return false;
std::string logoLower = logo; 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)) if (!LoadImage(logoLower.c_str(), tvguideConfig.logoPath, extension))
return false; return false;
if (height != 0 || width != 0) { buffer.sample( Geometry(width, height));
buffer.sample( Geometry(width, height));
}
return true; return true;
} }
@ -46,7 +45,7 @@ bool cImageLoader::LoadEPGImage(int eventID) {
} }
bool cImageLoader::DrawBackground(tColor back, tColor blend, int width, int height) { bool cImageLoader::DrawBackground(tColor back, tColor blend, int width, int height) {
if ((width == 0) || (height == 0)) if ((width < 1) || (height < 1))
return false; return false;
Color Back = Argb2Color(back); Color Back = Argb2Color(back);
Color Blend = Argb2Color(blend); Color Blend = Argb2Color(blend);

View File

@ -37,7 +37,8 @@ bool cOsdManager::setOsd() {
void cOsdManager::setBackground() { void cOsdManager::setBackground() {
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) { 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)); osd->DrawRectangle(0, tvguideConfig.statusHeaderHeight, cOsd::OsdWidth(), cOsd::OsdHeight() - tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD));
} }
else else

View File

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

138
setup.c
View File

@ -46,42 +46,53 @@ void cTvguideSetup::Store(void) {
tvguideConfig = tmpTvguideConfig; tvguideConfig = tmpTvguideConfig;
SetupStore("themeIndex", tvguideConfig.themeIndex); SetupStore("themeIndex", tvguideConfig.themeIndex);
SetupStore("displayMode", tvguideConfig.displayMode);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader); SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader);
SetupStore("statusHeaderPercent", tvguideConfig.statusHeaderPercent); SetupStore("statusHeaderPercent", tvguideConfig.statusHeaderPercent);
SetupStore("scaleVideo", tvguideConfig.scaleVideo); SetupStore("scaleVideo", tvguideConfig.scaleVideo);
SetupStore("decorateVideo", tvguideConfig.decorateVideo);
SetupStore("useBlending", tvguideConfig.useBlending); SetupStore("useBlending", tvguideConfig.useBlending);
SetupStore("roundedCorners", tvguideConfig.roundedCorners); SetupStore("roundedCorners", tvguideConfig.roundedCorners);
SetupStore("timeFormat", tvguideConfig.timeFormat); SetupStore("timeFormat", tvguideConfig.timeFormat);
SetupStore("channelCols", tvguideConfig.channelCols); SetupStore("channelCols", tvguideConfig.channelCols);
SetupStore("channelRows", tvguideConfig.channelRows);
SetupStore("displayTime", tvguideConfig.displayTime); SetupStore("displayTime", tvguideConfig.displayTime);
SetupStore("bigStepHours", tvguideConfig.bigStepHours); SetupStore("bigStepHours", tvguideConfig.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours); SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
SetupStore("jumpChannels", tvguideConfig.jumpChannels); SetupStore("jumpChannels", tvguideConfig.jumpChannels);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos); SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension); SetupStore("logoExtension", tvguideConfig.logoExtension);
SetupStore("logoWidth", tvguideConfig.logoWidth); SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio);
SetupStore("logoHeight", tvguideConfig.logoHeight); SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages); SetupStore("hideEpgImages", tvguideConfig.hideEpgImages);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth); SetupStore("epgImageWidth", tvguideConfig.epgImageWidth);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight); SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight); SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("timeColWidth", tvguideConfig.timeColWidth); SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent);
SetupStore("headerHeight", tvguideConfig.headerHeight); SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent);
SetupStore("displayChannelName", tvguideConfig.displayChannelName);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent);
SetupStore("footerHeight", tvguideConfig.footerHeight); SetupStore("footerHeight", tvguideConfig.footerHeight);
SetupStore("fontIndex", tvguideConfig.fontIndex); SetupStore("fontIndex", tvguideConfig.fontIndex);
SetupStore("fontHeaderSize", tvguideConfig.fontHeaderSize); SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
SetupStore("fontStatusHeaderSize", tvguideConfig.fontStatusHeaderSize); SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta);
SetupStore("fontStatusHeaderLargeSize", tvguideConfig.fontStatusHeaderLargeSize); SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta);
SetupStore("fontGridSize", tvguideConfig.fontGridSize); SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta);
SetupStore("fontGridSmallSize", tvguideConfig.fontGridSmallSize); SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta);
SetupStore("fontTimeLineWeekdaySize", tvguideConfig.fontTimeLineWeekdaySize); SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta);
SetupStore("fontTimeLineDateSize", tvguideConfig.fontTimeLineDateSize); SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta);
SetupStore("fontTimeLineTimeSize", tvguideConfig.fontTimeLineTimeSize); SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta);
SetupStore("fontButtonSize", tvguideConfig.fontButtonSize); SetupStore("FontGridDelta", tvguideConfig.FontGridDelta);
SetupStore("fontDetailViewSize", tvguideConfig.fontDetailViewSize); SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta);
SetupStore("fontDetailHeaderSize", tvguideConfig.fontDetailHeaderSize); SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta);
SetupStore("fontMessageBoxSize", tvguideConfig.fontMessageBoxSize); SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta);
SetupStore("fontMessageBoxLargeSize", tvguideConfig.fontMessageBoxLargeSize); 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) { 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) { cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
timeFormatItems[0] = "12h"; themes.Load(*cString("tvguide"));
timeFormatItems[0] = "12h";
timeFormatItems[1] = "24h"; timeFormatItems[1] = "24h";
blendingMethods[0] = "none";
blendingMethods[1] = "classic";
blendingMethods[2] = "nOpacity style";
Set(); Set();
} }
void cMenuSetupGeneral::Set(void) { void cMenuSetupGeneral::Set(void) {
int currentItem = Current(); int currentItem = Current();
Clear(); Clear();
if (themes.NumThemes())
Add(new cMenuEditIntItem(tr("Number of Channels / Columns"), &tmpTvguideConfig->channelCols, 3, 8)); 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("Channels to Jump (Keys Green / Yellow)"), &tmpTvguideConfig->jumpChannels, 2, 30)); 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("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 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)); 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) { cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
themes.Load(*cString("tvguide")); displayModeItems[0] = "vertical";
displayModeItems[1] = "horizontal";
hideChannelLogosItems[0] = trVDR("yes"); hideChannelLogosItems[0] = trVDR("yes");
hideChannelLogosItems[1] = trVDR("no"); hideChannelLogosItems[1] = trVDR("no");
logoExtensionItems[0] = "png"; logoExtensionItems[0] = "png";
logoExtensionItems[1] = "jpg"; logoExtensionItems[1] = "jpg";
blendingMethods[0] = "none";
blendingMethods[1] = "classic";
blendingMethods[2] = "nOpacity style";
Set(); Set();
} }
@ -150,26 +165,33 @@ void cMenuSetupScreenLayout::Set(void) {
const char *indent = " "; const char *indent = " ";
int currentItem = Current(); int currentItem = Current();
Clear(); 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)); Add(new cMenuEditBoolItem(tr("Display status header"), &tmpTvguideConfig->displayStatusHeader));
if (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 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)); Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideChannelLogos) { if (!tmpTvguideConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath)); 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 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 width ratio")), &tmpTvguideConfig->logoWidthRatio, 1, 1000));
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 height ratio")), &tmpTvguideConfig->logoHeightRatio, 1, 1000));
} }
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpTvguideConfig->hideEpgImages, 2, hideChannelLogosItems)); Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpTvguideConfig->hideEpgImages, 2, hideChannelLogosItems));
@ -204,22 +226,34 @@ cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fo
void cMenuSetupFont::Set(void) { void cMenuSetupFont::Set(void) {
int currentItem = Current(); int currentItem = Current();
Clear(); Clear();
Add(new cMenuEditStraItem(tr("Font"), &tmpTvguideConfig->fontIndex, fontNames.Size(), &fontNames[0])); 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("Status Header Font Size"), &tmpTvguideConfig->FontStatusHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->fontHeaderSize, 10, 70)); Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->FontStatusHeaderLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->fontGridSize, 10, 70)); Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->FontDetailViewDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->fontGridSmallSize, 10, 70)); Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpTvguideConfig->FontDetailHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->fontTimeLineWeekdaySize, 10, 70)); Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->FontMessageBoxDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->fontTimeLineDateSize, 10, 70)); Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->FontMessageBoxLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->fontTimeLineTimeSize, 10, 70)); Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->FontButtonDelta, -30, 30));
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)); if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->fontMessageBoxSize, 10, 70)); Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->fontMessageBoxLargeSize, 10, 70)); 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)); SetCurrent(Get(currentItem));
Display(); Display();
} }

View File

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

View File

@ -10,14 +10,27 @@ cStatusHeader::cStatusHeader(void) {
} else { } else {
width = tvguideConfig.osdWidth; width = tvguideConfig.osdWidth;
} }
int tvFrameWidth = tvguideConfig.osdWidth - width;
int radius = tvguideConfig.statusHeaderHeight / 8;
pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height)); pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height));
pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height)); pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height));
pixmapText->Fill(clrTransparent); 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(); drawBackground();
drawBorder(); drawBorder();
} }
cStatusHeader::~cStatusHeader(void) { cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame);
if (tvguideConfig.scaleVideo) { if (tvguideConfig.scaleVideo) {
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null);
cDevice::PrimaryDevice()->ScaleVideo(vidWin); cDevice::PrimaryDevice()->ScaleVideo(vidWin);
@ -71,4 +84,4 @@ void cStatusHeader::DrawInfoText(cGrid *grid) {
y += (heightText - tvguideConfig.FontStatusHeaderLarge->Height() - 2*border)/2; y += (heightText - tvguideConfig.FontStatusHeaderLarge->Height() - 2*border)/2;
pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeaderLarge); pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeaderLarge);
} }
} }

View File

@ -6,6 +6,7 @@
class cStatusHeader : public cStyledPixmap { class cStatusHeader : public cStyledPixmap {
private: private:
cPixmap *pixmapText; cPixmap *pixmapText;
cPixmap *pixmapTVFrame;
public: public:
cStatusHeader(void); cStatusHeader(void);
virtual ~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,57 +2,85 @@
cTimeLine::cTimeLine(cMyTime *myTime) { cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime; this->myTime = myTime;
dateViewer = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0, if (tvguideConfig.displayMode == eVertical) {
tvguideConfig.statusHeaderHeight, dateViewer = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
tvguideConfig.timeColWidth, tvguideConfig.statusHeaderHeight,
tvguideConfig.headerHeight) tvguideConfig.timeLineWidth,
, cRect::Null)); tvguideConfig.channelHeaderHeight)));
timeline = osdManager.requestPixmap(2, cRect(0, timeline = osdManager.requestPixmap(2, cRect(0,
tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight, tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight,
tvguideConfig.timeColWidth, tvguideConfig.timeLineWidth,
tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.headerHeight - tvguideConfig.footerHeight) tvguideConfig.osdHeight - tvguideConfig.statusHeaderHeight - tvguideConfig.channelHeaderHeight - tvguideConfig.footerHeight)
, cRect(0, , cRect(0,
0, 0,
tvguideConfig.timeColWidth, tvguideConfig.timeLineWidth,
1440*tvguideConfig.minuteHeight)); 1440*tvguideConfig.minutePixel));
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0, } 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.osdHeight- tvguideConfig.footerHeight,
tvguideConfig.timeColWidth, tvguideConfig.timeLineWidth,
tvguideConfig.footerHeight-9) tvguideConfig.footerHeight-9)));
, cRect::Null));
} }
cTimeLine::~cTimeLine(void) { cTimeLine::~cTimeLine(void) {
delete dateViewer; delete dateViewer;
osdManager.releasePixmap(timeline); osdManager.releasePixmap(timeline);
delete clock; if (clock)
delete clock;
} }
void cTimeLine::drawDateViewer() { void cTimeLine::drawDateViewer() {
cString weekDay = myTime->GetWeekday(); cString weekDay = myTime->GetWeekday();
cString date = myTime->GetDate(); 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->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground(); dateViewer->drawBackground();
dateViewer->drawBorder(); 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() { void cTimeLine::drawTimeline() {
timeline->SetTile(true); timeline->SetTile(true);
timeline->Fill(theme.Color(clrBackground)); timeline->Fill(theme.Color(clrBackground));
tColor colorFont; tColor colorFont;
const cImage *img1 = createBackgroundImage(tvguideConfig.timeColWidth-4, tvguideConfig.minuteHeight*30, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending)); int imgWidth, imgHeight;
const cImage *img2 = createBackgroundImage(tvguideConfig.timeColWidth-4, tvguideConfig.minuteHeight*30, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending)); 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; const cImage *img = NULL;
int textWidth, posY; int textWidth, posX, posY;
char timetext[10]; char timetext[10];
for (int i=0; i<48; i++) { for (int i=0; i<48; i++) {
@ -83,10 +111,16 @@ void cTimeLine::drawTimeline() {
sprintf(timetext, "%d:30", i/2); sprintf(timetext, "%d:30", i/2);
} }
} }
posY = i*tvguideConfig.minuteHeight*30; if (tvguideConfig.displayMode == eVertical) {
timeline->DrawImage(cPoint(2, posY), *img); posY = i*tvguideConfig.minutePixel*30;
textWidth = tvguideConfig.FontTimeLineTime->Width(timetext); timeline->DrawImage(cPoint(2, posY), *img);
timeline->DrawText(cPoint((tvguideConfig.timeColWidth-textWidth)/2, posY + 5), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTime); textWidth = tvguideConfig.FontTimeLineTime->Width(timetext);
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(); setTimeline();
delete img1; delete img1;
@ -124,15 +158,23 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t
void cTimeLine::setTimeline() { void cTimeLine::setTimeline() {
int offset = myTime->GetTimelineOffset(); 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() { void cTimeLine::drawClock() {
cString currentTime = myTime->GetCurrentTime(); cString currentTime = myTime->GetCurrentTime();
int textHeight = tvguideConfig.FontTimeLineTime->Height(); int textHeight = tvguideConfig.FontTimeLineTime->Height();
int clockWidth = tvguideConfig.FontTimeLineTime->Width(*currentTime); int clockWidth = tvguideConfig.FontTimeLineTime->Width(*currentTime);
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
clock->drawBackground(); clock->drawBackground();
clock->drawBorder(); 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); t = time(0);
tStart = t; tStart = t;
tStart = GetRounded(); 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) { void cMyTime::AddStep(int step) {
@ -34,7 +38,11 @@ bool cMyTime::DelStep(int step) {
void cMyTime::SetTime(time_t newTime) { void cMyTime::SetTime(time_t newTime) {
tStart = 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) { time_t cMyTime::getPrevPrimetime(time_t current) {

View File

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

View File

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

View File

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