source: smplayer/trunk/src/preferences.h@ 176

Last change on this file since 176 was 176, checked in by Silvan Scherrer, 9 years ago

smplayer: update trunk to version 16.4

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