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

Last change on this file since 150 was 142, checked in by Silvan Scherrer, 12 years ago

SMPlayer: update trunk to 0.8.5

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