[mythtv] [PATCH] mythtv: fix AspectOverride setting

Stefan Frank sfr+lists at 6913304088794.gnuu.de
Mon May 31 17:23:47 EDT 2004


This patch fixes the AspectOverride setting. Initially i just wanted to
add the 16:9 Stretch option to the settings screen, but the setting was
being ignored.

It replaces the existing AspectOverride() logic with the one from
ToggleLetterbox(). Note that the values of the db setting 'AspectOverride'
change as well, but imho all it will cause is some confusion among
users after an upgrade.

It should go into cvs if Mark Edwards agrees.

Oh, and please ignore the two hunks about OSDFadeTime.

Bye, Stefan

-------------- next part --------------
Index: libs/libmythtv/videooutbase.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videooutbase.cpp,v
retrieving revision 1.50
diff -u -r1.50 videooutbase.cpp
--- libs/libmythtv/videooutbase.cpp	30 Apr 2004 06:54:35 -0000	1.50
+++ libs/libmythtv/videooutbase.cpp	31 May 2004 19:56:02 -0000
@@ -165,8 +165,7 @@
 
     int asp_override = gContext->GetNumSetting("AspectOverride", 0);
 
-    if (asp_override > 0) 
-        AspectOverride(asp_override);
+    AspectOverride(asp_override);
 
     embedding = false;
 
@@ -175,27 +174,23 @@
 
 void VideoOutput::AspectOverride(int override)
 {
-    switch(override)
+    if (override > kLetterbox_Toggle && override < kLetterbox_END)
     {
-        default:
-        case 0:
-           break;
-        case 1:
-           XJ_aspect = (16.0 / 9);
-           letterbox = 0;
-           break;
-        case 2:
-           XJ_aspect = (4.0 / 3);
-           letterbox = 1;
-           break;
-        case 3:
-           XJ_aspect = (16.0 / 9);
-           letterbox = 2;
-           break;
-        case 4:
-           XJ_aspect = (4.0 / 3);
-           letterbox = 3;
-           break;
+        letterbox = override;
+
+        switch(letterbox)
+        {
+            case kLetterbox_4_3:
+            case kLetterbox_4_3_Zoom:
+                                            XJ_aspect = (4.0 / 3);
+                                            break; 
+            case kLetterbox_16_9:
+            case kLetterbox_16_9_Zoom:
+            case kLetterbox_16_9_Stretch:   XJ_aspect = (16.0 / 9);
+                                            break;
+            default:
+                                            break;
+        }
     }
 }
 
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.167
diff -u -r1.167 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp	25 May 2004 01:17:01 -0000	1.167
+++ programs/mythfrontend/globalsettings.cpp	31 May 2004 19:56:22 -0000
@@ -596,6 +596,18 @@
     };
 };
 
+class OSDFadeTime: public SpinBoxSetting, public GlobalSetting {
+public:
+    OSDFadeTime():
+        SpinBoxSetting(1, 60, 1),
+        GlobalSetting("OSDFadeTime") {
+        setLabel(QObject::tr("OSD fade time"));
+        setValue(30);
+        setHelpText(QObject::tr("How fast the On Screen Display "
+                    "will fade out after a channel change."));
+    };
+};
+
 class MenuTheme: public ComboBoxSetting, public GlobalSetting {
 public:
     MenuTheme():
@@ -1074,11 +1086,12 @@
     AspectOverride():
         GlobalSetting("AspectOverride") {
         setLabel(QObject::tr("Aspect Override"));
-        addSelection(QObject::tr("Off"), "0");
+        addSelection(QObject::tr("Off"), "-1");
+        addSelection(QObject::tr("4/3 Normal"), "0");
         addSelection(QObject::tr("16/9 Anamorphic"), "1");
-        addSelection(QObject::tr("4/3 Normal"), "2");
+        addSelection(QObject::tr("4/3 Zoom"), "2");
         addSelection(QObject::tr("16/9 Zoom"), "3");
-        addSelection(QObject::tr("4/3 Zoom"), "3");
+        addSelection(QObject::tr("16/9 Stretch"), "4");
         setHelpText(QObject::tr("This will override any aspect ratio in the "
                     "recorded stream, the same as pressing the W Key "
                     "during playback."));
@@ -2386,6 +2399,7 @@
     osd->setLabel(QObject::tr("On-screen display"));
     osd->addChild(new OSDTheme());
     osd->addChild(new OSDDisplayTime());
+    osd->addChild(new OSDFadeTime());
     osd->addChild(new OSDFont());
     osd->addChild(new OSDCCFont());
     osd->addChild(new OSDThemeFontSizeType());


More information about the mythtv-dev mailing list