1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | #include "preferences.h"
|
---|
20 | #include "global.h"
|
---|
21 | #include "paths.h"
|
---|
22 | #include "mediasettings.h"
|
---|
23 | #include "recents.h"
|
---|
24 | #include "urlhistory.h"
|
---|
25 | #include "filters.h"
|
---|
26 |
|
---|
27 | #include <QSettings>
|
---|
28 | #include <QFileInfo>
|
---|
29 | #include <QRegExp>
|
---|
30 | #include <QDir>
|
---|
31 | #include <QLocale>
|
---|
32 |
|
---|
33 | using namespace Global;
|
---|
34 |
|
---|
35 | Preferences::Preferences() {
|
---|
36 | history_recents = new Recents;
|
---|
37 | history_urls = new URLHistory;
|
---|
38 | filters = new Filters;
|
---|
39 |
|
---|
40 | reset();
|
---|
41 |
|
---|
42 | #ifndef NO_USE_INI_FILES
|
---|
43 | load();
|
---|
44 | #endif
|
---|
45 | }
|
---|
46 |
|
---|
47 | Preferences::~Preferences() {
|
---|
48 | #ifndef NO_USE_INI_FILES
|
---|
49 | save();
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | delete history_recents;
|
---|
53 | delete history_urls;
|
---|
54 | delete filters;
|
---|
55 | }
|
---|
56 |
|
---|
57 | void Preferences::reset() {
|
---|
58 | /* *******
|
---|
59 | General
|
---|
60 | ******* */
|
---|
61 |
|
---|
62 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
63 | mplayer_bin= "mplayer/mplayer.exe";
|
---|
64 | #else
|
---|
65 | mplayer_bin = "mplayer";
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | vo = "";
|
---|
69 | ao = "";
|
---|
70 |
|
---|
71 | use_screenshot = true;
|
---|
72 | screenshot_directory="";
|
---|
73 | #ifdef PORTABLE_APP
|
---|
74 | screenshot_directory= "./screenshots";
|
---|
75 | #else
|
---|
76 | if (QFile::exists(Paths::configPath() + "/screenshots")) {
|
---|
77 | screenshot_directory = Paths::configPath() + "/screenshots";
|
---|
78 | }
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | dont_remember_media_settings = false;
|
---|
82 | dont_remember_time_pos = false;
|
---|
83 |
|
---|
84 | audio_lang = "";
|
---|
85 | subtitle_lang = "";
|
---|
86 |
|
---|
87 | use_direct_rendering = false;
|
---|
88 | use_double_buffer = true;
|
---|
89 |
|
---|
90 | use_soft_video_eq = false;
|
---|
91 | use_slices = true;
|
---|
92 | autoq = 6;
|
---|
93 | add_blackborders_on_fullscreen = false;
|
---|
94 |
|
---|
95 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
96 | turn_screensaver_off = false;
|
---|
97 | avoid_screensaver = true;
|
---|
98 | #else
|
---|
99 | disable_screensaver = true;
|
---|
100 | #endif
|
---|
101 |
|
---|
102 | #ifndef Q_OS_WIN
|
---|
103 | vdpau.ffh264vdpau = true;
|
---|
104 | vdpau.ffmpeg12vdpau = true;
|
---|
105 | vdpau.ffwmv3vdpau = true;
|
---|
106 | vdpau.ffvc1vdpau = true;
|
---|
107 | vdpau.ffodivxvdpau = false;
|
---|
108 | vdpau.disable_video_filters = true;
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | use_soft_vol = true;
|
---|
112 | softvol_max = 110; // 110 = default value in mplayer
|
---|
113 | use_scaletempo = Detect;
|
---|
114 | use_hwac3 = false;
|
---|
115 | use_audio_equalizer = true;
|
---|
116 |
|
---|
117 | global_volume = true;
|
---|
118 | volume = 50;
|
---|
119 | mute = false;
|
---|
120 |
|
---|
121 | autosync = false;
|
---|
122 | autosync_factor = 100;
|
---|
123 |
|
---|
124 | use_mc = false;
|
---|
125 | mc_value = 0;
|
---|
126 |
|
---|
127 | osd = Seek;
|
---|
128 | osd_delay = 2200;
|
---|
129 |
|
---|
130 | file_settings_method = "hash"; // Possible values: normal & hash
|
---|
131 |
|
---|
132 |
|
---|
133 | /* ***************
|
---|
134 | Drives (CD/DVD)
|
---|
135 | *************** */
|
---|
136 |
|
---|
137 | dvd_device = "";
|
---|
138 | cdrom_device = "";
|
---|
139 |
|
---|
140 | #ifndef Q_OS_WIN
|
---|
141 | // Try to set default values
|
---|
142 | if (QFile::exists("/dev/dvd")) dvd_device = "/dev/dvd";
|
---|
143 | if (QFile::exists("/dev/cdrom")) cdrom_device = "/dev/cdrom";
|
---|
144 | #endif
|
---|
145 |
|
---|
146 | #ifdef Q_OS_WIN
|
---|
147 | enable_audiocd_on_windows = false;
|
---|
148 | #endif
|
---|
149 |
|
---|
150 | vcd_initial_title = 2; // Most VCD's start at title #2
|
---|
151 |
|
---|
152 | #if DVDNAV_SUPPORT
|
---|
153 | use_dvdnav = false;
|
---|
154 | #endif
|
---|
155 |
|
---|
156 |
|
---|
157 | /* ***********
|
---|
158 | Performance
|
---|
159 | *********** */
|
---|
160 |
|
---|
161 | priority = AboveNormal; // Option only for windows
|
---|
162 | frame_drop = true;
|
---|
163 | hard_frame_drop = false;
|
---|
164 | coreavc = false;
|
---|
165 | h264_skip_loop_filter = LoopEnabled;
|
---|
166 | HD_height = 720;
|
---|
167 |
|
---|
168 | // MPlayer 1.0rc1 require restart, new versions don't
|
---|
169 | fast_audio_change = Detect;
|
---|
170 | #if !SMART_DVD_CHAPTERS
|
---|
171 | fast_chapter_change = false;
|
---|
172 | #endif
|
---|
173 |
|
---|
174 | threads = 1;
|
---|
175 |
|
---|
176 | cache_for_files = 0;
|
---|
177 | cache_for_streams = 1000;
|
---|
178 | cache_for_dvds = 0; // not recommended to use cache for dvds
|
---|
179 | cache_for_vcds = 1000;
|
---|
180 | cache_for_audiocds = 1000;
|
---|
181 | cache_for_tv = 3000;
|
---|
182 |
|
---|
183 |
|
---|
184 | /* *********
|
---|
185 | Subtitles
|
---|
186 | ********* */
|
---|
187 |
|
---|
188 | font_file = "";
|
---|
189 | font_name = "";
|
---|
190 | use_fontconfig = false;
|
---|
191 | subcp = "ISO-8859-1";
|
---|
192 | use_enca = false;
|
---|
193 | enca_lang = QString(QLocale::system().name()).section("_",0,0);
|
---|
194 | font_autoscale = 1;
|
---|
195 | subfuzziness = 1;
|
---|
196 | autoload_sub = true;
|
---|
197 |
|
---|
198 | use_ass_subtitles = true;
|
---|
199 | ass_line_spacing = 0;
|
---|
200 |
|
---|
201 | use_forced_subs_only = false;
|
---|
202 |
|
---|
203 | sub_visibility = true;
|
---|
204 |
|
---|
205 | subtitles_on_screenshots = false;
|
---|
206 |
|
---|
207 | use_new_sub_commands = Detect;
|
---|
208 | change_sub_scale_should_restart = Detect;
|
---|
209 |
|
---|
210 | fast_load_sub = true;
|
---|
211 |
|
---|
212 | // ASS styles
|
---|
213 | // Nothing to do, default values are given in
|
---|
214 | // AssStyles constructor
|
---|
215 |
|
---|
216 | force_ass_styles = false;
|
---|
217 | user_forced_ass_style.clear();
|
---|
218 |
|
---|
219 | freetype_support = true;
|
---|
220 |
|
---|
221 |
|
---|
222 | /* ********
|
---|
223 | Advanced
|
---|
224 | ******** */
|
---|
225 |
|
---|
226 | #if USE_ADAPTER
|
---|
227 | adapter = -1;
|
---|
228 | #endif
|
---|
229 |
|
---|
230 | #if USE_COLORKEY
|
---|
231 | color_key = 0x020202;
|
---|
232 | #endif
|
---|
233 |
|
---|
234 | use_mplayer_window = false;
|
---|
235 |
|
---|
236 | monitor_aspect=""; // Autodetect
|
---|
237 |
|
---|
238 | use_idx = false;
|
---|
239 |
|
---|
240 | mplayer_additional_options="";
|
---|
241 | #ifdef PORTABLE_APP
|
---|
242 | mplayer_additional_options="-nofontconfig";
|
---|
243 | #endif
|
---|
244 | mplayer_additional_video_filters="";
|
---|
245 | mplayer_additional_audio_filters="";
|
---|
246 |
|
---|
247 | log_mplayer = true;
|
---|
248 | log_smplayer = true;
|
---|
249 | log_filter = ".*";
|
---|
250 | verbose_log = false;
|
---|
251 | save_smplayer_log = false;
|
---|
252 |
|
---|
253 | //mplayer log autosaving
|
---|
254 | autosave_mplayer_log = false;
|
---|
255 | mplayer_log_saveto = "";
|
---|
256 | //mplayer log autosaving end
|
---|
257 |
|
---|
258 | #if REPAINT_BACKGROUND_OPTION
|
---|
259 | // "Repaint video background" in the preferences dialog
|
---|
260 | #ifndef Q_OS_WIN
|
---|
261 | repaint_video_background = false;
|
---|
262 | #else
|
---|
263 | repaint_video_background = true;
|
---|
264 | #endif
|
---|
265 | #endif
|
---|
266 |
|
---|
267 | use_edl_files = true;
|
---|
268 |
|
---|
269 | prefer_ipv4 = true;
|
---|
270 |
|
---|
271 | use_short_pathnames = false;
|
---|
272 |
|
---|
273 | change_video_equalizer_on_startup = true;
|
---|
274 |
|
---|
275 | use_pausing_keep_force = true;
|
---|
276 |
|
---|
277 | use_correct_pts = Detect;
|
---|
278 |
|
---|
279 | actions_to_run = "";
|
---|
280 |
|
---|
281 | show_tag_in_window_title = true;
|
---|
282 |
|
---|
283 |
|
---|
284 | /* *********
|
---|
285 | GUI stuff
|
---|
286 | ********* */
|
---|
287 |
|
---|
288 | fullscreen = false;
|
---|
289 | start_in_fullscreen = false;
|
---|
290 | compact_mode = false;
|
---|
291 | stay_on_top = NeverOnTop;
|
---|
292 | size_factor = 100; // 100%
|
---|
293 |
|
---|
294 | resize_method = Always;
|
---|
295 |
|
---|
296 | #if STYLE_SWITCHING
|
---|
297 | style="";
|
---|
298 | #endif
|
---|
299 |
|
---|
300 |
|
---|
301 | #if DVDNAV_SUPPORT
|
---|
302 | mouse_left_click_function = "dvdnav_mouse";
|
---|
303 | #else
|
---|
304 | mouse_left_click_function = "";
|
---|
305 | #endif
|
---|
306 | mouse_right_click_function = "show_context_menu";
|
---|
307 | mouse_double_click_function = "fullscreen";
|
---|
308 | mouse_middle_click_function = "mute";
|
---|
309 | mouse_xbutton1_click_function = "";
|
---|
310 | mouse_xbutton2_click_function = "";
|
---|
311 | wheel_function = Seeking;
|
---|
312 | wheel_function_cycle = Seeking | Volume | Zoom | ChangeSpeed;
|
---|
313 | wheel_function_seeking_reverse = false;
|
---|
314 |
|
---|
315 | seeking1 = 10;
|
---|
316 | seeking2 = 60;
|
---|
317 | seeking3 = 10*60;
|
---|
318 | seeking4 = 30;
|
---|
319 |
|
---|
320 | update_while_seeking = false;
|
---|
321 | #if ENABLE_DELAYED_DRAGGING
|
---|
322 | time_slider_drag_delay = 100;
|
---|
323 | #endif
|
---|
324 | #if SEEKBAR_RESOLUTION
|
---|
325 | relative_seeking = false;
|
---|
326 | #endif
|
---|
327 |
|
---|
328 | language = "";
|
---|
329 | iconset = "";
|
---|
330 |
|
---|
331 | balloon_count = 5;
|
---|
332 |
|
---|
333 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
334 | restore_pos_after_fullscreen = true;
|
---|
335 | #else
|
---|
336 | restore_pos_after_fullscreen = false;
|
---|
337 | #endif
|
---|
338 |
|
---|
339 | save_window_size_on_exit = true;
|
---|
340 |
|
---|
341 | close_on_finish = false;
|
---|
342 |
|
---|
343 | default_font = "";
|
---|
344 |
|
---|
345 | pause_when_hidden = false;
|
---|
346 |
|
---|
347 | allow_video_movement = false;
|
---|
348 |
|
---|
349 | gui = "DefaultGui";
|
---|
350 |
|
---|
351 | #if USE_MINIMUMSIZE
|
---|
352 | gui_minimum_width = 0; // 0 == disabled
|
---|
353 | #endif
|
---|
354 | default_size = QSize(580, 440);
|
---|
355 |
|
---|
356 | #if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
|
---|
357 | hide_video_window_on_audio_files = true;
|
---|
358 | #endif
|
---|
359 |
|
---|
360 | report_mplayer_crashes = true;
|
---|
361 |
|
---|
362 | #if REPORT_OLD_MPLAYER
|
---|
363 | reported_mplayer_is_old = false;
|
---|
364 | #endif
|
---|
365 |
|
---|
366 | auto_add_to_playlist = true;
|
---|
367 | add_to_playlist_consecutive_files = false;
|
---|
368 |
|
---|
369 |
|
---|
370 | /* ********
|
---|
371 | TV (dvb)
|
---|
372 | ******** */
|
---|
373 |
|
---|
374 | check_channels_conf_on_startup = true;
|
---|
375 | initial_tv_deinterlace = MediaSettings::Yadif_1;
|
---|
376 | last_dvb_channel = "";
|
---|
377 | last_tv_channel = "";
|
---|
378 |
|
---|
379 |
|
---|
380 | /* ***********
|
---|
381 | Directories
|
---|
382 | *********** */
|
---|
383 |
|
---|
384 | latest_dir = QDir::homePath();
|
---|
385 | last_dvd_directory="";
|
---|
386 |
|
---|
387 |
|
---|
388 | /* **************
|
---|
389 | Initial values
|
---|
390 | ************** */
|
---|
391 |
|
---|
392 | initial_sub_scale = 5;
|
---|
393 | initial_sub_scale_ass = 1;
|
---|
394 | initial_volume = 40;
|
---|
395 | initial_contrast = 0;
|
---|
396 | initial_brightness = 0;
|
---|
397 | initial_hue = 0;
|
---|
398 | initial_saturation = 0;
|
---|
399 | initial_gamma = 0;
|
---|
400 |
|
---|
401 | initial_audio_equalizer << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0;
|
---|
402 |
|
---|
403 | initial_zoom_factor = 1.0;
|
---|
404 | initial_sub_pos = 100; // 100%
|
---|
405 |
|
---|
406 | initial_postprocessing = false;
|
---|
407 | initial_volnorm = false;
|
---|
408 |
|
---|
409 | initial_deinterlace = MediaSettings::NoDeinterlace;
|
---|
410 |
|
---|
411 | initial_audio_channels = MediaSettings::ChDefault;
|
---|
412 | initial_stereo_mode = MediaSettings::Stereo;
|
---|
413 |
|
---|
414 | initial_audio_track = 1;
|
---|
415 | initial_subtitle_track = 1;
|
---|
416 |
|
---|
417 |
|
---|
418 | /* ************
|
---|
419 | MPlayer info
|
---|
420 | ************ */
|
---|
421 |
|
---|
422 | mplayer_detected_version = -1; //None version parsed yet
|
---|
423 | mplayer_user_supplied_version = -1;
|
---|
424 |
|
---|
425 |
|
---|
426 | /* *********
|
---|
427 | Instances
|
---|
428 | ********* */
|
---|
429 |
|
---|
430 | #ifdef Q_OS_WIN
|
---|
431 | // Some people reported smplayer doesn't start with this option enabled
|
---|
432 | // So now it's disabled by default on Windows
|
---|
433 | use_single_instance = false;
|
---|
434 | #else
|
---|
435 | use_single_instance = true;
|
---|
436 | #endif
|
---|
437 | use_autoport = true;
|
---|
438 | connection_port = 8000;
|
---|
439 | autoport = 0;
|
---|
440 |
|
---|
441 |
|
---|
442 | /* ****************
|
---|
443 | Floating control
|
---|
444 | **************** */
|
---|
445 |
|
---|
446 | floating_control_margin = 0;
|
---|
447 | floating_control_width = 100; //100 %
|
---|
448 | floating_control_animated = true;
|
---|
449 | floating_display_in_compact_mode = false;
|
---|
450 | #ifndef Q_OS_WIN
|
---|
451 | bypass_window_manager = true;
|
---|
452 | #endif
|
---|
453 |
|
---|
454 |
|
---|
455 | /* *******
|
---|
456 | History
|
---|
457 | ******* */
|
---|
458 |
|
---|
459 | history_recents->clear();
|
---|
460 | history_urls->clear();
|
---|
461 |
|
---|
462 |
|
---|
463 | /* *******
|
---|
464 | Filters
|
---|
465 | ******* */
|
---|
466 |
|
---|
467 | filters->init();
|
---|
468 | }
|
---|
469 |
|
---|
470 | #ifndef NO_USE_INI_FILES
|
---|
471 | void Preferences::save() {
|
---|
472 | qDebug("Preferences::save");
|
---|
473 |
|
---|
474 | QSettings * set = settings;
|
---|
475 |
|
---|
476 |
|
---|
477 | /* *******
|
---|
478 | General
|
---|
479 | ******* */
|
---|
480 |
|
---|
481 | set->beginGroup( "general");
|
---|
482 |
|
---|
483 | set->setValue("mplayer_bin", mplayer_bin);
|
---|
484 | set->setValue("driver/vo", vo);
|
---|
485 | set->setValue("driver/audio_output", ao);
|
---|
486 |
|
---|
487 | set->setValue("use_screenshot", use_screenshot);
|
---|
488 | set->setValue("screenshot_directory", screenshot_directory);
|
---|
489 |
|
---|
490 | set->setValue("dont_remember_media_settings", dont_remember_media_settings);
|
---|
491 | set->setValue("dont_remember_time_pos", dont_remember_time_pos);
|
---|
492 |
|
---|
493 | set->setValue("audio_lang", audio_lang);
|
---|
494 | set->setValue("subtitle_lang", subtitle_lang);
|
---|
495 |
|
---|
496 | set->setValue("use_direct_rendering", use_direct_rendering);
|
---|
497 | set->setValue("use_double_buffer", use_double_buffer);
|
---|
498 | set->setValue("use_soft_video_eq", use_soft_video_eq);
|
---|
499 | set->setValue("use_slices", use_slices );
|
---|
500 | set->setValue("autoq", autoq);
|
---|
501 | set->setValue("add_blackborders_on_fullscreen", add_blackborders_on_fullscreen);
|
---|
502 |
|
---|
503 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
504 | set->setValue("turn_screensaver_off", turn_screensaver_off);
|
---|
505 | set->setValue("avoid_screensaver", avoid_screensaver);
|
---|
506 | #else
|
---|
507 | set->setValue("disable_screensaver", disable_screensaver);
|
---|
508 | #endif
|
---|
509 |
|
---|
510 | #ifndef Q_OS_WIN
|
---|
511 | set->setValue("vdpau_ffh264vdpau", vdpau.ffh264vdpau);
|
---|
512 | set->setValue("vdpau_ffmpeg12vdpau", vdpau.ffmpeg12vdpau);
|
---|
513 | set->setValue("vdpau_ffwmv3vdpau", vdpau.ffwmv3vdpau);
|
---|
514 | set->setValue("vdpau_ffvc1vdpau", vdpau.ffvc1vdpau);
|
---|
515 | set->setValue("vdpau_ffodivxvdpau", vdpau.ffodivxvdpau);
|
---|
516 | set->setValue("vdpau_disable_video_filters", vdpau.disable_video_filters);
|
---|
517 | #endif
|
---|
518 |
|
---|
519 | set->setValue("use_soft_vol", use_soft_vol);
|
---|
520 | set->setValue("softvol_max", softvol_max);
|
---|
521 | set->setValue("use_scaletempo", use_scaletempo);
|
---|
522 | set->setValue("use_hwac3", use_hwac3 );
|
---|
523 | set->setValue("use_audio_equalizer", use_audio_equalizer );
|
---|
524 |
|
---|
525 | set->setValue("global_volume", global_volume);
|
---|
526 | set->setValue("volume", volume);
|
---|
527 | set->setValue("mute", mute);
|
---|
528 |
|
---|
529 | set->setValue("autosync", autosync);
|
---|
530 | set->setValue("autosync_factor", autosync_factor);
|
---|
531 |
|
---|
532 | set->setValue("use_mc", use_mc);
|
---|
533 | set->setValue("mc_value", mc_value);
|
---|
534 |
|
---|
535 | set->setValue("osd", osd);
|
---|
536 | set->setValue("osd_delay", osd_delay);
|
---|
537 |
|
---|
538 | set->setValue("file_settings_method", file_settings_method);
|
---|
539 |
|
---|
540 | set->endGroup(); // general
|
---|
541 |
|
---|
542 |
|
---|
543 | /* ***************
|
---|
544 | Drives (CD/DVD)
|
---|
545 | *************** */
|
---|
546 |
|
---|
547 | set->beginGroup( "drives");
|
---|
548 |
|
---|
549 | set->setValue("dvd_device", dvd_device);
|
---|
550 | set->setValue("cdrom_device", cdrom_device);
|
---|
551 |
|
---|
552 | #ifdef Q_OS_WIN
|
---|
553 | set->setValue("enable_audiocd_on_windows", enable_audiocd_on_windows);
|
---|
554 | #endif
|
---|
555 |
|
---|
556 | set->setValue("vcd_initial_title", vcd_initial_title);
|
---|
557 |
|
---|
558 | #if DVDNAV_SUPPORT
|
---|
559 | set->setValue("use_dvdnav", use_dvdnav);
|
---|
560 | #endif
|
---|
561 |
|
---|
562 | set->endGroup(); // drives
|
---|
563 |
|
---|
564 |
|
---|
565 | /* ***********
|
---|
566 | Performance
|
---|
567 | *********** */
|
---|
568 |
|
---|
569 | set->beginGroup( "performance");
|
---|
570 |
|
---|
571 | set->setValue("priority", priority);
|
---|
572 | set->setValue("frame_drop", frame_drop);
|
---|
573 | set->setValue("hard_frame_drop", hard_frame_drop);
|
---|
574 | set->setValue("coreavc", coreavc);
|
---|
575 | set->setValue("h264_skip_loop_filter", h264_skip_loop_filter);
|
---|
576 | set->setValue("HD_height", HD_height);
|
---|
577 |
|
---|
578 | set->setValue("fast_audio_change", fast_audio_change);
|
---|
579 | #if !SMART_DVD_CHAPTERS
|
---|
580 | set->setValue("fast_chapter_change", fast_chapter_change);
|
---|
581 | #endif
|
---|
582 |
|
---|
583 | set->setValue("threads", threads);
|
---|
584 |
|
---|
585 | set->setValue("cache_for_files", cache_for_files);
|
---|
586 | set->setValue("cache_for_streams", cache_for_streams);
|
---|
587 | set->setValue("cache_for_dvds", cache_for_dvds);
|
---|
588 | set->setValue("cache_for_vcds", cache_for_vcds);
|
---|
589 | set->setValue("cache_for_audiocds", cache_for_audiocds);
|
---|
590 | set->setValue("cache_for_tv", cache_for_tv);
|
---|
591 |
|
---|
592 | set->endGroup(); // performance
|
---|
593 |
|
---|
594 |
|
---|
595 | /* *********
|
---|
596 | Subtitles
|
---|
597 | ********* */
|
---|
598 |
|
---|
599 | set->beginGroup("subtitles");
|
---|
600 |
|
---|
601 | set->setValue("font_file", font_file);
|
---|
602 | set->setValue("font_name", font_name);
|
---|
603 |
|
---|
604 | set->setValue("use_fontconfig", use_fontconfig);
|
---|
605 | set->setValue("subcp", subcp);
|
---|
606 | set->setValue("use_enca", use_enca);
|
---|
607 | set->setValue("enca_lang", enca_lang);
|
---|
608 | set->setValue("font_autoscale", font_autoscale);
|
---|
609 | set->setValue("subfuzziness", subfuzziness);
|
---|
610 | set->setValue("autoload_sub", autoload_sub);
|
---|
611 |
|
---|
612 | set->setValue("use_ass_subtitles", use_ass_subtitles);
|
---|
613 | set->setValue("ass_line_spacing", ass_line_spacing);
|
---|
614 | set->setValue("use_forced_subs_only", use_forced_subs_only);
|
---|
615 |
|
---|
616 | set->setValue("sub_visibility", sub_visibility);
|
---|
617 |
|
---|
618 | set->setValue("subtitles_on_screenshots", subtitles_on_screenshots);
|
---|
619 |
|
---|
620 | set->setValue("use_new_sub_commands", use_new_sub_commands);
|
---|
621 | set->setValue("change_sub_scale_should_restart", change_sub_scale_should_restart);
|
---|
622 |
|
---|
623 | set->setValue("fast_load_sub", fast_load_sub);
|
---|
624 |
|
---|
625 | // ASS styles
|
---|
626 | ass_styles.save(set);
|
---|
627 | set->setValue("force_ass_styles", force_ass_styles);
|
---|
628 | set->setValue("user_forced_ass_style", user_forced_ass_style);
|
---|
629 |
|
---|
630 | set->setValue("freetype_support", freetype_support);
|
---|
631 |
|
---|
632 | set->endGroup(); // subtitles
|
---|
633 |
|
---|
634 |
|
---|
635 | /* ********
|
---|
636 | Advanced
|
---|
637 | ******** */
|
---|
638 |
|
---|
639 | set->beginGroup( "advanced");
|
---|
640 |
|
---|
641 | #if USE_ADAPTER
|
---|
642 | set->setValue("adapter", adapter);
|
---|
643 | #endif
|
---|
644 |
|
---|
645 | #if USE_COLORKEY
|
---|
646 | set->setValue("color_key", QString::number(color_key,16));
|
---|
647 | #endif
|
---|
648 |
|
---|
649 | set->setValue("use_mplayer_window", use_mplayer_window);
|
---|
650 |
|
---|
651 | set->setValue("monitor_aspect", monitor_aspect);
|
---|
652 |
|
---|
653 | set->setValue("use_idx", use_idx);
|
---|
654 |
|
---|
655 | set->setValue("mplayer_additional_options", mplayer_additional_options);
|
---|
656 | set->setValue("mplayer_additional_video_filters", mplayer_additional_video_filters);
|
---|
657 | set->setValue("mplayer_additional_audio_filters", mplayer_additional_audio_filters);
|
---|
658 |
|
---|
659 | set->setValue("log_mplayer", log_mplayer);
|
---|
660 | set->setValue("log_smplayer", log_smplayer);
|
---|
661 | set->setValue("log_filter", log_filter);
|
---|
662 | set->setValue("verbose_log", verbose_log);
|
---|
663 | set->setValue("save_smplayer_log", save_smplayer_log);
|
---|
664 |
|
---|
665 | //mplayer log autosaving
|
---|
666 | set->setValue("autosave_mplayer_log", autosave_mplayer_log);
|
---|
667 | set->setValue("mplayer_log_saveto", mplayer_log_saveto);
|
---|
668 | //mplayer log autosaving end
|
---|
669 |
|
---|
670 | #if REPAINT_BACKGROUND_OPTION
|
---|
671 | set->setValue("repaint_video_background", repaint_video_background);
|
---|
672 | #endif
|
---|
673 |
|
---|
674 | set->setValue("use_edl_files", use_edl_files);
|
---|
675 |
|
---|
676 | set->setValue("prefer_ipv4", prefer_ipv4);
|
---|
677 |
|
---|
678 | set->setValue("use_short_pathnames", use_short_pathnames);
|
---|
679 |
|
---|
680 | set->setValue("change_video_equalizer_on_startup", change_video_equalizer_on_startup);
|
---|
681 |
|
---|
682 | set->setValue("use_pausing_keep_force", use_pausing_keep_force);
|
---|
683 |
|
---|
684 | set->setValue("correct_pts", use_correct_pts);
|
---|
685 |
|
---|
686 | set->setValue("actions_to_run", actions_to_run);
|
---|
687 |
|
---|
688 | set->setValue("show_tag_in_window_title", show_tag_in_window_title);
|
---|
689 |
|
---|
690 | set->endGroup(); // advanced
|
---|
691 |
|
---|
692 |
|
---|
693 | /* *********
|
---|
694 | GUI stuff
|
---|
695 | ********* */
|
---|
696 |
|
---|
697 | set->beginGroup("gui");
|
---|
698 |
|
---|
699 | set->setValue("fullscreen", fullscreen);
|
---|
700 | set->setValue("start_in_fullscreen", start_in_fullscreen);
|
---|
701 |
|
---|
702 | set->setValue("compact_mode", compact_mode);
|
---|
703 | set->setValue("stay_on_top", (int) stay_on_top);
|
---|
704 | set->setValue("size_factor", size_factor);
|
---|
705 | set->setValue("resize_method", resize_method);
|
---|
706 |
|
---|
707 | #if STYLE_SWITCHING
|
---|
708 | set->setValue("style", style);
|
---|
709 | #endif
|
---|
710 |
|
---|
711 | set->setValue("mouse_left_click_function", mouse_left_click_function);
|
---|
712 | set->setValue("mouse_right_click_function", mouse_right_click_function);
|
---|
713 | set->setValue("mouse_double_click_function", mouse_double_click_function);
|
---|
714 | set->setValue("mouse_middle_click_function", mouse_middle_click_function);
|
---|
715 | set->setValue("mouse_xbutton1_click_function", mouse_xbutton1_click_function);
|
---|
716 | set->setValue("mouse_xbutton2_click_function", mouse_xbutton2_click_function);
|
---|
717 | set->setValue("mouse_wheel_function", wheel_function);
|
---|
718 | set->setValue("wheel_function_cycle", (int) wheel_function_cycle);
|
---|
719 | set->setValue("wheel_function_seeking_reverse", wheel_function_seeking_reverse);
|
---|
720 |
|
---|
721 | set->setValue("seeking1", seeking1);
|
---|
722 | set->setValue("seeking2", seeking2);
|
---|
723 | set->setValue("seeking3", seeking3);
|
---|
724 | set->setValue("seeking4", seeking4);
|
---|
725 |
|
---|
726 | set->setValue("update_while_seeking", update_while_seeking);
|
---|
727 | #if ENABLE_DELAYED_DRAGGING
|
---|
728 | set->setValue("time_slider_drag_delay", time_slider_drag_delay);
|
---|
729 | #endif
|
---|
730 | #if SEEKBAR_RESOLUTION
|
---|
731 | set->setValue("relative_seeking", relative_seeking);
|
---|
732 | #endif
|
---|
733 |
|
---|
734 | set->setValue("language", language);
|
---|
735 | set->setValue("iconset", iconset);
|
---|
736 |
|
---|
737 | set->setValue("balloon_count", balloon_count);
|
---|
738 |
|
---|
739 | set->setValue("restore_pos_after_fullscreen", restore_pos_after_fullscreen);
|
---|
740 | set->setValue("save_window_size_on_exit", save_window_size_on_exit);
|
---|
741 |
|
---|
742 | set->setValue("close_on_finish", close_on_finish);
|
---|
743 |
|
---|
744 | set->setValue("default_font", default_font);
|
---|
745 |
|
---|
746 | set->setValue("pause_when_hidden", pause_when_hidden);
|
---|
747 |
|
---|
748 | set->setValue("allow_video_movement", allow_video_movement);
|
---|
749 |
|
---|
750 | set->setValue("gui", gui);
|
---|
751 |
|
---|
752 | #if USE_MINIMUMSIZE
|
---|
753 | set->setValue("gui_minimum_width", gui_minimum_width);
|
---|
754 | #endif
|
---|
755 | set->setValue("default_size", default_size);
|
---|
756 |
|
---|
757 | #if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
|
---|
758 | set->setValue("hide_video_window_on_audio_files", hide_video_window_on_audio_files);
|
---|
759 | #endif
|
---|
760 |
|
---|
761 | set->setValue("report_mplayer_crashes", report_mplayer_crashes);
|
---|
762 |
|
---|
763 | #if REPORT_OLD_MPLAYER
|
---|
764 | set->setValue("reported_mplayer_is_old", reported_mplayer_is_old);
|
---|
765 | #endif
|
---|
766 |
|
---|
767 | set->setValue("auto_add_to_playlist", auto_add_to_playlist);
|
---|
768 | set->setValue("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files);
|
---|
769 |
|
---|
770 | set->endGroup(); // gui
|
---|
771 |
|
---|
772 |
|
---|
773 | /* ********
|
---|
774 | TV (dvb)
|
---|
775 | ******** */
|
---|
776 |
|
---|
777 | set->beginGroup( "tv");
|
---|
778 | set->setValue("check_channels_conf_on_startup", check_channels_conf_on_startup);
|
---|
779 | set->setValue("initial_tv_deinterlace", initial_tv_deinterlace);
|
---|
780 | set->setValue("last_dvb_channel", last_dvb_channel);
|
---|
781 | set->setValue("last_tv_channel", last_tv_channel);
|
---|
782 | set->endGroup(); // tv
|
---|
783 |
|
---|
784 | /* ***********
|
---|
785 | Directories
|
---|
786 | *********** */
|
---|
787 |
|
---|
788 | set->beginGroup( "directories");
|
---|
789 | set->setValue("latest_dir", latest_dir);
|
---|
790 | set->setValue("last_dvd_directory", last_dvd_directory);
|
---|
791 | set->endGroup(); // directories
|
---|
792 |
|
---|
793 |
|
---|
794 | /* **************
|
---|
795 | Initial values
|
---|
796 | ************** */
|
---|
797 |
|
---|
798 | set->beginGroup( "defaults");
|
---|
799 |
|
---|
800 | set->setValue("initial_sub_scale", initial_sub_scale);
|
---|
801 | set->setValue("initial_sub_scale_ass", initial_sub_scale_ass);
|
---|
802 | set->setValue("initial_volume", initial_volume);
|
---|
803 | set->setValue("initial_contrast", initial_contrast);
|
---|
804 | set->setValue("initial_brightness", initial_brightness);
|
---|
805 | set->setValue("initial_hue", initial_hue);
|
---|
806 | set->setValue("initial_saturation", initial_saturation);
|
---|
807 | set->setValue("initial_gamma", initial_gamma);
|
---|
808 |
|
---|
809 | set->setValue("initial_audio_equalizer", initial_audio_equalizer);
|
---|
810 |
|
---|
811 | set->setValue("initial_zoom_factor", initial_zoom_factor);
|
---|
812 | set->setValue("initial_sub_pos", initial_sub_pos);
|
---|
813 |
|
---|
814 | set->setValue("initial_volnorm", initial_volnorm);
|
---|
815 | set->setValue("initial_postprocessing", initial_postprocessing);
|
---|
816 |
|
---|
817 | set->setValue("initial_deinterlace", initial_deinterlace);
|
---|
818 |
|
---|
819 | set->setValue("initial_audio_channels", initial_audio_channels);
|
---|
820 | set->setValue("initial_stereo_mode", initial_stereo_mode);
|
---|
821 |
|
---|
822 | set->setValue("initial_audio_track", initial_audio_track);
|
---|
823 | set->setValue("initial_subtitle_track", initial_subtitle_track);
|
---|
824 |
|
---|
825 | set->endGroup(); // defaults
|
---|
826 |
|
---|
827 |
|
---|
828 | /* ************
|
---|
829 | MPlayer info
|
---|
830 | ************ */
|
---|
831 |
|
---|
832 | set->beginGroup( "mplayer_info");
|
---|
833 | set->setValue("mplayer_detected_version", mplayer_detected_version);
|
---|
834 | set->setValue("mplayer_user_supplied_version", mplayer_user_supplied_version);
|
---|
835 | set->endGroup(); // mplayer_info
|
---|
836 |
|
---|
837 |
|
---|
838 | /* *********
|
---|
839 | Instances
|
---|
840 | ********* */
|
---|
841 |
|
---|
842 | set->beginGroup("instances");
|
---|
843 | set->setValue("use_single_instance", use_single_instance);
|
---|
844 | set->setValue("connection_port", connection_port);
|
---|
845 | set->setValue("use_autoport", use_autoport);
|
---|
846 | set->setValue("temp/autoport", autoport);
|
---|
847 | set->endGroup(); // instances
|
---|
848 |
|
---|
849 |
|
---|
850 | /* ****************
|
---|
851 | Floating control
|
---|
852 | **************** */
|
---|
853 |
|
---|
854 | set->beginGroup("floating_control");
|
---|
855 | set->setValue("margin", floating_control_margin);
|
---|
856 | set->setValue("width", floating_control_width);
|
---|
857 | set->setValue("animated", floating_control_animated);
|
---|
858 | set->setValue("display_in_compact_mode", floating_display_in_compact_mode);
|
---|
859 | #ifndef Q_OS_WIN
|
---|
860 | set->setValue("bypass_window_manager", bypass_window_manager);
|
---|
861 | #endif
|
---|
862 | set->endGroup(); // floating_control
|
---|
863 |
|
---|
864 |
|
---|
865 | /* *******
|
---|
866 | History
|
---|
867 | ******* */
|
---|
868 |
|
---|
869 | set->beginGroup("history");
|
---|
870 | set->setValue("recents", history_recents->toStringList());
|
---|
871 | set->setValue("recents/max_items", history_recents->maxItems());
|
---|
872 | set->setValue("urls", history_urls->toStringList());
|
---|
873 | set->setValue("urls/max_items", history_urls->maxItems());
|
---|
874 | set->endGroup(); // history
|
---|
875 |
|
---|
876 |
|
---|
877 | /* *******
|
---|
878 | Filters
|
---|
879 | ******* */
|
---|
880 |
|
---|
881 | filters->save(set);
|
---|
882 |
|
---|
883 |
|
---|
884 | set->sync();
|
---|
885 | }
|
---|
886 |
|
---|
887 | void Preferences::load() {
|
---|
888 | qDebug("Preferences::load");
|
---|
889 |
|
---|
890 | QSettings * set = settings;
|
---|
891 |
|
---|
892 |
|
---|
893 | /* *******
|
---|
894 | General
|
---|
895 | ******* */
|
---|
896 |
|
---|
897 | set->beginGroup( "general");
|
---|
898 |
|
---|
899 | mplayer_bin = set->value("mplayer_bin", mplayer_bin).toString();
|
---|
900 | vo = set->value("driver/vo", vo).toString();
|
---|
901 | ao = set->value("driver/audio_output", ao).toString();
|
---|
902 |
|
---|
903 | use_screenshot = set->value("use_screenshot", use_screenshot).toBool();
|
---|
904 | screenshot_directory = set->value("screenshot_directory", screenshot_directory).toString();
|
---|
905 |
|
---|
906 | dont_remember_media_settings = set->value("dont_remember_media_settings", dont_remember_media_settings).toBool();
|
---|
907 | dont_remember_time_pos = set->value("dont_remember_time_pos", dont_remember_time_pos).toBool();
|
---|
908 |
|
---|
909 | audio_lang = set->value("audio_lang", audio_lang).toString();
|
---|
910 | subtitle_lang = set->value("subtitle_lang", subtitle_lang).toString();
|
---|
911 |
|
---|
912 | use_direct_rendering = set->value("use_direct_rendering", use_direct_rendering).toBool();
|
---|
913 | use_double_buffer = set->value("use_double_buffer", use_double_buffer).toBool();
|
---|
914 |
|
---|
915 | use_soft_video_eq = set->value("use_soft_video_eq", use_soft_video_eq).toBool();
|
---|
916 | use_slices = set->value("use_slices", use_slices ).toBool();
|
---|
917 | autoq = set->value("autoq", autoq).toInt();
|
---|
918 | add_blackborders_on_fullscreen = set->value("add_blackborders_on_fullscreen", add_blackborders_on_fullscreen).toBool();
|
---|
919 |
|
---|
920 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
921 | turn_screensaver_off = set->value("turn_screensaver_off", turn_screensaver_off).toBool();
|
---|
922 | avoid_screensaver = set->value("avoid_screensaver", avoid_screensaver).toBool();
|
---|
923 | #else
|
---|
924 | disable_screensaver = set->value("disable_screensaver", disable_screensaver).toBool();
|
---|
925 | #endif
|
---|
926 |
|
---|
927 | #ifndef Q_OS_WIN
|
---|
928 | vdpau.ffh264vdpau = set->value("vdpau_ffh264vdpau", vdpau.ffh264vdpau).toBool();
|
---|
929 | vdpau.ffmpeg12vdpau = set->value("vdpau_ffmpeg12vdpau", vdpau.ffmpeg12vdpau).toBool();
|
---|
930 | vdpau.ffwmv3vdpau = set->value("vdpau_ffwmv3vdpau", vdpau.ffwmv3vdpau).toBool();
|
---|
931 | vdpau.ffvc1vdpau = set->value("vdpau_ffvc1vdpau", vdpau.ffvc1vdpau).toBool();
|
---|
932 | vdpau.ffodivxvdpau = set->value("vdpau_ffodivxvdpau", vdpau.ffodivxvdpau).toBool();
|
---|
933 | vdpau.disable_video_filters = set->value("vdpau_disable_video_filters", vdpau.disable_video_filters).toBool();
|
---|
934 | #endif
|
---|
935 |
|
---|
936 | use_soft_vol = set->value("use_soft_vol", use_soft_vol).toBool();
|
---|
937 | softvol_max = set->value("softvol_max", softvol_max).toInt();
|
---|
938 | use_scaletempo = (OptionState) set->value("use_scaletempo", use_scaletempo).toInt();
|
---|
939 | use_hwac3 = set->value("use_hwac3", use_hwac3 ).toBool();
|
---|
940 | use_audio_equalizer = set->value("use_audio_equalizer", use_audio_equalizer ).toBool();
|
---|
941 |
|
---|
942 | global_volume = set->value("global_volume", global_volume).toBool();
|
---|
943 | volume = set->value("volume", volume).toInt();
|
---|
944 | mute = set->value("mute", mute).toBool();
|
---|
945 |
|
---|
946 | autosync = set->value("autosync", autosync).toBool();
|
---|
947 | autosync_factor = set->value("autosync_factor", autosync_factor).toInt();
|
---|
948 |
|
---|
949 | use_mc = set->value("use_mc", use_mc).toBool();
|
---|
950 | mc_value = set->value("mc_value", mc_value).toDouble();
|
---|
951 |
|
---|
952 | osd = set->value("osd", osd).toInt();
|
---|
953 | osd_delay = set->value("osd_delay", osd_delay).toInt();
|
---|
954 |
|
---|
955 | file_settings_method = set->value("file_settings_method", file_settings_method).toString();
|
---|
956 |
|
---|
957 | set->endGroup(); // general
|
---|
958 |
|
---|
959 |
|
---|
960 | /* ***************
|
---|
961 | Drives (CD/DVD)
|
---|
962 | *************** */
|
---|
963 |
|
---|
964 | set->beginGroup( "drives");
|
---|
965 |
|
---|
966 | dvd_device = set->value("dvd_device", dvd_device).toString();
|
---|
967 | cdrom_device = set->value("cdrom_device", cdrom_device).toString();
|
---|
968 |
|
---|
969 | #ifdef Q_OS_WIN
|
---|
970 | enable_audiocd_on_windows = set->value("enable_audiocd_on_windows", enable_audiocd_on_windows).toBool();
|
---|
971 | #endif
|
---|
972 |
|
---|
973 | vcd_initial_title = set->value("vcd_initial_title", vcd_initial_title ).toInt();
|
---|
974 |
|
---|
975 | #if DVDNAV_SUPPORT
|
---|
976 | use_dvdnav = set->value("use_dvdnav", use_dvdnav).toBool();
|
---|
977 | #endif
|
---|
978 |
|
---|
979 | set->endGroup(); // drives
|
---|
980 |
|
---|
981 |
|
---|
982 | /* ***********
|
---|
983 | Performance
|
---|
984 | *********** */
|
---|
985 |
|
---|
986 | set->beginGroup( "performance");
|
---|
987 |
|
---|
988 | priority = set->value("priority", priority).toInt();
|
---|
989 | frame_drop = set->value("frame_drop", frame_drop).toBool();
|
---|
990 | hard_frame_drop = set->value("hard_frame_drop", hard_frame_drop).toBool();
|
---|
991 | coreavc = set->value("coreavc", coreavc).toBool();
|
---|
992 | h264_skip_loop_filter = (H264LoopFilter) set->value("h264_skip_loop_filter", h264_skip_loop_filter).toInt();
|
---|
993 | HD_height = set->value("HD_height", HD_height).toInt();
|
---|
994 |
|
---|
995 | fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt();
|
---|
996 | #if !SMART_DVD_CHAPTERS
|
---|
997 | fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool();
|
---|
998 | #endif
|
---|
999 |
|
---|
1000 | threads = set->value("threads", threads).toInt();
|
---|
1001 |
|
---|
1002 | cache_for_files = set->value("cache_for_files", cache_for_files).toInt();
|
---|
1003 | cache_for_streams = set->value("cache_for_streams", cache_for_streams).toInt();
|
---|
1004 | cache_for_dvds = set->value("cache_for_dvds", cache_for_dvds).toInt();
|
---|
1005 | cache_for_vcds = set->value("cache_for_vcds", cache_for_vcds).toInt();
|
---|
1006 | cache_for_audiocds = set->value("cache_for_audiocds", cache_for_audiocds).toInt();
|
---|
1007 | cache_for_tv = set->value("cache_for_tv", cache_for_tv).toInt();
|
---|
1008 |
|
---|
1009 | set->endGroup(); // performance
|
---|
1010 |
|
---|
1011 |
|
---|
1012 | /* *********
|
---|
1013 | Subtitles
|
---|
1014 | ********* */
|
---|
1015 |
|
---|
1016 | set->beginGroup("subtitles");
|
---|
1017 |
|
---|
1018 | font_file = set->value("font_file", font_file).toString();
|
---|
1019 | font_name = set->value("font_name", font_name).toString();
|
---|
1020 |
|
---|
1021 | use_fontconfig = set->value("use_fontconfig", use_fontconfig).toBool();
|
---|
1022 | subcp = set->value("subcp", subcp).toString();
|
---|
1023 | use_enca = set->value("use_enca", use_enca).toBool();
|
---|
1024 | enca_lang = set->value("enca_lang", enca_lang).toString();
|
---|
1025 | font_autoscale = set->value("font_autoscale", font_autoscale).toInt();
|
---|
1026 | subfuzziness = set->value("subfuzziness", subfuzziness).toInt();
|
---|
1027 | autoload_sub = set->value("autoload_sub", autoload_sub).toBool();
|
---|
1028 |
|
---|
1029 | use_ass_subtitles = set->value("use_ass_subtitles", use_ass_subtitles).toBool();
|
---|
1030 | ass_line_spacing = set->value("ass_line_spacing", ass_line_spacing).toInt();
|
---|
1031 |
|
---|
1032 | use_forced_subs_only = set->value("use_forced_subs_only", use_forced_subs_only).toBool();
|
---|
1033 |
|
---|
1034 | sub_visibility = set->value("sub_visibility", sub_visibility).toBool();
|
---|
1035 |
|
---|
1036 | subtitles_on_screenshots = set->value("subtitles_on_screenshots", subtitles_on_screenshots).toBool();
|
---|
1037 |
|
---|
1038 | use_new_sub_commands = (OptionState) set->value("use_new_sub_commands", use_new_sub_commands).toInt();
|
---|
1039 | change_sub_scale_should_restart = (OptionState) set->value("change_sub_scale_should_restart", change_sub_scale_should_restart).toInt();
|
---|
1040 |
|
---|
1041 | fast_load_sub = set->value("fast_load_sub", fast_load_sub).toBool();
|
---|
1042 |
|
---|
1043 | // ASS styles
|
---|
1044 | ass_styles.load(set);
|
---|
1045 | force_ass_styles = set->value("force_ass_styles", force_ass_styles).toBool();
|
---|
1046 | user_forced_ass_style = set->value("user_forced_ass_style", user_forced_ass_style).toString();
|
---|
1047 |
|
---|
1048 | freetype_support = set->value("freetype_support", freetype_support).toBool();
|
---|
1049 |
|
---|
1050 | set->endGroup(); // subtitles
|
---|
1051 |
|
---|
1052 |
|
---|
1053 | /* ********
|
---|
1054 | Advanced
|
---|
1055 | ******** */
|
---|
1056 |
|
---|
1057 | set->beginGroup( "advanced");
|
---|
1058 |
|
---|
1059 | #if USE_ADAPTER
|
---|
1060 | adapter = set->value("adapter", adapter).toInt();
|
---|
1061 | #endif
|
---|
1062 |
|
---|
1063 | #if USE_COLORKEY
|
---|
1064 | bool ok;
|
---|
1065 | QString color = set->value("color_key", QString::number(color_key,16)).toString();
|
---|
1066 | unsigned int temp_color_key = color.toUInt(&ok, 16);
|
---|
1067 | if (ok)
|
---|
1068 | color_key = temp_color_key;
|
---|
1069 | //color_key = set->value("color_key", color_key).toInt();
|
---|
1070 | #endif
|
---|
1071 |
|
---|
1072 | use_mplayer_window = set->value("use_mplayer_window", use_mplayer_window).toBool();
|
---|
1073 |
|
---|
1074 | monitor_aspect = set->value("monitor_aspect", monitor_aspect).toString();
|
---|
1075 |
|
---|
1076 | use_idx = set->value("use_idx", use_idx).toBool();
|
---|
1077 |
|
---|
1078 | mplayer_additional_options = set->value("mplayer_additional_options", mplayer_additional_options).toString();
|
---|
1079 | mplayer_additional_video_filters = set->value("mplayer_additional_video_filters", mplayer_additional_video_filters).toString();
|
---|
1080 | mplayer_additional_audio_filters = set->value("mplayer_additional_audio_filters", mplayer_additional_audio_filters).toString();
|
---|
1081 |
|
---|
1082 | log_mplayer = set->value("log_mplayer", log_mplayer).toBool();
|
---|
1083 | log_smplayer = set->value("log_smplayer", log_smplayer).toBool();
|
---|
1084 | log_filter = set->value("log_filter", log_filter).toString();
|
---|
1085 | verbose_log = set->value("verbose_log", verbose_log).toBool();
|
---|
1086 | save_smplayer_log = set->value("save_smplayer_log", save_smplayer_log).toBool();
|
---|
1087 |
|
---|
1088 | //mplayer log autosaving
|
---|
1089 | autosave_mplayer_log = set->value("autosave_mplayer_log", autosave_mplayer_log).toBool();
|
---|
1090 | mplayer_log_saveto = set->value("mplayer_log_saveto", mplayer_log_saveto).toString();
|
---|
1091 | //mplayer log autosaving end
|
---|
1092 |
|
---|
1093 | #if REPAINT_BACKGROUND_OPTION
|
---|
1094 | repaint_video_background = set->value("repaint_video_background", repaint_video_background).toBool();
|
---|
1095 | #endif
|
---|
1096 |
|
---|
1097 | use_edl_files = set->value("use_edl_files", use_edl_files).toBool();
|
---|
1098 |
|
---|
1099 | prefer_ipv4 = set->value("prefer_ipv4", prefer_ipv4).toBool();
|
---|
1100 |
|
---|
1101 | use_short_pathnames = set->value("use_short_pathnames", use_short_pathnames).toBool();
|
---|
1102 |
|
---|
1103 | use_pausing_keep_force = set->value("use_pausing_keep_force", use_pausing_keep_force).toBool();
|
---|
1104 |
|
---|
1105 | use_correct_pts = (OptionState) set->value("correct_pts", use_correct_pts).toInt();
|
---|
1106 |
|
---|
1107 | actions_to_run = set->value("actions_to_run", actions_to_run).toString();
|
---|
1108 |
|
---|
1109 | show_tag_in_window_title = set->value("show_tag_in_window_title", show_tag_in_window_title).toBool();
|
---|
1110 |
|
---|
1111 | set->endGroup(); // advanced
|
---|
1112 |
|
---|
1113 |
|
---|
1114 | /* *********
|
---|
1115 | GUI stuff
|
---|
1116 | ********* */
|
---|
1117 |
|
---|
1118 | set->beginGroup("gui");
|
---|
1119 |
|
---|
1120 | fullscreen = set->value("fullscreen", fullscreen).toBool();
|
---|
1121 | start_in_fullscreen = set->value("start_in_fullscreen", start_in_fullscreen).toBool();
|
---|
1122 |
|
---|
1123 | compact_mode = set->value("compact_mode", compact_mode).toBool();
|
---|
1124 | stay_on_top = (Preferences::OnTop) set->value("stay_on_top", (int) stay_on_top).toInt();
|
---|
1125 | size_factor = set->value("size_factor", size_factor).toInt();
|
---|
1126 | resize_method = set->value("resize_method", resize_method).toInt();
|
---|
1127 |
|
---|
1128 | #if STYLE_SWITCHING
|
---|
1129 | style = set->value("style", style).toString();
|
---|
1130 | #endif
|
---|
1131 |
|
---|
1132 | mouse_left_click_function = set->value("mouse_left_click_function", mouse_left_click_function).toString();
|
---|
1133 | mouse_right_click_function = set->value("mouse_right_click_function", mouse_right_click_function).toString();
|
---|
1134 | mouse_double_click_function = set->value("mouse_double_click_function", mouse_double_click_function).toString();
|
---|
1135 | mouse_middle_click_function = set->value("mouse_middle_click_function", mouse_middle_click_function).toString();
|
---|
1136 | mouse_xbutton1_click_function = set->value("mouse_xbutton1_click_function", mouse_xbutton1_click_function).toString();
|
---|
1137 | mouse_xbutton2_click_function = set->value("mouse_xbutton2_click_function", mouse_xbutton2_click_function).toString();
|
---|
1138 | wheel_function = set->value("mouse_wheel_function", wheel_function).toInt();
|
---|
1139 | int wheel_function_cycle_int = set->value("wheel_function_cycle", (int) wheel_function_cycle).toInt();
|
---|
1140 | wheel_function_cycle = QFlags<Preferences::WheelFunctions> (QFlag(wheel_function_cycle_int));
|
---|
1141 | wheel_function_seeking_reverse = set->value("wheel_function_seeking_reverse", wheel_function_seeking_reverse).toBool();
|
---|
1142 |
|
---|
1143 | seeking1 = set->value("seeking1", seeking1).toInt();
|
---|
1144 | seeking2 = set->value("seeking2", seeking2).toInt();
|
---|
1145 | seeking3 = set->value("seeking3", seeking3).toInt();
|
---|
1146 | seeking4 = set->value("seeking4", seeking4).toInt();
|
---|
1147 |
|
---|
1148 | update_while_seeking = set->value("update_while_seeking", update_while_seeking).toBool();
|
---|
1149 | #if ENABLE_DELAYED_DRAGGING
|
---|
1150 | time_slider_drag_delay = set->value("time_slider_drag_delay", time_slider_drag_delay).toInt();
|
---|
1151 | #endif
|
---|
1152 | #if SEEKBAR_RESOLUTION
|
---|
1153 | relative_seeking = set->value("relative_seeking", relative_seeking).toBool();
|
---|
1154 | #endif
|
---|
1155 |
|
---|
1156 | language = set->value("language", language).toString();
|
---|
1157 | iconset= set->value("iconset", iconset).toString();
|
---|
1158 |
|
---|
1159 | balloon_count = set->value("balloon_count", balloon_count).toInt();
|
---|
1160 |
|
---|
1161 | restore_pos_after_fullscreen = set->value("restore_pos_after_fullscreen", restore_pos_after_fullscreen).toBool();
|
---|
1162 | save_window_size_on_exit = set->value("save_window_size_on_exit", save_window_size_on_exit).toBool();
|
---|
1163 |
|
---|
1164 | close_on_finish = set->value("close_on_finish", close_on_finish).toBool();
|
---|
1165 |
|
---|
1166 | default_font = set->value("default_font", default_font).toString();
|
---|
1167 |
|
---|
1168 | pause_when_hidden = set->value("pause_when_hidden", pause_when_hidden).toBool();
|
---|
1169 |
|
---|
1170 | allow_video_movement = set->value("allow_video_movement", allow_video_movement).toBool();
|
---|
1171 |
|
---|
1172 | gui = set->value("gui", gui).toString();
|
---|
1173 |
|
---|
1174 | #if USE_MINIMUMSIZE
|
---|
1175 | gui_minimum_width = set->value("gui_minimum_width", gui_minimum_width).toInt();
|
---|
1176 | #endif
|
---|
1177 | default_size = set->value("default_size", default_size).toSize();
|
---|
1178 |
|
---|
1179 | #if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
|
---|
1180 | hide_video_window_on_audio_files = set->value("hide_video_window_on_audio_files", hide_video_window_on_audio_files).toBool();
|
---|
1181 | #endif
|
---|
1182 |
|
---|
1183 | report_mplayer_crashes = set->value("report_mplayer_crashes", report_mplayer_crashes).toBool();
|
---|
1184 |
|
---|
1185 | #if REPORT_OLD_MPLAYER
|
---|
1186 | reported_mplayer_is_old = set->value("reported_mplayer_is_old", reported_mplayer_is_old).toBool();
|
---|
1187 | #endif
|
---|
1188 |
|
---|
1189 | auto_add_to_playlist = set->value("auto_add_to_playlist", auto_add_to_playlist).toBool();
|
---|
1190 | add_to_playlist_consecutive_files = set->value("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files).toBool();
|
---|
1191 |
|
---|
1192 | set->endGroup(); // gui
|
---|
1193 |
|
---|
1194 |
|
---|
1195 | /* ********
|
---|
1196 | TV (dvb)
|
---|
1197 | ******** */
|
---|
1198 |
|
---|
1199 | set->beginGroup( "tv");
|
---|
1200 | check_channels_conf_on_startup = set->value("check_channels_conf_on_startup", check_channels_conf_on_startup).toBool();
|
---|
1201 | initial_tv_deinterlace = set->value("initial_tv_deinterlace", initial_tv_deinterlace).toInt();
|
---|
1202 | last_dvb_channel = set->value("last_dvb_channel", last_dvb_channel).toString();
|
---|
1203 | last_tv_channel = set->value("last_tv_channel", last_tv_channel).toString();
|
---|
1204 | set->endGroup(); // tv
|
---|
1205 |
|
---|
1206 |
|
---|
1207 | /* ***********
|
---|
1208 | Directories
|
---|
1209 | *********** */
|
---|
1210 |
|
---|
1211 | set->beginGroup( "directories");
|
---|
1212 | latest_dir = set->value("latest_dir", latest_dir).toString();
|
---|
1213 | last_dvd_directory = set->value("last_dvd_directory", last_dvd_directory).toString();
|
---|
1214 | set->endGroup(); // directories
|
---|
1215 |
|
---|
1216 |
|
---|
1217 | /* **************
|
---|
1218 | Initial values
|
---|
1219 | ************** */
|
---|
1220 |
|
---|
1221 | set->beginGroup( "defaults");
|
---|
1222 |
|
---|
1223 | initial_sub_scale = set->value("initial_sub_scale", initial_sub_scale).toDouble();
|
---|
1224 | initial_sub_scale_ass = set->value("initial_sub_scale_ass", initial_sub_scale_ass).toDouble();
|
---|
1225 | initial_volume = set->value("initial_volume", initial_volume).toInt();
|
---|
1226 | initial_contrast = set->value("initial_contrast", initial_contrast).toInt();
|
---|
1227 | initial_brightness = set->value("initial_brightness", initial_brightness).toInt();
|
---|
1228 | initial_hue = set->value("initial_hue", initial_hue).toInt();
|
---|
1229 | initial_saturation = set->value("initial_saturation", initial_saturation).toInt();
|
---|
1230 | initial_gamma = set->value("initial_gamma", initial_gamma).toInt();
|
---|
1231 |
|
---|
1232 | initial_audio_equalizer = set->value("initial_audio_equalizer", initial_audio_equalizer).toList();
|
---|
1233 |
|
---|
1234 | initial_zoom_factor = set->value("initial_zoom_factor", initial_zoom_factor).toDouble();
|
---|
1235 | initial_sub_pos = set->value("initial_sub_pos", initial_sub_pos).toInt();
|
---|
1236 |
|
---|
1237 | initial_volnorm = set->value("initial_volnorm", initial_volnorm).toBool();
|
---|
1238 | initial_postprocessing = set->value("initial_postprocessing", initial_postprocessing).toBool();
|
---|
1239 |
|
---|
1240 | initial_deinterlace = set->value("initial_deinterlace", initial_deinterlace).toInt();
|
---|
1241 |
|
---|
1242 | initial_audio_channels = set->value("initial_audio_channels", initial_audio_channels).toInt();
|
---|
1243 | initial_stereo_mode = set->value("initial_stereo_mode", initial_stereo_mode).toInt();
|
---|
1244 |
|
---|
1245 | initial_audio_track = set->value("initial_audio_track", initial_audio_track).toInt();
|
---|
1246 | initial_subtitle_track = set->value("initial_subtitle_track", initial_subtitle_track).toInt();
|
---|
1247 |
|
---|
1248 | set->endGroup(); // defaults
|
---|
1249 |
|
---|
1250 |
|
---|
1251 | /* ************
|
---|
1252 | MPlayer info
|
---|
1253 | ************ */
|
---|
1254 |
|
---|
1255 | set->beginGroup( "mplayer_info");
|
---|
1256 | mplayer_detected_version = set->value("mplayer_detected_version", mplayer_detected_version).toInt();
|
---|
1257 | mplayer_user_supplied_version = set->value("mplayer_user_supplied_version", mplayer_user_supplied_version).toInt();
|
---|
1258 | set->endGroup(); // mplayer_info
|
---|
1259 |
|
---|
1260 |
|
---|
1261 | /* *********
|
---|
1262 | Instances
|
---|
1263 | ********* */
|
---|
1264 |
|
---|
1265 | set->beginGroup("instances");
|
---|
1266 | use_single_instance = set->value("use_single_instance", use_single_instance).toBool();
|
---|
1267 | connection_port = set->value("connection_port", connection_port).toInt();
|
---|
1268 | use_autoport = set->value("use_autoport", use_autoport).toBool();
|
---|
1269 | autoport = set->value("temp/autoport", autoport).toInt();
|
---|
1270 | set->endGroup(); // instances
|
---|
1271 |
|
---|
1272 |
|
---|
1273 | /* ****************
|
---|
1274 | Floating control
|
---|
1275 | **************** */
|
---|
1276 |
|
---|
1277 | set->beginGroup("floating_control");
|
---|
1278 | floating_control_margin = set->value("margin", floating_control_margin).toInt();
|
---|
1279 | floating_control_width = set->value("width", floating_control_width).toInt();
|
---|
1280 | floating_control_animated = set->value("animated", floating_control_animated).toBool();
|
---|
1281 | floating_display_in_compact_mode = set->value("display_in_compact_mode", floating_display_in_compact_mode).toBool();
|
---|
1282 | #ifndef Q_OS_WIN
|
---|
1283 | bypass_window_manager = set->value("bypass_window_manager", bypass_window_manager).toBool();
|
---|
1284 | #endif
|
---|
1285 | set->endGroup(); // floating_control
|
---|
1286 |
|
---|
1287 |
|
---|
1288 | /* *******
|
---|
1289 | History
|
---|
1290 | ******* */
|
---|
1291 |
|
---|
1292 | set->beginGroup("history");
|
---|
1293 |
|
---|
1294 | history_recents->setMaxItems( set->value("recents/max_items", history_recents->maxItems()).toInt() );
|
---|
1295 | history_recents->fromStringList( set->value("recents", history_recents->toStringList()).toStringList() );
|
---|
1296 |
|
---|
1297 | history_urls->setMaxItems( set->value("urls/max_items", history_urls->maxItems()).toInt() );
|
---|
1298 | history_urls->fromStringList( set->value("urls", history_urls->toStringList()).toStringList() );
|
---|
1299 |
|
---|
1300 | set->endGroup(); // history
|
---|
1301 |
|
---|
1302 |
|
---|
1303 | /* *******
|
---|
1304 | Filters
|
---|
1305 | ******* */
|
---|
1306 |
|
---|
1307 | filters->load(set);
|
---|
1308 | }
|
---|
1309 |
|
---|
1310 | #endif // NO_USE_INI_FILES
|
---|
1311 |
|
---|
1312 | double Preferences::monitor_aspect_double() {
|
---|
1313 | qDebug("Preferences::monitor_aspect_double");
|
---|
1314 |
|
---|
1315 | QRegExp exp("(\\d+)[:/](\\d+)");
|
---|
1316 | if (exp.indexIn( monitor_aspect ) != -1) {
|
---|
1317 | int w = exp.cap(1).toInt();
|
---|
1318 | int h = exp.cap(2).toInt();
|
---|
1319 | qDebug(" monitor_aspect parsed successfully: %d:%d", w, h);
|
---|
1320 | return (double) w/h;
|
---|
1321 | }
|
---|
1322 |
|
---|
1323 | bool ok;
|
---|
1324 | double res = monitor_aspect.toDouble(&ok);
|
---|
1325 | if (ok) {
|
---|
1326 | qDebug(" monitor_aspect parsed successfully: %f", res);
|
---|
1327 | return res;
|
---|
1328 | } else {
|
---|
1329 | qDebug(" warning: monitor_aspect couldn't be parsed!");
|
---|
1330 | qDebug(" monitor_aspect set to 0");
|
---|
1331 | return 0;
|
---|
1332 | }
|
---|
1333 | }
|
---|