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

Last change on this file since 125 was 124, checked in by Silvan Scherrer, 13 years ago

SMPlayer: 0.7.1 trunk update

  • Property svn:eol-style set to LF
File size: 11.2 KB
Line 
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
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 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#if 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 bool log_mplayer;
252 bool log_smplayer;
253 QString log_filter;
254 bool verbose_log;
255 bool save_smplayer_log;
256
257 //mplayer log autosaving
258 bool autosave_mplayer_log;
259 QString mplayer_log_saveto;
260 //mplayer log autosaving end
261
262#if REPAINT_BACKGROUND_OPTION
263 //! If true, mplayerlayer erases its background
264 bool repaint_video_background;
265#endif
266
267 //! If true it will autoload edl files with the same name of the file
268 //! to play
269 bool use_edl_files;
270
271 //! Preferred connection method: ipv4 or ipv6
272 bool prefer_ipv4;
273
274 //! Windows only. If true, smplayer will pass short filenames to mplayer.
275 //! To workaround a bug in mplayer.
276 bool use_short_pathnames;
277
278 //! If false, -brightness, -contrast and so on, won't be passed to
279 //! mplayer. It seems that some graphic cards don't support those options.
280 bool change_video_equalizer_on_startup;
281
282 //! If true, smplayer will use the prefix pausing_keep_force to keep
283 //! the pause on slave commands. This experimental prefix was added
284 //! in mplayer svn r27665.
285 bool use_pausing_keep_force;
286
287 OptionState use_correct_pts; //!< Pass -correct-pts to mplayer
288
289 QString actions_to_run; //!< List of actions to run every time a video loads.
290
291 //! Show file tag in window title
292 bool show_tag_in_window_title;
293
294
295 /* *********
296 GUI stuff
297 ********* */
298
299 bool fullscreen;
300 bool start_in_fullscreen;
301 bool compact_mode;
302 OnTop stay_on_top;
303 int size_factor;
304
305 int resize_method; //!< Mainwindow resize method
306
307#if STYLE_SWITCHING
308 QString style; //!< SMPlayer look
309#endif
310
311 // Function of mouse buttons:
312 QString mouse_left_click_function;
313 QString mouse_right_click_function;
314 QString mouse_double_click_function;
315 QString mouse_middle_click_function;
316 QString mouse_xbutton1_click_function;
317 QString mouse_xbutton2_click_function;
318 int wheel_function;
319
320 QFlags<WheelFunctions> wheel_function_cycle;
321
322 bool wheel_function_seeking_reverse;
323
324 // Configurable seeking
325 int seeking1; // By default 10s
326 int seeking2; // By default 1m
327 int seeking3; // By default 10m
328 int seeking4; // For mouse wheel, by default 30s
329
330 bool update_while_seeking;
331#if ENABLE_DELAYED_DRAGGING
332 int time_slider_drag_delay;
333#endif
334#if SEEKBAR_RESOLUTION
335 //! If true, seeking will be done using a
336 //! percentage (with fractions) instead of time.
337 bool relative_seeking;
338#endif
339 bool precise_seeking; //! Enable precise_seeking (only available with mplayer2)
340
341 QString language;
342 QString iconset;
343
344 //! Number of times to show the balloon remembering that the program
345 //! is still running in the system tray.
346 int balloon_count;
347
348 //! If true, the position of the main window will be saved before
349 //! entering in fullscreen and will restore when going back to
350 //! window mode.
351 bool restore_pos_after_fullscreen;
352
353 bool save_window_size_on_exit;
354
355 //! Close the main window when a file or playlist finish
356 bool close_on_finish;
357
358 QString default_font;
359
360 //!< Pause the current file when the main window is not visible
361 bool pause_when_hidden;
362
363 //!< Allow frre movement of the video window
364 bool allow_video_movement;
365
366 QString gui; //!< The name of the GUI to use
367
368#if USE_MINIMUMSIZE
369 int gui_minimum_width;
370#endif
371 QSize default_size; // Default size of the main window
372
373#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
374 bool hide_video_window_on_audio_files;
375#endif
376
377 bool report_mplayer_crashes;
378
379#if REPORT_OLD_MPLAYER
380 bool reported_mplayer_is_old;
381#endif
382
383 bool auto_add_to_playlist; //!< Add files to open to playlist
384 bool add_to_playlist_consecutive_files;
385
386
387 /* ********
388 TV (dvb)
389 ******** */
390
391 bool check_channels_conf_on_startup;
392 int initial_tv_deinterlace;
393 QString last_dvb_channel;
394 QString last_tv_channel;
395
396
397 /* ***********
398 Directories
399 *********** */
400
401 QString latest_dir; //!< Directory of the latest file loaded
402 QString last_dvd_directory;
403
404
405 /* **************
406 Initial values
407 ************** */
408
409 double initial_sub_scale;
410 double initial_sub_scale_ass;
411 int initial_volume;
412 int initial_contrast;
413 int initial_brightness;
414 int initial_hue;
415 int initial_saturation;
416 int initial_gamma;
417
418 AudioEqualizerList initial_audio_equalizer;
419
420 //! Default value for zoom (1.0 = no zoom)
421 double initial_zoom_factor;
422
423 //! Default value for position of subtitles on screen
424 //! 100 = 100% at the bottom
425 int initial_sub_pos;
426
427 bool initial_postprocessing; //!< global postprocessing filter
428 bool initial_volnorm;
429
430 int initial_deinterlace;
431
432 int initial_audio_channels;
433 int initial_stereo_mode;
434
435 int initial_audio_track;
436 int initial_subtitle_track;
437
438
439 /* ************
440 MPlayer info
441 ************ */
442
443 int mplayer_detected_version; //!< Latest version of mplayer parsed
444
445 //! Version of mplayer supplied by the user which will be used if
446 //! the version can't be parsed from mplayer output
447 int mplayer_user_supplied_version;
448
449 bool mplayer_is_mplayer2; //! True if the detected version is mplayer2
450 QString mplayer2_detected_version;
451
452
453 /* *********
454 Instances
455 ********* */
456
457 bool use_single_instance;
458 int connection_port; // Manual port
459 bool use_autoport;
460 int autoport; // Port automatically chosen by Qt
461
462
463 /* ****************
464 Floating control
465 **************** */
466
467 int floating_control_margin;
468 int floating_control_width;
469 bool floating_control_animated;
470 bool floating_display_in_compact_mode;
471#ifndef Q_OS_WIN
472 bool bypass_window_manager;
473#endif
474
475
476 /* *******
477 History
478 ******* */
479
480 Recents * history_recents;
481 URLHistory * history_urls;
482
483
484 /* *******
485 Filters
486 ******* */
487 Filters * filters;
488};
489Q_DECLARE_OPERATORS_FOR_FLAGS(Preferences::WheelFunctions)
490
491#endif
Note: See TracBrowser for help on using the repository browser.