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

Last change on this file since 119 was 119, checked in by Silvan Scherrer, 14 years ago

SMPlayer: latest svn update

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