source: smplayer/vendor/current/src/prefgeneral.cpp

Last change on this file was 186, checked in by Silvan Scherrer, 8 years ago

SMPlayer: update vendor to 17.1.0

File size: 39.9 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
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
20#include "prefgeneral.h"
21#include "preferences.h"
22#include "filedialog.h"
23#include "images.h"
24#include "mediasettings.h"
25#include "paths.h"
26#include "vdpauproperties.h"
27#include "playerid.h"
28
29#if USE_ALSA_DEVICES || USE_PULSEAUDIO_DEVICES || USE_XV_ADAPTORS || USE_DSOUND_DEVICES
30#include "deviceinfo.h"
31#endif
32
33#ifdef MPLAYER_MPV_SELECTION
34 #define PLAYER_COMBO_MPLAYER 0
35 #define PLAYER_COMBO_MPV 1
36 #define PLAYER_COMBO_OTHER 2
37
38 #ifdef Q_OS_WIN
39 #define PLAYER_COMBO_MPLAYER_PATH "mplayer/mplayer.exe"
40 #define PLAYER_COMBO_MPV_PATH "mpv/mpv.exe"
41 #else
42 #define PLAYER_COMBO_MPLAYER_PATH "mplayer"
43 #define PLAYER_COMBO_MPV_PATH "mpv"
44 #endif
45#endif
46
47PrefGeneral::PrefGeneral(QWidget * parent, Qt::WindowFlags f)
48 : PrefWidget(parent, f )
49{
50 setupUi(this);
51
52 mplayerbin_edit->setDialogType(FileChooser::GetFileName);
53 screenshot_edit->setDialogType(FileChooser::GetDirectory);
54
55 // Read driver info from InfoReader:
56 InfoReader * i = InfoReader::obj();
57 i->getInfo();
58 vo_list = i->voList();
59 ao_list = i->aoList();
60
61#if USE_DSOUND_DEVICES
62 dsound_devices = DeviceInfo::dsoundDevices();
63#endif
64
65#if USE_ALSA_DEVICES
66 alsa_devices = DeviceInfo::alsaDevices();
67#endif
68#if USE_MPV_ALSA_DEVICES
69 mpv_alsa_devices = DeviceInfo::mpvAlsaDevices();
70#endif
71#if USE_PULSEAUDIO_DEVICES
72 pa_devices = DeviceInfo::paDevices();
73#endif
74#if USE_XV_ADAPTORS
75 xv_adaptors = DeviceInfo::xvAdaptors();
76#endif
77
78 // Screensaver
79#ifdef Q_OS_WIN
80 screensaver_check->hide();
81 #ifndef SCREENSAVER_OFF
82 turn_screensaver_off_check->hide();
83 #endif
84 #ifndef AVOID_SCREENSAVER
85 avoid_screensaver_check->hide();
86 #endif
87#else
88 screensaver_group->hide();
89#endif
90
91#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
92 vdpau_button->hide();
93#endif
94
95#ifndef AUTO_SHUTDOWN_PC
96 shutdown_widget->hide();
97#endif
98
99#ifndef ADD_BLACKBORDERS_FS
100 blackborders_on_fs_check->hide();
101#endif
102
103#ifndef INITIAL_BLACKBORDERS
104 blackborders_check->hide();
105#endif
106
107#ifdef MPV_SUPPORT
108 screenshot_format_combo->addItems(QStringList() << "png" << "ppm" << "pgm" << "pgmyuv" << "tga" << "jpg" << "jpeg");
109#else
110 screenshot_template_label->hide();
111 screenshot_template_edit->hide();
112 screenshot_format_label->hide();
113 screenshot_format_combo->hide();
114#endif
115
116 // Channels combo
117 channels_combo->addItem( "2", MediaSettings::ChStereo );
118 channels_combo->addItem( "4", MediaSettings::ChSurround );
119 channels_combo->addItem( "6", MediaSettings::ChFull51 );
120 channels_combo->addItem( "7", MediaSettings::ChFull61 );
121 channels_combo->addItem( "8", MediaSettings::ChFull71 );
122
123#ifdef MPLAYER_MPV_SELECTION
124 connect(player_combo, SIGNAL(currentIndexChanged(int)),
125 this, SLOT(player_combo_changed(int)));
126#else
127 player_combo->hide();
128 player_spacer->changeSize(0, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
129#endif
130
131 connect(vo_combo, SIGNAL(currentIndexChanged(int)),
132 this, SLOT(vo_combo_changed(int)));
133 connect(ao_combo, SIGNAL(currentIndexChanged(int)),
134 this, SLOT(ao_combo_changed(int)));
135
136 retranslateStrings();
137}
138
139PrefGeneral::~PrefGeneral()
140{
141}
142
143QString PrefGeneral::sectionName() {
144 return tr("General");
145}
146
147QPixmap PrefGeneral::sectionIcon() {
148 return Images::icon("pref_general");
149}
150
151void PrefGeneral::retranslateStrings() {
152 retranslateUi(this);
153
154#ifdef MPLAYER_MPV_SELECTION
155 int player_item = player_combo->currentIndex();
156 player_combo->clear();
157 player_combo->addItem("mplayer", PLAYER_COMBO_MPLAYER);
158 player_combo->addItem("mpv", PLAYER_COMBO_MPV);
159 player_combo->addItem(tr("Other..."), PLAYER_COMBO_OTHER);
160 player_combo->setCurrentIndex(player_item);
161#endif
162
163 channels_combo->setItemText(0, tr("2 (Stereo)") );
164 channels_combo->setItemText(1, tr("4 (4.0 Surround)") );
165 channels_combo->setItemText(2, tr("6 (5.1 Surround)") );
166 channels_combo->setItemText(3, tr("7 (6.1 Surround)") );
167 channels_combo->setItemText(4, tr("8 (7.1 Surround)") );
168
169 int deinterlace_item = deinterlace_combo->currentIndex();
170 deinterlace_combo->clear();
171 deinterlace_combo->addItem( tr("None"), MediaSettings::NoDeinterlace );
172 deinterlace_combo->addItem( tr("Lowpass5"), MediaSettings::L5 );
173 deinterlace_combo->addItem( tr("Yadif (normal)"), MediaSettings::Yadif );
174 deinterlace_combo->addItem( tr("Yadif (double framerate)"), MediaSettings::Yadif_1 );
175 deinterlace_combo->addItem( tr("Linear Blend"), MediaSettings::LB );
176 deinterlace_combo->addItem( tr("Kerndeint"), MediaSettings::Kerndeint );
177 deinterlace_combo->setCurrentIndex(deinterlace_item);
178
179 int filesettings_method_item = filesettings_method_combo->currentIndex();
180 filesettings_method_combo->clear();
181 filesettings_method_combo->addItem( tr("one ini file"), "normal");
182 filesettings_method_combo->addItem( tr("multiple ini files"), "hash");
183 filesettings_method_combo->setCurrentIndex(filesettings_method_item);
184
185 updateDriverCombos();
186
187 // Icons
188 /*
189 resize_window_icon->setPixmap( Images::icon("resize_window") );
190 volume_icon->setPixmap( Images::icon("speaker") );
191 */
192
193 mplayerbin_edit->setCaption(tr("Select the %1 executable").arg(PLAYER_NAME));
194#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
195 mplayerbin_edit->setFilter(tr("Executables") +" (*.exe)");
196#else
197 mplayerbin_edit->setFilter(tr("All files") +" (*)");
198#endif
199 screenshot_edit->setCaption(tr("Select a directory"));
200
201 preferred_desc->setText(
202 tr("Here you can type your preferred language for the audio "
203 "and subtitle streams. When a media with multiple audio or "
204 "subtitle streams is found, SMPlayer will try to use your "
205 "preferred language. This only will work with media that offer "
206 "info about the language of audio and subtitle streams, like DVDs "
207 "or mkv files.<br>These fields accept regular expressions. "
208 "Example: <b>es|esp|spa</b> will select the track if it matches with "
209 "<i>es</i>, <i>esp</i> or <i>spa</i>."));
210
211#ifndef MPLAYER_MPV_SELECTION
212 executable_label->setText( tr("%1 &executable:").arg(PLAYER_NAME) );
213#endif
214
215 createHelp();
216}
217
218void PrefGeneral::setData(Preferences * pref) {
219 setMplayerPath( pref->mplayer_bin );
220
221 setUseScreenshots( pref->use_screenshot );
222 setScreenshotDir( pref->screenshot_directory );
223#ifdef MPV_SUPPORT
224 screenshot_template_edit->setText( pref->screenshot_template );
225 setScreenshotFormat(pref->screenshot_format);
226#endif
227
228 setVO( pref->vo );
229 setAO( pref->ao );
230
231 setRememberSettings( pref->remember_media_settings );
232 setRememberTimePos( pref->remember_time_pos );
233 remember_streams_check->setChecked(pref->remember_stream_settings);
234
235 setFileSettingsMethod( pref->file_settings_method );
236 setAudioLang( pref->audio_lang );
237 setSubtitleLang( pref->subtitle_lang );
238 setAudioTrack( pref->initial_audio_track );
239 setSubtitleTrack( pref->initial_subtitle_track );
240 setCloseOnFinish( pref->close_on_finish );
241 setPauseWhenHidden( pref->pause_when_hidden );
242#ifdef AUTO_SHUTDOWN_PC
243 shutdown_check->setChecked( pref->auto_shutdown_pc );
244#endif
245
246 setEq2( pref->use_soft_video_eq );
247 setUseAudioEqualizer( pref->use_audio_equalizer );
248 global_audio_equalizer_check->setChecked(pref->global_audio_equalizer);
249 setGlobalVolume( pref->global_volume );
250 setSoftVol( pref->use_soft_vol );
251 setAc3DTSPassthrough( pref->use_hwac3 );
252 setInitialVolNorm( pref->initial_volnorm );
253 setAmplification( pref->softvol_max );
254 setInitialPostprocessing( pref->initial_postprocessing );
255 setInitialDeinterlace( pref->initial_deinterlace );
256 setInitialZoom( pref->initial_zoom_factor );
257 setDirectRendering( pref->use_direct_rendering );
258 setDoubleBuffer( pref->use_double_buffer );
259 setUseSlices( pref->use_slices );
260 setStartInFullscreen( pref->start_in_fullscreen );
261
262#ifdef ADD_BLACKBORDERS_FS
263 setBlackbordersOnFullscreen( pref->add_blackborders_on_fullscreen );
264#endif
265
266#ifdef INITIAL_BLACKBORDERS
267 blackborders_check->setChecked(pref->initial_blackborders);
268#endif
269
270 setAutoq( pref->autoq );
271
272#ifdef Q_OS_WIN
273 #ifdef SCREENSAVER_OFF
274 setTurnScreensaverOff( pref->turn_screensaver_off );
275 #endif
276 #ifdef AVOID_SCREENSAVER
277 setAvoidScreensaver( pref->avoid_screensaver );
278 #endif
279#else
280 setDisableScreensaver( pref->disable_screensaver );
281#endif
282
283#if !defined(Q_OS_WIN) && !defined(Q_OS_OS2)
284 vdpau = pref->vdpau;
285#endif
286
287 setAudioChannels( pref->initial_audio_channels );
288 setScaleTempoFilter( pref->use_scaletempo );
289
290 setAutoSyncActivated( pref->autosync );
291 setAutoSyncFactor( pref->autosync_factor );
292
293 setMcActivated( pref->use_mc );
294 setMc( pref->mc_value );
295}
296
297void PrefGeneral::getData(Preferences * pref) {
298 requires_restart = false;
299 filesettings_method_changed = false;
300
301 if (pref->mplayer_bin != mplayerPath()) {
302 requires_restart = true;
303 pref->mplayer_bin = mplayerPath();
304
305 qDebug("PrefGeneral::getData: mplayer binary has changed, getting version number");
306 // Forces to get info from mplayer to update version number
307 InfoReader * i = InfoReader::obj();
308 i->getInfo();
309 // Update the drivers list at the same time
310 vo_list = i->voList();
311 ao_list = i->aoList();
312 updateDriverCombos();
313 }
314
315 TEST_AND_SET(pref->use_screenshot, useScreenshots());
316 TEST_AND_SET(pref->screenshot_directory, screenshotDir());
317#ifdef MPV_SUPPORT
318 TEST_AND_SET(pref->screenshot_template, screenshot_template_edit->text());
319 TEST_AND_SET(pref->screenshot_format, screenshotFormat());
320#endif
321
322 TEST_AND_SET(pref->vo, VO());
323 TEST_AND_SET(pref->ao, AO());
324
325 TEST_AND_SET(pref->remember_media_settings, rememberSettings());
326 TEST_AND_SET(pref->remember_time_pos, rememberTimePos());
327 TEST_AND_SET(pref->remember_stream_settings, remember_streams_check->isChecked());
328
329 if (pref->file_settings_method != fileSettingsMethod()) {
330 pref->file_settings_method = fileSettingsMethod();
331 filesettings_method_changed = true;
332 }
333
334 pref->audio_lang = audioLang();
335 pref->subtitle_lang = subtitleLang();
336
337 pref->initial_audio_track = audioTrack();
338 pref->initial_subtitle_track = subtitleTrack();
339
340 pref->close_on_finish = closeOnFinish();
341 pref->pause_when_hidden = pauseWhenHidden();
342
343#ifdef AUTO_SHUTDOWN_PC
344 pref->auto_shutdown_pc = shutdown_check->isChecked();
345#endif
346
347 TEST_AND_SET(pref->use_soft_video_eq, eq2());
348 TEST_AND_SET(pref->use_soft_vol, softVol());
349 pref->global_volume = globalVolume();
350 TEST_AND_SET(pref->use_audio_equalizer, useAudioEqualizer());
351 pref->global_audio_equalizer = global_audio_equalizer_check->isChecked();
352 TEST_AND_SET(pref->use_hwac3, Ac3DTSPassthrough());
353 pref->initial_volnorm = initialVolNorm();
354 TEST_AND_SET(pref->softvol_max, amplification());
355 pref->initial_postprocessing = initialPostprocessing();
356 pref->initial_deinterlace = initialDeinterlace();
357 pref->initial_zoom_factor = initialZoom();
358 TEST_AND_SET(pref->use_direct_rendering, directRendering());
359 TEST_AND_SET(pref->use_double_buffer, doubleBuffer());
360 TEST_AND_SET(pref->use_slices, useSlices());
361 pref->start_in_fullscreen = startInFullscreen();
362
363#ifdef ADD_BLACKBORDERS_FS
364 if (pref->add_blackborders_on_fullscreen != blackbordersOnFullscreen()) {
365 pref->add_blackborders_on_fullscreen = blackbordersOnFullscreen();
366 if (pref->fullscreen) requires_restart = true;
367 }
368#endif
369
370#ifdef INITIAL_BLACKBORDERS
371 pref->initial_blackborders = blackborders_check->isChecked();
372#endif
373
374 TEST_AND_SET(pref->autoq, autoq());
375
376#ifdef Q_OS_WIN
377 #ifdef SCREENSAVER_OFF
378 TEST_AND_SET(pref->turn_screensaver_off, turnScreensaverOff());
379 #endif
380 #ifdef AVOID_SCREENSAVER
381 pref->avoid_screensaver = avoidScreensaver();
382 #endif
383#else
384 TEST_AND_SET(pref->disable_screensaver, disableScreensaver());
385#endif
386
387#if !defined(Q_OS_WIN) && !defined(Q_OS_OS2)
388 pref->vdpau = vdpau;
389#endif
390
391 pref->initial_audio_channels = audioChannels();
392 TEST_AND_SET(pref->use_scaletempo, scaleTempoFilter());
393
394 TEST_AND_SET(pref->autosync, autoSyncActivated());
395 TEST_AND_SET(pref->autosync_factor, autoSyncFactor());
396
397 TEST_AND_SET(pref->use_mc, mcActivated());
398 TEST_AND_SET(pref->mc_value, mc());
399}
400
401void PrefGeneral::updateDriverCombos() {
402 QString current_vo = VO();
403 QString current_ao = AO();
404
405 vo_combo->clear();
406 ao_combo->clear();
407
408 vo_combo->addItem(tr("Default"), "");
409 ao_combo->addItem(tr("Default"), "");
410
411 QString vo;
412 for ( int n = 0; n < vo_list.count(); n++ ) {
413 vo = vo_list[n].name();
414 #ifdef Q_OS_WIN
415 if ( vo == "directx" ) {
416 vo_combo->addItem( "directx (" + tr("fast") + ")", "directx" );
417 vo_combo->addItem( "directx (" + tr("slow") + ")", "directx:noaccel" );
418 }
419 else
420 #else
421 #ifdef Q_OS_OS2
422 if ( vo == "kva") {
423 vo_combo->addItem( "kva (" + tr("fast") + ")", "kva" );
424 vo_combo->addItem( "kva (" + tr("snap mode") + ")", "kva:snap" );
425 vo_combo->addItem( "kva (" + tr("slower dive mode") + ")", "kva:dive" );
426 }
427 else
428 #else
429 /*
430 if (vo == "xv") vo_combo->addItem( "xv (" + tr("fastest") + ")", vo);
431 else
432 */
433 #if USE_XV_ADAPTORS
434 if ((vo == "xv") && (!xv_adaptors.isEmpty())) {
435 vo_combo->addItem(vo, vo);
436 for (int n=0; n < xv_adaptors.count(); n++) {
437 vo_combo->addItem( "xv (" + xv_adaptors[n].ID().toString() + " - " + xv_adaptors[n].desc() + ")",
438 "xv:adaptor=" + xv_adaptors[n].ID().toString() );
439 }
440 }
441 else
442 #endif // USE_XV_ADAPTORS
443 #endif
444 #endif
445 if (vo == "x11") vo_combo->addItem( "x11 (" + tr("slow") + ")", vo);
446 else
447 if (vo == "gl") {
448 vo_combo->addItem( vo, vo);
449 vo_combo->addItem( "gl (" + tr("fast") + ")", "gl:yuv=2:force-pbo");
450 vo_combo->addItem( "gl (" + tr("fast - ATI cards") + ")", "gl:yuv=2:force-pbo:ati-hack");
451 vo_combo->addItem( "gl (yuv)", "gl:yuv=3");
452 }
453 else
454 if (vo == "gl2") {
455 vo_combo->addItem( vo, vo);
456 vo_combo->addItem( "gl2 (yuv)", "gl2:yuv=3");
457 }
458 else
459 if (vo == "gl_tiled") {
460 vo_combo->addItem( vo, vo);
461 vo_combo->addItem( "gl_tiled (yuv)", "gl_tiled:yuv=3");
462 }
463 else
464 if (vo == "null" || vo == "png" || vo == "jpeg" || vo == "gif89a" ||
465 vo == "tga" || vo == "pnm" || vo == "md5sum" )
466 {
467 ; // Nothing to do
468 }
469 else
470 vo_combo->addItem( vo, vo );
471 }
472 vo_combo->addItem( tr("User defined..."), "user_defined" );
473
474 QString ao;
475 for ( int n = 0; n < ao_list.count(); n++) {
476 ao = ao_list[n].name();
477 ao_combo->addItem( ao, ao );
478 /*
479 #ifdef Q_OS_OS2
480 if ( ao == "kai") {
481 ao_combo->addItem( "kai (" + tr("uniaud mode") + ")", "kai:uniaud" );
482 ao_combo->addItem( "kai (" + tr("dart mode") + ")", "kai:dart" );
483 }
484 #endif
485 */
486 #if USE_ALSA_DEVICES
487 if ((ao == "alsa") && (!alsa_devices.isEmpty())) {
488 for (int n=0; n < alsa_devices.count(); n++) {
489 ao_combo->addItem( DeviceInfo::printableName("alsa", alsa_devices[n]), DeviceInfo::internalName("alsa", alsa_devices[n]) );
490 }
491 }
492 #endif
493 #if USE_MPV_ALSA_DEVICES
494 if ((ao == "alsa") && (!mpv_alsa_devices.isEmpty())) {
495 for (int n=0; n < mpv_alsa_devices.count(); n++) {
496 ao_combo->addItem( DeviceInfo::printableName("alsa", mpv_alsa_devices[n]), DeviceInfo::internalName("alsa", mpv_alsa_devices[n]) );
497 }
498 }
499 #endif
500 #if USE_PULSEAUDIO_DEVICES
501 if ((ao == "pulse") && (!pa_devices.isEmpty())) {
502 for (int n=0; n < pa_devices.count(); n++) {
503 ao_combo->addItem( DeviceInfo::printableName("pulse", pa_devices[n]), DeviceInfo::internalName("pulse", pa_devices[n]) );
504 }
505 }
506 #endif
507 #if USE_DSOUND_DEVICES
508 if ((ao == "dsound") && (!dsound_devices.isEmpty())) {
509 for (int n=0; n < dsound_devices.count(); n++) {
510 ao_combo->addItem( DeviceInfo::printableName("dsound", dsound_devices[n]), DeviceInfo::internalName("dsound", dsound_devices[n]) );
511 }
512 }
513 #endif
514 }
515 ao_combo->addItem( tr("User defined..."), "user_defined" );
516
517 setVO(current_vo);
518 setAO(current_ao);
519}
520
521void PrefGeneral::setMplayerPath( QString path ) {
522 mplayerbin_edit->setText( path );
523
524#ifdef MPLAYER_MPV_SELECTION
525 if (path == PLAYER_COMBO_MPLAYER_PATH) {
526 player_combo->setCurrentIndex(PLAYER_COMBO_MPLAYER);
527 }
528 else
529 if (path == PLAYER_COMBO_MPV_PATH) {
530 player_combo->setCurrentIndex(PLAYER_COMBO_MPV);
531 }
532 else {
533 player_combo->setCurrentIndex(PLAYER_COMBO_OTHER);
534 }
535#endif
536}
537
538QString PrefGeneral::mplayerPath() {
539#ifdef MPLAYER_MPV_SELECTION
540 if (player_combo->currentIndex() == PLAYER_COMBO_MPLAYER) {
541 return PLAYER_COMBO_MPLAYER_PATH;
542 }
543 else
544 if (player_combo->currentIndex() == PLAYER_COMBO_MPV) {
545 return PLAYER_COMBO_MPV_PATH;
546 }
547 else
548#endif
549 return mplayerbin_edit->text();
550}
551
552void PrefGeneral::setUseScreenshots(bool b) {
553 use_screenshots_check->setChecked(b);
554}
555
556bool PrefGeneral::useScreenshots() {
557 return use_screenshots_check->isChecked();
558}
559
560void PrefGeneral::setScreenshotDir( QString path ) {
561 screenshot_edit->setText( path );
562}
563
564QString PrefGeneral::screenshotDir() {
565 return screenshot_edit->text().trimmed();
566}
567
568#ifdef MPV_SUPPORT
569void PrefGeneral::setScreenshotFormat(const QString format) {
570 int i = screenshot_format_combo->findText(format);
571 if (i < 0) i = 0;
572 screenshot_format_combo->setCurrentIndex(i);
573}
574
575QString PrefGeneral::screenshotFormat() {
576 return screenshot_format_combo->currentText();
577}
578#endif
579
580void PrefGeneral::setVO( QString vo_driver ) {
581 int idx = vo_combo->findData( vo_driver );
582 if (idx != -1) {
583 vo_combo->setCurrentIndex(idx);
584 } else {
585 vo_combo->setCurrentIndex(vo_combo->findData("user_defined"));
586 vo_user_defined_edit->setText(vo_driver);
587 }
588 vo_combo_changed(vo_combo->currentIndex());
589}
590
591void PrefGeneral::setAO( QString ao_driver ) {
592 int idx = ao_combo->findData( ao_driver );
593 if (idx != -1) {
594 ao_combo->setCurrentIndex(idx);
595 } else {
596 ao_combo->setCurrentIndex(ao_combo->findData("user_defined"));
597 ao_user_defined_edit->setText(ao_driver);
598 }
599 ao_combo_changed(ao_combo->currentIndex());
600}
601
602QString PrefGeneral::VO() {
603 QString vo = vo_combo->itemData(vo_combo->currentIndex()).toString();
604 if (vo == "user_defined") {
605 vo = vo_user_defined_edit->text();
606 /*
607 if (vo.isEmpty()) {
608 vo = vo_combo->itemData(0).toString();
609 qDebug("PrefGeneral::VO: user defined vo is empty, using %s", vo.toUtf8().constData());
610 }
611 */
612 }
613 return vo;
614}
615
616QString PrefGeneral::AO() {
617 QString ao = ao_combo->itemData(ao_combo->currentIndex()).toString();
618 if (ao == "user_defined") {
619 ao = ao_user_defined_edit->text();
620 /*
621 if (ao.isEmpty()) {
622 ao = ao_combo->itemData(0).toString();
623 qDebug("PrefGeneral::AO: user defined ao is empty, using %s", ao.toUtf8().constData());
624 }
625 */
626 }
627 return ao;
628}
629
630void PrefGeneral::setRememberSettings(bool b) {
631 remember_all_check->setChecked(b);
632 //rememberAllButtonToggled(b);
633}
634
635bool PrefGeneral::rememberSettings() {
636 return remember_all_check->isChecked();
637}
638
639void PrefGeneral::setRememberTimePos(bool b) {
640 remember_time_check->setChecked(b);
641}
642
643bool PrefGeneral::rememberTimePos() {
644 return remember_time_check->isChecked();
645}
646
647void PrefGeneral::setFileSettingsMethod(QString method) {
648 int index = filesettings_method_combo->findData(method);
649 if (index < 0) index = 0;
650 filesettings_method_combo->setCurrentIndex(index);
651}
652
653QString PrefGeneral::fileSettingsMethod() {
654 return filesettings_method_combo->itemData(filesettings_method_combo->currentIndex()).toString();
655}
656
657void PrefGeneral::setAudioLang(QString lang) {
658 audio_lang_edit->setText(lang);
659}
660
661QString PrefGeneral::audioLang() {
662 return audio_lang_edit->text();
663}
664
665void PrefGeneral::setSubtitleLang(QString lang) {
666 subtitle_lang_edit->setText(lang);
667}
668
669QString PrefGeneral::subtitleLang() {
670 return subtitle_lang_edit->text();
671}
672
673void PrefGeneral::setAudioTrack(int track) {
674 audio_track_spin->setValue(track);
675}
676
677int PrefGeneral::audioTrack() {
678 return audio_track_spin->value();
679}
680
681void PrefGeneral::setSubtitleTrack(int track) {
682 subtitle_track_spin->setValue(track);
683}
684
685int PrefGeneral::subtitleTrack() {
686 return subtitle_track_spin->value();
687}
688
689void PrefGeneral::setCloseOnFinish(bool b) {
690 close_on_finish_check->setChecked(b);
691}
692
693bool PrefGeneral::closeOnFinish() {
694 return close_on_finish_check->isChecked();
695}
696
697void PrefGeneral::setPauseWhenHidden(bool b) {
698 pause_if_hidden_check->setChecked(b);
699}
700
701bool PrefGeneral::pauseWhenHidden() {
702 return pause_if_hidden_check->isChecked();
703}
704
705
706void PrefGeneral::setEq2(bool b) {
707 eq2_check->setChecked(b);
708}
709
710bool PrefGeneral::eq2() {
711 return eq2_check->isChecked();
712}
713
714void PrefGeneral::setSoftVol(bool b) {
715 softvol_check->setChecked(b);
716}
717
718void PrefGeneral::setGlobalVolume(bool b) {
719 global_volume_check->setChecked(b);
720}
721
722bool PrefGeneral::globalVolume() {
723 return global_volume_check->isChecked();
724}
725
726bool PrefGeneral::softVol() {
727 return softvol_check->isChecked();
728}
729
730void PrefGeneral::setAutoSyncFactor(int factor) {
731 autosync_spin->setValue(factor);
732}
733
734int PrefGeneral::autoSyncFactor() {
735 return autosync_spin->value();
736}
737
738void PrefGeneral::setAutoSyncActivated(bool b) {
739 autosync_check->setChecked(b);
740}
741
742bool PrefGeneral::autoSyncActivated() {
743 return autosync_check->isChecked();
744}
745
746void PrefGeneral::setMc(double value) {
747 mc_spin->setValue(value);
748}
749
750double PrefGeneral::mc() {
751 return mc_spin->value();
752}
753
754void PrefGeneral::setMcActivated(bool b) {
755 use_mc_check->setChecked(b);
756}
757
758bool PrefGeneral::mcActivated() {
759 return use_mc_check->isChecked();
760}
761
762void PrefGeneral::setUseAudioEqualizer(bool b) {
763 audio_equalizer_check->setChecked(b);
764}
765
766bool PrefGeneral::useAudioEqualizer() {
767 return audio_equalizer_check->isChecked();
768}
769
770void PrefGeneral::setAc3DTSPassthrough(bool b) {
771 hwac3_check->setChecked(b);
772}
773
774bool PrefGeneral::Ac3DTSPassthrough() {
775 return hwac3_check->isChecked();
776}
777
778void PrefGeneral::setInitialVolNorm(bool b) {
779 volnorm_check->setChecked(b);
780}
781
782bool PrefGeneral::initialVolNorm() {
783 return volnorm_check->isChecked();
784}
785
786void PrefGeneral::setInitialPostprocessing(bool b) {
787 postprocessing_check->setChecked(b);
788}
789
790bool PrefGeneral::initialPostprocessing() {
791 return postprocessing_check->isChecked();
792}
793
794void PrefGeneral::setInitialDeinterlace(int ID) {
795 int pos = deinterlace_combo->findData(ID);
796 if (pos != -1) {
797 deinterlace_combo->setCurrentIndex(pos);
798 } else {
799 qWarning("PrefGeneral::setInitialDeinterlace: ID: %d not found in combo", ID);
800 }
801}
802
803int PrefGeneral::initialDeinterlace() {
804 if (deinterlace_combo->currentIndex() != -1) {
805 return deinterlace_combo->itemData( deinterlace_combo->currentIndex() ).toInt();
806 } else {
807 qWarning("PrefGeneral::initialDeinterlace: no item selected");
808 return 0;
809 }
810}
811
812void PrefGeneral::setInitialZoom(double v) {
813 zoom_spin->setValue(v);
814}
815
816double PrefGeneral::initialZoom() {
817 return zoom_spin->value();
818}
819
820void PrefGeneral::setDirectRendering(bool b) {
821 direct_rendering_check->setChecked(b);
822}
823
824bool PrefGeneral::directRendering() {
825 return direct_rendering_check->isChecked();
826}
827
828void PrefGeneral::setDoubleBuffer(bool b) {
829 double_buffer_check->setChecked(b);
830}
831
832bool PrefGeneral::doubleBuffer() {
833 return double_buffer_check->isChecked();
834}
835
836void PrefGeneral::setUseSlices(bool b) {
837 use_slices_check->setChecked(b);
838}
839
840bool PrefGeneral::useSlices() {
841 return use_slices_check->isChecked();
842}
843
844void PrefGeneral::setAmplification(int n) {
845 softvol_max_spin->setValue(n);
846}
847
848int PrefGeneral::amplification() {
849 return softvol_max_spin->value();
850}
851
852void PrefGeneral::setAudioChannels(int ID) {
853 int pos = channels_combo->findData(ID);
854 if (pos != -1) {
855 channels_combo->setCurrentIndex(pos);
856 } else {
857 qWarning("PrefGeneral::setAudioChannels: ID: %d not found in combo", ID);
858 }
859}
860
861int PrefGeneral::audioChannels() {
862 if (channels_combo->currentIndex() != -1) {
863 return channels_combo->itemData( channels_combo->currentIndex() ).toInt();
864 } else {
865 qWarning("PrefGeneral::audioChannels: no item selected");
866 return 0;
867 }
868}
869
870void PrefGeneral::setStartInFullscreen(bool b) {
871 start_fullscreen_check->setChecked(b);
872}
873
874bool PrefGeneral::startInFullscreen() {
875 return start_fullscreen_check->isChecked();
876}
877
878#ifdef Q_OS_WIN
879#ifdef AVOID_SCREENSAVER
880void PrefGeneral::setAvoidScreensaver(bool b) {
881 avoid_screensaver_check->setChecked(b);
882}
883
884bool PrefGeneral::avoidScreensaver() {
885 return avoid_screensaver_check->isChecked();
886}
887#endif
888
889#ifdef SCREENSAVER_OFF
890void PrefGeneral::setTurnScreensaverOff(bool b) {
891 turn_screensaver_off_check->setChecked(b);
892}
893
894bool PrefGeneral::turnScreensaverOff() {
895 return turn_screensaver_off_check->isChecked();
896}
897#endif
898
899#else
900void PrefGeneral::setDisableScreensaver(bool b) {
901 screensaver_check->setChecked(b);
902}
903
904bool PrefGeneral::disableScreensaver() {
905 return screensaver_check->isChecked();
906}
907#endif
908
909#ifdef ADD_BLACKBORDERS_FS
910void PrefGeneral::setBlackbordersOnFullscreen(bool b) {
911 blackborders_on_fs_check->setChecked(b);
912}
913
914bool PrefGeneral::blackbordersOnFullscreen() {
915 return blackborders_on_fs_check->isChecked();
916}
917#endif
918
919void PrefGeneral::setAutoq(int n) {
920 autoq_spin->setValue(n);
921}
922
923int PrefGeneral::autoq() {
924 return autoq_spin->value();
925}
926
927void PrefGeneral::setScaleTempoFilter(Preferences::OptionState value) {
928 scaletempo_combo->setState(value);
929}
930
931Preferences::OptionState PrefGeneral::scaleTempoFilter() {
932 return scaletempo_combo->state();
933}
934
935#ifdef MPLAYER_MPV_SELECTION
936void PrefGeneral::player_combo_changed(int idx) {
937 qDebug("PrefGeneral::player_combo_changed: %d", idx);
938 int d = player_combo->itemData(idx).toInt();
939 if (d == PLAYER_COMBO_OTHER) {
940 player_spacer->changeSize(0, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
941 mplayerbin_edit->setVisible(true);
942 //mplayerbin_edit->setFocus();
943 } else {
944 player_spacer->changeSize(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
945 mplayerbin_edit->setVisible(false);
946 }
947}
948#endif
949
950void PrefGeneral::vo_combo_changed(int idx) {
951 qDebug("PrefGeneral::vo_combo_changed: %d", idx);
952 bool visible = (vo_combo->itemData(idx).toString() == "user_defined");
953 vo_user_defined_edit->setVisible(visible);
954 vo_user_defined_edit->setFocus();
955
956#ifndef Q_OS_WIN
957 bool vdpau_button_visible = (vo_combo->itemData(idx).toString() == "vdpau");
958 vdpau_button->setVisible(vdpau_button_visible);
959#endif
960}
961
962void PrefGeneral::ao_combo_changed(int idx) {
963 qDebug("PrefGeneral::ao_combo_changed: %d", idx);
964 bool visible = (ao_combo->itemData(idx).toString() == "user_defined");
965 ao_user_defined_edit->setVisible(visible);
966 ao_user_defined_edit->setFocus();
967}
968
969#ifndef Q_OS_WIN
970void PrefGeneral::on_vdpau_button_clicked() {
971 qDebug("PrefGeneral::on_vdpau_button_clicked");
972
973 VDPAUProperties d(this);
974
975 d.setffh264vdpau(vdpau.ffh264vdpau);
976 d.setffmpeg12vdpau(vdpau.ffmpeg12vdpau);
977 d.setffwmv3vdpau(vdpau.ffwmv3vdpau);
978 d.setffvc1vdpau(vdpau.ffvc1vdpau);
979 d.setffodivxvdpau(vdpau.ffodivxvdpau);
980
981 d.setDisableFilters(vdpau.disable_video_filters);
982
983 if (d.exec() == QDialog::Accepted) {
984 vdpau.ffh264vdpau = d.ffh264vdpau();
985 vdpau.ffmpeg12vdpau = d.ffmpeg12vdpau();
986 vdpau.ffwmv3vdpau = d.ffwmv3vdpau();
987 vdpau.ffvc1vdpau = d.ffvc1vdpau();
988 vdpau.ffodivxvdpau = d.ffodivxvdpau();
989
990 vdpau.disable_video_filters = d.disableFilters();
991 }
992}
993#endif
994
995void PrefGeneral::createHelp() {
996 clearHelp();
997
998 addSectionTitle(tr("General"));
999
1000#ifdef MPLAYER_MPV_SELECTION
1001 setWhatsThis(player_combo, tr("Multimedia engine"),
1002 tr("Select which multimedia engine you want to use, either MPlayer or mpv.") +" "+
1003 tr("The option 'other' allows you to manually select the path of the executable.") );
1004#endif
1005
1006 setWhatsThis(mplayerbin_edit, tr("%1 executable").arg(PLAYER_NAME),
1007 tr("Here you must specify the %1 "
1008 "executable that SMPlayer will use.").arg(PLAYER_NAME) + "<br><b>" +
1009 tr("If this setting is wrong, SMPlayer won't be able to play "
1010 "anything!") + "</b>");
1011
1012 setWhatsThis(remember_all_check, tr("Remember settings"),
1013 tr("Usually SMPlayer will remember the settings for each file you "
1014 "play (audio track selected, volume, filters...). Disable this "
1015 "option if you don't like this feature.") );
1016
1017 setWhatsThis(remember_time_check, tr("Remember time position"),
1018 tr("If you check this option, SMPlayer will remember the last position "
1019 "of the file when you open it again. This option works only with "
1020 "regular files (not with DVDs, CDs, URLs...).") );
1021
1022 setWhatsThis(remember_streams_check, tr("Remember settings for streams"),
1023 tr("When this option is enabled the settings for online streams will be remembered as well."));
1024
1025 setWhatsThis(filesettings_method_combo, tr("Method to store the file settings"),
1026 tr("This option allows to change the way the file settings would be "
1027 "stored. The following options are available:") +"<ul><li>" +
1028 tr("<b>one ini file</b>: the settings for all played files will be "
1029 "saved in a single ini file (%1)").arg(QString("<i>"+Paths::iniPath()+"/smplayer.ini</i>")) + "</li><li>" +
1030 tr("<b>multiple ini files</b>: one ini file will be used for each played file. "
1031 "Those ini files will be saved in the folder %1").arg(QString("<i>"+Paths::iniPath()+"/file_settings</i>")) + "</li></ul>" +
1032 tr("The latter method could be faster if there is info for a lot of files.") );
1033
1034 setWhatsThis(use_screenshots_check, tr("Enable screenshots"),
1035 tr("You can use this option to enable or disable the possibility to "
1036 "take screenshots.") );
1037
1038 setWhatsThis(screenshot_edit, tr("Screenshots folder"),
1039 tr("Here you can specify a folder where the screenshots taken by "
1040 "SMPlayer will be stored. If the folder is not valid the "
1041 "screenshot feature will be disabled.") );
1042
1043#ifdef MPV_SUPPORT
1044 setWhatsThis(screenshot_template_edit, tr("Template for screenshots"),
1045 tr("This option specifies the filename template used to save screenshots.") + " " +
1046 tr("For example %1 would save the screenshot as 'moviename_0001.png'.").arg("%F_%04n") + "<br>" +
1047 tr("%1 specifies the filename of the video without the extension, "
1048 "%2 adds a 4 digit number padded with zeros.").arg("%F").arg("%04n") + " " +
1049 tr("For a full list of the template specifiers visit this link:") +
1050 " <a href=\"http://mpv.io/manual/stable/#options-screenshot-template\">"
1051 "http://mpv.io/manual/stable/#options-screenshot-template</a>"
1052 #ifdef MPLAYER_SUPPORT
1053 + "<br>" + tr("This option only works with mpv.")
1054 #endif
1055 );
1056
1057 setWhatsThis(screenshot_format_combo, tr("Format for screenshots"),
1058 tr("This option allows to choose the image file type used for saving screenshots.")
1059 #ifdef MPLAYER_SUPPORT
1060 + " " + tr("This option only works with mpv.")
1061 #endif
1062 );
1063#endif
1064
1065 setWhatsThis(pause_if_hidden_check, tr("Pause when minimized"),
1066 tr("If this option is enabled, the file will be paused when the "
1067 "main window is hidden. When the window is restored, playback "
1068 "will be resumed.") );
1069
1070 setWhatsThis(close_on_finish_check, tr("Close when finished"),
1071 tr("If this option is checked, the main window will be automatically "
1072 "closed when the current file/playlist finishes.") );
1073
1074#ifdef AUTO_SHUTDOWN_PC
1075 setWhatsThis(shutdown_check, tr("Shut down computer"),
1076 tr("If this option is enabled, the computer will shut down just after SMPlayer is closed.") );
1077#endif
1078
1079 // Video tab
1080 addSectionTitle(tr("Video"));
1081
1082 setWhatsThis(vo_combo, tr("Video output driver"),
1083 tr("Select the video output driver."));
1084
1085#if !defined(Q_OS_WIN) && !defined(Q_OS_OS2)
1086 /*
1087 setWhatsThis(vdpau_filters_check, tr("Disable video filters when using vdpau"),
1088 tr("Usually video filters won't work when using vdpau as video output "
1089 "driver, so it's wise to keep this option checked.") );
1090 */
1091#endif
1092
1093 setWhatsThis(postprocessing_check, tr("Enable postprocessing by default"),
1094 tr("Postprocessing will be used by default on new opened files.") );
1095
1096 setWhatsThis(autoq_spin, tr("Postprocessing quality"),
1097 tr("Dynamically changes the level of postprocessing depending on the "
1098 "available spare CPU time. The number you specify will be the "
1099 "maximum level used. Usually you can use some big number.") );
1100
1101 setWhatsThis(deinterlace_combo, tr("Deinterlace by default"),
1102 tr("Select the deinterlace filter that you want to be used for new "
1103 "videos opened.") +" "+
1104 tr("<b>Note:</b> This option won't be used for TV channels.") );
1105
1106#ifdef INITIAL_BLACKBORDERS
1107 setWhatsThis(blackborders_check, tr("Add black borders for subtitles by default"),
1108 tr("If this option is enabled, black borders will be added to the image "
1109 "by default on new opened files."));
1110#endif
1111
1112 setWhatsThis(zoom_spin, tr("Default zoom"),
1113 tr("This option sets the default zoom which will be used for "
1114 "new videos.") );
1115
1116 setWhatsThis(eq2_check, tr("Software video equalizer"),
1117 tr("You can check this option if video equalizer is not supported by "
1118 "your graphic card or the selected video output driver.<br>"
1119 "<b>Note:</b> this option can be incompatible with some video "
1120 "output drivers.") );
1121
1122 setWhatsThis(direct_rendering_check, tr("Direct rendering"),
1123 tr("If checked, turns on direct rendering (not supported by all "
1124 "codecs and video outputs)<br>"
1125 "<b>Warning:</b> May cause OSD/SUB corruption!") );
1126
1127 setWhatsThis(double_buffer_check, tr("Double buffering"),
1128 tr("Double buffering fixes flicker by storing two frames in memory, "
1129 "and displaying one while decoding another. If disabled it can "
1130 "affect OSD negatively, but often removes OSD flickering.") );
1131
1132 setWhatsThis(use_slices_check, tr("Draw video using slices"),
1133 tr("Enable/disable drawing video by 16-pixel height slices/bands. "
1134 "If disabled, the whole frame is drawn in a single run. "
1135 "May be faster or slower, depending on video card and available "
1136 "cache. It has effect only with libmpeg2 and libavcodec codecs.") );
1137
1138 setWhatsThis(start_fullscreen_check, tr("Start videos in fullscreen"),
1139 tr("If this option is checked, all videos will start to play in "
1140 "fullscreen mode.") );
1141
1142#ifdef ADD_BLACKBORDERS_FS
1143 setWhatsThis(blackborders_on_fs_check, tr("Add black borders on fullscreen"),
1144 tr("If this option is enabled, black borders will be added to the "
1145 "image in fullscreen mode. This allows subtitles to be displayed "
1146 "on the black borders.") /* + "<br>" +
1147 tr("This option will be ignored if MPlayer uses its own window, as "
1148 "some video drivers (like gl) are already able to display the "
1149 "subtitles automatically in the black borders.") */ );
1150#endif
1151
1152#ifdef Q_OS_WIN
1153 #ifdef SCREENSAVER_OFF
1154 setWhatsThis(turn_screensaver_off_check, tr("Switch screensaver off"),
1155 tr("This option switches the screensaver off just before starting to "
1156 "play a file and switches it on when playback finishes. If this "
1157 "option is enabled, the screensaver won't appear even if playing "
1158 "audio files or when a file is paused."));
1159 #endif
1160 #ifdef AVOID_SCREENSAVER
1161 setWhatsThis(avoid_screensaver_check, tr("Avoid screensaver"),
1162 tr("When this option is checked, SMPlayer will try to prevent the "
1163 "screensaver to be shown when playing a video file. The screensaver "
1164 "will be allowed to be shown if playing an audio file or in pause "
1165 "mode. This option only works if the SMPlayer window is in "
1166 "the foreground."));
1167 #endif
1168#else
1169 setWhatsThis(screensaver_check, tr("Disable screensaver"),
1170 tr("Check this option to disable the screensaver while playing.<br>"
1171 "The screensaver will enabled again when play finishes.")
1172 );
1173#endif
1174
1175 // Audio tab
1176 addSectionTitle(tr("Audio"));
1177
1178 setWhatsThis(ao_combo, tr("Audio output driver"),
1179 tr("Select the audio output driver."));
1180
1181 setWhatsThis(audio_equalizer_check, tr("Enable the audio equalizer"),
1182 tr("Check this option if you want to use the audio equalizer.") );
1183
1184 setWhatsThis(global_audio_equalizer_check, tr("Global audio equalizer"),
1185 tr("If this option is checked, all media files share the audio equalizer.") +" "+
1186 tr("If it's not checked, the audio equalizer values are saved along each file "
1187 "and loaded back when the file is played later.") );
1188
1189 setWhatsThis(hwac3_check, tr("AC3/DTS pass-through S/PDIF"),
1190 tr("Uses hardware AC3 passthrough.") + "<br>" +
1191 tr("<b>Note:</b> none of the audio filters will be used when this "
1192 "option is enabled.") );
1193
1194 setWhatsThis(channels_combo, tr("Channels by default"),
1195 tr("Requests the number of playback channels. %1 "
1196 "asks the decoder to decode the audio into as many channels as "
1197 "specified. Then it is up to the decoder to fulfill the "
1198 "requirement. This is usually only important when playing "
1199 "videos with AC3 audio (like DVDs). In that case liba52 does "
1200 "the decoding by default and correctly downmixes the audio "
1201 "into the requested number of channels. "
1202 "<b>Note</b>: This option is honored by codecs (AC3 only), "
1203 "filters (surround) and audio output drivers (OSS at least).").arg(PLAYER_NAME) );
1204
1205 setWhatsThis(scaletempo_combo, tr("High speed playback without altering pitch"),
1206 tr("Allows to change the playback speed without altering pitch.") );
1207
1208 setWhatsThis(global_volume_check, tr("Global volume"),
1209 tr("If this option is checked, the same volume will be used for "
1210 "all files you play. If the option is not checked each "
1211 "file uses its own volume.") + "<br>" +
1212 tr("This option also applies for the mute control.") );
1213
1214 setWhatsThis(softvol_check, tr("Software volume control"),
1215 tr("Check this option to use the software mixer, instead of "
1216 "using the sound card mixer.") );
1217
1218 setWhatsThis(softvol_max_spin, tr("Max. Amplification"),
1219 tr("Sets the maximum amplification level in percent (default: 110). "
1220 "A value of 200 will allow you to adjust the volume up to a "
1221 "maximum of double the current level. With values below 100 the "
1222 "initial volume (which is 100%) will be above the maximum, which "
1223 "e.g. the OSD cannot display correctly.") );
1224
1225 setWhatsThis(volnorm_check, tr("Volume normalization by default"),
1226 tr("Maximizes the volume without distorting the sound.") );
1227
1228 setWhatsThis(autosync_check, tr("Audio/video auto synchronization"),
1229 tr("Gradually adjusts the A/V sync based on audio delay "
1230 "measurements.") );
1231
1232 setWhatsThis(mc_spin, tr("A-V sync correction"),
1233 tr("Maximum A-V sync correction per frame (in seconds)") );
1234
1235 addSectionTitle(tr("Preferred audio and subtitles"));
1236
1237 setWhatsThis(audio_lang_edit, tr("Preferred audio language"),
1238 tr("Here you can type your preferred language for the audio streams. "
1239 "When a media with multiple audio streams is found, SMPlayer will "
1240 "try to use your preferred language.<br>"
1241 "This only will work with media that offer info about the language "
1242 "of the audio streams, like DVDs or mkv files.<br>"
1243 "This field accepts regular expressions. Example: <b>es|esp|spa</b> "
1244 "will select the audio track if it matches with <i>es</i>, "
1245 "<i>esp</i> or <i>spa</i>.") );
1246
1247 setWhatsThis(subtitle_lang_edit, tr("Preferred subtitle language"),
1248 tr("Here you can type your preferred language for the subtitle stream. "
1249 "When a media with multiple subtitle streams is found, SMPlayer will "
1250 "try to use your preferred language.<br>"
1251 "This only will work with media that offer info about the language "
1252 "of the subtitle streams, like DVDs or mkv files.<br>"
1253 "This field accepts regular expressions. Example: <b>es|esp|spa</b> "
1254 "will select the subtitle stream if it matches with <i>es</i>, "
1255 "<i>esp</i> or <i>spa</i>.") );
1256
1257 setWhatsThis(audio_track_spin, tr("Audio track"),
1258 tr("Specifies the default audio track which will be used when playing "
1259 "new files. If the track doesn't exist, the first one will be used. "
1260 "<br><b>Note:</b> the <i>\"preferred audio language\"</i> has "
1261 "preference over this option.") );
1262
1263 setWhatsThis(subtitle_track_spin, tr("Subtitle track"),
1264 tr("Specifies the default subtitle track which will be used when "
1265 "playing new files. If the track doesn't exist, the first one "
1266 "will be used. <br><b>Note:</b> the <i>\"preferred subtitle "
1267 "language\"</i> has preference over this option.") );
1268
1269}
1270
1271#include "moc_prefgeneral.cpp"
Note: See TracBrowser for help on using the repository browser.