MythTV master
globalsettings.cpp
Go to the documentation of this file.
1
2// -*- Mode: c++ -*-
3
4// Standard UNIX C headers
5#include <fcntl.h>
6#include <sys/stat.h>
7#include <sys/types.h>
8#include <unistd.h>
9
10// Qt headers
11#include <QApplication>
12#include <QCursor>
13#include <QDialog>
14#include <QDir>
15#include <QEvent>
16#include <QFile>
17#include <QFileInfo>
18#include <QFontDatabase>
19#include <QImage>
20#include <QtGlobal>
21
22// MythTV headers
25#include "libmythbase/iso639.h"
26#include "libmythbase/mythconfig.h"
35#include "libmythtv/cardutil.h"
38#include "libmythtv/playgroup.h" //Used for playBackGroup, to be remove at one point
44#include "libmythui/themeinfo.h"
45#if CONFIG_OPENGL
47#endif
48#if CONFIG_AIRPLAY
50#endif
51#if CONFIG_VAAPI
53#endif
54
55// MythFrontend
56#include "globalsettings.h"
57#include "playbackbox.h"
58
60// was previously *DecodeExtraAudio()
61{
62 auto *gc = new HostSpinBoxSetting("AudioReadAhead",0,5000,10,10);
63
64 gc->setLabel(PlaybackSettings::tr("Audio read ahead (ms)"));
65
66 gc->setValue(100);
67
68 gc->setHelpText(PlaybackSettings::tr(
69 "Increase this value if audio cuts out frequently. This is more "
70 "likely to occur when adjusting audio sync to a negative value. "
71 "If using high negative audio sync values you may need to set a large "
72 "value here. Default is 100."));
73 return gc;
74}
75
77{
78 auto *gc = new HostComboBoxSetting("ColourPrimariesMode");
79 gc->setLabel(PlaybackSettings::tr("Primary colourspace conversion"));
83 gc->setHelpText(PlaybackSettings::tr(
84 "Converting between different primary colourspaces incurs a small "
85 "performance penalty but in some situations the difference in output is "
86 "negligible. The default ('Auto') behaviour is to only enforce "
87 "this conversion when there is a significant difference between source "
88 "colourspace primaries and the display."));
89 return gc;
90}
91
93{
94 auto *gc = new HostCheckBoxSetting("ChromaUpsamplingFilter");
95 gc->setLabel(PlaybackSettings::tr("Enable Chroma Upsampling Filter when deinterlacing"));
96 gc->setHelpText(PlaybackSettings::tr(
97 "The 'Chroma upsampling error' affects the quality of interlaced material "
98 "for the most common, standard video formats and results in jagged/indistinct "
99 "edges to brightly coloured areas of video. This filter attempts to fix "
100 "the problem in the OpenGL shaders. It adds a small amount of overhead to "
101 "video rendering but may not be suitable in all cases. Enabled by default."));
102 gc->setValue(false);
103 return gc;
104}
105
106#if CONFIG_VAAPI
107static HostTextEditSetting *VAAPIDevice()
108{
109 auto *ge = new HostTextEditSetting("VAAPIDevice");
110
111 ge->setLabel(MainGeneralSettings::tr("Decoder Device for VAAPI hardware decoding"));
112
113 ge->setValue("");
114
115 QString help = MainGeneralSettings::tr(
116 "Use this if your system does not detect the VAAPI device. "
117 "Example: '/dev/dri/renderD128'.");
118
119 ge->setHelpText(help);
120
121 // update VideoDisplayProfile statics if this changes
122 QObject::connect(ge, &HostTextEditSetting::ChangeSaved, ge,
123 []()
124 {
125 QString device = gCoreContext->GetSetting("VAAPIDevice");
126 LOG(VB_GENERAL, LOG_INFO, QString("New VAAPI device (%1) - resetting profiles").arg(device));
129 });
130 return ge;
131}
132#endif
133
135{
136 auto *gc = new HostComboBoxSetting("DisplayRecGroup");
137
138 gc->setLabel(PlaybackSettings::tr("Default group filter to apply"));
139
140
141 gc->addSelection(PlaybackSettings::tr("All Programs"), QString("All Programs"));
142 gc->addSelection(QCoreApplication::translate("(Common)", "Default"),
143 QString("Default"));
144
146 query.prepare("SELECT DISTINCT recgroup from recorded;");
147
148 if (query.exec())
149 {
150 while (query.next())
151 {
152 if (query.value(0).toString() != "Default")
153 {
154 QString recgroup = query.value(0).toString();
155 gc->addSelection(recgroup, recgroup);
156 }
157 }
158 }
159
160 query.prepare("SELECT DISTINCT category from recorded;");
161
162 if (query.exec())
163 {
164 while (query.next())
165 {
166 QString key = query.value(0).toString();
167 gc->addSelection(key, key);
168 }
169 }
170
171 gc->setHelpText(PlaybackSettings::tr("Default group filter to apply on the "
172 "View Recordings screen."));
173 return gc;
174}
175
177{
178 auto *gc = new HostCheckBoxSetting("QueryInitialFilter");
179
180 gc->setLabel(PlaybackSettings::tr("Always prompt for initial group "
181 "filter"));
182
183 gc->setValue(false);
184
185 gc->setHelpText(PlaybackSettings::tr("If enabled, always prompt the user "
186 "for the initial filter to apply "
187 "when entering the Watch Recordings "
188 "screen."));
189 return gc;
190}
191
193{
194 auto *gc = new HostCheckBoxSetting("RememberRecGroup");
195
196 gc->setLabel(PlaybackSettings::tr("Save current group filter when "
197 "changed"));
198
199 gc->setValue(true);
200
201 gc->setHelpText(PlaybackSettings::tr("If enabled, remember the last "
202 "selected filter instead of "
203 "displaying the default filter "
204 "whenever you enter the playback "
205 "screen."));
206 return gc;
207}
208
210{
211 auto *gc = new HostCheckBoxSetting("RecGroupsFocusable");
212
213 gc->setLabel(PlaybackSettings::tr("Change Recording Group using the arrow "
214 "keys"));
215
216 gc->setValue(false);
217
218 gc->setHelpText(PlaybackSettings::tr("If enabled, change recording group "
219 "directly using the arrow keys "
220 "instead of having to use < and >. "
221 "Requires theme support for this "
222 "feature."));
223 return gc;
224}
225
226
228{
229 auto *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle");
230
231 gc->setLabel(PlaybackSettings::tr("Start in group list"));
232
233 gc->setValue(true);
234
235 gc->setHelpText(PlaybackSettings::tr("If enabled, the focus will start on "
236 "the group list, otherwise the focus "
237 "will default to the recordings."));
238 return gc;
239}
240
242{
243 auto *gc = new HostCheckBoxSetting("SmartForward");
244
245 gc->setLabel(PlaybackSettings::tr("Smart fast forwarding"));
246
247 gc->setValue(false);
248
249 gc->setHelpText(PlaybackSettings::tr("If enabled, then immediately after "
250 "rewinding, only skip forward the "
251 "same amount as skipping backwards."));
252 return gc;
253}
254
256{
257 auto *bc = new GlobalComboBoxSetting("CommercialSkipMethod");
258
259 bc->setLabel(GeneralSettings::tr("Commercial detection method"));
260
261 bc->setHelpText(GeneralSettings::tr("This determines the method used by "
262 "MythTV to detect when commercials "
263 "start and end."));
264
265 std::deque<int> tmp = GetPreferredSkipTypeCombinations();
266
267 for (int pref : tmp)
268 bc->addSelection(SkipTypeToString(pref), QString::number(pref));
269
270 return bc;
271}
272
274{
275 auto *gc = new GlobalCheckBoxSetting("CommFlagFast");
276
277 gc->setLabel(GeneralSettings::tr("Enable experimental speedup of "
278 "commercial detection"));
279
280 gc->setValue(false);
281
282 gc->setHelpText(GeneralSettings::tr("If enabled, experimental commercial "
283 "detection speedups will be enabled."));
284 return gc;
285}
286
288{
289 auto *gc = new HostComboBoxSetting("AutoCommercialSkip");
290
291 gc->setLabel(PlaybackSettings::tr("Automatically skip commercials"));
292
293 gc->addSelection(QCoreApplication::translate("(Common)", "Off"), "0");
294 gc->addSelection(PlaybackSettings::tr("Notify, but do not skip",
295 "Skip commercials"), "2");
296 gc->addSelection(PlaybackSettings::tr("Automatically Skip",
297 "Skip commercials"), "1");
298
299 gc->setHelpText(PlaybackSettings::tr("Automatically skip commercial breaks "
300 "that have been flagged during "
301 "automatic commercial detection "
302 "or by the mythcommflag program, or "
303 "just notify that a commercial has "
304 "been detected."));
305 return gc;
306}
307
309{
310 auto *gs = new GlobalSpinBoxSetting("DeferAutoTranscodeDays", 0, 365, 1);
311
312 gs->setLabel(GeneralSettings::tr("Deferral days for auto transcode jobs"));
313
314 gs->setHelpText(GeneralSettings::tr("If non-zero, automatic transcode jobs "
315 "will be scheduled to run this many "
316 "days after a recording completes "
317 "instead of immediately afterwards."));
318
319 gs->setValue(0);
320
321 return gs;
322}
323
325{
326 auto *bc = new GlobalCheckBoxSetting("AggressiveCommDetect");
327
328 bc->setLabel(GeneralSettings::tr("Strict commercial detection"));
329
330 bc->setValue(true);
331
332 bc->setHelpText(GeneralSettings::tr("Enable stricter commercial detection "
333 "code. Disable if some commercials are "
334 "not being detected."));
335 return bc;
336}
337
339{
340 auto *gs = new HostSpinBoxSetting("CommRewindAmount", 0, 10, 1);
341
342 gs->setLabel(PlaybackSettings::tr("Commercial skip automatic rewind amount "
343 "(secs)"));
344
345 gs->setHelpText(PlaybackSettings::tr("MythTV will automatically rewind "
346 "this many seconds after performing a "
347 "commercial skip."));
348
349 gs->setValue(0);
350
351 return gs;
352}
353
355{
356 auto *gs = new HostSpinBoxSetting("CommNotifyAmount", 0, 10, 1);
357
358 gs->setLabel(PlaybackSettings::tr("Commercial skip notify amount (secs)"));
359
360 gs->setHelpText(PlaybackSettings::tr("MythTV will act like a commercial "
361 "begins this many seconds early. This "
362 "can be useful when commercial "
363 "notification is used in place of "
364 "automatic skipping."));
365
366 gs->setValue(0);
367
368 return gs;
369}
370
372{
373 auto *bs = new GlobalSpinBoxSetting("MaximumCommercialSkip", 0, 3600, 10);
374
375 bs->setLabel(PlaybackSettings::tr("Maximum commercial skip (secs)"));
376
377 bs->setHelpText(PlaybackSettings::tr("MythTV will discourage long manual "
378 "commercial skips. Skips which are "
379 "longer than this will require the "
380 "user to hit the SKIP key twice. "
381 "Automatic commercial skipping is "
382 "not affected by this limit."));
383
384 bs->setValue(3600);
385
386 return bs;
387}
388
390{
391 auto *bs = new GlobalSpinBoxSetting("MergeShortCommBreaks", 0, 3600, 5);
392
393 bs->setLabel(PlaybackSettings::tr("Merge short commercial breaks (secs)"));
394
395 bs->setHelpText(PlaybackSettings::tr("Treat consecutive commercial breaks "
396 "shorter than this as one break when "
397 "skipping forward. Useful if you have "
398 "to skip a few times during breaks. "
399 "Applies to automatic skipping as "
400 "well. Set to 0 to disable."));
401
402 bs->setValue(0);
403
404 return bs;
405}
406
408{
409 auto *bs = new GlobalSpinBoxSetting("AutoExpireExtraSpace", 0, 200, 1);
410
411 bs->setLabel(GeneralSettings::tr("Extra disk space (GB)"));
412
413 bs->setHelpText(GeneralSettings::tr("Extra disk space (in gigabytes) "
414 "beyond what MythTV requires that "
415 "you want to keep free on the "
416 "recording file systems."));
417
418 bs->setValue(1);
419
420 return bs;
421};
422
423#if 0
424static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete()
425{
426 GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("AutoExpireInsteadOfDelete");
427
428 cb->setLabel(DeletedExpireOptions::tr("Auto-Expire instead of delete recording"));
429
430 cb->setValue(false);
431
432 cb->setHelpText(DeletedExpireOptions::tr("If enabled, move deleted recordings to the "
433 "'Deleted' recgroup and turn on autoexpire "
434 "instead of deleting immediately."));
435 return cb;
436}
437#endif
438
440{
441 auto *bs = new GlobalSpinBoxSetting("DeletedMaxAge", -1, 365, 1);
442
443 bs->setLabel(GeneralSettings::tr("Time to retain deleted recordings "
444 "(days)"));
445
446 bs->setHelpText(GeneralSettings::tr("Determines the maximum number of days "
447 "before undeleting a recording will "
448 "become impossible. A value of zero "
449 "means the recording will be "
450 "permanently deleted between 5 and 20 "
451 "minutes later. A value of minus one "
452 "means recordings will be retained "
453 "until space is required. A recording "
454 "will always be removed before this "
455 "time if the space is needed for a new "
456 "recording."));
457 bs->setValue(0);
458 return bs;
459};
460
461#if 0
462// If this is ever reactivated, re-add the translations...
463class DeletedExpireOptions : public TriggeredConfigurationGroup
464{
465 public:
466 DeletedExpireOptions() :
467 TriggeredConfigurationGroup(false, false, false, false)
468 {
469 setLabel("DeletedExpireOptions");
470 Setting* enabled = AutoExpireInsteadOfDelete();
471 addChild(enabled);
472 setTrigger(enabled);
473
474 HorizontalConfigurationGroup* settings =
475 new HorizontalConfigurationGroup(false);
476 settings->addChild(DeletedMaxAge());
477 addTarget("1", settings);
478
479 // show nothing if fillEnabled is off
480 addTarget("0", new HorizontalConfigurationGroup(true));
481 };
482};
483#endif
484
486{
487 auto *bc = new GlobalComboBoxSetting("AutoExpireMethod");
488
489 bc->setLabel(GeneralSettings::tr("Auto-Expire method"));
490
491 bc->addSelection(GeneralSettings::tr("Oldest show first"), "1");
492 bc->addSelection(GeneralSettings::tr("Lowest priority first"), "2");
493 bc->addSelection(GeneralSettings::tr("Weighted time/priority combination"),
494 "3");
495
496 bc->setHelpText(GeneralSettings::tr("Method used to determine which "
497 "recorded shows to delete first. "
498 "Live TV recordings will always "
499 "expire before normal recordings."));
500 bc->setValue(1);
501
502 return bc;
503}
504
506{
507 auto *bc = new GlobalCheckBoxSetting("AutoExpireWatchedPriority");
508
509 bc->setLabel(GeneralSettings::tr("Watched before unwatched"));
510
511 bc->setValue(false);
512
513 bc->setHelpText(GeneralSettings::tr("If enabled, programs that have been "
514 "marked as watched will be expired "
515 "before programs that have not "
516 "been watched."));
517 return bc;
518}
519
521{
522 auto *bs = new GlobalSpinBoxSetting("AutoExpireDayPriority", 1, 400, 1);
523
524 bs->setLabel(GeneralSettings::tr("Priority weight"));
525
526 bs->setHelpText(GeneralSettings::tr("The number of days bonus a program "
527 "gets for each priority point. This "
528 "is only used when the Weighted "
529 "time/priority Auto-Expire method "
530 "is selected."));
531 bs->setValue(3);
532
533 return bs;
534};
535
537{
538 auto *bs = new GlobalSpinBoxSetting("AutoExpireLiveTVMaxAge", 1, 365, 1);
539
540 bs->setLabel(GeneralSettings::tr("Live TV max age (days)"));
541
542 bs->setHelpText(GeneralSettings::tr("Auto-Expire will force expiration of "
543 "Live TV recordings when they are this "
544 "many days old. Live TV recordings may "
545 "also be expired early if necessary to "
546 "free up disk space."));
547 bs->setValue(1);
548
549 return bs;
550};
551
552#if 0
553// Translations have been removed, please put back if reactivated...
554static GlobalSpinBoxSetting *MinRecordDiskThreshold()
555{
556 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MinRecordDiskThreshold",
557 0, 1000000, 100);
558 bs->setLabel("New recording free disk space threshold "
559 "(MB)");
560 bs->setHelpText("MythTV will stop scheduling new recordings on "
561 "a backend when its free disk space (in megabytes) falls "
562 "below this value.");
563 bs->setValue(300);
564 return bs;
565}
566#endif
567
569{
570 auto *bc = new GlobalCheckBoxSetting("RerecordWatched");
571
572 bc->setLabel(GeneralSettings::tr("Re-record watched"));
573
574 bc->setValue(false);
575
576 bc->setHelpText(GeneralSettings::tr("If enabled, programs that have been "
577 "marked as watched and are "
578 "Auto-Expired will be re-recorded if "
579 "they are shown again."));
580 return bc;
581}
582
584{
585 auto *bs = new GlobalSpinBoxSetting("RecordPreRoll", 0, 600, 60, 1);
586
587 bs->setLabel(GeneralSettings::tr("Time to record before start of show "
588 "(secs)"));
589
590 bs->setHelpText(GeneralSettings::tr("This global setting allows the "
591 "recorder to start before the "
592 "scheduled start time. It does not "
593 "affect the scheduler. It is ignored "
594 "when two shows have been scheduled "
595 "without enough time in between."));
596 bs->setValue(0);
597
598 return bs;
599}
600
602{
603 auto *bs = new GlobalSpinBoxSetting("RecordOverTime", 0, 1800, 60, 1);
604
605 bs->setLabel(GeneralSettings::tr("Time to record past end of show (secs)"));
606
607 bs->setValue(0);
608
609 bs->setHelpText(GeneralSettings::tr("This global setting allows the "
610 "recorder to record beyond the "
611 "scheduled end time. It does not "
612 "affect the scheduler. It is ignored "
613 "when two shows have been scheduled "
614 "without enough time in between."));
615 return bs;
616}
617
619{
620 auto *bs = new GlobalSpinBoxSetting("MaxStartGap", 0, 300, 1, 15);
621
622 bs->setLabel(GeneralSettings::tr("Maximum Start Gap (secs)"));
623
624 bs->setValue(15);
625
626 bs->setHelpText(GeneralSettings::tr("If more than this number of seconds "
627 "is missing at the start of a recording "
628 "that will be regarded as a gap for "
629 "assessing recording quality. The recording "
630 "may be marked as damaged."));
631 return bs;
632}
633
635{
636 auto *bs = new GlobalSpinBoxSetting("MaxEndGap", 0, 300, 1, 15);
637
638 bs->setLabel(GeneralSettings::tr("Maximum End Gap (secs)"));
639
640 bs->setValue(15);
641
642 bs->setHelpText(GeneralSettings::tr("If more than this number of seconds "
643 "is missing at the end of a recording "
644 "that will be regarded as a gap for "
645 "assessing recording quality. The recording "
646 "may be marked as damaged."));
647 return bs;
648}
649
651{
652 auto *bs = new GlobalSpinBoxSetting("MinimumRecordingQuality", 0, 100, 1, 10);
653
654 bs->setLabel(GeneralSettings::tr("Minimum Recording Quality (percent)"));
655
656 bs->setValue(95);
657
658 bs->setHelpText(GeneralSettings::tr("If recording quality is below this value the "
659 "recording is marked as damaged."));
660 return bs;
661}
662
664{
665 auto *gc = new GlobalComboBoxSetting("OverTimeCategory");
666
667 gc->setLabel(GeneralSettings::tr("Category of shows to be extended"));
668
669 gc->setHelpText(GeneralSettings::tr("For a special category (e.g. "
670 "\"Sports event\"), request that "
671 "shows be autoextended. Only works "
672 "if a show's category can be "
673 "determined."));
674
676
677 query.prepare("SELECT DISTINCT category FROM program GROUP BY category;");
678
679 gc->addSelection("", "");
680 if (query.exec())
681 {
682 while (query.next())
683 {
684 QString key = query.value(0).toString();
685 if (!key.trimmed().isEmpty())
686 gc->addSelection(key, key);
687 }
688 }
689
690 return gc;
691}
692
694{
695 auto *bs = new GlobalSpinBoxSetting("CategoryOverTime", 0, 180, 60, 1);
696
697 bs->setLabel(GeneralSettings::tr("Record past end of show (mins)"));
698
699 bs->setValue(30);
700
701 bs->setHelpText(GeneralSettings::tr("For the specified category, an "
702 "attempt will be made to extend "
703 "the recording by the specified "
704 "number of minutes. It is ignored "
705 "when two shows have been scheduled "
706 "without enough time in-between."));
707 return bs;
708}
709
711{
712 auto *vcg = new GroupSetting();
713
714 vcg->setLabel(GeneralSettings::tr("Category record over-time"));
715
716 vcg->addChild(OverTimeCategory());
717 vcg->addChild(CategoryOverTime());
718
719 return vcg;
720}
721
723 PlaybackProfileConfig *parent, uint idx, MythVideoProfileItem &_item) :
724 m_item(_item),
725 m_widthRange(new TransTextEditSetting()),
726 m_heightRange(new TransTextEditSetting()),
727 m_codecs(new TransMythUIComboBoxSetting(true)),
728 m_framerate(new TransTextEditSetting()),
729 m_decoder(new TransMythUIComboBoxSetting()),
730 m_skipLoop(new TransMythUICheckBoxSetting()),
731 m_vidRend(new TransMythUIComboBoxSetting()),
732 m_upscaler(new TransMythUIComboBoxSetting()),
733 m_singleDeint(new TransMythUIComboBoxSetting()),
734 m_singleShader(new TransMythUICheckBoxSetting()),
735 m_singleDriver(new TransMythUICheckBoxSetting()),
736 m_doubleDeint(new TransMythUIComboBoxSetting()),
737 m_doubleShader(new TransMythUICheckBoxSetting()),
738 m_doubleDriver(new TransMythUICheckBoxSetting()),
739 m_parentConfig(parent),
740 m_index(idx)
741{
743
744 const QString rangeHelp(tr(" Valid formats for the setting are "
745 "[nnnn - nnnn], [> nnnn], [>= nnnn], [< nnnn], "
746 "[<= nnnn]. Also [nnnn] for an exact match. "
747 "You can also use more than 1 expression with & between."));
748 const QString rangeHelpDec(tr("Numbers can have up to 3 decimal places."));
749 m_widthRange->setLabel(tr("Width Range"));
750 m_widthRange->setHelpText(tr("Optional setting to restrict this profile "
751 "to videos with a selected width range. ") + rangeHelp);
752 m_heightRange->setLabel(tr("Height Range"));
753 m_heightRange->setHelpText(tr("Optional setting to restrict this profile "
754 "to videos with a selected height range. ") + rangeHelp);
755 m_codecs->setLabel(tr("Video Formats"));
756 m_codecs->addSelection(tr("All formats"), " ", true);
757 m_codecs->addSelection("MPEG2", "mpeg2video");
758 m_codecs->addSelection("MPEG4", "mpeg4");
759 m_codecs->addSelection("H264", "h264");
760 m_codecs->addSelection("HEVC", "hevc");
761 m_codecs->addSelection("VP8", "vp8");
762 m_codecs->addSelection("VP9", "vp9");
763 m_codecs->addSelection("AV1", "av1");
764 m_codecs->setHelpText(tr("Optional setting to restrict this profile "
765 "to a video format or formats. You can also type in a format "
766 "or several formats separated by space. "
767 "To find the format for a video use ffprobe and look at the "
768 "word after \"Video:\". Also you can get a complete list "
769 "of available formats with ffmpeg -codecs."));
770 m_framerate->setLabel(tr("Frame Rate Range"));
771 m_framerate->setHelpText(tr("Optional setting to restrict this profile "
772 "to a range of frame rates. ") + rangeHelp +" "+rangeHelpDec);
773 m_decoder->setLabel(tr("Decoder"));
774 m_maxCpus->setLabel(tr("Max CPUs"));
775 m_skipLoop->setLabel(tr("Deblocking filter"));
776 m_vidRend->setLabel(tr("Video renderer"));
777 m_upscaler->setLabel(tr("Video scaler"));
778 auto scalers = MythVideoProfile::GetUpscalers();
779 for (const auto & scaler : scalers)
780 m_upscaler->addSelection(scaler.first, scaler.second);
781
782 QString shaderdesc = "\t" + tr("Prefer OpenGL deinterlacers");
783 QString driverdesc = "\t" + tr("Prefer driver deinterlacers");
784 QString shaderhelp = tr("If possible, use GLSL shaders for deinterlacing in "
785 "preference to software deinterlacers. Note: Even if "
786 "disabled, shaders may be used if deinterlacing is "
787 "enabled but software deinterlacers are unavailable.");
788 QString driverhelp = tr("If possible, use hardware drivers (e.g. VDPAU, VAAPI) "
789 "for deinterlacing in preference to software and OpenGL "
790 "deinterlacers. Note: Even if disabled, driver deinterlacers "
791 "may be used if deinterlacing is enabled but other "
792 "deinterlacers are unavailable.");
793
794 m_singleDeint->setLabel(tr("Deinterlacer quality (single rate)"));
795 m_singleShader->setLabel(shaderdesc);
796 m_singleDriver->setLabel(driverdesc);
797 m_doubleDeint->setLabel(tr("Deinterlacer quality (double rate)"));
798 m_doubleShader->setLabel(shaderdesc);
799 m_doubleDriver->setLabel(driverdesc);
800
801 m_singleShader->setHelpText(shaderhelp);
802 m_doubleShader->setHelpText(shaderhelp);
803 m_singleDriver->setHelpText(driverhelp);
804 m_doubleDriver->setHelpText(driverhelp);
806 tr("Set the quality for single rate deinterlacing. Use 'None' to disable. "
807 "Higher quality deinterlacers require more system processing and resources. "
808 "Software deinterlacers are used by default unless OpenGL or driver preferences "
809 "are enabled."));
811 tr("Set the quality for double rate deinterlacing - which is only used "
812 "if the display can support the required frame rate. Use 'None' to "
813 "disable double rate deinterlacing."));
814
819
820 const QList<QPair<QString,QString> >& options = MythVideoProfile::GetDeinterlacers();
821 for (const auto & option : std::as_const(options))
822 {
823 m_singleDeint->addSelection(option.second, option.first);
824 m_doubleDeint->addSelection(option.second, option.first);
825 }
826
828 tr("Maximum number of CPU cores used for video decoding and filtering."));
829
831 tr("When unchecked the deblocking loopfilter will be disabled. ") + "\n" +
832 tr("Disabling will significantly reduce the load on the CPU for software decoding of "
833 "H.264 and HEVC material but may significantly reduce video quality."));
834
836 "The default scaler provides good quality in the majority of situations. "
837 "Higher quality scalers may offer some benefit when scaling very low "
838 "resolution material but may not be as fast."));
839
849
856
857 connect(m_widthRange, qOverload<const QString&>(&StandardSetting::valueChanged),
859 connect(m_heightRange, qOverload<const QString&>(&StandardSetting::valueChanged),
861 connect(m_codecs, qOverload<const QString&>(&StandardSetting::valueChanged),
863 connect(m_framerate, qOverload<const QString&>(&StandardSetting::valueChanged),
865 connect(m_decoder, qOverload<const QString&>(&StandardSetting::valueChanged),
867 connect(m_vidRend, qOverload<const QString&>(&StandardSetting::valueChanged),
869 connect(m_singleDeint, qOverload<const QString&>(&StandardSetting::valueChanged),
871 connect(m_doubleDeint, qOverload<const QString&>(&StandardSetting::valueChanged),
873}
874
876{
877 return m_index;
878}
879
881{
882 QString width_value;
883 QString height_value;
884 // pref_cmp0 and pref_cmp1 are no longer used. This code
885 // is here to convery them to the new settings cond_width
886 // and cond_height
887 for (uint i = 0; i < 2; ++i)
888 {
889 QString pcmp = m_item.Get(QString("pref_cmp%1").arg(i));
890 if (pcmp == "> 0 0")
891 continue;
892 QStringList clist = pcmp.split(" ");
893
894 if (clist.size() < 3)
895 continue;
896 if (!width_value.isEmpty())
897 {
898 width_value.append("&");
899 height_value.append("&");
900 }
901 width_value.append(clist[0]+clist[1]);
902 height_value.append(clist[0]+clist[2]);
903 }
904
905 QString tmp = m_item.Get(COND_WIDTH).trimmed();
906 if (!tmp.isEmpty())
907 {
908 if (!width_value.isEmpty())
909 width_value.append("&");
910 width_value.append(tmp);
911 }
912 tmp = m_item.Get(COND_HEIGHT).trimmed();
913 if (!tmp.isEmpty())
914 {
915 if (!height_value.isEmpty())
916 height_value.append("&");
917 height_value.append(tmp);
918 }
919
920 m_widthRange->setValue(width_value);
921 m_heightRange->setValue(height_value);
922 auto codecs = m_item.Get(COND_CODECS);
923 if (codecs.isEmpty())
924 codecs = " ";
925 m_codecs->setValue(codecs);
927
928 QString pdecoder = m_item.Get(PREF_DEC);
929 QString pmax_cpus = m_item.Get(PREF_CPUS);
930 QString pskiploop = m_item.Get(PREF_LOOP);
931 QString prenderer = m_item.Get(PREF_RENDER);
932 QString psingledeint = m_item.Get(PREF_DEINT1X);
933 QString pdoubledeint = m_item.Get(PREF_DEINT2X);
934 auto upscale = m_item.Get(PREF_UPSCALE);
935 if (upscale.isEmpty())
936 upscale = UPSCALE_DEFAULT;
937 bool found = false;
938
939 QString dech = MythVideoProfile::GetDecoderHelp();
940 QStringList decr = MythVideoProfile::GetDecoders();
941 QStringList decn = MythVideoProfile::GetDecoderNames();
942 QStringList::const_iterator itr = decr.cbegin();
943 QStringList::const_iterator itn = decn.cbegin();
945 m_decoder->setHelpText(dech);
946 for (; (itr != decr.cend()) && (itn != decn.cend()); ++itr, ++itn)
947 {
948 m_decoder->addSelection(*itn, *itr, (*itr == pdecoder));
949 found |= (*itr == pdecoder);
950 }
951 if (!found && !pdecoder.isEmpty())
952 m_decoder->addSelection(MythVideoProfile::GetDecoderName(pdecoder), pdecoder, true);
954
955 if (!pmax_cpus.isEmpty())
956 m_maxCpus->setValue(pmax_cpus.toInt());
957
958 m_skipLoop->setValue((!pskiploop.isEmpty()) ? (pskiploop.toInt() > 0) : true);
959 m_upscaler->setValue(upscale);
960
961 if (!prenderer.isEmpty())
962 m_vidRend->setValue(prenderer);
963
966
968}
969
971{
972 m_item.Set("pref_cmp0", QString());
973 m_item.Set("pref_cmp1", QString());
980 m_item.Set(PREF_LOOP, (m_skipLoop->boolValue()) ? "1" : "0");
985}
986
988{
989 bool ok = true;
990 QString oldvalue = m_item.Get(COND_WIDTH);
991 m_item.Set(COND_WIDTH, val);
992 m_item.CheckRange(COND_WIDTH, 640, &ok);
993 if (!ok)
994 {
995 ShowOkPopup(tr("Invalid width specification(%1), discarded").arg(val));
996 m_widthRange->setValue(oldvalue);
997 }
998 InitLabel();
999}
1000
1002{
1003 bool ok = true;
1004 QString oldvalue = m_item.Get(COND_HEIGHT);
1005 m_item.Set(COND_HEIGHT,val);
1006 m_item.CheckRange(COND_HEIGHT, 480, &ok);
1007 if (!ok)
1008 {
1009 ShowOkPopup(tr("Invalid height specification(%1), discarded").arg(val));
1010 m_heightRange->setValue(oldvalue);
1011 }
1012 InitLabel();
1013}
1014
1016{
1017 bool ok = true;
1018 QString oldvalue = m_item.Get(COND_RATE);
1019 m_item.Set(COND_RATE,val);
1020 m_item.CheckRange(COND_RATE, 25.0F, &ok);
1021 if (!ok)
1022 {
1023 ShowOkPopup(tr("Invalid frame rate specification(%1), discarded").arg(val));
1024 m_framerate->setValue(oldvalue);
1025 }
1026 InitLabel();
1027}
1028
1030{
1031 QString vrenderer = m_vidRend->getValue();
1032 QStringList renderers = MythVideoProfile::GetVideoRenderers(dec);
1033
1034 QString prenderer;
1035 for (const auto & rend : std::as_const(renderers))
1036 prenderer = (rend == vrenderer) ? vrenderer : prenderer;
1037 if (prenderer.isEmpty())
1039
1041 for (const auto & rend : std::as_const(renderers))
1042 {
1043 if ((!rend.contains("null")))
1045 rend, (rend == prenderer));
1046 }
1047 QString vrenderer2 = m_vidRend->getValue();
1048 vrenderChanged(vrenderer2);
1049
1051 InitLabel();
1052}
1053
1055{
1057 InitLabel();
1058}
1059
1061{
1062 bool enabled = Quality != DEINT_QUALITY_NONE;
1063 m_singleShader->setEnabled(enabled);
1064 m_singleDriver->setEnabled(enabled);
1065}
1066
1068{
1069 bool enabled = Quality != DEINT_QUALITY_NONE;
1070 m_doubleShader->setEnabled(enabled);
1071 m_doubleDriver->setEnabled(enabled);
1072}
1073
1084 QString &Value)
1085{
1086 bool enabled = true;
1087
1088 if (Value.contains(DEINT_QUALITY_HIGH))
1089 {
1091 }
1092 else if (Value.contains(DEINT_QUALITY_MEDIUM))
1093 {
1095 }
1096 else if (Value.contains(DEINT_QUALITY_LOW))
1097 {
1099 }
1100 else
1101 {
1102 enabled = false;
1104 }
1105
1106 Shader->setValue(Value.contains(DEINT_QUALITY_SHADER));
1107 Driver->setValue(Value.contains(DEINT_QUALITY_DRIVER));
1108 Shader->setEnabled(enabled);
1109 Driver->setEnabled(enabled);
1110}
1111
1115{
1116 QStringList values;
1117 QString quality = Deint->getValue();
1118 if (quality == DEINT_QUALITY_LOW || quality == DEINT_QUALITY_MEDIUM || quality == DEINT_QUALITY_HIGH)
1119 values.append(quality);
1120 else
1121 values.append(DEINT_QUALITY_NONE);
1122
1123 // N.B. save these regardless to preserve preferences
1124 if (Shader->boolValue())
1125 values.append(DEINT_QUALITY_SHADER);
1126 if (Driver->boolValue())
1127 values.append(DEINT_QUALITY_DRIVER);
1128
1129 return values.join(":");
1130}
1131
1133{
1134 QStringList actions;
1135
1136 if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
1137 return true;
1138
1139 if (actions.contains("DELETE"))
1140 {
1142 return true;
1143 }
1144
1145 return false;
1146}
1147
1149{
1150 QString message = tr("Remove this profile item?");
1151 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1152 auto *confirmDelete = new MythConfirmationDialog(popupStack, message, true);
1153
1154 if (confirmDelete->Create())
1155 {
1156 connect(confirmDelete, &MythConfirmationDialog::haveResult,
1158 popupStack->AddScreen(confirmDelete);
1159 }
1160 else
1161 {
1162 delete confirmDelete;
1163 }
1164}
1165
1167{
1168 if (doDelete)
1170}
1171
1173{
1175}
1176
1178{
1180}
1181
1183 StandardSetting *parent) :
1184 m_profileName(std::move(profilename))
1185{
1186 setVisible(false);
1190 InitUI(parent);
1191}
1192
1194{
1195 QStringList restrict;
1196 QString width = m_widthRange->getValue();
1197 if (!width.isEmpty())
1198 restrict << tr("Width", "video formats") + " " + width;
1199 QString height = m_heightRange->getValue();
1200 if (!height.isEmpty())
1201 restrict << tr("Height", "video formats") + " " + height;
1202 QString codecsval = m_codecs->getValue().trimmed();
1203 if (!codecsval.isEmpty())
1204 restrict << tr("Formats", "video formats") + " " + codecsval.toUpper();
1205 QString framerateval = m_framerate->getValue();
1206 if (!framerateval.isEmpty())
1207 restrict << tr("framerate") + " " + framerateval;
1208
1209 QString str;
1210 if (!restrict.isEmpty())
1211 str += restrict.join(" ") + " -> ";
1213 str += " " + tr("&", "and") + ' ';
1215 setLabel(str);
1216}
1217
1219{
1221 m_markForDeletion->setLabel(tr("Mark for deletion"));
1222 m_addNewEntry = new ButtonStandardSetting(tr("Add New Entry"));
1223
1226
1229
1230 for (size_t i = 0; i < m_items.size(); ++i)
1231 InitProfileItem(i, parent);
1232}
1233
1235 uint i, StandardSetting *parent)
1236{
1237 auto *ppic = new PlaybackProfileItemConfig(this, i, m_items[i]);
1238
1239 m_items[i].Set("pref_priority", QString::number(i + 1));
1240
1241 parent->addTargetedChild(m_profileName, ppic);
1242 m_profiles.push_back(ppic);
1243 return ppic;
1244}
1245
1247{
1249 {
1252 return;
1253 }
1254
1255 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1256 {
1257 profile->Save();
1258 }
1259
1261 if (!ok)
1262 {
1263 LOG(VB_GENERAL, LOG_ERR,
1264 "PlaybackProfileConfig::Save() -- failed to delete items");
1265 return;
1266 }
1267
1269 if (!ok)
1270 {
1271 LOG(VB_GENERAL, LOG_ERR,
1272 "PlaybackProfileConfig::Save() -- failed to save items");
1273 return;
1274 }
1275}
1276
1278 PlaybackProfileItemConfig *profileToDelete)
1279{
1280 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1281 profile->Save();
1282
1283 uint i = profileToDelete->GetIndex();
1284 m_delItems.push_back(m_items[i]);
1285 m_items.erase(m_items.begin() + i);
1286
1288}
1289
1291{
1292 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1293 profile->Save();
1294 m_items.emplace_back();
1296}
1297
1299{
1302
1303 for (StandardSetting *setting : std::as_const(m_profiles))
1305 m_profiles.clear();
1306
1307 InitUI(getParent());
1308 for (StandardSetting *setting : std::as_const(m_profiles))
1309 setting->Load();
1310 emit getParent()->settingsChanged();
1311 setChanged(true);
1312}
1313
1314// This function doesn't guarantee that no exceptions will be thrown.
1315// NOLINTNEXTLINE(performance-noexcept-swap)
1316void PlaybackProfileConfig::swap(int indexA, int indexB)
1317{
1318 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1319 profile->Save();
1320
1321 QString pri_i = QString::number(m_items[indexA].GetPriority());
1322 QString pri_j = QString::number(m_items[indexB].GetPriority());
1323
1324 MythVideoProfileItem item = m_items[indexB];
1325 m_items[indexB] = m_items[indexA];
1326 m_items[indexA] = item;
1327
1328 m_items[indexA].Set("pref_priority", pri_i);
1329 m_items[indexB].Set("pref_priority", pri_j);
1330
1332}
1333
1335{
1336 auto *grouptrigger = new HostComboBoxSetting("DefaultVideoPlaybackProfile");
1337 grouptrigger->setLabel(
1338 QCoreApplication::translate("PlaybackProfileConfigs",
1339 "Current Video Playback Profile"));
1340
1341 QString host = gCoreContext->GetHostName();
1343 QStringList profiles = MythVideoProfile::GetProfiles(host);
1344
1346 if (!profiles.contains(profile))
1347 {
1348 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
1350 }
1351
1352 for (const auto & prof : std::as_const(profiles))
1353 {
1354 grouptrigger->addSelection(ProgramInfo::i18n(prof), prof);
1355 grouptrigger->addTargetedChild(prof,
1356 new PlaybackProfileConfig(prof, grouptrigger));
1357 }
1358
1359 return grouptrigger;
1360}
1361
1363{
1364 QString msg = tr("Enter Playback Profile Name");
1365
1366 MythScreenStack *popupStack =
1367 GetMythMainWindow()->GetStack("popup stack");
1368
1369 auto *settingdialog = new MythTextInputDialog(popupStack, msg);
1370
1371 if (settingdialog->Create())
1372 {
1373 connect(settingdialog, &MythTextInputDialog::haveResult,
1375 popupStack->AddScreen(settingdialog);
1376 }
1377 else
1378 {
1379 delete settingdialog;
1380 }
1381}
1382
1384{
1385 QString host = gCoreContext->GetHostName();
1386 QStringList not_ok_list = MythVideoProfile::GetProfiles(host);
1387
1388 if (not_ok_list.contains(name) || name.isEmpty())
1389 {
1390 QString msg = (name.isEmpty()) ?
1391 tr("Sorry, playback group\nname cannot be blank.") :
1392 tr("Sorry, playback group name\n"
1393 "'%1' is already being used.").arg(name);
1394
1395 ShowOkPopup(msg);
1396
1397 return;
1398 }
1399
1403
1404 m_playbackProfiles->addSelection(name, name, true);
1405}
1406
1408{
1409 std::array<QString,4> str
1410 {
1411 PlaybackSettings::tr("Sort all sub-titles/multi-titles Ascending"),
1412 PlaybackSettings::tr("Sort all sub-titles/multi-titles Descending"),
1413 PlaybackSettings::tr("Sort sub-titles Descending, multi-titles "
1414 "Ascending"),
1415 PlaybackSettings::tr("Sort sub-titles Ascending, multi-titles Descending"),
1416 };
1417
1418 QString help = PlaybackSettings::tr("Selects how to sort show episodes. "
1419 "Sub-titles refers to the episodes "
1420 "listed under a specific show title. "
1421 "Multi-title refers to sections (e.g. "
1422 "\"All Programs\") which list multiple "
1423 "titles. Sections in parentheses are "
1424 "not affected.");
1425
1426 auto *gc = new HostComboBoxSetting("PlayBoxOrdering");
1427
1428 gc->setLabel(PlaybackSettings::tr("Episode sort orderings"));
1429
1430 for (size_t i = 0; i < str.size(); ++i)
1431 gc->addSelection(str[i], QString::number(i));
1432
1433 gc->setValue(3);
1434 gc->setHelpText(help);
1435
1436 return gc;
1437}
1438
1440{
1441 auto *gc = new HostComboBoxSetting("PlayBoxEpisodeSort");
1442
1443 gc->setLabel(PlaybackSettings::tr("Sort episodes"));
1444
1445 gc->addSelection(PlaybackSettings::tr("Record date"), "Date");
1446 gc->addSelection(PlaybackSettings::tr("Season/Episode"), "Season");
1447 gc->addSelection(PlaybackSettings::tr("Original air date"), "OrigAirDate");
1448 gc->addSelection(PlaybackSettings::tr("Program ID"), "Id");
1449
1450 gc->setHelpText(PlaybackSettings::tr("Selects how to sort a show's "
1451 "episodes"));
1452
1453 return gc;
1454}
1455
1457{
1458 auto *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5);
1459
1460 gs->setLabel(PlaybackSettings::tr("Fast forward/rewind reposition amount"));
1461
1462 gs->setValue(100);
1463
1464 gs->setHelpText(PlaybackSettings::tr("When exiting sticky keys fast "
1465 "forward/rewind mode, reposition "
1466 "this many 1/100th seconds before "
1467 "resuming normal playback. This "
1468 "compensates for the reaction time "
1469 "between seeing where to resume "
1470 "playback and actually exiting "
1471 "seeking."));
1472 return gs;
1473}
1474
1476{
1477 auto *gc = new HostCheckBoxSetting("FFRewReverse");
1478
1479 gc->setLabel(PlaybackSettings::tr("Reverse direction in fast "
1480 "forward/rewind"));
1481
1482 gc->setValue(true);
1483
1484 gc->setHelpText(PlaybackSettings::tr("If enabled, pressing the sticky "
1485 "rewind key in fast forward mode "
1486 "switches to rewind mode, and "
1487 "vice versa. If disabled, it will "
1488 "decrease the current speed or "
1489 "switch to play mode if the speed "
1490 "can't be decreased further."));
1491 return gc;
1492}
1493
1494static void AddPaintEngine(GroupSetting* Group)
1495{
1496 if (!Group)
1497 return;
1498
1499 const QStringList options = MythPainterWindow::GetPainters();
1500
1501 // Don't show an option if there is no choice. Do not offer Qt painter (but
1502 // MythPainterWindow will accept 'Qt' if overriden from the command line)
1503 if (options.size() <= 1)
1504 return;
1505
1506 QString pref = GetMythDB()->GetSetting("PaintEngine", MythPainterWindow::GetDefaultPainter());
1507 auto* paint = new HostComboBoxSetting("PaintEngine");
1508 paint->setLabel(AppearanceSettings::tr("Paint engine"));
1509 for (const auto & option : options)
1510 paint->addSelection(option, option, option == pref);
1511
1512 paint->setHelpText(AppearanceSettings::tr("This selects what MythTV uses to draw. "));
1513 Group->addChild(paint);
1514}
1515
1517{
1518 auto *gc = new HostComboBoxSetting("MenuTheme");
1519
1520 gc->setLabel(AppearanceSettings::tr("Menu theme"));
1521
1522 QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
1523
1524 QList<ThemeInfo>::iterator it;
1525 for( it = themelist.begin(); it != themelist.end(); ++it )
1526 {
1527 gc->addSelection((*it).GetName(), (*it).GetDirectoryName(),
1528 (*it).GetDirectoryName() == "defaultmenu");
1529 }
1530
1531 return gc;
1532}
1533
1534#if 0
1535static HostComboBoxSetting *DecodeVBIFormat()
1536{
1537 QString beVBI = gCoreContext->GetSetting("VbiFormat");
1538 QString fmt = beVBI.toLower().left(4);
1539 int sel = (fmt == "pal ") ? 1 : ((fmt == "ntsc") ? 2 : 0);
1540
1541 HostComboBoxSetting *gc = new HostComboBoxSetting("DecodeVBIFormat");
1542
1543 gc->setLabel(OSDSettings::tr("Decode VBI format"));
1544
1545 gc->addSelection(OSDSettings::tr("None"), "none",
1546 0 == sel);
1547 gc->addSelection(OSDSettings::tr("PAL teletext"), "pal_txt",
1548 1 == sel);
1549 gc->addSelection(OSDSettings::tr("NTSC closed caption"), "ntsc_cc",
1550 2 == sel);
1551
1552 gc->setHelpText(
1553 OSDSettings::tr("If enabled, this overrides the mythtv-setup setting "
1554 "used during recording when decoding captions."));
1555
1556 return gc;
1557}
1558#endif
1559
1561{
1562 static const QRegularExpression crlf { "[\r\n]" };
1563 static const QRegularExpression suffix { "(//.*)" };
1564
1565 auto *gc = new HostComboBoxSetting("SubtitleCodec");
1566
1567 gc->setLabel(OSDSettings::tr("Subtitle Codec"));
1568
1569 // Translations are now done via FFmpeg(iconv). Get the list of
1570 // encodings that iconv supports.
1571 QScopedPointer<MythSystem>
1572 cmd(MythSystem::Create({"iconv", "-l"},
1574 cmd->Wait();
1575 QString results = cmd->GetStandardOutputStream()->readAll();
1576 QStringList list = results.toLower().split(crlf, Qt::SkipEmptyParts);
1577 list.replaceInStrings(suffix, "");
1578 list.sort();
1579
1580 for (const auto & codec : std::as_const(list))
1581 {
1582 QString val = QString(codec);
1583 gc->addSelection(val, val, val.toLower() == "utf-8");
1584 }
1585
1586 return gc;
1587}
1588
1590{
1591 auto *gc = new HostComboBoxSetting("ChannelOrdering");
1592
1593 gc->setLabel(GeneralSettings::tr("Channel ordering"));
1594
1595 gc->addSelection(GeneralSettings::tr("channel number"), "channum");
1596 gc->addSelection(GeneralSettings::tr("callsign"), "callsign");
1597
1598 return gc;
1599}
1600
1602{
1603 auto *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1);
1604
1605 gs->setLabel(PlaybackSettings::tr("Vertical scaling"));
1606
1607 gs->setValue(0);
1608
1609 gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1610 "fill your screen vertically. Range "
1611 "-100% to 100%"));
1612 return gs;
1613}
1614
1616{
1617 auto *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1);
1618
1619 gs->setLabel(PlaybackSettings::tr("Horizontal scaling"));
1620
1621 gs->setValue(0);
1622
1623 gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1624 "fill your screen horizontally. Range "
1625 "-100% to 100%"));
1626 return gs;
1627};
1628
1630{
1631 auto *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1);
1632
1633 gs->setLabel(PlaybackSettings::tr("Scan displacement (X)"));
1634
1635 gs->setValue(0);
1636
1637 gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1638 "horizontally."));
1639
1640 return gs;
1641}
1642
1644{
1645 auto *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1);
1646
1647 gs->setLabel(PlaybackSettings::tr("Scan displacement (Y)"));
1648
1649 gs->setValue(0);
1650
1651 gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1652 "vertically."));
1653
1654 return gs;
1655};
1656
1658{
1659 auto *gc = new HostCheckBoxSetting("DefaultCCMode");
1660
1661 gc->setLabel(OSDSettings::tr("Always display closed captioning or "
1662 "subtitles"));
1663
1664 gc->setValue(false);
1665
1666 gc->setHelpText(OSDSettings::tr("If enabled, captions will be displayed "
1667 "when playing back recordings or watching "
1668 "Live TV. Closed Captioning can be turned "
1669 "on or off by pressing \"T\" during"
1670 "playback."));
1671 return gc;
1672}
1673
1675{
1676 auto *gc = new HostCheckBoxSetting("EnableMHEG");
1677
1678 gc->setLabel(OSDSettings::tr("Enable interactive TV"));
1679
1680 gc->setValue(false);
1681
1682 gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1683 "(MHEG) will be activated. This is used "
1684 "for teletext and logos for radio and "
1685 "channels that are currently off-air."));
1686 return gc;
1687}
1688
1690{
1691 auto *gc = new HostCheckBoxSetting("EnableMHEGic");
1692 gc->setLabel(OSDSettings::tr("Enable network access for interactive TV"));
1693 gc->setValue(true);
1694 gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1695 "(MHEG) will be able to access interactive "
1696 "content over the Internet. This is used "
1697 "for BBC iPlayer."));
1698 return gc;
1699}
1700
1702{
1703 auto *combo = new HostComboBoxSetting("AudioVisualiser");
1704 combo->setLabel(OSDSettings::tr("Visualiser for audio only playback"));
1705 combo->setHelpText(OSDSettings::tr("Select a visualisation to use when there "
1706 "is no video. Defaults to none."));
1707 combo->addSelection("None", "");
1709 for (const auto & visual : std::as_const(visuals))
1710 combo->addSelection(visual, visual);
1711 return combo;
1712}
1713
1715{
1716 auto *gc = new HostCheckBoxSetting("PersistentBrowseMode");
1717
1718 gc->setLabel(OSDSettings::tr("Always use browse mode in Live TV"));
1719
1720 gc->setValue(true);
1721
1722 gc->setHelpText(OSDSettings::tr("If enabled, browse mode will "
1723 "automatically be activated whenever "
1724 "you use channel up/down while watching "
1725 "Live TV."));
1726 return gc;
1727}
1728
1730{
1731 auto *gc = new HostCheckBoxSetting("BrowseAllTuners");
1732
1733 gc->setLabel(OSDSettings::tr("Browse all channels"));
1734
1735 gc->setValue(false);
1736
1737 gc->setHelpText(OSDSettings::tr("If enabled, browse mode will show "
1738 "channels on all available recording "
1739 "devices, instead of showing channels "
1740 "on just the current recorder."));
1741 return gc;
1742}
1743
1745{
1746 auto *gc = new HostCheckBoxSetting("UseProgStartMark");
1747
1748 gc->setLabel(PlaybackSettings::tr("Playback from start of program"));
1749
1750 gc->setValue(false);
1751
1752 gc->setHelpText(PlaybackSettings::tr("If enabled and no bookmark is set, "
1753 "playback starts at the program "
1754 "scheduled start time rather than "
1755 "the beginning of the recording. "
1756 "Useful for automatically skipping "
1757 "'start early' parts of a recording."));
1758 return gc;
1759}
1760
1762{
1763 auto *gc = new HostComboBoxSetting("PlaybackExitPrompt");
1764
1765 gc->setLabel(PlaybackSettings::tr("Action on playback exit"));
1766
1767 gc->addSelection(PlaybackSettings::tr("Just exit"), "0");
1768 gc->addSelection(PlaybackSettings::tr("Clear last played position and exit"), "16");
1769 gc->addSelection(PlaybackSettings::tr("Always prompt (excluding Live TV)"),
1770 "1");
1771 gc->addSelection(PlaybackSettings::tr("Always prompt (including Live TV)"),
1772 "4");
1773 gc->addSelection(PlaybackSettings::tr("Prompt for Live TV only"), "8");
1774
1775 gc->setHelpText(PlaybackSettings::tr("If set to prompt, a menu will be "
1776 "displayed when you exit playback "
1777 "mode. The options available will "
1778 "allow you delete the recording, "
1779 "continue watching, or exit."));
1780 return gc;
1781}
1782
1784{
1785 auto *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt");
1786
1787 gc->setLabel(PlaybackSettings::tr("Prompt at end of recording"));
1788
1789 gc->setValue(false);
1790
1791 gc->setHelpText(PlaybackSettings::tr("If enabled, a menu will be displayed "
1792 "allowing you to delete the recording "
1793 "when it has finished playing."));
1794 return gc;
1795}
1796
1798{
1799 auto *gc = new HostCheckBoxSetting("MusicChoiceEnabled");
1800
1801 gc->setLabel(PlaybackSettings::tr("Enable Music Choice"));
1802
1803 gc->setValue(false);
1804
1805 gc->setHelpText(PlaybackSettings::tr("Enable this to improve playing of Music Choice channels "
1806 "or recordings from those channels. "
1807 "These are audio channels with slide show "
1808 "from some cable providers. "
1809 "In unusual situations this could cause lip sync problems "
1810 "watching normal videos or TV shows."));
1811 return gc;
1812}
1813
1815{
1816 auto *gc = new HostCheckBoxSetting("JumpToProgramOSD");
1817
1818 gc->setLabel(PlaybackSettings::tr("Jump to program OSD"));
1819
1820 gc->setValue(true);
1821
1822 gc->setHelpText(PlaybackSettings::tr("Set the choice between viewing the "
1823 "current recording group in the OSD, "
1824 "or showing the 'Watch Recording' "
1825 "screen when 'Jump to Program' is "
1826 "activated. If enabled, the "
1827 "recordings are shown in the OSD"));
1828 return gc;
1829}
1830
1832{
1833 auto *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay");
1834
1835 gc->setLabel(PlaybackSettings::tr("Continue playback when embedded"));
1836
1837 gc->setValue(false);
1838
1839 gc->setHelpText(PlaybackSettings::tr("If enabled, TV playback continues "
1840 "when the TV window is embedded in "
1841 "the upcoming program list or "
1842 "recorded list. The default is to "
1843 "pause the recorded show when "
1844 "embedded."));
1845 return gc;
1846}
1847
1849{
1850 auto *gc = new HostCheckBoxSetting("AutomaticSetWatched");
1851
1852 gc->setLabel(PlaybackSettings::tr("Automatically mark a recording as "
1853 "watched"));
1854
1855 gc->setValue(false);
1856
1857 gc->setHelpText(PlaybackSettings::tr("If enabled, when you exit near the "
1858 "end of a recording it will be marked "
1859 "as watched. The automatic detection "
1860 "is not foolproof, so do not enable "
1861 "this setting if you don't want an "
1862 "unwatched recording marked as "
1863 "watched."));
1864 return gc;
1865}
1866
1868{
1869 auto *gc = new HostCheckBoxSetting("AlwaysShowWatchedProgress");
1870
1871 gc->setLabel(PlaybackSettings::tr("Always show watched percent progress bar"));
1872
1873 gc->setValue(false);
1874
1875 gc->setHelpText(PlaybackSettings::tr("If enabled, shows the watched percent "
1876 "progress bar even if the recording or "
1877 "video is marked as watched. "
1878 "Having a watched percent progress bar at "
1879 "all depends on the currently used theme."));
1880 return gc;
1881}
1882
1884{
1885 auto *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1);
1886
1887 gs->setLabel(PlaybackSettings::tr("Live TV idle timeout (mins)"));
1888
1889 gs->setValue(0);
1890
1891 gs->setHelpText(PlaybackSettings::tr("Exit Live TV automatically if left "
1892 "idle for the specified number of "
1893 "minutes. 0 disables the timeout."));
1894 return gs;
1895}
1896
1897// static HostCheckBoxSetting *PlaybackPreview()
1898// {
1899// HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackPreview");
1900//
1901// gc->setLabel(PlaybackSettings::tr("Display live preview of recordings"));
1902//
1903// gc->setValue(true);
1904//
1905// gc->setHelpText(PlaybackSettings::tr("If enabled, a preview of the recording "
1906// "will play in a small window on the \"Watch a "
1907// "Recording\" menu."));
1908//
1909// return gc;
1910// }
1911//
1912// static HostCheckBoxSetting *HWAccelPlaybackPreview()
1913// {
1914// HostCheckBoxSetting *gc = new HostCheckBoxSetting("HWAccelPlaybackPreview");
1915//
1916// gc->setLabel(PlaybackSettings::tr("Use HW Acceleration for live recording preview"));
1917//
1918// gc->setValue(false);
1919//
1920// gc->setHelpText(
1921// PlaybackSettings::tr(
1922// "If enabled, live recording preview will use hardware "
1923// "acceleration. The video renderer used is determined by the "
1924// "selected CPU profile. Disable if playback is sluggish or "
1925// "causes high CPU load"));
1926//
1927// return gc;
1928// }
1929
1931{
1932 auto *gc = new HostCheckBoxSetting("UseVirtualKeyboard");
1933
1934 gc->setLabel(MainGeneralSettings::tr("Use line edit virtual keyboards"));
1935
1936 gc->setValue(true);
1937
1938 gc->setHelpText(MainGeneralSettings::tr("If enabled, you can use a virtual "
1939 "keyboard in MythTV's line edit "
1940 "boxes. To use, hit SELECT (Enter "
1941 "or Space) while a line edit is in "
1942 "focus."));
1943 return gc;
1944}
1945
1947{
1948 auto *gs = new HostSpinBoxSetting("FrontendIdleTimeout", 0, 360, 5);
1949
1950 gs->setLabel(MainGeneralSettings::tr("Idle time before entering standby "
1951 "mode (minutes)"));
1952
1953 gs->setValue(90);
1954
1955 gs->setHelpText(MainGeneralSettings::tr("Number of minutes to wait when "
1956 "the frontend is idle before "
1957 "entering standby mode. Standby "
1958 "mode allows the backend to power "
1959 "down if configured to do so. Any "
1960 "remote or mouse input will cause "
1961 "the countdown to start again "
1962 "and/or exit idle mode. Video "
1963 "playback suspends the countdown. "
1964 "A value of zero prevents the "
1965 "frontend automatically entering "
1966 "standby."));
1967 return gs;
1968}
1969
1971{
1972 auto * checkbox = new HostCheckBoxSetting("ConfirmPowerEvent");
1973 checkbox->setLabel(MainGeneralSettings::tr("Confirm before suspending/shutting down"));
1974 checkbox->setHelpText(MainGeneralSettings::tr(
1975 "If enabled (the default) then the user will always be asked to confirm before the system "
1976 "is shutdown, suspended or rebooted."));
1977 checkbox->setValue(true);
1978 return checkbox;
1979}
1980
1982{
1983 auto *gc = new HostComboBoxSetting("OverrideExitMenu");
1984
1985 gc->setLabel(MainGeneralSettings::tr("Customize exit menu options"));
1986
1987 gc->addSelection(MainGeneralSettings::tr("Default"), "0");
1988 gc->addSelection(MainGeneralSettings::tr("Show quit"), "1");
1989 gc->addSelection(MainGeneralSettings::tr("Show quit and suspend"), "9");
1990 gc->addSelection(MainGeneralSettings::tr("Show quit and shutdown"), "2");
1991 gc->addSelection(MainGeneralSettings::tr("Show quit, reboot and shutdown"), "3");
1992 gc->addSelection(MainGeneralSettings::tr("Show quit, reboot, shutdown and suspend"), "10");
1993 gc->addSelection(MainGeneralSettings::tr("Show shutdown"), "4");
1994 gc->addSelection(MainGeneralSettings::tr("Show reboot"), "5");
1995 gc->addSelection(MainGeneralSettings::tr("Show reboot and shutdown"), "6");
1996 gc->addSelection(MainGeneralSettings::tr("Show standby"), "7");
1997 gc->addSelection(MainGeneralSettings::tr("Show suspend"), "8");
1998
1999 QString helptext = MainGeneralSettings::tr("By default, only remote frontends are shown "
2000 "the shutdown option on the exit menu. Here "
2001 "you can force specific shutdown, reboot and suspend "
2002 "options to be displayed.");
2003 if (Power)
2004 {
2005 QStringList supported = Power->GetFeatureList();
2006 if (!supported.isEmpty())
2007 {
2008 helptext.prepend(MainGeneralSettings::tr(
2009 "This system supports '%1' without additional setup. ")
2010 .arg(supported.join(", ")));
2011 }
2012 else
2013 {
2014 helptext.append(MainGeneralSettings::tr(
2015 " This system appears to have no power options available. Try "
2016 "setting the Halt/Reboot/Suspend commands below."));
2017 }
2018 }
2019 gc->setHelpText(helptext);
2020
2021 return gc;
2022}
2023
2024#ifndef Q_OS_ANDROID
2026{
2027 auto *ge = new HostTextEditSetting("RebootCommand");
2028 ge->setLabel(MainGeneralSettings::tr("Reboot command"));
2029 ge->setValue("");
2030 QString help = MainGeneralSettings::tr(
2031 "Optional. Script to run if you select the reboot option from the "
2032 "exit menu, if the option is displayed. You must configure an "
2033 "exit key to display the exit menu.");
2034 if (Power && Power->IsFeatureSupported(MythPower::FeatureRestart))
2035 {
2036 help.append(MainGeneralSettings::tr(
2037 " Note: This system appears to support reboot without using this setting."));
2038 }
2039 ge->setHelpText(help);
2040 return ge;
2041}
2042
2044{
2045 auto *suspend = new HostTextEditSetting("SuspendCommand");
2046 suspend->setLabel(MainGeneralSettings::tr("Suspend command"));
2047 suspend->setValue("");
2048 QString help = MainGeneralSettings::tr(
2049 "Optional: Script to run if you select the suspend option from the "
2050 "exit menu, if the option is displayed.");
2051
2052 if (Power && Power->IsFeatureSupported(MythPower::FeatureSuspend))
2053 {
2054 help.append(MainGeneralSettings::tr(
2055 " Note: This system appears to support suspend without using this setting."));
2056 }
2057 suspend->setHelpText(help);
2058 return suspend;
2059}
2060
2062{
2063 auto *ge = new HostTextEditSetting("HaltCommand");
2064 ge->setLabel(MainGeneralSettings::tr("Halt command"));
2065 ge->setValue("");
2066 QString help = MainGeneralSettings::tr("Optional. Script to run if you "
2067 "select the shutdown option from "
2068 "the exit menu, if the option is "
2069 "displayed. You must configure an "
2070 "exit key to display the exit "
2071 "menu.");
2073 {
2074 help.append(MainGeneralSettings::tr(
2075 " Note: This system appears to support shutdown without using this setting."));
2076 }
2077
2078 ge->setHelpText(help);
2079 return ge;
2080}
2081#endif
2082
2084{
2085 auto *ge = new HostTextEditSetting("LircSocket");
2086
2087 ge->setLabel(MainGeneralSettings::tr("LIRC daemon socket"));
2088
2089 /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
2090 QString lirc_socket = "/dev/lircd";
2091
2092 if (!QFile::exists(lirc_socket))
2093 lirc_socket = "/var/run/lirc/lircd";
2094
2095 ge->setValue(lirc_socket);
2096
2097 QString help = MainGeneralSettings::tr("UNIX socket or IP address[:port] "
2098 "to connect in order to communicate "
2099 "with the LIRC Daemon.");
2100 ge->setHelpText(help);
2101
2102 return ge;
2103}
2104
2105#if CONFIG_LIBCEC
2106static HostTextEditSetting *CECDevice()
2107{
2108 auto *ge = new HostTextEditSetting("libCECDevice");
2109
2110 ge->setLabel(MainGeneralSettings::tr("CEC Device"));
2111
2112 ge->setValue("/dev/cec0");
2113
2114 QString help = MainGeneralSettings::tr("CEC Device. Default is /dev/cec0 "
2115 "if you have only 1 HDMI output "
2116 "port.");
2117 ge->setHelpText(help);
2118
2119 return ge;
2120}
2121#endif
2122
2123
2125{
2126 auto *ge = new HostTextEditSetting("ScreenShotPath");
2127
2128 ge->setLabel(MainGeneralSettings::tr("Screen shot path"));
2129
2130 ge->setValue("/tmp/");
2131
2132 ge->setHelpText(MainGeneralSettings::tr("Path to screenshot storage "
2133 "location. Should be writable "
2134 "by the frontend"));
2135
2136 return ge;
2137}
2138
2140{
2141 auto *ge = new HostTextEditSetting("SetupPinCode");
2142
2143 ge->setLabel(MainGeneralSettings::tr("Setup PIN code"));
2144
2145 ge->setHelpText(MainGeneralSettings::tr("This PIN is used to control "
2146 "access to the setup menus. "
2147 "If you want to use this feature, "
2148 "then setting the value to all "
2149 "numbers will make your life much "
2150 "easier. Set it to blank to "
2151 "disable. If enabled, you will not "
2152 "be able to return to this screen "
2153 "and reset the Setup PIN without "
2154 "first entering the current PIN."));
2155 return ge;
2156}
2157
2159{
2160 auto *gc = new HostComboBoxSetting("XineramaScreen", false);
2161 gc->setLabel(AppearanceSettings::tr("Display on screen"));
2162 gc->setValue(0);
2163 gc->setHelpText(AppearanceSettings::tr("Run on the specified screen or "
2164 "spanning all screens."));
2165 return gc;
2166}
2167
2168
2170{
2171 auto *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio");
2172
2173 gc->setLabel(AppearanceSettings::tr("Screen aspect ratio"));
2174 gc->addSelection(AppearanceSettings::tr("Auto (Assume square pixels)"), "-1.0");
2175 gc->addSelection(AppearanceSettings::tr("Auto (Detect from display)"), "0.0");
2176 gc->addSelection("16:9", "1.7777");
2177 gc->addSelection("16:10", "1.6");
2178 gc->addSelection("21:9", "2.3704"); // N.B. Actually 64:27
2179 gc->addSelection("32:9", "3.5555");
2180 gc->addSelection("256:135", "1.8963"); // '4K HD'
2181 gc->addSelection("3:2", "1.5");
2182 gc->addSelection("5:4", "1.25");
2183 gc->addSelection("4:3", "1.3333");
2184 gc->addSelection(AppearanceSettings::tr("16:18 (16:9 Above and below)"), "0.8888");
2185 gc->addSelection(AppearanceSettings::tr("32:10 (16:10 Side by side)"), "3.2");
2186 gc->addSelection(AppearanceSettings::tr("16:20 (16:10 Above and below)"), "0.8");
2187 gc->setHelpText(AppearanceSettings::tr(
2188 "This setting applies to video playback only, not to the GUI. "
2189 "Most modern displays have square pixels and the aspect ratio of the screen can be "
2190 "computed from the resolution (default). "
2191 "The aspect ratio can also be automatically detected from the connected display "
2192 "- though this may be slightly less accurate. If automatic detection fails, the correct "
2193 "aspect ratio can be specified here. Note: Some values (e.g 32:10) are "
2194 "primarily intended for multiscreen setups."));
2195 return gc;
2196}
2197
2199{
2200 auto *gc = new HostComboBoxSetting("LetterboxColour");
2201
2202 gc->setLabel(PlaybackSettings::tr("Letterboxing color"));
2203
2204 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
2205 gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
2206
2207 gc->setHelpText(PlaybackSettings::tr("By default MythTV uses black "
2208 "letterboxing to match broadcaster "
2209 "letterboxing, but those with plasma "
2210 "screens may prefer gray to minimize "
2211 "burn-in."));
2212 return gc;
2213}
2214
2216{
2217 auto * cb = new HostCheckBoxSetting("DiscardStereo3D");
2218 cb->setLabel(PlaybackSettings::tr("Discard 3D stereoscopic fields"));
2219 cb->setHelpText(PlaybackSettings::tr(
2220 "If 'Side by Side' or 'Top and Bottom' 3D material is detected, "
2221 "enabling this setting will discard one field (enabled by default)."));
2222 cb->setValue(true);
2223 return cb;
2224}
2225
2227{
2228 auto *gc = new HostComboBoxSetting("AspectOverride");
2229
2230 gc->setLabel(PlaybackSettings::tr("Video aspect override"));
2231
2232 for (int m = kAspect_Off; m < kAspect_END; ++m)
2233 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
2234
2235 gc->setHelpText(PlaybackSettings::tr("When enabled, these will override "
2236 "the aspect ratio specified by any "
2237 "broadcaster for all video streams."));
2238 return gc;
2239}
2240
2242{
2243 auto *gc = new HostComboBoxSetting("AdjustFill");
2244
2245 gc->setLabel(PlaybackSettings::tr("Zoom"));
2246
2247 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
2248 gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
2250 QString::number(kAdjustFill_AutoDetect_DefaultOff));
2252 QString::number(kAdjustFill_AutoDetect_DefaultHalf));
2253
2254 gc->setHelpText(PlaybackSettings::tr("When enabled, these will apply a "
2255 "predefined zoom to all video "
2256 "playback in MythTV."));
2257 return gc;
2258}
2259
2260// Theme settings
2261
2263{
2264 auto *gs = new HostSpinBoxSetting("GuiWidth", 0, 3840, 8, 1);
2265
2266 gs->setLabel(AppearanceSettings::tr("GUI width (pixels)"));
2267
2268 gs->setValue(0);
2269
2270 gs->setHelpText(AppearanceSettings::tr("The width of the GUI. Do not make "
2271 "the GUI wider than your actual "
2272 "screen resolution. Set to 0 to "
2273 "automatically scale to "
2274 "fullscreen."));
2275 return gs;
2276}
2277
2279{
2280 auto *gs = new HostSpinBoxSetting("GuiHeight", 0, 2160, 8, 1);
2281
2282 gs->setLabel(AppearanceSettings::tr("GUI height (pixels)"));
2283
2284 gs->setValue(0);
2285
2286 gs->setHelpText(AppearanceSettings::tr("The height of the GUI. Do not make "
2287 "the GUI taller than your actual "
2288 "screen resolution. Set to 0 to "
2289 "automatically scale to "
2290 "fullscreen."));
2291 return gs;
2292}
2293
2295{
2296 auto *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, 1);
2297
2298 gs->setLabel(AppearanceSettings::tr("GUI X offset"));
2299
2300 gs->setValue(0);
2301
2302 gs->setHelpText(AppearanceSettings::tr("The horizontal offset where the "
2303 "GUI will be displayed. May only "
2304 "work if run in a window."));
2305 return gs;
2306}
2307
2309{
2310 auto *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, 1);
2311
2312 gs->setLabel(AppearanceSettings::tr("GUI Y offset"));
2313
2314 gs->setValue(0);
2315
2316 gs->setHelpText(AppearanceSettings::tr("The vertical offset where the "
2317 "GUI will be displayed."));
2318 return gs;
2319}
2320
2322{
2323 auto *gc = new HostCheckBoxSetting("GuiSizeForTV");
2324
2325 gc->setLabel(AppearanceSettings::tr("Use GUI size for TV playback"));
2326
2327 gc->setValue(true);
2328
2329 gc->setHelpText(AppearanceSettings::tr("If enabled, use the above size for "
2330 "TV, otherwise use full screen."));
2331 return gc;
2332}
2333
2335{
2336 auto *gc = new HostCheckBoxSetting("ForceFullScreen");
2337
2338 gc->setLabel(AppearanceSettings::tr("Force Full Screen for GUI and TV playback"));
2339
2340 gc->setValue(false);
2341
2342 gc->setHelpText(AppearanceSettings::tr(
2343 "Use Full Screen for GUI and TV playback independent of the settings for "
2344 "the GUI dimensions. This does not change the values of the GUI dimensions "
2345 "so it is easy to switch from window mode to full screen and back."));
2346 return gc;
2347}
2348
2350{
2351 HostCheckBoxSetting *gc = new VideoModeSettings("UseVideoModes");
2352
2353 gc->setLabel(VideoModeSettings::tr("Separate video modes for GUI and "
2354 "TV playback"));
2355
2356 gc->setValue(false);
2357
2358 gc->setHelpText(VideoModeSettings::tr(
2359 "Switch video modes for playback depending on the source "
2360 "resolution and frame rate."));
2361 return gc;
2362}
2363
2365{
2366 auto *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
2367 0, 3840, 16, 1);
2368
2369 gs->setLabel(VideoModeSettings::tr("In X", "Video mode width"));
2370
2371 gs->setValue(0);
2372
2373 gs->setHelpText(VideoModeSettings::tr("Horizontal resolution of video "
2374 "which needs a special output "
2375 "resolution."));
2376 return gs;
2377}
2378
2380{
2381 auto *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
2382 0, 2160, 16, 1);
2383
2384 gs->setLabel(VideoModeSettings::tr("In Y", "Video mode height"));
2385
2386 gs->setValue(0);
2387
2388 gs->setHelpText(VideoModeSettings::tr("Vertical resolution of video "
2389 "which needs a special output "
2390 "resolution."));
2391 return gs;
2392}
2393
2395{
2396 auto *gc = new HostComboBoxSetting("GuiVidModeResolution");
2397
2398 gc->setLabel(VideoModeSettings::tr("GUI"));
2399
2400 gc->setHelpText(VideoModeSettings::tr("Resolution of screen when not "
2401 "watching a video."));
2402
2404 std::vector<MythDisplayMode> scr = display->GetVideoModes();
2405 for (auto & vmode : scr)
2406 {
2407 int w = vmode.Width();
2408 int h = vmode.Height();
2409 QString sel = QString("%1x%2").arg(w).arg(h);
2410 gc->addSelection(sel, sel);
2411 }
2412
2413 // if no resolution setting, set it with a reasonable initial value
2414 if (!scr.empty() && (gCoreContext->GetSetting("GuiVidModeResolution").isEmpty()))
2415 {
2416 int w = 0;
2417 int h = 0;
2418 gCoreContext->GetResolutionSetting("GuiVidMode", w, h);
2419 if ((w <= 0) || (h <= 0))
2420 {
2421 w = 640;
2422 h = 480;
2423 }
2424
2425 MythDisplayMode dscr(w, h, -1, -1, -1.0, 0);
2426 double rate = -1.0;
2427 int i = MythDisplayMode::FindBestMatch(scr, dscr, rate);
2428 gc->setValue((i >= 0) ? i : scr.size() - 1);
2429 }
2430
2431 return gc;
2432}
2433
2435{
2436 QString dhelp = VideoModeSettings::tr("Default screen resolution "
2437 "when watching a video.");
2438 QString ohelp = VideoModeSettings::tr("Screen resolution when watching a "
2439 "video at a specific resolution.");
2440
2441 QString qstr = (idx<0) ? "TVVidModeResolution" :
2442 QString("TVVidModeResolution%1").arg(idx);
2443 auto *gc = new HostComboBoxSetting(qstr);
2444 QString lstr = (idx<0) ? VideoModeSettings::tr("Video output") :
2445 VideoModeSettings::tr("Output");
2446 QString hstr = (idx<0) ? dhelp : ohelp;
2447
2448 gc->setLabel(lstr);
2449
2450 gc->setHelpText(hstr);
2451
2453 std::vector<MythDisplayMode> scr = display->GetVideoModes();
2454 for (auto & vmode : scr)
2455 {
2456 QString sel = QString("%1x%2").arg(vmode.Width()).arg(vmode.Height());
2457 gc->addSelection(sel, sel);
2458 }
2459
2460 return gc;
2461}
2462
2464{
2465 const QString previousValue = getValue();
2466 const bool wasUnchanged = !haveChanged();
2467
2469 QString resolution = setting->getValue();
2470 int hz50 = -1;
2471 int hz60 = -1;
2472 const std::vector<double> list = GetRefreshRates(resolution);
2473 addSelection(QObject::tr("Auto"), "0");
2474 for (size_t i = 0; i < list.size(); ++i)
2475 {
2476 QString sel = QString::number((double) list[i], 'f', 3);
2477 addSelection(sel + " Hz", sel, sel == previousValue);
2478 hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
2479 hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
2480 }
2481
2482 // addSelection() will cause setValue() to be called, marking the setting as
2483 // changed even though the previous value might still be available. Mark it
2484 // as unchanged in this case if it wasn't already changed.
2485 if (wasUnchanged && previousValue == getValue())
2486 setChanged(false);
2487 else
2488 {
2489 if ("640x480" == resolution || "720x480" == resolution)
2490 setValue(hz60+1);
2491 if ("640x576" == resolution || "720x576" == resolution)
2492 setValue(hz50+1);
2493 }
2494
2495 setEnabled(!list.empty());
2496}
2497
2498std::vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res)
2499{
2500 QStringList slist = res.split("x");
2501 int width = 0;
2502 int height = 0;
2503 bool ok0 = false;
2504 bool ok1 = false;
2505 if (2 == slist.size())
2506 {
2507 width = slist[0].toInt(&ok0);
2508 height = slist[1].toInt(&ok1);
2509 }
2510
2511 std::vector<double> result;
2512 if (ok0 && ok1)
2513 {
2514 QSize size(width, height);
2516 result = display->GetRefreshRates(size);
2517 }
2518 return result;
2519}
2520
2522{
2523 QString dhelp = VideoModeSettings::tr("Default refresh rate when watching "
2524 "a video. Leave at \"Auto\" to "
2525 "automatically use the best "
2526 "available");
2527 QString ohelp = VideoModeSettings::tr("Refresh rate when watching a "
2528 "video at a specific resolution. "
2529 "Leave at \"Auto\" to automatically "
2530 "use the best available");
2531
2532 QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
2533 QString("TVVidModeRefreshRate%1").arg(idx);
2534 auto *gc = new HostRefreshRateComboBoxSetting(qstr);
2535 QString lstr = VideoModeSettings::tr("Rate");
2536 QString hstr = (idx<0) ? dhelp : ohelp;
2537
2538 gc->setLabel(lstr);
2539 gc->setHelpText(hstr);
2540 gc->setEnabled(false);
2541 return gc;
2542}
2543
2545{
2546 QString dhelp = VideoModeSettings::tr("Aspect ratio when watching a "
2547 "video. Leave at \"%1\" to "
2548 "use ratio reported by the monitor. "
2549 "Set to 16:9 or 4:3 to force a "
2550 "specific aspect ratio.");
2551
2552
2553
2554 QString ohelp = VideoModeSettings::tr("Aspect ratio when watching a "
2555 "video at a specific resolution. "
2556 "Leave at \"%1\" to use ratio "
2557 "reported by the monitor. Set to "
2558 "16:9 or 4:3 to force a specific "
2559 "aspect ratio.");
2560
2561 QString qstr = (idx<0) ? "TVVidModeForceAspect" :
2562 QString("TVVidModeForceAspect%1").arg(idx);
2563
2564 auto *gc = new HostComboBoxSetting(qstr);
2565
2566 gc->setLabel(VideoModeSettings::tr("Aspect"));
2567
2568 QString hstr = (idx<0) ? dhelp : ohelp;
2569
2570 gc->setHelpText(hstr.arg(VideoModeSettings::tr("Default")));
2571
2572 gc->addSelection(VideoModeSettings::tr("Default"), "0.0");
2573 gc->addSelection("16:9", "1.77777777777");
2574 gc->addSelection("4:3", "1.33333333333");
2575
2576 return gc;
2577}
2578
2580{
2582 item->setDrawArrow(getValue() == "1");
2583}
2584
2586{
2587 auto *pause = new HostSpinBoxSetting("VideoModeChangePauseMS", 0, 5000, 100);
2588 pause->setLabel(VideoModeSettings::tr("Pause while switching video modes (ms)"));
2589 pause->setHelpText(VideoModeSettings::tr(
2590 "For most displays, switching video modes takes time and content can be missed. "
2591 "If non-zero, this setting will pause playback while the video mode is changed. "
2592 "The required pause length (in ms) will be dependant on the display's characteristics."));
2593 pause->setValue(0);
2594 return pause;
2595}
2596
2598{
2602
2604 addChild(res);
2605 addChild(rate);
2607 addChild(pause);
2608 connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2610
2611 auto *overrides = new GroupSetting();
2612
2613 overrides->setLabel(tr("Overrides for specific video sizes"));
2614
2615 for (int idx = 0; idx < 3; ++idx)
2616 {
2617 //input side
2618 overrides->addChild(VidModeWidth(idx));
2619 overrides->addChild(VidModeHeight(idx));
2620 // output side
2621 overrides->addChild(res = TVVidModeResolution(idx));
2622 overrides->addChild(rate = TVVidModeRefreshRate(idx));
2623 overrides->addChild(TVVidModeForceAspect(idx));
2624
2625 connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2627 }
2628
2629 addChild(overrides);
2630};
2631
2633{
2634 auto *gc = new HostCheckBoxSetting("HideMouseCursor");
2635
2636 gc->setLabel(AppearanceSettings::tr("Hide mouse cursor in MythTV"));
2637
2638 gc->setValue(false);
2639
2640 gc->setHelpText(AppearanceSettings::tr("Toggles mouse cursor visibility "
2641 "for touchscreens. By default "
2642 "MythTV will auto-hide the cursor "
2643 "if the mouse doesn't move for a "
2644 "period, this setting disables the "
2645 "cursor entirely."));
2646 return gc;
2647};
2648
2649
2651{
2652 auto *gc = new HostCheckBoxSetting("RunFrontendInWindow");
2653
2654 gc->setLabel(AppearanceSettings::tr("Use window border"));
2655
2656 gc->setValue(false);
2657
2658 gc->setHelpText(AppearanceSettings::tr("Toggles between windowed and "
2659 "borderless operation."));
2660 return gc;
2661}
2662
2664{
2665 auto *gc = new HostCheckBoxSetting("AlwaysOnTop");
2666
2667 gc->setLabel(AppearanceSettings::tr("Always On Top"));
2668
2669 gc->setValue(false);
2670
2671 gc->setHelpText(AppearanceSettings::tr("If enabled, MythTV will always be "
2672 "on top"));
2673 return gc;
2674}
2675
2677{
2678 auto *gc = new HostCheckBoxSetting("SmoothTransitions");
2679
2680 gc->setLabel(AppearanceSettings::tr("Smooth Transitions"));
2681
2682 gc->setValue(true);
2683
2684 gc->setHelpText(AppearanceSettings::tr("Enable smooth transitions with fade-in and fade-out of menu pages and enable GUI animations. "
2685 "Disabling this can make the GUI respond faster especially on low-powered machines."));
2686 return gc;
2687}
2688
2690{
2691 auto *gs = new HostSpinBoxSetting("StartupScreenDelay", -1, 60, 1, 1,
2692 "Never show startup screen");
2693
2694 gs->setLabel(AppearanceSettings::tr("Startup Screen Delay"));
2695
2696 gs->setValue(2);
2697
2698 gs->setHelpText(AppearanceSettings::tr(
2699 "The Startup Screen will show the progress of starting the frontend "
2700 "if frontend startup takes longer than this number of seconds."));
2701 return gs;
2702}
2703
2704
2706{
2707 auto *gs = new HostSpinBoxSetting("GUITEXTZOOM", 50, 150, 1, 1);
2708
2709 gs->setLabel(AppearanceSettings::tr("GUI text zoom percentage"));
2710
2711 gs->setValue(100);
2712
2713 gs->setHelpText(AppearanceSettings::tr
2714 ("Adjust the themed defined font size by this percentage. "
2715 "mythfrontend needs restart for this to take effect."));
2716 return gs;
2717}
2718
2719
2721{
2722 auto *gc = new HostComboBoxSetting("DateFormat");
2723 gc->setLabel(AppearanceSettings::tr("Date format"));
2724
2725 QDate sampdate = MythDate::current().toLocalTime().date();
2726 QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2727 "today's date.");
2728
2729 if (sampdate.month() == sampdate.day())
2730 {
2731 sampdate = sampdate.addDays(1);
2732 sampleStr = AppearanceSettings::tr("Samples are shown using "
2733 "tomorrow's date.");
2734 }
2735
2736 QLocale locale = gCoreContext->GetQLocale();
2737
2738 gc->addSelection(locale.toString(sampdate, "ddd MMM d"), "ddd MMM d");
2739 gc->addSelection(locale.toString(sampdate, "ddd d MMM"), "ddd d MMM");
2740 gc->addSelection(locale.toString(sampdate, "ddd MMMM d"), "ddd MMMM d");
2741 gc->addSelection(locale.toString(sampdate, "ddd d MMMM"), "ddd d MMMM");
2742 gc->addSelection(locale.toString(sampdate, "dddd MMM d"), "dddd MMM d");
2743 gc->addSelection(locale.toString(sampdate, "dddd d MMM"), "dddd d MMM");
2744 gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2745 gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2746 gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2747 gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2748 gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2749 gc->addSelection(locale.toString(sampdate, "dd.MM"), "dd.MM");
2750 gc->addSelection(locale.toString(sampdate, "M/d/yyyy"), "M/d/yyyy");
2751 gc->addSelection(locale.toString(sampdate, "d/M/yyyy"), "d/M/yyyy");
2752 gc->addSelection(locale.toString(sampdate, "MM.dd.yyyy"), "MM.dd.yyyy");
2753 gc->addSelection(locale.toString(sampdate, "dd.MM.yyyy"), "dd.MM.yyyy");
2754 gc->addSelection(locale.toString(sampdate, "yyyy-MM-dd"), "yyyy-MM-dd");
2755 gc->addSelection(locale.toString(sampdate, "ddd MMM d yyyy"), "ddd MMM d yyyy");
2756 gc->addSelection(locale.toString(sampdate, "ddd d MMM yyyy"), "ddd d MMM yyyy");
2757 gc->addSelection(locale.toString(sampdate, "ddd yyyy-MM-dd"), "ddd yyyy-MM-dd");
2758
2759 QString cn_long = QString("dddd yyyy") + QChar(0x5E74) +
2760 "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd yyyy年M月d日
2761 gc->addSelection(locale.toString(sampdate, cn_long), cn_long);
2762 QString cn_med = QString("dddd ") +
2763 "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd M月d日
2764
2765 gc->addSelection(locale.toString(sampdate, cn_med), cn_med);
2766
2767 //: %1 gives additional information regarding the date format
2768 gc->setHelpText(AppearanceSettings::tr("Your preferred date format. %1")
2769 .arg(sampleStr));
2770
2771 return gc;
2772}
2773
2775{
2776 auto *gc = new HostComboBoxSetting("ShortDateFormat");
2777 gc->setLabel(AppearanceSettings::tr("Short date format"));
2778
2779 QDate sampdate = MythDate::current().toLocalTime().date();
2780
2781 QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2782 "today's date.");
2783
2784 if (sampdate.month() == sampdate.day())
2785 {
2786 sampdate = sampdate.addDays(1);
2787 sampleStr = AppearanceSettings::tr("Samples are shown using "
2788 "tomorrow's date.");
2789 }
2790 QLocale locale = gCoreContext->GetQLocale();
2791
2792 gc->addSelection(locale.toString(sampdate, "M/d"), "M/d");
2793 gc->addSelection(locale.toString(sampdate, "d/M"), "d/M");
2794 gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2795 gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2796 gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2797 gc->addSelection(locale.toString(sampdate, "dd.MM."), "dd.MM.");
2798 gc->addSelection(locale.toString(sampdate, "M.d."), "M.d.");
2799 gc->addSelection(locale.toString(sampdate, "d.M."), "d.M.");
2800 gc->addSelection(locale.toString(sampdate, "MM-dd"), "MM-dd");
2801 gc->addSelection(locale.toString(sampdate, "dd-MM"), "dd-MM");
2802 gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2803 gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2804 gc->addSelection(locale.toString(sampdate, "ddd d"), "ddd d");
2805 gc->addSelection(locale.toString(sampdate, "d ddd"), "d ddd");
2806 gc->addSelection(locale.toString(sampdate, "ddd M/d"), "ddd M/d");
2807 gc->addSelection(locale.toString(sampdate, "ddd d/M"), "ddd d/M");
2808 gc->addSelection(locale.toString(sampdate, "ddd d.M"), "ddd d.M");
2809 gc->addSelection(locale.toString(sampdate, "ddd dd.MM"), "ddd dd.MM");
2810 gc->addSelection(locale.toString(sampdate, "M/d ddd"), "M/d ddd");
2811 gc->addSelection(locale.toString(sampdate, "d/M ddd"), "d/M ddd");
2812
2813 QString cn_short1 = QString("M") + QChar(0x6708) + "d" + QChar(0x65E5); // M月d日
2814
2815 gc->addSelection(locale.toString(sampdate, cn_short1), cn_short1);
2816
2817 QString cn_short2 = QString("ddd M") + QChar(0x6708) + "d" + QChar(0x65E5); // ddd M月d日
2818
2819 gc->addSelection(locale.toString(sampdate, cn_short2), cn_short2);
2820
2821 //: %1 gives additional information regarding the date format
2822 gc->setHelpText(AppearanceSettings::tr("Your preferred short date format. %1")
2823 .arg(sampleStr));
2824 return gc;
2825}
2826
2828{
2829 auto *gc = new HostComboBoxSetting("TimeFormat");
2830
2831 gc->setLabel(AppearanceSettings::tr("Time format"));
2832
2833 QTime samptime = QTime::currentTime();
2834
2835 QLocale locale = gCoreContext->GetQLocale();
2836
2837 gc->addSelection(locale.toString(samptime, "h:mm AP"), "h:mm AP");
2838 gc->addSelection(locale.toString(samptime, "h:mm ap"), "h:mm ap");
2839 gc->addSelection(locale.toString(samptime, "hh:mm AP"), "hh:mm AP");
2840 gc->addSelection(locale.toString(samptime, "hh:mm ap"), "hh:mm ap");
2841 gc->addSelection(locale.toString(samptime, "h:mm"), "h:mm");
2842 gc->addSelection(locale.toString(samptime, "hh:mm"), "hh:mm");
2843 gc->addSelection(locale.toString(samptime, "hh.mm"), "hh.mm");
2844 gc->addSelection(locale.toString(samptime, "AP h:mm"), "AP h:mm");
2845
2846 gc->setHelpText(AppearanceSettings::tr("Your preferred time format. You "
2847 "must choose a format with \"AM\" "
2848 "or \"PM\" in it, otherwise your "
2849 "time display will be 24-hour or "
2850 "\"military\" time."));
2851 return gc;
2852}
2853
2855{
2856 auto *rgb = new HostCheckBoxSetting("GUIRGBLevels");
2857 rgb->setLabel(AppearanceSettings::tr("Use full range RGB output"));
2858 rgb->setValue(true);
2859 rgb->setHelpText(AppearanceSettings::tr(
2860 "Enable (recommended) to supply full range RGB output to your display device. "
2861 "Disable to supply limited range RGB output. This setting applies to both the "
2862 "GUI and media playback. Ideally the value of this setting should match a "
2863 "similar setting on your TV or monitor."));
2864 return rgb;
2865}
2866
2868{
2869 auto *gc = new HostComboBoxSetting("ChannelFormat");
2870
2871 gc->setLabel(GeneralSettings::tr("Channel format"));
2872
2873 gc->addSelection(GeneralSettings::tr("number"), "<num>");
2874 gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2875 gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2876 gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2877 gc->addSelection(GeneralSettings::tr("name"), "<name>");
2878
2879 gc->setHelpText(GeneralSettings::tr("Your preferred channel format."));
2880
2881 gc->setValue(1);
2882
2883 return gc;
2884}
2885
2887{
2888 auto *gc = new HostComboBoxSetting("LongChannelFormat");
2889
2890 gc->setLabel(GeneralSettings::tr("Long channel format"));
2891
2892 gc->addSelection(GeneralSettings::tr("number"), "<num>");
2893 gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2894 gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2895 gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2896 gc->addSelection(GeneralSettings::tr("name"), "<name>");
2897
2898 gc->setHelpText(GeneralSettings::tr("Your preferred long channel format."));
2899
2900 gc->setValue(2);
2901
2902 return gc;
2903}
2904
2906{
2907 auto *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
2908
2909 gc->setLabel(ChannelGroupSettings::tr("Remember last channel group"));
2910
2911 gc->setHelpText(ChannelGroupSettings::tr("If enabled, the EPG will "
2912 "initially display only the "
2913 "channels from the last channel "
2914 "group selected. Pressing \"4\" "
2915 "will toggle channel group."));
2916
2917 gc->setValue(false);
2918
2919 return gc;
2920}
2921
2923{
2924 auto *gc = new HostComboBoxSetting("ChannelGroupDefault");
2925
2926 gc->setLabel(ChannelGroupSettings::tr("Default channel group"));
2927
2928 ChannelGroupList changrplist;
2929
2930 changrplist = ChannelGroup::GetChannelGroups();
2931
2932 gc->addSelection(ChannelGroupSettings::tr("All Channels"), "-1");
2933
2934 ChannelGroupList::iterator it;
2935
2936 for (it = changrplist.begin(); it < changrplist.end(); ++it)
2937 gc->addSelection(it->m_name, QString("%1").arg(it->m_grpId));
2938
2939 gc->setHelpText(ChannelGroupSettings::tr("Default channel group to be "
2940 "shown in the EPG. Pressing "
2941 "GUIDE key will toggle channel "
2942 "group."));
2943 gc->setValue(0);
2944
2945 return gc;
2946}
2947
2949{
2950 auto *gc = new HostCheckBoxSetting("BrowseChannelGroup");
2951
2952 gc->setLabel(GeneralSettings::tr("Browse/change channels from Channel "
2953 "Group"));
2954
2955 gc->setHelpText(GeneralSettings::tr("If enabled, Live TV will browse or "
2956 "change channels from the selected "
2957 "channel group. The \"All Channels\" "
2958 "channel group may be selected to "
2959 "browse all channels."));
2960 gc->setValue(false);
2961
2962 return gc;
2963}
2964
2965#if 0
2966static GlobalCheckBoxSetting *SortCaseSensitive()
2967{
2968 auto *gc = new GlobalCheckBoxSetting("SortCaseSensitive");
2969 gc->setLabel(GeneralSettings::tr("Case-sensitive sorting"));
2970 gc->setValue(false);
2971 gc->setHelpText(GeneralSettings::tr("If enabled, all sorting will be "
2972 "case-sensitive. This would mean "
2973 "that \"bee movie\" would sort after "
2974 "\"Sea World\" as lower case letters "
2975 "sort after uppercase letters."));
2976 return gc;
2977}
2978#endif
2979
2981{
2982 auto *gc = new GlobalCheckBoxSetting("SortStripPrefixes");
2983
2984 gc->setLabel(GeneralSettings::tr("Remove prefixes when sorting"));
2985 gc->setValue(true);
2986 gc->setHelpText(GeneralSettings::tr(
2987 "If enabled, all sorting will remove the common "
2988 "prefixes (The, A, An) from a string prior to "
2989 "sorting. For example, this would sort the titles "
2990 "\"Earth 2\", \"The Flash\", and \"Kings\" in that "
2991 "order. If disabled, they would sort as \"Earth 2\", "
2992 "\"Kings\", \"The Flash\"."));
2993 return gc;
2994}
2995
2997{
2998 auto *gc = new GlobalTextEditSetting("SortPrefixExceptions");
2999
3000 gc->setLabel(MainGeneralSettings::tr("Names exempt from prefix removal"));
3001 gc->setValue("");
3002 gc->setHelpText(MainGeneralSettings::tr(
3003 "This list of names will be exempt from removing "
3004 "the common prefixes (The, A, An) from a title or "
3005 "filename. Enter multiple names separated by "
3006 "semicolons."));
3007 return gc;
3008}
3009
3011{
3012 auto *gc = new GlobalComboBoxSetting("ManualRecordStartChanType");
3013
3014 gc->setLabel(GeneralSettings::tr("Starting channel for Manual Record"));
3015 gc->addSelection(GeneralSettings::tr("Guide Starting Channel"), "1", true);
3016 gc->addSelection(GeneralSettings::tr("Last Manual Record Channel"), "2");
3017 gc->setHelpText(GeneralSettings::tr(
3018 "When entering a new Manual Record Rule, "
3019 "the starting channel will default to this."));
3020 return gc;
3021}
3022
3023// General RecPriorities settings
3024
3026{
3027 auto *bc = new GlobalComboBoxSetting("SchedOpenEnd");
3028
3029 bc->setLabel(GeneralRecPrioritiesSettings::tr("Avoid back to back "
3030 "recordings"));
3031
3032 bc->setHelpText(
3033 GeneralRecPrioritiesSettings::tr("Selects the situations where the "
3034 "scheduler will avoid assigning shows "
3035 "to the same card if their end time "
3036 "and start time match. This will be "
3037 "allowed when necessary in order to "
3038 "resolve conflicts."));
3039
3040 bc->addSelection(GeneralRecPrioritiesSettings::tr("Never"), "0");
3041 bc->addSelection(GeneralRecPrioritiesSettings::tr("Different Channels"),
3042 "1");
3043 bc->addSelection(GeneralRecPrioritiesSettings::tr("Always"), "2");
3044
3045 bc->setValue(0);
3046
3047 return bc;
3048}
3049
3051{
3052 auto *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
3053
3054 bs->setLabel(GeneralRecPrioritiesSettings::tr("Preferred input priority"));
3055
3056 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3057 "a showing matches the "
3058 "preferred input selected "
3059 "in the 'Scheduling "
3060 "Options' section of the "
3061 "recording rule."));
3062
3063 bs->setValue(2);
3064 return bs;
3065}
3066
3068{
3069 auto *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
3070
3071 bs->setLabel(GeneralRecPrioritiesSettings::tr("HDTV recording priority"));
3072
3073 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3074 "a showing is marked as an "
3075 "HDTV broadcast in the TV "
3076 "listings."));
3077
3078 bs->setValue(0);
3079
3080 return bs;
3081}
3082
3084{
3085 auto *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
3086
3087 bs->setLabel(GeneralRecPrioritiesSettings::tr("Widescreen recording "
3088 "priority"));
3089
3090 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3091 "a showing is marked as "
3092 "widescreen in the TV "
3093 "listings."));
3094
3095 bs->setValue(0);
3096
3097 return bs;
3098}
3099
3101{
3102 auto *bs = new GlobalSpinBoxSetting("SignLangRecPriority", -99, 99, 1);
3103
3104 bs->setLabel(GeneralRecPrioritiesSettings::tr("Sign language recording "
3105 "priority"));
3106
3107 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3108 "when a showing is "
3109 "marked as having "
3110 "in-vision sign "
3111 "language."));
3112
3113 bs->setValue(0);
3114
3115 return bs;
3116}
3117
3119{
3120 auto *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority", -99, 99, 1);
3121
3122 bs->setLabel(GeneralRecPrioritiesSettings::tr("In-vision Subtitles "
3123 "Recording Priority"));
3124
3125 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3126 "when a showing is marked "
3127 "as having in-vision "
3128 "subtitles."));
3129
3130 bs->setValue(0);
3131
3132 return bs;
3133}
3134
3136{
3137 auto *bs = new GlobalSpinBoxSetting("CCRecPriority", -99, 99, 1);
3138
3139 bs->setLabel(GeneralRecPrioritiesSettings::tr("Subtitles/CC recording "
3140 "priority"));
3141
3142 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3143 "a showing is marked as "
3144 "having subtitles or "
3145 "closed captioning (CC) "
3146 "available."));
3147
3148 bs->setValue(0);
3149
3150 return bs;
3151}
3152
3154{
3155 auto *bs = new GlobalSpinBoxSetting("HardHearRecPriority", -99, 99, 1);
3156
3157 bs->setLabel(GeneralRecPrioritiesSettings::tr("Hard of hearing priority"));
3158
3159 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3160 "a showing is marked as "
3161 "having support for "
3162 "viewers with impaired "
3163 "hearing."));
3164
3165 bs->setValue(0);
3166
3167 return bs;
3168}
3169
3171{
3172 auto *bs = new GlobalSpinBoxSetting("AudioDescRecPriority", -99, 99, 1);
3173
3174 bs->setLabel(GeneralRecPrioritiesSettings::tr("Audio described priority"));
3175
3176 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3177 "a showing is marked as "
3178 "being Audio Described."));
3179
3180 bs->setValue(0);
3181
3182 return bs;
3183}
3184
3186{
3187 auto *ge = new HostTextEditSetting("DefaultTVChannel");
3188
3189 ge->setLabel(EPGSettings::tr("Guide starts at channel"));
3190
3191 ge->setValue("3");
3192
3193 ge->setHelpText(EPGSettings::tr("The program guide starts on this channel "
3194 "if it is run from outside of Live TV "
3195 "mode. Leave blank to enable Live TV "
3196 "automatic start channel."));
3197
3198 return ge;
3199}
3200
3202{
3203 auto *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
3204
3205 gs->setLabel(EPGSettings::tr("Record threshold"));
3206
3207 gs->setValue(16);
3208
3209 gs->setHelpText(EPGSettings::tr("Pressing SELECT on a show that is at "
3210 "least this many minutes into the future "
3211 "will schedule a recording."));
3212 return gs;
3213}
3214
3216{
3217 auto *gc = new GlobalComboBoxSetting("Language");
3218
3219 gc->setLabel(AppearanceSettings::tr("Menu Language"));
3220
3221 QMap<QString, QString> langMap = MythTranslation::getLanguages();
3222 QStringList langs = langMap.values();
3223 langs.sort();
3224 QString langCode = gCoreContext->GetSetting("Language").toLower();
3225
3226 if (langCode.isEmpty())
3227 langCode = "en_US";
3228
3229 gc->clearSelections();
3230
3231 for (const auto & label : std::as_const(langs))
3232 {
3233 QString value = langMap.key(label);
3234 gc->addSelection(label, value, (value.toLower() == langCode));
3235 }
3236
3237 gc->setHelpText(AppearanceSettings::tr("Your preferred language for the "
3238 "user interface."));
3239 return gc;
3240}
3241
3243{
3244 auto *gc = new GlobalComboBoxSetting("AudioLanguage");
3245
3246 gc->setLabel(AppearanceSettings::tr("Audio Language"));
3247
3248 QMap<QString, QString> langMap = MythTranslation::getLanguages();
3249 QStringList langs = langMap.values();
3250 langs.sort();
3251 QString langCode = gCoreContext->GetSetting("AudioLanguage").toLower();
3252
3253 if (langCode.isEmpty())
3254 {
3255 auto menuLangCode = gCoreContext->GetSetting("Language").toLower();
3256 langCode = menuLangCode.isEmpty() ? "en_US" : menuLangCode;
3257 }
3258
3259 gc->clearSelections();
3260
3261 for (const auto & label : std::as_const(langs))
3262 {
3263 QString value = langMap.key(label);
3264 gc->addSelection(label, value, (value.toLower() == langCode));
3265 }
3266
3267 gc->setHelpText(AppearanceSettings::tr("Preferred language for the "
3268 "audio track."));
3269 return gc;
3270}
3271
3273{
3274 widget->clearSelections();
3275 QString q = QString("ISO639Language%1").arg(i);
3276 QString lang = gCoreContext->GetSetting(q, "").toLower();
3277
3278 if ((lang.isEmpty() || lang == "aar") &&
3279 !gCoreContext->GetSetting("Language", "").isEmpty())
3280 {
3281 lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
3282 }
3283
3284 QMap<int,QString>::iterator it = iso639_key_to_english_name.begin();
3285 QMap<int,QString>::iterator ite = iso639_key_to_english_name.end();
3286
3287 for (; it != ite; ++it)
3288 {
3289 QString desc = (*it);
3290 int idx = desc.indexOf(";");
3291 if (idx > 0)
3292 desc = desc.left(idx);
3293
3294 const QString il = iso639_key_to_str3(it.key());
3295 widget->addSelection(desc, il, il == lang);
3296 }
3297}
3298
3300{
3301 auto *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
3302
3303 gc->setLabel(AppearanceSettings::tr("Guide language #%1").arg(i+1));
3304
3305 // We should try to get language from "MythLanguage"
3306 // then use code 2 to code 3 map in iso639.h
3308
3309 gc->setHelpText(AppearanceSettings::tr("Your #%1 preferred language for "
3310 "Program Guide data and captions.")
3311 .arg(i+1));
3312 return gc;
3313}
3314
3316{
3317 auto *gc = new HostCheckBoxSetting("NetworkControlEnabled");
3318
3319 gc->setLabel(MainGeneralSettings::tr("Enable Network Remote Control "
3320 "interface"));
3321
3322 gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3323 "controlling MythFrontend "
3324 "over the network."));
3325
3326 gc->setValue(false);
3327
3328 return gc;
3329}
3330
3332{
3333 auto *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
3334
3335 gs->setLabel(MainGeneralSettings::tr("Network Remote Control port"));
3336
3337 gs->setValue(6546);
3338
3339 gs->setHelpText(MainGeneralSettings::tr("This specifies what port the "
3340 "Network Remote Control "
3341 "interface will listen on for "
3342 "new connections."));
3343 return gs;
3344}
3345
3347{
3348 auto *ge = new HostTextEditSetting("UDPNotifyPort");
3349
3350 ge->setLabel(MainGeneralSettings::tr("UDP notify port"));
3351
3352 ge->setValue("6948");
3353
3354 ge->setHelpText(MainGeneralSettings::tr("MythTV will listen for "
3355 "connections from the "
3356 "\"mythutil\" program on "
3357 "this port."));
3358 return ge;
3359}
3360
3361#if CONFIG_LIBCEC
3362static HostCheckBoxSetting *CECEnabled()
3363{
3364 auto *gc = new HostCheckBoxSetting("libCECEnabled");
3365 gc->setLabel(MainGeneralSettings::tr("Enable CEC Control "
3366 "interface"));
3367 gc->setHelpText(MainGeneralSettings::tr("This enables "
3368 "controlling MythFrontend from a TV remote or powering the TV "
3369 "on and off from a MythTV remote "
3370 "if you have compatible hardware. "
3371 "These settings only take effect after a restart."));
3372 gc->setValue(true);
3373 return gc;
3374}
3375
3376static HostCheckBoxSetting *CECPowerOnTVAllowed()
3377{
3378 auto *gc = new HostCheckBoxSetting("PowerOnTVAllowed");
3379 gc->setLabel(MainGeneralSettings::tr("Allow Power On TV"));
3380 gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3381 "on from MythTV remote or when MythTV starts "
3382 "if you have compatible hardware."));
3383 gc->setValue(true);
3384 return gc;
3385}
3386
3387static HostCheckBoxSetting *CECPowerOffTVAllowed()
3388{
3389 auto *gc = new HostCheckBoxSetting("PowerOffTVAllowed");
3390 gc->setLabel(MainGeneralSettings::tr("Allow Power Off TV"));
3391 gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3392 "off from MythTV remote or when MythTV starts "
3393 "if you have compatible hardware."));
3394 gc->setValue(true);
3395 return gc;
3396}
3397
3398static HostCheckBoxSetting *CECPowerOnTVOnStart()
3399{
3400 auto *gc = new HostCheckBoxSetting("PowerOnTVOnStart");
3401 gc->setLabel(MainGeneralSettings::tr("Power on TV At Start"));
3402 gc->setHelpText(MainGeneralSettings::tr("Powers "
3403 "on your TV when you start MythTV "
3404 "if you have compatible hardware."));
3405 gc->setValue(true);
3406 return gc;
3407}
3408
3409static HostCheckBoxSetting *CECPowerOffTVOnExit()
3410{
3411 auto *gc = new HostCheckBoxSetting("PowerOffTVOnExit");
3412 gc->setLabel(MainGeneralSettings::tr("Power off TV At Exit"));
3413 gc->setHelpText(MainGeneralSettings::tr("Powers "
3414 "off your TV when you exit MythTV "
3415 "if you have compatible hardware."));
3416 gc->setValue(true);
3417 return gc;
3418}
3419
3420#endif // CONFIG_LIBCEC
3421
3422#if CONFIG_AIRPLAY
3423// AirPlay Settings
3424static HostCheckBoxSetting *AirPlayEnabled()
3425{
3426 auto *gc = new HostCheckBoxSetting("AirPlayEnabled");
3427
3428 gc->setLabel(MainGeneralSettings::tr("Enable AirPlay"));
3429
3430 gc->setHelpText(MainGeneralSettings::tr("AirPlay lets you wirelessly view "
3431 "content on your TV from your "
3432 "iPhone, iPad, iPod Touch, or "
3433 "iTunes on your computer."));
3434
3435 gc->setValue(true);
3436
3437 return gc;
3438}
3439
3440static HostCheckBoxSetting *AirPlayAudioOnly()
3441{
3442 auto *gc = new HostCheckBoxSetting("AirPlayAudioOnly");
3443
3444 gc->setLabel(MainGeneralSettings::tr("Only support AirTunes (no video)"));
3445
3446 gc->setHelpText(MainGeneralSettings::tr("Only stream audio from your "
3447 "iPhone, iPad, iPod Touch, or "
3448 "iTunes on your computer"));
3449
3450 gc->setValue(false);
3451
3452 return gc;
3453}
3454
3455static HostCheckBoxSetting *AirPlayPasswordEnabled()
3456{
3457 auto *gc = new HostCheckBoxSetting("AirPlayPasswordEnabled");
3458
3459 gc->setLabel(MainGeneralSettings::tr("Require password"));
3460
3461 gc->setValue(false);
3462
3463 gc->setHelpText(MainGeneralSettings::tr("Require a password to use "
3464 "AirPlay. Your iPhone, iPad, iPod "
3465 "Touch, or iTunes on your computer "
3466 "will prompt you when required"));
3467 return gc;
3468}
3469
3470static HostTextEditSetting *AirPlayPassword()
3471{
3472 auto *ge = new HostTextEditSetting("AirPlayPassword");
3473
3474 ge->setLabel(MainGeneralSettings::tr("Password"));
3475
3476 ge->setValue("0000");
3477
3478 ge->setHelpText(MainGeneralSettings::tr("Your iPhone, iPad, iPod Touch, or "
3479 "iTunes on your computer will "
3480 "prompt you for this password "
3481 "when required"));
3482 return ge;
3483}
3484
3485static GroupSetting *AirPlayPasswordSettings()
3486{
3487 auto *hc = new GroupSetting();
3488
3489 hc->setLabel(MainGeneralSettings::tr("AirPlay - Password"));
3490 hc->addChild(AirPlayPasswordEnabled());
3491 hc->addChild(AirPlayPassword());
3492
3493 return hc;
3494}
3495
3496static HostCheckBoxSetting *AirPlayFullScreen()
3497{
3498 auto *gc = new HostCheckBoxSetting("AirPlayFullScreen");
3499
3500 gc->setLabel(MainGeneralSettings::tr("AirPlay full screen playback"));
3501
3502 gc->setValue(false);
3503
3504 gc->setHelpText(MainGeneralSettings::tr("During music playback, displays "
3505 "album cover and various media "
3506 "information in full screen mode"));
3507 return gc;
3508}
3509
3510//static TransLabelSetting *AirPlayInfo()
3511//{
3512// TransLabelSetting *ts = new TransLabelSetting();
3513//
3514// ts->setValue(MainGeneralSettings::tr("All AirPlay settings take effect "
3515// "when you restart MythFrontend."));
3516// return ts;
3517//}
3518
3519//static TransLabelSetting *AirPlayRSAInfo()
3520//{
3521// TransLabelSetting *ts = new TransLabelSetting();
3522//
3523// if (MythRAOPConnection::LoadKey() == nullptr)
3524// {
3525// ts->setValue(MainGeneralSettings::tr("AirTunes RSA key couldn't be "
3526// "loaded. Check http://www.mythtv.org/wiki/AirTunes/AirPlay. "
3527// "Last Error: %1")
3528// .arg(MythRAOPConnection::RSALastError()));
3529// }
3530// else
3531// {
3532// ts->setValue(MainGeneralSettings::tr("AirTunes RSA key successfully "
3533// "loaded."));
3534// }
3535//
3536// return ts;
3537//}
3538#endif
3539
3541{
3542 auto *gc = new HostCheckBoxSetting("RealtimePriority");
3543
3544 gc->setLabel(PlaybackSettings::tr("Enable realtime priority threads"));
3545
3546 gc->setHelpText(PlaybackSettings::tr("When running mythfrontend with root "
3547 "privileges, some threads can be "
3548 "given enhanced priority. Disable "
3549 "this if MythFrontend freezes during "
3550 "video playback."));
3551 gc->setValue(true);
3552
3553 return gc;
3554}
3555
3557{
3558 auto *ge = new HostTextEditSetting("IgnoreDevices");
3559
3560 ge->setLabel(MainGeneralSettings::tr("Ignore devices"));
3561
3562 ge->setValue("");
3563
3564 ge->setHelpText(MainGeneralSettings::tr("If there are any devices that you "
3565 "do not want to be monitored, list "
3566 "them here with commas in-between. "
3567 "The plugins will ignore them. "
3568 "Requires restart."));
3569 return ge;
3570}
3571
3573{
3574 auto *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
3575
3576 gc->setLabel(PlaybackSettings::tr("Sort titles"));
3577
3578 gc->addSelection(PlaybackSettings::tr("Alphabetically"),
3579 QString::number(PlaybackBox::TitleSortAlphabetical));
3580 gc->addSelection(PlaybackSettings::tr("By recording priority"),
3581 QString::number(PlaybackBox::TitleSortRecPriority));
3582
3583 gc->setHelpText(PlaybackSettings::tr("Sets the title sorting order when "
3584 "the view is set to Titles only."));
3585 return gc;
3586}
3587
3589{
3590 auto *gc = new HostCheckBoxSetting("PlaybackWatchList");
3591
3592 gc->setLabel(WatchListSettings::tr("Include the 'Watch List' group"));
3593
3594 gc->setValue(true);
3595
3596 gc->setHelpText(WatchListSettings::tr("The 'Watch List' is an abbreviated "
3597 "list of recordings sorted to "
3598 "highlight series and shows that "
3599 "need attention in order to keep up "
3600 "to date."));
3601 return gc;
3602}
3603
3605{
3606 auto *gc = new HostCheckBoxSetting("PlaybackWLStart");
3607
3608 gc->setLabel(WatchListSettings::tr("Start from the Watch List view"));
3609
3610 gc->setValue(false);
3611
3612 gc->setHelpText(WatchListSettings::tr("If enabled, the 'Watch List' will "
3613 "be the initial view each time you "
3614 "enter the Watch Recordings screen"));
3615 return gc;
3616}
3617
3619{
3620 auto *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
3621
3622 gc->setLabel(WatchListSettings::tr("Exclude recordings not set for "
3623 "Auto-Expire"));
3624
3625 gc->setValue(false);
3626
3627 gc->setHelpText(WatchListSettings::tr("Set this if you turn off "
3628 "Auto-Expire only for recordings "
3629 "that you've seen and intend to "
3630 "keep. This option will exclude "
3631 "these recordings from the "
3632 "'Watch List'."));
3633 return gc;
3634}
3635
3637{
3638 auto *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
3639
3640 gs->setLabel(WatchListSettings::tr("Maximum days counted in the score"));
3641
3642 gs->setValue(60);
3643
3644 gs->setHelpText(WatchListSettings::tr("The 'Watch List' scores are based "
3645 "on 1 point equals one day since "
3646 "recording. This option limits the "
3647 "maximum score due to age and "
3648 "affects other weighting factors."));
3649 return gs;
3650}
3651
3653{
3654 auto *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
3655
3656 gs->setLabel(WatchListSettings::tr("Days to exclude weekly episodes after "
3657 "delete"));
3658
3659 gs->setValue(2);
3660
3661 gs->setHelpText(WatchListSettings::tr("When an episode is deleted or "
3662 "marked as watched, other episodes "
3663 "of the series are excluded from the "
3664 "'Watch List' for this interval of "
3665 "time. Daily shows also have a "
3666 "smaller interval based on this "
3667 "setting."));
3668 return gs;
3669}
3670
3672{
3673 auto *gc = new HostCheckBoxSetting("MonitorDrives");
3674
3675 gc->setLabel(MainGeneralSettings::tr("Media Monitor"));
3676
3677 gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3678 "monitoring your CD/DVD drives for "
3679 "new disks and launching the "
3680 "proper plugin to handle them. "
3681 "Requires restart."));
3682
3683 gc->setValue(false);
3684
3685 gc->addTargetedChild("1", IgnoreMedia());
3686
3687 return gc;
3688}
3689
3691{
3692 auto *gc = new HostCheckBoxSetting("LCDShowTime");
3693
3694 gc->setLabel(LcdSettings::tr("Display time"));
3695
3696 gc->setHelpText(LcdSettings::tr("Display current time on idle LCD "
3697 "display."));
3698
3699 gc->setValue(true);
3700
3701 return gc;
3702}
3703
3705{
3706 auto *gc = new HostCheckBoxSetting("LCDShowRecStatus");
3707
3708 gc->setLabel(LcdSettings::tr("Display recording status"));
3709
3710 gc->setHelpText(LcdSettings::tr("Display current recordings information "
3711 "on LCD display."));
3712
3713 gc->setValue(false);
3714
3715 return gc;
3716}
3717
3719{
3720 auto *gc = new HostCheckBoxSetting("LCDShowMenu");
3721
3722 gc->setLabel(LcdSettings::tr("Display menus"));
3723
3724 gc->setHelpText(LcdSettings::tr("Display selected menu on LCD display. "));
3725
3726 gc->setValue(true);
3727
3728 return gc;
3729}
3730
3732{
3733 auto *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, 1);
3734
3735 gs->setLabel(LcdSettings::tr("Menu pop-up time"));
3736
3737 gs->setHelpText(LcdSettings::tr("How many seconds the menu will remain "
3738 "visible after navigation."));
3739
3740 gs->setValue(5);
3741
3742 return gs;
3743}
3744
3746{
3747 auto *gc = new HostCheckBoxSetting("LCDShowMusic");
3748
3749 gc->setLabel(LcdSettings::tr("Display music artist and title"));
3750
3751 gc->setHelpText(LcdSettings::tr("Display playing artist and song title in "
3752 "MythMusic on LCD display."));
3753
3754 gc->setValue(true);
3755
3756 return gc;
3757}
3758
3760{
3761 auto *gc = new HostComboBoxSetting("LCDShowMusicItems");
3762
3763 gc->setLabel(LcdSettings::tr("Items"));
3764
3765 gc->addSelection(LcdSettings::tr("Artist - Title"), "ArtistTitle");
3766 gc->addSelection(LcdSettings::tr("Artist [Album] Title"),
3767 "ArtistAlbumTitle");
3768
3769 gc->setHelpText(LcdSettings::tr("Which items to show when playing music."));
3770
3771 return gc;
3772}
3773
3775{
3776 auto *gc = new HostCheckBoxSetting("LCDShowChannel");
3777
3778 gc->setLabel(LcdSettings::tr("Display channel information"));
3779
3780 gc->setHelpText(LcdSettings::tr("Display tuned channel information on LCD "
3781 "display."));
3782
3783 gc->setValue(true);
3784
3785 return gc;
3786}
3787
3789{
3790 auto *gc = new HostCheckBoxSetting("LCDShowVolume");
3791
3792 gc->setLabel(LcdSettings::tr("Display volume information"));
3793
3794 gc->setHelpText(LcdSettings::tr("Display volume level information "
3795 "on LCD display."));
3796
3797 gc->setValue(true);
3798
3799 return gc;
3800}
3801
3803{
3804 auto *gc = new HostCheckBoxSetting("LCDShowGeneric");
3805
3806 gc->setLabel(LcdSettings::tr("Display generic information"));
3807
3808 gc->setHelpText(LcdSettings::tr("Display generic information on LCD display."));
3809
3810 gc->setValue(true);
3811
3812 return gc;
3813}
3814
3816{
3817 auto *gc = new HostCheckBoxSetting("LCDBacklightOn");
3818
3819 gc->setLabel(LcdSettings::tr("Backlight always on"));
3820
3821 gc->setHelpText(LcdSettings::tr("Turn on the backlight permanently on the "
3822 "LCD display."));
3823 gc->setValue(true);
3824
3825 return gc;
3826}
3827
3829{
3830 auto *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
3831
3832 gc->setLabel(LcdSettings::tr("Heartbeat always on"));
3833
3834 gc->setHelpText(LcdSettings::tr("Turn on the LCD heartbeat."));
3835
3836 gc->setValue(false);
3837
3838 return gc;
3839}
3840
3842{
3843 auto *gc = new HostCheckBoxSetting("LCDBigClock");
3844
3845 gc->setLabel(LcdSettings::tr("Display large clock"));
3846
3847 gc->setHelpText(LcdSettings::tr("On multiline displays try and display the "
3848 "time as large as possible."));
3849
3850 gc->setValue(false);
3851
3852 return gc;
3853}
3854
3856{
3857 auto *ge = new HostTextEditSetting("LCDKeyString");
3858
3859 ge->setLabel(LcdSettings::tr("LCD key order"));
3860
3861 ge->setValue("ABCDEF");
3862
3863 ge->setHelpText(
3864 LcdSettings::tr("Enter the 6 Keypad Return Codes for your LCD keypad "
3865 "in the order in which you want the functions "
3866 "up/down/left/right/yes/no to operate. (See "
3867 "lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
3868 "or the matrix for your display)"));
3869 return ge;
3870}
3871
3873{
3874 auto *gc = new HostCheckBoxSetting("LCDEnable");
3875
3876 gc->setLabel(LcdSettings::tr("Enable LCD device"));
3877
3878 gc->setHelpText(LcdSettings::tr("Use an LCD display to view MythTV status "
3879 "information."));
3880
3881 gc->setValue(false);
3882 gc->addTargetedChild("1", LCDShowTime());
3883 gc->addTargetedChild("1", LCDShowMenu());
3884 gc->addTargetedChild("1", LCDShowMusic());
3886 gc->addTargetedChild("1", LCDShowChannel());
3888 gc->addTargetedChild("1", LCDShowVolume());
3889 gc->addTargetedChild("1", LCDShowGeneric());
3890 gc->addTargetedChild("1", LCDBacklightOn());
3891 gc->addTargetedChild("1", LCDHeartBeatOn());
3892 gc->addTargetedChild("1", LCDBigClock());
3893 gc->addTargetedChild("1", LCDKeyString());
3894 gc->addTargetedChild("1", LCDPopupTime());
3895 return gc;
3896}
3897
3898
3899#ifdef Q_OS_DARWIN
3900static HostCheckBoxSetting *MacGammaCorrect()
3901{
3902 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
3903
3904 gc->setLabel(PlaybackSettings::tr("Enable gamma correction for video"));
3905
3906 gc->setValue(false);
3907
3908 gc->setHelpText(PlaybackSettings::tr("If enabled, QuickTime will correct "
3909 "the gamma of the video to match "
3910 "your monitor. Turning this off can "
3911 "save some CPU cycles."));
3912 return gc;
3913}
3914
3915static HostCheckBoxSetting *MacScaleUp()
3916{
3917 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
3918
3919 gc->setLabel(PlaybackSettings::tr("Scale video as necessary"));
3920
3921 gc->setValue(true);
3922
3923 gc->setHelpText(PlaybackSettings::tr("If enabled, video will be scaled to "
3924 "fit your window or screen. If "
3925 "unchecked, video will never be made "
3926 "larger than its actual pixel size."));
3927 return gc;
3928}
3929
3930static HostSpinBoxSetting *MacFullSkip()
3931{
3932 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
3933
3934 gs->setLabel(PlaybackSettings::tr("Frames to skip in fullscreen mode"));
3935
3936 gs->setValue(0);
3937
3938 gs->setHelpText(PlaybackSettings::tr("Video displayed in fullscreen or "
3939 "non-windowed mode will skip this "
3940 "many frames for each frame drawn. "
3941 "Set to 0 to show every frame. Only "
3942 "valid when either \"Use GUI size for "
3943 "TV playback\" or \"Run the frontend "
3944 "in a window\" is not checked."));
3945 return gs;
3946}
3947
3948static HostCheckBoxSetting *MacMainEnabled()
3949{
3950 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
3951
3952 gc->setLabel(MacMainSettings::tr("Video in main window"));
3953
3954 gc->setValue(true);
3955
3956 gc->setHelpText(MacMainSettings::tr("If enabled, video will be displayed "
3957 "in the main GUI window. Disable this "
3958 "when you only want video on the "
3959 "desktop or in a floating window. Only "
3960 "valid when \"Use GUI size for TV "
3961 "playback\" and \"Run the frontend in "
3962 "a window\" are checked."));
3963 return gc;
3964}
3965
3966static HostSpinBoxSetting *MacMainSkip()
3967{
3968 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
3969
3970 gs->setLabel(MacMainSettings::tr("Frames to skip"));
3971
3972 gs->setValue(0);
3973
3974 gs->setHelpText(MacMainSettings::tr("Video in the main window will skip "
3975 "this many frames for each frame "
3976 "drawn. Set to 0 to show every "
3977 "frame."));
3978 return gs;
3979}
3980
3981static HostSpinBoxSetting *MacMainOpacity()
3982{
3983 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
3984
3985 gs->setLabel(MacMainSettings::tr("Opacity"));
3986
3987 gs->setValue(100);
3988
3989 gs->setHelpText(MacMainSettings::tr("The opacity of the main window. Set "
3990 "to 100 for completely opaque, set "
3991 "to 0 for completely transparent."));
3992 return gs;
3993}
3994
3995static HostCheckBoxSetting *MacFloatEnabled()
3996{
3997 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
3998
3999 gc->setLabel(MacFloatSettings::tr("Video in floating window"));
4000
4001 gc->setValue(false);
4002
4003 gc->setHelpText(MacFloatSettings::tr("If enabled, video will be displayed "
4004 "in a floating window. Only valid "
4005 "when \"Use GUI size for TV "
4006 "playback\" and \"Run the frontend "
4007 "in a window\" are checked."));
4008 return gc;
4009}
4010
4011static HostSpinBoxSetting *MacFloatSkip()
4012{
4013 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
4014
4015 gs->setLabel(MacFloatSettings::tr("Frames to skip"));
4016
4017 gs->setValue(0);
4018
4019 gs->setHelpText(MacFloatSettings::tr("Video in the floating window will "
4020 "skip this many frames for each "
4021 "frame drawn. Set to 0 to show "
4022 "every frame."));
4023 return gs;
4024}
4025
4026static HostSpinBoxSetting *MacFloatOpacity()
4027{
4028 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
4029
4030 gs->setLabel(MacFloatSettings::tr("Opacity"));
4031
4032 gs->setValue(100);
4033
4034 gs->setHelpText(MacFloatSettings::tr("The opacity of the floating window. "
4035 "Set to 100 for completely opaque, "
4036 "set to 0 for completely "
4037 "transparent."));
4038 return gs;
4039}
4040
4041static HostCheckBoxSetting *MacDockEnabled()
4042{
4043 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
4044
4045 gc->setLabel(MacDockSettings::tr("Video in the dock"));
4046
4047 gc->setValue(true);
4048
4049 gc->setHelpText(MacDockSettings::tr("If enabled, video will be displayed "
4050 "in the application's dock icon. Only "
4051 "valid when \"Use GUI size for TV "
4052 "playback\" and \"Run the frontend in "
4053 "a window\" are checked."));
4054 return gc;
4055}
4056
4057static HostSpinBoxSetting *MacDockSkip()
4058{
4059 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
4060
4061 gs->setLabel(MacDockSettings::tr("Frames to skip"));
4062
4063 gs->setValue(3);
4064
4065 gs->setHelpText(MacDockSettings::tr("Video in the dock icon will skip this "
4066 "many frames for each frame drawn. Set "
4067 "to 0 to show every frame."));
4068 return gs;
4069}
4070
4071static HostCheckBoxSetting *MacDesktopEnabled()
4072{
4073 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
4074
4075 gc->setLabel(MacDesktopSettings::tr("Video on the desktop"));
4076
4077 gc->setValue(false);
4078
4079 gc->setHelpText(MacDesktopSettings::tr("If enabled, video will be "
4080 "displayed on the desktop, "
4081 "behind the Finder icons. "
4082 "Only valid when \"Use GUI "
4083 "size for TV playback\" and "
4084 "\"Run the frontend in a "
4085 "window\" are checked."));
4086 return gc;
4087}
4088
4089static HostSpinBoxSetting *MacDesktopSkip()
4090{
4091 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
4092
4093 gs->setLabel(MacDesktopSettings::tr("Frames to skip"));
4094
4095 gs->setValue(0);
4096
4097 gs->setHelpText(MacDesktopSettings::tr("Video on the desktop will skip "
4098 "this many frames for each frame "
4099 "drawn. Set to 0 to show every "
4100 "frame."));
4101 return gs;
4102}
4103#endif
4104
4105
4107{
4108 public:
4110
4111 private slots:
4112 void childChanged(StandardSetting* /*unused*/) override;
4113
4114 private:
4120};
4121
4123{
4124 setLabel(MainGeneralSettings::tr("Shutdown/Reboot Settings"));
4125 auto *power = MythPower::AcquireRelease(this, true);
4128#ifndef Q_OS_ANDROID
4132#endif
4134 if (power)
4135 MythPower::AcquireRelease(this, false);
4136 connect(m_overrideExitMenu, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4138}
4139
4141{
4143 return;
4144
4145 bool confirmold = m_confirmCommand->isVisible();
4146 bool haltold = m_haltCommand->isVisible();
4147 bool rebootold = m_rebootCommand->isVisible();
4148 bool suspendold = m_suspendCommand->isVisible();
4149
4150 switch (m_overrideExitMenu->getValue().toInt())
4151 {
4152 case 2:
4153 case 4:
4158 break;
4159 case 3:
4160 case 6:
4165 break;
4166 case 5:
4167 m_haltCommand->setVisible(false);
4171 break;
4172 case 8:
4173 case 9:
4174 m_haltCommand->setVisible(false);
4178 break;
4179 case 10:
4184 break;
4185 case 0:
4186 case 1:
4187 default:
4188 m_haltCommand->setVisible(false);
4192 break;
4193 }
4194
4195 if (confirmold != m_confirmCommand->isVisible() ||
4196 haltold != m_haltCommand->isVisible() ||
4197 rebootold != m_rebootCommand->isVisible() ||
4198 suspendold != m_suspendCommand->isVisible())
4199 {
4200 emit settingsChanged();
4201 }
4202}
4203
4205{
4206// DatabaseSettings::addDatabaseSettings(this);
4207 setLabel(tr("Main Settings"));
4208
4210
4211 auto *pin = new GroupSetting();
4212 pin->setLabel(tr("Settings Access"));
4213 pin->addChild(SetupPinCode());
4214 addChild(pin);
4215
4216 auto *general = new GroupSetting();
4217 general->setLabel(tr("General"));
4218 general->addChild(UseVirtualKeyboard());
4219 general->addChild(ScreenShotPath());
4220
4221 auto sh = getMythSortHelper();
4222 if (sh->hasPrefixes()) {
4223#if 0
4224 // Last minute change. QStringRef::localeAwareCompare appears to
4225 // always do case insensitive sorting, so there's no point in
4226 // presenting this option to a user.
4227 general->addChild(SortCaseSensitive());
4228#endif
4229 auto *stripPrefixes = SortStripPrefixes();
4230 general->addChild(stripPrefixes);
4231 stripPrefixes->addTargetedChild("1", SortPrefixExceptions());
4232 }
4233 general->addChild(ManualRecordStartChanType());
4234 addChild(general);
4235
4237
4239
4240 auto *remotecontrol = new GroupSetting();
4241 remotecontrol->setLabel(tr("Remote Control"));
4242 remotecontrol->addChild(LircDaemonDevice());
4243 remotecontrol->addChild(NetworkControlEnabled());
4244 remotecontrol->addChild(NetworkControlPort());
4245 remotecontrol->addChild(UDPNotifyPort());
4246#if CONFIG_LIBCEC
4247 HostCheckBoxSetting *cec = CECEnabled();
4248 remotecontrol->addChild(cec);
4249 cec->addTargetedChild("1",CECDevice());
4250 m_cecPowerOnTVAllowed = CECPowerOnTVAllowed();
4251 m_cecPowerOffTVAllowed = CECPowerOffTVAllowed();
4252 m_cecPowerOnTVOnStart = CECPowerOnTVOnStart();
4253 m_cecPowerOffTVOnExit = CECPowerOffTVOnExit();
4254 cec->addTargetedChild("1",m_cecPowerOnTVAllowed);
4255 cec->addTargetedChild("1",m_cecPowerOffTVAllowed);
4256 cec->addTargetedChild("1",m_cecPowerOnTVOnStart);
4257 cec->addTargetedChild("1",m_cecPowerOffTVOnExit);
4258 connect(m_cecPowerOnTVAllowed, &MythUICheckBoxSetting::valueChanged,
4259 this, &MainGeneralSettings::cecChanged);
4260 connect(m_cecPowerOffTVAllowed, &MythUICheckBoxSetting::valueChanged,
4261 this, &MainGeneralSettings::cecChanged);
4262#endif // CONFIG_LIBCEC
4263 addChild(remotecontrol);
4264
4265#if CONFIG_AIRPLAY
4266 auto *airplay = new GroupSetting();
4267 airplay->setLabel(tr("AirPlay Settings"));
4268 airplay->addChild(AirPlayEnabled());
4269 airplay->addChild(AirPlayFullScreen());
4270 airplay->addChild(AirPlayAudioOnly());
4271 airplay->addChild(AirPlayPasswordSettings());
4272// airplay->addChild(AirPlayInfo());
4273// airplay->addChild(AirPlayRSAInfo());
4274 addChild(airplay);
4275#endif
4276}
4277
4278#if CONFIG_LIBCEC
4279void MainGeneralSettings::cecChanged(bool /*setting*/)
4280{
4281 if (m_cecPowerOnTVAllowed->boolValue())
4282 m_cecPowerOnTVOnStart->setEnabled(true);
4283 else
4284 {
4285 m_cecPowerOnTVOnStart->setEnabled(false);
4286 m_cecPowerOnTVOnStart->setValue(false);
4287 }
4288
4289 if (m_cecPowerOffTVAllowed->boolValue())
4290 m_cecPowerOffTVOnExit->setEnabled(true);
4291 else
4292 {
4293 m_cecPowerOffTVOnExit->setEnabled(false);
4294 m_cecPowerOffTVOnExit->setValue(false);
4295 }
4296}
4297#endif // CONFIG_LIBCEC
4298
4300{
4301 QStringList strlist( QString("REFRESH_BACKEND") );
4303 LOG(VB_GENERAL, LOG_ERR, QString("%1 called").arg(__FUNCTION__));
4305}
4306
4307
4309{
4310 public:
4312 void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4313
4314 private slots:
4315 void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4316
4317 private:
4322};
4323
4325{
4326 setLabel(PlaybackSettings::tr("Scaling"));
4331 connect(m_vertScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4333 connect(m_yScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4335 connect(m_horizScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4337 connect(m_xScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4339}
4340
4341
4343{
4345 if (m_vertScan->getValue() == "0" &&
4346 m_horizScan->getValue() == "0" &&
4347 m_yScan->getValue() == "0" &&
4348 m_xScan->getValue() == "0")
4349 {
4350 item->SetText(PlaybackSettings::tr("No scaling"), "value");
4351 }
4352 else
4353 {
4354 item->SetText(QString("%1%x%2%+%3%+%4%")
4355 .arg(m_horizScan->getValue(),
4357 m_xScan->getValue(),
4358 m_yScan->getValue()),
4359 "value");
4360 }
4361}
4362
4364{
4365 emit ShouldRedraw(this);
4366}
4367
4369 : StandardSettingDialog(stack, "playbacksettings", new PlaybackSettings())
4370{
4371}
4372
4374{
4376 if (item)
4377 {
4378 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4379 if (config)
4381 }
4382}
4383
4384
4386{
4387 auto *menu = new MythMenu(tr("Playback Profile Menu"), this, "mainmenu");
4388
4389 if (m_buttonList->GetItemPos(item) > 2)
4390 menu->AddItem(tr("Move Up"), &PlaybackSettingsDialog::MoveProfileItemUp);
4391 if (m_buttonList->GetItemPos(item) + 1 < m_buttonList->GetCount())
4392 menu->AddItem(tr("Move Down"), &PlaybackSettingsDialog::MoveProfileItemDown);
4393
4394 menu->AddItem(tr("Delete"), &PlaybackSettingsDialog::DeleteProfileItem);
4395
4396 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
4397
4398 auto *menuPopup = new MythDialogBox(menu, popupStack, "menudialog");
4399 menuPopup->SetReturnEvent(this, "mainmenu");
4400
4401 if (menuPopup->Create())
4402 popupStack->AddScreen(menuPopup);
4403 else
4404 delete menuPopup;
4405}
4406
4408{
4410 if (item)
4411 {
4412 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4413 if (config)
4414 {
4415 const int currentPos = m_buttonList->GetCurrentPos();
4416
4417 config->DecreasePriority();
4418
4419 m_buttonList->SetItemCurrent(currentPos + 1);
4420 }
4421 }
4422}
4423
4425{
4427 if (item)
4428 {
4429 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4430 if (config)
4431 {
4432 const int currentPos = m_buttonList->GetCurrentPos();
4433
4434 config->IncreasePriority();
4435
4436 m_buttonList->SetItemCurrent(currentPos - 1);
4437 }
4438 }
4439}
4440
4442{
4443 auto *config = m_buttonList->GetDataValue().value<PlaybackProfileItemConfig*>();
4444 if (config)
4445 config->ShowDeleteDialog();
4446}
4447
4449{
4450 setLabel(tr("Playback settings"));
4451}
4452
4454{
4455 auto *general = new GroupSetting();
4456 general->setLabel(tr("General Playback"));
4457 general->addChild(JumpToProgramOSD());
4458 general->addChild(UseProgStartMark());
4459 general->addChild(AutomaticSetWatched());
4460 general->addChild(AlwaysShowWatchedProgress());
4461 general->addChild(ContinueEmbeddedTVPlay());
4462 general->addChild(LiveTVIdleTimeout());
4463
4464 general->addChild(new PlayBackScaling());
4465 general->addChild(StereoDiscard());
4466 general->addChild(AspectOverride());
4467 general->addChild(AdjustFill());
4468
4469 general->addChild(LetterboxingColour());
4470 general->addChild(PlaybackExitPrompt());
4471 general->addChild(EndOfRecordingExitPrompt());
4472 general->addChild(MusicChoiceEnabled());
4473 addChild(general);
4474
4475 auto *advanced = new GroupSetting();
4476 advanced->setLabel(tr("Advanced Playback Settings"));
4477 advanced->addChild(RealtimePriority());
4478 advanced->addChild(AudioReadAhead());
4479 advanced->addChild(ColourPrimaries());
4480 advanced->addChild(ChromaUpsampling());
4481#if CONFIG_VAAPI
4482 advanced->addChild(VAAPIDevice());
4483#endif
4484
4485 addChild(advanced);
4486
4489
4491 new ButtonStandardSetting(tr("Add a new playback profile"));
4495
4496 auto *pbox = new GroupSetting();
4497 pbox->setLabel(tr("View Recordings"));
4498 pbox->addChild(PlayBoxOrdering());
4499 pbox->addChild(PlayBoxEpisodeSort());
4500 // Disabled until we re-enable live previews
4501 // pbox->addChild(PlaybackPreview());
4502 // pbox->addChild(HWAccelPlaybackPreview());
4503 pbox->addChild(PBBStartInTitle());
4504
4505 auto *pbox2 = new GroupSetting();
4506 pbox2->setLabel(tr("Recording Groups"));
4507 pbox2->addChild(DisplayRecGroup());
4508 pbox2->addChild(QueryInitialFilter());
4509 pbox2->addChild(RememberRecGroup());
4510 pbox2->addChild(RecGroupMod());
4511
4512 pbox->addChild(pbox2);
4513
4514 pbox->addChild(DisplayGroupTitleSort());
4515
4516 StandardSetting *playbackWatchList = PlaybackWatchList();
4517 playbackWatchList->addTargetedChild("1", PlaybackWLStart());
4518 playbackWatchList->addTargetedChild("1", PlaybackWLAutoExpire());
4519 playbackWatchList->addTargetedChild("1", PlaybackWLMaxAge());
4520 playbackWatchList->addTargetedChild("1", PlaybackWLBlackOut());
4521 pbox->addChild(playbackWatchList);
4522 addChild(pbox);
4523
4524 auto *seek = new GroupSetting();
4525 seek->setLabel(tr("Seeking"));
4526 seek->addChild(SmartForward());
4527 seek->addChild(FFRewReposTime());
4528 seek->addChild(FFRewReverse());
4529
4530 addChild(seek);
4531
4532 auto *comms = new GroupSetting();
4533 comms->setLabel(tr("Commercial Skip"));
4534 comms->addChild(AutoCommercialSkip());
4535 comms->addChild(CommRewindAmount());
4536 comms->addChild(CommNotifyAmount());
4537 comms->addChild(MaximumCommercialSkip());
4538 comms->addChild(MergeShortCommBreaks());
4539
4540 addChild(comms);
4541
4542#ifdef Q_OS_DARWIN
4543 GroupSetting* mac = new GroupSetting();
4544 mac->setLabel(tr("Mac OS X Video Settings"));
4545 mac->addChild(MacGammaCorrect());
4546 mac->addChild(MacScaleUp());
4547 mac->addChild(MacFullSkip());
4548
4549 StandardSetting *floatEnabled = MacFloatEnabled();
4550 floatEnabled->addTargetedChild("1", MacFloatSkip());
4551 floatEnabled->addTargetedChild("1", MacFloatOpacity());
4552 mac->addChild(floatEnabled);
4553
4554 StandardSetting *macMainEnabled = MacMainEnabled();
4555 macMainEnabled->addTargetedChild("1", MacMainSkip());
4556 macMainEnabled->addTargetedChild("1", MacMainOpacity());
4557 mac->addChild(macMainEnabled);
4558
4559 StandardSetting *dockEnabled = MacDockEnabled();
4560 dockEnabled->addTargetedChild("1", MacDockSkip());
4561 mac->addChild(dockEnabled);
4562
4563 StandardSetting* desktopEnabled = MacDesktopEnabled();
4564 desktopEnabled->addTargetedChild("1", MacDesktopSkip());
4565 mac->addChild(desktopEnabled);
4566
4567 addChild(mac);
4568#endif
4569
4571}
4572
4574{
4575 setLabel(tr("On-screen Display"));
4576
4584
4585 //GroupSetting *cc = new GroupSetting();
4586 //cc->setLabel(tr("Closed Captions"));
4587 //cc->addChild(DecodeVBIFormat());
4588 //addChild(cc);
4589
4590#ifdef Q_OS_MACOS
4591 // Any Mac OS-specific OSD stuff would go here.
4592#endif
4593}
4594
4596{
4597 setLabel(tr("General"));
4598 auto *general = new GroupSetting();
4599 general->setLabel(tr("General (Basic)"));
4600 general->addChild(ChannelOrdering());
4601 general->addChild(ChannelFormat());
4602 general->addChild(LongChannelFormat());
4603
4604 addChild(general);
4605
4606 auto *autoexp = new GroupSetting();
4607
4608 autoexp->setLabel(tr("General (Auto-Expire)"));
4609
4610 autoexp->addChild(AutoExpireMethod());
4611
4612 autoexp->addChild(RerecordWatched());
4613 autoexp->addChild(AutoExpireWatchedPriority());
4614
4615 autoexp->addChild(AutoExpireLiveTVMaxAge());
4616 autoexp->addChild(AutoExpireDayPriority());
4617 autoexp->addChild(AutoExpireExtraSpace());
4618
4619// autoexp->addChild(new DeletedExpireOptions());
4620 autoexp->addChild(DeletedMaxAge());
4621
4622 addChild(autoexp);
4623
4624 auto *jobs = new GroupSetting();
4625
4626 jobs->setLabel(tr("General (Jobs)"));
4627
4628 jobs->addChild(CommercialSkipMethod());
4629 jobs->addChild(CommFlagFast());
4630 jobs->addChild(AggressiveCommDetect());
4631 jobs->addChild(DeferAutoTranscodeDays());
4632
4633 addChild(jobs);
4634
4635 auto *general2 = new GroupSetting();
4636
4637 general2->setLabel(tr("General (Advanced)"));
4638
4639 general2->addChild(RecordPreRoll());
4640 general2->addChild(RecordOverTime());
4641 general2->addChild(MaxStartGap());
4642 general2->addChild(MaxEndGap());
4643 general2->addChild(MinimumRecordingQuality());
4644 general2->addChild(CategoryOverTimeSettings());
4645 addChild(general2);
4646
4647 auto *changrp = new GroupSetting();
4648
4649 changrp->setLabel(tr("General (Channel Groups)"));
4650
4651 changrp->addChild(ChannelGroupRememberLast());
4652 changrp->addChild(ChannelGroupDefault());
4653 changrp->addChild(BrowseChannelGroup());
4654
4655 addChild(changrp);
4656}
4657
4659{
4660 setLabel(tr("Program Guide"));
4661
4664}
4665
4667{
4668 auto *sched = new GroupSetting();
4669
4670 sched->setLabel(tr("Scheduler Options"));
4671
4672 sched->addChild(GRSchedOpenEnd());
4673 sched->addChild(GRPrefInputRecPriority());
4674 sched->addChild(GRHDTVRecPriority());
4675 sched->addChild(GRWSRecPriority());
4676
4677 addChild(sched);
4678
4679 auto *access = new GroupSetting();
4680
4681 access->setLabel(tr("Accessibility Options"));
4682
4683 access->addChild(GRSignLangRecPriority());
4684 access->addChild(GROnScrSubRecPriority());
4685 access->addChild(GRCCRecPriority());
4686 access->addChild(GRHardHearRecPriority());
4687 access->addChild(GRAudioDescRecPriority());
4688
4689 addChild(access);
4690}
4691
4693{
4694 public:
4695 GuiDimension();
4696 //QString getValue() override; // StandardSetting
4697 void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4698
4699 private slots:
4700 void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4701 private:
4706};
4707
4709{
4710 setLabel(AppearanceSettings::tr("GUI dimension"));
4715 connect(m_width, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4717 connect(m_height, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4719 connect(m_offsetX, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4721 connect(m_offsetY, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4723}
4724
4726{
4728 if ((m_width->getValue() == "0" ||
4729 m_height->getValue() == "0") &&
4730 m_offsetX->getValue() == "0" &&
4731 m_offsetY->getValue() == "0")
4732 {
4733 item->SetText(AppearanceSettings::tr("Fullscreen"), "value");
4734 }
4735 else
4736 {
4737 item->SetText(QString("%1x%2+%3+%4")
4738 .arg(m_width->getValue(),
4739 m_height->getValue(),
4741 m_offsetY->getValue()),
4742 "value");
4743 }
4744}
4745
4747{
4748 emit ShouldRedraw(this);
4749}
4750
4752{
4753 QCoreApplication::processEvents();
4754 GetMythMainWindow()->JumpTo("Reload Theme");
4755}
4756
4758{
4760 QList screens = QGuiApplication::screens();
4761 for (QScreen *qscreen : std::as_const(screens))
4762 {
4763 QString extra = MythDisplay::GetExtraScreenInfo(qscreen);
4764 m_screen->addSelection(qscreen->name() + extra, qscreen->name());
4765 }
4766 if (Screens > 1)
4767 m_screen->addSelection(AppearanceSettings::tr("All"), QString::number(-1));
4768}
4769
4771 : m_screen(ScreenSelection()),
4772 m_screenAspect(ScreenAspectRatio()),
4773 m_display(GetMythMainWindow()->GetDisplay())
4774{
4775 auto *screen = new GroupSetting();
4776 screen->setLabel(tr("Theme / Screen Settings"));
4777 addChild(screen);
4778
4779 AddPaintEngine(screen);
4780 screen->addChild(MenuTheme());
4781 screen->addChild(GUIRGBLevels());
4782
4783 screen->addChild(m_screen);
4784 screen->addChild(m_screenAspect);
4787
4788 screen->addChild(ForceFullScreen());
4789 screen->addChild(new GuiDimension());
4790
4791 screen->addChild(GuiSizeForTV());
4792 screen->addChild(HideMouseCursor());
4794 {
4795 screen->addChild(RunInWindow());
4796 screen->addChild(AlwaysOnTop());
4797 }
4798 screen->addChild(SmoothTransitions());
4799 screen->addChild(StartupScreenDelay());
4800 screen->addChild(GUIFontZoom());
4801#if CONFIG_AIRPLAY
4802 screen->addChild(AirPlayFullScreen());
4803#endif
4804
4806 if (display->VideoModesAvailable())
4807 {
4808 std::vector<MythDisplayMode> scr = display->GetVideoModes();
4809 if (!scr.empty())
4811 }
4812
4813 auto *dates = new GroupSetting();
4814
4815 dates->setLabel(tr("Localization"));
4816
4817 dates->addChild(MythLanguage());
4818 dates->addChild(AudioLanguage());
4819 dates->addChild(ISO639PreferredLanguage(0));
4820 dates->addChild(ISO639PreferredLanguage(1));
4821 dates->addChild(MythDateFormatCB());
4822 dates->addChild(MythShortDateFormat());
4823 dates->addChild(MythTimeFormat());
4824
4825 addChild(dates);
4826
4828}
4829
4830/*******************************************************************************
4831* Channel Groups *
4832*******************************************************************************/
4833
4835{
4836 auto *gc = new HostComboBoxSetting("Select from Channel Group");
4837 gc->setLabel(AppearanceSettings::tr("Select from Channel Group"));
4838 gc->addSelection("All Channels");
4839
4840 // All automatic channel groups that have at least one channel
4841 auto list = ChannelGroup::GetAutomaticChannelGroups(false);
4842 for (const auto &chgrp : list)
4843 {
4844 gc->addSelection(chgrp.m_name);
4845 }
4846 gc->setHelpText(AppearanceSettings::tr(
4847 "Select the channel group to select channels from. "
4848 "\"All Channels\" lets you choose from all channels of all video sources. "
4849 "\"Priority\" lets you choose from all channels that have recording priority. "
4850 "The other values let you select a video source to choose channels from."));
4851 return gc;
4852}
4853
4855{
4856 public:
4858 const QString &channum, const QString &name);
4860 private:
4862
4863};
4864
4866 const QString &channum, const QString &channame)
4867 : m_channelId(chanid)
4868{
4869 setLabel(QString("%1 %2").arg(channum, channame));
4870 setHelpText(ChannelGroupSettings::tr("Select/Unselect channels for this channel group"));
4871}
4872
4874 int groupId = -1)
4875 : m_groupId(groupId),
4876 m_groupName(new TransTextEditSetting())
4877{
4878 setLabel(groupName == "Favorites" ? tr("Favorites") : groupName);
4879 setValue(groupName);
4880 m_groupName->setLabel(groupName);
4881}
4882
4884{
4885 //Change the name
4887 || m_groupId == -1)
4888 {
4889 if (m_groupId == -1)//create a new group
4890 {
4892 QString newname = m_groupName ? m_groupName->getValue() : "undefined";
4894 }
4895 else
4896 {
4898 }
4899 }
4900
4901 if (m_groupId == -1)
4902 return;
4903
4904 QList<StandardSetting *> *children = getSubSettings();
4905 if (!children)
4906 return;
4907
4908 QList<StandardSetting *>::const_iterator i;
4909 for (i = children->constBegin(); i != children->constEnd(); ++i)
4910 {
4911 if ((*i)->haveChanged())
4912 {
4913 if ((*i) != m_groupName)
4914 {
4915 auto *channel = dynamic_cast<ChannelCheckBoxSetting *>(*i);
4916 if (channel)
4917 {
4918 if (channel->boolValue())
4919 {
4920 ChannelGroup::AddChannel(channel->getChannelId(),
4921 m_groupId);
4922 }
4923 else
4924 {
4925 ChannelGroup::DeleteChannel(channel->getChannelId(),
4926 m_groupId);
4927 }
4928 }
4929 }
4930 }
4931 }
4932}
4933
4935{
4936 if (VERBOSE_LEVEL_CHECK(VB_GENERAL, LOG_DEBUG))
4937 {
4938 QString group = m_groupSelection->getValue();
4939 int groupId = ChannelGroup::GetChannelGroupId(group);
4940 LOG(VB_GENERAL, LOG_INFO,
4941 QString("ChannelGroupSetting::LoadChannelGroup group:%1 groupId:%2")
4942 .arg(group).arg(groupId));
4943 }
4944
4945 // Set the old checkboxes from the previously selected channel group invisible
4946 for (const auto &it : m_boxMap)
4947 {
4948 it.second->setVisible(false);
4949 }
4950
4951 // And load the new collection
4953
4954 // Using m_groupSelection instead of nullptr keeps the focus in the "Select from Channel Group" box
4956}
4957
4959{
4960 QString fromGroup = m_groupSelection->getValue();
4961 int fromGroupId = ChannelGroup::GetChannelGroupId(fromGroup);
4962
4964
4965 if (fromGroupId == -1) // All Channels
4966 {
4967 query.prepare(
4968 "SELECT channel.chanid, channum, name, grpid FROM channel "
4969 "LEFT JOIN channelgroup "
4970 "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) "
4971 "WHERE deleted IS NULL "
4972 "AND visible > 0 "
4973 "ORDER BY channum+0; "); // Order by numeric value of channel number
4974 query.bindValue(":GRPID", m_groupId);
4975 }
4976 else
4977 {
4978 query.prepare(
4979 "SELECT channel.chanid, channum, name, cg2.grpid FROM channel "
4980 "RIGHT JOIN channelgroup AS cg1 "
4981 "ON (channel.chanid = cg1.chanid AND cg1.grpid = :FROMGRPID) "
4982 "LEFT JOIN channelgroup AS cg2 "
4983 "ON (channel.chanid = cg2.chanid AND cg2.grpid = :GRPID) "
4984 "WHERE deleted IS NULL "
4985 "AND visible > 0 "
4986 "ORDER BY channum+0; "); // Order by numeric value of channel number
4987 query.bindValue(":GRPID", m_groupId);
4988 query.bindValue(":FROMGRPID", fromGroupId);
4989 }
4990
4991 if (!query.exec() || !query.isActive())
4992 MythDB::DBError("ChannelGroupSetting::LoadChannelGroupChannels", query);
4993 else
4994 {
4995 while (query.next())
4996 {
4997 auto chanid = query.value(0).toUInt();
4998 auto channum = query.value(1).toString();
4999 auto name = query.value(2).toString();
5000 auto checked = !query.value(3).isNull();
5001 auto pair = std::make_pair(m_groupId, chanid);
5002
5003 TransMythUICheckBoxSetting *checkBox = nullptr;
5004 auto it = m_boxMap.find(pair);
5005 if (it != m_boxMap.end())
5006 {
5007 checkBox = it->second;
5008 checkBox->setVisible(true);
5009 }
5010 else
5011 {
5012 checkBox = new ChannelCheckBoxSetting(chanid, channum, name);
5013 checkBox->setValue(checked);
5014 m_boxMap[pair] = checkBox;
5015 addChild(checkBox);
5016 }
5017 }
5018 }
5019}
5020
5022{
5023 clearSettings();
5024
5025 // We cannot rename the Favorites group, make it readonly
5027 m_groupName->setLabel(tr("Group name"));
5031
5032 // Add channel group selection
5034 connect(m_groupSelection, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
5037
5039
5041}
5042
5044{
5045 // Cannot delete new group or Favorites
5046 return (m_groupId > 1);
5047}
5048
5050{
5052
5053 // Delete channels from this group
5054 query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
5055 query.bindValue(":GRPID", m_groupId);
5056 if (!query.exec())
5057 MythDB::DBError("ChannelGroupSetting::deleteEntry 1", query);
5058
5059 // Now delete the group from channelgroupnames
5060 query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
5061 query.bindValue(":GRPID", m_groupId);
5062 if (!query.exec())
5063 MythDB::DBError("ChannelGroupSetting::deleteEntry 2", query);
5064}
5065
5067{
5068 setLabel(tr("Channel Groups"));
5069}
5070
5072{
5073 clearSettings();
5074 auto *newGroup = new ButtonStandardSetting(tr("(Create New Channel Group)"));
5075 connect(newGroup, &ButtonStandardSetting::clicked,
5077 addChild(newGroup);
5078
5080 for (auto it = list.begin(); it < list.end(); ++it)
5081 {
5082 QString name = (it->m_name == "Favorites") ? tr("Favorites") : it->m_name;
5083 addChild(new ChannelGroupSetting(name, it->m_grpId));
5084 }
5085
5086 // Load all the groups
5088
5089 // TODO select the new one or the edited one
5090 emit settingsChanged(nullptr);
5091}
5092
5094{
5095 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
5096 auto *settingdialog = new MythTextInputDialog(popupStack,
5097 tr("Enter the name of the new channel group"));
5098
5099 if (settingdialog->Create())
5100 {
5101 connect(settingdialog, &MythTextInputDialog::haveResult,
5103 popupStack->AddScreen(settingdialog);
5104 }
5105 else
5106 {
5107 delete settingdialog;
5108 }
5109}
5110
5112{
5113 auto *button = new ChannelGroupSetting(name, -1);
5114 button->setLabel(name);
5115 button->Load();
5116 addChild(button);
5117 emit settingsChanged(this);
5118}
5119
5120// vim:set sw=4 ts=4 expandtab:
std::vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:31
MythDisplay * m_display
void PopulateScreens(int Screens)
void applyChange() override
HostComboBoxSetting * m_screenAspect
HostComboBoxSetting * m_screen
ChannelCheckBoxSetting(uint chanid, const QString &channum, const QString &name)
void Load() override
TransTextEditSetting * m_groupName
ChannelGroupSetting(const QString &groupName, int groupId)
void Save() override
std::map< std::pair< int, uint >, TransMythUICheckBoxSetting * > m_boxMap
HostComboBoxSetting * m_groupSelection
void LoadChannelGroupChannels(void)
void deleteEntry(void) override
bool canDelete(void) override
static ChannelGroupList GetAutomaticChannelGroups(bool includeEmpty=true)
static bool AddChannel(uint chanid, int changrpid)
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
static bool DeleteChannel(uint chanid, int changrpid)
static ChannelGroupList GetManualChannelGroups(bool includeEmpty=true)
static int GetChannelGroupId(const QString &changroupname)
static int AddChannelGroup(const QString &groupName)
static bool UpdateChannelGroup(const QString &oldName, const QString &newName)
void ShowNewGroupDialog(void) const
void CreateNewGroup(const QString &name)
GroupSetting()=default
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
StandardSetting * m_offsetX
StandardSetting * m_height
void childChanged(StandardSetting *) override
StandardSetting * m_offsetY
StandardSetting * m_width
static std::vector< double > GetRefreshRates(const QString &resolution)
virtual void ChangeResolution(StandardSetting *setting)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:838
QVariant value(int i) const
Definition: mythdbcon.h:204
bool isActive(void) const
Definition: mythdbcon.h:215
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:813
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
void applyChange() override
Dialog asking for user confirmation.
QString GetHostName(void)
QLocale GetQLocale(void)
QString GetSetting(const QString &key, const QString &defaultval="")
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
QString GetLanguage(void)
Returns two character ISO-639 language descriptor for UI language.
void GetResolutionSetting(const QString &type, int &width, int &height, double &forced_aspect, double &refresh_rate, int index=-1)
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:225
Basic menu dialog, message and a list of options.
static int FindBestMatch(const MythDisplayModes &Modes, const MythDisplayMode &Mode, double &TargetRate)
MythDisplayRates GetRefreshRates(QSize Size)
virtual bool VideoModesAvailable()
Definition: mythdisplay.h:29
void ScreenCountChanged(int Screens)
virtual const MythDisplayModes & GetVideoModes()
static QString GetExtraScreenInfo(QScreen *qScreen)
static int GetScreenCount()
MythDisplay * GetDisplay()
void JumpTo(const QString &Destination, bool Pop=true)
MythScreenStack * GetStack(const QString &Stackname)
static MUI_PUBLIC QStringList GetPainters()
static MUI_PUBLIC QString GetDefaultPainter()
@ FeatureRestart
Definition: mythpower.h:41
@ FeatureShutdown
Definition: mythpower.h:38
@ FeatureSuspend
Definition: mythpower.h:39
bool IsFeatureSupported(Feature Supported)
Definition: mythpower.cpp:167
static MythPower * AcquireRelease(void *Reference, bool Acquire, std::chrono::seconds MinimumDelay=0s)
Definition: mythpower.cpp:77
QStringList GetFeatureList(void)
Definition: mythpower.cpp:155
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static MythSystem * Create(const QStringList &args, uint flags=kMSNone, const QString &startPath=QString(), Priority cpuPriority=kInheritPriority, Priority diskPriority=kInheritPriority)
Definition: mythsystem.cpp:205
Dialog prompting the user to enter a text string.
void haveResult(QString)
static QMap< QString, QString > getLanguages(void)
void setDrawArrow(bool flag)
void SetText(const QString &text, const QString &name="", const QString &state="")
MythUIButtonListItem * GetItemCurrent() const
void SetItemCurrent(MythUIButtonListItem *item)
int GetItemPos(MythUIButtonListItem *item) const
int GetCurrentPos() const
QVariant GetDataValue() const
void setValue(const QString &newValue) override
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
virtual int size(void) const
void addSelection(const QString &label, QString value=QString(), bool select=false)
void setValue(int value) override
static bool WindowIsAlwaysFullscreen()
Return true if the current platform only supports fullscreen windows.
QList< ThemeInfo > GetThemes(ThemeType Type)
static QString HaveVAAPI(bool ReCheck=false)
Check whether VAAPI is available and not emulated via VDPAU.
void Set(const QString &Value, const QString &Data)
bool CheckRange(const QString &Key, float Value, bool *Ok=nullptr) const
QString Get(const QString &Value) const
static QString GetDecoderHelp(const QString &Decoder=QString())
static QStringList GetDecoders()
static QString GetDefaultProfileName(const QString &HostName)
static void CreateProfiles(const QString &HostName)
static uint CreateProfileGroup(const QString &ProfileName, const QString &HostName)
static bool DeleteDB(uint GroupId, const std::vector< MythVideoProfileItem > &Items)
static bool SaveDB(uint GroupId, std::vector< MythVideoProfileItem > &Items)
static uint GetProfileGroupID(const QString &ProfileName, const QString &HostName)
static const QList< QPair< QString, QString > > & GetDeinterlacers()
static std::vector< std::pair< QString, QString > > GetUpscalers()
static void SetDefaultProfileName(const QString &ProfileName, const QString &HostName)
static void InitStatics(bool Reinit=false)
static QString GetPreferredVideoRenderer(const QString &Decoder)
static QStringList GetProfiles(const QString &HostName)
static std::vector< MythVideoProfileItem > LoadDB(uint GroupId)
static QStringList GetDecoderNames()
static bool DeleteProfileGroup(const QString &GroupName, const QString &HostName)
static QString GetVideoRendererName(const QString &Renderer)
static QStringList GetVideoRenderers(const QString &Decoder)
static QString GetVideoRendererHelp(const QString &Renderer)
static QString GetDecoderName(const QString &Decoder)
void childChanged(StandardSetting *) override
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
StandardSetting * m_horizScan
StandardSetting * m_yScan
StandardSetting * m_vertScan
StandardSetting * m_xScan
@ TitleSortAlphabetical
Definition: playbackbox.h:82
@ TitleSortRecPriority
Definition: playbackbox.h:83
std::vector< PlaybackProfileItemConfig * > m_profiles
PlaybackProfileConfig(QString profilename, StandardSetting *parent)
TransMythUICheckBoxSetting * m_markForDeletion
void swap(int indexA, int indexB)
std::vector< MythVideoProfileItem > m_items
void Save(void) override
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
ButtonStandardSetting * m_addNewEntry
void InitUI(StandardSetting *parent)
std::vector< MythVideoProfileItem > m_delItems
StandardSetting * InitProfileItem(uint i, StandardSetting *parent)
void decoderChanged(const QString &dec)
TransTextEditSetting * m_heightRange
void framerateChanged(const QString &val)
TransMythUICheckBoxSetting * m_skipLoop
static QString GetQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver)
TransMythUIComboBoxSetting * m_singleDeint
TransTextEditSetting * m_widthRange
void Save(void) override
TransTextEditSetting * m_framerate
void DoDeleteSlot(bool doDelete)
TransMythUICheckBoxSetting * m_doubleDriver
TransMythUIComboBoxSetting * m_upscaler
void DoubleQualityChanged(const QString &Quality)
MythVideoProfileItem & m_item
MythUIComboBoxSetting * m_codecs
PlaybackProfileConfig * m_parentConfig
void widthChanged(const QString &val)
TransMythUICheckBoxSetting * m_singleDriver
TransMythUICheckBoxSetting * m_singleShader
TransMythUICheckBoxSetting * m_doubleShader
static void LoadQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver, QString &Value)
Parse the required deinterlacing quality and preferences.
bool keyPressEvent(QKeyEvent *e) override
PlaybackProfileItemConfig(PlaybackProfileConfig *parent, uint idx, MythVideoProfileItem &_item)
TransMythUIComboBoxSetting * m_doubleDeint
TransMythUISpinBoxSetting * m_maxCpus
void Load(void) override
TransMythUIComboBoxSetting * m_decoder
void vrenderChanged(const QString &renderer)
void heightChanged(const QString &val)
void ShowDeleteDialog(void) const
void SingleQualityChanged(const QString &Quality)
TransMythUIComboBoxSetting * m_vidRend
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
void ShowMenu(void) override
PlaybackSettingsDialog(MythScreenStack *stack)
void NewPlaybackProfileSlot(void) const
void Load(void) override
MythUIComboBoxSetting * m_playbackProfiles
void CreateNewPlaybackProfileSlot(const QString &name)
ButtonStandardSetting * m_newPlaybackProfileButton
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
void childChanged(StandardSetting *) override
StandardSetting * m_rebootCommand
StandardSetting * m_overrideExitMenu
StandardSetting * m_confirmCommand
StandardSetting * m_suspendCommand
StandardSetting * m_haltCommand
MythUIButtonList * m_buttonList
virtual void addChild(StandardSetting *child)
virtual void Load(void)
bool isVisible(void) const
virtual void setReadOnly(bool readonly)
void addTargetedChild(const QString &value, StandardSetting *setting)
virtual void clearSettings()
void settingsChanged(StandardSetting *selectedSetting=nullptr)
virtual void setHelpText(const QString &str)
QString getLabel(void) const
StandardSetting * getParent() const
void ShouldRedraw(StandardSetting *setting)
void setVisible(bool visible)
virtual QList< StandardSetting * > * getSubSettings()
bool haveChanged()
Return true if the setting have changed or any of its children.
virtual void setValue(const QString &newValue)
void removeTargetedChild(const QString &value, StandardSetting *child)
void valueChanged(const QString &newValue)
virtual QString getValue(void) const
virtual void setEnabled(bool enabled)
virtual void setLabel(QString str)
void setChanged(bool changed)
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
VideoModeSettings(const char *c)
static QStringList GetVisualiserList(RenderType type)
Definition: videovisual.cpp:10
unsigned int uint
Definition: compat.h:60
static GlobalSpinBoxSetting * RecordPreRoll()
static HostCheckBoxSetting * LCDShowMusic()
static HostCheckBoxSetting * LCDShowVolume()
static HostCheckBoxSetting * LCDBigClock()
static GlobalSpinBoxSetting * DeletedMaxAge()
static HostSpinBoxSetting * GuiHeight()
static HostCheckBoxSetting * LCDShowRecStatus()
static HostSpinBoxSetting * LiveTVIdleTimeout()
static GlobalSpinBoxSetting * GRSignLangRecPriority()
static GlobalSpinBoxSetting * GROnScrSubRecPriority()
static HostSpinBoxSetting * StartupScreenDelay()
static HostCheckBoxSetting * LCDEnable()
static HostCheckBoxSetting * BrowseAllTuners()
static HostCheckBoxSetting * JumpToProgramOSD()
static HostCheckBoxSetting * PlaybackWatchList()
static GlobalSpinBoxSetting * GRHDTVRecPriority()
static GlobalSpinBoxSetting * MaximumCommercialSkip()
static HostCheckBoxSetting * SmartForward()
static GlobalSpinBoxSetting * MaxStartGap()
static HostCheckBoxSetting * AlwaysOnTop()
static HostTextEditSetting * LCDKeyString()
static GlobalComboBoxSetting * ISO639PreferredLanguage(uint i)
static GlobalComboBoxSetting * OverTimeCategory()
static HostCheckBoxSetting * EnableMHEG()
static HostComboBoxSetting * ChannelFormat()
static HostComboBoxSetting * MenuTheme()
static HostCheckBoxSetting * PersistentBrowseMode()
static HostComboBoxSetting * Visualiser()
static HostSpinBoxSetting * FrontendIdleTimeout()
static HostComboBoxSetting * ColourPrimaries()
static GlobalComboBoxSetting * MythLanguage()
static HostCheckBoxSetting * PlaybackWLStart()
static HostTextEditSetting * DefaultTVChannel()
static HostCheckBoxSetting * UseVirtualKeyboard()
static HostComboBoxSetting * ScreenSelection()
static HostCheckBoxSetting * EnableMHEGic()
static GlobalSpinBoxSetting * AutoExpireExtraSpace()
static HostCheckBoxSetting * EnableMediaMon()
static HostCheckBoxSetting * AutomaticSetWatched()
static HostCheckBoxSetting * LCDBacklightOn()
static HostTextEditSetting * ScreenShotPath()
static HostComboBoxSetting * AutomaticChannelGroupSelection()
static HostComboBoxSetting * GuiVidModeResolution()
static HostTextEditSetting * IgnoreMedia()
static HostSpinBoxSetting * PlaybackWLMaxAge()
static GlobalCheckBoxSetting * RerecordWatched()
static HostCheckBoxSetting * LCDShowChannel()
static HostCheckBoxSetting * ChannelGroupRememberLast()
static HostCheckBoxSetting * ChromaUpsampling()
static HostSpinBoxSetting * GuiWidth()
static GlobalSpinBoxSetting * GRCCRecPriority()
static HostTextEditSetting * HaltCommand(MythPower *Power)
static GlobalSpinBoxSetting * AutoExpireLiveTVMaxAge()
static GlobalSpinBoxSetting * GRWSRecPriority()
static HostComboBoxSetting * ChannelGroupDefault()
static HostComboBoxSetting * LCDShowMusicItems()
static GlobalComboBoxSetting * ManualRecordStartChanType()
static HostCheckBoxSetting * ForceFullScreen()
static HostCheckBoxSetting * ConfirmPowerEvent()
static GlobalSpinBoxSetting * RecordOverTime()
static GlobalComboBoxSetting * AutoExpireMethod()
static GlobalSpinBoxSetting * MergeShortCommBreaks()
static HostCheckBoxSetting * RecGroupMod()
static HostCheckBoxSetting * PBBStartInTitle()
static GlobalSpinBoxSetting * GRPrefInputRecPriority()
static HostComboBoxSetting * ScreenAspectRatio()
static HostCheckBoxSetting * LCDShowMenu()
static HostCheckBoxSetting * BrowseChannelGroup()
static HostComboBoxSetting * ChannelOrdering()
static HostCheckBoxSetting * LCDShowTime()
static GlobalSpinBoxSetting * GRHardHearRecPriority()
static HostComboBoxSetting * TVVidModeResolution(int idx=-1)
static HostSpinBoxSetting * VertScanPercentage()
static HostSpinBoxSetting * PlaybackWLBlackOut()
static HostComboBoxSetting * PlayBoxOrdering()
static HostComboBoxSetting * LongChannelFormat()
static HostSpinBoxSetting * XScanDisplacement()
static HostCheckBoxSetting * EndOfRecordingExitPrompt()
static HostCheckBoxSetting * RunInWindow()
static HostComboBoxSetting * AutoCommercialSkip()
static HostCheckBoxSetting * RealtimePriority()
static HostTextEditSetting * UDPNotifyPort()
static HostCheckBoxSetting * ContinueEmbeddedTVPlay()
static HostCheckBoxSetting * HideMouseCursor()
static HostTextEditSetting * SetupPinCode()
static HostTextEditSetting * SuspendCommand(MythPower *Power)
static HostRefreshRateComboBoxSetting * TVVidModeRefreshRate(int idx=-1)
static HostComboBoxSetting * DisplayRecGroup()
static GlobalComboBoxSetting * GRSchedOpenEnd()
static HostComboBoxSetting * LetterboxingColour()
static GlobalSpinBoxSetting * GRAudioDescRecPriority()
static HostComboBoxSetting * PlaybackExitPrompt()
static GroupSetting * CategoryOverTimeSettings()
static GlobalCheckBoxSetting * AggressiveCommDetect()
static HostTextEditSetting * LircDaemonDevice()
static HostComboBoxSetting * OverrideExitMenu(MythPower *Power)
static HostComboBoxSetting * TVVidModeForceAspect(int idx=-1)
static HostComboBoxSetting * MythTimeFormat()
static HostCheckBoxSetting * UseVideoModes()
static GlobalTextEditSetting * SortPrefixExceptions()
static HostSpinBoxSetting * AudioReadAhead()
static GlobalCheckBoxSetting * CommFlagFast()
static HostCheckBoxSetting * LCDHeartBeatOn()
static GlobalSpinBoxSetting * CategoryOverTime()
static HostCheckBoxSetting * LCDShowGeneric()
static HostSpinBoxSetting * NetworkControlPort()
static HostSpinBoxSetting * VidModeWidth(int idx)
static HostCheckBoxSetting * DefaultCCMode()
static void ISO639_fill_selections(MythUIComboBoxSetting *widget, uint i)
static HostComboBoxSetting * MythShortDateFormat()
static void AddPaintEngine(GroupSetting *Group)
static GlobalSpinBoxSetting * DeferAutoTranscodeDays()
static HostComboBoxSetting * AdjustFill()
static HostSpinBoxSetting * VideoModeChangePause(void)
static HostCheckBoxSetting * GUIRGBLevels()
static HostCheckBoxSetting * NetworkControlEnabled()
static HostSpinBoxSetting * VidModeHeight(int idx)
static HostCheckBoxSetting * MusicChoiceEnabled()
static HostSpinBoxSetting * FFRewReposTime()
static GlobalCheckBoxSetting * SortStripPrefixes()
static HostSpinBoxSetting * EPGRecThreshold()
static HostComboBoxSetting * DisplayGroupTitleSort()
static HostSpinBoxSetting * YScanDisplacement()
static HostCheckBoxSetting * StereoDiscard()
static GlobalComboBoxSetting * AudioLanguage()
static GlobalSpinBoxSetting * AutoExpireDayPriority()
static GlobalSpinBoxSetting * MinimumRecordingQuality()
static HostCheckBoxSetting * SmoothTransitions()
static HostComboBoxSetting * CurrentPlaybackProfile()
static HostSpinBoxSetting * GuiOffsetX()
static HostComboBoxSetting * AspectOverride()
static HostSpinBoxSetting * LCDPopupTime()
static HostCheckBoxSetting * UseProgStartMark()
static HostCheckBoxSetting * PlaybackWLAutoExpire()
static GlobalComboBoxSetting * CommercialSkipMethod()
static HostCheckBoxSetting * QueryInitialFilter()
static HostCheckBoxSetting * RememberRecGroup()
static HostSpinBoxSetting * CommRewindAmount()
static HostCheckBoxSetting * FFRewReverse()
static GlobalCheckBoxSetting * AutoExpireWatchedPriority()
static HostSpinBoxSetting * CommNotifyAmount()
static HostSpinBoxSetting * HorizScanPercentage()
static HostComboBoxSetting * PlayBoxEpisodeSort()
static HostTextEditSetting * RebootCommand(MythPower *Power)
static HostSpinBoxSetting * GuiOffsetY()
static HostComboBoxSetting * MythDateFormatCB()
static GlobalSpinBoxSetting * MaxEndGap()
static HostComboBoxSetting * SubtitleCodec()
static HostCheckBoxSetting * AlwaysShowWatchedProgress()
static HostSpinBoxSetting * GUIFontZoom()
static HostCheckBoxSetting * GuiSizeForTV()
QMap< int, QString > iso639_key_to_english_name
Definition: iso639.cpp:15
QString iso639_str2_to_str3(const QString &str2)
Definition: iso639.cpp:73
ISO 639-1 and ISO 639-2 support functions.
static QString iso639_key_to_str3(int code)
Definition: iso639.h:45
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythDB * GetMythDB(void)
Definition: mythdb.cpp:50
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
Definition: mythlogging.h:29
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythMainWindow * GetMythMainWindow(void)
@ kRenderOpenGL
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
void resetMythSortHelper(void)
Delete the MythSortHelper singleton.
@ kMSStdOut
allow access to stdout
Definition: mythsystem.h:41
@ kMSDontDisableDrawing
avoid disabling UI drawing
Definition: mythsystem.h:37
QMap< QString, bool > Setting
static MythThemedMenu * menu
MythUIHelper * GetMythUI()
static constexpr const char * PREF_DEC
static constexpr const char * PREF_DEINT1X
static constexpr const char * DEINT_QUALITY_MEDIUM
static constexpr const char * DEINT_QUALITY_HIGH
static constexpr const char * DEINT_QUALITY_SHADER
static constexpr const char * PREF_LOOP
static constexpr const char * DEINT_QUALITY_LOW
static constexpr const char * PREF_UPSCALE
static constexpr const char * COND_RATE
static constexpr const char * COND_CODECS
static constexpr const char * PREF_CPUS
static constexpr const char * DEINT_QUALITY_NONE
static constexpr const char * COND_HEIGHT
static constexpr const char * PREF_RENDER
static constexpr const char * PREF_DEINT2X
static constexpr uint VIDEO_MAX_CPUS
static constexpr const char * UPSCALE_DEFAULT
static constexpr const char * DEINT_QUALITY_DRIVER
static constexpr const char * COND_WIDTH
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:93
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15
bool exists(str path)
Definition: xbmcvfs.py:51
std::deque< int > GetPreferredSkipTypeCombinations(void)
QString SkipTypeToString(int flags)
@ THEME_MENU
Definition: themeinfo.h:17
Scheduler * sched
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:86
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:80
AspectOverrideMode
Definition: videoouttypes.h:61
@ kAspect_Off
Definition: videoouttypes.h:63
@ kAspect_END
Definition: videoouttypes.h:68
QString toDBString(PrimariesMode Mode)
AdjustFillMode
Definition: videoouttypes.h:72
@ kAdjustFill_Off
Definition: videoouttypes.h:74
@ kAdjustFill_AutoDetect_DefaultHalf
Definition: videoouttypes.h:83
@ kAdjustFill_AutoDetect_DefaultOff
Definition: videoouttypes.h:82
@ kAdjustFill_END
Definition: videoouttypes.h:81
QString toUserString(PrimariesMode Mode)
LetterBoxColour
Definition: videoouttypes.h:87
@ kLetterBoxColour_END
Definition: videoouttypes.h:91
@ kLetterBoxColour_Black
Definition: videoouttypes.h:89
@ PrimariesDisabled
@ PrimariesExact
@ PrimariesRelaxed