summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2009-05-03 17:15:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2009-05-03 17:15:00 +0200
commit991eda006700f1703bcec528c1ff178a4cab9048 (patch)
tree11f216938606e63027bc717e3d36668df646f474 /menu.c
parent733a2becc44a02daf10b97d24b8a9c8b00de3964 (diff)
downloadvdr-patch-lnbsharing-991eda006700f1703bcec528c1ff178a4cab9048.tar.gz
vdr-patch-lnbsharing-991eda006700f1703bcec528c1ff178a4cab9048.tar.bz2
Version 1.7.7vdr-1.7.7
- The new function cDevice::GetVideoSize() returns the size and aspect ratio of the video material currently displayed. This function is used to determine the proper size of the OSD. Plugin authors should implement this function in classes derived from cDevice, if they are able to replay video. - The OSD and font sizes are now defined in percent of the actual video display size. The maximum OSD size has been raised to 1920x1080, to allow full screen OSD on HD systems. - The OSD size is now automatically adjusted to the actual video display (provided the output device implements the GetVideoSize() function). - cFrameDetector::Analyze() now syncs on the TS packet sync bytes (thanks to Oliver Endriss for reporting broken index generation after a buffer overflow).
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/menu.c b/menu.c
index fa60065..423f6f2 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 2.6 2009/01/24 15:05:43 kls Exp $
+ * $Id: menu.c 2.7 2009/05/03 13:30:13 kls Exp $
*/
#include "menu.h"
@@ -2197,19 +2197,19 @@ void cMenuSetupOSD::Set(void)
Add(new cMenuEditStraItem(tr("Setup.OSD$Skin"), &skinIndex, numSkins, skinDescriptions));
if (themes.NumThemes())
Add(new cMenuEditStraItem(tr("Setup.OSD$Theme"), &themeIndex, themes.NumThemes(), themes.Descriptions()));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Left"), &data.OSDLeft, 0, MAXOSDWIDTH));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Top"), &data.OSDTop, 0, MAXOSDHEIGHT));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Width"), &data.OSDWidth, MINOSDWIDTH, MAXOSDWIDTH));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Height"), &data.OSDHeight, MINOSDHEIGHT, MAXOSDHEIGHT));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Left (%)"), &data.OSDLeftP, 0.0, 0.5));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Top (%)"), &data.OSDTopP, 0.0, 0.5));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Width (%)"), &data.OSDWidthP, 0.5, 1.0));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Height (%)"), &data.OSDHeightP, 0.5, 1.0));
Add(new cMenuEditIntItem( tr("Setup.OSD$Message time (s)"), &data.OSDMessageTime, 1, 60));
Add(new cMenuEditStraItem(tr("Setup.OSD$Use small font"), &data.UseSmallFont, 3, useSmallFontTexts));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Anti-alias"), &data.AntiAlias));
Add(new cMenuEditStraItem(tr("Setup.OSD$Default font"), &fontOsdIndex, fontOsdNames.Size(), &fontOsdNames[0]));
Add(new cMenuEditStraItem(tr("Setup.OSD$Small font"), &fontSmlIndex, fontSmlNames.Size(), &fontSmlNames[0]));
Add(new cMenuEditStraItem(tr("Setup.OSD$Fixed font"), &fontFixIndex, fontFixNames.Size(), &fontFixNames[0]));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Default font size (pixel)"), &data.FontOsdSize, 10, MAXFONTSIZE));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Small font size (pixel)"),&data.FontSmlSize, 10, MAXFONTSIZE));
- Add(new cMenuEditIntItem( tr("Setup.OSD$Fixed font size (pixel)"),&data.FontFixSize, 10, MAXFONTSIZE));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Default font size (%)"), &data.FontOsdSizeP, 0.01, 0.1, 1));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Small font size (%)"), &data.FontSmlSizeP, 0.01, 0.1, 1));
+ Add(new cMenuEditPrcItem( tr("Setup.OSD$Fixed font size (%)"), &data.FontFixSizeP, 0.01, 0.1, 1));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Channel info position"), &data.ChannelInfoPos, tr("bottom"), tr("top")));
Add(new cMenuEditIntItem( tr("Setup.OSD$Channel info time (s)"), &data.ChannelInfoTime, 1, 60));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Info on channel switch"), &data.ShowInfoOnChSwitch));
@@ -2224,7 +2224,7 @@ void cMenuSetupOSD::Set(void)
eOSState cMenuSetupOSD::ProcessKey(eKeys Key)
{
- bool ModifiedApperance = false;
+ bool ModifiedAppearance = false;
if (Key == kOk) {
I18nSetLocale(data.OSDLanguage);
@@ -2233,43 +2233,37 @@ eOSState cMenuSetupOSD::ProcessKey(eKeys Key)
if (Skin) {
Utf8Strn0Cpy(data.OSDSkin, Skin->Name(), sizeof(data.OSDSkin));
Skins.SetCurrent(Skin->Name());
- ModifiedApperance = true;
+ ModifiedAppearance = true;
}
}
if (themes.NumThemes() && Skins.Current()->Theme()) {
Skins.Current()->Theme()->Load(themes.FileName(themeIndex));
Utf8Strn0Cpy(data.OSDTheme, themes.Name(themeIndex), sizeof(data.OSDTheme));
- ModifiedApperance |= themeIndex != originalThemeIndex;
- }
- if (data.OSDLeft != Setup.OSDLeft || data.OSDTop != Setup.OSDTop || data.OSDWidth != Setup.OSDWidth || data.OSDHeight != Setup.OSDHeight) {
- data.OSDWidth &= ~0x07; // OSD width must be a multiple of 8
- ModifiedApperance = true;
+ ModifiedAppearance |= themeIndex != originalThemeIndex;
}
+ if (data.OSDLeftP != Setup.OSDLeftP || data.OSDTopP != Setup.OSDTopP || data.OSDWidthP != Setup.OSDWidthP || data.OSDHeightP != Setup.OSDHeightP)
+ ModifiedAppearance = true;
if (data.UseSmallFont != Setup.UseSmallFont || data.AntiAlias != Setup.AntiAlias)
- ModifiedApperance = true;
+ ModifiedAppearance = true;
Utf8Strn0Cpy(data.FontOsd, fontOsdNames[fontOsdIndex], sizeof(data.FontOsd));
Utf8Strn0Cpy(data.FontSml, fontSmlNames[fontSmlIndex], sizeof(data.FontSml));
Utf8Strn0Cpy(data.FontFix, fontFixNames[fontFixIndex], sizeof(data.FontFix));
- if (strcmp(data.FontOsd, Setup.FontOsd) || data.FontOsdSize != Setup.FontOsdSize) {
- cFont::SetFont(fontOsd, data.FontOsd, data.FontOsdSize);
- ModifiedApperance = true;
- }
- if (strcmp(data.FontSml, Setup.FontSml) || data.FontSmlSize != Setup.FontSmlSize) {
- cFont::SetFont(fontSml, data.FontSml, data.FontSmlSize);
- ModifiedApperance = true;
- }
- if (strcmp(data.FontFix, Setup.FontFix) || data.FontFixSize != Setup.FontFixSize) {
- cFont::SetFont(fontFix, data.FontFix, data.FontFixSize);
- ModifiedApperance = true;
- }
+ if (strcmp(data.FontOsd, Setup.FontOsd) || data.FontOsdSizeP != Setup.FontOsdSizeP)
+ ModifiedAppearance = true;
+ if (strcmp(data.FontSml, Setup.FontSml) || data.FontSmlSizeP != Setup.FontSmlSizeP)
+ ModifiedAppearance = true;
+ if (strcmp(data.FontFix, Setup.FontFix) || data.FontFixSizeP != Setup.FontFixSizeP)
+ ModifiedAppearance = true;
}
int oldSkinIndex = skinIndex;
int oldOsdLanguageIndex = osdLanguageIndex;
eOSState state = cMenuSetupBase::ProcessKey(Key);
- if (ModifiedApperance)
+ if (ModifiedAppearance) {
+ cOsdProvider::UpdateOsdSize(true);
SetDisplayMenu();
+ }
if (osdLanguageIndex != oldOsdLanguageIndex || skinIndex != oldSkinIndex) {
strn0cpy(data.OSDLanguage, I18nLocale(osdLanguageIndex), sizeof(data.OSDLanguage));