Repository navigation
Expand file tree
/
Copy pathsetupmenu.cpp
More file actions
901 lines (821 loc) · 35.6 KB
/
Copy pathsetupmenu.cpp
File metadata and controls
901 lines (821 loc) · 35.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
// SPDX-License-Identifier: AGPL-3.0-or-later
/**
* @file setupmenu.cpp
* Plugin Setup Menu
*
* This file defines cDeviceSetupMenu which describes the
* setup menu and sets the config paramaters.
*
* @copyright 2011, 2015 by Johns. All Rights Reserved.
* @copyright 2018 zille. All Rights Reserved.
* @copyright 2025 - 2026 by Andreas Baierl. All Rights Reserved.
*
* @license{AGPL-3.0-or-later}
*/
#include <string>
#include <vdr/config.h>
#include <vdr/menuitems.h>
#include "audio.h"
#include "codec_audio.h"
#include "config.h"
#include "device.h"
#include "logger.h"
#include "setupmenu.h"
/**
* Passthrough modes of the setup menu
*
* @ingroup menu
*/
enum PassthroughMode {
PASSTHROUGH_OFF, ///< decode all audio
PASSTHROUGH_MANUAL, ///< pass the selected codecs through
PASSTHROUGH_AUTO ///< pass the codecs through, which the sink reports in its ELD
};
/**
* Create a seperator named item
*
* @param label text inside separator
*
* @ingroup menu
*/
static inline cOsdItem *SeparatorName(const char *label)
{
return new cOsdItem(cString::sprintf("%s:", label), osUnknown, false);
}
/**
* Get the name of a section of the setup menu
*
* @param section section (see cDeviceSetupMenu::Section)
*/
const char *cDeviceSetupMenu::SectionName(int section)
{
switch (section) {
case SECTION_GENERAL: return tr("General");
case SECTION_VIDEO: return tr("Video");
case SECTION_AUDIO: return tr("Audio");
case SECTION_AUDIO_EQ: return tr("Audio equalizer");
case SECTION_PIP: return tr("Picture-in-picture");
case SECTION_LOGGING: return tr("Logging");
case SECTION_STATISTICS: return tr("Statistics");
case SECTION_EXPERT: return tr("Expert settings");
default: return "";
}
}
/**
* Show the overview or a section of the setup menu
*
* @param section section to show (SECTION_OVERVIEW: the list of the sections)
*/
void cDeviceSetupMenu::ShowSection(int section)
{
int current = -1; // the first selectable item of a section
if (section == SECTION_OVERVIEW) {
// select the section, which was just closed
for (size_t i = 0; i < m_overviewSections.size(); i++) {
if (m_overviewSections[i] == m_section)
current = i;
}
SetTitle(m_title);
} else {
// the title of the page is set by VDR after the construction (SetPlugin())
if (m_section == SECTION_OVERVIEW)
m_title = Title();
SetTitle(cString::sprintf("%s - %s", *m_title, SectionName(section)));
}
m_section = section;
Create(current);
}
/**
* Get a readable name of a codec for the statistics
*
* @param codec FFmpeg name of the codec (e.g. "eac3")
* @param profile profile of the codec (e.g. "DTS-HD MA" or empty)
* @return e.g. "E-AC-3" or "DTS-HD MA"
*
* @ingroup menu
*/
static std::string CodecLabel(const std::string &codec, const std::string &profile)
{
static const struct { const char *codec; const char *label; } labels[] = {
{ "mpeg2video", "MPEG-2" }, { "h264", "H.264" }, { "hevc", "HEVC" },
{ "ac3", "AC-3" }, { "eac3", "E-AC-3" }, { "dts", "DTS" }, { "truehd", "TrueHD" },
{ "mp2", "MP2" }, { "mp3", "MP3" }, { "aac", "AAC" }, { "aac_latm", "AAC-LATM" },
{ "pcm_dvd", "LPCM" },
};
// the DTS profiles name the format (e.g. "DTS-HD MA")
if (codec == "dts" && !profile.empty())
return profile;
std::string label = codec;
for (const auto &l : labels) {
if (codec == l.codec)
label = l.label;
}
return profile.empty() ? label : label + " (" + profile + ")";
}
/**
* Get the codecs of a passthrough mask for the statistics
*
* @param mask CODEC_* bit mask
* @return e.g. "AC-3 E-AC-3" or "-", if the mask is empty
*
* @ingroup menu
*/
static std::string PassthroughCodecs(int mask)
{
std::string codecs;
if (mask & CODEC_AC3) codecs += " AC-3";
if (mask & CODEC_EAC3) codecs += " E-AC-3";
if (mask & CODEC_DTS) codecs += " DTS";
if (mask & CODEC_DTSHD) codecs += " DTS-HD";
if (mask & CODEC_TRUEHD) codecs += " TrueHD";
return codecs.empty() ? "-" : codecs.substr(1);
}
/**
* Add a statistics item, whose text is updated, while the menu is shown
*
* @param text creates the current text of the item
*/
void cDeviceSetupMenu::AddLiveItem(std::function<cString(void)> text)
{
cOsdItem *item = new cOsdItem(text(), osUnknown, false);
Add(item);
m_liveItems.push_back({ item, std::move(text) });
}
/**
* Update the texts of the statistics items and redraw the menu, if one changed
*
* The whole menu is drawn again, because not every skin draws a single item,
* which is changed with cOsdMenu::DisplayItem().
*/
void cDeviceSetupMenu::UpdateLiveItems(void)
{
bool changed = false;
for (auto &live : m_liveItems) {
cString text = live.text();
if (strcmp(text, live.item->Text())) {
live.item->SetText(text);
changed = true;
}
}
if (changed)
Display();
}
/**
* Add the statistics of the played streams, the display and the audio output
*/
void cDeviceSetupMenu::AddStatistics(void)
{
// video
AddLiveItem([this]() {
if (m_pDevice->IsDetached())
return cString(tr("Device detached"));
sVideoStreamInfo video = m_pConfig->GetVideoStreamInfo();
if (video.codec.empty())
return cString(tr("Video: none"));
return cString::sprintf(tr("Video: %s %dx%d%s, %.2f fps"), CodecLabel(video.codec, "").c_str(),
video.width, video.height, video.interlaced ? "i" : "p", video.frameRate);
});
AddLiveItem([this]() {
return cString::sprintf(tr("Video decoder: %s (%s)"), m_pConfig->CurrentDecoderName, m_pConfig->CurrentDecoderType);
});
AddLiveItem([this]() {
const char *deinterlacer = m_pConfig->GetVideoStreamInfo().deinterlacer;
return cString::sprintf(tr("Deinterlacer: %s"), !strcmp(deinterlacer, "off") ? trVDR("off") : tr(deinterlacer));
});
AddLiveItem([this]() {
return cString::sprintf(tr("Display: %dx%d@%.2f%s, %s"), m_pConfig->CurrentDrmMode.width, m_pConfig->CurrentDrmMode.height,
m_pConfig->CurrentDrmMode.refreshRateHz, m_pConfig->CurrentDrmMode.interlaced ? "i" : "",
m_pConfig->StatHdrActive ? "HDR" : "SDR");
});
AddLiveItem([this]() {
int duped;
int dropped;
int counter;
m_pDevice->GetStats(&duped, &dropped, &counter);
return cString::sprintf(tr("Frames duped(%d) dropped(%d) total(%d)"), duped, dropped, counter);
});
// audio
AddLiveItem([this]() {
sAudioStreamInfo audio = m_pConfig->GetAudioStreamInfo();
if (audio.codec.empty())
return cString(tr("Audio: none"));
std::string codec = CodecLabel(audio.codec, audio.profile);
// the stream format of a bitstream is only known from the mediaplayer
if (!audio.sampleRate || !audio.channels)
return cString::sprintf(tr("Audio: %s"), codec.c_str());
return cString::sprintf(tr("Audio: %s, %d Hz, %d channels"), codec.c_str(), audio.sampleRate, audio.channels);
});
AddLiveItem([this]() {
sAudioStreamInfo audio = m_pConfig->GetAudioStreamInfo();
if (audio.codec.empty())
return cString(tr("Audio output: none"));
return cString::sprintf(audio.passthrough ? tr("Audio output: passthrough, %d Hz, %d channels") : tr("Audio output: PCM, %d Hz, %d channels"),
audio.outputSampleRate, audio.outputChannels);
});
AddLiveItem([this]() {
cAudioStream *audio = m_pDevice->Audio();
return cString::sprintf(tr("Audio device: %s"), audio ? audio->GetDeviceName().c_str() : "-");
});
AddLiveItem([this]() {
cAudioStream *audio = m_pDevice->Audio();
// in automatic mode the codecs of the sink's ELD are passed through
if (audio && m_pDevice->IsPassthroughOn() && m_pConfig->ConfigAudioPassthroughAuto && audio->GetEldPassthroughMask() >= 0)
return cString::sprintf(" %s (%s)", *m_pDevice->PassthroughString(), PassthroughCodecs(audio->GetEldPassthroughMask()).c_str());
return cString::sprintf(" %s", *m_pDevice->PassthroughString());
});
// osd
#ifdef USE_GLES
Add(new cOsdItem(cString::sprintf(tr("OSD: Using %s rendering"), m_pConfig->ConfigDisableOglOsd ? "software" : "hardware"), osUnknown, false));
#else
Add(new cOsdItem(cString::sprintf(tr("OSD: Using software rendering")), osUnknown, false));
#endif
}
/**
* Build setup menu
*/
void cDeviceSetupMenu::Create(int current)
{
if (current == KEEP_CURRENT)
current = Current(); // get current menu item index
Clear(); // clear the menu
m_liveItems.clear();
//
// Overview: OK opens the section under the cursor
//
SetHasHotkeys(m_section == SECTION_OVERVIEW);
if (m_section == SECTION_OVERVIEW) {
m_overviewSections.clear();
for (int section = 0; section < SECTION_COUNT; section++) {
if (section == SECTION_PIP && !m_pDevice->UsePip())
continue;
Add(new cOsdItem(hk(SectionName(section))));
m_overviewSections.push_back(section);
}
}
//
// General
//
if (m_section == SECTION_GENERAL) {
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &m_cHideMainMenuEntry, trVDR("no"), trVDR("yes")));
}
//
// Video
//
if (m_section == SECTION_VIDEO) {
Add(new cMenuEditBoolItem(tr("Enable HDR"), &m_cVideoEnableHDR, trVDR("no"), trVDR("yes")));
Add(new cMenuEditStraItem(tr("Display mode"), &m_cVideoDisplayMode, m_displayModePtrs.size(), m_displayModePtrs.data()));
Add(new cMenuEditStraItem(tr("Enable fast channel switch"), &m_cVideoChannelSwitchMode, m_channelSwitchModePtrs.size(), m_channelSwitchModePtrs.data()));
for (int i = 0; i < cDeviceConfig::ZOOM_LEVELS; i++)
Add(new cMenuEditIntItem(cString::sprintf(tr("Zoom level %d (/1000)"), i + 1), &m_cZoomLevel[i], 0, cDeviceConfig::ZOOM_MAX, trVDR("off")));
}
//
// Audio
//
if (m_section == SECTION_AUDIO) {
Add(new cMenuEditBoolItem(tr("Volume control"), &m_cAudioSoftvol, tr("hardware"), tr("software")));
Add(new cMenuEditBoolItem(tr("Enable stereo downmix"), &m_cAudioDownmix, trVDR("no"), trVDR("yes")));
Add(new cMenuEditStraItem(tr("Passthrough"), &m_cAudioPassthroughMode, 3, m_passthroughModes));
if (m_cAudioPassthroughMode == PASSTHROUGH_MANUAL) {
Add(new cMenuEditBoolItem(tr(" AC-3 passthrough"), &m_cAudioPassthroughAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" E-AC-3 passthrough"), &m_cAudioPassthroughEAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" DTS passthrough"), &m_cAudioPassthroughDTS, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" DTS-HD passthrough"), &m_cAudioPassthroughDTSHD, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" TrueHD passthrough"), &m_cAudioPassthroughTrueHD, trVDR("no"), trVDR("yes")));
}
if (m_cAudioPassthroughMode != PASSTHROUGH_OFF)
Add(new cMenuEditBoolItem(tr(" Disable automatic AES"), &m_cAudioDisableAutoAES, trVDR("no"), trVDR("yes")));
Add(new cMenuEditIntItem(tr("Audio/Video delay (ms)"), &m_cAudioDelay, -1000, 1000));
Add(new cMenuEditBoolItem(tr("Enable normalize volume"), &m_cAudioNormalize, trVDR("no"), trVDR("yes")));
if (m_cAudioNormalize)
Add(new cMenuEditIntItem(tr(" Max normalize factor (/1000)"), &m_cAudioMaxNormalize, 0, 10000));
Add(new cMenuEditBoolItem(tr("Enable volume compression"), &m_cAudioCompression, trVDR("no"), trVDR("yes")));
if (m_cAudioCompression)
Add(new cMenuEditIntItem(tr(" Max compression factor (/1000)"), &m_cAudioMaxCompression, 0, 10000));
Add(new cMenuEditIntItem(tr("Reduce stereo volume (/1000)"), &m_cAudioStereoDescent, 0, 1000));
}
//
// Audio filter
//
if (m_section == SECTION_AUDIO_EQ) {
Add(new cMenuEditBoolItem(tr("Enable audio equalizer"), &m_cAudioEq, trVDR("no"), trVDR("yes")));
if (m_cAudioEq) {
Add(new cMenuEditIntItem(tr(" 60 Hz band gain"), &m_cAudioEqBand[0], -15, 1));
Add(new cMenuEditIntItem(tr(" 72 Hz band gain"), &m_cAudioEqBand[1], -15, 1));
Add(new cMenuEditIntItem(tr(" 107 Hz band gain"), &m_cAudioEqBand[2], -15, 1));
Add(new cMenuEditIntItem(tr(" 150 Hz band gain"), &m_cAudioEqBand[3], -15, 1));
Add(new cMenuEditIntItem(tr(" 220 Hz band gain"), &m_cAudioEqBand[4], -15, 1));
Add(new cMenuEditIntItem(tr(" 310 Hz band gain"), &m_cAudioEqBand[5], -15, 1));
Add(new cMenuEditIntItem(tr(" 430 Hz band gain"), &m_cAudioEqBand[6], -15, 1));
Add(new cMenuEditIntItem(tr(" 620 Hz band gain"), &m_cAudioEqBand[7], -15, 1));
Add(new cMenuEditIntItem(tr(" 860 Hz band gain"), &m_cAudioEqBand[8], -15, 1));
Add(new cMenuEditIntItem(tr(" 1200 Hz band gain"), &m_cAudioEqBand[9], -15, 1));
Add(new cMenuEditIntItem(tr(" 1700 Hz band gain"), &m_cAudioEqBand[10], -15, 1));
Add(new cMenuEditIntItem(tr(" 2500 Hz band gain"), &m_cAudioEqBand[11], -15, 1));
Add(new cMenuEditIntItem(tr(" 3500 Hz band gain"), &m_cAudioEqBand[12], -15, 1));
Add(new cMenuEditIntItem(tr(" 4800 Hz band gain"), &m_cAudioEqBand[13], -15, 1));
Add(new cMenuEditIntItem(tr(" 7000 Hz band gain"), &m_cAudioEqBand[14], -15, 1));
Add(new cMenuEditIntItem(tr(" 9500 Hz band gain"), &m_cAudioEqBand[15], -15, 1));
Add(new cMenuEditIntItem(tr(" 13500 Hz band gain"), &m_cAudioEqBand[16], -15, 1));
Add(new cMenuEditIntItem(tr(" 17200 Hz band gain"), &m_cAudioEqBand[17], -15, 1));
}
}
//
// PiP
//
if (m_section == SECTION_PIP && m_pDevice->UsePip()) {
Add(new cMenuEditIntItem(tr("Video scaling factor (%)"), &m_cPipScalePercent, 10, 100));
Add(new cMenuEditIntItem(tr("Video left (%)"), &m_cPipLeftPercent, 0, 100));
Add(new cMenuEditIntItem(tr("Video top (%)"), &m_cPipTopPercent, 0, 100));
Add(new cMenuEditBoolItem(tr("Use alternative position as default"), &m_cPipUseAlt, trVDR("no"), trVDR("yes")));
Add(new cMenuEditIntItem(tr("Alternative video scaling factor (%)"), &m_cPipAltScalePercent, 10, 100));
Add(new cMenuEditIntItem(tr("Alternative video left (%)"), &m_cPipAltLeftPercent, 0, 100));
Add(new cMenuEditIntItem(tr("Alternative video top (%)"), &m_cPipAltTopPercent, 0, 100));
}
//
// Logging
//
if (m_section == SECTION_LOGGING) {
Add(new cMenuEditBoolItem(tr("Enable logging"), &m_cLogDefault, trVDR("off"), trVDR("on")));
if (m_cLogDefault) {
Add(new cMenuEditBoolItem(tr(" Standard debug logs"), &m_cLogDebug_, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" DRM debug logs"), &m_cLogDRM, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Codec debug logs"), &m_cLogCodec, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" AV Sync debug logs"), &m_cLogAVSync, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Sound debug logs"), &m_cLogSound, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" FFmpeg debug logs"), &m_cLogFFmpeg, trVDR("no"), trVDR("yes")));
if (m_cLogFFmpeg)
Add(new cMenuEditStraItem(tr(" FFmpeg log level"), &m_cLogFFmpegLevel, FFMPEG_LOG_LEVELS, m_ffmpegLogLevels));
Add(new cMenuEditBoolItem(tr(" Packet tracking logs"), &m_cLogPacket, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" OSD debug logs"), &m_cLogOSD, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Grabbing debug logs"), &m_cLogGrab, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Stillpicture debug logs"), &m_cLogStill, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Trickspeed debug logs"), &m_cLogTrick, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" Mediaplayer debug logs"), &m_cLogMedia, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" OpenGL OSD debug logs"), &m_cLogGL, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" OpenGL OSD time measurement"), &m_cLogGLTime, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" OpenGL OSD time measurement (extensive)"), &m_cLogGLTimeAll, trVDR("no"), trVDR("yes")));
}
}
//
// Statistics
//
if (m_section == SECTION_STATISTICS)
AddStatistics();
//
// Expert settings
//
if (m_section == SECTION_EXPERT) {
Add(SeparatorName(tr("Audio settings")));
Add(new cMenuEditIntItem(tr("Adjust a/v buffer size (ms)"), &m_cAdditionalBufferLengthMs, - (m_pDevice->GetMinBufferFillLevelThresholdMs() - 100), 1000));
AddLiveItem([this]() {
return cString::sprintf(tr(" Current a/v buffer size: %dms"), m_pDevice->GetMinBufferFillLevelThresholdMs() + m_cAdditionalBufferLengthMs);
});
AddLiveItem([this]() {
return cString::sprintf(tr(" Audio jitter: %dms, max: %dms"), m_pConfig->StatMaxShortTermAudioJitterMs.load(), m_pConfig->StatMaxLongTermAudioJitterMs.load());
});
AddLiveItem([this]() {
return cString::sprintf(tr(" Video jitter: %dms, max: %dms"), m_pConfig->StatMaxShortTermVideoJitterMs.load(), m_pConfig->StatMaxLongTermVideoJitterMs.load());
});
Add(SeparatorName(tr("Video settings")));
Add(new cMenuEditBoolItem(tr("Disable deinterlacer"), &m_cDisableDeint, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Enable SW decoder fallback"), &m_cDecoderFallbackToSw, trVDR("no"), trVDR("yes")));
if (m_cDecoderFallbackToSw) {
Add(new cOsdItem(cString::sprintf(tr(" (minimum: %d)"), m_pConfig->GetDecoderNeedsMaxPackets() + 1), osUnknown, false));
Add(new cMenuEditIntItem(tr(" fallback after num packets"), &m_cDecoderFallbackToSwNumPkts, 22));
}
Add(new cMenuEditIntItem(tr("H.264: Parse stream until num I-Frames"), &m_cParseH264StreamStart, 0, 20));
Add(new cMenuEditIntItem(tr("H.264: Drop invalid P-Frames until num I-Frames"), &m_cDropInvalidH264PFrames, 0, 20));
#ifdef USE_GLES
Add(SeparatorName(tr("OSD settings")));
if (!m_pConfig->ConfigDisableOglOsd) {
Add(new cMenuEditIntItem(tr("GPU mem used for image caching (MB)"), &m_cMaxSizeGPUImageCache, 0, 4000));
}
#endif
Add(SeparatorName(tr("Misc settings")));
Add(new cMenuEditBoolItem(tr("Show channel switch duration"), &m_cShowChannelSwitchDurationMessage, trVDR("no"), trVDR("yes")));
}
SetCurrent(Get(current)); // restore selected menu entry
Display(); // display build menu
}
/**
* Process key for setup menu.
*
* The overview lists the sections, OK opens the section under the cursor.
* In a section, OK stores the settings and Back discards the changes, both
* return to the overview. Back in the overview closes the setup menu.
*
* OK returns OK_HANDLED instead of osContinue: VDR's plugin setup menu
* (cMenuSetupPlugins) stores the setup with OK and osContinue, calls
* cOsdProvider::UpdateOsdSize(true) and so the skin closes and opens the OSD
* again (it flickers). The setup is saved here instead.
*
* @param key pressed key
*/
eOSState cDeviceSetupMenu::ProcessKey(eKeys key)
{
int old_cAudioPassthroughMode = m_cAudioPassthroughMode;
int old_cAudioNormalize = m_cAudioNormalize;
int old_cAudioCompression = m_cAudioCompression;
int old_cAudioEq = m_cAudioEq;
int old_cLogDefault = m_cLogDefault;
int old_cLogFFmpeg = m_cLogFFmpeg;
int old_cDecoderFallbackToSw = m_cDecoderFallbackToSw;
if (m_section == SECTION_OVERVIEW) {
// cMenuSetupPage would store the settings and close the menu with OK
if (key == kOk) {
int current = Current();
if (current >= 0 && current < (int)m_overviewSections.size())
ShowSection(m_overviewSections[current]);
return OK_HANDLED;
}
return cMenuSetupPage::ProcessKey(key);
}
// let an edited item handle the key first (e.g. OK in a string item)
eOSState state = cOsdMenu::ProcessKey(key);
if (state == osUnknown && key == kOk) {
if (m_section != SECTION_STATISTICS) { // nothing to store
Store();
Setup.Save();
}
ShowSection(SECTION_OVERVIEW);
return OK_HANDLED;
}
// OK of an edited item (e.g. the end of a string input)
if (state == osContinue && key == kOk)
state = OK_HANDLED;
if (state == osBack) {
// discard the changes of the section
LoadValues();
ShowSection(SECTION_OVERVIEW);
return osContinue;
}
// update the statistics, while the menu is shown
if (key == kNone && !HasSubMenu() && !m_liveItems.empty() && m_liveUpdateTimer.TimedOut()) {
UpdateLiveItems();
m_liveUpdateTimer.Set(LIVE_UPDATE_INTERVAL_MS);
}
if (key != kNone) {
// update menu only, if something on the structure has changed
// this is needed because VDR menus are evil slow
if (old_cAudioPassthroughMode != m_cAudioPassthroughMode ||
old_cAudioNormalize != m_cAudioNormalize ||
old_cAudioCompression != m_cAudioCompression ||
old_cAudioEq != m_cAudioEq ||
old_cLogDefault != m_cLogDefault ||
old_cLogFFmpeg != m_cLogFFmpeg ||
old_cDecoderFallbackToSw != m_cDecoderFallbackToSw) {
Create(); // update menu
}
}
return state;
}
/**
* Init the setup menu and build the overview
*/
cDeviceSetupMenu::cDeviceSetupMenu(cOutputDevice *device)
: m_pDevice(device),
m_pConfig(m_pDevice->Config())
{
BuildDisplayModeList();
BuildChannelSwitchModeList();
m_passthroughModes[PASSTHROUGH_OFF] = trVDR("off");
m_passthroughModes[PASSTHROUGH_MANUAL] = tr("manual");
m_passthroughModes[PASSTHROUGH_AUTO] = tr("automatic");
LoadValues();
Create();
}
/**
* Copy the setup values of the config into the menu
*
* Also used to discard the changes of a section.
*/
void cDeviceSetupMenu::LoadValues(void)
{
//
// General
//
m_cHideMainMenuEntry = m_pConfig->ConfigHideMainMenuEntry;
//
// Video
//
m_cVideoEnableHDR = m_pConfig->ConfigVideoEnableHDR;
m_cVideoDisplayMode = m_pConfig->ConfigVideoDisplayMode;
m_cVideoChannelSwitchMode = m_pConfig->ConfigVideoChannelSwitchMode;
for (int i = 0; i < cDeviceConfig::ZOOM_LEVELS; i++)
m_cZoomLevel[i] = m_pConfig->ConfigZoomLevel[i];
//
// Audio
//
m_cAudioSoftvol = m_pConfig->ConfigAudioSoftvol;
m_cAudioDownmix = m_pConfig->ConfigAudioDownmix;
m_cAudioPassthroughMode = !m_pConfig->ConfigAudioPassthroughState ? PASSTHROUGH_OFF :
m_pConfig->ConfigAudioPassthroughAuto ? PASSTHROUGH_AUTO : PASSTHROUGH_MANUAL;
m_cAudioPassthroughAC3 = m_pConfig->ConfigAudioPassthroughMask & CODEC_AC3;
m_cAudioPassthroughEAC3 = m_pConfig->ConfigAudioPassthroughMask & CODEC_EAC3;
m_cAudioPassthroughDTS = m_pConfig->ConfigAudioPassthroughMask & CODEC_DTS;
m_cAudioPassthroughTrueHD = m_pConfig->ConfigAudioPassthroughMask & CODEC_TRUEHD;
m_cAudioPassthroughDTSHD = m_pConfig->ConfigAudioPassthroughMask & CODEC_DTSHD;
m_cAudioDisableAutoAES = m_pConfig->ConfigAudioDisableAutoAES;
m_cAudioDelay = m_pConfig->ConfigVideoAudioDelayMs;
m_cAudioNormalize = m_pConfig->ConfigAudioNormalize;
m_cAudioMaxNormalize = m_pConfig->ConfigAudioMaxNormalize;
m_cAudioCompression = m_pConfig->ConfigAudioCompression;
m_cAudioMaxCompression = m_pConfig->ConfigAudioMaxCompression;
m_cAudioStereoDescent = m_pConfig->ConfigAudioStereoDescent;
//
// Audio equalizer
//
m_cAudioEq = m_pConfig->ConfigAudioEq;
for (int i = 0; i < 18; i++) {
m_cAudioEqBand[i] = m_pConfig->ConfigAudioEqBand[i];
}
//
// Picture-in-picture
//
m_cPipScalePercent = m_pConfig->ConfigPipScalePercent;
m_cPipLeftPercent = m_pConfig->ConfigPipLeftPercent;
m_cPipTopPercent = m_pConfig->ConfigPipTopPercent;
m_cPipUseAlt = m_pConfig->ConfigPipUseAlt;
m_cPipAltScalePercent = m_pConfig->ConfigPipAltScalePercent;
m_cPipAltLeftPercent = m_pConfig->ConfigPipAltLeftPercent;
m_cPipAltTopPercent = m_pConfig->ConfigPipAltTopPercent;
//
// Logging
//
m_cLogDefault = m_pConfig->ConfigLogState;
m_cLogDebug_ = m_pConfig->ConfigLogLevels & L_DEBUG;
m_cLogDRM = m_pConfig->ConfigLogLevels & L_DRM;
m_cLogCodec = m_pConfig->ConfigLogLevels & L_CODEC;
m_cLogAVSync = m_pConfig->ConfigLogLevels & L_AV_SYNC;
m_cLogSound = m_pConfig->ConfigLogLevels & L_SOUND;
m_cLogFFmpeg = m_pConfig->ConfigLogLevels & L_FFMPEG;
m_cLogFFmpegLevel = m_pConfig->ConfigLogFFmpegLevel;
m_cLogPacket = m_pConfig->ConfigLogLevels & L_PACKET;
m_cLogOSD = m_pConfig->ConfigLogLevels & L_OSD;
m_cLogGrab = m_pConfig->ConfigLogLevels & L_GRAB;
m_cLogStill = m_pConfig->ConfigLogLevels & L_STILL;
m_cLogTrick = m_pConfig->ConfigLogLevels & L_TRICK;
m_cLogMedia = m_pConfig->ConfigLogLevels & L_MEDIA;
m_cLogGL = m_pConfig->ConfigLogLevels & L_OPENGL;
m_cLogGLTime = m_pConfig->ConfigLogLevels & L_OPENGL_TIME;
m_cLogGLTimeAll = m_pConfig->ConfigLogLevels & L_OPENGL_TIME_ALL;
//
// Expert settings
//
m_cAdditionalBufferLengthMs= m_pConfig->ConfigAdditionalBufferLengthMs;
m_cDisableDeint = m_pConfig->ConfigDisableDeint;
m_cDecoderFallbackToSw = m_pConfig->ConfigDecoderFallbackToSw;
m_cDecoderFallbackToSwNumPkts = m_pConfig->ConfigDecoderFallbackToSwNumPkts;
m_cParseH264StreamStart = m_pConfig->ConfigParseH264StreamStart;
m_cDropInvalidH264PFrames = m_pConfig->ConfigDropInvalidH264PFrames;
#ifdef USE_GLES
m_cMaxSizeGPUImageCache = m_pConfig->ConfigMaxSizeGPUImageCache;
#endif
m_cShowChannelSwitchDurationMessage = m_pConfig->ConfigShowChannelSwitchDurationMessage;
}
void cDeviceSetupMenu::BuildDisplayModeList(void)
{
m_displayMode.clear();
// CONFIG_DISPLAY_MODE_DEFAULT = 0
m_displayMode.push_back(*cString::sprintf(tr("default %dx%d@%.2f%s"),
m_pConfig->AutoDetectedDrmMode.width,
m_pConfig->AutoDetectedDrmMode.height,
m_pConfig->AutoDetectedDrmMode.refreshRateHz,
m_pConfig->AutoDetectedDrmMode.interlaced ? "i" : ""));
// CONFIG_DISPLAY_MODE_FOLLOW_VIDEO = 1
if (m_pConfig->ConfigVideoDisplayMode == CONFIG_DISPLAY_MODE_FOLLOW_VIDEO)
m_displayMode.push_back(*cString::sprintf(tr("match video %dx%d@%.2f%s"),
m_pConfig->CurrentDrmMode.width,
m_pConfig->CurrentDrmMode.height,
m_pConfig->CurrentDrmMode.refreshRateHz,
m_pConfig->CurrentDrmMode.interlaced ? "i" : ""));
else
m_displayMode.push_back(tr("match video"));
// CONFIG_DISPLAY_MODE_FOLLOW_VIDEO_INTERLACED = 2
if (m_pConfig->ConfigVideoDisplayMode == CONFIG_DISPLAY_MODE_FOLLOW_VIDEO_INTERLACED)
m_displayMode.push_back(*cString::sprintf(tr("match video (interlaced) %dx%d@%.2f%s"),
m_pConfig->CurrentDrmMode.width,
m_pConfig->CurrentDrmMode.height,
m_pConfig->CurrentDrmMode.refreshRateHz,
m_pConfig->CurrentDrmMode.interlaced ? "i" : ""));
else
m_displayMode.push_back(tr("match video (interlaced)"));
// CONFIG_DISPLAY_MODE_MANUAL = 3
for (size_t i = CONFIG_DISPLAY_MODE_MANUAL; i < m_pConfig->CollectedDrmModes.size() + CONFIG_DISPLAY_MODE_MANUAL; i++) {
m_displayMode.push_back(*cString::sprintf("%dx%d@%.2f%s",
m_pConfig->CollectedDrmModes[i - CONFIG_DISPLAY_MODE_MANUAL].width,
m_pConfig->CollectedDrmModes[i - CONFIG_DISPLAY_MODE_MANUAL].height,
m_pConfig->CollectedDrmModes[i - CONFIG_DISPLAY_MODE_MANUAL].refreshRateHz,
m_pConfig->CollectedDrmModes[i - CONFIG_DISPLAY_MODE_MANUAL].interlaced ? "i" : ""));
}
m_displayModePtrs.clear();
for (auto &s : m_displayMode)
m_displayModePtrs.push_back(s.c_str());
}
void cDeviceSetupMenu::BuildChannelSwitchModeList(void)
{
m_channelSwitchMode.clear();
m_channelSwitchMode.push_back(trVDR("off"));
m_channelSwitchMode.push_back(tr("video"));
m_channelSwitchMode.push_back(tr("video and audio"));
for (auto &s : m_channelSwitchMode)
m_channelSwitchModePtrs.push_back(s.c_str());
}
/**
* Store a setup value, if it changed
*
* @param name name of the setup value
* @param config the value in the config, it gets the new value
* @param value the new value
*
* @return true, if the value changed
*/
bool cDeviceSetupMenu::StoreChanged(const char *name, int &config, int value)
{
if (config == value)
return false;
SetupStore(name, config = value);
return true;
}
/**
* Store a setup flag, if it changed
*
* @param name name of the setup value
* @param config the flag in the config, it gets the new value
* @param value the new value (0: false)
*
* @return true, if the flag changed
*/
bool cDeviceSetupMenu::StoreChanged(const char *name, bool &config, int value)
{
if (config == (value != 0))
return false;
config = value != 0;
SetupStore(name, config);
return true;
}
/**
* Store settings
*
* Only the changed values are stored and applied.
*/
void cDeviceSetupMenu::Store(void)
{
//
// General
//
StoreChanged("HideMainMenuEntry", m_pConfig->ConfigHideMainMenuEntry, m_cHideMainMenuEntry);
//
// Video
//
bool hdrChanged = StoreChanged("VideoEnableHDR", m_pConfig->ConfigVideoEnableHDR, m_cVideoEnableHDR);
bool displayModeChanged = m_pConfig->ConfigVideoDisplayMode != m_cVideoDisplayMode;
if (displayModeChanged) {
m_pConfig->ConfigVideoDisplayMode = m_cVideoDisplayMode;
// only save default and auto adjusted modes
if (m_pConfig->ConfigVideoDisplayMode < CONFIG_DISPLAY_MODE_MANUAL)
SetupStore("VideoDisplayMode", m_cVideoDisplayMode);
}
if (StoreChanged("VideoChannelSwitchMode", m_pConfig->ConfigVideoChannelSwitchMode, m_cVideoChannelSwitchMode))
m_pDevice->SetChannelSwitchMode(static_cast<ChannelSwitchMode>(m_pConfig->ConfigVideoChannelSwitchMode));
bool zoomChanged = false;
for (int i = 0; i < cDeviceConfig::ZOOM_LEVELS; i++)
zoomChanged |= StoreChanged(cString::sprintf("ZoomLevel%d", i + 1), m_pConfig->ConfigZoomLevel[i], m_cZoomLevel[i]);
// a disabled zoom level can't stay active
if (zoomChanged && m_pDevice->GetZoomLevel() && !m_pDevice->GetZoom())
m_pDevice->SetZoomLevel(0);
//
// Audio
//
bool softvolChanged = StoreChanged("AudioSoftvol", m_pConfig->ConfigAudioSoftvol, m_cAudioSoftvol);
// a changed downmix resets the audio, so it is applied at once
bool downmixChanged = StoreChanged("AudioDownmix", m_pConfig->ConfigAudioDownmix, m_cAudioDownmix);
if (downmixChanged)
m_pDevice->ResetChannelId();
int passthroughMask = (m_cAudioPassthroughAC3 ? CODEC_AC3 : 0)
| (m_cAudioPassthroughEAC3 ? CODEC_EAC3 : 0)
| (m_cAudioPassthroughDTS ? CODEC_DTS : 0)
| (m_cAudioPassthroughTrueHD ? CODEC_TRUEHD : 0)
| (m_cAudioPassthroughDTSHD ? CODEC_DTSHD : 0);
bool passthroughState = m_cAudioPassthroughMode != PASSTHROUGH_OFF;
// switching the passthrough off keeps the automatic mode for the passthrough toggle
bool passthroughAuto = passthroughState ? m_cAudioPassthroughMode == PASSTHROUGH_AUTO : m_pConfig->ConfigAudioPassthroughAuto;
if (m_pConfig->ConfigAudioPassthroughMask != passthroughMask ||
m_pConfig->ConfigAudioPassthroughState != passthroughState ||
m_pConfig->ConfigAudioPassthroughAuto != passthroughAuto) {
m_pConfig->ConfigAudioPassthroughMask = passthroughMask;
m_pConfig->ConfigAudioPassthroughState = passthroughState;
m_pConfig->ConfigAudioPassthroughAuto = passthroughAuto;
// the automatic mode is stored as an additional bit, the sign is the on/off state
int passthrough = passthroughMask | (passthroughAuto ? CODEC_PASSTHROUGH_AUTO : 0);
SetupStore("AudioPassthrough", passthroughState ? passthrough : -passthrough);
m_pDevice->SetPassthroughOn(passthroughState);
}
bool autoAesChanged = StoreChanged("AudioDisableAutoAES", m_pConfig->ConfigAudioDisableAutoAES, m_cAudioDisableAutoAES);
StoreChanged("AudioDelay", m_pConfig->ConfigVideoAudioDelayMs, m_cAudioDelay);
bool normalizeChanged = StoreChanged("AudioNormalize", m_pConfig->ConfigAudioNormalize, m_cAudioNormalize);
normalizeChanged |= StoreChanged("AudioMaxNormalize", m_pConfig->ConfigAudioMaxNormalize, m_cAudioMaxNormalize);
bool compressionChanged = StoreChanged("AudioCompression", m_pConfig->ConfigAudioCompression, m_cAudioCompression);
compressionChanged |= StoreChanged("AudioMaxCompression", m_pConfig->ConfigAudioMaxCompression, m_cAudioMaxCompression);
bool stereoDescentChanged = StoreChanged("AudioStereoDescent", m_pConfig->ConfigAudioStereoDescent, m_cAudioStereoDescent);
//
// Audio equalizer
//
bool equalizerChanged = StoreChanged("AudioEq", m_pConfig->ConfigAudioEq, m_cAudioEq);
for (int i = 0; i < 18; i++)
equalizerChanged |= StoreChanged(cString::sprintf("AudioEqBand%02db", i + 1), m_pConfig->ConfigAudioEqBand[i], m_cAudioEqBand[i]);
//
// Picture-in-picture
//
bool pipChanged = StoreChanged("PipScalePercent", m_pConfig->ConfigPipScalePercent, m_cPipScalePercent);
pipChanged |= StoreChanged("PipLeftPercent", m_pConfig->ConfigPipLeftPercent, m_cPipLeftPercent);
pipChanged |= StoreChanged("PipTopPercent", m_pConfig->ConfigPipTopPercent, m_cPipTopPercent);
pipChanged |= StoreChanged("PipUseAlt", m_pConfig->ConfigPipUseAlt, m_cPipUseAlt);
pipChanged |= StoreChanged("PipAltScalePercent", m_pConfig->ConfigPipAltScalePercent, m_cPipAltScalePercent);
pipChanged |= StoreChanged("PipAltLeftPercent", m_pConfig->ConfigPipAltLeftPercent, m_cPipAltLeftPercent);
pipChanged |= StoreChanged("PipAltTopPercent", m_pConfig->ConfigPipAltTopPercent, m_cPipAltTopPercent);
if (m_pDevice->UsePip() && pipChanged)
m_pDevice->PipSetSize();
//
// Logging
//
int logLevels =
(m_cLogDebug_ ? L_DEBUG : 0) |
(m_cLogDRM ? L_DRM : 0) |
(m_cLogCodec ? L_CODEC : 0) |
(m_cLogAVSync ? L_AV_SYNC : 0) |
(m_cLogSound ? L_SOUND : 0) |
(m_cLogFFmpeg ? L_FFMPEG : 0) |
(m_cLogPacket ? L_PACKET : 0) |
(m_cLogOSD ? L_OSD : 0) |
(m_cLogGrab ? L_GRAB : 0) |
(m_cLogStill ? L_STILL : 0) |
(m_cLogTrick ? L_TRICK : 0) |
(m_cLogMedia ? L_MEDIA : 0) |
(m_cLogGL ? L_OPENGL : 0) |
(m_cLogGLTime ? L_OPENGL_TIME : 0) |
(m_cLogGLTimeAll ? L_OPENGL_TIME_ALL : 0);
if (StoreChanged("LogFFmpegLevel", m_pConfig->ConfigLogFFmpegLevel, m_cLogFFmpegLevel))
LOGGER->SetFFmpegLogLevel(cDeviceConfig::FFmpegLogLevel(m_pConfig->ConfigLogFFmpegLevel));
if (m_pConfig->ConfigLogLevels != logLevels || m_pConfig->ConfigLogState != m_cLogDefault) {
m_pConfig->ConfigLogLevels = logLevels;
m_pConfig->ConfigLogState = m_cLogDefault;
// the sign is the on/off state
if (m_pConfig->ConfigLogState) {
SetupStore("LogLevel", m_pConfig->ConfigLogLevels);
if (LOGGER->GetLogLevel() != m_pConfig->ConfigLogLevels) {
m_pConfig->PrintLogLevel(m_pConfig->ConfigLogLevels);
LOGGER->SetLogLevel(m_pConfig->ConfigLogLevels);
}
} else {
SetupStore("LogLevel", -m_pConfig->ConfigLogLevels);
LOGGER->SetLogLevel(0);
}
}
//
// Expert settings
//
StoreChanged("AdditionalBufferLengthMs", m_pConfig->ConfigAdditionalBufferLengthMs, m_cAdditionalBufferLengthMs);
if (StoreChanged("DisableDeint", m_pConfig->ConfigDisableDeint, m_cDisableDeint)) {
if (m_pConfig->ConfigDisableDeint)
LOGDEBUG("Disable deinterlacer!");
m_pDevice->SetDisableDeint();
}
bool fallbackChanged = StoreChanged("DecoderFallbackToSw", m_pConfig->ConfigDecoderFallbackToSw, m_cDecoderFallbackToSw);
fallbackChanged |= StoreChanged("DecoderFallbackToSwNumPkts", m_pConfig->ConfigDecoderFallbackToSwNumPkts, m_cDecoderFallbackToSwNumPkts);
if (fallbackChanged)
m_pDevice->SetDecoderFallbackToSw(m_pConfig->ConfigDecoderFallbackToSw);
StoreChanged("ParseH264StreamStart", m_pConfig->ConfigParseH264StreamStart, m_cParseH264StreamStart);
StoreChanged("DropInvalidH264PFrames", m_pConfig->ConfigDropInvalidH264PFrames, m_cDropInvalidH264PFrames);
#ifdef USE_GLES
StoreChanged("MaxSizeGPUImageCache", m_pConfig->ConfigMaxSizeGPUImageCache, m_cMaxSizeGPUImageCache);
#endif
StoreChanged("ShowChannelSwitchDurationMessage", m_pConfig->ConfigShowChannelSwitchDurationMessage, m_cShowChannelSwitchDurationMessage);
//
// Apply the settings to the output objects
//
// They only exist in attached state, the setup menu may still be open after a detach
// (e.g. via SVDRP). On the next attach, they are created with the settings of the config.
if (m_pDevice->IsDetached())
return;
if (hdrChanged)
m_pDevice->SetEnableHdr(m_pConfig->ConfigVideoEnableHDR);
// the audio stream is recreated on an attach, so don't store its pointer in the menu
cAudioStream *audio = m_pDevice->Audio();
if (softvolChanged)
audio->SetSoftvol(m_pConfig->ConfigAudioSoftvol);
if (downmixChanged)
audio->SetDownmix(m_pConfig->ConfigAudioDownmix);
if (autoAesChanged)
audio->SetAutoAES(!m_pConfig->ConfigAudioDisableAutoAES);
if (normalizeChanged)
audio->SetNormalize(m_pConfig->ConfigAudioNormalize, m_pConfig->ConfigAudioMaxNormalize);
if (compressionChanged)
audio->SetCompression(m_pConfig->ConfigAudioCompression, m_pConfig->ConfigAudioMaxCompression);
if (stereoDescentChanged)
audio->SetStereoDescent(m_pConfig->ConfigAudioStereoDescent);
if (equalizerChanged)
audio->SetEqualizer(m_pConfig->ConfigAudioEq, m_pConfig->ConfigAudioEqBand);
if (displayModeChanged)
m_pDevice->SetDisplayMode(m_pConfig->ConfigVideoDisplayMode);
}