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