1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 |
|
---|
20 | #ifndef _PREFERENCES_H_
|
---|
21 | #define _PREFERENCES_H_
|
---|
22 |
|
---|
23 | /* Global settings */
|
---|
24 |
|
---|
25 | #include <QString>
|
---|
26 | #include <QStringList>
|
---|
27 | #include <QSize>
|
---|
28 | #include "config.h"
|
---|
29 | #include "audioequalizerlist.h"
|
---|
30 | #include "assstyles.h"
|
---|
31 |
|
---|
32 | #ifdef UPDATE_CHECKER
|
---|
33 | #include "updatechecker.h"
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | class Recents;
|
---|
37 | class URLHistory;
|
---|
38 | class Filters;
|
---|
39 |
|
---|
40 | class Preferences {
|
---|
41 |
|
---|
42 | public:
|
---|
43 | enum OSD { None = 0, Seek = 1, SeekTimer = 2, SeekTimerTotal = 3 };
|
---|
44 | enum OnTop { NeverOnTop = 0, AlwaysOnTop = 1, WhilePlayingOnTop = 2 };
|
---|
45 | enum Resize { Never = 0, Always = 1, Afterload = 2 };
|
---|
46 | enum Priority { Realtime = 0, High = 1, AboveNormal = 2, Normal = 3,
|
---|
47 | BelowNormal = 4, Idle = 5 };
|
---|
48 | enum WheelFunction { DoNothing = 1, Seeking = 2, Volume = 4, Zoom = 8,
|
---|
49 | ChangeSpeed = 16 };
|
---|
50 | enum OptionState { Detect = -1, Disabled = 0, Enabled = 1 };
|
---|
51 | enum H264LoopFilter { LoopDisabled = 0, LoopEnabled = 1, LoopDisabledOnHD = 2 };
|
---|
52 | enum AutoAddToPlaylistFilter { NoFiles = 0, VideoFiles = 1, AudioFiles = 2, MultimediaFiles = 3, ConsecutiveFiles = 4 };
|
---|
53 |
|
---|
54 | Q_DECLARE_FLAGS(WheelFunctions, WheelFunction);
|
---|
55 |
|
---|
56 | Preferences();
|
---|
57 | virtual ~Preferences();
|
---|
58 |
|
---|
59 | virtual void reset();
|
---|
60 |
|
---|
61 | #ifndef NO_USE_INI_FILES
|
---|
62 | void save();
|
---|
63 | void load();
|
---|
64 | #endif
|
---|
65 |
|
---|
66 | double monitor_aspect_double();
|
---|
67 | void setupScreenshotFolder();
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|
71 | /* *******
|
---|
72 | General
|
---|
73 | ******* */
|
---|
74 |
|
---|
75 | int config_version;
|
---|
76 |
|
---|
77 | QString mplayer_bin;
|
---|
78 | QString vo; // video output
|
---|
79 | QString ao; // audio output
|
---|
80 |
|
---|
81 | bool use_screenshot;
|
---|
82 | QString screenshot_directory;
|
---|
83 |
|
---|
84 | // SMPlayer will remember all media settings for all videos.
|
---|
85 | // This options allow to disable it:
|
---|
86 | bool dont_remember_media_settings; // Will not remember anything
|
---|
87 | bool dont_remember_time_pos; // Will not remember time pos
|
---|
88 |
|
---|
89 | QString audio_lang; // Preferred audio language
|
---|
90 | QString subtitle_lang; // Preferred subtitle language
|
---|
91 |
|
---|
92 | // Video
|
---|
93 | bool use_direct_rendering;
|
---|
94 | bool use_double_buffer;
|
---|
95 | bool use_soft_video_eq;
|
---|
96 | bool use_slices;
|
---|
97 | int autoq; //!< Postprocessing quality
|
---|
98 | bool add_blackborders_on_fullscreen;
|
---|
99 |
|
---|
100 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
---|
101 | #ifdef SCREENSAVER_OFF
|
---|
102 | bool turn_screensaver_off;
|
---|
103 | #endif
|
---|
104 | #ifdef AVOID_SCREENSAVER
|
---|
105 | bool avoid_screensaver;
|
---|
106 | #endif
|
---|
107 | #else
|
---|
108 | bool disable_screensaver;
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | #ifndef Q_OS_WIN
|
---|
112 | struct VDPAU_settings {
|
---|
113 | bool ffh264vdpau;
|
---|
114 | bool ffmpeg12vdpau;
|
---|
115 | bool ffwmv3vdpau;
|
---|
116 | bool ffvc1vdpau;
|
---|
117 | bool ffodivxvdpau;
|
---|
118 | bool disable_video_filters;
|
---|
119 | } vdpau;
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | // Audio
|
---|
123 | bool use_soft_vol;
|
---|
124 | int softvol_max;
|
---|
125 | OptionState use_scaletempo;
|
---|
126 | bool use_hwac3; // -afm hwac3
|
---|
127 | bool use_audio_equalizer;
|
---|
128 |
|
---|
129 | // Global volume options
|
---|
130 | bool global_volume;
|
---|
131 | int volume;
|
---|
132 | bool mute;
|
---|
133 |
|
---|
134 | // Global equalizer
|
---|
135 | bool global_audio_equalizer;
|
---|
136 | AudioEqualizerList audio_equalizer;
|
---|
137 |
|
---|
138 | bool autosync;
|
---|
139 | int autosync_factor;
|
---|
140 |
|
---|
141 | // For the -mc option
|
---|
142 | bool use_mc;
|
---|
143 | double mc_value;
|
---|
144 |
|
---|
145 | // When playing a mp4 file, it will use a m4a file for audio if a there's a file with same name but extension m4a
|
---|
146 | bool autoload_m4a;
|
---|
147 | int min_step; //<! Step to increase of decrease the controls for color, contrast, brightness and so on
|
---|
148 |
|
---|
149 | // Misc
|
---|
150 | int osd;
|
---|
151 | int osd_delay; //<! Delay in ms to show the OSD.
|
---|
152 |
|
---|
153 | QString file_settings_method; //!< Method to be used for saving file settings
|
---|
154 |
|
---|
155 |
|
---|
156 | /* ***************
|
---|
157 | Drives (CD/DVD)
|
---|
158 | *************** */
|
---|
159 |
|
---|
160 | QString dvd_device;
|
---|
161 | QString cdrom_device;
|
---|
162 | #ifdef BLURAY_SUPPORT
|
---|
163 | QString bluray_device;
|
---|
164 | #endif
|
---|
165 |
|
---|
166 | #ifdef Q_OS_WIN
|
---|
167 | bool enable_audiocd_on_windows;
|
---|
168 | #endif
|
---|
169 |
|
---|
170 | int vcd_initial_title;
|
---|
171 |
|
---|
172 | #if DVDNAV_SUPPORT
|
---|
173 | bool use_dvdnav; //!< Opens DVDs using dvdnav: instead of dvd:
|
---|
174 | #endif
|
---|
175 |
|
---|
176 |
|
---|
177 | /* ***********
|
---|
178 | Performance
|
---|
179 | *********** */
|
---|
180 |
|
---|
181 | int priority;
|
---|
182 | bool frame_drop;
|
---|
183 | bool hard_frame_drop;
|
---|
184 | bool coreavc;
|
---|
185 | H264LoopFilter h264_skip_loop_filter;
|
---|
186 | int HD_height; //!< An HD is a video which height is equal or greater than this.
|
---|
187 |
|
---|
188 | OptionState fast_audio_change; // If activated, not restart mplayer
|
---|
189 | #if !SMART_DVD_CHAPTERS
|
---|
190 | bool fast_chapter_change;
|
---|
191 | #endif
|
---|
192 |
|
---|
193 | int threads; //!< number of threads to use for decoding (-lavdopts threads <1-8>)
|
---|
194 |
|
---|
195 | int cache_for_files;
|
---|
196 | int cache_for_streams;
|
---|
197 | int cache_for_dvds;
|
---|
198 | int cache_for_vcds;
|
---|
199 | int cache_for_audiocds;
|
---|
200 | int cache_for_tv;
|
---|
201 |
|
---|
202 | #ifdef YOUTUBE_SUPPORT
|
---|
203 | int yt_quality;
|
---|
204 | QString yt_user_agent;
|
---|
205 | #endif
|
---|
206 |
|
---|
207 |
|
---|
208 | /* *********
|
---|
209 | Subtitles
|
---|
210 | ********* */
|
---|
211 |
|
---|
212 | QString font_file;
|
---|
213 | QString font_name;
|
---|
214 | bool use_fontconfig;
|
---|
215 | QString subcp; // -subcp
|
---|
216 | bool use_enca;
|
---|
217 | QString enca_lang;
|
---|
218 | int font_autoscale; // -subfont-autoscale
|
---|
219 | int subfuzziness;
|
---|
220 | bool autoload_sub;
|
---|
221 |
|
---|
222 | bool use_ass_subtitles;
|
---|
223 | int ass_line_spacing;
|
---|
224 |
|
---|
225 | bool use_forced_subs_only;
|
---|
226 |
|
---|
227 | bool sub_visibility;
|
---|
228 |
|
---|
229 | bool subtitles_on_screenshots;
|
---|
230 |
|
---|
231 | //! Use the new sub_vob, sub_demux and sub_file commands
|
---|
232 | //! instead of sub_select
|
---|
233 | OptionState use_new_sub_commands;
|
---|
234 | OptionState change_sub_scale_should_restart;
|
---|
235 |
|
---|
236 | //! If true, loading an external subtitle will be done
|
---|
237 | //! by using the sub_load slave command. Otherwise
|
---|
238 | //! mplayer will be restarted.
|
---|
239 | bool fast_load_sub;
|
---|
240 |
|
---|
241 | // ASS styles
|
---|
242 | AssStyles ass_styles;
|
---|
243 | bool force_ass_styles; // Use ass styles even for ass files
|
---|
244 | QString user_forced_ass_style; //!< Specifies a style defined by the user to be used with -ass-force-style
|
---|
245 |
|
---|
246 | //! If false, options requiring freetype won't be used
|
---|
247 | bool freetype_support;
|
---|
248 | #ifdef Q_OS_WIN
|
---|
249 | bool use_windowsfontdir;
|
---|
250 | #endif
|
---|
251 |
|
---|
252 |
|
---|
253 | /* ********
|
---|
254 | Advanced
|
---|
255 | ******** */
|
---|
256 |
|
---|
257 | #if USE_ADAPTER
|
---|
258 | int adapter; //Screen for overlay. If -1 it won't be used.
|
---|
259 | #endif
|
---|
260 |
|
---|
261 | #if USE_COLORKEY
|
---|
262 | unsigned int color_key;
|
---|
263 | #endif
|
---|
264 |
|
---|
265 | bool use_mplayer_window;
|
---|
266 |
|
---|
267 | QString monitor_aspect;
|
---|
268 |
|
---|
269 | bool use_idx; //!< Use -idx
|
---|
270 | bool use_lavf_demuxer;
|
---|
271 |
|
---|
272 | // Let the user pass options to mplayer
|
---|
273 | QString mplayer_additional_options;
|
---|
274 | QString mplayer_additional_video_filters;
|
---|
275 | QString mplayer_additional_audio_filters;
|
---|
276 |
|
---|
277 | // Logs
|
---|
278 | #ifdef LOG_MPLAYER
|
---|
279 | bool log_mplayer;
|
---|
280 | bool verbose_log;
|
---|
281 | bool autosave_mplayer_log;
|
---|
282 | QString mplayer_log_saveto;
|
---|
283 | #endif
|
---|
284 | #ifdef LOG_SMPLAYER
|
---|
285 | bool log_smplayer;
|
---|
286 | QString log_filter;
|
---|
287 | bool save_smplayer_log;
|
---|
288 | #endif
|
---|
289 |
|
---|
290 | #if REPAINT_BACKGROUND_OPTION
|
---|
291 | //! If true, mplayerlayer erases its background
|
---|
292 | bool repaint_video_background;
|
---|
293 | #endif
|
---|
294 |
|
---|
295 | //! If true it will autoload edl files with the same name of the file
|
---|
296 | //! to play
|
---|
297 | bool use_edl_files;
|
---|
298 |
|
---|
299 | //! Preferred connection method: ipv4 or ipv6
|
---|
300 | bool prefer_ipv4;
|
---|
301 |
|
---|
302 | //! Windows only. If true, smplayer will pass short filenames to mplayer.
|
---|
303 | //! To workaround a bug in mplayer.
|
---|
304 | bool use_short_pathnames;
|
---|
305 |
|
---|
306 | //! If false, -brightness, -contrast and so on, won't be passed to
|
---|
307 | //! mplayer. It seems that some graphic cards don't support those options.
|
---|
308 | bool change_video_equalizer_on_startup;
|
---|
309 |
|
---|
310 | //! If true, smplayer will use the prefix pausing_keep_force to keep
|
---|
311 | //! the pause on slave commands. This experimental prefix was added
|
---|
312 | //! in mplayer svn r27665.
|
---|
313 | bool use_pausing_keep_force;
|
---|
314 |
|
---|
315 | OptionState use_correct_pts; //!< Pass -correct-pts to mplayer
|
---|
316 |
|
---|
317 | QString actions_to_run; //!< List of actions to run every time a video loads.
|
---|
318 |
|
---|
319 | //! Show file tag in window title
|
---|
320 | bool show_tag_in_window_title;
|
---|
321 |
|
---|
322 | int time_to_kill_mplayer;
|
---|
323 |
|
---|
324 |
|
---|
325 | /* *********
|
---|
326 | GUI stuff
|
---|
327 | ********* */
|
---|
328 |
|
---|
329 | bool fullscreen;
|
---|
330 | bool start_in_fullscreen;
|
---|
331 | bool compact_mode;
|
---|
332 | OnTop stay_on_top;
|
---|
333 | int size_factor;
|
---|
334 |
|
---|
335 | int resize_method; //!< Mainwindow resize method
|
---|
336 |
|
---|
337 | #if STYLE_SWITCHING
|
---|
338 | QString style; //!< SMPlayer look
|
---|
339 | #endif
|
---|
340 |
|
---|
341 | bool move_when_dragging; //!< Move the main window when the video area is dragged
|
---|
342 |
|
---|
343 | // Function of mouse buttons:
|
---|
344 | QString mouse_left_click_function;
|
---|
345 | QString mouse_right_click_function;
|
---|
346 | QString mouse_double_click_function;
|
---|
347 | QString mouse_middle_click_function;
|
---|
348 | QString mouse_xbutton1_click_function;
|
---|
349 | QString mouse_xbutton2_click_function;
|
---|
350 | int wheel_function;
|
---|
351 |
|
---|
352 | WheelFunctions wheel_function_cycle;
|
---|
353 | bool wheel_function_seeking_reverse;
|
---|
354 |
|
---|
355 | // Configurable seeking
|
---|
356 | int seeking1; // By default 10s
|
---|
357 | int seeking2; // By default 1m
|
---|
358 | int seeking3; // By default 10m
|
---|
359 | int seeking4; // For mouse wheel, by default 30s
|
---|
360 |
|
---|
361 | bool update_while_seeking;
|
---|
362 | #if ENABLE_DELAYED_DRAGGING
|
---|
363 | int time_slider_drag_delay;
|
---|
364 | #endif
|
---|
365 | #if SEEKBAR_RESOLUTION
|
---|
366 | //! If true, seeking will be done using a
|
---|
367 | //! percentage (with fractions) instead of time.
|
---|
368 | bool relative_seeking;
|
---|
369 | #endif
|
---|
370 | bool precise_seeking; //! Enable precise_seeking (only available with mplayer2)
|
---|
371 |
|
---|
372 | bool reset_stop; //! Pressing the stop button resets the position
|
---|
373 |
|
---|
374 | //! If true, the left click in the video is delayed some ms
|
---|
375 | //! to check if the user double clicked
|
---|
376 | bool delay_left_click;
|
---|
377 |
|
---|
378 | QString language;
|
---|
379 | QString iconset;
|
---|
380 |
|
---|
381 | //! Number of times to show the balloon remembering that the program
|
---|
382 | //! is still running in the system tray.
|
---|
383 | int balloon_count;
|
---|
384 |
|
---|
385 | //! If true, the position of the main window will be saved before
|
---|
386 | //! entering in fullscreen and will restore when going back to
|
---|
387 | //! window mode.
|
---|
388 | bool restore_pos_after_fullscreen;
|
---|
389 |
|
---|
390 | bool save_window_size_on_exit;
|
---|
391 |
|
---|
392 | //! Close the main window when a file or playlist finish
|
---|
393 | bool close_on_finish;
|
---|
394 |
|
---|
395 | QString default_font;
|
---|
396 |
|
---|
397 | //!< Pause the current file when the main window is not visible
|
---|
398 | bool pause_when_hidden;
|
---|
399 |
|
---|
400 | //!< Allow frre movement of the video window
|
---|
401 | bool allow_video_movement;
|
---|
402 |
|
---|
403 | QString gui; //!< The name of the GUI to use
|
---|
404 |
|
---|
405 | #if USE_MINIMUMSIZE
|
---|
406 | int gui_minimum_width;
|
---|
407 | #endif
|
---|
408 | QSize default_size; // Default size of the main window
|
---|
409 |
|
---|
410 | #if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
|
---|
411 | bool hide_video_window_on_audio_files;
|
---|
412 | #endif
|
---|
413 |
|
---|
414 | bool report_mplayer_crashes;
|
---|
415 |
|
---|
416 | #if REPORT_OLD_MPLAYER
|
---|
417 | bool reported_mplayer_is_old;
|
---|
418 | #endif
|
---|
419 |
|
---|
420 | bool auto_add_to_playlist; //!< Add files to open to playlist
|
---|
421 | AutoAddToPlaylistFilter media_to_add_to_playlist;
|
---|
422 |
|
---|
423 | #if LOGO_ANIMATION
|
---|
424 | bool animated_logo;
|
---|
425 | #endif
|
---|
426 |
|
---|
427 |
|
---|
428 | /* ********
|
---|
429 | TV (dvb)
|
---|
430 | ******** */
|
---|
431 |
|
---|
432 | bool check_channels_conf_on_startup;
|
---|
433 | int initial_tv_deinterlace;
|
---|
434 | QString last_dvb_channel;
|
---|
435 | QString last_tv_channel;
|
---|
436 |
|
---|
437 |
|
---|
438 | /* ***********
|
---|
439 | Directories
|
---|
440 | *********** */
|
---|
441 |
|
---|
442 | QString latest_dir; //!< Directory of the latest file loaded
|
---|
443 | QString last_dvd_directory;
|
---|
444 | bool save_dirs; // Save or not the latest dirs
|
---|
445 |
|
---|
446 | /* **************
|
---|
447 | Initial values
|
---|
448 | ************** */
|
---|
449 |
|
---|
450 | double initial_sub_scale;
|
---|
451 | double initial_sub_scale_ass;
|
---|
452 | int initial_volume;
|
---|
453 | int initial_contrast;
|
---|
454 | int initial_brightness;
|
---|
455 | int initial_hue;
|
---|
456 | int initial_saturation;
|
---|
457 | int initial_gamma;
|
---|
458 |
|
---|
459 | AudioEqualizerList initial_audio_equalizer;
|
---|
460 |
|
---|
461 | //! Default value for zoom (1.0 = no zoom)
|
---|
462 | double initial_zoom_factor;
|
---|
463 |
|
---|
464 | //! Default value for position of subtitles on screen
|
---|
465 | //! 100 = 100% at the bottom
|
---|
466 | int initial_sub_pos;
|
---|
467 |
|
---|
468 | bool initial_postprocessing; //!< global postprocessing filter
|
---|
469 | bool initial_volnorm;
|
---|
470 |
|
---|
471 | int initial_deinterlace;
|
---|
472 |
|
---|
473 | int initial_audio_channels;
|
---|
474 | int initial_stereo_mode;
|
---|
475 |
|
---|
476 | int initial_audio_track;
|
---|
477 | int initial_subtitle_track;
|
---|
478 |
|
---|
479 |
|
---|
480 | /* ************
|
---|
481 | MPlayer info
|
---|
482 | ************ */
|
---|
483 |
|
---|
484 | int mplayer_detected_version; //!< Latest version of mplayer parsed
|
---|
485 |
|
---|
486 | //! Version of mplayer supplied by the user which will be used if
|
---|
487 | //! the version can't be parsed from mplayer output
|
---|
488 | int mplayer_user_supplied_version;
|
---|
489 |
|
---|
490 | bool mplayer_is_mplayer2; //! True if the detected version is mplayer2
|
---|
491 | QString mplayer2_detected_version;
|
---|
492 |
|
---|
493 |
|
---|
494 | /* *********
|
---|
495 | Instances
|
---|
496 | ********* */
|
---|
497 | #ifdef SINGLE_INSTANCE
|
---|
498 | bool use_single_instance;
|
---|
499 | #endif
|
---|
500 |
|
---|
501 |
|
---|
502 | /* ****************
|
---|
503 | Floating control
|
---|
504 | **************** */
|
---|
505 |
|
---|
506 | int floating_control_margin;
|
---|
507 | int floating_control_width;
|
---|
508 | bool floating_control_animated;
|
---|
509 | bool floating_display_in_compact_mode;
|
---|
510 | int floating_activation_area;
|
---|
511 | int floating_hide_delay;
|
---|
512 |
|
---|
513 |
|
---|
514 | /* *******
|
---|
515 | History
|
---|
516 | ******* */
|
---|
517 |
|
---|
518 | Recents * history_recents;
|
---|
519 | URLHistory * history_urls;
|
---|
520 |
|
---|
521 |
|
---|
522 | /* *******
|
---|
523 | Filters
|
---|
524 | ******* */
|
---|
525 | Filters * filters;
|
---|
526 |
|
---|
527 |
|
---|
528 | /* *********
|
---|
529 | SMPlayer info
|
---|
530 | ********* */
|
---|
531 |
|
---|
532 | #ifdef CHECK_UPGRADED
|
---|
533 | QString smplayer_stable_version;
|
---|
534 | bool check_if_upgraded;
|
---|
535 | #endif
|
---|
536 | #ifdef FONTCACHE_DIALOG
|
---|
537 | QString smplayer_version;
|
---|
538 | #endif
|
---|
539 |
|
---|
540 |
|
---|
541 | /* *********
|
---|
542 | Update
|
---|
543 | ********* */
|
---|
544 |
|
---|
545 | #ifdef UPDATE_CHECKER
|
---|
546 | UpdateCheckerData update_checker_data;
|
---|
547 | #endif
|
---|
548 | };
|
---|
549 |
|
---|
550 | Q_DECLARE_OPERATORS_FOR_FLAGS(Preferences::WheelFunctions)
|
---|
551 |
|
---|
552 | #endif
|
---|