[mythtv] PATCH: Fixed aspect ratio option

Bruce Markey mythtv-dev@snowman.net
Thu, 26 Dec 2002 22:49:28 -0800


This is a multi-part message in MIME format.
--------------010101080106000007020000
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

This patch adds a checkbox to Setup->Playback for "Fixed
aspect ratio". When set, the width of the non-fullscreen
TV picture will be adjusted to fit a 4x3 aspect ratio.
The default is to use the dimensions of the recording.

As with other playback settings, the setup screen will
enter the value into the settings table, however, only
the value in settings.txt is currently used.

--  bjm

--------------010101080106000007020000
Content-Type: text/plain;
 name="aspect.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="aspect.diff"

diff -ur MC.orig/libs/libNuppelVideo/XJ.cpp MC/libs/libNuppelVideo/XJ.cpp
--- MC.orig/libs/libNuppelVideo/XJ.cpp	2002-12-18 14:17:18.000000000 -0800
+++ MC/libs/libNuppelVideo/XJ.cpp	2002-12-26 21:52:39.000000000 -0800
@@ -159,6 +159,8 @@
     printf("Over/underscanning. V: %f, H: %f, XOff: %d, YOff: %d\n", 
            img_vscanf, img_hscanf, img_xoff, img_yoff);
 
+    XJ_aspect = settings->GetNumSetting("FixedAspectRatio", 0);
+
     delete settings;
 
     XJ_white=XWhitePixel(data->XJ_disp, XJ_screen_num);
@@ -406,6 +408,10 @@
     {
         XJ_fullscreen = 0; 
         curx = oldx; cury = oldy; curw = oldw; curh = oldh;
+
+	if (XJ_aspect)
+	    curw = 4 * curh / 3;
+
         show_cursor();
         decorate(1);
     } 
diff -ur MC.orig/libs/libNuppelVideo/XJ.h MC/libs/libNuppelVideo/XJ.h
--- MC.orig/libs/libNuppelVideo/XJ.h	2002-12-18 14:17:18.000000000 -0800
+++ MC/libs/libNuppelVideo/XJ.h	2002-12-26 21:32:37.000000000 -0800
@@ -42,6 +42,7 @@
     int XJ_width, XJ_height;
     int XJ_screenwidth, XJ_screenheight;
     int XJ_fullscreen;
+    int XJ_aspect;
 
     int oldx, oldy, oldw, oldh;
     int curx, cury, curw, curh;
diff -ur MC.orig/libs/libmythtv/settings.txt MC/libs/libmythtv/settings.txt
--- MC.orig/libs/libmythtv/settings.txt	2002-12-18 14:17:18.000000000 -0800
+++ MC/libs/libmythtv/settings.txt	2002-12-26 21:48:43.000000000 -0800
@@ -84,6 +84,9 @@
 int xScanDisplacement=0
 int yScanDisplacement=0
 
+# Should the non-fullscreen picture be 4x3?
+int FixedAspectRatio=0
+
 # Picture-in-picture options
 int PIPBufferSize=1
 int PIPMaxBufferFill=50
diff -ur MC.orig/programs/mythfrontend/globalsettings.h MC/programs/mythfrontend/globalsettings.h
--- MC.orig/programs/mythfrontend/globalsettings.h	2002-12-22 20:04:36.000000000 -0800
+++ MC/programs/mythfrontend/globalsettings.h	2002-12-26 21:36:18.000000000 -0800
@@ -271,6 +271,15 @@
     };
 };
 
+class FixedAspectRatio: public CheckBoxSetting, public GlobalSetting {
+public:
+    FixedAspectRatio():
+        GlobalSetting("FixedAspectRatio") {
+        setLabel("Fixed aspect ratio");
+        setValue(false);
+    };
+};
+
 class ExternalChannelCommand: public LineEditSetting, public GlobalSetting {
 public:
     ExternalChannelCommand():
@@ -575,6 +584,7 @@
         general->addChild(new XScanDisplacement());
         general->addChild(new YScanDisplacement());
         general->addChild(new PlaybackExitPrompt());
+        general->addChild(new FixedAspectRatio());
         addChild(general);
 
         VerticalConfigurationGroup* osd = new VerticalConfigurationGroup();

--------------010101080106000007020000--