1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
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.
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.
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
19
#include "preferences.h"
22
#include "mediasettings.h"
29
using namespace Global;
31
Preferences::Preferences() {
34
#ifndef NO_USE_INI_FILES
39
Preferences::~Preferences() {
40
#ifndef NO_USE_INI_FILES
45
void Preferences::reset() {
47
mplayer_bin= "mplayer/mplayer.exe";
49
mplayer_bin = "mplayer";
53
QFileInfo fi(mplayer_bin);
55
mplayer_bin = fi.absFilePath();
56
qDebug("mplayer_bin: '%s'", mplayer_bin.toUtf8().data());
60
use_fontconfig = FALSE;
61
use_ass_subtitles = FALSE;
69
ass_border_color = 0x000000;
70
//ass_styles = "Bold=1,Outline=2,Shadow=2";
72
change_sub_scale_should_restart = Detect;
73
use_new_sub_commands = Detect;
75
use_closed_caption_subs = false;
76
use_forced_subs_only = false;
90
// MPlayer 1.0rc1 require restart, new versions don't
91
fast_audio_change = Detect;
92
#if !SMART_DVD_CHAPTERS
93
fast_chapter_change = false;
97
cache_for_streams = 1000;
98
cache_for_dvds = 0; // not recommended to use cache for dvds
100
cache_for_audiocds = 0;
103
use_mplayer_window = FALSE;
105
monitor_aspect=""; // Autodetect
107
latest_dir = QDir::homePath();
109
last_dvd_directory="";
113
resize_method = Always;
114
disable_screensaver = true;
116
use_direct_rendering = false;
117
use_double_buffer = true;
119
screenshot_directory="";
120
if (QFile::exists(Helper::appHomePath() + "/screenshots")) {
121
screenshot_directory = Helper::appHomePath() + "/screenshots";
123
subtitles_on_screenshots = false;
125
use_soft_video_eq = FALSE;
126
use_soft_vol = FALSE;
127
softvol_max = 110; // 110 = default value in mplayer
128
use_scaletempo = Detect;
135
dont_change_volume = false;
139
mplayer_additional_options="";
140
mplayer_additional_video_filters="";
141
mplayer_additional_audio_filters="";
143
priority = AboveNormal; // Option only for windows
145
hard_frame_drop = false;
147
autosync_factor = 100;
149
h264_skip_loop_filter = LoopEnabled;
152
dont_remember_media_settings = FALSE;
153
dont_remember_time_pos = FALSE;
160
start_in_fullscreen = FALSE;
162
compact_mode = FALSE;
164
size_factor = 100; // 100%
166
show_frame_counter = FALSE;
167
show_motion_vectors = false;
173
use_single_instance = FALSE;
174
connection_port = 8000;
176
mouse_left_click_function = "";
177
mouse_right_click_function = "show_context_menu";
178
mouse_double_click_function = "fullscreen";
179
mouse_middle_click_function = "mute";
180
mouse_xbutton1_click_function = "";
181
mouse_xbutton2_click_function = "";
182
wheel_function = Seeking;
184
recents_max_items = 10;
191
update_while_seeking = false;
192
#if ENABLE_DELAYED_DRAGGING
193
time_slider_drag_delay = 100;
203
// "Don't repaint video background" in the preferences dialog
205
always_clear_video_background = true;
207
always_clear_video_background = false;
210
rx_endoffile = "Exiting... \\(End of file\\)";
211
rx_novideo = "Video: no video";
215
dont_use_eq_options = false;
218
restore_pos_after_fullscreen = true;
220
restore_pos_after_fullscreen = false;
223
save_window_size_on_exit = true;
226
//enable_vcd_on_windows = false;
227
enable_audiocd_on_windows = false;
230
close_on_finish = false;
234
pause_when_hidden = false;
236
allow_video_movement = false;
238
use_edl_files = true;
242
vcd_initial_title = 2; // Most VCD's start at title #2
244
initial_sub_scale = 5;
246
initial_sub_scale_ass = 1;
249
initial_contrast = 0;
250
initial_brightness = 0;
252
initial_saturation = 0;
255
initial_panscan_factor = 1.0;
256
initial_sub_pos = 100; // 100%
258
initial_postprocessing = false;
259
initial_volnorm = false;
261
initial_deinterlace = MediaSettings::NoDeinterlace;
263
initial_audio_channels = MediaSettings::ChDefault;
265
initial_audio_track = 1;
266
initial_subtitle_track = 1;
268
//mplayer log autosaving
269
autosave_mplayer_log = false;
270
mplayer_log_saveto = "";
271
//mplayer log autosaving end
273
auto_add_to_playlist = true;
274
use_volume_option2 = Detect;
276
use_short_pathnames = false;
278
mplayer_detected_version = -1; //None version parsed yet
279
mplayer_user_supplied_version = -1;
280
mplayer_has_volume_option = false;
283
#ifndef NO_USE_INI_FILES
284
void Preferences::save() {
285
qDebug("Preferences::save");
287
QSettings * set = settings;
289
set->beginGroup( "preferences");
291
set->setValue("mplayer_bin", mplayer_bin);
292
set->setValue("use_fontconfig", use_fontconfig);
293
set->setValue("font_file", font_file);
294
set->setValue("font_name", font_name);
295
set->setValue("font_autoscale", font_autoscale);
296
set->setValue("subcp", subcp);
297
set->setValue("use_ass_subtitles", use_ass_subtitles);
298
set->setValue("autoload_sub", autoload_sub);
299
set->setValue("subfuzziness", subfuzziness);
300
set->setValue("ass_color", (int) ass_color);
301
set->setValue("ass_border_color", (int) ass_border_color);
302
set->setValue("ass_styles", ass_styles);
303
set->setValue("change_sub_scale_should_restart", change_sub_scale_should_restart);
304
set->setValue("use_new_sub_commands", use_new_sub_commands);
305
set->setValue("use_closed_caption_subs", use_closed_caption_subs);
306
set->setValue("use_forced_subs_only", use_forced_subs_only);
308
set->setValue("osd", osd);
309
set->setValue("vo", vo);
310
set->setValue("ao", ao);
313
set->setValue("color_key", QString::number(color_key,16));
316
set->setValue("fast_audio_change", fast_audio_change);
317
#if !SMART_DVD_CHAPTERS
318
set->setValue("fast_chapter_change", fast_chapter_change);
321
set->setValue("dvd_device", dvd_device);
322
set->setValue("cdrom_device", cdrom_device);
324
set->setValue("cache_for_files", cache_for_files);
325
set->setValue("cache_for_streams", cache_for_streams);
326
set->setValue("cache_for_dvds", cache_for_dvds);
327
set->setValue("cache_for_vcds", cache_for_vcds);
328
set->setValue("cache_for_audiocds", cache_for_audiocds);
331
set->setValue("use_mplayer_window", use_mplayer_window);
333
set->setValue("monitor_aspect", monitor_aspect);
335
set->setValue("latest_dir", latest_dir);
336
set->setValue("last_url", last_url);
337
set->setValue("last_dvd_directory", last_dvd_directory);
339
set->setValue("mplayer_verbose", mplayer_verbose);
340
set->setValue("resize_method", resize_method);
341
set->setValue("disable_screensaver", disable_screensaver);
343
set->setValue("use_direct_rendering", use_direct_rendering);
344
set->setValue("use_double_buffer", use_double_buffer);
346
set->setValue("screenshot_directory", screenshot_directory);
347
set->setValue("subtitles_on_screenshots", subtitles_on_screenshots);
349
set->setValue("use_soft_video_eq", use_soft_video_eq);
350
set->setValue("use_soft_vol", use_soft_vol);
351
set->setValue("softvol_max", softvol_max);
352
set->setValue("use_scaletempo", use_scaletempo);
354
set->setValue("audio_lang", audio_lang);
355
set->setValue("subtitle_lang", subtitle_lang);
357
set->setValue("use_idx", use_idx);
359
set->setValue("dont_change_volume", dont_change_volume );
361
set->setValue("use_hwac3", use_hwac3 );
363
set->setValue("vcd_initial_title", vcd_initial_title);
366
set->setValue("mplayer_additional_options", mplayer_additional_options);
367
set->setValue("mplayer_additional_video_filters", mplayer_additional_video_filters);
368
set->setValue("mplayer_additional_audio_filters", mplayer_additional_audio_filters);
370
set->setValue("priority", priority);
371
set->setValue("frame_drop", frame_drop);
372
set->setValue("hard_frame_drop", hard_frame_drop);
373
set->setValue("autosync", autosync);
374
set->setValue("autosync_factor", autosync_factor);
376
set->setValue("h264_skip_loop_filter", h264_skip_loop_filter);
377
set->setValue("HD_height", HD_height);
379
set->setValue("dont_remember_media_settings", dont_remember_media_settings);
380
set->setValue("dont_remember_time_pos", dont_remember_time_pos);
383
set->setValue("style", style);
386
set->setValue("fullscreen", fullscreen);
387
set->setValue("start_in_fullscreen", start_in_fullscreen);
389
set->setValue("compact_mode", compact_mode);
390
set->setValue("stay_on_top", stay_on_top);
391
set->setValue("size_factor", size_factor);
393
set->setValue("show_frame_counter", show_frame_counter);
394
set->setValue("show_motion_vectors", show_motion_vectors);
396
set->setValue("autoq", autoq);
398
set->setValue("loop", loop);
400
set->setValue("use_single_instance", use_single_instance);
401
set->setValue("connection_port", connection_port);
403
set->setValue("mouse_left_click_function", mouse_left_click_function);
404
set->setValue("mouse_right_click_function", mouse_right_click_function);
405
set->setValue("mouse_double_click_function", mouse_double_click_function);
406
set->setValue("mouse_middle_click_function", mouse_middle_click_function);
407
set->setValue("mouse_xbutton1_click_function", mouse_xbutton1_click_function);
408
set->setValue("mouse_xbutton2_click_function", mouse_xbutton2_click_function);
409
set->setValue("wheel_function", wheel_function);
411
set->setValue("recents_max_items", recents_max_items);
413
set->setValue("seeking1", seeking1);
414
set->setValue("seeking2", seeking2);
415
set->setValue("seeking3", seeking3);
416
set->setValue("seeking4", seeking4);
418
set->setValue("update_while_seeking", update_while_seeking);
419
#if ENABLE_DELAYED_DRAGGING
420
set->setValue("time_slider_drag_delay", time_slider_drag_delay);
423
set->setValue("log_mplayer", log_mplayer);
424
set->setValue("log_smplayer", log_smplayer);
425
set->setValue("log_filter", log_filter);
427
set->setValue("language", language);
428
set->setValue("iconset", iconset);
430
set->setValue("always_clear_video_background", always_clear_video_background);
432
set->setValue("rx_endoffile", rx_endoffile);
433
set->setValue("rx_novideo", rx_novideo);
435
set->setValue("balloon_count", balloon_count);
437
set->setValue("dont_use_eq_options", dont_use_eq_options);
439
set->setValue("restore_pos_after_fullscreen", restore_pos_after_fullscreen);
440
set->setValue("save_window_size_on_exit", save_window_size_on_exit);
443
//set->setValue("enable_vcd_on_windows", enable_vcd_on_windows);
444
set->setValue("enable_audiocd_on_windows", enable_audiocd_on_windows);
447
set->setValue("close_on_finish", close_on_finish);
449
set->setValue("default_font", default_font);
451
set->setValue("pause_when_hidden", pause_when_hidden);
453
set->setValue("allow_video_movement", allow_video_movement);
455
set->setValue("use_edl_files", use_edl_files);
457
set->setValue("gui", gui);
459
//mplayer log autosaving
460
set->setValue("autosave_mplayer_log", autosave_mplayer_log);
461
set->setValue("mplayer_log_saveto", mplayer_log_saveto);
462
//mplayer log autosaving end
464
set->setValue("auto_add_to_playlist", auto_add_to_playlist);
465
set->setValue("use_volume_option2", use_volume_option2);
467
set->setValue("use_short_pathnames", use_short_pathnames);
472
set->beginGroup( "defaults");
474
set->setValue("initial_sub_scale", initial_sub_scale);
476
set->setValue("initial_sub_scale_ass", initial_sub_scale_ass);
478
set->setValue("initial_volume", initial_volume);
479
set->setValue("initial_contrast", initial_contrast);
480
set->setValue("initial_brightness", initial_brightness);
481
set->setValue("initial_hue", initial_hue);
482
set->setValue("initial_saturation", initial_saturation);
483
set->setValue("initial_gamma", initial_gamma);
485
set->setValue("initial_panscan_factor", initial_panscan_factor);
486
set->setValue("initial_sub_pos", initial_sub_pos);
488
set->setValue("initial_volnorm", initial_volnorm);
489
set->setValue("initial_postprocessing", initial_postprocessing);
491
set->setValue("initial_deinterlace", initial_deinterlace);
493
set->setValue("initial_audio_channels", initial_audio_channels);
495
set->setValue("initial_audio_track", initial_audio_track);
496
set->setValue("initial_subtitle_track", initial_subtitle_track);
500
set->beginGroup( "mplayer_info");
501
set->setValue("mplayer_detected_version", mplayer_detected_version);
502
set->setValue("mplayer_user_supplied_version", mplayer_user_supplied_version);
503
set->setValue("mplayer_has_volume_option", mplayer_has_volume_option);
507
void Preferences::load() {
508
qDebug("Preferences::load");
510
QSettings * set = settings;
512
set->beginGroup( "preferences");
514
mplayer_bin = set->value("mplayer_bin", mplayer_bin).toString();
516
use_fontconfig = set->value("use_fontconfig", use_fontconfig).toBool();
517
font_file = set->value("font_file", font_file).toString();
518
font_name = set->value("font_name", font_name).toString();
519
font_autoscale = set->value("font_autoscale", font_autoscale).toInt();
520
subcp = set->value("subcp", subcp).toString();
521
subfuzziness = set->value("subfuzziness", subfuzziness).toInt();
522
use_ass_subtitles = set->value("use_ass_subtitles", use_ass_subtitles).toBool();
523
autoload_sub = set->value("autoload_sub", autoload_sub).toBool();
524
ass_color = set->value("ass_color", ass_color).toInt();
525
ass_border_color = set->value("ass_border_color", ass_border_color).toInt();
526
ass_styles = set->value("ass_styles", ass_styles).toString();
527
change_sub_scale_should_restart = (OptionState) set->value("change_sub_scale_should_restart", change_sub_scale_should_restart).toInt();
528
use_new_sub_commands = (OptionState) set->value("use_new_sub_commands", use_new_sub_commands).toInt();
529
use_closed_caption_subs = set->value("use_closed_caption_subs", use_closed_caption_subs).toBool();
530
use_forced_subs_only = set->value("use_forced_subs_only", use_forced_subs_only).toBool();
532
osd = set->value("osd", osd).toInt();
533
vo = set->value("vo", vo).toString();
534
ao = set->value("ao", ao).toString();
538
QString color = set->value("color_key", QString::number(color_key,16)).toString();
539
unsigned int temp_color_key = color.toUInt(&ok, 16);
541
color_key = temp_color_key;
542
//color_key = set->value("color_key", color_key).toInt();
545
fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt();
546
#if !SMART_DVD_CHAPTERS
547
fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool();
550
dvd_device = set->value("dvd_device", dvd_device).toString();
551
cdrom_device = set->value("cdrom_device", cdrom_device).toString();
553
cache_for_files = set->value("cache_for_files", cache_for_files).toInt();
554
cache_for_streams = set->value("cache_for_streams", cache_for_streams).toInt();
555
cache_for_dvds = set->value("cache_for_dvds", cache_for_dvds).toInt();
556
cache_for_vcds = set->value("cache_for_vcds", cache_for_vcds).toInt();
557
cache_for_audiocds = set->value("cache_for_audiocds", cache_for_audiocds).toInt();
559
use_mplayer_window = set->value("use_mplayer_window", use_mplayer_window).toBool();
561
monitor_aspect = set->value("monitor_aspect", monitor_aspect).toString();
563
latest_dir = set->value("latest_dir", latest_dir).toString();
564
last_url = set->value("last_url", last_url).toString();
565
last_dvd_directory = set->value("last_dvd_directory", last_dvd_directory).toString();
567
mplayer_verbose = set->value("mplayer_verbose", mplayer_verbose).toString();
568
resize_method = set->value("resize_method", resize_method).toInt();
569
disable_screensaver = set->value("disable_screensaver", disable_screensaver).toBool();
571
use_direct_rendering = set->value("use_direct_rendering", use_direct_rendering).toBool();
572
use_double_buffer = set->value("use_double_buffer", use_double_buffer).toBool();
574
screenshot_directory = set->value("screenshot_directory", screenshot_directory).toString();
575
subtitles_on_screenshots = set->value("subtitles_on_screenshots", subtitles_on_screenshots).toBool();
577
use_soft_video_eq = set->value("use_soft_video_eq", use_soft_video_eq).toBool();
578
use_soft_vol = set->value("use_soft_vol", use_soft_vol).toBool();
579
softvol_max = set->value("softvol_max", softvol_max).toInt();
580
use_scaletempo = (OptionState) set->value("use_scaletempo", use_scaletempo).toInt();
582
audio_lang = set->value("audio_lang", audio_lang).toString();
583
subtitle_lang = set->value("subtitle_lang", subtitle_lang).toString();
585
use_idx = set->value("use_idx", use_idx).toBool();
587
dont_change_volume = set->value("dont_change_volume", dont_change_volume ).toBool();
589
use_hwac3 = set->value("use_hwac3", use_hwac3 ).toBool();
591
vcd_initial_title = set->value("vcd_initial_title", vcd_initial_title ).toInt();
594
mplayer_additional_options = set->value("mplayer_additional_options", mplayer_additional_options).toString();
595
mplayer_additional_video_filters = set->value("mplayer_additional_video_filters", mplayer_additional_video_filters).toString();
596
mplayer_additional_audio_filters = set->value("mplayer_additional_audio_filters", mplayer_additional_audio_filters).toString();
598
priority = set->value("priority", priority).toInt();
599
frame_drop = set->value("frame_drop", frame_drop).toBool();
600
hard_frame_drop = set->value("hard_frame_drop", hard_frame_drop).toBool();
601
autosync = set->value("autosync", autosync).toBool();
602
autosync_factor = set->value("autosync_factor", autosync_factor).toInt();
604
h264_skip_loop_filter = (H264LoopFilter) set->value("h264_skip_loop_filter", h264_skip_loop_filter).toInt();
605
HD_height = set->value("HD_height", HD_height).toInt();
607
dont_remember_media_settings = set->value("dont_remember_media_settings", dont_remember_media_settings).toBool();
608
dont_remember_time_pos = set->value("dont_remember_time_pos", dont_remember_time_pos).toBool();
611
style = set->value("style", style).toString();
614
fullscreen = set->value("fullscreen", fullscreen).toBool();
615
start_in_fullscreen = set->value("start_in_fullscreen", start_in_fullscreen).toBool();
617
compact_mode = set->value("compact_mode", compact_mode).toBool();
618
stay_on_top = set->value("stay_on_top", stay_on_top).toBool();
619
size_factor = set->value("size_factor", size_factor).toInt();
621
show_frame_counter = set->value("show_frame_counter", show_frame_counter).toBool();
622
show_motion_vectors = set->value("show_motion_vectors", show_motion_vectors).toBool();
624
autoq = set->value("autoq", autoq).toInt();
626
loop = set->value("loop", loop).toBool();
628
use_single_instance = set->value("use_single_instance", use_single_instance).toBool();
629
connection_port = set->value("connection_port", connection_port).toInt();
631
mouse_left_click_function = set->value("mouse_left_click_function", mouse_left_click_function).toString();
632
mouse_right_click_function = set->value("mouse_right_click_function", mouse_right_click_function).toString();
633
mouse_double_click_function = set->value("mouse_double_click_function", mouse_double_click_function).toString();
634
mouse_middle_click_function = set->value("mouse_middle_click_function", mouse_middle_click_function).toString();
635
mouse_xbutton1_click_function = set->value("mouse_xbutton1_click_function", mouse_xbutton1_click_function).toString();
636
mouse_xbutton2_click_function = set->value("mouse_xbutton2_click_function", mouse_xbutton2_click_function).toString();
637
wheel_function = set->value("wheel_function", wheel_function).toInt();
639
recents_max_items = set->value("recents_max_items", recents_max_items).toInt();
641
seeking1 = set->value("seeking1", seeking1).toInt();
642
seeking2 = set->value("seeking2", seeking2).toInt();
643
seeking3 = set->value("seeking3", seeking3).toInt();
644
seeking4 = set->value("seeking4", seeking4).toInt();
646
update_while_seeking = set->value("update_while_seeking", update_while_seeking).toBool();
647
#if ENABLE_DELAYED_DRAGGING
648
time_slider_drag_delay = set->value("time_slider_drag_delay", time_slider_drag_delay).toInt();
651
language = set->value("language", language).toString();
652
iconset= set->value("iconset", iconset).toString();
654
log_mplayer = set->value("log_mplayer", log_mplayer).toBool();
655
log_smplayer = set->value("log_smplayer", log_smplayer).toBool();
656
log_filter = set->value("log_filter", log_filter).toString();
658
always_clear_video_background = set->value("always_clear_video_background", always_clear_video_background).toBool();
660
rx_endoffile = set->value("rx_endoffile", rx_endoffile).toString();
661
rx_novideo = set->value("rx_novideo", rx_novideo).toString();
663
balloon_count = set->value("balloon_count", balloon_count).toInt();
665
dont_use_eq_options = set->value("dont_use_eq_options", dont_use_eq_options).toBool();
667
restore_pos_after_fullscreen = set->value("restore_pos_after_fullscreen", restore_pos_after_fullscreen).toBool();
668
save_window_size_on_exit = set->value("save_window_size_on_exit", save_window_size_on_exit).toBool();
671
//enable_vcd_on_windows = set->value("enable_vcd_on_windows", enable_vcd_on_windows).toBool();
672
enable_audiocd_on_windows = set->value("enable_audiocd_on_windows", enable_audiocd_on_windows).toBool();
675
close_on_finish = set->value("close_on_finish", close_on_finish).toBool();
677
default_font = set->value("default_font", default_font).toString();
679
pause_when_hidden = set->value("pause_when_hidden", pause_when_hidden).toBool();
681
allow_video_movement = set->value("allow_video_movement", allow_video_movement).toBool();
683
use_edl_files = set->value("use_edl_files", use_edl_files).toBool();
685
gui = set->value("gui", gui).toString();
687
//mplayer log autosaving
688
autosave_mplayer_log = set->value("autosave_mplayer_log", autosave_mplayer_log).toBool();
689
mplayer_log_saveto = set->value("mplayer_log_saveto", mplayer_log_saveto).toString();
690
//mplayer log autosaving end
692
auto_add_to_playlist = set->value("auto_add_to_playlist", auto_add_to_playlist).toBool();
693
use_volume_option2 = (OptionState) set->value("use_volume_option2", use_volume_option2).toInt();
695
use_short_pathnames = set->value("use_short_pathnames", use_short_pathnames).toBool();
700
set->beginGroup( "defaults");
702
initial_sub_scale = set->value("initial_sub_scale", initial_sub_scale).toDouble();
704
initial_sub_scale_ass = set->value("initial_sub_scale_ass", initial_sub_scale_ass).toDouble();
706
initial_volume = set->value("initial_volume", initial_volume).toInt();
707
initial_contrast = set->value("initial_contrast", initial_contrast).toInt();
708
initial_brightness = set->value("initial_brightness", initial_brightness).toInt();
709
initial_hue = set->value("initial_hue", initial_hue).toInt();
710
initial_saturation = set->value("initial_saturation", initial_saturation).toInt();
711
initial_gamma = set->value("initial_gamma", initial_gamma).toInt();
713
initial_panscan_factor = set->value("initial_panscan_factor", initial_panscan_factor).toDouble();
714
initial_sub_pos = set->value("initial_sub_pos", initial_sub_pos).toInt();
716
initial_volnorm = set->value("initial_volnorm", initial_volnorm).toBool();
717
initial_postprocessing = set->value("initial_postprocessing", initial_postprocessing).toBool();
719
initial_deinterlace = set->value("initial_deinterlace", initial_deinterlace).toInt();
721
initial_audio_channels = set->value("initial_audio_channels", initial_audio_channels).toInt();
723
initial_audio_track = set->value("initial_audio_track", initial_audio_track).toInt();
724
initial_subtitle_track = set->value("initial_subtitle_track", initial_subtitle_track).toInt();
728
set->beginGroup( "mplayer_info");
729
mplayer_detected_version = set->value("mplayer_detected_version", mplayer_detected_version).toInt();
730
mplayer_user_supplied_version = set->value("mplayer_user_supplied_version", mplayer_user_supplied_version).toInt();
731
mplayer_has_volume_option = set->value("mplayer_has_volume_option", mplayer_has_volume_option).toBool();
735
QFileInfo fi(mplayer_bin);
737
mplayer_bin = fi.absFilePath();
738
qDebug("mplayer_bin: '%s'", mplayer_bin.toUtf8().data());
743
#endif // NO_USE_INI_FILES
745
double Preferences::monitor_aspect_double() {
746
qDebug("Preferences::monitor_aspect_double");
748
QRegExp exp("(\\d+)[:/](\\d+)");
749
if (exp.indexIn( monitor_aspect ) != -1) {
750
int w = exp.cap(1).toInt();
751
int h = exp.cap(2).toInt();
752
qDebug(" monitor_aspect parsed successfully: %d:%d", w, h);
757
double res = monitor_aspect.toDouble(&ok);
759
qDebug(" monitor_aspect parsed successfully: %f", res);
762
qDebug(" warning: monitor_aspect couldn't be parsed!");
763
qDebug(" monitor_aspect set to 0");