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"
24
#include "urlhistory.h"
31
#include <QNetworkProxy>
33
using namespace Global;
35
Preferences::Preferences() {
36
history_recents = new Recents;
37
history_urls = new URLHistory;
41
#ifndef NO_USE_INI_FILES
46
Preferences::~Preferences() {
47
#ifndef NO_USE_INI_FILES
51
delete history_recents;
55
void Preferences::reset() {
61
mplayer_bin= "mplayer/mplayer.exe";
63
mplayer_bin = "mplayer";
69
// On Windows Vista set vo to gl:yuv=2:force-pbo:ati-hack as default
71
if (QSysInfo::WindowsVersion == QSysInfo::WV_VISTA) {
72
vo = "gl:yuv=2:force-pbo:ati-hack,";
76
screenshot_directory="";
78
if (QFile::exists(Paths::configPath() + "/screenshots")) {
79
screenshot_directory = Paths::configPath() + "/screenshots";
83
dont_remember_media_settings = false;
84
dont_remember_time_pos = false;
89
use_direct_rendering = false;
90
use_double_buffer = true;
91
disable_screensaver = true;
92
use_soft_video_eq = false;
95
add_blackborders_on_fullscreen = false;
98
softvol_max = 110; // 110 = default value in mplayer
99
use_scaletempo = Detect;
100
dont_change_volume = false;
102
use_audio_equalizer = true;
103
use_volume_option = Detect;
108
file_settings_method = "normal"; // Possible values: normal & hash
119
// Try to set default values
120
if (QFile::exists("/dev/dvd")) dvd_device = "/dev/dvd";
121
if (QFile::exists("/dev/cdrom")) cdrom_device = "/dev/cdrom";
125
enable_audiocd_on_windows = false;
128
vcd_initial_title = 2; // Most VCD's start at title #2
135
priority = AboveNormal; // Option only for windows
137
hard_frame_drop = false;
139
autosync_factor = 100;
141
h264_skip_loop_filter = LoopEnabled;
144
// MPlayer 1.0rc1 require restart, new versions don't
145
fast_audio_change = Detect;
146
#if !SMART_DVD_CHAPTERS
147
fast_chapter_change = false;
152
cache_for_files = 2000;
153
cache_for_streams = 1000;
154
cache_for_dvds = 0; // not recommended to use cache for dvds
155
cache_for_vcds = 1000;
156
cache_for_audiocds = 1000;
165
use_fontconfig = false;
166
subcp = "ISO-8859-1";
168
enca_lang = QString(QLocale::system().name()).section("_",0,0);
174
use_ass_subtitles = false;
176
use_ass_subtitles = true;
179
ass_line_spacing = 0;
181
use_closed_caption_subs = false;
182
use_forced_subs_only = false;
184
subtitles_on_screenshots = false;
186
use_new_sub_commands = Detect;
187
change_sub_scale_should_restart = Detect;
190
// Nothing to do, default values are given in
191
// AssStyles constructor
193
freetype_support = true;
205
color_key = 0x020202;
208
use_mplayer_window = false;
210
monitor_aspect=""; // Autodetect
214
mplayer_additional_options="";
215
mplayer_additional_video_filters="";
216
mplayer_additional_audio_filters="";
222
//mplayer log autosaving
223
autosave_mplayer_log = false;
224
mplayer_log_saveto = "";
225
//mplayer log autosaving end
227
#if REPAINT_BACKGROUND_OPTION
228
// "Repaint video background" in the preferences dialog
230
repaint_video_background = false;
232
repaint_video_background = true;
236
use_edl_files = true;
240
use_short_pathnames = false;
242
change_video_equalizer_on_startup = true;
244
use_pausing_keep_force = true;
246
use_correct_pts = false;
256
start_in_fullscreen = false;
257
compact_mode = false;
258
stay_on_top = NeverOnTop;
259
size_factor = 100; // 100%
261
resize_method = Always;
267
show_frame_counter = FALSE;
268
show_motion_vectors = false;
270
mouse_left_click_function = "";
271
mouse_right_click_function = "show_context_menu";
272
mouse_double_click_function = "fullscreen";
273
mouse_middle_click_function = "mute";
274
mouse_xbutton1_click_function = "";
275
mouse_xbutton2_click_function = "";
276
wheel_function = Seeking;
283
update_while_seeking = false;
284
#if ENABLE_DELAYED_DRAGGING
285
time_slider_drag_delay = 100;
294
restore_pos_after_fullscreen = true;
296
restore_pos_after_fullscreen = false;
299
save_window_size_on_exit = true;
301
close_on_finish = false;
305
pause_when_hidden = false;
307
allow_video_movement = false;
312
gui_minimum_width = 0; // 0 == disabled
314
default_size = QSize(580, 440);
316
#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
317
hide_video_window_on_audio_files = true;
320
report_mplayer_crashes = true;
322
#if REPORT_OLD_MPLAYER
323
reported_mplayer_is_old = false;
326
auto_add_to_playlist = true;
327
add_to_playlist_consecutive_files = false;
334
latest_dir = QDir::homePath();
335
last_dvd_directory="";
342
initial_sub_scale = 5;
343
initial_sub_scale_ass = 1;
345
initial_contrast = 0;
346
initial_brightness = 0;
348
initial_saturation = 0;
351
initial_audio_equalizer << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0;
353
initial_panscan_factor = 1.0;
354
initial_sub_pos = 100; // 100%
356
initial_postprocessing = false;
357
initial_volnorm = false;
359
initial_deinterlace = MediaSettings::NoDeinterlace;
361
initial_audio_channels = MediaSettings::ChDefault;
362
initial_stereo_mode = MediaSettings::Stereo;
364
initial_audio_track = 1;
365
initial_subtitle_track = 1;
372
mplayer_detected_version = -1; //None version parsed yet
373
mplayer_user_supplied_version = -1;
381
// Some people reported smplayer doesn't start with this option enabled
382
// So now it's disabled by default on Windows
383
use_single_instance = false;
385
use_single_instance = true;
388
connection_port = 8000;
396
floating_control_margin = 0;
397
floating_control_width = 100; //100 %
398
floating_control_animated = true;
399
floating_display_in_compact_mode = false;
401
bypass_window_manager = true;
410
proxy_type = QNetworkProxy::HttpProxy;
421
history_recents->clear();
422
history_urls->clear();
425
#ifndef NO_USE_INI_FILES
426
void Preferences::save() {
427
qDebug("Preferences::save");
429
QSettings * set = settings;
436
set->beginGroup( "general");
438
set->setValue("mplayer_bin", mplayer_bin);
439
set->setValue("driver/vo", vo);
440
set->setValue("driver/ao", ao);
442
set->setValue("screenshot_directory", screenshot_directory);
444
set->setValue("dont_remember_media_settings", dont_remember_media_settings);
445
set->setValue("dont_remember_time_pos", dont_remember_time_pos);
447
set->setValue("audio_lang", audio_lang);
448
set->setValue("subtitle_lang", subtitle_lang);
450
set->setValue("use_direct_rendering", use_direct_rendering);
451
set->setValue("use_double_buffer", use_double_buffer);
452
set->setValue("disable_screensaver", disable_screensaver);
453
set->setValue("use_soft_video_eq", use_soft_video_eq);
454
set->setValue("use_slices", use_slices );
455
set->setValue("autoq", autoq);
456
set->setValue("add_blackborders_on_fullscreen", add_blackborders_on_fullscreen);
458
set->setValue("use_soft_vol", use_soft_vol);
459
set->setValue("softvol_max", softvol_max);
460
set->setValue("use_scaletempo", use_scaletempo);
461
set->setValue("dont_change_volume", dont_change_volume );
462
set->setValue("use_hwac3", use_hwac3 );
463
set->setValue("use_audio_equalizer", use_audio_equalizer );
464
set->setValue("use_volume_option", use_volume_option);
466
set->setValue("loop", loop);
467
set->setValue("osd", osd);
469
set->setValue("file_settings_method", file_settings_method);
471
set->endGroup(); // general
478
set->beginGroup( "drives");
480
set->setValue("dvd_device", dvd_device);
481
set->setValue("cdrom_device", cdrom_device);
484
set->setValue("enable_audiocd_on_windows", enable_audiocd_on_windows);
487
set->setValue("vcd_initial_title", vcd_initial_title);
489
set->endGroup(); // drives
496
set->beginGroup( "performance");
498
set->setValue("priority", priority);
499
set->setValue("frame_drop", frame_drop);
500
set->setValue("hard_frame_drop", hard_frame_drop);
501
set->setValue("autosync", autosync);
502
set->setValue("autosync_factor", autosync_factor);
504
set->setValue("h264_skip_loop_filter", h264_skip_loop_filter);
505
set->setValue("HD_height", HD_height);
507
set->setValue("fast_audio_change", fast_audio_change);
508
#if !SMART_DVD_CHAPTERS
509
set->setValue("fast_chapter_change", fast_chapter_change);
512
set->setValue("threads", threads);
514
set->setValue("cache_for_files", cache_for_files);
515
set->setValue("cache_for_streams", cache_for_streams);
516
set->setValue("cache_for_dvds", cache_for_dvds);
517
set->setValue("cache_for_vcds", cache_for_vcds);
518
set->setValue("cache_for_audiocds", cache_for_audiocds);
520
set->endGroup(); // performance
527
set->beginGroup("subtitles");
529
set->setValue("font_file", font_file);
530
set->setValue("font_name", font_name);
532
set->setValue("use_fontconfig", use_fontconfig);
533
set->setValue("subcp", subcp);
534
set->setValue("use_enca", use_enca);
535
set->setValue("enca_lang", enca_lang);
536
set->setValue("font_autoscale", font_autoscale);
537
set->setValue("subfuzziness", subfuzziness);
538
set->setValue("autoload_sub", autoload_sub);
540
set->setValue("use_ass_subtitles", use_ass_subtitles);
541
set->setValue("ass_line_spacing", ass_line_spacing);
542
set->setValue("use_closed_caption_subs", use_closed_caption_subs);
543
set->setValue("use_forced_subs_only", use_forced_subs_only);
545
set->setValue("subtitles_on_screenshots", subtitles_on_screenshots);
547
set->setValue("use_new_sub_commands", use_new_sub_commands);
548
set->setValue("change_sub_scale_should_restart", change_sub_scale_should_restart);
551
ass_styles.save(set);
553
set->setValue("freetype_support", freetype_support);
555
set->endGroup(); // subtitles
562
set->beginGroup( "advanced");
565
set->setValue("adapter", adapter);
569
set->setValue("color_key", QString::number(color_key,16));
572
set->setValue("use_mplayer_window", use_mplayer_window);
574
set->setValue("monitor_aspect", monitor_aspect);
576
set->setValue("use_idx", use_idx);
578
set->setValue("mplayer_additional_options", mplayer_additional_options);
579
set->setValue("mplayer_additional_video_filters", mplayer_additional_video_filters);
580
set->setValue("mplayer_additional_audio_filters", mplayer_additional_audio_filters);
582
set->setValue("log_mplayer", log_mplayer);
583
set->setValue("log_smplayer", log_smplayer);
584
set->setValue("log_filter", log_filter);
586
//mplayer log autosaving
587
set->setValue("autosave_mplayer_log", autosave_mplayer_log);
588
set->setValue("mplayer_log_saveto", mplayer_log_saveto);
589
//mplayer log autosaving end
591
#if REPAINT_BACKGROUND_OPTION
592
set->setValue("repaint_video_background", repaint_video_background);
595
set->setValue("use_edl_files", use_edl_files);
597
set->setValue("prefer_ipv4", prefer_ipv4);
599
set->setValue("use_short_pathnames", use_short_pathnames);
601
set->setValue("change_video_equalizer_on_startup", change_video_equalizer_on_startup);
603
set->setValue("use_pausing_keep_force", use_pausing_keep_force);
605
set->setValue("use_correct_pts", use_correct_pts);
607
set->setValue("actions_to_run", actions_to_run);
609
set->endGroup(); // advanced
616
set->beginGroup("gui");
618
set->setValue("fullscreen", fullscreen);
619
set->setValue("start_in_fullscreen", start_in_fullscreen);
621
set->setValue("compact_mode", compact_mode);
622
set->setValue("stay_on_top", (int) stay_on_top);
623
set->setValue("size_factor", size_factor);
624
set->setValue("resize_method", resize_method);
627
set->setValue("style", style);
630
set->setValue("show_frame_counter", show_frame_counter);
631
set->setValue("show_motion_vectors", show_motion_vectors);
633
set->setValue("mouse_left_click_function", mouse_left_click_function);
634
set->setValue("mouse_right_click_function", mouse_right_click_function);
635
set->setValue("mouse_double_click_function", mouse_double_click_function);
636
set->setValue("mouse_middle_click_function", mouse_middle_click_function);
637
set->setValue("mouse_xbutton1_click_function", mouse_xbutton1_click_function);
638
set->setValue("mouse_xbutton2_click_function", mouse_xbutton2_click_function);
639
set->setValue("wheel_function", wheel_function);
641
set->setValue("seeking1", seeking1);
642
set->setValue("seeking2", seeking2);
643
set->setValue("seeking3", seeking3);
644
set->setValue("seeking4", seeking4);
646
set->setValue("update_while_seeking", update_while_seeking);
647
#if ENABLE_DELAYED_DRAGGING
648
set->setValue("time_slider_drag_delay", time_slider_drag_delay);
651
set->setValue("language", language);
652
set->setValue("iconset", iconset);
654
set->setValue("balloon_count", balloon_count);
656
set->setValue("restore_pos_after_fullscreen", restore_pos_after_fullscreen);
657
set->setValue("save_window_size_on_exit", save_window_size_on_exit);
659
set->setValue("close_on_finish", close_on_finish);
661
set->setValue("default_font", default_font);
663
set->setValue("pause_when_hidden", pause_when_hidden);
665
set->setValue("allow_video_movement", allow_video_movement);
667
set->setValue("gui", gui);
670
set->setValue("gui_minimum_width", gui_minimum_width);
672
set->setValue("default_size", default_size);
674
#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
675
set->setValue("hide_video_window_on_audio_files", hide_video_window_on_audio_files);
678
set->setValue("report_mplayer_crashes", report_mplayer_crashes);
680
#if REPORT_OLD_MPLAYER
681
set->setValue("reported_mplayer_is_old", reported_mplayer_is_old);
684
set->setValue("auto_add_to_playlist", auto_add_to_playlist);
685
set->setValue("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files);
687
set->endGroup(); // gui
694
set->beginGroup( "directories");
695
set->setValue("latest_dir", latest_dir);
696
set->setValue("last_dvd_directory", last_dvd_directory);
697
set->endGroup(); // directories
704
set->beginGroup( "defaults");
706
set->setValue("initial_sub_scale", initial_sub_scale);
707
set->setValue("initial_sub_scale_ass", initial_sub_scale_ass);
708
set->setValue("initial_volume", initial_volume);
709
set->setValue("initial_contrast", initial_contrast);
710
set->setValue("initial_brightness", initial_brightness);
711
set->setValue("initial_hue", initial_hue);
712
set->setValue("initial_saturation", initial_saturation);
713
set->setValue("initial_gamma", initial_gamma);
715
set->setValue("initial_audio_equalizer", initial_audio_equalizer);
717
set->setValue("initial_panscan_factor", initial_panscan_factor);
718
set->setValue("initial_sub_pos", initial_sub_pos);
720
set->setValue("initial_volnorm", initial_volnorm);
721
set->setValue("initial_postprocessing", initial_postprocessing);
723
set->setValue("initial_deinterlace", initial_deinterlace);
725
set->setValue("initial_audio_channels", initial_audio_channels);
726
set->setValue("initial_stereo_mode", initial_stereo_mode);
728
set->setValue("initial_audio_track", initial_audio_track);
729
set->setValue("initial_subtitle_track", initial_subtitle_track);
731
set->endGroup(); // defaults
738
set->beginGroup( "mplayer_info");
739
set->setValue("mplayer_detected_version", mplayer_detected_version);
740
set->setValue("mplayer_user_supplied_version", mplayer_user_supplied_version);
741
set->endGroup(); // mplayer_info
748
set->beginGroup("instances");
749
set->setValue("use_single_instance", use_single_instance);
750
set->setValue("connection_port", connection_port);
751
set->setValue("use_autoport", use_autoport);
752
set->setValue("temp/autoport", autoport);
753
set->endGroup(); // instances
760
set->beginGroup("floating_control");
761
set->setValue("margin", floating_control_margin);
762
set->setValue("width", floating_control_width);
763
set->setValue("animated", floating_control_animated);
764
set->setValue("display_in_compact_mode", floating_display_in_compact_mode);
766
set->setValue("bypass_window_manager", bypass_window_manager);
768
set->endGroup(); // floating_control
775
set->beginGroup("proxy");
776
set->setValue("use_proxy", use_proxy);
777
set->setValue("proxy_type", proxy_type);
778
set->setValue("host", proxy_host);
779
set->setValue("port", proxy_port);
780
set->setValue("username", proxy_username);
781
set->setValue("password", proxy_password);
782
set->endGroup(); // proxy
789
set->beginGroup("history");
790
set->setValue("recents", history_recents->toStringList());
791
set->setValue("recents/max_items", history_recents->maxItems());
792
set->setValue("urls", history_urls->toStringList());
793
set->setValue("urls/max_items", history_urls->maxItems());
794
set->endGroup(); // history
799
void Preferences::load() {
800
qDebug("Preferences::load");
802
QSettings * set = settings;
809
set->beginGroup( "general");
811
mplayer_bin = set->value("mplayer_bin", mplayer_bin).toString();
812
vo = set->value("driver/vo", vo).toString();
813
ao = set->value("driver/ao", ao).toString();
815
screenshot_directory = set->value("screenshot_directory", screenshot_directory).toString();
817
dont_remember_media_settings = set->value("dont_remember_media_settings", dont_remember_media_settings).toBool();
818
dont_remember_time_pos = set->value("dont_remember_time_pos", dont_remember_time_pos).toBool();
820
audio_lang = set->value("audio_lang", audio_lang).toString();
821
subtitle_lang = set->value("subtitle_lang", subtitle_lang).toString();
823
use_direct_rendering = set->value("use_direct_rendering", use_direct_rendering).toBool();
824
use_double_buffer = set->value("use_double_buffer", use_double_buffer).toBool();
825
disable_screensaver = set->value("disable_screensaver", disable_screensaver).toBool();
826
use_soft_video_eq = set->value("use_soft_video_eq", use_soft_video_eq).toBool();
827
use_slices = set->value("use_slices", use_slices ).toBool();
828
autoq = set->value("autoq", autoq).toInt();
829
add_blackborders_on_fullscreen = set->value("add_blackborders_on_fullscreen", add_blackborders_on_fullscreen).toBool();
831
use_soft_vol = set->value("use_soft_vol", use_soft_vol).toBool();
832
softvol_max = set->value("softvol_max", softvol_max).toInt();
833
use_scaletempo = (OptionState) set->value("use_scaletempo", use_scaletempo).toInt();
834
dont_change_volume = set->value("dont_change_volume", dont_change_volume ).toBool();
835
use_hwac3 = set->value("use_hwac3", use_hwac3 ).toBool();
836
use_audio_equalizer = set->value("use_audio_equalizer", use_audio_equalizer ).toBool();
837
use_volume_option = (OptionState) set->value("use_volume_option", use_volume_option).toInt();
839
loop = set->value("loop", loop).toBool();
840
osd = set->value("osd", osd).toInt();
842
file_settings_method = set->value("file_settings_method", file_settings_method).toString();
844
set->endGroup(); // general
851
set->beginGroup( "drives");
853
dvd_device = set->value("dvd_device", dvd_device).toString();
854
cdrom_device = set->value("cdrom_device", cdrom_device).toString();
857
enable_audiocd_on_windows = set->value("enable_audiocd_on_windows", enable_audiocd_on_windows).toBool();
860
vcd_initial_title = set->value("vcd_initial_title", vcd_initial_title ).toInt();
862
set->endGroup(); // drives
869
set->beginGroup( "performance");
871
priority = set->value("priority", priority).toInt();
872
frame_drop = set->value("frame_drop", frame_drop).toBool();
873
hard_frame_drop = set->value("hard_frame_drop", hard_frame_drop).toBool();
874
autosync = set->value("autosync", autosync).toBool();
875
autosync_factor = set->value("autosync_factor", autosync_factor).toInt();
877
h264_skip_loop_filter = (H264LoopFilter) set->value("h264_skip_loop_filter", h264_skip_loop_filter).toInt();
878
HD_height = set->value("HD_height", HD_height).toInt();
880
fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt();
881
#if !SMART_DVD_CHAPTERS
882
fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool();
885
threads = set->value("threads", threads).toInt();
887
cache_for_files = set->value("cache_for_files", cache_for_files).toInt();
888
cache_for_streams = set->value("cache_for_streams", cache_for_streams).toInt();
889
cache_for_dvds = set->value("cache_for_dvds", cache_for_dvds).toInt();
890
cache_for_vcds = set->value("cache_for_vcds", cache_for_vcds).toInt();
891
cache_for_audiocds = set->value("cache_for_audiocds", cache_for_audiocds).toInt();
893
set->endGroup(); // performance
900
set->beginGroup("subtitles");
902
font_file = set->value("font_file", font_file).toString();
903
font_name = set->value("font_name", font_name).toString();
905
use_fontconfig = set->value("use_fontconfig", use_fontconfig).toBool();
906
subcp = set->value("subcp", subcp).toString();
907
use_enca = set->value("use_enca", use_enca).toBool();
908
enca_lang = set->value("enca_lang", enca_lang).toString();
909
font_autoscale = set->value("font_autoscale", font_autoscale).toInt();
910
subfuzziness = set->value("subfuzziness", subfuzziness).toInt();
911
autoload_sub = set->value("autoload_sub", autoload_sub).toBool();
913
use_ass_subtitles = set->value("use_ass_subtitles", use_ass_subtitles).toBool();
914
ass_line_spacing = set->value("ass_line_spacing", ass_line_spacing).toInt();
916
use_closed_caption_subs = set->value("use_closed_caption_subs", use_closed_caption_subs).toBool();
917
use_forced_subs_only = set->value("use_forced_subs_only", use_forced_subs_only).toBool();
919
subtitles_on_screenshots = set->value("subtitles_on_screenshots", subtitles_on_screenshots).toBool();
921
use_new_sub_commands = (OptionState) set->value("use_new_sub_commands", use_new_sub_commands).toInt();
922
change_sub_scale_should_restart = (OptionState) set->value("change_sub_scale_should_restart", change_sub_scale_should_restart).toInt();
925
ass_styles.load(set);
927
freetype_support = set->value("freetype_support", freetype_support).toBool();
929
set->endGroup(); // subtitles
936
set->beginGroup( "advanced");
939
adapter = set->value("adapter", adapter).toInt();
944
QString color = set->value("color_key", QString::number(color_key,16)).toString();
945
unsigned int temp_color_key = color.toUInt(&ok, 16);
947
color_key = temp_color_key;
948
//color_key = set->value("color_key", color_key).toInt();
951
use_mplayer_window = set->value("use_mplayer_window", use_mplayer_window).toBool();
953
monitor_aspect = set->value("monitor_aspect", monitor_aspect).toString();
955
use_idx = set->value("use_idx", use_idx).toBool();
957
mplayer_additional_options = set->value("mplayer_additional_options", mplayer_additional_options).toString();
958
mplayer_additional_video_filters = set->value("mplayer_additional_video_filters", mplayer_additional_video_filters).toString();
959
mplayer_additional_audio_filters = set->value("mplayer_additional_audio_filters", mplayer_additional_audio_filters).toString();
961
log_mplayer = set->value("log_mplayer", log_mplayer).toBool();
962
log_smplayer = set->value("log_smplayer", log_smplayer).toBool();
963
log_filter = set->value("log_filter", log_filter).toString();
965
//mplayer log autosaving
966
autosave_mplayer_log = set->value("autosave_mplayer_log", autosave_mplayer_log).toBool();
967
mplayer_log_saveto = set->value("mplayer_log_saveto", mplayer_log_saveto).toString();
968
//mplayer log autosaving end
970
#if REPAINT_BACKGROUND_OPTION
971
repaint_video_background = set->value("repaint_video_background", repaint_video_background).toBool();
974
use_edl_files = set->value("use_edl_files", use_edl_files).toBool();
976
prefer_ipv4 = set->value("prefer_ipv4", prefer_ipv4).toBool();
978
use_short_pathnames = set->value("use_short_pathnames", use_short_pathnames).toBool();
980
use_pausing_keep_force = set->value("use_pausing_keep_force", use_pausing_keep_force).toBool();
982
use_correct_pts = set->value("use_correct_pts", use_correct_pts).toBool();
984
actions_to_run = set->value("actions_to_run", actions_to_run).toString();
986
set->endGroup(); // advanced
993
set->beginGroup("gui");
995
fullscreen = set->value("fullscreen", fullscreen).toBool();
996
start_in_fullscreen = set->value("start_in_fullscreen", start_in_fullscreen).toBool();
998
compact_mode = set->value("compact_mode", compact_mode).toBool();
999
stay_on_top = (Preferences::OnTop) set->value("stay_on_top", (int) stay_on_top).toInt();
1000
size_factor = set->value("size_factor", size_factor).toInt();
1001
resize_method = set->value("resize_method", resize_method).toInt();
1004
style = set->value("style", style).toString();
1007
show_frame_counter = set->value("show_frame_counter", show_frame_counter).toBool();
1008
show_motion_vectors = set->value("show_motion_vectors", show_motion_vectors).toBool();
1010
mouse_left_click_function = set->value("mouse_left_click_function", mouse_left_click_function).toString();
1011
mouse_right_click_function = set->value("mouse_right_click_function", mouse_right_click_function).toString();
1012
mouse_double_click_function = set->value("mouse_double_click_function", mouse_double_click_function).toString();
1013
mouse_middle_click_function = set->value("mouse_middle_click_function", mouse_middle_click_function).toString();
1014
mouse_xbutton1_click_function = set->value("mouse_xbutton1_click_function", mouse_xbutton1_click_function).toString();
1015
mouse_xbutton2_click_function = set->value("mouse_xbutton2_click_function", mouse_xbutton2_click_function).toString();
1016
wheel_function = set->value("wheel_function", wheel_function).toInt();
1018
seeking1 = set->value("seeking1", seeking1).toInt();
1019
seeking2 = set->value("seeking2", seeking2).toInt();
1020
seeking3 = set->value("seeking3", seeking3).toInt();
1021
seeking4 = set->value("seeking4", seeking4).toInt();
1023
update_while_seeking = set->value("update_while_seeking", update_while_seeking).toBool();
1024
#if ENABLE_DELAYED_DRAGGING
1025
time_slider_drag_delay = set->value("time_slider_drag_delay", time_slider_drag_delay).toInt();
1028
language = set->value("language", language).toString();
1029
iconset= set->value("iconset", iconset).toString();
1031
balloon_count = set->value("balloon_count", balloon_count).toInt();
1033
restore_pos_after_fullscreen = set->value("restore_pos_after_fullscreen", restore_pos_after_fullscreen).toBool();
1034
save_window_size_on_exit = set->value("save_window_size_on_exit", save_window_size_on_exit).toBool();
1036
close_on_finish = set->value("close_on_finish", close_on_finish).toBool();
1038
default_font = set->value("default_font", default_font).toString();
1040
pause_when_hidden = set->value("pause_when_hidden", pause_when_hidden).toBool();
1042
allow_video_movement = set->value("allow_video_movement", allow_video_movement).toBool();
1044
gui = set->value("gui", gui).toString();
1047
gui_minimum_width = set->value("gui_minimum_width", gui_minimum_width).toInt();
1049
default_size = set->value("default_size", default_size).toSize();
1051
#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
1052
hide_video_window_on_audio_files = set->value("hide_video_window_on_audio_files", hide_video_window_on_audio_files).toBool();
1055
report_mplayer_crashes = set->value("report_mplayer_crashes", report_mplayer_crashes).toBool();
1057
#if REPORT_OLD_MPLAYER
1058
reported_mplayer_is_old = set->value("reported_mplayer_is_old", reported_mplayer_is_old).toBool();
1061
auto_add_to_playlist = set->value("auto_add_to_playlist", auto_add_to_playlist).toBool();
1062
add_to_playlist_consecutive_files = set->value("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files).toBool();
1064
set->endGroup(); // gui
1071
set->beginGroup( "directories");
1072
latest_dir = set->value("latest_dir", latest_dir).toString();
1073
last_dvd_directory = set->value("last_dvd_directory", last_dvd_directory).toString();
1074
set->endGroup(); // directories
1081
set->beginGroup( "defaults");
1083
initial_sub_scale = set->value("initial_sub_scale", initial_sub_scale).toDouble();
1084
initial_sub_scale_ass = set->value("initial_sub_scale_ass", initial_sub_scale_ass).toDouble();
1085
initial_volume = set->value("initial_volume", initial_volume).toInt();
1086
initial_contrast = set->value("initial_contrast", initial_contrast).toInt();
1087
initial_brightness = set->value("initial_brightness", initial_brightness).toInt();
1088
initial_hue = set->value("initial_hue", initial_hue).toInt();
1089
initial_saturation = set->value("initial_saturation", initial_saturation).toInt();
1090
initial_gamma = set->value("initial_gamma", initial_gamma).toInt();
1092
initial_audio_equalizer = set->value("initial_audio_equalizer", initial_audio_equalizer).toList();
1094
initial_panscan_factor = set->value("initial_panscan_factor", initial_panscan_factor).toDouble();
1095
initial_sub_pos = set->value("initial_sub_pos", initial_sub_pos).toInt();
1097
initial_volnorm = set->value("initial_volnorm", initial_volnorm).toBool();
1098
initial_postprocessing = set->value("initial_postprocessing", initial_postprocessing).toBool();
1100
initial_deinterlace = set->value("initial_deinterlace", initial_deinterlace).toInt();
1102
initial_audio_channels = set->value("initial_audio_channels", initial_audio_channels).toInt();
1103
initial_stereo_mode = set->value("initial_stereo_mode", initial_stereo_mode).toInt();
1105
initial_audio_track = set->value("initial_audio_track", initial_audio_track).toInt();
1106
initial_subtitle_track = set->value("initial_subtitle_track", initial_subtitle_track).toInt();
1108
set->endGroup(); // defaults
1115
set->beginGroup( "mplayer_info");
1116
mplayer_detected_version = set->value("mplayer_detected_version", mplayer_detected_version).toInt();
1117
mplayer_user_supplied_version = set->value("mplayer_user_supplied_version", mplayer_user_supplied_version).toInt();
1118
set->endGroup(); // mplayer_info
1125
set->beginGroup("instances");
1126
use_single_instance = set->value("use_single_instance", use_single_instance).toBool();
1127
connection_port = set->value("connection_port", connection_port).toInt();
1128
use_autoport = set->value("use_autoport", use_autoport).toBool();
1129
autoport = set->value("temp/autoport", autoport).toInt();
1130
set->endGroup(); // instances
1137
set->beginGroup("floating_control");
1138
floating_control_margin = set->value("margin", floating_control_margin).toInt();
1139
floating_control_width = set->value("width", floating_control_width).toInt();
1140
floating_control_animated = set->value("animated", floating_control_animated).toBool();
1141
floating_display_in_compact_mode = set->value("display_in_compact_mode", floating_display_in_compact_mode).toBool();
1143
bypass_window_manager = set->value("bypass_window_manager", bypass_window_manager).toBool();
1145
set->endGroup(); // floating_control
1152
set->beginGroup("proxy");
1153
use_proxy = set->value("use_proxy", use_proxy).toBool();
1154
proxy_type = set->value("proxy_type", proxy_type).toInt();
1155
proxy_host = set->value("host", proxy_host).toString();
1156
proxy_port = set->value("port", proxy_port).toInt();
1157
proxy_username = set->value("username", proxy_username).toString();
1158
proxy_password = set->value("password", proxy_password).toString();
1159
set->endGroup(); // proxy
1166
set->beginGroup("history");
1167
history_recents->fromStringList( set->value("recents", history_recents->toStringList()).toStringList() );
1168
history_recents->setMaxItems( set->value("recents/max_items", history_recents->maxItems()).toInt() );;
1169
history_urls->fromStringList( set->value("urls", history_urls->toStringList()).toStringList() );
1170
history_urls->setMaxItems( set->value("urls/max_items", history_urls->maxItems()).toInt() );;
1171
set->endGroup(); // history
1174
#endif // NO_USE_INI_FILES
1176
double Preferences::monitor_aspect_double() {
1177
qDebug("Preferences::monitor_aspect_double");
1179
QRegExp exp("(\\d+)[:/](\\d+)");
1180
if (exp.indexIn( monitor_aspect ) != -1) {
1181
int w = exp.cap(1).toInt();
1182
int h = exp.cap(2).toInt();
1183
qDebug(" monitor_aspect parsed successfully: %d:%d", w, h);
1184
return (double) w/h;
1188
double res = monitor_aspect.toDouble(&ok);
1190
qDebug(" monitor_aspect parsed successfully: %f", res);
1193
qDebug(" warning: monitor_aspect couldn't be parsed!");
1194
qDebug(" monitor_aspect set to 0");