[mythtv] PATCH: Fixed aspect ratio option
Bruce Markey
mythtv-dev@snowman.net
Fri, 27 Dec 2002 00:01:05 -0800
This is a multi-part message in MIME format.
--------------090401070308020506040506
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Bruce Markey wrote:
> 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.
...but, of course, a change to globalsettings.h was right
next to a change mdz was making at the same time. This
caused a conflict in the diffs. Here is a new diff against
version 1.18 of globalsettings.h .
-- bjm
--------------090401070308020506040506
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 23:49:10.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 23:49:41.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 23:50:27.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-26 22:05:50.000000000 -0800
+++ MC/programs/mythfrontend/globalsettings.h 2002-12-26 23:53:32.000000000 -0800
@@ -262,6 +262,15 @@
};
};
+class FixedAspectRatio: public CheckBoxSetting, public GlobalSetting {
+public:
+ FixedAspectRatio():
+ GlobalSetting("FixedAspectRatio") {
+ setLabel("Fixed aspect ratio");
+ setValue(false);
+ };
+};
+
class PlaybackExitPrompt: public CheckBoxSetting, public GlobalSetting {
public:
PlaybackExitPrompt():
@@ -564,6 +573,7 @@
general->addChild(new HorizScanPercentage());
general->addChild(new XScanDisplacement());
general->addChild(new YScanDisplacement());
+ general->addChild(new FixedAspectRatio());
general->addChild(new PlaybackExitPrompt());
addChild(general);
--------------090401070308020506040506--