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