~ubuntu-branches/debian/experimental/smplayer/experimental

« back to all changes in this revision

Viewing changes to src/preferences.h

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-01-03 17:08:06 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090103170806-eodntb2slv6g2pb6
Tags: 0.6.6-0ubuntu1
* The "just before FF" release.
* New upstream release.
* debian/control: Bumped Standards-Version to 3.8.0.
* debian/copyright: Changed (C) to © to fix Lintian warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  smplayer, GUI front-end for mplayer.
 
2
    Copyright (C) 2006-2008 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
 
 
32
class Recents;
 
33
class URLHistory;
 
34
 
 
35
class Preferences {
 
36
 
 
37
public:
 
38
        enum OSD { None = 0, Seek = 1, SeekTimer = 2, SeekTimerTotal = 3 };
 
39
        enum OnTop { NeverOnTop = 0, AlwaysOnTop = 1, WhilePlayingOnTop = 2 };
 
40
        enum Resize { Never = 0, Always = 1, Afterload = 2 };
 
41
        enum Priority { Realtime = 0, High = 1, AboveNormal = 2, Normal = 3,
 
42
                    BelowNormal = 4, Idle = 5 };
 
43
        enum WheelFunction { Seeking = 0, Volume = 1, Zoom = 2, DoNothing = 3,
 
44
                         ChangeSpeed = 4 };
 
45
        enum OptionState { Detect = -1, Disabled = 0, Enabled = 1 };
 
46
        enum H264LoopFilter { LoopDisabled = 0, LoopEnabled = 1, LoopDisabledOnHD = 2 };
 
47
 
 
48
        Preferences();
 
49
        virtual ~Preferences();
 
50
 
 
51
        virtual void reset();
 
52
 
 
53
#ifndef NO_USE_INI_FILES
 
54
        void save();
 
55
        void load();
 
56
#endif
 
57
 
 
58
        double monitor_aspect_double();
 
59
 
 
60
 
 
61
 
 
62
    /* *******
 
63
       General
 
64
       ******* */
 
65
 
 
66
        QString mplayer_bin;
 
67
        QString vo; // video output
 
68
        QString ao; // audio output
 
69
 
 
70
        QString screenshot_directory;
 
71
 
 
72
        // SMPlayer will remember all media settings for all videos.
 
73
        // This options allow to disable it:
 
74
        bool dont_remember_media_settings;      // Will not remember anything
 
75
        bool dont_remember_time_pos;            // Will not remember time pos
 
76
 
 
77
        QString audio_lang;             // Preferred audio language
 
78
        QString subtitle_lang;          // Preferred subtitle language
 
79
 
 
80
        // Video
 
81
        bool use_direct_rendering;
 
82
        bool use_double_buffer;
 
83
        bool disable_screensaver;
 
84
        bool use_soft_video_eq;
 
85
        bool use_slices;
 
86
        int autoq;      //!< Postprocessing quality
 
87
        bool add_blackborders_on_fullscreen;
 
88
 
 
89
        // Audio
 
90
        bool use_soft_vol;
 
91
        int softvol_max;
 
92
        OptionState use_scaletempo;
 
93
        bool dont_change_volume; // Don't change volume on startup
 
94
        bool use_hwac3; // -afm hwac3
 
95
        bool use_audio_equalizer;
 
96
        OptionState use_volume_option; //!< Use -volume in command line
 
97
 
 
98
        // Misc
 
99
        bool loop;      //!< Loop. If true repeat the file
 
100
        int osd;
 
101
 
 
102
        QString file_settings_method; //!< Method to be used for saving file settings
 
103
 
 
104
 
 
105
    /* ***************
 
106
       Drives (CD/DVD)
 
107
       *************** */
 
108
 
 
109
        QString dvd_device;
 
110
        QString cdrom_device;
 
111
 
 
112
#ifdef Q_OS_WIN
 
113
        bool enable_audiocd_on_windows;
 
114
#endif
 
115
 
 
116
        int vcd_initial_title;
 
117
 
 
118
 
 
119
    /* ***********
 
120
       Performance
 
121
       *********** */
 
122
 
 
123
        int priority;
 
124
        bool frame_drop;
 
125
        bool hard_frame_drop;
 
126
        bool autosync;
 
127
        int autosync_factor;
 
128
 
 
129
        H264LoopFilter h264_skip_loop_filter;
 
130
        int HD_height; //!< An HD is a video which height is equal or greater than this.
 
131
 
 
132
        OptionState fast_audio_change; // If activated, not restart mplayer
 
133
#if !SMART_DVD_CHAPTERS
 
134
        bool fast_chapter_change;
 
135
#endif
 
136
 
 
137
        int threads; //!< number of threads to use for decoding (-lavdopts threads <1-8>)
 
138
 
 
139
        int cache_for_files;
 
140
        int cache_for_streams;
 
141
        int cache_for_dvds;
 
142
        int cache_for_vcds;
 
143
        int cache_for_audiocds;
 
144
 
 
145
 
 
146
        /* *********
 
147
           Subtitles
 
148
           ********* */
 
149
 
 
150
        QString font_file;
 
151
        QString font_name;
 
152
        bool use_fontconfig;
 
153
        QString subcp; // -subcp
 
154
        bool use_enca;
 
155
        QString enca_lang;
 
156
        int font_autoscale; // -subfont-autoscale
 
157
        int subfuzziness;
 
158
        bool autoload_sub;
 
159
 
 
160
        bool use_ass_subtitles;
 
161
        int ass_line_spacing;
 
162
 
 
163
        bool use_closed_caption_subs;
 
164
        bool use_forced_subs_only;
 
165
 
 
166
        bool subtitles_on_screenshots;
 
167
 
 
168
        //! Use the new sub_vob, sub_demux and sub_file commands
 
169
        //! instead of sub_select
 
170
        OptionState use_new_sub_commands; 
 
171
        OptionState change_sub_scale_should_restart;
 
172
 
 
173
        // ASS styles
 
174
        AssStyles ass_styles;
 
175
 
 
176
        //! If false, options requiring freetype won't be used
 
177
        bool freetype_support;
 
178
 
 
179
 
 
180
    /* ********
 
181
       Advanced
 
182
       ******** */
 
183
 
 
184
#if USE_ADAPTER
 
185
        int adapter; //Screen for overlay. If -1 it won't be used.
 
186
#endif
 
187
 
 
188
#if USE_COLORKEY
 
189
        unsigned int color_key;
 
190
#endif
 
191
 
 
192
        bool use_mplayer_window;
 
193
 
 
194
        QString monitor_aspect;
 
195
 
 
196
        bool use_idx; //!< Use -idx
 
197
 
 
198
        // Let the user pass options to mplayer
 
199
        QString mplayer_additional_options;
 
200
        QString mplayer_additional_video_filters;
 
201
        QString mplayer_additional_audio_filters;
 
202
 
 
203
        // Logs
 
204
        bool log_mplayer;
 
205
        bool log_smplayer;
 
206
        QString log_filter;
 
207
 
 
208
    //mplayer log autosaving
 
209
    bool autosave_mplayer_log;
 
210
    QString mplayer_log_saveto;
 
211
    //mplayer log autosaving end
 
212
 
 
213
#if REPAINT_BACKGROUND_OPTION
 
214
        //! If true, mplayerlayer erases its background
 
215
        bool repaint_video_background; 
 
216
#endif
 
217
 
 
218
        //! If true it will autoload edl files with the same name of the file
 
219
    //! to play
 
220
        bool use_edl_files;
 
221
 
 
222
        //! Preferred connection method: ipv4 or ipv6
 
223
        bool prefer_ipv4;
 
224
 
 
225
        //! Windows only. If true, smplayer will pass short filenames to mplayer.
 
226
        //! To workaround a bug in mplayer.
 
227
        bool use_short_pathnames; 
 
228
 
 
229
        //! If false, -brightness, -contrast and so on, won't be passed to
 
230
        //! mplayer. It seems that some graphic cards don't support those options.
 
231
        bool change_video_equalizer_on_startup;
 
232
 
 
233
        //! If true, smplayer will use the prefix pausing_keep_force to keep
 
234
        //! the pause on slave commands. This experimental prefix was added
 
235
        //! in mplayer svn r27665.
 
236
        bool use_pausing_keep_force;
 
237
 
 
238
        bool use_correct_pts; //!< Pass -correct-pts to mplayer
 
239
 
 
240
        QString actions_to_run; //!< List of actions to run every time a video loads.
 
241
 
 
242
 
 
243
        /* *********
 
244
           GUI stuff
 
245
           ********* */
 
246
 
 
247
        bool fullscreen;
 
248
        bool start_in_fullscreen;
 
249
        bool compact_mode;
 
250
        OnTop stay_on_top;
 
251
        int size_factor;
 
252
 
 
253
        int resize_method;      //!< Mainwindow resize method
 
254
 
 
255
#if STYLE_SWITCHING
 
256
        QString style;  //!< SMPlayer look
 
257
#endif
 
258
        bool show_frame_counter;
 
259
        bool show_motion_vectors;
 
260
 
 
261
        // Function of mouse buttons:
 
262
        QString mouse_left_click_function;
 
263
        QString mouse_right_click_function;
 
264
        QString mouse_double_click_function;
 
265
        QString mouse_middle_click_function;
 
266
        QString mouse_xbutton1_click_function;
 
267
        QString mouse_xbutton2_click_function;
 
268
        int wheel_function;
 
269
 
 
270
        // Configurable seeking
 
271
        int seeking1; // By default 10s
 
272
        int seeking2; // By default 1m
 
273
        int seeking3; // By default 10m
 
274
        int seeking4; // For mouse wheel, by default 30s
 
275
 
 
276
        bool update_while_seeking;
 
277
#if ENABLE_DELAYED_DRAGGING     
 
278
        int time_slider_drag_delay;
 
279
#endif
 
280
 
 
281
        QString language;
 
282
        QString iconset;
 
283
 
 
284
        //! Number of times to show the balloon remembering that the program
 
285
        //! is still running in the system tray.
 
286
        int balloon_count;
 
287
 
 
288
        //! If true, the position of the main window will be saved before
 
289
        //! entering in fullscreen and will restore when going back to
 
290
        //! window mode.
 
291
        bool restore_pos_after_fullscreen;
 
292
 
 
293
        bool save_window_size_on_exit;
 
294
 
 
295
        //! Close the main window when a file or playlist finish
 
296
        bool close_on_finish;
 
297
 
 
298
        QString default_font;
 
299
 
 
300
        //!< Pause the current file when the main window is not visible
 
301
        bool pause_when_hidden; 
 
302
 
 
303
        //!< Allow frre movement of the video window
 
304
        bool allow_video_movement;
 
305
 
 
306
        QString gui; //!< The name of the GUI to use
 
307
 
 
308
#if USE_MINIMUMSIZE
 
309
        int gui_minimum_width;
 
310
#endif
 
311
        QSize default_size; // Default size of the main window
 
312
 
 
313
#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
 
314
        bool hide_video_window_on_audio_files;
 
315
#endif
 
316
 
 
317
        bool report_mplayer_crashes;
 
318
 
 
319
#if REPORT_OLD_MPLAYER
 
320
        bool reported_mplayer_is_old;
 
321
#endif
 
322
 
 
323
        bool auto_add_to_playlist; //!< Add files to open to playlist
 
324
        bool add_to_playlist_consecutive_files;
 
325
 
 
326
 
 
327
    /* ***********
 
328
       Directories
 
329
       *********** */
 
330
 
 
331
        QString latest_dir; //!< Directory of the latest file loaded
 
332
        QString last_dvd_directory;
 
333
 
 
334
 
 
335
    /* **************
 
336
       Initial values
 
337
       ************** */
 
338
 
 
339
        double initial_sub_scale;
 
340
        double initial_sub_scale_ass;
 
341
        int initial_volume;
 
342
        int initial_contrast;
 
343
        int initial_brightness;
 
344
        int initial_hue;
 
345
        int initial_saturation;
 
346
        int initial_gamma;
 
347
 
 
348
        AudioEqualizerList initial_audio_equalizer;
 
349
 
 
350
        //! Default value for panscan (1.0 = no zoom)
 
351
        double initial_panscan_factor;
 
352
 
 
353
        //! Default value for position of subtitles on screen
 
354
        //! 100 = 100% at the bottom
 
355
        int initial_sub_pos;
 
356
 
 
357
        bool initial_postprocessing; //!< global postprocessing filter
 
358
        bool initial_volnorm;
 
359
 
 
360
        int initial_deinterlace;
 
361
 
 
362
        int initial_audio_channels;
 
363
        int initial_stereo_mode;
 
364
 
 
365
        int initial_audio_track;
 
366
        int initial_subtitle_track;
 
367
 
 
368
 
 
369
    /* ************
 
370
       MPlayer info
 
371
       ************ */
 
372
 
 
373
        int mplayer_detected_version;   //!< Latest version of mplayer parsed
 
374
 
 
375
        //! Version of mplayer supplied by the user which will be used if
 
376
        //! the version can't be parsed from mplayer output
 
377
        int mplayer_user_supplied_version;
 
378
 
 
379
 
 
380
    /* *********
 
381
       Instances
 
382
       ********* */
 
383
 
 
384
        bool use_single_instance;
 
385
        int connection_port; // Manual port
 
386
        bool use_autoport;
 
387
        int autoport; // Port automatically chosen by Qt
 
388
 
 
389
 
 
390
    /* ****************
 
391
       Floating control
 
392
       **************** */
 
393
 
 
394
        int floating_control_margin;
 
395
        int floating_control_width;
 
396
        bool floating_control_animated;
 
397
        bool floating_display_in_compact_mode;
 
398
#ifndef Q_OS_WIN
 
399
        bool bypass_window_manager;
 
400
#endif
 
401
 
 
402
 
 
403
    /* *****
 
404
       Proxy
 
405
       ***** */
 
406
 
 
407
        bool use_proxy;
 
408
        int proxy_type;
 
409
        QString proxy_host;
 
410
        int proxy_port;
 
411
        QString proxy_username;
 
412
        QString proxy_password;
 
413
 
 
414
 
 
415
    /* *******
 
416
       History
 
417
       ******* */
 
418
 
 
419
        Recents * history_recents;
 
420
        URLHistory * history_urls;
 
421
};
 
422
 
 
423
#endif