1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2016 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 | #include "mediasettings.h"
|
---|
20 | #include "preferences.h"
|
---|
21 | #include "global.h"
|
---|
22 | #include <QSettings>
|
---|
23 |
|
---|
24 | using namespace Global;
|
---|
25 |
|
---|
26 | MediaSettings::MediaSettings() {
|
---|
27 | reset();
|
---|
28 | }
|
---|
29 |
|
---|
30 | MediaSettings::~MediaSettings() {
|
---|
31 | }
|
---|
32 |
|
---|
33 | void MediaSettings::reset() {
|
---|
34 | qDebug("MediaSettings::reset");
|
---|
35 |
|
---|
36 | current_sec = 0;
|
---|
37 | //current_sub_id = SubNone;
|
---|
38 | current_sub_id = NoneSelected;
|
---|
39 | #ifdef MPV_SUPPORT
|
---|
40 | current_secondary_sub_id = NoneSelected;
|
---|
41 | #endif
|
---|
42 | #if PROGRAM_SWITCH
|
---|
43 | current_program_id = NoneSelected;
|
---|
44 | #endif
|
---|
45 | current_video_id = NoneSelected;
|
---|
46 | current_audio_id = NoneSelected;
|
---|
47 | current_title_id = NoneSelected;
|
---|
48 | current_angle_id = NoneSelected;
|
---|
49 |
|
---|
50 | aspect_ratio_id = AspectAuto;
|
---|
51 |
|
---|
52 | //fullscreen = false;
|
---|
53 | volume = pref->initial_volume;
|
---|
54 | mute = false;
|
---|
55 | external_subtitles = "";
|
---|
56 | external_subtitles_fps = SFPS_None;
|
---|
57 | external_audio = "";
|
---|
58 | sub_delay=0;
|
---|
59 | audio_delay=0;
|
---|
60 | sub_pos = pref->initial_sub_pos; // 100% by default
|
---|
61 | sub_scale = pref->initial_sub_scale;
|
---|
62 | sub_scale_ass = pref->initial_sub_scale_ass;
|
---|
63 |
|
---|
64 | closed_caption_channel = 0; // disabled
|
---|
65 |
|
---|
66 | brightness = pref->initial_brightness;
|
---|
67 | contrast = pref->initial_contrast;
|
---|
68 | gamma = pref->initial_gamma;
|
---|
69 | hue = pref->initial_hue;
|
---|
70 | saturation = pref->initial_saturation;
|
---|
71 |
|
---|
72 | audio_equalizer = pref->initial_audio_equalizer;
|
---|
73 |
|
---|
74 | speed = 1.0;
|
---|
75 |
|
---|
76 | phase_filter = false;
|
---|
77 | deblock_filter = false;
|
---|
78 | dering_filter = false;
|
---|
79 | gradfun_filter = false;
|
---|
80 | noise_filter = false;
|
---|
81 | postprocessing_filter = pref->initial_postprocessing;
|
---|
82 | upscaling_filter = false;
|
---|
83 | current_denoiser = NoDenoise;
|
---|
84 | current_unsharp = 0;
|
---|
85 |
|
---|
86 | stereo3d_in = "none";
|
---|
87 | stereo3d_out = QString::null;
|
---|
88 |
|
---|
89 | //current_deinterlacer = NoDeinterlace;
|
---|
90 | current_deinterlacer = pref->initial_deinterlace;
|
---|
91 |
|
---|
92 | add_letterbox = false;
|
---|
93 |
|
---|
94 | #ifdef MPLAYER_SUPPORT
|
---|
95 | karaoke_filter = false;
|
---|
96 | #endif
|
---|
97 | extrastereo_filter = false;
|
---|
98 | volnorm_filter = pref->initial_volnorm;
|
---|
99 |
|
---|
100 | audio_use_channels = pref->initial_audio_channels; //ChDefault; // (0)
|
---|
101 | stereo_mode = pref->initial_stereo_mode; //Stereo; // (0)
|
---|
102 |
|
---|
103 | zoom_factor = pref->initial_zoom_factor; // 1.0;
|
---|
104 |
|
---|
105 | starting_time = -1; // Not set yet.
|
---|
106 |
|
---|
107 | rotate = NoRotate;
|
---|
108 | flip = false;
|
---|
109 | mirror = false;
|
---|
110 |
|
---|
111 | loop = false;
|
---|
112 | A_marker = -1;
|
---|
113 | B_marker = -1;
|
---|
114 |
|
---|
115 | #ifdef BOOKMARKS
|
---|
116 | // Initialize bookmarks
|
---|
117 | bookmarks.clear();
|
---|
118 | bookmarks.insert(0, "");
|
---|
119 | #endif
|
---|
120 |
|
---|
121 | is264andHD = false;
|
---|
122 |
|
---|
123 | current_demuxer = "unknown";
|
---|
124 |
|
---|
125 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
126 | forced_demuxer="";
|
---|
127 | if (pref->use_lavf_demuxer) forced_demuxer = "lavf";
|
---|
128 |
|
---|
129 | forced_video_codec="";
|
---|
130 | forced_audio_codec="";
|
---|
131 |
|
---|
132 | original_demuxer="";
|
---|
133 | original_video_codec="";
|
---|
134 | original_audio_codec="";
|
---|
135 | #endif
|
---|
136 |
|
---|
137 | mplayer_additional_options="";
|
---|
138 | mplayer_additional_video_filters="";
|
---|
139 | mplayer_additional_audio_filters="";
|
---|
140 |
|
---|
141 | win_width=400;
|
---|
142 | win_height=300;
|
---|
143 | }
|
---|
144 |
|
---|
145 | double MediaSettings::win_aspect() {
|
---|
146 | return (double) win_width / win_height;
|
---|
147 | }
|
---|
148 |
|
---|
149 | double MediaSettings::aspectToNum(Aspect aspect) {
|
---|
150 | double asp;
|
---|
151 |
|
---|
152 | switch (aspect) {
|
---|
153 | case MediaSettings::AspectNone: asp = 0; break;
|
---|
154 | case MediaSettings::Aspect43: asp = (double) 4 / 3; break;
|
---|
155 | case MediaSettings::Aspect169: asp = (double) 16 / 9; break;
|
---|
156 | case MediaSettings::Aspect149: asp = (double) 14 / 9; break;
|
---|
157 | case MediaSettings::Aspect1610: asp = (double) 16 / 10; break;
|
---|
158 | case MediaSettings::Aspect54: asp = (double) 5 / 4; break;
|
---|
159 | case MediaSettings::Aspect235: asp = 2.35; break;
|
---|
160 | case MediaSettings::Aspect11: asp = 1; break;
|
---|
161 | case MediaSettings::Aspect32: asp = (double) 3 / 2; break;
|
---|
162 | case MediaSettings::Aspect1410: asp = (double) 14 / 10; break;
|
---|
163 | case MediaSettings::Aspect118: asp = (double) 11 / 8; break;
|
---|
164 | case MediaSettings::AspectAuto: asp = win_aspect(); break;
|
---|
165 | default: asp = win_aspect();
|
---|
166 | qWarning("MediaSettings::aspectToNum: invalid aspect: %d", aspect);
|
---|
167 | }
|
---|
168 |
|
---|
169 | return asp;
|
---|
170 | }
|
---|
171 |
|
---|
172 | QString MediaSettings::aspectToString(Aspect aspect) {
|
---|
173 | QString asp_name;
|
---|
174 |
|
---|
175 | switch (aspect) {
|
---|
176 | case MediaSettings::AspectNone: asp_name = QObject::tr("disabled", "aspect_ratio"); break;
|
---|
177 | case MediaSettings::Aspect43: asp_name = "4:3"; break;
|
---|
178 | case MediaSettings::Aspect169: asp_name = "16:9"; break;
|
---|
179 | case MediaSettings::Aspect149: asp_name = "14:9"; break;
|
---|
180 | case MediaSettings::Aspect1610: asp_name = "16:10"; break;
|
---|
181 | case MediaSettings::Aspect54: asp_name = "5:4"; break;
|
---|
182 | case MediaSettings::Aspect235: asp_name = "2.35:1"; break;
|
---|
183 | case MediaSettings::Aspect11: asp_name = "1:1"; break;
|
---|
184 | case MediaSettings::Aspect32: asp_name = "3:2"; break;
|
---|
185 | case MediaSettings::Aspect1410: asp_name = "14:10"; break;
|
---|
186 | case MediaSettings::Aspect118: asp_name = "11:8"; break;
|
---|
187 | case MediaSettings::AspectAuto: asp_name = QObject::tr("auto", "aspect_ratio"); break;
|
---|
188 | default: asp_name = QObject::tr("unknown", "aspect_ratio");
|
---|
189 | }
|
---|
190 |
|
---|
191 | return asp_name;
|
---|
192 | }
|
---|
193 |
|
---|
194 | void MediaSettings::list() {
|
---|
195 | qDebug("MediaSettings::list");
|
---|
196 |
|
---|
197 | qDebug(" current_sec: %f", current_sec);
|
---|
198 | qDebug(" current_sub_id: %d", current_sub_id);
|
---|
199 | #ifdef MPV_SUPPORT
|
---|
200 | qDebug(" current_secondary_sub_id: %d", current_secondary_sub_id);
|
---|
201 | #endif
|
---|
202 | #if PROGRAM_SWITCH
|
---|
203 | qDebug(" current_program_id: %d", current_program_id);
|
---|
204 | #endif
|
---|
205 | qDebug(" current_video_id: %d", current_video_id);
|
---|
206 | qDebug(" current_audio_id: %d", current_audio_id);
|
---|
207 | qDebug(" current_title_id: %d", current_title_id);
|
---|
208 | qDebug(" current_angle_id: %d", current_angle_id);
|
---|
209 |
|
---|
210 | qDebug(" aspect_ratio_id: %d", aspect_ratio_id);
|
---|
211 | //qDebug(" fullscreen: %d", fullscreen);
|
---|
212 | qDebug(" volume: %d", volume);
|
---|
213 | qDebug(" mute: %d", mute);
|
---|
214 | qDebug(" external_subtitles: '%s'", external_subtitles.toUtf8().data());
|
---|
215 | qDebug(" external_subtitles_fps: '%d'", external_subtitles_fps);
|
---|
216 | qDebug(" external_audio: '%s'", external_audio.toUtf8().data());
|
---|
217 | qDebug(" sub_delay: %d", sub_delay);
|
---|
218 | qDebug(" audio_delay: %d", sub_delay);
|
---|
219 | qDebug(" sub_pos: %d", sub_pos);
|
---|
220 | qDebug(" sub_scale: %f", sub_scale);
|
---|
221 | qDebug(" sub_scale_ass: %f", sub_scale_ass);
|
---|
222 |
|
---|
223 | qDebug(" closed_caption_channel: %d", closed_caption_channel);
|
---|
224 |
|
---|
225 | qDebug(" brightness: %d", brightness);
|
---|
226 | qDebug(" contrast: %d", contrast);
|
---|
227 | qDebug(" gamma: %d", gamma);
|
---|
228 | qDebug(" hue: %d", hue);
|
---|
229 | qDebug(" saturation: %d", saturation);
|
---|
230 |
|
---|
231 | qDebug(" speed: %f", speed);
|
---|
232 |
|
---|
233 | qDebug(" phase_filter: %d", phase_filter);
|
---|
234 | qDebug(" deblock_filter: %d", deblock_filter);
|
---|
235 | qDebug(" dering_filter: %d", dering_filter);
|
---|
236 | qDebug(" gradfun_filter: %d", gradfun_filter);
|
---|
237 | qDebug(" noise_filter: %d", noise_filter);
|
---|
238 | qDebug(" postprocessing_filter: %d", postprocessing_filter);
|
---|
239 | qDebug(" upscaling_filter: %d", upscaling_filter);
|
---|
240 | qDebug(" current_denoiser: %d", current_denoiser);
|
---|
241 | qDebug(" current_unsharp: %d", current_unsharp);
|
---|
242 |
|
---|
243 | qDebug(" stereo3d_in: %s", stereo3d_in.toUtf8().constData());
|
---|
244 | qDebug(" stereo3d_out: %s", stereo3d_out.toUtf8().constData());
|
---|
245 |
|
---|
246 | qDebug(" current_deinterlacer: %d", current_deinterlacer);
|
---|
247 |
|
---|
248 | qDebug(" add_letterbox: %d", add_letterbox);
|
---|
249 |
|
---|
250 | #ifdef MPLAYER_SUPPORT
|
---|
251 | qDebug(" karaoke_filter: %d", karaoke_filter);
|
---|
252 | #endif
|
---|
253 | qDebug(" extrastereo_filter: %d", extrastereo_filter);
|
---|
254 | qDebug(" volnorm_filter: %d", volnorm_filter);
|
---|
255 |
|
---|
256 | qDebug(" audio_use_channels: %d", audio_use_channels);
|
---|
257 | qDebug(" stereo_mode: %d", stereo_mode);
|
---|
258 |
|
---|
259 | qDebug(" zoom_factor: %f", zoom_factor);
|
---|
260 |
|
---|
261 | qDebug(" rotate: %d", rotate);
|
---|
262 | qDebug(" flip: %d", flip);
|
---|
263 | qDebug(" mirror: %d", mirror);
|
---|
264 |
|
---|
265 | qDebug(" loop: %d", loop);
|
---|
266 | qDebug(" A_marker: %d", A_marker);
|
---|
267 | qDebug(" B_marker: %d", B_marker);
|
---|
268 |
|
---|
269 | qDebug(" current_demuxer: '%s'", current_demuxer.toUtf8().data());
|
---|
270 |
|
---|
271 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
272 | qDebug(" forced_demuxer: '%s'", forced_demuxer.toUtf8().data());
|
---|
273 | qDebug(" forced_video_codec: '%s'", forced_video_codec.toUtf8().data());
|
---|
274 | qDebug(" forced_audio_codec: '%s'", forced_video_codec.toUtf8().data());
|
---|
275 |
|
---|
276 | qDebug(" original_demuxer: '%s'", original_demuxer.toUtf8().data());
|
---|
277 | qDebug(" original_video_codec: '%s'", original_video_codec.toUtf8().data());
|
---|
278 | qDebug(" original_audio_codec: '%s'", original_video_codec.toUtf8().data());
|
---|
279 | #endif
|
---|
280 |
|
---|
281 | qDebug(" mplayer_additional_options: '%s'", mplayer_additional_options.toUtf8().data());
|
---|
282 | qDebug(" mplayer_additional_video_filters: '%s'", mplayer_additional_video_filters.toUtf8().data());
|
---|
283 | qDebug(" mplayer_additional_audio_filters: '%s'", mplayer_additional_audio_filters.toUtf8().data());
|
---|
284 |
|
---|
285 | qDebug(" win_width: %d", win_width);
|
---|
286 | qDebug(" win_height: %d", win_height);
|
---|
287 | qDebug(" win_aspect(): %f", win_aspect());
|
---|
288 |
|
---|
289 | qDebug(" starting_time: %f", starting_time);
|
---|
290 | qDebug(" is264andHD: %d", is264andHD);
|
---|
291 | }
|
---|
292 |
|
---|
293 | #ifndef NO_USE_INI_FILES
|
---|
294 | void MediaSettings::save(QSettings * set, int player_id) {
|
---|
295 | qDebug("MediaSettings::save");
|
---|
296 |
|
---|
297 | set->beginGroup("player_" + QString::number(player_id));
|
---|
298 |
|
---|
299 | set->setValue( "current_demuxer", current_demuxer);
|
---|
300 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
301 | set->setValue( "forced_demuxer", forced_demuxer);
|
---|
302 | set->setValue( "forced_video_codec", forced_video_codec);
|
---|
303 | set->setValue( "forced_audio_codec", forced_audio_codec);
|
---|
304 | set->setValue( "original_demuxer", original_demuxer);
|
---|
305 | set->setValue( "original_video_codec", original_video_codec);
|
---|
306 | set->setValue( "original_audio_codec", original_audio_codec);
|
---|
307 | #endif
|
---|
308 |
|
---|
309 | // Save the tracks ID in a demuxer section
|
---|
310 | QString demuxer_section = QString("demuxer_%1").arg(current_demuxer);
|
---|
311 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
312 | if (!forced_demuxer.isEmpty()) {
|
---|
313 | demuxer_section = QString("demuxer_%1").arg(forced_demuxer);
|
---|
314 | }
|
---|
315 | #endif
|
---|
316 |
|
---|
317 | set->beginGroup(demuxer_section);
|
---|
318 | set->setValue( "current_sub_id", current_sub_id );
|
---|
319 | #ifdef MPV_SUPPORT
|
---|
320 | set->setValue( "current_secondary_sub_id", current_secondary_sub_id );
|
---|
321 | #endif
|
---|
322 | #if PROGRAM_SWITCH
|
---|
323 | set->setValue( "current_program_id", current_program_id );
|
---|
324 | #endif
|
---|
325 | set->setValue( "current_video_id", current_video_id );
|
---|
326 | set->setValue( "current_audio_id", current_audio_id );
|
---|
327 | set->endGroup();
|
---|
328 |
|
---|
329 | set->endGroup(); // player
|
---|
330 |
|
---|
331 |
|
---|
332 | set->setValue( "current_sec", current_sec );
|
---|
333 |
|
---|
334 | set->setValue( "current_title_id", current_title_id );
|
---|
335 | set->setValue( "current_angle_id", current_angle_id );
|
---|
336 |
|
---|
337 | set->setValue( "aspect_ratio", aspect_ratio_id );
|
---|
338 | //set->setValue( "fullscreen", fullscreen );
|
---|
339 | set->setValue( "volume", volume );
|
---|
340 | set->setValue( "mute", mute );
|
---|
341 | set->setValue( "external_subtitles", external_subtitles );
|
---|
342 | set->setValue( "external_subtitles_fps", external_subtitles_fps );
|
---|
343 | set->setValue( "external_audio", external_audio );
|
---|
344 | set->setValue( "sub_delay", sub_delay);
|
---|
345 | set->setValue( "audio_delay", audio_delay);
|
---|
346 | set->setValue( "sub_pos", sub_pos);
|
---|
347 | set->setValue( "sub_scale", sub_scale);
|
---|
348 | set->setValue( "sub_scale_ass", sub_scale_ass);
|
---|
349 |
|
---|
350 | set->setValue( "closed_caption_channel", closed_caption_channel);
|
---|
351 |
|
---|
352 | set->setValue( "brightness", brightness);
|
---|
353 | set->setValue( "contrast", contrast);
|
---|
354 | set->setValue( "gamma", gamma);
|
---|
355 | set->setValue( "hue", hue);
|
---|
356 | set->setValue( "saturation", saturation);
|
---|
357 |
|
---|
358 | set->setValue("audio_equalizer", audio_equalizer );
|
---|
359 |
|
---|
360 | set->setValue( "speed", speed);
|
---|
361 |
|
---|
362 | set->setValue( "phase_filter", phase_filter);
|
---|
363 | set->setValue( "deblock_filter", deblock_filter);
|
---|
364 | set->setValue( "dering_filter", dering_filter);
|
---|
365 | set->setValue( "gradfun_filter", gradfun_filter);
|
---|
366 | set->setValue( "noise_filter", noise_filter);
|
---|
367 | set->setValue( "postprocessing_filter", postprocessing_filter);
|
---|
368 | set->setValue( "upscaling_filter", upscaling_filter);
|
---|
369 | set->setValue( "current_denoiser", current_denoiser);
|
---|
370 | set->setValue( "current_unsharp", current_unsharp);
|
---|
371 |
|
---|
372 | set->setValue( "stereo3d_in", stereo3d_in);
|
---|
373 | set->setValue( "stereo3d_out", stereo3d_out);
|
---|
374 |
|
---|
375 | set->setValue( "current_deinterlacer", current_deinterlacer);
|
---|
376 |
|
---|
377 | set->setValue( "add_letterbox", add_letterbox );
|
---|
378 |
|
---|
379 | #ifdef MPLAYER_SUPPORT
|
---|
380 | set->setValue( "karaoke_filter", karaoke_filter);
|
---|
381 | #endif
|
---|
382 | set->setValue( "extrastereo_filter", extrastereo_filter);
|
---|
383 | set->setValue( "volnorm_filter", volnorm_filter);
|
---|
384 |
|
---|
385 | set->setValue( "audio_use_channels", audio_use_channels);
|
---|
386 | set->setValue( "stereo_mode", stereo_mode);
|
---|
387 |
|
---|
388 | set->setValue( "zoom_factor", zoom_factor);
|
---|
389 |
|
---|
390 | set->setValue( "rotate", rotate );
|
---|
391 | set->setValue( "flip", flip);
|
---|
392 | set->setValue( "mirror", mirror);
|
---|
393 |
|
---|
394 | set->setValue( "loop", loop);
|
---|
395 | set->setValue( "A_marker", A_marker);
|
---|
396 | set->setValue( "B_marker", B_marker);
|
---|
397 |
|
---|
398 | #ifdef BOOKMARKS
|
---|
399 | // Save bookmarks
|
---|
400 | bool save_bookmarks = true;
|
---|
401 | QMap<int, QString>::const_iterator i = bookmarks.constBegin();
|
---|
402 | if (save_bookmarks) {
|
---|
403 | set->beginWriteArray("bookmarks");
|
---|
404 | int count = 0;
|
---|
405 | while (i != bookmarks.constEnd()) {
|
---|
406 | set->setArrayIndex(count);
|
---|
407 | set->setValue("time", i.key());
|
---|
408 | set->setValue("name", i.value());
|
---|
409 | i++;
|
---|
410 | count++;
|
---|
411 | }
|
---|
412 | set->endArray();
|
---|
413 | }
|
---|
414 | #endif
|
---|
415 |
|
---|
416 | set->setValue( "mplayer_additional_options", mplayer_additional_options);
|
---|
417 | set->setValue( "mplayer_additional_video_filters", mplayer_additional_video_filters);
|
---|
418 | set->setValue( "mplayer_additional_audio_filters", mplayer_additional_audio_filters);
|
---|
419 |
|
---|
420 | set->setValue( "win_width", win_width );
|
---|
421 | set->setValue( "win_height", win_height );
|
---|
422 |
|
---|
423 | set->setValue( "starting_time", starting_time );
|
---|
424 |
|
---|
425 | set->setValue( "is264andHD", is264andHD );
|
---|
426 | }
|
---|
427 |
|
---|
428 | void MediaSettings::load(QSettings * set, int player_id) {
|
---|
429 | qDebug("MediaSettings::load");
|
---|
430 |
|
---|
431 | set->beginGroup("player_" + QString::number(player_id));
|
---|
432 |
|
---|
433 | current_demuxer = set->value( "current_demuxer", current_demuxer).toString();
|
---|
434 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
435 | forced_demuxer = set->value( "forced_demuxer", forced_demuxer).toString();
|
---|
436 | if (pref->use_lavf_demuxer) forced_demuxer = "lavf";
|
---|
437 | forced_video_codec = set->value( "forced_video_codec", forced_video_codec).toString();
|
---|
438 | forced_audio_codec = set->value( "forced_audio_codec", forced_audio_codec).toString();
|
---|
439 | original_demuxer = set->value( "original_demuxer", original_demuxer).toString();
|
---|
440 | original_video_codec = set->value( "original_video_codec", original_video_codec).toString();
|
---|
441 | original_audio_codec = set->value( "original_audio_codec", original_audio_codec).toString();
|
---|
442 | #endif
|
---|
443 |
|
---|
444 | // Load the tracks ID from a demuxer section
|
---|
445 | QString demuxer_section = QString("demuxer_%1").arg(current_demuxer);
|
---|
446 | #if ALLOW_DEMUXER_CODEC_CHANGE
|
---|
447 | if (!forced_demuxer.isEmpty()) {
|
---|
448 | demuxer_section = QString("demuxer_%1").arg(forced_demuxer);
|
---|
449 | }
|
---|
450 | #endif
|
---|
451 | qDebug("MediaSettings::load: demuxer_section: %s", demuxer_section.toUtf8().constData());
|
---|
452 |
|
---|
453 | set->beginGroup(demuxer_section);
|
---|
454 | current_sub_id = set->value( "current_sub_id", NoneSelected ).toInt();
|
---|
455 | #ifdef MPV_SUPPORT
|
---|
456 | current_secondary_sub_id = set->value( "current_secondary_sub_id", NoneSelected ).toInt();
|
---|
457 | #endif
|
---|
458 | #if PROGRAM_SWITCH
|
---|
459 | current_program_id = set->value( "current_program_id", NoneSelected ).toInt();
|
---|
460 | #endif
|
---|
461 | current_video_id = set->value( "current_video_id", NoneSelected ).toInt();
|
---|
462 | current_audio_id = set->value( "current_audio_id", NoneSelected ).toInt();
|
---|
463 | set->endGroup();
|
---|
464 |
|
---|
465 | set->endGroup(); // player
|
---|
466 |
|
---|
467 |
|
---|
468 | current_sec = set->value( "current_sec", current_sec).toDouble();
|
---|
469 |
|
---|
470 | current_title_id = set->value( "current_title_id", current_title_id ).toInt();
|
---|
471 | current_angle_id = set->value( "current_angle_id", current_angle_id ).toInt();
|
---|
472 |
|
---|
473 | aspect_ratio_id = set->value( "aspect_ratio", aspect_ratio_id ).toInt();
|
---|
474 | //fullscreen = set->value( "fullscreen", fullscreen ).toBool();
|
---|
475 | volume = set->value( "volume", volume ).toInt();
|
---|
476 | mute = set->value( "mute", mute ).toBool();
|
---|
477 | external_subtitles = set->value( "external_subtitles", external_subtitles ).toString();
|
---|
478 | external_subtitles_fps = set->value( "external_subtitles_fps", external_subtitles_fps ).toInt();
|
---|
479 | external_audio = set->value( "external_audio", external_audio ).toString();
|
---|
480 | sub_delay = set->value( "sub_delay", sub_delay).toInt();
|
---|
481 | audio_delay = set->value( "audio_delay", audio_delay).toInt();
|
---|
482 | sub_pos = set->value( "sub_pos", sub_pos).toInt();
|
---|
483 | sub_scale = set->value( "sub_scale", sub_scale).toDouble();
|
---|
484 | sub_scale_ass = set->value( "sub_scale_ass", sub_scale_ass).toDouble();
|
---|
485 |
|
---|
486 | closed_caption_channel = set->value( "closed_caption_channel", closed_caption_channel).toInt();
|
---|
487 |
|
---|
488 | brightness = set->value( "brightness", brightness).toInt();
|
---|
489 | contrast = set->value( "contrast", contrast).toInt();
|
---|
490 | gamma = set->value( "gamma", gamma).toInt();
|
---|
491 | hue = set->value( "hue", hue).toInt();
|
---|
492 | saturation = set->value( "saturation", saturation).toInt();
|
---|
493 |
|
---|
494 | audio_equalizer = set->value("audio_equalizer", audio_equalizer ).toList();
|
---|
495 |
|
---|
496 | speed = set->value( "speed", speed ).toDouble();
|
---|
497 |
|
---|
498 | phase_filter = set->value( "phase_filter", phase_filter ).toBool();
|
---|
499 | deblock_filter = set->value( "deblock_filter", deblock_filter).toBool();
|
---|
500 | dering_filter = set->value( "dering_filter", dering_filter).toBool();
|
---|
501 | gradfun_filter = set->value( "gradfun_filter", gradfun_filter).toBool();
|
---|
502 | noise_filter = set->value( "noise_filter", noise_filter).toBool();
|
---|
503 | postprocessing_filter = set->value( "postprocessing_filter", postprocessing_filter).toBool();
|
---|
504 | upscaling_filter = set->value( "upscaling_filter", upscaling_filter).toBool();
|
---|
505 | current_denoiser = set->value( "current_denoiser", current_denoiser).toInt();
|
---|
506 | current_unsharp = set->value( "current_unsharp", current_unsharp).toInt();
|
---|
507 |
|
---|
508 | stereo3d_in = set->value( "stereo3d_in", stereo3d_in).toString();
|
---|
509 | stereo3d_out = set->value( "stereo3d_out", stereo3d_out).toString();
|
---|
510 |
|
---|
511 | current_deinterlacer = set->value( "current_deinterlacer", current_deinterlacer ).toInt();
|
---|
512 |
|
---|
513 | add_letterbox = set->value( "add_letterbox", add_letterbox ).toBool();
|
---|
514 |
|
---|
515 | #ifdef MPLAYER_SUPPORT
|
---|
516 | karaoke_filter = set->value( "karaoke_filter", karaoke_filter).toBool();
|
---|
517 | #endif
|
---|
518 | extrastereo_filter = set->value( "extrastereo_filter", extrastereo_filter).toBool();
|
---|
519 | volnorm_filter = set->value( "volnorm_filter", volnorm_filter).toBool();
|
---|
520 |
|
---|
521 | audio_use_channels = set->value( "audio_use_channels", audio_use_channels).toInt();
|
---|
522 | stereo_mode = set->value( "stereo_mode", stereo_mode).toInt();
|
---|
523 |
|
---|
524 | zoom_factor = set->value( "zoom_factor", zoom_factor).toDouble();
|
---|
525 |
|
---|
526 | rotate = set->value( "rotate", rotate).toInt();
|
---|
527 | flip = set->value( "flip", flip).toBool();
|
---|
528 | mirror = set->value( "mirror", mirror).toBool();
|
---|
529 |
|
---|
530 | loop = set->value( "loop", loop).toBool();
|
---|
531 | A_marker = set->value( "A_marker", A_marker).toInt();
|
---|
532 | B_marker = set->value( "B_marker", B_marker).toInt();
|
---|
533 |
|
---|
534 | #ifdef BOOKMARKS
|
---|
535 | // Load bookmarks
|
---|
536 | int n_bookmarks = set->beginReadArray("bookmarks");
|
---|
537 | if (n_bookmarks > 0) {
|
---|
538 | bookmarks.clear();
|
---|
539 | for (int i = 0; i < n_bookmarks; ++i) {
|
---|
540 | set->setArrayIndex(i);
|
---|
541 | int time = set->value("time").toInt();
|
---|
542 | QString name = set->value("name").toString();
|
---|
543 | bookmarks.insert(time, name);
|
---|
544 | }
|
---|
545 | }
|
---|
546 | set->endArray();
|
---|
547 | #endif
|
---|
548 |
|
---|
549 | mplayer_additional_options = set->value( "mplayer_additional_options", mplayer_additional_options).toString();
|
---|
550 | mplayer_additional_video_filters = set->value( "mplayer_additional_video_filters", mplayer_additional_video_filters).toString();
|
---|
551 | mplayer_additional_audio_filters = set->value( "mplayer_additional_audio_filters", mplayer_additional_audio_filters).toString();
|
---|
552 |
|
---|
553 | win_width = set->value( "win_width", win_width ).toInt();
|
---|
554 | win_height = set->value( "win_height", win_height ).toInt();
|
---|
555 |
|
---|
556 | starting_time = set->value( "starting_time", starting_time ).toDouble();
|
---|
557 |
|
---|
558 | is264andHD = set->value( "is264andHD", is264andHD ).toBool();
|
---|
559 |
|
---|
560 | // ChDefault not used anymore
|
---|
561 | if (audio_use_channels == ChDefault) audio_use_channels = ChStereo;
|
---|
562 | }
|
---|
563 |
|
---|
564 | #endif // NO_USE_INI_FILES
|
---|