summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-06-06 10:25:24 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-06-09 13:51:21 +0200
commitae00b6eba342735e52d888ba2b3b7a8a83e088c1 (patch)
treebf2742996f5354d62e1f861bbe726c8cd1d93470
parentba6738dc00d068e5c54aae1cc3c9a8ea93681a91 (diff)
downloadskin-nopacity-ae00b6eba342735e52d888ba2b3b7a8a83e088c1.tar.gz
skin-nopacity-ae00b6eba342735e52d888ba2b3b7a8a83e088c1.tar.bz2
Remove some unnessesary variable
channelX is always 0 channelWidth is always channelOsdWidth replayWidth is always replayOsdWidth replayHeight is always replayOsdHeight
-rw-r--r--displaychannelview.c26
-rw-r--r--displayreplay.c40
-rw-r--r--geometrymanager.c46
-rw-r--r--geometrymanager.h6
-rw-r--r--imagecache.c8
5 files changed, 60 insertions, 66 deletions
diff --git a/displaychannelview.c b/displaychannelview.c
index 840716a..f68ba51 100644
--- a/displaychannelview.c
+++ b/displaychannelview.c
@@ -64,50 +64,50 @@ cNopacityDisplayChannelView::~cNopacityDisplayChannelView(void) {
void cNopacityDisplayChannelView::CreatePixmaps(void) {
pixmapBackground = osd->CreatePixmap(1,
- cRect(geoManager->channelX,
+ cRect(0,
geoManager->channelTop,
- geoManager->channelWidth,
+ geoManager->channelOsdWidth,
geoManager->channelHeight)
);
pixmapTop = osd->CreatePixmap(5,
- cRect(geoManager->channelX,
+ cRect(0,
geoManager->channelTop,
- geoManager->channelWidth,
+ geoManager->channelOsdWidth,
geoManager->channelHeight)
);
pixmapLogo = osd->CreatePixmap(3,
- cRect(geoManager->channelX + geoManager->channelLogoX,
+ cRect(geoManager->channelLogoX,
geoManager->channelLogoY,
geoManager->channelLogoWidth,
geoManager->channelLogoHeight)
);
pixmapLogoBackground = osd->CreatePixmap(2,
- cRect(geoManager->channelX + geoManager->channelLogoBgX,
+ cRect(geoManager->channelLogoBgX,
geoManager->channelLogoBgY,
geoManager->channelLogoBgWidth,
geoManager->channelLogoBgHeight)
);
pixmapChannelName = osd->CreatePixmap(2,
- cRect(geoManager->channelX + geoManager->channelContentX,
+ cRect(geoManager->channelContentX,
geoManager->channelTop,
geoManager->channelChannelNameWidth,
geoManager->channelHeaderHeight)
);
pixmapDate = osd->CreatePixmap(2,
- cRect(geoManager->channelX + geoManager->channelContentX +
+ cRect(geoManager->channelContentX +
geoManager->channelChannelNameWidth,
geoManager->channelTop,
geoManager->channelDateWidth,
geoManager->channelHeaderHeight)
);
pixmapProgressBar = osd->CreatePixmap(2,
- cRect(geoManager->channelX + geoManager->channelContentX,
+ cRect(geoManager->channelContentX,
geoManager->channelTop + geoManager->channelHeaderHeight,
geoManager->channelContentWidth,
geoManager->channelProgressBarHeight)
);
pixmapEPGInfo = osd->CreatePixmap(2,
- cRect(geoManager->channelX + geoManager->channelContentX,
+ cRect(geoManager->channelContentX,
geoManager->channelTop + geoManager->channelHeaderHeight +
geoManager->channelProgressBarHeight,
geoManager->channelContentWidth,
@@ -184,7 +184,7 @@ void cNopacityDisplayChannelView::DrawBackground(void) {
int backgroundWidth;
if (config.GetValue("backgroundStyle") == bsFull) {
backgroundX = 0;
- backgroundWidth = geoManager->channelWidth;
+ backgroundWidth = geoManager->channelOsdWidth;
} else {
backgroundX = geoManager->channelContentX;
backgroundWidth = geoManager->channelContentWidth;
@@ -536,7 +536,7 @@ void cNopacityDisplayChannelView::DrawPoster(const cEvent *event, bool initial)
}
void cNopacityDisplayChannelView::DrawSignalMeter(void) {
- signalWidth = geoManager->channelWidth * 0.15;
+ signalWidth = geoManager->channelOsdWidth * 0.15;
signalHeight = signalWidth * 15 / 200;
cFont *fontInfoline = cFont::CreateFont(config.fontName, signalHeight - 2);
cString signalStrength = "STR";
@@ -764,7 +764,7 @@ void cNopacityDisplayChannelView::DisplayMessage(eMessageType Type, const char *
if (!Text)
return;
messageBox = new cNopacityMessageBox(osd,
- cRect((geoManager->channelWidth - geoManager->messageWidth) / 2,
+ cRect((geoManager->channelOsdWidth - geoManager->messageWidth) / 2,
geoManager->channelTop + geoManager->channelHeight - geoManager->messageHeight - 20,
geoManager->messageWidth, geoManager->messageHeight),
Type, Text);
diff --git a/displayreplay.c b/displayreplay.c
index 2c1350f..49d9366 100644
--- a/displayreplay.c
+++ b/displayreplay.c
@@ -55,19 +55,19 @@ cNopacityDisplayReplay::~cNopacityDisplayReplay() {
}
void cNopacityDisplayReplay::createOSD(void) {
- osd = CreateOsd(geoManager->replayOsdLeft, geoManager->replayOsdTop, geoManager->replayWidth, geoManager->replayHeight);
+ osd = CreateOsd(geoManager->replayOsdLeft, geoManager->replayOsdTop, geoManager->replayOsdWidth, geoManager->replayOsdHeight);
}
void cNopacityDisplayReplay::CreatePixmaps(void) {
if (!modeOnly) {
pixmapBackground = osd->CreatePixmap(1, cRect(0,
0,
- geoManager->replayWidth,
- geoManager->replayHeight));
+ geoManager->replayOsdWidth,
+ geoManager->replayOsdHeight));
pixmapTop = osd->CreatePixmap(5, cRect(0,
0,
- geoManager->replayWidth,
- geoManager->replayHeight));
+ geoManager->replayOsdWidth,
+ geoManager->replayOsdHeight));
pixmapInfo = osd->CreatePixmap(2, cRect(0,
0,
geoManager->replayInfoWidth,
@@ -83,19 +83,19 @@ void cNopacityDisplayReplay::CreatePixmaps(void) {
pixmapProgressBar = osd->CreatePixmap(2, cRect(0,
geoManager->replayHeaderHeight
+ geoManager->replayInfo2Height,
- geoManager->replayWidth,
+ geoManager->replayOsdWidth,
geoManager->replayProgressBarHeight));
pixmapCurrent = osd->CreatePixmap(3, cRect(0,
geoManager->replayHeaderHeight
+ geoManager->replayInfo2Height
+ geoManager->replayProgressBarHeight,
- geoManager->replayWidth/5,
+ geoManager->replayOsdWidth/5,
geoManager->replayCurrentHeight));
- pixmapTotal = osd->CreatePixmap(3, cRect(4*geoManager->replayWidth/5,
+ pixmapTotal = osd->CreatePixmap(3, cRect(4*geoManager->replayOsdWidth/5,
geoManager->replayHeaderHeight
+ geoManager->replayInfo2Height
+ geoManager->replayProgressBarHeight,
- geoManager->replayWidth/5,
+ geoManager->replayOsdWidth/5,
geoManager->replayCurrentHeight));
pixmapScreenResBackground = osd->CreatePixmap(3, cRect(geoManager->replayResolutionX - 10,
geoManager->replayResolutionY - 5,
@@ -121,16 +121,16 @@ void cNopacityDisplayReplay::CreatePixmaps(void) {
if (!modeOnly) {
pixmapControls = osd->CreatePixmap(2, cRect(0,
controlY,
- geoManager->replayWidth,
+ geoManager->replayOsdWidth,
geoManager->replayControlsHeight));
} else {
- pixmapControls = osd->CreatePixmap(2, cRect((geoManager->replayWidth
+ pixmapControls = osd->CreatePixmap(2, cRect((geoManager->replayOsdWidth
- (5 * iconWidth))/2,
controlY - 10,
5 * iconWidth,
geoManager->replayControlsHeight + 20));
}
- int iconX = (geoManager->replayWidth - 4 * iconWidth)/2;
+ int iconX = (geoManager->replayOsdWidth - 4 * iconWidth)/2;
pixmapRew = osd->CreatePixmap(4, cRect(iconX + iconBorder,
controlY + iconBorder,
iconSize,
@@ -196,13 +196,13 @@ void cNopacityDisplayReplay::DrawBackground(void) {
(Theme.Color(clrReplayBackground) != Theme.Color(clrReplayBackBlend))) {
DrawBlendedBackground(pixmapBackground,
0,
- geoManager->replayWidth,
+ geoManager->replayOsdWidth,
Theme.Color(clrReplayBackground),
Theme.Color(clrReplayBackBlend),
true);
DrawBlendedBackground(pixmapBackground,
0,
- geoManager->replayWidth,
+ geoManager->replayOsdWidth,
Theme.Color(clrReplayBackground),
Theme.Color(clrReplayBackBlend),
false);
@@ -214,8 +214,8 @@ void cNopacityDisplayReplay::DrawBackground(void) {
cornerRadius,
0,
0,
- geoManager->replayWidth,
- geoManager->replayHeight);
+ geoManager->replayOsdWidth,
+ geoManager->replayOsdHeight);
}
}
}
@@ -390,7 +390,7 @@ void cNopacityDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
void cNopacityDisplayReplay::SetProgress(int Current, int Total) {
if (Running() || geoManager->replayProgressBarHeight < 5)
return;
- int barWidth = geoManager->replayWidth - 2*geoManager->replayProgressBarHeight;
+ int barWidth = geoManager->replayOsdWidth - 2*geoManager->replayProgressBarHeight;
cProgressBar pb(barWidth,
geoManager->replayProgressBarHeight-2,
Current,
@@ -437,7 +437,7 @@ void cNopacityDisplayReplay::SetCurrent(const char *Current) {
void cNopacityDisplayReplay::SetTotal(const char *Total) {
pixmapTotal->Fill(clrTransparent);
- pixmapTotal->DrawText(cPoint(geoManager->replayWidth/5
+ pixmapTotal->DrawText(cPoint(geoManager->replayOsdWidth/5
- (fontManager->replayText->Width(Total)
+ geoManager->replayHeaderHeight/2),
0),
@@ -466,8 +466,8 @@ void cNopacityDisplayReplay::SetMessage(eMessageType Type, const char *Text) {
if (!Text)
return;
messageBox = new cNopacityMessageBox(osd,
- cRect((geoManager->replayWidth - geoManager->messageWidth) / 2,
- geoManager->replayHeight - geoManager->messageHeight - 20,
+ cRect((geoManager->replayOsdWidth - geoManager->messageWidth) / 2,
+ geoManager->replayOsdHeight - geoManager->messageHeight - 20,
geoManager->messageWidth, geoManager->messageHeight),
Type, Text);
}
diff --git a/geometrymanager.c b/geometrymanager.c
index 552aa61..e477f11 100644
--- a/geometrymanager.c
+++ b/geometrymanager.c
@@ -104,8 +104,6 @@ void cGeometryManager::SetGeometry(void) {
channelOsdWidth = osdWidth - 2 * config.GetValue("channelBorderVertical");
channelOsdHeight = osdHeight - 2 * config.GetValue("channelBorderBottom");
- channelX = 0;
- channelWidth = channelOsdWidth;
channelHeight = channelOsdHeight * config.GetValue("channelHeight") / 100;
channelTop = channelOsdHeight - channelHeight;
@@ -120,10 +118,10 @@ void cGeometryManager::SetGeometry(void) {
channelContentHeight = channelHeight - channelHeaderHeight - channelFooterHeight;
int logoWidthTotalPercent = 16;
- channelLogoWidthTotal = logoWidthTotalPercent * channelWidth / 100;
+ channelLogoWidthTotal = logoWidthTotalPercent * channelOsdWidth / 100;
// 184x130 logo background for 1250x180 graphical display channel window (default theme)
- channelLogoBgWidth = channelWidth * 184 / 1250;
+ channelLogoBgWidth = channelOsdWidth * 184 / 1250;
channelLogoBgHeight = channelHeight * 130 / 180;
channelLogoBgX = (channelLogoWidthTotal - channelLogoBgWidth) / 2;
if (config.GetValue("displayType") != dtGraphical) {
@@ -155,30 +153,30 @@ void cGeometryManager::SetGeometry(void) {
channelStatusIconBorder = 5;
channelStatusIconSize = channelFooterHeight - 2 * channelStatusIconBorder;
channelStatusIconsWidth = 8 * channelStatusIconSize + 6 * channelStatusIconBorder;
- channelStatusIconX = channelX + channelWidth - channelStatusIconsWidth - channelFooterHeight / 2;
- channelSourceInfoX = channelX + 10;
+ channelStatusIconX = channelOsdWidth - channelStatusIconsWidth - channelFooterHeight / 2;
+ channelSourceInfoX = 10;
switch (config.GetValue("logoPosition")) {
case lpLeft:
channelContentX = channelLogoWidthTotal;
- channelContentWidth = channelWidth - channelLogoWidthTotal;
+ channelContentWidth = channelOsdWidth - channelLogoWidthTotal;
channelSourceInfoX += channelContentX;
break;
case lpRight:
channelContentX = 0;
- channelContentWidth = channelWidth - channelLogoWidthTotal;
+ channelContentWidth = channelOsdWidth - channelLogoWidthTotal;
channelLogoX = channelContentWidth + (channelLogoWidthTotal - channelLogoWidth) / 2;
channelLogoBgX = channelContentWidth + (channelLogoWidthTotal - channelLogoBgWidth) / 2;
channelStatusIconX -= channelLogoWidthTotal;
break;
case lpNone:
channelContentX = 0;
- channelContentWidth = channelWidth;
+ channelContentWidth = channelOsdWidth;
break;
}
if (config.GetValue("displaySignalStrength"))
- channelSourceInfoX += channelWidth * 0.2;
+ channelSourceInfoX += channelOsdWidth * 0.2;
channelChannelNameWidth = channelContentWidth * 70 / 100;
channelDateWidth = channelContentWidth - channelChannelNameWidth;
@@ -192,36 +190,34 @@ void cGeometryManager::SetGeometry(void) {
replayOsdWidth = osdWidth - 2 * config.GetValue("replayBorderVertical");
replayOsdTop = osdTop + osdHeight - replayOsdHeight - config.GetValue("replayBorderBottom");
replayOsdLeft = osdLeft + config.GetValue("replayBorderVertical"),
- replayWidth = replayOsdWidth;
- replayHeight = replayOsdHeight;
- replayHeaderHeight = replayHeight * 0.2;
+ replayHeaderHeight = replayOsdHeight * 0.2;
if (replayHeaderHeight % 2 != 0)
replayHeaderHeight++;
replayFooterHeight = replayHeaderHeight;
replayResolutionSize = replayHeaderHeight - 10;
- replayResolutionX = replayWidth - replayResolutionSize * 3 - replayHeaderHeight / 2;
- replayResolutionY = replayHeight - replayFooterHeight;
+ replayResolutionX = replayOsdWidth - replayResolutionSize * 3 - replayHeaderHeight / 2;
+ replayResolutionY = replayOsdHeight - replayFooterHeight;
replayInfo2Height = replayHeaderHeight;
- replayProgressBarHeight = 0.1 * replayHeight;
+ replayProgressBarHeight = 0.1 * replayOsdHeight;
if (replayProgressBarHeight % 2 != 0)
replayProgressBarHeight++;
replayCurrentHeight = replayProgressBarHeight + config.GetValue("fontReplay");
- replayControlsHeight = replayHeight - replayHeaderHeight - replayInfo2Height - replayFooterHeight - replayProgressBarHeight;
+ replayControlsHeight = replayOsdHeight - replayHeaderHeight - replayInfo2Height - replayFooterHeight - replayProgressBarHeight;
if (replayControlsHeight < 11)
replayControlsHeight = 11;
- replayInfoWidth = 0.75 * replayWidth;
- replayDateWidth = replayWidth - replayInfoWidth;
+ replayInfoWidth = 0.75 * replayOsdWidth;
+ replayDateWidth = replayOsdWidth - replayInfoWidth;
- replayJumpX = (replayWidth - 4 * replayControlsHeight)/2 + 5*replayControlsHeight;
+ replayJumpX = (replayOsdWidth - 4 * replayControlsHeight)/2 + 5*replayControlsHeight;
replayJumpY = replayHeaderHeight + replayInfo2Height + replayProgressBarHeight;
- replayJumpWidth = replayWidth - replayJumpX;
+ replayJumpWidth = replayOsdWidth - replayJumpX;
replayJumpHeight = replayControlsHeight;
replayIconBorder = 5;
replayIconSize = std::min(replayControlsHeight - 2*replayIconBorder, 128);
- replayMessageY = replayHeight - replayFooterHeight;
- replayMessageWidth = replayWidth * 75 / 100;
+ replayMessageY = replayOsdHeight - replayFooterHeight;
+ replayMessageWidth = replayOsdWidth * 75 / 100;
replayMessageHeight = replayFooterHeight;
// DisplayMessage Sizes
@@ -242,7 +238,7 @@ void cGeometryManager::SetGeometry(void) {
// Volume Sizes for Channel
if (config.GetValue("displayChannelVolume") == vbSimple) {
- channelVolumeLeft = channelX + channelContentX + channelWidth * 0.2 + 10;
+ channelVolumeLeft = channelContentX + channelOsdWidth * 0.2 + 10;
channelVolumeTop = channelTop + channelHeaderHeight + channelProgressBarHeight + channelEpgInfoHeight;
channelVolumeWidth = channelStatusIconX - channelVolumeLeft - 5 * channelStatusIconBorder;
if (config.GetValue("logoPosition") == lpRight)
@@ -258,7 +254,7 @@ void cGeometryManager::SetGeometry(void) {
// Volume Sizes for Replay
if (config.GetValue("displayReplayVolume") == vbSimple) {
replayVolumeLeft = replayOsdWidth / 3;
- replayVolumeTop = replayHeight - replayFooterHeight;
+ replayVolumeTop = replayOsdHeight - replayFooterHeight;
replayVolumeWidth = replayOsdWidth / 3;
replayVolumeHeight = replayFooterHeight;
} else {
diff --git a/geometrymanager.h b/geometrymanager.h
index 98de55f..dfd7fc7 100644
--- a/geometrymanager.h
+++ b/geometrymanager.h
@@ -61,8 +61,8 @@ class cGeometryManager {
//DisplayChannel Sizes
int channelOsdLeft, channelOsdTop;
int channelOsdWidth, channelOsdHeight;
- int channelX, channelTop;
- int channelWidth, channelHeight;
+ int channelTop;
+ int channelHeight;
int channelHeaderHeight;
int channelFooterHeight;
int channelContentHeight;
@@ -88,8 +88,6 @@ class cGeometryManager {
//DisplayReplay Sizes
int replayOsdLeft, replayOsdTop;
int replayOsdWidth, replayOsdHeight;
- int replayWidth;
- int replayHeight;
int replayHeaderHeight;
int replayInfo2Height;
int replayProgressBarHeight;
diff --git a/imagecache.c b/imagecache.c
index d336c5e..8158aef 100644
--- a/imagecache.c
+++ b/imagecache.c
@@ -588,11 +588,11 @@ void cImageCache::CreateSkinElementsGraphics(void) {
}
success = LoadIcon(ctSkinElement, imgChannelBackground);
if (success)
- InsertIntoSkinElementCache(seChannelBackground, geoManager->channelWidth, geoManager->channelHeight);
+ InsertIntoSkinElementCache(seChannelBackground, geoManager->channelOsdWidth, geoManager->channelHeight);
success = LoadIcon(ctSkinElement, imgChannelTop);
if (success)
- InsertIntoSkinElementCache(seChannelTop, geoManager->channelWidth, geoManager->channelHeight);
+ InsertIntoSkinElementCache(seChannelTop, geoManager->channelOsdWidth, geoManager->channelHeight);
//ChannelLogo Background
std::string imgChannelLogoBack = "skinElements/channellogoback";
@@ -604,11 +604,11 @@ void cImageCache::CreateSkinElementsGraphics(void) {
std::string imgReplayBackground = "skinElements/displayreplayback";
success = LoadIcon(ctSkinElement, imgReplayBackground);
if (success)
- InsertIntoSkinElementCache(seReplayBackground, geoManager->replayWidth, geoManager->replayHeight);
+ InsertIntoSkinElementCache(seReplayBackground, geoManager->replayOsdWidth, geoManager->replayOsdHeight);
std::string imgReplayTop = "skinElements/displayreplaytop";
success = LoadIcon(ctSkinElement, imgReplayTop);
if (success)
- InsertIntoSkinElementCache(seReplayTop, geoManager->replayWidth, geoManager->replayHeight);
+ InsertIntoSkinElementCache(seReplayTop, geoManager->replayOsdWidth, geoManager->replayOsdHeight);
//DisplayVolume Background
std::string imgVolumeBackground = "skinElements/displayvolume";