summaryrefslogtreecommitdiff
path: root/geometrymanager.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
committerlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
commit4c61104675de5f1fac7e7fa95fb5743e18defc02 (patch)
tree7a3ee90e3b28246e8d4595954d4559445fb7ebe7 /geometrymanager.c
parent8aa2c81d3165a0517115337362f1203ea4bdd899 (diff)
downloadvdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.gz
vdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.bz2
Version 1.2.0pre
Diffstat (limited to 'geometrymanager.c')
-rw-r--r--geometrymanager.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/geometrymanager.c b/geometrymanager.c
new file mode 100644
index 0000000..6c9362d
--- /dev/null
+++ b/geometrymanager.c
@@ -0,0 +1,70 @@
+#include <vdr/osd.h>
+
+#include "config.h"
+#include "geometrymanager.h"
+
+cGeometryManager::cGeometryManager() {
+ osdWidth = 0;
+ osdHeight = 0;
+}
+
+cGeometryManager::~cGeometryManager() {
+}
+
+bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
+ if (!force && (this->osdWidth == osdWidth) && (this->osdHeight == osdHeight)) {
+ esyslog("tvgudie: GeoManager SetGeometry nothing to change");
+ return false;
+ }
+ this->osdWidth = osdWidth;
+ this->osdHeight = osdHeight;
+ esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
+
+ statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.statusHeaderPercent * osdHeight / 100):0;
+ tvFrameWidth = statusHeaderHeight * 16 / 9;
+ statusHeaderContentWidth = (tvguideConfig.scaleVideo)?(osdWidth - tvFrameWidth):osdWidth;
+ channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0;
+ channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0;
+ channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100;
+ channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
+ timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
+ timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
+ clockWidth = tvFrameWidth / 3;
+ clockHeight = timeLineHeight;
+ footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
+
+ if (tvguideConfig.displayMode == eVertical) {
+ colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols;
+ rowHeight = 0;
+ minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime;
+ channelLogoWidth = colWidth;
+ channelLogoHeight = channelHeaderHeight;
+ logoWidth = channelLogoWidth/2 - 15;
+ logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
+ timeLineGridWidth = timeLineWidth;
+ timeLineGridHeight = minutePixel*30;
+ dateVieverWidth = timeLineWidth;
+ dateVieverHeight = channelHeaderHeight + channelGroupsHeight;
+ } else if (tvguideConfig.displayMode == eHorizontal) {
+ colWidth = 0;
+ rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
+ minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayTime;
+ channelLogoWidth = channelHeaderWidth;
+ channelLogoHeight = rowHeight;
+ logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
+ logoHeight = channelLogoHeight;
+ timeLineGridWidth = geoManager.minutePixel*30;
+ timeLineGridHeight = geoManager.timeLineHeight;
+ dateVieverWidth = channelHeaderWidth + channelGroupsWidth;
+ dateVieverHeight = timeLineHeight;
+ }
+
+ buttonBorder = footerHeight / 6;
+ buttonWidth = osdWidth / 4 - 2 * buttonBorder;
+ buttonHeight = footerHeight - 3 * buttonBorder;
+
+ epgViewHeaderHeight = tvguideConfig.epgViewHeaderPercent * osdHeight / 100;
+
+ borderRecMenus = 10;
+ return true;
+} \ No newline at end of file