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