| [90] | 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| [140] | 2 | Copyright (C) 2006-2013 Ricardo Villalba <[email protected]>
|
|---|
| [90] | 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 | class Recents;
|
|---|
| 33 | class URLHistory;
|
|---|
| 34 | class Filters;
|
|---|
| 35 |
|
|---|
| 36 | class Preferences {
|
|---|
| 37 |
|
|---|
| 38 | public:
|
|---|
| 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();
|
|---|
| [121] | 62 | void setupScreenshotFolder();
|
|---|
| [90] | 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | /* *******
|
|---|
| 67 | General
|
|---|
| 68 | ******* */
|
|---|
| 69 |
|
|---|
| [133] | 70 | int config_version;
|
|---|
| 71 |
|
|---|
| [90] | 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 |
|
|---|
| [118] | 95 | #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
|---|
| [90] | 96 | bool turn_screensaver_off;
|
|---|
| 97 | bool avoid_screensaver;
|
|---|
| 98 | #else
|
|---|
| 99 | bool disable_screensaver;
|
|---|
| 100 | #endif
|
|---|
| 101 |
|
|---|
| 102 | #ifndef Q_OS_WIN
|
|---|
| [118] | 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;
|
|---|
| [90] | 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 |
|
|---|
| [127] | 182 | #ifdef YOUTUBE_SUPPORT
|
|---|
| [121] | 183 | int yt_quality;
|
|---|
| [133] | 184 | QString yt_user_agent;
|
|---|
| [121] | 185 | #endif
|
|---|
| [90] | 186 |
|
|---|
| [121] | 187 |
|
|---|
| [90] | 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
|
|---|
| [127] | 254 | #ifdef LOG_MPLAYER
|
|---|
| [90] | 255 | bool log_mplayer;
|
|---|
| [127] | 256 | bool verbose_log;
|
|---|
| 257 | bool autosave_mplayer_log;
|
|---|
| 258 | QString mplayer_log_saveto;
|
|---|
| 259 | #endif
|
|---|
| 260 | #ifdef LOG_SMPLAYER
|
|---|
| [90] | 261 | bool log_smplayer;
|
|---|
| 262 | QString log_filter;
|
|---|
| 263 | bool save_smplayer_log;
|
|---|
| [127] | 264 | #endif
|
|---|
| [90] | 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 |
|
|---|
| [118] | 295 | //! Show file tag in window title
|
|---|
| 296 | bool show_tag_in_window_title;
|
|---|
| [90] | 297 |
|
|---|
| [137] | 298 | int time_to_kill_mplayer;
|
|---|
| [118] | 299 |
|
|---|
| [137] | 300 |
|
|---|
| [90] | 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 |
|
|---|
| [140] | 317 | bool move_when_dragging; //!< Move the main window when the video area is dragged
|
|---|
| 318 |
|
|---|
| [90] | 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;
|
|---|
| |
|---|