[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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 |
|
---|
[176] | 19 | #ifndef MEDIASETTINGS_H
|
---|
| 20 | #define MEDIASETTINGS_H
|
---|
[112] | 21 |
|
---|
| 22 |
|
---|
| 23 | /* Settings the user has set for this file, and that we need to */
|
---|
| 24 | /* restore the video after a restart */
|
---|
| 25 |
|
---|
| 26 | #include <QString>
|
---|
| 27 | #include <QSize>
|
---|
| 28 | #include "config.h"
|
---|
| 29 | #include "audioequalizerlist.h"
|
---|
| 30 |
|
---|
[188] | 31 | //#define MSET_USE_STARTING_TIME
|
---|
| 32 |
|
---|
[112] | 33 | class QSettings;
|
---|
| 34 |
|
---|
| 35 | class MediaSettings {
|
---|
| 36 |
|
---|
| 37 | public:
|
---|
| 38 | enum Denoise { NoDenoise = 0, DenoiseNormal = 1, DenoiseSoft = 2 };
|
---|
| 39 | enum Aspect { AspectAuto = 1, Aspect43 = 2, Aspect54 = 3, Aspect149 = 4,
|
---|
| 40 | Aspect169 = 5, Aspect1610 = 6, Aspect235 = 7, Aspect11 = 8,
|
---|
[165] | 41 | Aspect32 = 9, Aspect1410 = 10, Aspect118 = 11,
|
---|
[112] | 42 | AspectNone = 0 };
|
---|
| 43 | enum Deinterlace { NoDeinterlace = 0, L5 = 1, Yadif = 2, LB = 3,
|
---|
| 44 | Yadif_1 = 4, Kerndeint = 5 };
|
---|
| 45 | enum AudioChannels { ChDefault = 0, ChStereo = 2, ChSurround = 4,
|
---|
[139] | 46 | ChFull51 = 6, ChFull61 = 7, ChFull71 = 8 };
|
---|
[142] | 47 | enum StereoMode { Stereo = 0, Left = 1, Right = 2, Mono = 3, Reverse = 4 };
|
---|
[112] | 48 |
|
---|
| 49 | enum Rotate { NoRotate = -1, Clockwise_flip = 0, Clockwise = 1,
|
---|
| 50 | Counterclockwise = 2, Counterclockwise_flip = 3 };
|
---|
| 51 |
|
---|
| 52 | enum IDs { NoneSelected = -1000, SubNone = 90000 };
|
---|
| 53 |
|
---|
[142] | 54 | enum SubFPS { SFPS_None, SFPS_23, SFPS_24, SFPS_25, SFPS_30, SFPS_23976, SFPS_29970 };
|
---|
| 55 |
|
---|
[112] | 56 | MediaSettings();
|
---|
| 57 | virtual ~MediaSettings();
|
---|
| 58 |
|
---|
| 59 | virtual void reset();
|
---|
| 60 |
|
---|
| 61 | double current_sec;
|
---|
| 62 | int current_sub_id;
|
---|
[176] | 63 | #ifdef MPV_SUPPORT
|
---|
| 64 | int current_secondary_sub_id;
|
---|
| 65 | #endif
|
---|
[112] | 66 |
|
---|
| 67 | #if PROGRAM_SWITCH
|
---|
| 68 | int current_program_id;
|
---|
| 69 | #endif
|
---|
| 70 |
|
---|
| 71 | int current_video_id;
|
---|
| 72 | int current_audio_id;
|
---|
| 73 |
|
---|
| 74 | int current_title_id;
|
---|
| 75 | int current_angle_id;
|
---|
| 76 |
|
---|
| 77 | int aspect_ratio_id;
|
---|
| 78 |
|
---|
| 79 | //bool fullscreen;
|
---|
| 80 |
|
---|
| 81 | int volume;
|
---|
| 82 | bool mute;
|
---|
| 83 |
|
---|
| 84 | int brightness, contrast, gamma, hue, saturation;
|
---|
| 85 |
|
---|
| 86 | AudioEqualizerList audio_equalizer;
|
---|
| 87 |
|
---|
| 88 | QString external_subtitles;
|
---|
[142] | 89 | int external_subtitles_fps;
|
---|
[112] | 90 | QString external_audio; // external audio file
|
---|
| 91 |
|
---|
| 92 | int sub_delay;
|
---|
| 93 | int audio_delay;
|
---|
| 94 |
|
---|
| 95 | // Subtitles position (0-100)
|
---|
| 96 | int sub_pos;
|
---|
| 97 | double sub_scale;
|
---|
| 98 | double sub_scale_ass;
|
---|
| 99 |
|
---|
[119] | 100 | int closed_caption_channel; // 0 = disabled
|
---|
| 101 |
|
---|
[112] | 102 | double speed; // Speed of playback: 1.0 = normal speed
|
---|
| 103 |
|
---|
| 104 | int current_deinterlacer;
|
---|
| 105 |
|
---|
| 106 | bool add_letterbox;
|
---|
| 107 |
|
---|
| 108 | // Filters in menu
|
---|
| 109 | bool phase_filter;
|
---|
| 110 | bool deblock_filter;
|
---|
| 111 | bool dering_filter;
|
---|
[128] | 112 | bool gradfun_filter;
|
---|
[112] | 113 | bool noise_filter;
|
---|
| 114 | bool postprocessing_filter;
|
---|
| 115 | bool upscaling_filter; //!< Software scaling
|
---|
| 116 |
|
---|
[128] | 117 | int current_denoiser;
|
---|
| 118 | int current_unsharp;
|
---|
| 119 |
|
---|
[176] | 120 | QString stereo3d_in;
|
---|
| 121 | QString stereo3d_out;
|
---|
| 122 |
|
---|
| 123 | #ifdef MPLAYER_SUPPORT
|
---|
[112] | 124 | bool karaoke_filter;
|
---|
[176] | 125 | #endif
|
---|
[112] | 126 | bool extrastereo_filter;
|
---|
| 127 | bool volnorm_filter;
|
---|
| 128 |
|
---|
| 129 | int audio_use_channels;
|
---|
| 130 | int stereo_mode;
|
---|
| 131 |
|
---|
| 132 | double zoom_factor; // mplayerwindow zoom
|
---|
| 133 |
|
---|
| 134 | int rotate;
|
---|
| 135 | bool flip; //!< Flip image
|
---|
| 136 | bool mirror; //!< Mirrors the image on the Y axis.
|
---|
| 137 |
|
---|
| 138 | bool loop; //!< Loop. If true repeat the file
|
---|
| 139 | int A_marker;
|
---|
| 140 | int B_marker;
|
---|
| 141 |
|
---|
[176] | 142 | #ifdef BOOKMARKS
|
---|
| 143 | QMap<int, QString> bookmarks;
|
---|
| 144 | #endif
|
---|
| 145 |
|
---|
[188] | 146 | #ifdef MSET_USE_STARTING_TIME
|
---|
[112] | 147 | // This a property of the video and it should be
|
---|
[188] | 148 | // in mediadata, but we have to save it to preserve
|
---|
[112] | 149 | // this data among restarts.
|
---|
| 150 | double starting_time; // Some videos don't start at 0
|
---|
[188] | 151 | #endif
|
---|
[112] | 152 |
|
---|
| 153 | //! The codec of the video is ffh264 and it's high definition
|
---|
| 154 | bool is264andHD;
|
---|
| 155 |
|
---|
[176] | 156 | QString current_demuxer;
|
---|
| 157 |
|
---|
| 158 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
[112] | 159 | // Advanced settings
|
---|
| 160 | QString forced_demuxer;
|
---|
| 161 | QString forced_video_codec;
|
---|
| 162 | QString forced_audio_codec;
|
---|
| 163 |
|
---|
| 164 | // A copy of the original values, so we can restore them.
|
---|
| 165 | QString original_demuxer;
|
---|
| 166 | QString original_video_codec;
|
---|
| 167 | QString original_audio_codec;
|
---|
[176] | 168 | #endif
|
---|
[112] | 169 |
|
---|
| 170 | // Options to mplayer (for this file only)
|
---|
| 171 | QString mplayer_additional_options;
|
---|
| 172 | QString mplayer_additional_video_filters;
|
---|
| 173 | QString mplayer_additional_audio_filters;
|
---|
| 174 |
|
---|
| 175 | // Some things that were before in mediadata
|
---|
| 176 | // They can vary, because of filters, so better here
|
---|
| 177 |
|
---|
[176] | 178 | // Resolution used by mplayer
|
---|
| 179 | // Can be bigger that video resolution
|
---|
| 180 | // because of the aspect ratio or expand filter
|
---|
| 181 | int win_width;
|
---|
| 182 | int win_height;
|
---|
| 183 | double win_aspect();
|
---|
[112] | 184 |
|
---|
| 185 | //! Returns the aspect as a double. Returns 0 if aspect == AspectNone.
|
---|
| 186 | double aspectToNum(Aspect aspect);
|
---|
| 187 | static QString aspectToString(Aspect aspect);
|
---|
| 188 |
|
---|
| 189 | void list();
|
---|
| 190 |
|
---|
[176] | 191 | void save(QSettings * set, int player_id);
|
---|
| 192 | void load(QSettings * set, int player_id);
|
---|
[112] | 193 | };
|
---|
| 194 |
|
---|
| 195 | #endif
|
---|