1 /**
2  * Copyright (C) 2003 Joonas Koivunen <rzei@mbnet.fi>
3  * Copyright (C) 2003 Koos Vriezen <koos.vriezen@xs4all.nl>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #undef Always
22 
23 #include <QIcon>
24 #include <QVBoxLayout>
25 #include <qlayout.h>
26 #include <qlabel.h>
27 #include <qpushbutton.h>
28 #include <qradiobutton.h>
29 #include <qcheckbox.h>
30 #include <qstringlist.h>
31 #include <qcombobox.h>
32 #include <qlineedit.h>
33 #include <qwhatsthis.h>
34 #include <qtabwidget.h>
35 #include <qslider.h>
36 #include <qspinbox.h>
37 #include <qmessagebox.h>
38 #include <qmap.h>
39 #include <qtimer.h>
40 #include <qfont.h>
41 #include <QAbstractButton>
42 #include <QButtonGroup>
43 #include <QGroupBox>
44 #include <QListWidget>
45 
46 #include <klocale.h>
47 #include <kdebug.h>
48 #include <kfiledialog.h>
49 #include <kmessagebox.h>
50 #include <klineedit.h>
51 #include <kiconloader.h>
52 #include <kdeversion.h>
53 #include <kcombobox.h>
54 #include <kcolorbutton.h>
55 #include <kurlrequester.h>
56 #include <kfontdialog.h>
57 #include <kvbox.h>
58 #include <KTextWidgets/kpluralhandlingspinbox.h>
59 #include "pref.h"
60 #include "kmplayerpartbase.h"
61 #include "kmplayerprocess.h"
62 #include "mediaobject.h"
63 #include "kmplayerconfig.h"
64 
65 using namespace KMPlayer;
66 
Preferences(PartBase * player,Settings * settings)67 KDE_NO_CDTOR_EXPORT Preferences::Preferences(PartBase * player, Settings * settings)
68 : KPageDialog (player->view ())
69 {
70     setFaceType (KPageDialog::List);
71     setWindowTitle(i18n("Preferences"));
72     setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply);
73     button(QDialogButtonBox::Ok)->setDefault(true);
74 
75     KVBox *page = new KVBox (this);
76     KPageWidgetItem *item = addPage (page, i18n ("General Options"));
77     item->setIcon(QIcon::fromTheme("kmplayer"));
78     QTabWidget *tab = new QTabWidget (page);
79     m_GeneralPageGeneral = new PrefGeneralPageGeneral (tab, settings);
80     tab->addTab (m_GeneralPageGeneral, i18n("General"));
81     m_GeneralPageLooks = new PrefGeneralPageLooks (tab, settings);
82     tab->addTab (m_GeneralPageLooks, i18n("Looks"));
83     m_GeneralPageOutput = new PrefGeneralPageOutput
84         (tab, settings->audiodrivers, settings->videodrivers);
85     tab->addTab (m_GeneralPageOutput, i18n("Output"));
86     entries.insert (i18n("General Options"), tab);
87 
88     page = new KVBox (this);
89     m_url_item = addPage (page, i18n ("Source"));
90     m_url_item->setIcon(QIcon::fromTheme("document-import"));
91     tab = new QTabWidget (page);
92     m_SourcePageURL = new PrefSourcePageURL (tab);
93     tab->addTab (m_SourcePageURL, i18n ("URL"));
94     entries.insert (i18n("Source"), tab);
95 
96     page = new KVBox (this);
97     m_record_item = addPage (page, i18n ("Recording"));
98     m_record_item->setIcon(QIcon::fromTheme("folder-video"));
99     tab = new QTabWidget (page);
100 
101     int recorders_count = 3;
102     m_MEncoderPage = new PrefMEncoderPage (tab, player);
103     tab->addTab (m_MEncoderPage, i18n ("MEncoder"));
104     recorders = m_MEncoderPage;
105 
106     m_FFMpegPage = new PrefFFMpegPage (tab, player);
107     tab->addTab (m_FFMpegPage, i18n ("FFMpeg"));
108     m_MEncoderPage->next = m_FFMpegPage;
109 
110     m_MPlayerDumpstreamPage = new PrefMPlayerDumpstreamPage (tab, player);
111     // tab->addTab (m_MPlayerDumpstreamPage, i18n ("MPlayer -dumpstream"));
112     m_FFMpegPage->next = m_MPlayerDumpstreamPage;
113 #ifdef KMPLAYER_WITH_XINE
114     recorders_count = 4;
115     m_XinePage = new PrefXinePage (tab, player);
116     // tab->addTab (m_XinePage, i18n ("Xine"));
117     m_MPlayerDumpstreamPage->next = m_XinePage;
118 #endif
119     m_RecordPage = new PrefRecordPage (tab, player, recorders, recorders_count);
120     tab->insertTab (0, m_RecordPage, i18n ("General"));
121     tab->setCurrentIndex (0);
122     entries.insert (i18n("Recording"), tab);
123 
124     page = new KVBox (this);
125     item = addPage (page, i18n ("Output Plugins"));
126     item->setIcon(QIcon::fromTheme("folder-image"));
127     tab = new QTabWidget (page);
128     m_OPPagePostproc = new PrefOPPagePostProc (tab);
129     tab->addTab (m_OPPagePostproc, i18n ("Postprocessing"));
130     entries.insert (i18n("Postprocessing"), tab);
131 
132     for (PreferencesPage * p = settings->pagelist; p; p = p->next)
133         addPrefPage (p);
134 
135     //connect (this, SIGNAL (defaultClicked ()), SLOT (confirmDefaults ()));
136 }
137 
setPage(const char * name)138 KDE_NO_EXPORT void Preferences::setPage (const char * name) {
139     KPageWidgetItem *item = NULL;
140     if (!strcmp (name, "RecordPage"))
141         item = m_record_item;
142     else if (!strcmp (name, "URLPage"))
143         item = m_url_item;
144     if (item) {
145         setCurrentPage (item);
146         QWidget* page = findChild<QWidget*>(name);
147         if (!page)
148             return;
149         QWidget * w = page->parentWidget ();
150         while (w && !qobject_cast <QTabWidget *> (w))
151             w = w->parentWidget ();
152         if (!w)
153             return;
154         QTabWidget *t = static_cast <QTabWidget*> (w);
155         t->setCurrentIndex (t->indexOf(page));
156     }
157 }
158 
addPrefPage(PreferencesPage * page)159 KDE_NO_EXPORT void Preferences::addPrefPage (PreferencesPage * page) {
160     QString item, subitem, icon;
161     KPageWidgetItem *witem;
162     QTabWidget *tab;
163     page->prefLocation (item, icon, subitem);
164     if (item.isEmpty ())
165         return;
166     QMap<QString, QTabWidget *>::iterator en_it = entries.find (item);
167     if (en_it == entries.end ()) {
168         KVBox *page = new KVBox (this);
169         witem = addPage (page, item);
170         witem->setIcon(QIcon::fromTheme(icon));
171         tab = new QTabWidget (page);
172         entries.insert (item, tab);
173     } else
174         tab = en_it.value ();
175     QFrame *frame = page->prefPage (tab);
176     tab->addTab (frame, subitem);
177 }
178 
removePrefPage(PreferencesPage * page)179 KDE_NO_EXPORT void Preferences::removePrefPage(PreferencesPage * page) {
180     QString item, subitem, icon;
181     page->prefLocation (item, icon, subitem);
182     if (item.isEmpty ())
183         return;
184     QMap<QString, QTabWidget *>::iterator en_it = entries.find (item);
185     if (en_it == entries.end ())
186         return;
187     QTabWidget * tab = en_it.value ();
188     for (int i = 0; i < tab->count (); i++)
189         if (tab->tabText (i) == subitem) {
190             QWidget* w = tab->widget (i);
191             tab->removeTab (i);
192             delete w;
193             break;
194         }
195     if (!tab->count ()) {
196         QWidget * w = tab->parentWidget ();
197         while (w && !w->inherits ("QFrame"))
198             w = w->parentWidget ();
199         delete w;
200         entries.erase (en_it);
201     }
202 }
203 
~Preferences()204 KDE_NO_CDTOR_EXPORT Preferences::~Preferences() {
205 }
206 
PrefGeneralPageGeneral(QWidget * parent,Settings *)207 KDE_NO_CDTOR_EXPORT PrefGeneralPageGeneral::PrefGeneralPageGeneral(QWidget *parent, Settings *)
208 : QWidget(parent)
209 {
210     QGroupBox *windowbox = new QGroupBox(i18n("Window"));
211     QWidget * bbox = new QWidget (windowbox);
212     QGridLayout * gridlayout = new QGridLayout (bbox/*, 2, 2*/);
213     keepSizeRatio = new QCheckBox (i18n ("Keep size ratio"), bbox);
214     keepSizeRatio->setWhatsThis(i18n("When checked, the movie will keep its aspect ratio\nwhen the window is resized."));
215     dockSysTray = new QCheckBox (i18n ("Dock in system tray"), bbox);
216     dockSysTray->setWhatsThis(i18n ("When checked, an icon for KMPlayer will be added to the system tray.\nWhen clicked, it will hide KMPlayer's main window and remove KMPlayer's task bar button."));
217     autoResize = new QCheckBox (i18n ("Auto resize to video sizes"), bbox);
218     autoResize->setWhatsThis(i18n("When checked, KMPlayer will resize to movie sizes\nwhen video starts."));
219     gridlayout->addWidget (keepSizeRatio, 0, 0);
220     gridlayout->addWidget (dockSysTray, 1, 0);
221     gridlayout->addWidget (autoResize, 0, 1);
222     QRadioButton* sizeexit = new QRadioButton(i18n("Remember window size on exit"));
223     QRadioButton* sizefixed = new QRadioButton (i18n("Always start with fixed size"));
224     sizesChoice = new QButtonGroup(windowbox);
225     sizesChoice->addButton(sizeexit, 0);
226     sizesChoice->addButton(sizefixed, 1);
227     QVBoxLayout* vbox = new QVBoxLayout;
228     vbox->addWidget(bbox);
229     vbox->addWidget(sizeexit);
230     vbox->addWidget(sizefixed);
231     windowbox->setLayout(vbox);
232 
233     QGroupBox *playbox = new QGroupBox(i18n("Playing"));
234     loop = new QCheckBox (i18n("Loop"));
235     loop->setWhatsThis(i18n("Makes current movie loop"));
236     framedrop = new QCheckBox (i18n ("Allow frame drops"));
237     framedrop->setWhatsThis(i18n ("Allow dropping frames for better audio and video synchronization"));
238     adjustvolume = new QCheckBox(i18n("Auto set volume on start"));
239     adjustvolume->setWhatsThis(i18n ("When a new source is selected, the volume will be set according the volume control"));
240     adjustcolors = new QCheckBox(i18n("Auto set colors on start"));
241     adjustcolors->setWhatsThis(i18n ("When a movie starts, the colors will be set according the sliders for colors"));
242     vbox = new QVBoxLayout;
243     vbox->addWidget(loop);
244     vbox->addWidget(framedrop);
245     vbox->addWidget(adjustvolume);
246     vbox->addWidget(adjustcolors);
247     playbox->setLayout(vbox);
248 
249     QGroupBox* controlbox = new QGroupBox(i18n("Control Panel"));
250     showConfigButton = new QCheckBox(i18n("Show config button"));
251     showConfigButton->setWhatsThis(i18n ("Add a button that will popup a config menu"));
252     showPlaylistButton = new QCheckBox(i18n("Show playlist button"));
253     showPlaylistButton->setWhatsThis(i18n ("Add a playlist button to the control buttons"));
254     showRecordButton = new QCheckBox(i18n("Show record button"));
255     showRecordButton->setWhatsThis(i18n ("Add a record button to the control buttons"));
256     showBroadcastButton = new QCheckBox (i18n ("Show broadcast button"));
257     showBroadcastButton->setWhatsThis(i18n ("Add a broadcast button to the control buttons"));
258     gridlayout = new QGridLayout;
259     gridlayout->addWidget (showConfigButton, 0, 0);
260     gridlayout->addWidget (showPlaylistButton, 0, 1);
261     gridlayout->addWidget (showRecordButton, 1, 0);
262     gridlayout->addWidget (showBroadcastButton, 1, 1);
263     QHBoxLayout *seekLayout = new QHBoxLayout;
264     seekLayout->addWidget(new QLabel(i18n("Forward/backward seek time:")));
265     seekLayout->addItem(new QSpacerItem(0,0,QSizePolicy::Minimum, QSizePolicy::Minimum));
266     KPluralHandlingSpinBox* pluralSeekBox = new KPluralHandlingSpinBox;
267     pluralSeekBox->setRange(1, 600);
268     pluralSeekBox->setSingleStep(1);
269     pluralSeekBox->setValue(10);
270 #if KDE_IS_VERSION(4, 2, 80)
271     pluralSeekBox->setSuffix(ki18np(" second", " seconds"));
272 #else
273     pluralSeekBox->setSuffix(i18n(" seconds"));
274 #endif
275     seekTime = pluralSeekBox;
276     seekLayout->addWidget(seekTime);
277     seekLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
278     gridlayout->addLayout (seekLayout, 2, 0, 1, 2);
279     controlbox->setLayout(gridlayout);
280 
281     QVBoxLayout* pagelayout = new QVBoxLayout;
282     pagelayout->setMargin(5);
283     pagelayout->setSpacing(2);
284     pagelayout->addWidget(windowbox);
285     pagelayout->addWidget(playbox);
286     pagelayout->addWidget(controlbox);
287     pagelayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
288     setLayout(pagelayout);
289 }
290 
PrefGeneralPageLooks(QWidget * parent,Settings * settings)291 KDE_NO_CDTOR_EXPORT PrefGeneralPageLooks::PrefGeneralPageLooks (QWidget *parent, Settings * settings)
292  : QWidget(parent), colors (settings->colors), fonts (settings->fonts)
293 {
294     QGroupBox *colorbox= new QGroupBox(i18n("Colors"));
295     colorscombo = new QComboBox;
296     for (int i = 0; i < int (ColorSetting::last_target); i++)
297         colorscombo->addItem (colors[i].title);
298     colorscombo->setCurrentIndex (0);
299     connect (colorscombo, SIGNAL (activated (int)),
300             this, SLOT (colorItemChanged(int)));
301     colorbutton = new KColorButton;
302     colorbutton->setColor (colors[0].color);
303     connect (colorbutton, SIGNAL (changed (const QColor &)),
304             this, SLOT (colorCanged (const QColor &)));
305     QHBoxLayout* hbox = new QHBoxLayout;
306     hbox->addWidget(colorscombo);
307     hbox->addWidget(colorbutton);
308     colorbox->setLayout(hbox);
309 
310     QGroupBox* fontbox = new QGroupBox(i18n ("Fonts"));
311     fontscombo = new QComboBox;
312     for (int i = 0; i < int (FontSetting::last_target); i++)
313         fontscombo->addItem (fonts[i].title);
314     fontscombo->setCurrentIndex (0);
315     connect (fontscombo, SIGNAL (activated (int)),
316             this, SLOT (fontItemChanged(int)));
317     fontbutton = new QPushButton(i18n ("AaBbCc"));
318     fontbutton->setFlat (true);
319     fontbutton->setFont (fonts[0].font);
320     connect (fontbutton, SIGNAL (clicked ()), this, SLOT (fontClicked ()));
321     hbox = new QHBoxLayout;
322     hbox->addWidget(fontscombo);
323     hbox->addWidget(fontbutton);
324     fontbox->setLayout(hbox);
325 
326     QVBoxLayout* vbox = new QVBoxLayout;
327     vbox->setMargin (5);
328     vbox->setSpacing (2);
329     vbox->addWidget(colorbox);
330     vbox->addWidget(fontbox);
331     vbox->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
332     setLayout(vbox);
333 }
334 
colorItemChanged(int c)335 KDE_NO_EXPORT void PrefGeneralPageLooks::colorItemChanged (int c) {
336     if (c < int (ColorSetting::last_target))
337         colorbutton->setColor (colors[c].newcolor);
338 }
339 
colorCanged(const QColor & c)340 KDE_NO_EXPORT void PrefGeneralPageLooks::colorCanged (const QColor & c) {
341     if (colorscombo->currentIndex () < int (ColorSetting::last_target))
342         colors[colorscombo->currentIndex ()].newcolor = c;
343 }
344 
fontItemChanged(int f)345 KDE_NO_EXPORT void PrefGeneralPageLooks::fontItemChanged (int f) {
346     if (f < int (FontSetting::last_target))
347         fontbutton->setFont (fonts[f].newfont);
348 }
349 
fontClicked()350 KDE_NO_EXPORT void PrefGeneralPageLooks::fontClicked () {
351     if (fontscombo->currentIndex () < int (FontSetting::last_target)) {
352         QFont myfont = fonts [fontscombo->currentIndex ()].newfont;
353         int res = KFontDialog::getFont (myfont, KFontChooser::NoDisplayFlags, this);
354         if (res == KFontDialog::Accepted) {
355             fonts [fontscombo->currentIndex ()].newfont = myfont;
356             fontbutton->setFont (myfont);
357         }
358     }
359 }
360 
PrefSourcePageURL(QWidget * parent)361 KDE_NO_CDTOR_EXPORT PrefSourcePageURL::PrefSourcePageURL (QWidget *parent)
362 : QWidget(parent)
363 {
364     setObjectName ("URLPage");
365     QHBoxLayout* urllayout = new QHBoxLayout;
366     QHBoxLayout* sub_urllayout = new QHBoxLayout;
367     QLabel *urlLabel = new QLabel(i18n("Location:"));
368     urllist = new KComboBox (true);
369     urllist->setMaxCount (20);
370     urllist->setDuplicatesEnabled (false); // not that it helps much :(
371     url = new KUrlRequester(urllist, NULL);
372     url->setWhatsThis(i18n ("Location of the playable item"));
373     //url->setShowLocalProtocol (true);
374     url->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Preferred));
375     QLabel *sub_urlLabel = new QLabel(i18n("Sub title:"));
376     sub_urllist = new KComboBox(true);
377     sub_urllist->setMaxCount (20);
378     sub_urllist->setDuplicatesEnabled (false); // not that it helps much :(
379     sub_url = new KUrlRequester(sub_urllist, NULL);
380     sub_url->setWhatsThis(i18n ("Optional location of a file containing the subtitles of the URL above"));
381     sub_url->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Preferred));
382     backend = new QListWidget;
383     clicktoplay = new QCheckBox(i18n("Load on demand"));
384     clicktoplay->setWhatsThis(i18n ("When enabled, all embedded movies will start with a image that needs to be clicked to start the video playback"));
385     grabhref = new QCheckBox(i18n("Grab image when 'Click to Play' detected"));
386     grabhref->setWhatsThis(i18n ("When enabled and a HTML object has a HREF attribute, grab and save an image of the first frame of initial link. This image will be shown instead of a default picture."));
387     urllayout->addWidget (urlLabel);
388     urllayout->addWidget (url);
389     sub_urllayout->addWidget (sub_urlLabel);
390     sub_urllayout->addWidget (sub_url);
391 
392     QGridLayout * gridlayout = new QGridLayout (/*2, 2*/);
393     QLabel *backendLabel = new QLabel(i18n ("Use movie player:"));
394     //QWhatsThis::add (allowhref, i18n ("Explain this in a few lines"));
395     gridlayout->addWidget (backendLabel, 0, 0);
396     gridlayout->addWidget (backend, 1, 0);
397     gridlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1, 1, 1);
398 
399     QGroupBox *bandwidthbox = new QGroupBox(i18n("Network bandwidth"));
400     prefBitRate = new QLineEdit;
401     prefBitRate->setValidator( new QIntValidator( prefBitRate ) );
402     prefBitRate->setWhatsThis(i18n("Sometimes it is possible to choose between various streams given a particular bitrate.\nThis option sets how much bandwidth you would prefer to allocate to video."));
403     maxBitRate = new QLineEdit;
404     maxBitRate->setValidator( new QIntValidator( maxBitRate ) );
405     maxBitRate->setWhatsThis(i18n("Sometimes it is possible to choose between various streams given a particular bitrate.\nThis option sets the maximum bandwidth you have available for video."));
406     QGridLayout* bitratelayout = new QGridLayout;
407     bitratelayout->addWidget(new QLabel(i18n("Preferred bitrate:")), 0, 0);
408     bitratelayout->addWidget (prefBitRate, 0, 1);
409     bitratelayout->addWidget (new QLabel (i18n ("kbit/s")), 0, 2);
410     bitratelayout->addWidget (new QLabel(i18n("Maximum bitrate:")), 1, 0);
411     bitratelayout->addWidget (maxBitRate, 1, 1);
412     bitratelayout->addWidget (new QLabel (i18n ("kbit/s")), 1, 2);
413     bandwidthbox->setLayout(bitratelayout);
414 
415     QVBoxLayout* vbox = new QVBoxLayout;
416     vbox->setMargin(5);
417     vbox->setSpacing(2);
418     vbox->addLayout(urllayout);
419     vbox->addLayout(sub_urllayout);
420     vbox->addItem (new QSpacerItem (0, 10, QSizePolicy::Minimum, QSizePolicy::Minimum));
421     vbox->addWidget(clicktoplay);
422     vbox->addWidget(grabhref);
423     vbox->addItem (new QSpacerItem (0, 10, QSizePolicy::Minimum, QSizePolicy::Minimum));
424     vbox->addWidget(bandwidthbox);
425     vbox->addItem (new QSpacerItem (0, 10, QSizePolicy::Minimum, QSizePolicy::Minimum));
426     vbox->addLayout(gridlayout);
427     vbox->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
428     setLayout(vbox);
429 
430     connect (url, SIGNAL(textChanged(const QString&)),
431              this, SLOT (slotTextChanged (const QString &)));
432     connect (sub_url, SIGNAL(textChanged(const QString&)),
433              this, SLOT (slotTextChanged (const QString &)));
434 }
435 
slotBrowse()436 KDE_NO_EXPORT void PrefSourcePageURL::slotBrowse () {
437 }
438 
slotTextChanged(const QString &)439 KDE_NO_EXPORT void PrefSourcePageURL::slotTextChanged (const QString &) {
440     changed = true;
441 }
442 
PrefRecordPage(QWidget * parent,PartBase * player,RecorderPage * rl,int rec_len)443 KDE_NO_CDTOR_EXPORT PrefRecordPage::PrefRecordPage(QWidget* parent,
444         PartBase * player, RecorderPage * rl, int rec_len)
445  : QWidget(parent),
446    m_player (player),
447    m_recorders (rl),
448    m_recorders_length (rec_len)
449 {
450     setObjectName ("RecordPage");
451     QHBoxLayout * urllayout = new QHBoxLayout ();
452     QLabel* urlLabel = new QLabel(i18n("Output file:"));
453     url = new KUrlRequester;
454     urllayout->addWidget (urlLabel);
455     urllayout->addWidget (url);
456 
457     source = new QLabel (i18n ("Current source: ") +
458            (m_player->source () ? m_player->source ()->prettyName () : QString ()));
459     QGroupBox* group = new QGroupBox(i18n("Recorder"));
460     QVBoxLayout *vbox = new QVBoxLayout;
461     recorder = new QButtonGroup;
462     int id = 0;
463     for (RecorderPage* p = m_recorders; p; p = p->next) {
464         QRadioButton* button = new QRadioButton(p->name());
465         vbox->addWidget(button);
466         recorder->addButton(button, id++);
467     }
468     recorder->button(0)->setChecked(true); // for now
469     group->setLayout(vbox);
470 
471     QGroupBox* autogroup = new QGroupBox(i18n("Auto Playback"));
472     vbox = new QVBoxLayout;
473     replay = new QButtonGroup;
474     QRadioButton* radio = new QRadioButton (i18n ("&No"));
475     vbox->addWidget(radio);
476     replay->addButton(radio, 0);
477     radio = new QRadioButton (i18n ("&When recording finished"));
478     vbox->addWidget(radio);
479     replay->addButton(radio, 1);
480     radio = new QRadioButton (i18n ("A&fter"));
481     vbox->addWidget(radio);
482     replay->addButton(radio, 2);
483     QWidget* customreplay = new QWidget;
484     KPluralHandlingSpinBox* pluralReplayBox = new KPluralHandlingSpinBox;
485     pluralReplayBox = new KPluralHandlingSpinBox;
486 #if KDE_IS_VERSION(4, 2, 80)
487     pluralReplayBox->setSuffix(ki18np(" second", " seconds"));
488 #else
489     pluralReplayBox->setSuffix(i18n(" seconds"));
490 #endif
491     replaytime = pluralReplayBox;
492     QHBoxLayout *replaylayout = new QHBoxLayout;
493     replaylayout->addWidget(new QLabel(i18n("Time:")));
494     replaylayout->addWidget (replaytime);
495     replaylayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
496     customreplay->setLayout(replaylayout);
497     vbox->addWidget(customreplay);
498     autogroup->setLayout(vbox);
499 
500     recordButton = new QPushButton (i18n ("Start &Recording"));
501     QHBoxLayout *buttonlayout = new QHBoxLayout;
502     buttonlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
503     buttonlayout->addWidget (recordButton);
504 #ifdef KMPLAYER_WITH_XINE
505     connect (recorder, SIGNAL (clicked(int)), this, SLOT(recorderClicked(int)));
506 #endif
507     //connect(replay, SIGNAL(buttonClicked (int)), this, SLOT (replayClicked (int)));
508     connect (player, SIGNAL (recording (bool)), this, SLOT (recording (bool)));
509     connect(recordButton, SIGNAL(clicked()), this, SLOT(slotRecord()));
510 
511     QVBoxLayout* pagelayout = new QVBoxLayout;
512     pagelayout->setMargin(5);
513     pagelayout->setSpacing(2);
514     pagelayout->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
515     pagelayout->addLayout(urllayout);
516     pagelayout->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
517     pagelayout->addWidget(source);
518     pagelayout->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
519     pagelayout->addWidget(group);
520     pagelayout->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
521     pagelayout->addWidget(autogroup);
522     pagelayout->addLayout(buttonlayout);
523     pagelayout->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
524     setLayout(pagelayout);
525 }
526 
~PrefRecordPage()527 PrefRecordPage::~PrefRecordPage () {
528 }
529 
recording(bool on)530 KDE_NO_EXPORT void PrefRecordPage::recording (bool on) {
531     kDebug() << "PrefRecordPage::recording " << on << endl;
532     recordButton->setText (on
533             ? i18n ("Stop &Recording")
534             : i18n ("Start &Recording"));
535     url->setEnabled (!on);
536     if (on)
537         topLevelWidget ()->hide ();
538 }
539 
showEvent(QShowEvent * e)540 KDE_NO_EXPORT void PrefRecordPage::showEvent (QShowEvent *e) {
541     Source *src = m_player->source ();
542     if (recordButton->text () == i18n ("Start &Recording") && src &&
543             src->current ()) {
544         int id = 0;
545         int nr_recs = 0;
546         for (RecorderPage * p = m_recorders; p; p = p->next, ++id) {
547             QAbstractButton * radio = recorder->button(id);
548             bool b = m_player->mediaManager ()->recorderInfos ()
549                 [p->recorderName ()]->supports (src->name ());
550             radio->setEnabled (b);
551             if (b) nr_recs++;
552         }
553         source_url = src->current ()->src;
554         source->setText (i18n ("Current Source: ") + source_url);
555         recordButton->setEnabled (nr_recs > 0);
556     }
557     QWidget::showEvent (e);
558 }
559 
recorderClicked(int)560 KDE_NO_EXPORT void PrefRecordPage::recorderClicked (int /*id*/) {
561     /*bool b = recorder->button(id)->text().indexOf (QString::fromLatin1("Xine")) > -1;
562     replay->setEnabled (!b);
563     if (b)
564         replay->setButton (Settings::ReplayNo);*/
565 
566 }
567 
replayClicked(int id)568 KDE_NO_EXPORT void PrefRecordPage::replayClicked (int id) {
569     replaytime->setEnabled (id == Settings::ReplayAfter);
570 }
571 
slotRecord()572 KDE_NO_EXPORT void PrefRecordPage::slotRecord () {
573     if (m_player->isRecording ()) {
574         m_player->stopRecording ();
575     } else if (!url->lineEdit()->text().isEmpty()) {
576         m_player->source ()->document ()->reset ();
577         m_player->settings ()->recordfile = url->lineEdit()->text();
578         m_player->settings ()->replaytime = replaytime->value();
579         int id = recorder->checkedId ();
580         int replayid = replay->checkedId ();
581         m_player->settings ()->recorder = Settings::Recorder (id);
582         m_player->settings ()->replayoption = Settings::ReplayOption (replayid);
583         for (RecorderPage * p = m_recorders; p; p = p->next)
584             if (id-- == 0) {
585                 int start_after = 0;
586                 if (replay->checkedId () == Settings::ReplayAfter) {
587                     int t = replaytime->value ();
588                     if (t > 0)
589                         start_after = 1000 * t;
590                 } else if (replay->checkedId () != Settings::ReplayNo) {
591                     start_after = -1;
592                 }
593                 p->startRecording ();
594                 m_player->record (source_url, url->lineEdit()->text(),
595                         p->recorderName (), start_after);
596                 break;
597             }
598     }
599 }
600 
RecorderPage(QWidget * parent,PartBase * player)601 KDE_NO_CDTOR_EXPORT RecorderPage::RecorderPage (QWidget *parent, PartBase * player)
602  : QWidget(parent), next(0L), m_player(player) {}
603 
PrefMEncoderPage(QWidget * parent,PartBase * player)604 KDE_NO_CDTOR_EXPORT PrefMEncoderPage::PrefMEncoderPage(QWidget* parent, PartBase* player)
605     : RecorderPage (parent, player)
606 {
607     QGroupBox* formatbox = new QGroupBox(i18n("Format"));
608     QVBoxLayout* vbox = new QVBoxLayout;
609     format = new QButtonGroup(this);
610     QRadioButton* radio = new QRadioButton (i18n ("Same as source"));
611     vbox->addWidget(radio);
612     format->addButton(radio, 0);
613     radio = new QRadioButton (i18n ("Custom"));
614     vbox->addWidget(radio);
615     format->addButton(radio, 1);
616     QGridLayout* gridlayout = new QGridLayout;
617     QLabel *argLabel = new QLabel (i18n("Mencoder arguments:"));
618     arguments = new QLineEdit ("");
619     gridlayout->addWidget (argLabel, 0, 0);
620     gridlayout->addWidget (arguments, 0, 1);
621     vbox->addLayout(gridlayout);
622     formatbox->setLayout(vbox);
623     connect (format, SIGNAL (buttonClicked (int)), this, SLOT (formatClicked (int)));
624 
625     QVBoxLayout* pagelayout = new QVBoxLayout;
626     pagelayout->setMargin(5);
627     pagelayout->setSpacing(2);
628     pagelayout->addWidget(formatbox);
629     pagelayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
630     setLayout(pagelayout);
631 }
632 
formatClicked(int id)633 KDE_NO_EXPORT void PrefMEncoderPage::formatClicked (int id) {
634     arguments->setEnabled (!!id);
635 }
636 
startRecording()637 KDE_NO_EXPORT void PrefMEncoderPage::startRecording () {
638     m_player->settings ()->recordcopy = !format->checkedId ();
639     m_player->settings ()->mencoderarguments = arguments->text ();
640 }
641 
name()642 KDE_NO_EXPORT QString PrefMEncoderPage::name () {
643     return i18n ("&MEncoder");
644 }
645 
PrefMPlayerDumpstreamPage(QWidget * parent,PartBase * player)646 KDE_NO_CDTOR_EXPORT PrefMPlayerDumpstreamPage::PrefMPlayerDumpstreamPage (QWidget *parent, PartBase * player) : RecorderPage (parent, player) {
647     hide();
648 }
649 
name()650 KDE_NO_EXPORT QString PrefMPlayerDumpstreamPage::name () {
651     return i18n ("MPlayer -&dumpstream");
652 }
653 
PrefFFMpegPage(QWidget * parent,PartBase * player)654 KDE_NO_CDTOR_EXPORT PrefFFMpegPage::PrefFFMpegPage(QWidget* parent, PartBase* player)
655     : RecorderPage(parent, player)
656 {
657     QGridLayout *gridlayout = new QGridLayout (/*1, 2, 2*/);
658     QLabel *argLabel = new QLabel (i18n("FFMpeg arguments:"));
659     arguments = new QLineEdit ("");
660     gridlayout->addWidget (argLabel, 0, 0);
661     gridlayout->addWidget (arguments, 0, 1);
662 
663     QVBoxLayout* pagelayout = new QVBoxLayout;
664     pagelayout->setMargin(5);
665     pagelayout->setSpacing(2);
666     pagelayout->addLayout (gridlayout);
667     pagelayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
668     setLayout(pagelayout);
669 }
670 
startRecording()671 KDE_NO_EXPORT void PrefFFMpegPage::startRecording () {
672     m_player->settings ()->ffmpegarguments = arguments->text ();
673 }
674 
name()675 KDE_NO_EXPORT QString PrefFFMpegPage::name () {
676     return i18n ("&FFMpeg");
677 }
678 
679 #ifdef KMPLAYER_WITH_XINE
PrefXinePage(QWidget * parent,PartBase * player)680 KDE_NO_CDTOR_EXPORT PrefXinePage::PrefXinePage (QWidget *parent, PartBase * player) : RecorderPage (parent, player) {
681     hide();
682 }
683 
name()684 KDE_NO_EXPORT QString PrefXinePage::name () {
685     return i18n ("&Xine");
686 }
687 #endif
688 
PrefGeneralPageOutput(QWidget * parent,OutputDriver * ad,OutputDriver * vd)689 KDE_NO_CDTOR_EXPORT PrefGeneralPageOutput::PrefGeneralPageOutput(QWidget *parent, OutputDriver * ad, OutputDriver * vd)
690  : QWidget(parent)
691 {
692     videoDriver = new QListWidget;
693     for (int i = 0; vd[i].driver; i++)
694         videoDriver->addItem(vd[i].description);
695     videoDriver->setWhatsThis(i18n("Sets video driver. Recommended is XVideo, or, if it is not supported, X11, which is slower."));
696 
697     audioDriver = new QListWidget;
698     for (int i = 0; ad[i].driver; i++)
699         audioDriver->addItem(ad[i].description);
700 
701     QVBoxLayout* pagelayout = new QVBoxLayout;
702     pagelayout->setMargin(5);
703     pagelayout->setSpacing(2);
704     pagelayout->addWidget(videoDriver);
705     pagelayout->addWidget(audioDriver);
706     pagelayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
707     setLayout(pagelayout);
708 }
709 
PrefOPPagePostProc(QWidget * parent)710 KDE_NO_CDTOR_EXPORT PrefOPPagePostProc::PrefOPPagePostProc(QWidget *parent)
711     : QWidget(parent)
712 {
713     postProcessing = new QCheckBox(i18n("Enable use of postprocessing filters"));
714     postProcessing->setEnabled( true );
715     disablePPauto = new QCheckBox(i18n("Disable use of postprocessing when watching TV/DVD"));
716 
717     PostprocessingOptions = new QTabWidget;
718     PostprocessingOptions->setEnabled (true);
719     //PostprocessingOptions->setAutoMask (false);
720     PostprocessingOptions->setTabShape( QTabWidget::Rounded );
721     PostprocessingOptions->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ));
722 
723     QGroupBox* presetSelection = new QGroupBox;
724     defaultPreset = new QRadioButton (i18n ("Default"));
725     customPreset = new QRadioButton (i18n ("Custom"));
726     fastPreset = new QRadioButton (i18n ("Fast"));
727     defaultPreset->setChecked( true );
728     QVBoxLayout* vbox = new QVBoxLayout;
729     vbox->addWidget(defaultPreset);
730     vbox->addWidget(customPreset);
731     vbox->addWidget(fastPreset);
732     QButtonGroup* buttongroup = new QButtonGroup(presetSelection);
733     buttongroup->addButton(defaultPreset, 0);
734     buttongroup->addButton(customPreset, 1);
735     buttongroup->addButton(fastPreset, 2);
736     vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
737     presetSelection->setLayout(vbox);
738     PostprocessingOptions->addTab(presetSelection, i18n("General"));
739 
740     //
741     // SECOND!!!
742     //
743     /* I JUST WASN'T ABLE TO GET THIS WORKING WITH QGridLayouts */
744     QVBoxLayout *customFiltersLayout = new QVBoxLayout;
745 
746     QGroupBox *customFilters = new QGroupBox;
747     customFilters->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum));
748     customFilters->setFlat(false);
749     customFilters->setEnabled( false );
750     //customFilters->setInsideSpacing(7);
751 
752     QHBoxLayout* hbox = new QHBoxLayout;
753     HzDeblockFilter = new QCheckBox (i18n ("Horizontal deblocking"));
754     HzDeblockAQuality = new QCheckBox (i18n ("Auto quality"));
755     HzDeblockAQuality->setEnabled (false);
756     HzDeblockCFiltering = new QCheckBox (i18n ("Chrominance filtering"));
757     HzDeblockCFiltering->setEnabled (false);
758     hbox->addWidget( HzDeblockFilter );
759     hbox->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ) );
760     hbox->addWidget( HzDeblockAQuality );
761     hbox->addWidget( HzDeblockCFiltering );
762     customFiltersLayout->addLayout(hbox);
763 
764     QFrame* line = new QFrame;
765     line->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum ) );
766     line->setFrameShape( QFrame::HLine );
767     line->setFrameShadow( QFrame::Sunken );
768     customFiltersLayout->addWidget(line);
769 
770     hbox = new QHBoxLayout;
771     VtDeblockFilter = new QCheckBox(i18n("Vertical deblocking"));
772     VtDeblockAQuality = new QCheckBox (i18n ("Auto quality"));
773     VtDeblockAQuality->setEnabled (false);
774     VtDeblockCFiltering = new QCheckBox (i18n ("Chrominance filtering"));
775     VtDeblockCFiltering->setEnabled (false);
776     hbox->addWidget( VtDeblockFilter );
777     hbox->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ) );
778     hbox->addWidget( VtDeblockAQuality );
779     hbox->addWidget( VtDeblockCFiltering );
780     customFiltersLayout->addLayout(hbox);
781 
782     line = new QFrame;
783     line->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum ) );
784     line->setFrameShape( QFrame::HLine );
785     line->setFrameShadow( QFrame::Sunken );
786     customFiltersLayout->addWidget(line);
787 
788     hbox = new QHBoxLayout;
789     DeringFilter = new QCheckBox (i18n ("Dering filter"));
790     DeringAQuality = new QCheckBox (i18n ("Auto quality"));
791     DeringAQuality->setEnabled (false);
792     DeringCFiltering=new QCheckBox(i18n("Chrominance filtering"));
793     DeringCFiltering->setEnabled (false);
794     hbox->addWidget( DeringFilter );
795     hbox->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ) );
796     hbox->addWidget( DeringAQuality );
797     hbox->addWidget( DeringCFiltering );
798     customFiltersLayout->addLayout(hbox);
799 
800     line = new QFrame;
801     line->setFrameShape( QFrame::HLine );
802     line->setFrameShadow( QFrame::Sunken );
803     line->setFrameShape( QFrame::HLine );
804     customFiltersLayout->addWidget(line);
805 
806     hbox = new QHBoxLayout;
807     AutolevelsFilter = new QCheckBox (i18n ("Auto brightness/contrast"));
808     AutolevelsFullrange = new QCheckBox (i18n ("Stretch luminance to full range"));
809     AutolevelsFullrange->setEnabled (false);
810     hbox->addWidget(AutolevelsFilter);
811     hbox->addItem(new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ));
812     hbox->addWidget(AutolevelsFullrange);
813     customFiltersLayout->addLayout(hbox);
814 
815     hbox = new QHBoxLayout;
816     TmpNoiseFilter =new QCheckBox(i18n("Temporal noise reducer"),customFilters);
817     /*	Note: Change TmpNoiseFilter text back to "Label:" if this slider gets reactivated
818         TmpNoiseSlider = new QSlider( customFilters, "TmpNoiseSlider" );
819         TmpNoiseSlider->setEnabled( false );
820         TmpNoiseSlider->setMinValue( 1 );
821         TmpNoiseSlider->setMaxValue( 3 );
822         TmpNoiseSlider->setValue( 1 );
823         TmpNoiseSlider->setOrientation( QSlider::Horizontal );
824         TmpNoiseSlider->setTickmarks( QSlider::Left );
825         TmpNoiseSlider->setTickInterval( 1 );
826         TmpNoiseSlider->setSizePolicy(QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum);*/
827 
828     /*customFiltersLayout->addWidget(TmpNoiseFilter,7,0);
829       customFiltersLayout->addWidget(TmpNoiseSlider,7,2);*/
830     hbox->addWidget(TmpNoiseFilter);
831     hbox->addItem(new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ));
832     //hbox->addWidget(TmpNoiseSlider);
833     customFiltersLayout->addLayout(hbox);
834 
835     customFiltersLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
836     customFilters->setLayout(customFiltersLayout);
837 
838     PostprocessingOptions->addTab(customFilters, i18n("Custom Preset"));
839     //
840     //THIRD!!!
841     //
842     QGroupBox* deintSelectionWidget = new QGroupBox;
843     vbox = new QVBoxLayout;
844     LinBlendDeinterlacer = new QCheckBox(i18n ("Linear blend deinterlacer"));
845     LinIntDeinterlacer = new QCheckBox(i18n ("Linear interpolating deinterlacer"));
846     CubicIntDeinterlacer = new QCheckBox(i18n ("Cubic interpolating deinterlacer"));
847     MedianDeinterlacer = new QCheckBox(i18n ("Median deinterlacer"));
848     FfmpegDeinterlacer = new QCheckBox(i18n ("FFmpeg deinterlacer"));
849     vbox->addWidget(LinBlendDeinterlacer);
850     vbox->addWidget(LinIntDeinterlacer);
851     vbox->addWidget(CubicIntDeinterlacer);
852     vbox->addWidget(MedianDeinterlacer);
853     vbox->addWidget(FfmpegDeinterlacer);
854     vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
855     deintSelectionWidget->setLayout(vbox);
856     PostprocessingOptions->addTab(deintSelectionWidget, i18n( "Deinterlacing"));
857 
858     QVBoxLayout* pagelayout = new QVBoxLayout;
859     pagelayout->setMargin(5);
860     pagelayout->setSpacing(2);
861     pagelayout->addWidget(postProcessing);
862     pagelayout->addWidget(disablePPauto);
863     pagelayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum));
864     pagelayout->addWidget(PostprocessingOptions);
865     pagelayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
866     setLayout(pagelayout);
867 
868     PostprocessingOptions->setEnabled(false);
869     connect( customPreset, SIGNAL (toggled(bool) ), customFilters, SLOT(setEnabled(bool)));
870     connect( postProcessing, SIGNAL( toggled(bool) ), PostprocessingOptions, SLOT( setEnabled(bool) ) );
871     connect( HzDeblockFilter, SIGNAL( toggled(bool) ), HzDeblockAQuality, SLOT( setEnabled(bool) ) );
872     connect( HzDeblockFilter, SIGNAL( toggled(bool) ), HzDeblockCFiltering, SLOT( setEnabled(bool) ) );
873     connect( VtDeblockFilter, SIGNAL( toggled(bool) ), VtDeblockCFiltering, SLOT( setEnabled(bool) ) );
874     connect( VtDeblockFilter, SIGNAL( toggled(bool) ), VtDeblockAQuality, SLOT( setEnabled(bool) ) );
875     connect( DeringFilter, SIGNAL( toggled(bool) ), DeringAQuality, SLOT( setEnabled(bool) ) );
876     connect( DeringFilter, SIGNAL( toggled(bool) ), DeringCFiltering, SLOT( setEnabled(bool) ) );
877     //connect( TmpNoiseFilter, SIGNAL( toggled(bool) ), TmpNoiseSlider, SLOT( setEnabled(bool) ) );
878 
879     connect( AutolevelsFilter, SIGNAL( toggled(bool) ), AutolevelsFullrange, SLOT( setEnabled(bool) ) );
880 
881     defaultPreset->setWhatsThis(i18n( "Enable mplayer's default postprocessing filters" ) );
882     customPreset->setWhatsThis(i18n( "Enable custom postprocessing filters (See: Custom preset -tab)" ) );
883     fastPreset->setWhatsThis(i18n( "Enable mplayer's fast postprocessing filters" ) );
884     HzDeblockAQuality->setWhatsThis(i18n( "Filter is used if there is enough CPU" ) );
885     VtDeblockAQuality->setWhatsThis(i18n( "Filter is used if there is enough CPU" ) );
886     DeringAQuality->setWhatsThis(i18n( "Filter is used if there is enough CPU" ) );
887     //QWhatsThis::add( TmpNoiseSlider, i18n( "Strength of the noise reducer" ) );
888     AutolevelsFullrange->setWhatsThis(i18n( "Stretches luminance to full range (0..255)" ) );
889     PostprocessingOptions->adjustSize();
890 }
891 
confirmDefaults()892 KDE_NO_EXPORT void Preferences::confirmDefaults() {
893     // TODO: Switch to KMessageBox
894     switch( QMessageBox::warning( this, i18n("Reset Settings?"),
895                 i18n("You are about to have all your settings overwritten with defaults.\nPlease confirm.\n"),
896                 i18n ("&OK"), i18n ("&Cancel"), QString (), 0, 1)) {
897         case 0:	Preferences::setDefaults();
898                 break;
899         case 1:	break;
900     }
901 }
902 
setDefaults()903 KDE_NO_EXPORT void Preferences::setDefaults() {
904 	m_GeneralPageGeneral->keepSizeRatio->setChecked(true);
905 	m_GeneralPageGeneral->loop->setChecked(false);
906 	m_GeneralPageGeneral->seekTime->setValue(10);
907 
908 	m_GeneralPageOutput->videoDriver->setCurrentRow(0);
909 	m_GeneralPageOutput->audioDriver->setCurrentRow(0);
910 
911 	m_OPPagePostproc->postProcessing->setChecked(false);
912 	m_OPPagePostproc->disablePPauto->setChecked(true);
913 
914 	m_OPPagePostproc->defaultPreset->setChecked(true);
915 
916 	m_OPPagePostproc->LinBlendDeinterlacer->setChecked(false);
917 	m_OPPagePostproc->LinIntDeinterlacer->setChecked(false);
918 	m_OPPagePostproc->CubicIntDeinterlacer->setChecked(false);
919 	m_OPPagePostproc->MedianDeinterlacer->setChecked(false);
920 	m_OPPagePostproc->FfmpegDeinterlacer->setChecked(false);
921 
922 }
923 #include "pref.moc"
924