Change tvguideConfig to Config

This commit is contained in:
kamel5 2019-07-11 11:28:11 +02:00
parent 3513f82a8c
commit 0766d67980
31 changed files with 455 additions and 455 deletions

View File

@ -36,12 +36,12 @@ void cChannelGroupGrid::SetBackground() {
void cChannelGroupGrid::SetGeometry(int start, int end) { void cChannelGroupGrid::SetGeometry(int start, int end) {
int x, y, width, height; int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + start*geoManager.colWidth; x = geoManager.timeLineWidth + start*geoManager.colWidth;
y = geoManager.statusHeaderHeight; y = geoManager.statusHeaderHeight;
width = (end - start + 1) * geoManager.colWidth; width = (end - start + 1) * geoManager.colWidth;
height = geoManager.channelGroupsHeight; height = geoManager.channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
x = 0; x = 0;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + start*geoManager.rowHeight; y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + start*geoManager.rowHeight;
width = geoManager.channelGroupsWidth; width = geoManager.channelGroupsWidth;
@ -51,17 +51,17 @@ void cChannelGroupGrid::SetGeometry(int start, int end) {
} }
void cChannelGroupGrid::Draw(void) { void cChannelGroupGrid::Draw(void) {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelGroup); drawBackgroundGraphical(bgChannelGroup);
} else { } else {
drawBackground(); drawBackground();
drawBorder(); drawBorder();
} }
tColor colorText = theme.Color(clrFont); tColor colorText = theme.Color(clrFont);
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
DrawVertical(colorText, colorTextBack); DrawVertical(colorText, colorTextBack);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
DrawHorizontal(colorText, colorTextBack); DrawHorizontal(colorText, colorTextBack);
} }
} }

View File

