1 /* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2021 Ricardo Villalba <ricardo@smplayer.info>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #include "stereo3ddialog.h"
20
Stereo3dDialog(QWidget * parent,Qt::WindowFlags f)21 Stereo3dDialog::Stereo3dDialog(QWidget* parent, Qt::WindowFlags f)
22 : QDialog(parent, f)
23 {
24 setupUi(this);
25
26 in_combo->addItem(tr("Side by side parallel (left eye left, right eye right)"), "sbsl");
27 in_combo->addItem(tr("Side by side crosseye (right eye left, left eye right)"), "sbsr");
28 in_combo->addItem(tr("Side by side with half width resolution (left eye left, right eye right)"), "sbs2l");
29 in_combo->addItem(tr("Side by side with half width resolution (right eye left, left eye right)"), "sbs2r");
30
31 in_combo->addItem(tr("Above-below (left eye above, right eye below)"), "abl");
32 in_combo->addItem(tr("Above-below (right eye above, left eye below)"), "abr");
33 in_combo->addItem(tr("Above-below with half height resolution (left eye above, right eye below)"), "ab2l");
34 in_combo->addItem(tr("Above-below with half height resolution (right eye above, left eye below)"), "ab2r");
35
36 // Copy the input formats
37 for (int n = 0; n < in_combo->count(); n++) {
38 out_combo->addItem( in_combo->itemText(n), in_combo->itemData(n) );
39 }
40
41 out_combo->addItem(tr("Anaglyph red/cyan gray"), "arcg");
42 out_combo->addItem(tr("Anaglyph red/cyan half colored"), "arch");
43 out_combo->addItem(tr("Anaglyph red/cyan color"), "arcc");
44 out_combo->addItem(tr("Anaglyph red/cyan color optimized with the least-squares projection of Dubois"), "arcd");
45
46 out_combo->addItem(tr("Anaglyph green/magenta gray"), "agmg");
47 out_combo->addItem(tr("Anaglyph green/magenta half colored"), "agmh");
48 out_combo->addItem(tr("Anaglyph green/magenta colored"), "agmc");
49
50 out_combo->addItem(tr("Anaglyph yellow/blue gray"), "aybg");
51 out_combo->addItem(tr("Anaglyph yellow/blue half colored"), "aybh");
52 out_combo->addItem(tr("Anaglyph yellow/blue colored"), "aybc");
53
54 out_combo->addItem(tr("Interleaved rows (left eye has top row, right eye starts on next row)"), "irl");
55 out_combo->addItem(tr("Interleaved rows (right eye has top row, left eye starts on next row)"), "irr");
56
57 out_combo->addItem(tr("Mono output (left eye only)"), "ml");
58 out_combo->addItem(tr("Mono output (right eye only)"), "mr");
59
60 in_combo->insertItem(0, tr("None"), "none");
61 in_combo->insertItem(1, tr("Auto"), "");
62
63 adjustSize();
64 }
65
~Stereo3dDialog()66 Stereo3dDialog::~Stereo3dDialog() {
67 }
68
setInputFormat(const QString & in)69 void Stereo3dDialog::setInputFormat(const QString & in) {
70 int i = in_combo->findData(in);
71 if (i == -1) i = 0;
72 in_combo->setCurrentIndex(i);
73 }
74
setOutputFormat(const QString & out)75 void Stereo3dDialog::setOutputFormat(const QString & out) {
76 int i = out_combo->findData(out);
77 if (i == -1) {
78 // Use ml as default if the output format is not found
79 i = out_combo->findData("ml");
80 if (i == -1) i = 0;
81 }
82 out_combo->setCurrentIndex(i);
83 }
84
inputFormat()85 QString Stereo3dDialog::inputFormat() {
86 int i = in_combo->currentIndex();
87 return in_combo->itemData(i).toString();
88 }
89
outputFormat()90 QString Stereo3dDialog::outputFormat() {
91 int i = out_combo->currentIndex();
92 return out_combo->itemData(i).toString();
93 }
94
95 #include "moc_stereo3ddialog.cpp"
96