[mythtv] [PATCH] Specify aspect ratio cycle
Kristof Pelckmans
kristof.pelckmans at antwerpen.be
Wed Jun 2 18:21:28 EDT 2004
> Good idea. However I think you changed the default order, which violates
> the principle of least surprise. Currently it is:
>
> kLetterbox_4_3 = 0,
> kLetterbox_16_9,
> kLetterbox_4_3_Zoom,
> kLetterbox_16_9_Zoom,
> kLetterbox_16_9_Stretch,
It was due to the standard behaviour of QMap : the items are sorted
alphabetically (by key) when iterating over the map.
Here is a new patch without surprises.
Kristof
-------------- next part --------------
diff -Nurd -x CVS -x Makefile -x '.*' -x settings.pro -x config.h -x '*.o' -x '*.so' -x config.mak mythtv/libs/libmythtv/videoout_directfb.cpp mythtv-dev/libs/libmythtv/videoout_directfb.cpp
--- mythtv/libs/libmythtv/videoout_directfb.cpp 2004-05-25 07:13:30.000000000 +0200
+++ mythtv-dev/libs/libmythtv/videoout_directfb.cpp 2004-06-02 00:33:26.000000000 +0200
@@ -456,7 +456,6 @@
embedid);
VERBOSE(VB_GENERAL, QString("DirectFB output : screen size %1x%2").arg(data->screen_width).arg(data->screen_height));
- MoveResize();
if (gContext->GetNumSetting("UseOutputPictureControls", 0))
{
@@ -471,6 +470,7 @@
w_mm = data->screen_width;
h_mm = data->screen_height;
+ MoveResize();
//w_mm = DisplayWidthMM(data->XJ_disp, XJ_screen_num);
//h_mm = DisplayHeightMM(data->XJ_disp, XJ_screen_num);
diff -Nurd -x CVS -x Makefile -x '.*' -x settings.pro -x config.h -x '*.o' -x '*.so' -x config.mak mythtv/libs/libmythtv/videooutbase.cpp mythtv-dev/libs/libmythtv/videooutbase.cpp
--- mythtv/libs/libmythtv/videooutbase.cpp 2004-04-30 08:54:35.000000000 +0200
+++ mythtv-dev/libs/libmythtv/videooutbase.cpp 2004-06-02 23:58:12.487109536 +0200
@@ -168,6 +168,30 @@
if (asp_override > 0)
AspectOverride(asp_override);
+ aspectRatioMap["4:3"] = kLetterbox_4_3;
+ aspectRatioMap["16:9"] = kLetterbox_16_9;
+ aspectRatioMap["4:3 Zoom"] = kLetterbox_4_3_Zoom;
+ aspectRatioMap["16:9 Zoom"] = kLetterbox_16_9_Zoom;
+ aspectRatioMap["16:9 Stretch"] = kLetterbox_16_9_Stretch;
+
+ QString aspectRatios = gContext->GetSetting("AspectRatioCycle");
+ if (aspectRatios.length() > 1)
+ {
+ QStringList aspectRatioList = QStringList::split(",", aspectRatios);
+ for ( QStringList::Iterator it = aspectRatioList.begin(); it != aspectRatioList.end(); ++it )
+ {
+ aspectRatioCycle.append(aspectRatioMap[*it]);
+ }
+ }
+ else
+ {
+ for ( int i = 0; i < kLetterbox_END; i++ )
+ {
+ aspectRatioCycle.append(i);
+ }
+ }
+ aspectRatioIterator = aspectRatioCycle.begin();
+
embedding = false;
return true;
@@ -532,8 +556,11 @@
{
if (letterboxMode == kLetterbox_Toggle)
{
- if (++letterbox >= kLetterbox_END)
- letterbox = 0;
+ if(aspectRatioIterator == aspectRatioCycle.end())
+ aspectRatioIterator = aspectRatioCycle.begin();
+
+ letterbox = *aspectRatioIterator;
+ aspectRatioIterator++;
}
else
{
diff -Nurd -x CVS -x Makefile -x '.*' -x settings.pro -x config.h -x '*.o' -x '*.so' -x config.mak mythtv/libs/libmythtv/videooutbase.h mythtv-dev/libs/libmythtv/videooutbase.h
--- mythtv/libs/libmythtv/videooutbase.h 2004-05-20 09:09:02.000000000 +0200
+++ mythtv-dev/libs/libmythtv/videooutbase.h 2004-06-02 23:52:28.626384312 +0200
@@ -12,6 +12,7 @@
#include <qptrqueue.h>
#include <qwaitcondition.h>
#include <qptrlist.h>
+#include <qvaluelist.h>
using namespace std;
@@ -242,6 +243,10 @@
ImgReSampleContext *pipscontext;
bool allowpreviewepg;
+
+ QMap<QString, int> aspectRatioMap;
+ QValueList<int> aspectRatioCycle;
+ QValueList<int>::Iterator aspectRatioIterator;
};
#endif
diff -Nurd -x CVS -x Makefile -x '.*' -x settings.pro -x config.h -x '*.o' -x '*.so' -x config.mak mythtv/programs/mythfrontend/globalsettings.cpp mythtv-dev/programs/mythfrontend/globalsettings.cpp
--- mythtv/programs/mythfrontend/globalsettings.cpp 2004-06-02 23:31:58.411405416 +0200
+++ mythtv-dev/programs/mythfrontend/globalsettings.cpp 2004-06-02 23:54:55.577044416 +0200
@@ -1119,16 +1119,30 @@
GlobalSetting("AspectOverride") {
setLabel(QObject::tr("Aspect Override"));
addSelection(QObject::tr("Off"), "0");
- addSelection(QObject::tr("16/9 Anamorphic"), "1");
- addSelection(QObject::tr("4/3 Normal"), "2");
- addSelection(QObject::tr("16/9 Zoom"), "3");
- addSelection(QObject::tr("4/3 Zoom"), "3");
+ addSelection(QObject::tr("16:9 Anamorphic"), "1");
+ addSelection(QObject::tr("4:3 Normal"), "2");
+ addSelection(QObject::tr("16:9 Zoom"), "3");
+ addSelection(QObject::tr("4:3 Zoom"), "3");
setHelpText(QObject::tr("This will override any aspect ratio in the "
"recorded stream, the same as pressing the W Key "
"during playback."));
};
};
+class AspectRatioList: public LineEditSetting, public GlobalSetting {
+public:
+ AspectRatioList():
+ GlobalSetting("AspectRatioCycle") {
+ setLabel(QObject::tr("Aspect ratio cycle"));
+ setValue("");
+ setHelpText(QObject::tr("The aspect ratios used when pressing \'W\' "
+ "during playback. They are specified as an ordered, "
+ "comma-separated list (without spaces after commas). "
+ "Possible values are : 4:3, 4:3 Zoom, 16:9, 16:9 Zoom "
+ "and 16:9 Stretch."));
+ };
+};
+
// Theme settings
class GuiWidth: public SpinBoxSetting, public GlobalSetting {
@@ -2360,6 +2374,7 @@
general->addChild(new UseVideoTimebase());
general->addChild(new DecodeExtraAudio());
general->addChild(new AspectOverride());
+ general->addChild(new AspectRatioList());
general->addChild(new PIPLocation());
addChild(general);
More information about the mythtv-dev
mailing list