@ -41,7 +41,7 @@ void cChannelGroups::ReadChannelGroups(void) {
} }
if (channelGroups.size() > 0) { if (channelGroups.size() > 0) {
channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber); channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber);
if ((tvguideConfig.hideLastGroup)&&(channelGroups.size() > 1)) { if ((config.hideLastGroup)&&(channelGroups.size() > 1)) {
channelGroups.pop_back(); channelGroups.pop_back();
} }
} }
@ -96,7 +96,7 @@ int cChannelGroups::GetNextGroupChannelNumber(const cChannel *channel) {
} }
bool cChannelGroups::IsInLastGroup(const cChannel *channel) { bool cChannelGroups::IsInLastGroup(const cChannel *channel) {
if (!tvguideConfig.hideLastGroup) if (!config.hideLastGroup)
return false; return false;
if (channelGroups.size() > 0) { if (channelGroups.size() > 0) {
if (channel->Number() > channelGroups[channelGroups.size()-1].StopChannel()) { if (channel->Number() > channelGroups[channelGroups.size()-1].StopChannel()) {

View File

@ -10,7 +10,7 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups; this->channelGroups = channelGroups;
pixmapText = NULL; pixmapText = NULL;
channel = 0; channel = 0;
if (!tvguideConfig.hideLastGroup) { if (!config.hideLastGroup) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
maxChannels = Channels->MaxNumber(); maxChannels = Channels->MaxNumber();
@ -41,7 +41,7 @@ void cChannelJump::SetPixmaps(void) {
} }
void cChannelJump::Draw(void) { void cChannelJump::Draw(void) {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelJump); drawBackgroundGraphical(bgChannelJump);
} else { } else {
pixmap->Fill(theme.Color(clrBackground)); pixmap->Fill(theme.Color(clrBackground));

View File

@ -175,7 +175,7 @@ class cTvguideConfig {
}; };
#ifdef DEFINE_CONFIG #ifdef DEFINE_CONFIG
cTvguideConfig tvguideConfig; cTvguideConfig config;
cOsdManager osdManager; cOsdManager osdManager;
cGeometryManager geoManager; cGeometryManager geoManager;
cFontManager fontManager; cFontManager fontManager;
@ -183,7 +183,7 @@ class cTvguideConfig {
cTheme theme; cTheme theme;
cPlugin* pRemoteTimers = NULL; cPlugin* pRemoteTimers = NULL;
#else #else
extern cTvguideConfig tvguideConfig; extern cTvguideConfig config;
extern cOsdManager osdManager; extern cOsdManager osdManager;
extern cGeometryManager geoManager; extern cGeometryManager geoManager;
extern cFontManager fontManager; extern cFontManager fontManager;

View File

@ -74,8 +74,8 @@ std::string cDetailView::LoadReruns(void) {
Epgsearch_searchresults_v1_0 data; Epgsearch_searchresults_v1_0 data;
std::string strQuery = event->Title(); std::string strQuery = event->Title();
if (tvguideConfig.displayRerunsDetailEPGView > 0) { if (config.displayRerunsDetailEPGView > 0) {
if (tvguideConfig.useSubtitleRerun == 2 && !isempty(event->ShortText())) { if (config.useSubtitleRerun == 2 && !isempty(event->ShortText())) {
strQuery += "~"; strQuery += "~";
strQuery += event->ShortText(); strQuery += event->ShortText();
} }
@ -95,7 +95,7 @@ std::string cDetailView::LoadReruns(void) {
if (list && (list->Count() > 1)) { if (list && (list->Count() > 1)) {
foundRerun = true; foundRerun = true;
int i = 0; int i = 0;
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < tvguideConfig.numReruns; r = list->Next(r)) { for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < config.numReruns; r = list->Next(r)) {
if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime())) if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime()))
continue; continue;
i++; i++;

View File

@ -27,7 +27,7 @@ void cDummyGrid::SetViewportHeight() {
void cDummyGrid::PositionPixmap() { void cDummyGrid::PositionPixmap() {
int x0, y0; int x0, y0;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
x0 = column->getX(); x0 = column->getX();
y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) { if ( column->Start() < StartTime() ) {
@ -41,7 +41,7 @@ void cDummyGrid::PositionPixmap() {
} else { } else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
} }
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
y0 = column->getY(); y0 = column->getY();
if ( column->Start() < StartTime() ) { if ( column->Start() < StartTime() ) {
@ -59,7 +59,7 @@ void cDummyGrid::PositionPixmap() {
} }
void cDummyGrid::setText() { void cDummyGrid::setText() {
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
text->Set(*strText, fontManager.FontGrid, geoManager.colWidth-2*borderWidth); text->Set(*strText, fontManager.FontGrid, geoManager.colWidth-2*borderWidth);
} }
} }
@ -67,13 +67,13 @@ void cDummyGrid::setText() {
void cDummyGrid::drawText() { void cDummyGrid::drawText() {
tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont);
tColor colorTextBack; tColor colorTextBack;
if (tvguideConfig.style == eStyleFlat) if (config.style == eStyleFlat)
colorTextBack = color; colorTextBack = color;
else if (tvguideConfig.style == eStyleGraphical) else if (config.style == eStyleGraphical)
colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack);
else else
colorTextBack = clrTransparent; colorTextBack = clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
if (Height()/geoManager.minutePixel < 6) if (Height()/geoManager.minutePixel < 6)
return; return;
int textHeight = fontManager.FontGrid->Height(); int textHeight = fontManager.FontGrid->Height();
@ -82,7 +82,7 @@ void cDummyGrid::drawText() {
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid); pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
} }
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
if (Width()/geoManager.minutePixel < 10) { if (Width()/geoManager.minutePixel < 10) {
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2; int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal); pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);

View File

@ -33,7 +33,7 @@ void cEpgGrid::SetViewportHeight() {
} }
void cEpgGrid::PositionPixmap() { void cEpgGrid::PositionPixmap() {
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
int x0 = column->getX(); int x0 = column->getX();
int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) { if ( column->Start() < StartTime() ) {
@ -45,7 +45,7 @@ void cEpgGrid::PositionPixmap() {
} else { } else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
} }
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
int y0 = column->getY(); int y0 = column->getY();
if ( column->Start() < StartTime() ) { if ( column->Start() < StartTime() ) {
@ -63,7 +63,7 @@ void cEpgGrid::PositionPixmap() {
void cEpgGrid::SetTimer() { void cEpgGrid::SetTimer() {
hasTimer = false; hasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Event_v1_0 rt; RemoteTimers_Event_v1_0 rt;
rt.event = event; rt.event = event;
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt)) if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
@ -91,12 +91,12 @@ void cEpgGrid::SetSwitchTimer() {
} }
void cEpgGrid::setText() { void cEpgGrid::setText() {
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
cString strText; cString strText;
strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title()); strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title());
text->Set(*(strText), fontManager.FontGrid, geoManager.colWidth-2*borderWidth); text->Set(*(strText), fontManager.FontGrid, geoManager.colWidth-2*borderWidth);
extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth-2*borderWidth); extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth-2*borderWidth);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString())); timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
} }
} }
@ -104,13 +104,13 @@ void cEpgGrid::setText() {
void cEpgGrid::drawText() { void cEpgGrid::drawText() {
tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont);
tColor colorTextBack; tColor colorTextBack;
if (tvguideConfig.style == eStyleFlat) if (config.style == eStyleFlat)
colorTextBack = color; colorTextBack = color;
else if (tvguideConfig.style == eStyleGraphical) else if (config.style == eStyleGraphical)
colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack);
else else
colorTextBack = clrTransparent; colorTextBack = clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
if (Height()/geoManager.minutePixel < 6) if (Height()/geoManager.minutePixel < 6)
return; return;
int textHeight = fontManager.FontGrid->Height(); int textHeight = fontManager.FontGrid->Height();
@ -126,7 +126,7 @@ void cEpgGrid::drawText() {
pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall); pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall);
} }
} }
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
if (Width()/geoManager.minutePixel < 10) { if (Width()/geoManager.minutePixel < 10) {
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2; int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal); pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);
@ -134,7 +134,7 @@ void cEpgGrid::drawText() {
} }
cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str(); cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str();
int titleY = 0; int titleY = 0;
if (tvguideConfig.showTimeInGrid) { if (config.showTimeInGrid) {
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall); pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall);
titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height())/2; titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height())/2;
} else { } else {
@ -170,7 +170,7 @@ void cEpgGrid::drawText() {
void cEpgGrid::drawIcon(cString iconText, tColor color) { void cEpgGrid::drawIcon(cString iconText, tColor color) {
const cFont *font = (tvguideConfig.displayMode == eVertical) const cFont *font = (config.displayMode == eVertical)
?fontManager.FontGrid ?fontManager.FontGrid
:fontManager.FontGridHorizontalSmall; :fontManager.FontGridHorizontalSmall;
int textWidth = font->Width(*iconText)+2*borderWidth; int textWidth = font->Width(*iconText)+2*borderWidth;

View File

@ -12,34 +12,34 @@ cFontManager::~cFontManager() {
void cFontManager::SetFonts() { void cFontManager::SetFonts() {
InitialiseFontType(); InitialiseFontType();
//Common Fonts //Common Fonts
FontButton = CreateFont(geoManager.footerHeight/3 + 4 + tvguideConfig.FontButtonDelta); FontButton = CreateFont(geoManager.footerHeight/3 + 4 + config.FontButtonDelta);
FontDetailView = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontDetailViewDelta); FontDetailView = CreateFont(geoManager.osdHeight/30 + config.FontDetailViewDelta);
FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontDetailViewSmallDelta); FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + config.FontDetailViewSmallDelta);
FontDetailHeader = CreateFont(geoManager.osdHeight/27 + tvguideConfig.FontDetailHeaderDelta); FontDetailHeader = CreateFont(geoManager.osdHeight/27 + config.FontDetailHeaderDelta);
FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + tvguideConfig.FontDetailHeaderDelta); FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + config.FontDetailHeaderDelta);
FontMessageBox = CreateFont(geoManager.osdHeight/33 + tvguideConfig.FontMessageBoxDelta); FontMessageBox = CreateFont(geoManager.osdHeight/33 + config.FontMessageBoxDelta);
FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontMessageBoxLargeDelta); FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + config.FontMessageBoxLargeDelta);
FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + tvguideConfig.FontStatusHeaderDelta); FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + config.FontStatusHeaderDelta);
FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + tvguideConfig.FontStatusHeaderLargeDelta); FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + config.FontStatusHeaderLargeDelta);
//Fonts for vertical Display //Fonts for vertical Display
FontChannelHeader = CreateFont(geoManager.colWidth/10 + tvguideConfig.FontChannelHeaderDelta); FontChannelHeader = CreateFont(geoManager.colWidth/10 + config.FontChannelHeaderDelta);
FontChannelGroups = CreateFont(geoManager.colWidth/8 + tvguideConfig.FontChannelGroupsDelta); FontChannelGroups = CreateFont(geoManager.colWidth/8 + config.FontChannelGroupsDelta);
FontGrid = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridDelta); FontGrid = CreateFont(geoManager.colWidth/12 + config.FontGridDelta);
FontGridSmall = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridSmallDelta); FontGridSmall = CreateFont(geoManager.colWidth/12 + config.FontGridSmallDelta);
FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + tvguideConfig.FontTimeLineWeekdayDelta); FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + config.FontTimeLineWeekdayDelta);
FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineDateDelta); FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineDateDelta);
FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineTimeDelta); FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineTimeDelta);
//Fonts for horizontal Display //Fonts for horizontal Display
FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + tvguideConfig.FontChannelHeaderHorizontalDelta); FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + config.FontChannelHeaderHorizontalDelta);
FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontChannelGroupsHorizontalDelta); FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontChannelGroupsHorizontalDelta);
FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontGridHorizontalDelta); FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontGridHorizontalDelta);
FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + tvguideConfig.FontGridHorizontalSmallDelta); FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + config.FontGridHorizontalSmallDelta);
FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + tvguideConfig.FontTimeLineDateHorizontalDelta); FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + config.FontTimeLineDateHorizontalDelta);
FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + tvguideConfig.FontTimeLineTimeHorizontalDelta); FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + config.FontTimeLineTimeHorizontalDelta);
//Fonts for RecMenu //Fonts for RecMenu
FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontRecMenuItemDelta); FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + config.FontRecMenuItemDelta);
FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontRecMenuItemSmallDelta); FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + config.FontRecMenuItemSmallDelta);
FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + tvguideConfig.FontRecMenuItemLargeDelta); FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + config.FontRecMenuItemLargeDelta);
} }
void cFontManager::DeleteFonts() { void cFontManager::DeleteFonts() {
@ -71,15 +71,15 @@ void cFontManager::DeleteFonts() {
} }
void cFontManager::InitialiseFontType(void) { void cFontManager::InitialiseFontType(void) {
if (tvguideConfig.fontIndex == 0) { if (config.fontIndex == 0) {
fontName = tvguideConfig.fontNameDefault; fontName = config.fontNameDefault;
} else { } else {
cStringList availableFonts; cStringList availableFonts;
cFont::GetAvailableFontNames(&availableFonts); cFont::GetAvailableFontNames(&availableFonts);
if (availableFonts[tvguideConfig.fontIndex-1]) { if (availableFonts[config.fontIndex-1]) {
fontName = availableFonts[tvguideConfig.fontIndex-1]; fontName = availableFonts[config.fontIndex-1];
} else } else
fontName = tvguideConfig.fontNameDefault; fontName = config.fontNameDefault;
} }
cFont *test = NULL; cFont *test = NULL;
test = cFont::CreateFont(*fontName, 30); test = cFont::CreateFont(*fontName, 30);

View File

@ -26,7 +26,7 @@ void cFooter::drawRedButton() {
} }
void cFooter::drawGreenButton() { void cFooter::drawGreenButton() {
cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels back")); cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels back"));
DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]); DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]);
} }
@ -36,7 +36,7 @@ void cFooter::drawGreenButton(const char *text) {
} }
void cFooter::drawYellowButton() { void cFooter::drawYellowButton() {
cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels forward")); cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels forward"));
DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]); DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
} }
@ -47,14 +47,14 @@ void cFooter::drawYellowButton(const char *text) {
void cFooter::drawBlueButton(bool detailedEPG) { void cFooter::drawBlueButton(bool detailedEPG) {
cString text; cString text;
if (tvguideConfig.blueKeyMode == eBlueKeySwitch) if (config.blueKeyMode == eBlueKeySwitch)
text = tr("Switch to Channel"); text = tr("Switch to Channel");
else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { else if (config.blueKeyMode == eBlueKeyEPG) {
if (!detailedEPG) if (!detailedEPG)
text = tr("Detailed EPG"); text = tr("Detailed EPG");
else else
text = tr("Close detailed EPG"); text = tr("Close detailed EPG");
} else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { } else if (config.blueKeyMode == eBlueKeyFavorites) {
if (!detailedEPG) if (!detailedEPG)
text = tr("Favorites"); text = tr("Favorites");
else else
@ -80,7 +80,7 @@ void cFooter::SetDetailedViewMode(bool fromRecMenu) {
if (fromRecMenu) { if (fromRecMenu) {
ClearButton(positionButtons[0]); ClearButton(positionButtons[0]);
ClearButton(positionButtons[3]); ClearButton(positionButtons[3]);
} else if (tvguideConfig.blueKeyMode != eBlueKeySwitch) { } else if (config.blueKeyMode != eBlueKeySwitch) {
ClearButton(positionButtons[3]); ClearButton(positionButtons[3]);
drawBlueButton(true); drawBlueButton(true);
} }
@ -89,7 +89,7 @@ void cFooter::SetDetailedViewMode(bool fromRecMenu) {
void cFooter::LeaveDetailedViewMode(const cChannel *channel) { void cFooter::LeaveDetailedViewMode(const cChannel *channel) {
drawRedButton(); drawRedButton();
drawBlueButton(); drawBlueButton();
if (tvguideConfig.channelJumpMode == eNumJump) { if (config.channelJumpMode == eNumJump) {
drawGreenButton(); drawGreenButton();
drawYellowButton(); drawYellowButton();
} else { } else {
@ -128,20 +128,20 @@ void cFooter::SetButtonPositions(void) {
} }
void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) { void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) {
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder; int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder;
if ((tvguideConfig.style == eStyleBlendingMagick) || (tvguideConfig.style == eStyleBlendingDefault)) { if ((config.style == eStyleBlendingMagick) || (config.style == eStyleBlendingDefault)) {
cImageLoader imgLoader; cImageLoader imgLoader;
imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4); imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4);
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor); footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage()); footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());
if (tvguideConfig.roundedCorners) { if (config.roundedCorners) {
int borderRadius = 12; int borderRadius = 12;
int borderWidth = 2; int borderWidth = 2;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
} }
} else if (tvguideConfig.style == eStyleGraphical) { } else if (config.style == eStyleGraphical) {
cImage *button = imgCache.GetOsdElement(buttonType); cImage *button = imgCache.GetOsdElement(buttonType);
if (button) { if (button) {
footer->DrawImage(cPoint(left, buttonY), *button); footer->DrawImage(cPoint(left, buttonY), *button);
@ -149,7 +149,7 @@ void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOs
} else { } else {
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor); footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color); footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color);
if (tvguideConfig.roundedCorners) { if (config.roundedCorners) {
int borderRadius = 12; int borderRadius = 12;
int borderWidth = 1; int borderWidth = 1;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);

View File

@ -20,39 +20,39 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
this->osdHeight = osdHeight; this->osdHeight = osdHeight;
esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight); esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.headerHeightPercent * osdHeight / 100):0; statusHeaderHeight = (config.displayStatusHeader) ? (config.headerHeightPercent * osdHeight / 100):0;
tvFrameWidth = statusHeaderHeight * 16 / 9; tvFrameWidth = statusHeaderHeight * 16 / 9;
headerContentWidth = (tvguideConfig.scaleVideo)?(osdWidth - tvFrameWidth):osdWidth; headerContentWidth = (config.scaleVideo) ? (osdWidth - tvFrameWidth):osdWidth;
channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0; channelGroupsWidth = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdWidth / 100):0;
channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0; channelGroupsHeight = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdHeight / 100):0;
channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100; channelHeaderWidth = config.channelHeaderWidthPercent * osdWidth / 100;
channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100; channelHeaderHeight = config.channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100; timeLineWidth = config.timeLineWidthPercent * osdWidth / 100;
timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100; timeLineHeight = config.timeLineHeightPercent * osdHeight / 100;
footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100; footerHeight = config.footerHeightPercent * osdHeight / 100;
footerY = osdHeight - footerHeight; footerY = osdHeight - footerHeight;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols; colWidth = (osdWidth - timeLineWidth) / config.channelCols;
rowHeight = 0; rowHeight = 0;
minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime; minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / config.displayTime;
channelLogoWidth = colWidth; channelLogoWidth = colWidth;
channelLogoHeight = channelHeaderHeight; channelLogoHeight = channelHeaderHeight;
logoWidth = channelLogoWidth/2 - 15; logoWidth = channelLogoWidth / 2 - 15;
logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio; logoHeight = logoWidth * config.logoHeightRatio / config.logoWidthRatio;
timeLineGridWidth = timeLineWidth; timeLineGridWidth = timeLineWidth;
timeLineGridHeight = minutePixel * 30; timeLineGridHeight = minutePixel * 30;
dateVieverWidth = timeLineWidth; dateVieverWidth = timeLineWidth;
dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3; dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
clockWidth = dateVieverWidth; clockWidth = dateVieverWidth;
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight; clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
colWidth = 0; colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows; rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / config.channelRows;
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayHorizontalTime; minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / config.displayHorizontalTime;
channelLogoWidth = channelHeaderWidth; channelLogoWidth = channelHeaderWidth;
channelLogoHeight = rowHeight; channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; logoWidth = channelLogoHeight * config.logoWidthRatio / config.logoHeightRatio;
logoHeight = channelLogoHeight; logoHeight = channelLogoHeight;
timeLineGridWidth = geoManager.minutePixel * 30; timeLineGridWidth = geoManager.minutePixel * 30;
timeLineGridHeight = geoManager.timeLineHeight; timeLineGridHeight = geoManager.timeLineHeight;
@ -65,7 +65,7 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
buttonWidth = osdWidth / 4 - 2 * buttonBorder; buttonWidth = osdWidth / 4 - 2 * buttonBorder;
buttonHeight = footerHeight - 3 * buttonBorder; buttonHeight = footerHeight - 3 * buttonBorder;
epgViewHeaderHeight = tvguideConfig.headerHeightPercent * osdHeight / 100; epgViewHeaderHeight = config.headerHeightPercent * osdHeight / 100;
borderRecMenus = 10; borderRecMenus = 10;

2
grid.c
View File

@ -34,7 +34,7 @@ void cGrid::Draw() {
return; return;
} }
if (dirty) { if (dirty) {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgGrid, active); drawBackgroundGraphical(bgGrid, active);
drawText(); drawText();
} else { } else {

View File

@ -15,10 +15,10 @@ void cHeaderGrid::createBackground(int num) {
color = theme.Color(clrHeader); color = theme.Color(clrHeader);
colorBlending = theme.Color(clrHeaderBlending); colorBlending = theme.Color(clrHeaderBlending);
int x, y; int x, y;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth; x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth; x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
} }
@ -28,7 +28,7 @@ void cHeaderGrid::createBackground(int num) {
return; return;
} }
pixmapLogo->Fill(clrTransparent); pixmapLogo->Fill(clrTransparent);
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelHeader); drawBackgroundGraphical(bgChannelHeader);
} else { } else {
drawBackground(); drawBackground();
@ -37,9 +37,9 @@ void cHeaderGrid::createBackground(int num) {
} }
void cHeaderGrid::drawChannel(const cChannel *channel) { void cHeaderGrid::drawChannel(const cChannel *channel) {
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
drawChannelVertical(channel); drawChannelVertical(channel);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
drawChannelHorizontal(channel); drawChannelHorizontal(channel);
} }
} }
@ -48,11 +48,11 @@ void cHeaderGrid::drawChannel(const cChannel *channel) {
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int logoWidth = geoManager.logoWidth; int logoWidth = geoManager.logoWidth;
int logoX = tvguideConfig.displayChannelName ? 5 : (Width() - logoWidth) / 2; int logoX = config.displayChannelName ? 5 : (Width() - logoWidth) / 2;
int textX = 5; int textX = 5;
int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2; int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2;
bool logoFound = false; bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) { if (!config.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel); cImage *logo = imgCache.GetLogo(channel);
if (logo) { if (logo) {
const int logoheight = logo->Height(); const int logoheight = logo->Height();
@ -65,13 +65,13 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
if (!logoFound) { if (!logoFound) {
drawText = true; drawText = true;
} }
if (tvguideConfig.displayChannelName) { if (config.displayChannelName) {
drawText = true; drawText = true;
textX += logoWidth + 5; textX += logoWidth + 5;
textWidthMax -= textX; textWidthMax -= textX;
} }
if (drawText) { if (drawText) {
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name()); cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name());
strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str(); strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str();
pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal); pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal);
@ -90,7 +90,7 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int lineHeight = fontManager.FontChannelHeader->Height(); int lineHeight = fontManager.FontChannelHeader->Height();
int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8; int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8;
bool logoFound = false; bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) { if (!config.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel); cImage *logo = imgCache.GetLogo(channel);
if (logo) { if (logo) {
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo); pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
@ -100,13 +100,13 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
bool drawText = false; bool drawText = false;
if (!logoFound) { if (!logoFound) {
drawText = true; drawText = true;
} else if (tvguideConfig.displayChannelName) { } else if (config.displayChannelName) {
drawText = true; drawText = true;
yStart = logoHeight; yStart = logoHeight;
} }
if (!drawText) if (!drawText)
return; return;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
for (int i = 0; i < lines; i++) { for (int i = 0; i < lines; i++) {
int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i)); int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
int xText = (geoManager.colWidth - textWidth) / 2; int xText = (geoManager.colWidth - textWidth) / 2;
@ -118,12 +118,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
void cHeaderGrid::setPosition(int num) { void cHeaderGrid::setPosition(int num) {
int x, y, width, height; int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth; x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
width = geoManager.colWidth; width = geoManager.colWidth;
height = geoManager.channelHeaderHeight; height = geoManager.channelHeaderHeight;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth; x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
width = geoManager.channelHeaderWidth; width = geoManager.channelHeaderWidth;

View File

@ -28,7 +28,7 @@ cImageCache::~cImageCache() {
} }
void cImageCache::CreateCache(void) { void cImageCache::CreateCache(void) {
if (tvguideConfig.style != eStyleGraphical) if (config.style != eStyleGraphical)
return; return;
esyslog("tvguide: Creating Image Cache"); esyslog("tvguide: Creating Image Cache");
int start = cTimeMs::Now(); int start = cTimeMs::Now();
@ -85,7 +85,7 @@ void cImageCache::CreateOsdIconCache(void) {
InsertIntoOsdElementCache(oeButtonBlue, geoManager.buttonWidth, geoManager.buttonHeight); InsertIntoOsdElementCache(oeButtonBlue, geoManager.buttonWidth, geoManager.buttonHeight);
//Channel Logo Background //Channel Logo Background
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
success = LoadIcon("osdElements/channellogoback_horizontal"); success = LoadIcon("osdElements/channellogoback_horizontal");
} else { } else {
success = LoadIcon("osdElements/channellogoback_vertical"); success = LoadIcon("osdElements/channellogoback_vertical");
@ -95,7 +95,7 @@ void cImageCache::CreateOsdIconCache(void) {
//Timeline Elements //Timeline Elements
std::string imgTimeline1, imgTimeline2, imgDateViewer; std::string imgTimeline1, imgTimeline2, imgDateViewer;
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
imgTimeline1 = "osdElements/timeline1_horizontal"; imgTimeline1 = "osdElements/timeline1_horizontal";
imgTimeline2 = "osdElements/timeline2_horizontal"; imgTimeline2 = "osdElements/timeline2_horizontal";
imgDateViewer = "osdElements/timeline2_horizontal"; imgDateViewer = "osdElements/timeline2_horizontal";
@ -129,7 +129,7 @@ void cImageCache::PrepareGridIconCache(void) {
//Create Buffers for Background //Create Buffers for Background
gridsAvailable = true; gridsAvailable = true;
std::string grid, grid_active; std::string grid, grid_active;
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
grid = "osdElements/grid_horizontal"; grid = "osdElements/grid_horizontal";
grid_active = "osdElements/grid_active_horizontal"; grid_active = "osdElements/grid_active_horizontal";
} else { } else {
@ -158,7 +158,7 @@ void cImageCache::PrepareGridIconCache(void) {
imgBottom = NULL; imgBottom = NULL;
imgBottomActive = NULL; imgBottomActive = NULL;
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
std::string left = "osdElements/grid_left"; std::string left = "osdElements/grid_left";
std::string right = "osdElements/grid_right"; std::string right = "osdElements/grid_right";
std::string left_active = "osdElements/grid_active_left"; std::string left_active = "osdElements/grid_active_left";
@ -214,7 +214,7 @@ void cImageCache::PrepareGridIconCache(void) {
} }
void cImageCache::CreateGridIconCache(void) { void cImageCache::CreateGridIconCache(void) {
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
int gridHeight = geoManager.rowHeight; int gridHeight = geoManager.rowHeight;
for (int minutes = 5; minutes <= 120; minutes += 5) { for (int minutes = 5; minutes <= 120; minutes += 5) {
GetGrid(minutes * geoManager.minutePixel, gridHeight, false); GetGrid(minutes * geoManager.minutePixel, gridHeight, false);
@ -233,7 +233,7 @@ void cImageCache::CreateChannelGroupCache(void) {
groupsBottom = NULL; groupsBottom = NULL;
groupsLeft = NULL; groupsLeft = NULL;
groupsRight = NULL; groupsRight = NULL;
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
std::string channelGroupHead = "osdElements/channelgroup_head"; std::string channelGroupHead = "osdElements/channelgroup_head";
std::string channelGroupBottom = "osdElements/channelgroup_bottom"; std::string channelGroupBottom = "osdElements/channelgroup_bottom";
int width = geoManager.channelGroupsWidth; int width = geoManager.channelGroupsWidth;
@ -249,7 +249,7 @@ void cImageCache::CreateChannelGroupCache(void) {
if (success && heightHeadBottom) { if (success && heightHeadBottom) {
groupsBottom = CreateImage(width, heightHeadBottom, false); groupsBottom = CreateImage(width, heightHeadBottom, false);
} }
for (int size = 1; size <= tvguideConfig.numGrids; ++size) { for (int size = 1; size <= config.numGrids; ++size) {
InsertIntoGroupsCacheHorizontal(size); InsertIntoGroupsCacheHorizontal(size);
} }
} else { } else {
@ -268,7 +268,7 @@ void cImageCache::CreateChannelGroupCache(void) {
if (success && widthHeadBottom) { if (success && widthHeadBottom) {
groupsRight = CreateImage(widthHeadBottom, height, false); groupsRight = CreateImage(widthHeadBottom, height, false);
} }
for (int size = 1; size <= tvguideConfig.numGrids; ++size) { for (int size = 1; size <= config.numGrids; ++size) {
InsertIntoGroupsCacheVertical(size); InsertIntoGroupsCacheVertical(size);
} }
} }
@ -276,9 +276,9 @@ void cImageCache::CreateChannelGroupCache(void) {
} }
void cImageCache::CreateLogoCache(void) { void cImageCache::CreateLogoCache(void) {
if (tvguideConfig.hideChannelLogos) if (config.hideChannelLogos)
return; return;
if (tvguideConfig.numLogosInitial > 0) { if (config.numLogosInitial > 0) {
int channelsCached = 0; int channelsCached = 0;
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
@ -286,7 +286,7 @@ void cImageCache::CreateLogoCache(void) {
#else #else
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
#endif #endif
if (channelsCached >= tvguideConfig.numLogosInitial) if (channelsCached >= config.numLogosInitial)
break; break;
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
bool success = LoadLogo(channel); bool success = LoadLogo(channel);
@ -351,7 +351,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
} else { } else {
bool success = LoadLogo(channel); bool success = LoadLogo(channel);
if (success) { if (success) {
if ((tvguideConfig.limitLogoCache) && ((int)logoCache.size() >= tvguideConfig.numLogosMax)) { if ((config.limitLogoCache) && ((int)logoCache.size() >= config.numLogosMax)) {
//logo cache is full, don't cache anymore //logo cache is full, don't cache anymore
if (tempStaticLogo) { if (tempStaticLogo) {
delete tempStaticLogo; delete tempStaticLogo;
@ -403,7 +403,7 @@ void cImageCache::InsertIntoOsdElementCache(eOsdElementType type, int width, int
void cImageCache::InsertIntoGridCache(std::string name, int width, int height, bool active) { void cImageCache::InsertIntoGridCache(std::string name, int width, int height, bool active) {
cImage *image = CreateGrid(width, height, active); cImage *image = CreateGrid(width, height, active);
if (image) { if (image) {
if (tvguideConfig.displayMode == eHorizontal) { if (config.displayMode == eHorizontal) {
AddCornersHorizontal(image, active); AddCornersHorizontal(image, active);
} else { } else {
AddCornersVertical(image, active); AddCornersVertical(image, active);
@ -553,25 +553,25 @@ void cImageCache::AddCornersGroupVertical(cImage *img) {
bool cImageCache::LoadIcon(std::string name) { bool cImageCache::LoadIcon(std::string name) {
bool success = false; bool success = false;
if (tvguideConfig.iconsPathSet) { if (config.iconsPathSet) {
cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPath, *tvguideConfig.themeName); cString iconPathTheme = cString::sprintf("%s%s/", *config.iconPath, *config.themeName);
success = LoadImage(name, *iconPathTheme, "png"); success = LoadImage(name, *iconPathTheme, "png");
if (success) { if (success) {
return true; return true;
} else { } else {
success = LoadImage(name, *tvguideConfig.iconPath, "png"); success = LoadImage(name, *config.iconPath, "png");
if (success) { if (success) {
return true; return true;
} }
} }
} }
if (!success) { if (!success) {
cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName); cString iconPathTheme = cString::sprintf("%s%s/", *config.iconPathDefault, *config.themeName);
success = LoadImage(name, *iconPathTheme, "png"); success = LoadImage(name, *iconPathTheme, "png");
if (success) { if (success) {
return true; return true;
} else { } else {
success = LoadImage(name, *tvguideConfig.iconPathDefault, "png"); success = LoadImage(name, *config.iconPathDefault, "png");
if (success) { if (success) {
return true; return true;
} }
@ -587,24 +587,24 @@ bool cImageCache::LoadLogo(const cChannel *channel) {
std::string logoLower = StrToLowerCase(channel->Name()); std::string logoLower = StrToLowerCase(channel->Name());
bool success = false; bool success = false;
cString extension; cString extension;
if (tvguideConfig.logoExtension == 0) { if (config.logoExtension == 0) {
extension = "png"; extension = "png";
} else if (tvguideConfig.logoExtension == 1) { } else if (config.logoExtension == 1) {
extension = "jpg"; extension = "jpg";
} }
if (tvguideConfig.logoPathSet) { if (config.logoPathSet) {
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); success = LoadImage(channelID.c_str(), *config.logoPath, *extension);
if (success) if (success)
return true; return true;
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); success = LoadImage(logoLower.c_str(), *config.logoPath, *extension);
if (success) if (success)
return true; return true;
} }
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension); success = LoadImage(channelID.c_str(), *config.logoPathDefault, *extension);
if (success) if (success)
return true; return true;
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension); success = LoadImage(logoLower.c_str(), *config.logoPathDefault, *extension);
return success; return success;
} }

View File

@ -23,22 +23,22 @@ bool cImageLoader::LoadLogo(const cChannel *channel, int width, int height) {
std::string channelID = StrToLowerCase(*(channel->GetChannelID().ToString())); std::string channelID = StrToLowerCase(*(channel->GetChannelID().ToString()));
std::string logoLower = StrToLowerCase(channel->Name()); std::string logoLower = StrToLowerCase(channel->Name());
cString extension; cString extension;
if (tvguideConfig.logoExtension == 0) { if (config.logoExtension == 0) {
extension = "png"; extension = "png";
} else if (tvguideConfig.logoExtension == 1) { } else if (config.logoExtension == 1) {
extension = "jpg"; extension = "jpg";
} }
bool success = false; bool success = false;
if (tvguideConfig.logoPathSet) { if (config.logoPathSet) {
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); success = LoadImage(channelID.c_str(), *config.logoPath, *extension);
if (!success) { if (!success) {
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); success = LoadImage(logoLower.c_str(), *config.logoPath, *extension);
} }
} }
if (!success) if (!success)
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension); success = LoadImage(channelID.c_str(), *config.logoPathDefault, *extension);
if (!success) if (!success)
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension); success = LoadImage(logoLower.c_str(), *config.logoPathDefault, *extension);
if (success) if (success)
buffer.sample(Geometry(width, height)); buffer.sample(Geometry(width, height));
return success; return success;
@ -48,9 +48,9 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) {
if ((width == 0)||(height==0)) if ((width == 0)||(height==0))
return false; return false;
bool success = false; bool success = false;
success = LoadImage(*cString::sprintf("%d", eventID), *tvguideConfig.epgImagePath, "jpg"); success = LoadImage(*cString::sprintf("%d", eventID), *config.epgImagePath, "jpg");
if (!success) if (!success)
success = LoadImage(*cString::sprintf("%d_0", eventID), *tvguideConfig.epgImagePath, "jpg"); success = LoadImage(*cString::sprintf("%d_0", eventID), *config.epgImagePath, "jpg");
if (!success) if (!success)
return false; return false;
buffer.sample( Geometry(width, height)); buffer.sample( Geometry(width, height));
@ -58,12 +58,12 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) {
} }
bool cImageLoader::LoadAdditionalEPGImage(cString name) { bool cImageLoader::LoadAdditionalEPGImage(cString name) {
int width = tvguideConfig.epgImageWidthLarge; int width = config.epgImageWidthLarge;
int height = tvguideConfig.epgImageHeightLarge; int height = config.epgImageHeightLarge;
if ((width == 0)||(height==0)) if ((width == 0)||(height==0))
return false; return false;
bool success = false; bool success = false;
success = LoadImage(*name, *tvguideConfig.epgImagePath, "jpg"); success = LoadImage(*name, *config.epgImagePath, "jpg");
if (!success) if (!success)
return false; return false;
if (height != 0 || width != 0) { if (height != 0 || width != 0) {
@ -84,19 +84,19 @@ bool cImageLoader::LoadIcon(const char *cIcon, int size) {
if (size==0) if (size==0)
return false; return false;
bool success = false; bool success = false;
if (tvguideConfig.iconsPathSet) { if (config.iconsPathSet) {
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPath, *tvguideConfig.themeName); cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *config.iconPath, *config.themeName);
success = LoadImage(cIcon, *iconPathTheme, "png"); success = LoadImage(cIcon, *iconPathTheme, "png");
if (!success) { if (!success) {
cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPath); cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPath);
success = LoadImage(cIcon, *iconPath, "png"); success = LoadImage(cIcon, *iconPath, "png");
} }
} }
if (!success) { if (!success) {
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName); cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *config.iconPathDefault, *config.themeName);
success = LoadImage(cIcon, *iconPathTheme, "png"); success = LoadImage(cIcon, *iconPathTheme, "png");
if (!success) { if (!success) {
cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPathDefault); cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPathDefault);
success = LoadImage(cIcon, *iconPath, "png"); success = LoadImage(cIcon, *iconPath, "png");
} }
} }
@ -110,20 +110,20 @@ bool cImageLoader::LoadOsdElement(cString name, int width, int height) {
if ((width == 0)||(height==0)) if ((width == 0)||(height==0))
return false; return false;
bool success = false; bool success = false;
if (tvguideConfig.iconsPathSet) { if (config.iconsPathSet) {
cString path = cString::sprintf("%s%s%s", *tvguideConfig.iconPath, *tvguideConfig.themeName, "/osdElements/"); cString path = cString::sprintf("%s%s%s", *config.iconPath, *config.themeName, "/osdElements/");
success = LoadImage(*name, *path, "png"); success = LoadImage(*name, *path, "png");
if (!success) { if (!success) {
path = cString::sprintf("%s%s", *tvguideConfig.iconPath, "/osdElements/"); path = cString::sprintf("%s%s", *config.iconPath, "/osdElements/");
success = LoadImage(*name, *path, "png"); success = LoadImage(*name, *path, "png");
} }
} }
if (!success) { if (!success) {
cString path = cString::sprintf("%s%s%s", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName, "/osdElements/"); cString path = cString::sprintf("%s%s%s", *config.iconPathDefault, *config.themeName, "/osdElements/");
success = LoadImage(*name, *path, "png"); success = LoadImage(*name, *path, "png");
} }
if (!success) { if (!success) {
cString path = cString::sprintf("%s%s", *tvguideConfig.iconPathDefault, "/osdElements/"); cString path = cString::sprintf("%s%s", *config.iconPathDefault, "/osdElements/");
success = LoadImage(*name, *path, "png"); success = LoadImage(*name, *path, "png");
} }
if (!success) if (!success)

View File

@ -77,21 +77,21 @@ bool cImageMagickWrapper::LoadImage(std::string FileName, std::string Path, std:
std::stringstream sstrImgFile; std::stringstream sstrImgFile;
sstrImgFile << Path << FileName << "." << Extension; sstrImgFile << Path << FileName << "." << Extension;
std::string imgFile = sstrImgFile.str(); std::string imgFile = sstrImgFile.str();
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: trying to load: %s", imgFile.c_str()); esyslog("tvguide: trying to load: %s", imgFile.c_str());
buffer.read(imgFile.c_str()); buffer.read(imgFile.c_str());
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: %s sucessfully loaded", imgFile.c_str()); esyslog("tvguide: %s sucessfully loaded", imgFile.c_str());
} catch( Magick::Warning &warning ) { } catch( Magick::Warning &warning ) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: Magick Warning: %s", warning.what()); esyslog("tvguide: Magick Warning: %s", warning.what());
return true; return true;
} catch( Magick::Error &error ) { } catch( Magick::Error &error ) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: Magick Error: %s", error.what()); esyslog("tvguide: Magick Error: %s", error.what());
return false; return false;
} catch(...) { } catch(...) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: an unknown Magick error occured during image loading"); esyslog("tvguide: an unknown Magick error occured during image loading");
return false; return false;
} }
@ -102,21 +102,21 @@ bool cImageMagickWrapper::LoadImage(const char *fullpath) {
if ((fullpath == NULL) || (strlen(fullpath) < 5)) if ((fullpath == NULL) || (strlen(fullpath) < 5))
return false; return false;
try { try {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: trying to load: %s", fullpath); esyslog("tvguide: trying to load: %s", fullpath);
buffer.read(fullpath); buffer.read(fullpath);
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: %s sucessfully loaded", fullpath); esyslog("tvguide: %s sucessfully loaded", fullpath);
} catch( Magick::Warning &warning ) { } catch( Magick::Warning &warning ) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: Magick Warning: %s", warning.what()); esyslog("tvguide: Magick Warning: %s", warning.what());
return true; return true;
} catch( Magick::Error &error ) { } catch( Magick::Error &error ) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: Magick Error: %s", error.what()); esyslog("tvguide: Magick Error: %s", error.what());
return false; return false;
} catch(...) { } catch(...) {
if (tvguideConfig.debugImageLoading) if (config.debugImageLoading)
esyslog("tvguide: an unknown Magick error occured during image loading"); esyslog("tvguide: an unknown Magick error occured during image loading");
return false; return false;
} }

View File

@ -17,7 +17,7 @@ bool cOsdManager::setOsd() {
void cOsdManager::setBackground() { void cOsdManager::setBackground() {
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) { if (config.displayStatusHeader && config.scaleVideo) {
int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9; int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD)); osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD)); osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));

View File

@ -44,7 +44,7 @@ bool cRecManager::RefreshRemoteTimers(void) {
bool cRecManager::CheckEventForTimer(const cEvent *event) { bool cRecManager::CheckEventForTimer(const cEvent *event) {
bool hasTimer = false; bool hasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event; rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@ -66,7 +66,7 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) {
const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
const cTimer *timer = NULL; const cTimer *timer = NULL;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event; rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@ -85,7 +85,7 @@ const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createTimer(const cEvent *event, std::string path) {
cTimer *timer = NULL; cTimer *timer = NULL;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
timer = createRemoteTimer(event, path); timer = createRemoteTimer(event, path);
} else { } else {
timer = createLocalTimer(event, path); timer = createLocalTimer(event, path);
@ -143,9 +143,9 @@ cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
} }
void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string path) { void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string path) {
if (tvguideConfig.instRecFolderMode == eFolderFixed) { if (config.instRecFolderMode == eFolderFixed) {
Epgsearch_services_v1_2 *epgSearch = new Epgsearch_services_v1_2; Epgsearch_services_v1_2 *epgSearch = new Epgsearch_services_v1_2;
std::string recDir = tvguideConfig.instRecFixedFolder; std::string recDir = config.instRecFixedFolder;
std::replace(recDir.begin(), recDir.end(), '/', '~'); std::replace(recDir.begin(), recDir.end(), '/', '~');
if (strchr(recDir.c_str(), '%') != NULL) { if (strchr(recDir.c_str(), '%') != NULL) {
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) { if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
@ -193,7 +193,7 @@ void cRecManager::DeleteTimer(int timerID) {
void cRecManager::DeleteTimer(const cEvent *event) { void cRecManager::DeleteTimer(const cEvent *event) {
if (!event) if (!event)
return; return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
DeleteRemoteTimer(event); DeleteRemoteTimer(event);
} else { } else {
DeleteLocalTimer(event); DeleteLocalTimer(event);
@ -287,7 +287,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) {
#if VDRVERSNUM < 20300 #if VDRVERSNUM < 20300
timer->SetEventFromSchedule(); timer->SetEventFromSchedule();
#endif #endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt; RemoteTimers_Timer_v1_0 rt;
rt.timer = timer; rt.timer = timer;
if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt)) if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt))
@ -337,7 +337,7 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
#if VDRVERSNUM < 20300 #if VDRVERSNUM < 20300
seriesTimer->SetEventFromSchedule(); seriesTimer->SetEventFromSchedule();
#endif #endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt; RemoteTimers_Timer_v1_0 rt;
rt.timer = seriesTimer; rt.timer = seriesTimer;
if (!pRemoteTimers->Service("RemoteTimers::NewTimer-v1.0", &rt)) if (!pRemoteTimers->Service("RemoteTimers::NewTimer-v1.0", &rt))
@ -717,8 +717,8 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
if (epgSearchAvailable && !isempty(event->Title())) { if (epgSearchAvailable && !isempty(event->Title())) {
Epgsearch_searchresults_v1_0 data; Epgsearch_searchresults_v1_0 data;
std::string strQuery = event->Title(); std::string strQuery = event->Title();
if (tvguideConfig.useSubtitleRerun > 0) { if (config.useSubtitleRerun > 0) {
if (tvguideConfig.useSubtitleRerun == 2 || !isempty(event->ShortText())) if (config.useSubtitleRerun == 2 || !isempty(event->ShortText()))
strQuery += "~"; strQuery += "~";
if (!isempty(event->ShortText())) if (!isempty(event->ShortText()))
strQuery += event->ShortText(); strQuery += event->ShortText();
@ -789,9 +789,9 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif #endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (config.favLimitChannels) {
startChannel = channels->GetByNumber(tvguideConfig.favStartChannel); startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = channels->GetByNumber(tvguideConfig.favStopChannel); stopChannel = channels->GetByNumber(config.favStopChannel);
} }
if (!startChannel) if (!startChannel)
startChannel = channels->First(); startChannel = channels->First();
@ -825,13 +825,13 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
std::vector<const cEvent*> tmpResults; std::vector<const cEvent*> tmpResults;
int favTime = 0; int favTime = 0;
if (userTime == 1) { if (userTime == 1) {
favTime = tvguideConfig.favTime1; favTime = config.favTime1;
} else if (userTime == 2) { } else if (userTime == 2) {
favTime = tvguideConfig.favTime2; favTime = config.favTime2;
} else if (userTime == 3) { } else if (userTime == 3) {
favTime = tvguideConfig.favTime3; favTime = config.favTime3;
} else if (userTime == 4) { } else if (userTime == 4) {
favTime = tvguideConfig.favTime4; favTime = config.favTime4;
} }
time_t now = time(0); time_t now = time(0);
@ -857,9 +857,9 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif #endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (config.favLimitChannels) {
startChannel = channels->GetByNumber(tvguideConfig.favStartChannel); startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = channels->GetByNumber(tvguideConfig.favStopChannel); stopChannel = channels->GetByNumber(config.favStopChannel);
} }
if (!startChannel) if (!startChannel)
startChannel = channels->First(); startChannel = channels->First();

View File

@ -532,7 +532,7 @@ void cRecMenu::Arrange(bool scroll) {
} }
void cRecMenu::Display(bool scroll) { void cRecMenu::Display(bool scroll) {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgRecMenuBack); drawBackgroundGraphical(bgRecMenuBack);
} else { } else {
pixmap->Fill(theme.Color(clrBackground)); pixmap->Fill(theme.Color(clrBackground));
@ -674,7 +674,7 @@ eRecMenuState cRecMenu::ProcessKey(eKeys Key) {
cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = new cImage(cSize(width, height)); cImage *image = new cImage(cSize(width, height));
image->Fill(clrBgr); image->Fill(clrBgr);
if (tvguideConfig.style != eStyleFlat) { if (config.style != eStyleFlat) {
int numSteps = 64; int numSteps = 64;
int alphaStep = 0x03; int alphaStep = 0x03;
if (height < 30) if (height < 30)

View File

@ -36,7 +36,7 @@ void cRecMenuItem::SetPixmaps(void) {
} }
void cRecMenuItem::setBackground(void) { void cRecMenuItem::setBackground(void) {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
if (defaultBackground) { if (defaultBackground) {
drawBackgroundGraphical(bgButton, active); drawBackgroundGraphical(bgButton, active);
} }
@ -52,7 +52,7 @@ void cRecMenuItem::setBackground(void) {
colorBlending = theme.Color(clrGrid1Blending); colorBlending = theme.Color(clrGrid1Blending);
colorText = theme.Color(clrFont); colorText = theme.Color(clrFont);
} }
colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
if (defaultBackground) { if (defaultBackground) {
drawBackground(); drawBackground();
drawBorder(); drawBorder();
@ -177,7 +177,7 @@ void cRecMenuItemButtonYesNo::Show(void) {
} }
void cRecMenuItemButtonYesNo::setBackground() { void cRecMenuItemButtonYesNo::setBackground() {
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgButton, yesActive&&active); drawBackgroundGraphical(bgButton, yesActive&&active);
colorTextBack = clrTransparent; colorTextBack = clrTransparent;
colorTextNoBack = clrTransparent; colorTextNoBack = clrTransparent;
@ -213,8 +213,8 @@ void cRecMenuItemButtonYesNo::setBackground() {
theme.Color(clrGrid1Blending)); theme.Color(clrGrid1Blending));
colorTextNo = theme.Color(clrFont); colorTextNo = theme.Color(clrFont);
} }
colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
colorTextNoBack = (tvguideConfig.style == eStyleFlat)?colorNoBack:clrTransparent; colorTextNoBack = (config.style == eStyleFlat)?colorNoBack:clrTransparent;
drawBackground(); drawBackground();
drawBorder(); drawBorder();
pixmapNo->drawBackground(); pixmapNo->drawBackground();
@ -641,8 +641,8 @@ cRecMenuItemSelectDirectory::cRecMenuItemSelectDirectory(cString text,
height = 3 * font->Height() / 2; height = 3 * font->Height() / 2;
pixmapVal = NULL; pixmapVal = NULL;
folders.push_back(tr("root video folder")); folders.push_back(tr("root video folder"));
if (isSearchTimer && tvguideConfig.instRecFixedFolder.size() > 0) if (isSearchTimer && config.instRecFixedFolder.size() > 0)
folders.push_back(tvguideConfig.instRecFixedFolder); folders.push_back(config.instRecFixedFolder);
ReadRecordingDirectories(&folders, NULL, ""); ReadRecordingDirectories(&folders, NULL, "");
numValues = folders.size(); numValues = folders.size();
this->currentVal = GetInitial(); this->currentVal = GetInitial();
@ -1615,9 +1615,9 @@ void cRecMenuItemTimer::Draw(void) {
channelName = channel->Name(); channelName = channel->Name();
} }
int logoX = DrawIcons(); int logoX = DrawIcons();
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
cImageLoader imgLoader; cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) { if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, height)) { if (imgLoader.LoadLogo(channel, logoWidth, height)) {
cImage logo = imgLoader.GetImage(); cImage logo = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(logoX, 0), logo); pixmapIcons->DrawImage(cPoint(logoX, 0), logo);
@ -1865,9 +1865,9 @@ void cRecMenuItemEvent::Draw(void) {
cString channelName = ""; cString channelName = "";
if (channel) if (channel)
channelName = channel->Name(); channelName = channel->Name();
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
cImageLoader imgLoader; cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) { if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, height)) { if (imgLoader.LoadLogo(channel, logoWidth, height)) {
cImage logo = imgLoader.GetImage(); cImage logo = imgLoader.GetImage();
pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo); pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
@ -2018,7 +2018,7 @@ void cRecMenuItemChannelChooser::DrawValue(void) {
cString textVal = cString::sprintf("%d - %s", channel->Number(), channel->Name()); cString textVal = cString::sprintf("%d - %s", channel->Number(), channel->Name());
int textX = width - font->Width(*textVal) - 10; int textX = width - font->Width(*textVal) - 10;
pixmapChannel->DrawText(cPoint(textX, textY), *textVal, colorText, clrTransparent, font); pixmapChannel->DrawText(cPoint(textX, textY), *textVal, colorText, clrTransparent, font);
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
int logoX = textX - logoWidth - 10; int logoX = textX - logoWidth - 10;
cImageLoader imgLoader; cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) { if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) {
@ -2416,10 +2416,10 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
const cChannel *channel = timer->Channel(); const cChannel *channel = timer->Channel();
int x = 0; int x = 0;
if (channel) { if (channel) {
int logoWidth = infoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int logoWidth = infoHeight * config.logoWidthRatio / config.logoHeightRatio;
bool logoDrawn = false; bool logoDrawn = false;
cImageLoader imgLoader; cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) { if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) { if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) {
cImage logo = imgLoader.GetImage(); cImage logo = imgLoader.GetImage();
pixmapTimerInfo->DrawImage(cPoint(0, 0), logo); pixmapTimerInfo->DrawImage(cPoint(0, 0), logo);
@ -2427,7 +2427,7 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
logoDrawn = true; logoDrawn = true;
} }
} }
if (tvguideConfig.hideChannelLogos || !logoDrawn) { if (config.hideChannelLogos || !logoDrawn) {
int channelNameWidth = fontSmall->Width(channel->Name()); int channelNameWidth = fontSmall->Width(channel->Name());
pixmapTimerInfo->DrawText(cPoint(10, (infoHeight - fontSmall->Height())/2), channel->Name(), colorText, clrTransparent, fontSmall); pixmapTimerInfo->DrawText(cPoint(10, (infoHeight - fontSmall->Height())/2), channel->Name(), colorText, clrTransparent, fontSmall);
x += channelNameWidth + 20; x += channelNameWidth + 20;

View File

@ -7,7 +7,7 @@
cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) { cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) {
eRecMenuState action = rmsInstantRecord; eRecMenuState action = rmsInstantRecord;
if (!timerActive) { if (!timerActive) {
if (tvguideConfig.instRecFolderMode == eFolderSelect) if (config.instRecFolderMode == eFolderSelect)
action = rmsInstantRecordFolder; action = rmsInstantRecordFolder;
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true)); AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
} else { } else {
@ -22,7 +22,7 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc
AddMenuItem(new cRecMenuItemButton(tr("Search Timers"), rmsSearchTimers, false, false, false, true)); AddMenuItem(new cRecMenuItemButton(tr("Search Timers"), rmsSearchTimers, false, false, false, true));
} }
if (tvguideConfig.instRecFolderMode == eFolderSelect) if (config.instRecFolderMode == eFolderSelect)
action = rmsSeriesTimerFolder; action = rmsSeriesTimerFolder;
else else
action = rmsSeriesTimer; action = rmsSeriesTimer;
@ -113,7 +113,7 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
#endif #endif
cString message; cString message;
bool eventHasTimer = false; bool eventHasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event; rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@ -426,7 +426,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat
AddMenuItemInitial(infoItem); AddMenuItemInitial(infoItem);
timerActive = false; timerActive = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = timer->Event(); rtMatch.event = timer->Event();
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@ -1148,8 +1148,8 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea
// --- cRecMenuSwitchTimer --------------------------------------------------------- // --- cRecMenuSwitchTimer ---------------------------------------------------------
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
switchMinsBefore = tvguideConfig.switchMinsBefore; switchMinsBefore = config.switchMinsBefore;
switchMode = tvguideConfig.switchMode; switchMode = config.switchMode;
SetWidthPercent(60); SetWidthPercent(60);
@ -1618,26 +1618,26 @@ cRecMenuFavorites::~cRecMenuFavorites(void) {
} }
void cRecMenuFavorites::CreateFavoritesMenuItems(void) { void cRecMenuFavorites::CreateFavoritesMenuItems(void) {
if (tvguideConfig.favWhatsOnNow) { if (config.favWhatsOnNow) {
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on now"), rmsFavoritesNow, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on now"), rmsFavoritesNow, false));
} }
if (tvguideConfig.favWhatsOnNext) { if (config.favWhatsOnNext) {
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on next"), rmsFavoritesNext, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on next"), rmsFavoritesNext, false));
} }
if (tvguideConfig.favUseTime1) { if (config.favUseTime1) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser1.c_str(), NiceTime(tvguideConfig.favTime1).c_str()); std::string desc = *cString::sprintf("%s (%s)", config.descUser1.c_str(), NiceTime(config.favTime1).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser1, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser1, false));
} }
if (tvguideConfig.favUseTime2) { if (config.favUseTime2) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser2.c_str(), NiceTime(tvguideConfig.favTime2).c_str()); std::string desc = *cString::sprintf("%s (%s)", config.descUser2.c_str(), NiceTime(config.favTime2).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser2, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser2, false));
} }
if (tvguideConfig.favUseTime3) { if (config.favUseTime3) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser3.c_str(), NiceTime(tvguideConfig.favTime3).c_str()); std::string desc = *cString::sprintf("%s (%s)", config.descUser3.c_str(), NiceTime(config.favTime3).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser3, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser3, false));
} }
if (tvguideConfig.favUseTime4) { if (config.favUseTime4) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser4.c_str(), NiceTime(tvguideConfig.favTime4).c_str()); std::string desc = *cString::sprintf("%s (%s)", config.descUser4.c_str(), NiceTime(config.favTime4).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser4, false)); myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser4, false));
} }

View File

@ -72,7 +72,7 @@ void cRecMenuView::SetBackground(void) {
int backgroundHeight = geoManager.osdHeight; int backgroundHeight = geoManager.osdHeight;
pixmapBackground = osdManager.requestPixmap(3, cRect(0, 0, backgroundWidth, backgroundHeight)); pixmapBackground = osdManager.requestPixmap(3, cRect(0, 0, backgroundWidth, backgroundHeight));
pixmapBackground->Fill(theme.Color(clrRecMenuBackground)); pixmapBackground->Fill(theme.Color(clrRecMenuBackground));
if (tvguideConfig.scaleVideo) { if (config.scaleVideo) {
int tvHeight = geoManager.statusHeaderHeight; int tvHeight = geoManager.statusHeaderHeight;
int tvWidth = tvHeight * 16 / 9; int tvWidth = tvHeight * 16 / 9;
int tvX = geoManager.osdWidth - tvWidth; int tvX = geoManager.osdWidth - tvWidth;
@ -844,22 +844,22 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
case rmsFavoritesUser1: { case rmsFavoritesUser1: {
int numResults = 0; int numResults = 0;
const cEvent **result = recManager->UserDefinedTime(1, numResults); const cEvent **result = recManager->UserDefinedTime(1, numResults);
DisplayFavoriteResults(tvguideConfig.descUser1, result, numResults); DisplayFavoriteResults(config.descUser1, result, numResults);
break; } break; }
case rmsFavoritesUser2: { case rmsFavoritesUser2: {
int numResults = 0; int numResults = 0;
const cEvent **result = recManager->UserDefinedTime(2, numResults); const cEvent **result = recManager->UserDefinedTime(2, numResults);
DisplayFavoriteResults(tvguideConfig.descUser2, result, numResults); DisplayFavoriteResults(config.descUser2, result, numResults);
break; } break; }
case rmsFavoritesUser3: { case rmsFavoritesUser3: {
int numResults = 0; int numResults = 0;
const cEvent **result = recManager->UserDefinedTime(3, numResults); const cEvent **result = recManager->UserDefinedTime(3, numResults);
DisplayFavoriteResults(tvguideConfig.descUser3, result, numResults); DisplayFavoriteResults(config.descUser3, result, numResults);
break; } break; }
case rmsFavoritesUser4: { case rmsFavoritesUser4: {
int numResults = 0; int numResults = 0;
const cEvent **result = recManager->UserDefinedTime(4, numResults); const cEvent **result = recManager->UserDefinedTime(4, numResults);
DisplayFavoriteResults(tvguideConfig.descUser4, result, numResults); DisplayFavoriteResults(config.descUser4, result, numResults);
break; } break; }
/********************************************************************************************** /**********************************************************************************************

208
setup.c
View File

@ -1,7 +1,7 @@
#include "setup.h" #include "setup.h"
cTvguideSetup::cTvguideSetup() { cTvguideSetup::cTvguideSetup() {
tmpConfig = tvguideConfig; tmpConfig = config;
Setup(); Setup();
} }
@ -9,8 +9,8 @@ cTvguideSetup::~cTvguideSetup() {
geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true); geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true);
fontManager.DeleteFonts(); fontManager.DeleteFonts();
fontManager.SetFonts(); fontManager.SetFonts();
tvguideConfig.LoadTheme(); config.LoadTheme();
tvguideConfig.setDynamicValues(); config.setDynamicValues();
imgCache.Clear(); imgCache.Clear();
imgCache.CreateCache(); imgCache.CreateCache();
} }
@ -56,104 +56,104 @@ eOSState cTvguideSetup::ProcessKey(eKeys Key) {
void cTvguideSetup::Store(void) { void cTvguideSetup::Store(void) {
tvguideConfig = tmpConfig; config = tmpConfig;
SetupStore("debugImageLoading", tvguideConfig.debugImageLoading); SetupStore("debugImageLoading", config.debugImageLoading);
SetupStore("useNopacityTheme", tvguideConfig.useNopacityTheme); SetupStore("useNopacityTheme", config.useNopacityTheme);
SetupStore("themeIndex", tvguideConfig.themeIndex); SetupStore("themeIndex", config.themeIndex);
SetupStore("showMainMenuEntry", tvguideConfig.showMainMenuEntry); SetupStore("showMainMenuEntry", config.showMainMenuEntry);
SetupStore("replaceOriginalSchedule", tvguideConfig.replaceOriginalSchedule); SetupStore("replaceOriginalSchedule", config.replaceOriginalSchedule);
SetupStore("displayMode", tvguideConfig.displayMode); SetupStore("displayMode", config.displayMode);
SetupStore("showTimeInGrid", tvguideConfig.showTimeInGrid); SetupStore("showTimeInGrid", config.showTimeInGrid);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader); SetupStore("displayStatusHeader", config.displayStatusHeader);
SetupStore("displayChannelGroups", tvguideConfig.displayChannelGroups); SetupStore("displayChannelGroups", config.displayChannelGroups);
SetupStore("displayTimeBase", tvguideConfig.displayTimeBase); SetupStore("displayTimeBase", config.displayTimeBase);
SetupStore("headerHeightPercent", tvguideConfig.headerHeightPercent); SetupStore("headerHeightPercent", config.headerHeightPercent);
SetupStore("channelGroupsPercent", tvguideConfig.channelGroupsPercent); SetupStore("channelGroupsPercent", config.channelGroupsPercent);
SetupStore("epgViewBorder", tvguideConfig.epgViewBorder); SetupStore("epgViewBorder", config.epgViewBorder);
SetupStore("scaleVideo", tvguideConfig.scaleVideo); SetupStore("scaleVideo", config.scaleVideo);
SetupStore("decorateVideo", tvguideConfig.decorateVideo); SetupStore("decorateVideo", config.decorateVideo);
SetupStore("roundedCorners", tvguideConfig.roundedCorners); SetupStore("roundedCorners", config.roundedCorners);
SetupStore("timeFormat", tvguideConfig.timeFormat); SetupStore("timeFormat", config.timeFormat);
SetupStore("channelCols", tvguideConfig.channelCols); SetupStore("channelCols", config.channelCols);
SetupStore("channelRows", tvguideConfig.channelRows); SetupStore("channelRows", config.channelRows);
SetupStore("displayTime", tvguideConfig.displayTime); SetupStore("displayTime", config.displayTime);
SetupStore("displayHorizontalTime", tvguideConfig.displayHorizontalTime); SetupStore("displayHorizontalTime", config.displayHorizontalTime);
SetupStore("bigStepHours", tvguideConfig.bigStepHours); SetupStore("bigStepHours", config.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours); SetupStore("hugeStepHours", config.hugeStepHours);
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode); SetupStore("channelJumpMode", config.channelJumpMode);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode); SetupStore("blueKeyMode", config.blueKeyMode);
SetupStore("numkeyMode", tvguideConfig.numkeyMode); SetupStore("numkeyMode", config.numkeyMode);
SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers); SetupStore("useRemoteTimers", config.useRemoteTimers);
SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch); SetupStore("closeOnSwitch", config.closeOnSwitch);
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup); SetupStore("hideLastGroup", config.hideLastGroup);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos); SetupStore("hideChannelLogos", config.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension); SetupStore("logoExtension", config.logoExtension);
SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio); SetupStore("logoWidthRatio", config.logoWidthRatio);
SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio); SetupStore("logoHeightRatio", config.logoHeightRatio);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages); SetupStore("hideEpgImages", config.hideEpgImages);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth); SetupStore("epgImageWidth", config.epgImageWidth);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight); SetupStore("epgImageHeight", config.epgImageHeight);
SetupStore("numAdditionalEPGPictures", tvguideConfig.numAdditionalEPGPictures); SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures);
SetupStore("epgImageWidthLarge", tvguideConfig.epgImageWidthLarge); SetupStore("epgImageWidthLarge", config.epgImageWidthLarge);
SetupStore("epgImageHeightLarge", tvguideConfig.epgImageHeightLarge); SetupStore("epgImageHeightLarge", config.epgImageHeightLarge);
SetupStore("detailedViewScrollStep", tvguideConfig.detailedViewScrollStep); SetupStore("detailedViewScrollStep", config.detailedViewScrollStep);
SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent); SetupStore("timeLineWidthPercent", config.timeLineWidthPercent);
SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent); SetupStore("timeLineHeightPercent", config.timeLineHeightPercent);
SetupStore("displayChannelName", tvguideConfig.displayChannelName); SetupStore("displayChannelName", config.displayChannelName);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent); SetupStore("channelHeaderWidthPercent", config.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent); SetupStore("channelHeaderHeightPercent", config.channelHeaderHeightPercent);
SetupStore("footerHeightPercent", tvguideConfig.footerHeightPercent); SetupStore("footerHeightPercent", config.footerHeightPercent);
SetupStore("instRecFolderMode", tvguideConfig.instRecFolderMode); SetupStore("instRecFolderMode", config.instRecFolderMode);
SetupStore("instRecFixedFolder", tvguideConfig.instRecFixedFolder.c_str()); SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str());
SetupStore("favWhatsOnNow", tvguideConfig.favWhatsOnNow); SetupStore("favWhatsOnNow", config.favWhatsOnNow);
SetupStore("favWhatsOnNext", tvguideConfig.favWhatsOnNext); SetupStore("favWhatsOnNext", config.favWhatsOnNext);
SetupStore("favUseTime1", tvguideConfig.favUseTime1); SetupStore("favUseTime1", config.favUseTime1);
SetupStore("favUseTime2", tvguideConfig.favUseTime2); SetupStore("favUseTime2", config.favUseTime2);
SetupStore("favUseTime3", tvguideConfig.favUseTime3); SetupStore("favUseTime3", config.favUseTime3);
SetupStore("favUseTime4", tvguideConfig.favUseTime4); SetupStore("favUseTime4", config.favUseTime4);
SetupStore("favTime1", tvguideConfig.favTime1); SetupStore("favTime1", config.favTime1);
SetupStore("favTime2", tvguideConfig.favTime2); SetupStore("favTime2", config.favTime2);
SetupStore("favTime3", tvguideConfig.favTime3); SetupStore("favTime3", config.favTime3);
SetupStore("favTime4", tvguideConfig.favTime4); SetupStore("favTime4", config.favTime4);
SetupStore("descUser1", tvguideConfig.descUser1.c_str()); SetupStore("descUser1", config.descUser1.c_str());
SetupStore("descUser2", tvguideConfig.descUser2.c_str()); SetupStore("descUser2", config.descUser2.c_str());
SetupStore("descUser3", tvguideConfig.descUser3.c_str()); SetupStore("descUser3", config.descUser3.c_str());
SetupStore("descUser4", tvguideConfig.descUser4.c_str()); SetupStore("descUser4", config.descUser4.c_str());
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels); SetupStore("favLimitChannels", config.favLimitChannels);
SetupStore("favStartChannel", tvguideConfig.favStartChannel); SetupStore("favStartChannel", config.favStartChannel);
SetupStore("favStopChannel", tvguideConfig.favStopChannel); SetupStore("favStopChannel", config.favStopChannel);
SetupStore("switchMode", tvguideConfig.switchMode); SetupStore("switchMode", config.switchMode);
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore); SetupStore("switchMinsBefore", config.switchMinsBefore);
SetupStore("fontIndex", tvguideConfig.fontIndex); SetupStore("fontIndex", config.fontIndex);
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta); SetupStore("FontButtonDelta", config.FontButtonDelta);
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta); SetupStore("FontDetailViewDelta", config.FontDetailViewDelta);
SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta); SetupStore("FontDetailHeaderDelta", config.FontDetailHeaderDelta);
SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta); SetupStore("FontMessageBoxDelta", config.FontMessageBoxDelta);
SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta); SetupStore("FontMessageBoxLargeDelta", config.FontMessageBoxLargeDelta);
SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta); SetupStore("FontStatusHeaderDelta", config.FontStatusHeaderDelta);
SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta); SetupStore("FontStatusHeaderLargeDelta", config.FontStatusHeaderLargeDelta);
SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta); SetupStore("FontChannelHeaderDelta", config.FontChannelHeaderDelta);
SetupStore("FontChannelGroupsDelta", tvguideConfig.FontChannelGroupsDelta); SetupStore("FontChannelGroupsDelta", config.FontChannelGroupsDelta);
SetupStore("FontGridDelta", tvguideConfig.FontGridDelta); SetupStore("FontGridDelta", config.FontGridDelta);
SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta); SetupStore("FontGridSmallDelta", config.FontGridSmallDelta);
SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta); SetupStore("FontTimeLineWeekdayDelta", config.FontTimeLineWeekdayDelta);
SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta); SetupStore("FontTimeLineDateDelta", config.FontTimeLineDateDelta);
SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta); SetupStore("FontTimeLineTimeDelta", config.FontTimeLineTimeDelta);
SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta); SetupStore("FontChannelHeaderHorizontalDelta", config.FontChannelHeaderHorizontalDelta);
SetupStore("FontChannelGroupsHorizontalDelta", tvguideConfig.FontChannelGroupsHorizontalDelta); SetupStore("FontChannelGroupsHorizontalDelta", config.FontChannelGroupsHorizontalDelta);
SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta); SetupStore("FontGridHorizontalDelta", config.FontGridHorizontalDelta);
SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta); SetupStore("FontGridHorizontalSmallDelta", config.FontGridHorizontalSmallDelta);
SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta); SetupStore("FontTimeLineDateHorizontalDelta", config.FontTimeLineDateHorizontalDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta); SetupStore("FontTimeLineTimeHorizontalDelta", config.FontTimeLineTimeHorizontalDelta);
SetupStore("FontRecMenuItemDelta", tvguideConfig.FontRecMenuItemDelta); SetupStore("FontRecMenuItemDelta", config.FontRecMenuItemDelta);
SetupStore("FontRecMenuItemSmallDelta", tvguideConfig.FontRecMenuItemSmallDelta); SetupStore("FontRecMenuItemSmallDelta", config.FontRecMenuItemSmallDelta);
SetupStore("FontRecMenuItemLargeDelta", tvguideConfig.FontRecMenuItemLargeDelta); SetupStore("FontRecMenuItemLargeDelta", config.FontRecMenuItemLargeDelta);
SetupStore("displayRerunsDetailEPGView", tvguideConfig.displayRerunsDetailEPGView); SetupStore("displayRerunsDetailEPGView", config.displayRerunsDetailEPGView);
SetupStore("numReruns", tvguideConfig.numReruns); SetupStore("numReruns", config.numReruns);
SetupStore("useSubtitleRerun", tvguideConfig.useSubtitleRerun); SetupStore("useSubtitleRerun", config.useSubtitleRerun);
SetupStore("numLogosInitial", tvguideConfig.numLogosInitial); SetupStore("numLogosInitial", config.numLogosInitial);
SetupStore("numLogosMax", tvguideConfig.numLogosMax); SetupStore("numLogosMax", config.numLogosMax);
SetupStore("limitLogoCache", tvguideConfig.limitLogoCache); SetupStore("limitLogoCache", config.limitLogoCache);
} }
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 40) { cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 40) {
@ -299,7 +299,7 @@ void cMenuSetupScreenLayout::Set(void) {
Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpConfig->displayTimeBase)); Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpConfig->displayTimeBase));
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpConfig->hideChannelLogos, 2, hideChannelLogosItems)); Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpConfig->hideChannelLogos) { if (!tmpConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath)); Add(InfoItem(tr("Logo Path used"), *config.logoPath));
Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpConfig->logoExtension, 2, logoExtensionItems)); Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpConfig->logoExtension, 2, logoExtensionItems));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo width ratio")), &tmpConfig->logoWidthRatio, 1, 1000)); Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo width ratio")), &tmpConfig->logoWidthRatio, 1, 1000));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo height ratio")), &tmpConfig->logoHeightRatio, 1, 1000)); Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo height ratio")), &tmpConfig->logoHeightRatio, 1, 1000));
@ -309,7 +309,7 @@ void cMenuSetupScreenLayout::Set(void) {
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpConfig->hideEpgImages, 2, hideChannelLogosItems)); Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpConfig->hideEpgImages, 2, hideChannelLogosItems));
if (!tmpConfig->hideEpgImages) { if (!tmpConfig->hideEpgImages) {
Add(InfoItem(tr("EPG Images Path used"), *tvguideConfig.epgImagePath)); Add(InfoItem(tr("EPG Images Path used"), *config.epgImagePath));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image width")), &tmpConfig->epgImageWidth, 0, 800)); Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image width")), &tmpConfig->epgImageWidth, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image height")), &tmpConfig->epgImageHeight, 0, 800)); Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image height")), &tmpConfig->epgImageHeight, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of additional EPG Images")), &tmpConfig->numAdditionalEPGPictures, 0, 20)); Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of additional EPG Images")), &tmpConfig->numAdditionalEPGPictures, 0, 20));
@ -346,7 +346,7 @@ eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) { cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) {
cFont::GetAvailableFontNames(&fontNames); cFont::GetAvailableFontNames(&fontNames);
fontNames.Insert(strdup(tvguideConfig.fontNameDefault)); fontNames.Insert(strdup(config.fontNameDefault));
Set(); Set();
} }

View File

@ -4,6 +4,8 @@
#include <vdr/menuitems.h> #include <vdr/menuitems.h>
#include "config.h" #include "config.h"
extern cTvguideConfig config;
class cTvguideSetup : public cMenuSetupPage { class cTvguideSetup : public cMenuSetupPage {
public: public:
cTvguideSetup(void); cTvguideSetup(void);

View File

@ -17,7 +17,7 @@ cStatusHeader::cStatusHeader(void) {
cStatusHeader::~cStatusHeader(void) { cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText); osdManager.releasePixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame); osdManager.releasePixmap(pixmapTVFrame);
if (tvguideConfig.scaleVideo) { if (config.scaleVideo) {
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null);
cDevice::PrimaryDevice()->ScaleVideo(vidWin); cDevice::PrimaryDevice()->ScaleVideo(vidWin);
} }
@ -26,8 +26,8 @@ cStatusHeader::~cStatusHeader(void) {
void cStatusHeader::Draw(void) { void cStatusHeader::Draw(void) {
pixmapText->Fill(clrTransparent); pixmapText->Fill(clrTransparent);
pixmapTVFrame->Fill(clrTransparent); pixmapTVFrame->Fill(clrTransparent);
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
if (tvguideConfig.scaleVideo) { if (config.scaleVideo) {
drawBackgroundGraphical(bgStatusHeaderWindowed); drawBackgroundGraphical(bgStatusHeaderWindowed);
cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame); cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame);
if (tvFrameBack) if (tvFrameBack)
@ -36,7 +36,7 @@ void cStatusHeader::Draw(void) {
drawBackgroundGraphical(bgStatusHeaderFull); drawBackgroundGraphical(bgStatusHeaderFull);
} }
} else { } else {
if (tvguideConfig.decorateVideo) { if (config.decorateVideo) {
DecorateVideoFrame(); DecorateVideoFrame();
} }
drawBackground(); drawBackground();
@ -45,7 +45,7 @@ void cStatusHeader::Draw(void) {
} }
void cStatusHeader::ScaleVideo(void) { void cStatusHeader::ScaleVideo(void) {
if (tvguideConfig.scaleVideo) { if (config.scaleVideo) {
int width = height * 16 / 9; int width = height * 16 / 9;
int x = osdManager.Left() + geoManager.osdWidth - width; int x = osdManager.Left() + geoManager.osdWidth - width;
int y = osdManager.Top(); int y = osdManager.Top();
@ -59,7 +59,7 @@ void cStatusHeader::DrawInfoText(cGrid *grid) {
int border = 10; int border = 10;
int textWidth = 0; int textWidth = 0;
textWidth = width - 2 * border; textWidth = width - 2 * border;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
pixmapText->Fill(clrTransparent); pixmapText->Fill(clrTransparent);
int x = border; int x = border;
int y = border; int y = border;

View File

@ -22,9 +22,9 @@ void cStyledPixmap::setPixmap(cPixmap *pixmap) {
} }
void cStyledPixmap::drawBackground() { void cStyledPixmap::drawBackground() {
if (tvguideConfig.style == eStyleBlendingDefault){ if (config.style == eStyleBlendingDefault){
drawBlendedBackground(); drawBlendedBackground();
} else if (tvguideConfig.style == eStyleBlendingMagick){ } else if (config.style == eStyleBlendingMagick){
drawSparsedBackground(); drawSparsedBackground();
} else { } else {
pixmap->Fill(color); pixmap->Fill(color);
@ -129,7 +129,7 @@ void cStyledPixmap::drawBorder() {
int height = pixmap->ViewPort().Height(); int height = pixmap->ViewPort().Height();
drawDefaultBorder(width, height); drawDefaultBorder(width, height);
if (tvguideConfig.roundedCorners) { if (config.roundedCorners) {
int borderRadius = 12; int borderRadius = 12;
drawRoundedCorners(width, height, borderRadius); drawRoundedCorners(width, height, borderRadius);
} }

View File

@ -6,15 +6,13 @@ cSwitchTimers SwitchTimers;
cSwitchTimer::cSwitchTimer(void) { cSwitchTimer::cSwitchTimer(void) {
eventID = 0; eventID = 0;
startTime = 0; startTime = 0;
switchMinsBefore = tvguideConfig.switchMinsBefore; switchMinsBefore = config.switchMinsBefore;
switchMode = tvguideConfig.switchMode; switchMode = config.switchMode;
} }
cSwitchTimer::cSwitchTimer(const cEvent* Event) { cSwitchTimer::cSwitchTimer(const cEvent* Event) {
eventID = 0; eventID = 0;
startTime = 0; startTime = 0;
// switchMinsBefore = tvguideConfig.switchMinsBefore;
// switchModes = tvguideConfig.switchModes;
if (Event) { if (Event) {
eventID = Event->EventID(); eventID = Event->EventID();
channelID = Event->ChannelID(); channelID = Event->ChannelID();

View File

@ -3,7 +3,7 @@
cTimeLine::cTimeLine(cMyTime *myTime) { cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime; this->myTime = myTime;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0, dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight + geoManager.clockHeight, geoManager.statusHeaderHeight + geoManager.clockHeight,
geoManager.dateVieverWidth, geoManager.dateVieverWidth,
@ -20,7 +20,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight, geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,
geoManager.osdWidth, geoManager.osdWidth,
geoManager.timeLineGridHeight)); geoManager.timeLineGridHeight));
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth, dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
geoManager.dateVieverWidth, geoManager.dateVieverWidth,
@ -36,12 +36,12 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
timeBase = osdManager.requestPixmap(3, cRect(geoManager.channelGroupsWidth + geoManager.channelHeaderWidth, timeBase = osdManager.requestPixmap(3, cRect(geoManager.channelGroupsWidth + geoManager.channelHeaderWidth,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
geoManager.timeLineGridWidth, geoManager.timeLineGridWidth,
geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight)); geoManager.timeLineHeight + config.channelRows * geoManager.rowHeight));
} }
timeBase->Fill(clrTransparent); timeBase->Fill(clrTransparent);
int clockY; int clockY;
int clockX; int clockX;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
clockY = geoManager.statusHeaderHeight; clockY = geoManager.statusHeaderHeight;
clockX = 0; clockX = 0;
} }
@ -65,7 +65,7 @@ cTimeLine::~cTimeLine(void) {
void cTimeLine::drawDateViewer() { void cTimeLine::drawDateViewer() {
cString weekDay = myTime->GetWeekday(); cString weekDay = myTime->GetWeekday();
cString date = myTime->GetDate(); cString date = myTime->GetDate();
if (tvguideConfig.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground(); dateViewer->drawBackground();
dateViewer->drawBorder(); dateViewer->drawBorder();
@ -78,9 +78,9 @@ void cTimeLine::drawDateViewer() {
dateViewer->Fill(clrTransparent); dateViewer->Fill(clrTransparent);
} }
tColor colorFont = theme.Color(clrButtonYellow); tColor colorFont = theme.Color(clrButtonYellow);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent; tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
int textHeightWeekday = fontManager.FontTimeLineWeekday->Height(); int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
int textHeightDate = fontManager.FontTimeLineDate->Height(); int textHeightDate = fontManager.FontTimeLineDate->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay); int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
@ -88,7 +88,7 @@ void cTimeLine::drawDateViewer() {
int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2); int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday); dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate); dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date); cString strDate = cString::sprintf("%s %s", *weekDay, *date);
int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2); int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2);
int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2); int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2);
@ -105,7 +105,7 @@ void cTimeLine::drawTimeline() {
int imgHeight = geoManager.timeLineGridHeight; int imgHeight = geoManager.timeLineGridHeight;
const cImage *img1 = NULL; const cImage *img1 = NULL;
const cImage *img2 = NULL; const cImage *img2 = NULL;
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
img1 = imgCache.GetOsdElement(oeTimeline1); img1 = imgCache.GetOsdElement(oeTimeline1);
img2 = imgCache.GetOsdElement(oeTimeline2); img2 = imgCache.GetOsdElement(oeTimeline2);
} else { } else {
@ -122,8 +122,8 @@ void cTimeLine::drawTimeline() {
if (i%2==0) { if (i%2==0) {
img = img1; img = img1;
colorFont = theme.Color(clrTimeline2); colorFont = theme.Color(clrTimeline2);
colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent; colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) { if (config.timeFormat == e12Hours) {
if (i == 0) if (i == 0)
sprintf(timetext, "12:00 PM"); sprintf(timetext, "12:00 PM");
else if (i/2 < 13) else if (i/2 < 13)
@ -136,8 +136,8 @@ void cTimeLine::drawTimeline() {
} else { } else {
img = img2; img = img2;
colorFont = theme.Color(clrTimeline1); colorFont = theme.Color(clrTimeline1);
colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent; colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) { if (config.timeFormat == e12Hours) {
if (i == 1) if (i == 1)
sprintf(timetext, "12:30 PM"); sprintf(timetext, "12:30 PM");
else if (i/2 < 13) else if (i/2 < 13)
@ -148,25 +148,25 @@ void cTimeLine::drawTimeline() {
sprintf(timetext, "%d:30", i/2); sprintf(timetext, "%d:30", i/2);
} }
} }
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
posY = i*geoManager.minutePixel*30; posY = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(0, posY), *img); timeline->DrawImage(cPoint(0, posY), *img);
if (tvguideConfig.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
decorateTile(0, posY, imgWidth+2, imgHeight); decorateTile(0, posY, imgWidth+2, imgHeight);
} }
textWidth = fontManager.FontTimeLineTime->Width(timetext); textWidth = fontManager.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime); timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
posX = i*geoManager.minutePixel*30; posX = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(posX, 0), *img); timeline->DrawImage(cPoint(posX, 0), *img);
if (tvguideConfig.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
decorateTile(posX, 0, imgWidth, imgHeight+2); decorateTile(posX, 0, imgWidth, imgHeight+2);
} }
timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal); timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal);
} }
} }
setTimeline(); setTimeline();
if (tvguideConfig.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
delete img1; delete img1;
delete img2; delete img2;
} }
@ -183,7 +183,7 @@ void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight)
timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder)); //bottom timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder)); //bottom
timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //right timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //right
if (tvguideConfig.roundedCorners) { if (config.roundedCorners) {
int borderRadius = 12; int borderRadius = 12;
drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius); drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius);
} }
@ -211,7 +211,7 @@ void cTimeLine::drawCurrentTimeBase(void) {
if (!nowVisible) if (!nowVisible)
return; return;
int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel; int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase)); timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase));
} else { } else {
timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase)); timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
@ -221,7 +221,7 @@ void cTimeLine::drawCurrentTimeBase(void) {
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL; cImage *image = NULL;
if (tvguideConfig.style == eStyleBlendingDefault) { if (config.style == eStyleBlendingDefault) {
image = new cImage(cSize(width, height)); image = new cImage(cSize(width, height));
image->Fill(clrBgr); image->Fill(clrBgr);
int stepY = 0.5*height / 64; int stepY = 0.5*height / 64;
@ -236,7 +236,7 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t
} }
alpha += 0x04; alpha += 0x04;
} }
} else if (tvguideConfig.style == eStyleBlendingMagick) { } else if (config.style == eStyleBlendingMagick) {
cImageLoader imgLoader; cImageLoader imgLoader;
if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) { if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) {
image = new cImage(imgLoader.GetImage()); image = new cImage(imgLoader.GetImage());
@ -251,27 +251,27 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t
void cTimeLine::setTimeline() { void cTimeLine::setTimeline() {
int offset = myTime->GetTimelineOffset(); int offset = myTime->GetTimelineOffset();
int xNew, yNew; int xNew, yNew;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
xNew = 0; xNew = 0;
yNew = -offset*geoManager.minutePixel; yNew = -offset*geoManager.minutePixel;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
xNew = -offset*geoManager.minutePixel; xNew = -offset*geoManager.minutePixel;
yNew = 0; yNew = 0;
} }
timeline->SetDrawPortPoint(cPoint(xNew, yNew)); timeline->SetDrawPortPoint(cPoint(xNew, yNew));
if (tvguideConfig.displayTimeBase) if (config.displayTimeBase)
drawCurrentTimeBase(); drawCurrentTimeBase();
} }
void cTimeLine::drawClock() { void cTimeLine::drawClock() {
if (tvguideConfig.displayMode == eVertical) if (config.displayMode == eVertical)
clock->Fill(clrTransparent); clock->Fill(clrTransparent);
cString currentTime = myTime->GetCurrentTime(); cString currentTime = myTime->GetCurrentTime();
const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal; const cFont *font = (config.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal;
int textHeight = font->Height(); int textHeight = font->Height();
int clockTextWidth = font->Width(*currentTime); int clockTextWidth = font->Width(*currentTime);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; tColor colorFontBack = (config.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
clock->drawBackgroundGraphical(bgClock); clock->drawBackgroundGraphical(bgClock);
} else { } else {
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));

12
timer.c
View File

@ -18,9 +18,9 @@ void cMyTime::Now() {
t = time(0); t = time(0);
tStart = t; tStart = t;
tStart = GetRounded(); tStart = GetRounded();
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60; tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60; tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
} }
} }
@ -41,9 +41,9 @@ bool cMyTime::DelStep(int step) {
void cMyTime::SetTime(time_t newTime) { void cMyTime::SetTime(time_t newTime) {
tStart = newTime; tStart = newTime;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60; tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60; tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
} }
} }
@ -84,9 +84,9 @@ cString cMyTime::GetCurrentTime() {
t = time(0); t = time(0);
tm *st = localtime(&t); tm *st = localtime(&t);
//snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min); //snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
if (tvguideConfig.timeFormat == e12Hours) { if (config.timeFormat == e12Hours) {
strftime(buf, sizeof(buf), "%I:%M %p", st); strftime(buf, sizeof(buf), "%I:%M %p", st);
} else if (tvguideConfig.timeFormat == e24Hours) } else if (config.timeFormat == e24Hours)
strftime(buf, sizeof(buf), "%H:%M", st); strftime(buf, sizeof(buf), "%H:%M", st);
return buf; return buf;

View File

@ -45,7 +45,7 @@ public:
virtual void MainThreadHook(void); virtual void MainThreadHook(void);
virtual cString Active(void); virtual cString Active(void);
virtual time_t WakeupTime(void); virtual time_t WakeupTime(void);
virtual const char *MainMenuEntry(void) { return (tvguideConfig.showMainMenuEntry)?MAINMENUENTRY:NULL; } virtual const char *MainMenuEntry(void) { return (config.showMainMenuEntry) ? MAINMENUENTRY : NULL; }
virtual cOsdObject *MainMenuAction(void); virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void); virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value); virtual bool SetupParse(const char *Name, const char *Value);
@ -78,13 +78,13 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) {
while ((c = getopt_long(argc, argv, "e:i:l:", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "e:i:l:", long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'e': case 'e':
tvguideConfig.SetImagesPath(cString(optarg)); config.SetImagesPath(cString(optarg));
break; break;
case 'i': case 'i':
tvguideConfig.SetIconsPath(cString(optarg)); config.SetIconsPath(cString(optarg));
break; break;
case 'l': case 'l':
tvguideConfig.SetLogoPath(cString(optarg)); config.SetLogoPath(cString(optarg));
break; break;
default: default:
return false; return false;
@ -94,10 +94,10 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) {
} }
bool cPluginTvguide::Initialize(void) { bool cPluginTvguide::Initialize(void) {
tvguideConfig.SetDefaultPathes(); config.SetDefaultPathes();
tvguideConfig.LoadTheme(); config.LoadTheme();
tvguideConfig.SetStyle(); config.SetStyle();
tvguideConfig.setDynamicValues(); config.setDynamicValues();
geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight());
fontManager.SetFonts(); fontManager.SetFonts();
imgCache.CreateCache(); imgCache.CreateCache();
@ -134,11 +134,11 @@ cMenuSetupPage *cPluginTvguide::SetupMenu(void) {
} }
bool cPluginTvguide::SetupParse(const char *Name, const char *Value) { bool cPluginTvguide::SetupParse(const char *Name, const char *Value) {
return tvguideConfig.SetupParse(Name, Value); return config.SetupParse(Name, Value);
} }
bool cPluginTvguide::Service(const char *Id, void *Data) { bool cPluginTvguide::Service(const char *Id, void *Data) {
if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && tvguideConfig.replaceOriginalSchedule != 0) { if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && config.replaceOriginalSchedule != 0) {
if (Data == NULL) if (Data == NULL)
return true; return true;
cOsdObject **guide = (cOsdObject**) Data; cOsdObject **guide = (cOsdObject**) Data;

View File

@ -22,7 +22,7 @@ cTvGuideOsd::cTvGuideOsd(void) {
cTvGuideOsd::~cTvGuideOsd() { cTvGuideOsd::~cTvGuideOsd() {
delete myTime; delete myTime;
columns.Clear(); columns.Clear();
if (tvguideConfig.displayStatusHeader) { if (config.displayStatusHeader) {
delete statusHeader; delete statusHeader;
} }
if (detailView) if (detailView)
@ -41,9 +41,9 @@ void cTvGuideOsd::Show(void) {
bool ok = false; bool ok = false;
ok = osdManager.setOsd(); ok = osdManager.setOsd();
if (ok) { if (ok) {
bool themeChanged = tvguideConfig.LoadTheme(); bool themeChanged = config.LoadTheme();
tvguideConfig.SetStyle(); config.SetStyle();
tvguideConfig.setDynamicValues(); config.setDynamicValues();
bool geoChanged = geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); bool geoChanged = geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight());
if (themeChanged || geoChanged) { if (themeChanged || geoChanged) {
fontManager.DeleteFonts(); fontManager.DeleteFonts();
@ -60,7 +60,7 @@ void cTvGuideOsd::Show(void) {
if (pRemoteTimers) { if (pRemoteTimers) {
isyslog("tvguide: remotetimers-plugin is available"); isyslog("tvguide: remotetimers-plugin is available");
} }
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
cString errorMsg; cString errorMsg;
if (!pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg)) { if (!pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg)) {
esyslog("tvguide: %s", *errorMsg); esyslog("tvguide: %s", *errorMsg);
@ -73,7 +73,7 @@ void cTvGuideOsd::Show(void) {
void cTvGuideOsd::drawOsd() { void cTvGuideOsd::drawOsd() {
cPixmap::Lock(); cPixmap::Lock();
int numBack = tvguideConfig.numGrids / 2; int numBack = config.numGrids / 2;
int offset = 0; int offset = 0;
const cChannel *newStartChannel; const cChannel *newStartChannel;
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
@ -106,7 +106,7 @@ void cTvGuideOsd::drawOsd() {
if (offset < 0) if (offset < 0)
offset = 0; offset = 0;
if (tvguideConfig.displayStatusHeader) { if (config.displayStatusHeader) {
statusHeader = new cStatusHeader(); statusHeader = new cStatusHeader();
statusHeader->Draw(); statusHeader->Draw();
statusHeader->ScaleVideo(); statusHeader->ScaleVideo();
@ -120,7 +120,7 @@ void cTvGuideOsd::drawOsd() {
footer = new cFooter(channelGroups); footer = new cFooter(channelGroups);
recMenuView->SetFooter(footer); recMenuView->SetFooter(footer);
footer->drawRedButton(); footer->drawRedButton();
if (tvguideConfig.channelJumpMode == eNumJump) { if (config.channelJumpMode == eNumJump) {
footer->drawGreenButton(); footer->drawGreenButton();
footer->drawYellowButton(); footer->drawYellowButton();
} }
@ -160,14 +160,14 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
delete column; delete column;
} }
} }
if (i == tvguideConfig.numGrids) { if (i == config.numGrids) {
foundEnough = true; foundEnough = true;
break; break;
} }
} }
if (!foundEnough) { if (!foundEnough) {
int numCurrent = columns.Count(); int numCurrent = columns.Count();
int numBack = tvguideConfig.numGrids - numCurrent; int numBack = config.numGrids - numCurrent;
int newChannelNumber = columns.First()->getChannel()->Number() - numBack; int newChannelNumber = columns.First()->getChannel()->Number() - numBack;
const cChannel *newStart = channels->GetByNumber(newChannelNumber); const cChannel *newStart = channels->GetByNumber(newChannelNumber);
readChannels(newStart); readChannels(newStart);
@ -180,13 +180,13 @@ void cTvGuideOsd::drawGridsChannelJump(int offset) {
activeGrid = columns.Get(offset)->getActive(); activeGrid = columns.Get(offset)->getActive();
if (activeGrid) if (activeGrid)
activeGrid->SetActive(); activeGrid->SetActive();
if (tvguideConfig.displayStatusHeader) { if (config.displayStatusHeader) {
statusHeader->DrawInfoText(activeGrid); statusHeader->DrawInfoText(activeGrid);
} }
if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { if (activeGrid && (config.channelJumpMode == eGroupJump)) {
footer->UpdateGroupButtons(activeGrid->column->getChannel()); footer->UpdateGroupButtons(activeGrid->column->getChannel());
} }
if (tvguideConfig.displayChannelGroups) { if (config.displayChannelGroups) {
channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel());
} }
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
@ -213,7 +213,7 @@ void cTvGuideOsd::drawGridsTimeJump() {
if (activeGrid) { if (activeGrid) {
activeGrid->SetActive(); activeGrid->SetActive();
activeGrid->Draw(); activeGrid->Draw();
if (tvguideConfig.displayStatusHeader) { if (config.displayStatusHeader) {
statusHeader->DrawInfoText(activeGrid); statusHeader->DrawInfoText(activeGrid);
} }
} }
@ -228,7 +228,7 @@ void cTvGuideOsd::setNextActiveGrid(cGrid *next) {
activeGrid = next; activeGrid = next;
activeGrid->SetActive(); activeGrid->SetActive();
activeGrid->Draw(); activeGrid->Draw();
if (tvguideConfig.displayStatusHeader) { if (config.displayStatusHeader) {
statusHeader->DrawInfoText(activeGrid); statusHeader->DrawInfoText(activeGrid);
} }
} }
@ -252,7 +252,7 @@ void cTvGuideOsd::channelForward() {
if (channelGroups->IsInLastGroup(channelRight)) { if (channelGroups->IsInLastGroup(channelRight)) {
break; break;
} }
colRight = new cChannelColumn(tvguideConfig.numGrids - 1, channelRight, myTime); colRight = new cChannelColumn(config.numGrids - 1, channelRight, myTime);
if (colRight->readGrids()) { if (colRight->readGrids()) {
break; break;
} else { } else {
@ -263,7 +263,7 @@ void cTvGuideOsd::channelForward() {
} }
if (colRight) { if (colRight) {
colAdded = true; colAdded = true;
if (columns.Count() == tvguideConfig.numGrids) { if (columns.Count() == config.numGrids) {
cChannelColumn *cFirst = columns.First(); cChannelColumn *cFirst = columns.First();
columns.Del(cFirst); columns.Del(cFirst);
} }
@ -283,10 +283,10 @@ void cTvGuideOsd::channelForward() {
setNextActiveGrid(right); setNextActiveGrid(right);
} }
} }
if (tvguideConfig.displayChannelGroups && colAdded) { if (config.displayChannelGroups && colAdded) {
channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel());
} }
if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { if (activeGrid && (config.channelJumpMode == eGroupJump)) {
footer->UpdateGroupButtons(activeGrid->column->getChannel()); footer->UpdateGroupButtons(activeGrid->column->getChannel());
} }
osdManager.flush(); osdManager.flush();
@ -319,7 +319,7 @@ void cTvGuideOsd::channelBack() {
} }
if (colLeft) { if (colLeft) {
colAdded = true; colAdded = true;
if (columns.Count() == tvguideConfig.numGrids) { if (columns.Count() == config.numGrids) {
cChannelColumn *cLast = columns.Last(); cChannelColumn *cLast = columns.Last();
columns.Del(cLast); columns.Del(cLast);
} }
@ -340,11 +340,11 @@ void cTvGuideOsd::channelBack() {
setNextActiveGrid(left); setNextActiveGrid(left);
} }
} }
if (tvguideConfig.displayChannelGroups && colAdded) { if (config.displayChannelGroups && colAdded) {
channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel());
} }
if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { if (activeGrid && (config.channelJumpMode == eGroupJump)) {
footer->UpdateGroupButtons(activeGrid->column->getChannel()); footer->UpdateGroupButtons(activeGrid->column->getChannel());
} }
osdManager.flush(); osdManager.flush();
@ -371,7 +371,7 @@ void cTvGuideOsd::timeForward() {
} }
void cTvGuideOsd::ScrollForward() { void cTvGuideOsd::ScrollForward() {
myTime->AddStep(tvguideConfig.stepMinutes); myTime->AddStep(config.stepMinutes);
timeLine->drawDateViewer(); timeLine->drawDateViewer();
timeLine->drawClock(); timeLine->drawClock();
timeLine->setTimeline(); timeLine->setTimeline();
@ -404,7 +404,7 @@ void cTvGuideOsd::timeBack() {
} }
void cTvGuideOsd::ScrollBack() { void cTvGuideOsd::ScrollBack() {
bool tooFarInPast = myTime->DelStep(tvguideConfig.stepMinutes); bool tooFarInPast = myTime->DelStep(config.stepMinutes);
if (tooFarInPast) if (tooFarInPast)
return; return;
timeLine->drawDateViewer(); timeLine->drawDateViewer();
@ -421,9 +421,9 @@ void cTvGuideOsd::processKeyUp() {
if (!activeGrid) { if (!activeGrid) {
return; return;
} }
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
timeBack(); timeBack();
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
channelBack(); channelBack();
} }
} }
@ -432,9 +432,9 @@ void cTvGuideOsd::processKeyDown() {
if (!activeGrid) { if (!activeGrid) {
return; return;
} }
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
timeForward(); timeForward();
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
channelForward(); channelForward();
} }
} }
@ -442,9 +442,9 @@ void cTvGuideOsd::processKeyDown() {
void cTvGuideOsd::processKeyLeft() { void cTvGuideOsd::processKeyLeft() {
if (activeGrid == NULL) if (activeGrid == NULL)
return; return;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
channelBack(); channelBack();
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
timeBack(); timeBack();
} }
} }
@ -452,9 +452,9 @@ void cTvGuideOsd::processKeyLeft() {
void cTvGuideOsd::processKeyRight() { void cTvGuideOsd::processKeyRight() {
if (activeGrid == NULL) if (activeGrid == NULL)
return; return;
if (tvguideConfig.displayMode == eVertical) { if (config.displayMode == eVertical) {
channelForward(); channelForward();
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
timeForward(); timeForward();
} }
} }
@ -474,7 +474,7 @@ void cTvGuideOsd::processKeyGreen() {
int currentCol = activeGrid->column->GetNum(); int currentCol = activeGrid->column->GetNum();
const cChannel *prev = NULL; const cChannel *prev = NULL;
if (tvguideConfig.channelJumpMode == eGroupJump) { if (config.channelJumpMode == eGroupJump) {
int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel); int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel);
if (prevNum) { if (prevNum) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
@ -484,8 +484,8 @@ void cTvGuideOsd::processKeyGreen() {
prev = Channels.GetByNumber(prevNum); prev = Channels.GetByNumber(prevNum);
#endif #endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (config.channelJumpMode == eNumJump) {
int i = tvguideConfig.jumpChannels + 1; int i = config.jumpChannels + 1;
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) { for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) {
@ -503,7 +503,7 @@ void cTvGuideOsd::processKeyGreen() {
if (prev) { if (prev) {
readChannels(prev); readChannels(prev);
if (columns.Count() > 0) { if (columns.Count() > 0) {
if (tvguideConfig.channelJumpMode == eGroupJump) if (config.channelJumpMode == eGroupJump)
drawGridsChannelJump(); drawGridsChannelJump();
else else
drawGridsChannelJump(currentCol); drawGridsChannelJump(currentCol);
@ -520,7 +520,7 @@ void cTvGuideOsd::processKeyYellow() {
const cChannel *firstChannel = columns.First()->getChannel(); const cChannel *firstChannel = columns.First()->getChannel();
const cChannel *next = NULL; const cChannel *next = NULL;
if (tvguideConfig.channelJumpMode == eGroupJump) { if (config.channelJumpMode == eGroupJump) {
int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel); int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel);
if (nextNum) { if (nextNum) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
@ -530,7 +530,7 @@ void cTvGuideOsd::processKeyYellow() {
next = Channels.GetByNumber(nextNum); next = Channels.GetByNumber(nextNum);
#endif #endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (config.channelJumpMode == eNumJump) {
int i=0; int i=0;
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
@ -545,7 +545,7 @@ void cTvGuideOsd::processKeyYellow() {
next = channel; next = channel;
i++; i++;
} }
if (i == (tvguideConfig.jumpChannels+1)) { if (i == (config.jumpChannels+1)) {
break; break;
} }
} }
@ -553,7 +553,7 @@ void cTvGuideOsd::processKeyYellow() {
if (next) { if (next) {
readChannels(next); readChannels(next);
if (columns.Count() > 0) { if (columns.Count() > 0) {
if (tvguideConfig.channelJumpMode == eGroupJump) if (config.channelJumpMode == eGroupJump)
drawGridsChannelJump(); drawGridsChannelJump();
else else
drawGridsChannelJump(currentCol); drawGridsChannelJump(currentCol);
@ -563,22 +563,22 @@ void cTvGuideOsd::processKeyYellow() {
} }
eOSState cTvGuideOsd::processKeyBlue(bool *alreadyUnlocked) { eOSState cTvGuideOsd::processKeyBlue(bool *alreadyUnlocked) {
if (tvguideConfig.blueKeyMode == eBlueKeySwitch) { if (config.blueKeyMode == eBlueKeySwitch) {
return ChannelSwitch(alreadyUnlocked); return ChannelSwitch(alreadyUnlocked);
} else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { } else if (config.blueKeyMode == eBlueKeyEPG) {
DetailedEPG(); DetailedEPG();
} else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { } else if (config.blueKeyMode == eBlueKeyFavorites) {
recMenuView->StartFavorites(); recMenuView->StartFavorites();
} }
return osContinue; return osContinue;
} }
eOSState cTvGuideOsd::processKeyOk(bool *alreadyUnlocked) { eOSState cTvGuideOsd::processKeyOk(bool *alreadyUnlocked) {
if (tvguideConfig.blueKeyMode == eBlueKeySwitch) { if (config.blueKeyMode == eBlueKeySwitch) {
DetailedEPG(); DetailedEPG();
} else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { } else if (config.blueKeyMode == eBlueKeyEPG) {
return ChannelSwitch(alreadyUnlocked); return ChannelSwitch(alreadyUnlocked);
} else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { } else if (config.blueKeyMode == eBlueKeyFavorites) {
DetailedEPG(); DetailedEPG();
} }
return osContinue; return osContinue;
@ -592,7 +592,7 @@ eOSState cTvGuideOsd::ChannelSwitch(bool *alreadyUnlocked) {
cPixmap::Unlock(); cPixmap::Unlock();
*alreadyUnlocked = true; *alreadyUnlocked = true;
cDevice::PrimaryDevice()->SwitchChannel(currentChannel, true); cDevice::PrimaryDevice()->SwitchChannel(currentChannel, true);
if (tvguideConfig.closeOnSwitch) { if (config.closeOnSwitch) {
if (detailView) { if (detailView) {
delete detailView; delete detailView;
detailView = NULL; detailView = NULL;
@ -616,7 +616,7 @@ void cTvGuideOsd::DetailedEPG() {
} }
void cTvGuideOsd::processNumKey(int numKey) { void cTvGuideOsd::processNumKey(int numKey) {
if (tvguideConfig.numkeyMode == 0) { if (config.numkeyMode == 0) {
//timely jumps with 1,3,4,6,7,9 //timely jumps with 1,3,4,6,7,9
TimeJump(numKey); TimeJump(numKey);
} else { } else {
@ -628,23 +628,23 @@ void cTvGuideOsd::processNumKey(int numKey) {
void cTvGuideOsd::TimeJump(int mode) { void cTvGuideOsd::TimeJump(int mode) {
switch (mode) { switch (mode) {
case 1: { case 1: {
bool tooFarInPast = myTime->DelStep(tvguideConfig.bigStepHours*60); bool tooFarInPast = myTime->DelStep(config.bigStepHours*60);
if (tooFarInPast) if (tooFarInPast)
return; return;
} }
break; break;
case 3: { case 3: {
myTime->AddStep(tvguideConfig.bigStepHours*60); myTime->AddStep(config.bigStepHours*60);
} }
break; break;
case 4: { case 4: {
bool tooFarInPast = myTime->DelStep(tvguideConfig.hugeStepHours*60); bool tooFarInPast = myTime->DelStep(config.hugeStepHours*60);
if (tooFarInPast) if (tooFarInPast)
return; return;
} }
break; break;
case 6: { case 6: {
myTime->AddStep(tvguideConfig.hugeStepHours*60); myTime->AddStep(config.hugeStepHours*60);
} }
break; break;
case 7: { case 7: {
@ -734,13 +734,13 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
delete detailView; delete detailView;
detailView = NULL; detailView = NULL;
detailViewActive = false; detailViewActive = false;
if ((tvguideConfig.blueKeyMode == eBlueKeySwitch) || (tvguideConfig.blueKeyMode == eBlueKeyFavorites)) { if ((config.blueKeyMode == eBlueKeySwitch) || (config.blueKeyMode == eBlueKeyFavorites)) {
state = ChannelSwitch(&alreadyUnlocked); state = ChannelSwitch(&alreadyUnlocked);
} else { } else {
osdManager.flush(); osdManager.flush();
state = osContinue; state = osContinue;
} }
} else if ((Key & ~k_Repeat) == kOk && (tvguideConfig.blueKeyMode == eBlueKeyEPG)) { } else if ((Key & ~k_Repeat) == kOk && (config.blueKeyMode == eBlueKeyEPG)) {
delete detailView; delete detailView;
detailView = NULL; detailView = NULL;
detailViewActive = false; detailViewActive = false;

26
view.c
View File

@ -71,7 +71,7 @@ void cView::SetGeometry(void) {
scrollbarWidth = 40; scrollbarWidth = 40;
width = geoManager.osdWidth - scrollbarWidth; width = geoManager.osdWidth - scrollbarWidth;
height = geoManager.osdHeight; height = geoManager.osdHeight;
border = tvguideConfig.epgViewBorder; border = config.epgViewBorder;
headerWidth = geoManager.headerContentWidth; headerWidth = geoManager.headerContentWidth;
headerHeight = geoManager.epgViewHeaderHeight; headerHeight = geoManager.epgViewHeaderHeight;
if (tabbed) if (tabbed)
@ -89,8 +89,8 @@ void cView::DrawHeader(void) {
} }
pixmapHeader->Fill(clrTransparent); pixmapHeader->Fill(clrTransparent);
pixmapHeaderLogo->Fill(clrTransparent); pixmapHeaderLogo->Fill(clrTransparent);
if (tvguideConfig.style == eStyleGraphical) { if (config.style == eStyleGraphical) {
if (tvguideConfig.scaleVideo) { if (config.scaleVideo) {
pixmapHeader->drawBackgroundGraphical(bgStatusHeaderWindowed); pixmapHeader->drawBackgroundGraphical(bgStatusHeaderWindowed);
} else { } else {
pixmapHeader->drawBackgroundGraphical(bgStatusHeaderFull); pixmapHeader->drawBackgroundGraphical(bgStatusHeaderFull);
@ -101,9 +101,9 @@ void cView::DrawHeader(void) {
} }
//Channel Logo //Channel Logo
int logoHeight = 2 * headerHeight / 3; int logoHeight = 2 * headerHeight / 3;
int logoWidth = logoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int logoWidth = logoHeight * config.logoWidthRatio / config.logoHeightRatio;
int xText = border / 2; int xText = border / 2;
if (channel && !tvguideConfig.hideChannelLogos) { if (channel && !config.hideChannelLogos) {
cImageLoader imgLoader; cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) { if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) {
cImage logo = imgLoader.GetImage(); cImage logo = imgLoader.GetImage();
@ -125,7 +125,7 @@ void cView::DrawHeader(void) {
if (!event) if (!event)
return; return;
const cTimer *ti; const cTimer *ti;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event; rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@ -450,7 +450,7 @@ void cView::DrawScrollbar(void) {
cImage *cView::CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *cView::CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = new cImage(cSize(width, height)); cImage *image = new cImage(cSize(width, height));
image->Fill(clrBgr); image->Fill(clrBgr);
if (tvguideConfig.style != eStyleFlat) { if (config.style != eStyleFlat) {
int numSteps = 64; int numSteps = 64;
int alphaStep = 0x03; int alphaStep = 0x03;
if (height < 30) if (height < 30)
@ -485,7 +485,7 @@ bool cView::KeyUp(void) {
if (aktHeight >= 0) { if (aktHeight >= 0) {
return false; return false;
} }
int step = tvguideConfig.detailedViewScrollStep * font->Height(); int step = config.detailedViewScrollStep * font->Height();
int newY = aktHeight + step; int newY = aktHeight + step;
if (newY > 0) if (newY > 0)
newY = 0; newY = 0;
@ -503,7 +503,7 @@ bool cView::KeyDown(void) {
if (totalHeight - ((-1)*aktHeight) == screenHeight) { if (totalHeight - ((-1)*aktHeight) == screenHeight) {
return false; return false;
} }
int step = tvguideConfig.detailedViewScrollStep * font->Height(); int step = config.detailedViewScrollStep * font->Height();
int newY = aktHeight - step; int newY = aktHeight - step;
if ((-1)*newY > totalHeight - screenHeight) if ((-1)*newY > totalHeight - screenHeight)
newY = (-1)*(totalHeight - screenHeight); newY = (-1)*(totalHeight - screenHeight);
@ -540,9 +540,9 @@ void cEPGView::SetTabs(void) {
void cEPGView::CheckEPGImages(void) { void cEPGView::CheckEPGImages(void) {
if (eventID > 0) { if (eventID > 0) {
for (int i=1; i <= tvguideConfig.numAdditionalEPGPictures; i++) { for (int i=1; i <= config.numAdditionalEPGPictures; i++) {
cString epgimage; cString epgimage;
epgimage = cString::sprintf("%s%d_%d.jpg", *tvguideConfig.epgImagePath, eventID, i); epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePath, eventID, i);
FILE *fp = fopen(*epgimage, "r"); FILE *fp = fopen(*epgimage, "r");
if (fp) { if (fp) {
std::stringstream ss; std::stringstream ss;
@ -560,8 +560,8 @@ void cEPGView::CheckEPGImages(void) {
} }
void cEPGView::DrawImages(void) { void cEPGView::DrawImages(void) {
int imgWidth = tvguideConfig.epgImageWidthLarge; int imgWidth = config.epgImageWidthLarge;
int imgHeight = tvguideConfig.epgImageHeightLarge; int imgHeight = config.epgImageHeightLarge;
int totalHeight = numEPGPics * (imgHeight + border); int totalHeight = numEPGPics * (imgHeight + border);