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

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

SMplayer: update trunk to 0.8.1

  • Property svn:eol-style set to LF
File size: 11.3 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 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
299 /* *********
300 GUI stuff
301 ********* */
302
303 bool fullscreen;
304 bool start_in_fullscreen;
305 bool compact_mode;
306 OnTop stay_on_top;
307 int size_factor;
308
309 int resize_method; //!< Mainwindow resize method
310
311#if STYLE_SWITCHING
312 QString style; //!< SMPlayer look
313#endif
314
315 // Function of mouse buttons:
316 QString mouse_left_click_function;
317 QString mouse_right_click_function;
318 QString mouse_double_click_function;
319 QString mouse_middle_click_function;
320 QString mouse_xbutton1_click_function;
321 QString mouse_xbutton2_click_function;
322 int wheel_function;
323
324 QFlags<WheelFunctions> wheel_function_cycle;
325
326 bool wheel_function_seeking_reverse;
327
328 // Configurable seeking
329 int seeking1; // By default 10s
330 int seeking2; // By default 1m
331 int seeking3; // By default 10m
332 int seeking4; // For mouse wheel, by default 30s
333
334 bool update_while_seeking;
335#if ENABLE_DELAYED_DRAGGING
336 int time_slider_drag_delay;
337#endif
338#if SEEKBAR_RESOLUTION
339 //! If true, seeking will be done using a
340 //! percentage (with fractions) instead of time.
341 bool relative_seeking;
342#endif
343 bool precise_seeking; //! Enable precise_seeking (only available with mplayer2)
344
345 QString language;
346 QString iconset;
347
348 //! Number of times to show the balloon remembering that the program
349 //! is still running in the system tray.
350 int balloon_count;
351
352 //! If true, the position of the main window will be saved before
353 //! entering in fullscreen and will restore when going back to
354 //! window mode.
355 bool restore_pos_after_fullscreen;
356
357 bool save_window_size_on_exit;
358
359 //! Close the main window when a file or playlist finish
360 bool close_on_finish;
361
362 QString default_font;
363
364 //!< Pause the current file when the main window is not visible
365 bool pause_when_hidden;
366
367 //!< Allow frre movement of the video window
368 bool allow_video_movement;
369
370 QString gui; //!< The name of the GUI to use
371
372#if USE_MINIMUMSIZE
373 int gui_minimum_width;
374#endif
375 QSize default_size; // Default size of the main window
376
377#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
378 bool hide_video_window_on_audio_files;
379#endif
380
381 bool report_mplayer_crashes;
382
383#if REPORT_OLD_MPLAYER
384 bool reported_mplayer_is_old;
385#endif
386
387 bool auto_add_to_playlist; //!< Add files to open to playlist
388 bool add_to_playlist_consecutive_files;
389
390#if LOGO_ANIMATION
391 bool animated_logo;
392#endif
393
394
395 /* ********
396 TV (dvb)
397 ******** */
398
399 bool check_channels_conf_on_startup;
400 int initial_tv_deinterlace;
401 QString last_dvb_channel;
402 QString last_tv_channel;
403
404
405 /* ***********
406 Directories
407 *********** */
408
409 QString latest_dir; //!< Directory of the latest file loaded
410 QString last_dvd_directory;
411 bool save_dirs; // Save or not the latest dirs
412
413 /* **************
414 Initial values
415 ************** */
416
417 double initial_sub_scale;
418 double initial_sub_scale_ass;
419 int initial_volume;
420 int initial_contrast;
421 int initial_brightness;
422 int initial_hue;
423 int initial_saturation;
424 int initial_gamma;
425
426 AudioEqualizerList initial_audio_equalizer;
427
428 //! Default value for zoom (1.0 = no zoom)
429 double initial_zoom_factor;
430
431 //! Default value for position of subtitles on screen
432 //! 100 = 100% at the bottom
433 int initial_sub_pos;
434
435 bool initial_postprocessing; //!< global postprocessing filter
436 bool initial_volnorm;
437
438 int initial_deinterlace;
439
440 int initial_audio_channels;
441 int initial_stereo_mode;
442
443 int initial_audio_track;
444 int initial_subtitle_track;
445
446
447 /* ************
448 MPlayer info
449 ************ */
450
451 int mplayer_detected_version; //!< Latest version of mplayer parsed
452
453 //! Version of mplayer supplied by the user which will be used if
454 //! the version can't be parsed from mplayer output
455 int mplayer_user_supplied_version;
456
457 bool mplayer_is_mplayer2; //! True if the detected version is mplayer2
458 QString mplayer2_detected_version;
459
460
461 /* *********
462 Instances
463 ********* */
464#ifdef SINGLE_INSTANCE
465 bool use_single_instance;
466#endif
467
468
469 /* ****************
470 Floating control
471 **************** */
472
473 int floating_control_margin;
474 int floating_control_width;
475 bool floating_control_animated;
476 bool floating_display_in_compact_mode;
477#ifndef Q_OS_WIN
478 bool bypass_window_manager;
479#endif
480
481
482 /* *******
483 History
484 ******* */
485
486 Recents * history_recents;
487 URLHistory * history_urls;
488
489
490 /* *******
491 Filters
492 ******* */
493 Filters * filters;
494};
495Q_DECLARE_OPERATORS_FOR_FLAGS(Preferences::WheelFunctions)
496
497#endif
Note: See TracBrowser for help on using the repository browser.