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

Last change on this file since 156 was 156, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to 0.8.6

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