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{
756 m_maxCpus = new TransMythUISpinBoxSetting(1, HAVE_THREADS ? VIDEO_MAX_CPUS : 1, 1, 1);
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 (HAVE_THREADS ? "" :
844 tr(" Multithreaded decoding disabled-only one CPU "
845 "will be used, please recompile with "
846 "--enable-ffmpeg-pthreads to enable.")));
847
849 tr("When unchecked the deblocking loopfilter will be disabled. ") + "\n" +
850 tr("Disabling will significantly reduce the load on the CPU for software decoding of "
851 "H.264 and HEVC material but may significantly reduce video quality."));
852
854 "The default scaler provides good quality in the majority of situations. "
855 "Higher quality scalers may offer some benefit when scaling very low "
856 "resolution material but may not be as fast."));
857
867
874
875 connect(m_widthRange, qOverload<const QString&>(&StandardSetting::valueChanged),
877 connect(m_heightRange, qOverload<const QString&>(&StandardSetting::valueChanged),
879 connect(m_codecs, qOverload<const QString&>(&StandardSetting::valueChanged),
881 connect(m_framerate, qOverload<const QString&>(&StandardSetting::valueChanged),
883 connect(m_decoder, qOverload<const QString&>(&StandardSetting::valueChanged),
885 connect(m_vidRend, qOverload<const QString&>(&StandardSetting::valueChanged),
887 connect(m_singleDeint, qOverload<const QString&>(&StandardSetting::valueChanged),
889 connect(m_doubleDeint, qOverload<const QString&>(&StandardSetting::valueChanged),
891}
892
894{
895 return m_index;
896}
897
899{
900 QString width_value;
901 QString height_value;
902 // pref_cmp0 and pref_cmp1 are no longer used. This code
903 // is here to convery them to the new settings cond_width
904 // and cond_height
905 for (uint i = 0; i < 2; ++i)
906 {
907 QString pcmp = m_item.Get(QString("pref_cmp%1").arg(i));
908 if (pcmp == "> 0 0")
909 continue;
910 QStringList clist = pcmp.split(" ");
911
912 if (clist.size() < 3)
913 continue;
914 if (!width_value.isEmpty())
915 {
916 width_value.append("&");
917 height_value.append("&");
918 }
919 width_value.append(clist[0]+clist[1]);
920 height_value.append(clist[0]+clist[2]);
921 }
922
923 QString tmp = m_item.Get(COND_WIDTH).trimmed();
924 if (!tmp.isEmpty())
925 {
926 if (!width_value.isEmpty())
927 width_value.append("&");
928 width_value.append(tmp);
929 }
930 tmp = m_item.Get(COND_HEIGHT).trimmed();
931 if (!tmp.isEmpty())
932 {
933 if (!height_value.isEmpty())
934 height_value.append("&");
935 height_value.append(tmp);
936 }
937
938 m_widthRange->setValue(width_value);
939 m_heightRange->setValue(height_value);
940 auto codecs = m_item.Get(COND_CODECS);
941 if (codecs.isEmpty())
942 codecs = " ";
943 m_codecs->setValue(codecs);
945
946 QString pdecoder = m_item.Get(PREF_DEC);
947 QString pmax_cpus = m_item.Get(PREF_CPUS);
948 QString pskiploop = m_item.Get(PREF_LOOP);
949 QString prenderer = m_item.Get(PREF_RENDER);
950 QString psingledeint = m_item.Get(PREF_DEINT1X);
951 QString pdoubledeint = m_item.Get(PREF_DEINT2X);
952 auto upscale = m_item.Get(PREF_UPSCALE);
953 if (upscale.isEmpty())
954 upscale = UPSCALE_DEFAULT;
955 bool found = false;
956
957 QString dech = MythVideoProfile::GetDecoderHelp();
958 QStringList decr = MythVideoProfile::GetDecoders();
959 QStringList decn = MythVideoProfile::GetDecoderNames();
960 QStringList::const_iterator itr = decr.cbegin();
961 QStringList::const_iterator itn = decn.cbegin();
963 m_decoder->setHelpText(dech);
964 for (; (itr != decr.cend()) && (itn != decn.cend()); ++itr, ++itn)
965 {
966 m_decoder->addSelection(*itn, *itr, (*itr == pdecoder));
967 found |= (*itr == pdecoder);
968 }
969 if (!found && !pdecoder.isEmpty())
970 m_decoder->addSelection(MythVideoProfile::GetDecoderName(pdecoder), pdecoder, true);
972
973 if (!pmax_cpus.isEmpty())
974 m_maxCpus->setValue(pmax_cpus.toInt());
975
976 m_skipLoop->setValue((!pskiploop.isEmpty()) ? (pskiploop.toInt() > 0) : true);
977 m_upscaler->setValue(upscale);
978
979 if (!prenderer.isEmpty())
980 m_vidRend->setValue(prenderer);
981
984
986}
987
989{
990 m_item.Set("pref_cmp0", QString());
991 m_item.Set("pref_cmp1", QString());
998 m_item.Set(PREF_LOOP, (m_skipLoop->boolValue()) ? "1" : "0");
1003}
1004
1006{
1007 bool ok = true;
1008 QString oldvalue = m_item.Get(COND_WIDTH);
1009 m_item.Set(COND_WIDTH, val);
1010 m_item.CheckRange(COND_WIDTH, 640, &ok);
1011 if (!ok)
1012 {
1013 ShowOkPopup(tr("Invalid width specification(%1), discarded").arg(val));
1014 m_widthRange->setValue(oldvalue);
1015 }
1016 InitLabel();
1017}
1018
1020{
1021 bool ok = true;
1022 QString oldvalue = m_item.Get(COND_HEIGHT);
1023 m_item.Set(COND_HEIGHT,val);
1024 m_item.CheckRange(COND_HEIGHT, 480, &ok);
1025 if (!ok)
1026 {
1027 ShowOkPopup(tr("Invalid height specification(%1), discarded").arg(val));
1028 m_heightRange->setValue(oldvalue);
1029 }
1030 InitLabel();
1031}
1032
1034{
1035 bool ok = true;
1036 QString oldvalue = m_item.Get(COND_RATE);
1037 m_item.Set(COND_RATE,val);
1038 m_item.CheckRange(COND_RATE, 25.0F, &ok);
1039 if (!ok)
1040 {
1041 ShowOkPopup(tr("Invalid frame rate specification(%1), discarded").arg(val));
1042 m_framerate->setValue(oldvalue);
1043 }
1044 InitLabel();
1045}
1046
1048{
1049 QString vrenderer = m_vidRend->getValue();
1050 QStringList renderers = MythVideoProfile::GetVideoRenderers(dec);
1051
1052 QString prenderer;
1053 for (const auto & rend : std::as_const(renderers))
1054 prenderer = (rend == vrenderer) ? vrenderer : prenderer;
1055 if (prenderer.isEmpty())
1057
1059 for (const auto & rend : std::as_const(renderers))
1060 {
1061 if ((!rend.contains("null")))
1063 rend, (rend == prenderer));
1064 }
1065 QString vrenderer2 = m_vidRend->getValue();
1066 vrenderChanged(vrenderer2);
1067
1069 InitLabel();
1070}
1071
1073{
1075 InitLabel();
1076}
1077
1079{
1080 bool enabled = Quality != DEINT_QUALITY_NONE;
1081 m_singleShader->setEnabled(enabled);
1082 m_singleDriver->setEnabled(enabled);
1083}
1084
1086{
1087 bool enabled = Quality != DEINT_QUALITY_NONE;
1088 m_doubleShader->setEnabled(enabled);
1089 m_doubleDriver->setEnabled(enabled);
1090}
1091
1102 QString &Value)
1103{
1104 bool enabled = true;
1105
1106 if (Value.contains(DEINT_QUALITY_HIGH))
1107 {
1109 }
1110 else if (Value.contains(DEINT_QUALITY_MEDIUM))
1111 {
1113 }
1114 else if (Value.contains(DEINT_QUALITY_LOW))
1115 {
1117 }
1118 else
1119 {
1120 enabled = false;
1122 }
1123
1124 Shader->setValue(Value.contains(DEINT_QUALITY_SHADER));
1125 Driver->setValue(Value.contains(DEINT_QUALITY_DRIVER));
1126 Shader->setEnabled(enabled);
1127 Driver->setEnabled(enabled);
1128}
1129
1133{
1134 QStringList values;
1135 QString quality = Deint->getValue();
1136 if (quality == DEINT_QUALITY_LOW || quality == DEINT_QUALITY_MEDIUM || quality == DEINT_QUALITY_HIGH)
1137 values.append(quality);
1138 else
1139 values.append(DEINT_QUALITY_NONE);
1140
1141 // N.B. save these regardless to preserve preferences
1142 if (Shader->boolValue())
1143 values.append(DEINT_QUALITY_SHADER);
1144 if (Driver->boolValue())
1145 values.append(DEINT_QUALITY_DRIVER);
1146
1147 return values.join(":");
1148}
1149
1151{
1152 QStringList actions;
1153
1154 if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
1155 return true;
1156
1157 if (std::any_of(actions.cbegin(), actions.cend(),
1158 [](const QString & action) { return action == "DELETE"; } ))
1159 {
1161 return true;
1162 }
1163
1164 return false;
1165}
1166
1168{
1169 QString message = tr("Remove this profile item?");
1170 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1171 auto *confirmDelete = new MythConfirmationDialog(popupStack, message, true);
1172
1173 if (confirmDelete->Create())
1174 {
1175 connect(confirmDelete, &MythConfirmationDialog::haveResult,
1177 popupStack->AddScreen(confirmDelete);
1178 }
1179 else
1180 {
1181 delete confirmDelete;
1182 }
1183}
1184
1186{
1187 if (doDelete)
1189}
1190
1192{
1194}
1195
1197{
1199}
1200
1202 StandardSetting *parent) :
1203 m_profileName(std::move(profilename))
1204{
1205 setVisible(false);
1209 InitUI(parent);
1210}
1211
1213{
1214 QStringList restrict;
1215 QString width = m_widthRange->getValue();
1216 if (!width.isEmpty())
1217 restrict << tr("Width", "video formats") + " " + width;
1218 QString height = m_heightRange->getValue();
1219 if (!height.isEmpty())
1220 restrict << tr("Height", "video formats") + " " + height;
1221 QString codecsval = m_codecs->getValue().trimmed();
1222 if (!codecsval.isEmpty())
1223 restrict << tr("Formats", "video formats") + " " + codecsval.toUpper();
1224 QString framerateval = m_framerate->getValue();
1225 if (!framerateval.isEmpty())
1226 restrict << tr("framerate") + " " + framerateval;
1227
1228 QString str;
1229 if (!restrict.isEmpty())
1230 str += restrict.join(" ") + " -> ";
1232 str += " " + tr("&", "and") + ' ';
1234 setLabel(str);
1235}
1236
1238{
1240 m_markForDeletion->setLabel(tr("Mark for deletion"));
1241 m_addNewEntry = new ButtonStandardSetting(tr("Add New Entry"));
1242
1245
1248
1249 for (size_t i = 0; i < m_items.size(); ++i)
1250 InitProfileItem(i, parent);
1251}
1252
1254 uint i, StandardSetting *parent)
1255{
1256 auto *ppic = new PlaybackProfileItemConfig(this, i, m_items[i]);
1257
1258 m_items[i].Set("pref_priority", QString::number(i + 1));
1259
1260 parent->addTargetedChild(m_profileName, ppic);
1261 m_profiles.push_back(ppic);
1262 return ppic;
1263}
1264
1266{
1268 {
1271 return;
1272 }
1273
1274 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1275 {
1276 profile->Save();
1277 }
1278
1280 if (!ok)
1281 {
1282 LOG(VB_GENERAL, LOG_ERR,
1283 "PlaybackProfileConfig::Save() -- failed to delete items");
1284 return;
1285 }
1286
1288 if (!ok)
1289 {
1290 LOG(VB_GENERAL, LOG_ERR,
1291 "PlaybackProfileConfig::Save() -- failed to save items");
1292 return;
1293 }
1294}
1295
1297 PlaybackProfileItemConfig *profileToDelete)
1298{
1299 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1300 profile->Save();
1301
1302 uint i = profileToDelete->GetIndex();
1303 m_delItems.push_back(m_items[i]);
1304 m_items.erase(m_items.begin() + i);
1305
1307}
1308
1310{
1311 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1312 profile->Save();
1313 m_items.emplace_back();
1315}
1316
1318{
1321
1322 for (StandardSetting *setting : std::as_const(m_profiles))
1324 m_profiles.clear();
1325
1326 InitUI(getParent());
1327 for (StandardSetting *setting : std::as_const(m_profiles))
1328 setting->Load();
1329 emit getParent()->settingsChanged();
1330 setChanged(true);
1331}
1332
1333// This function doesn't guarantee that no exceptions will be thrown.
1334// NOLINTNEXTLINE(performance-noexcept-swap)
1335void PlaybackProfileConfig::swap(int indexA, int indexB)
1336{
1337 for (PlaybackProfileItemConfig *profile : std::as_const(m_profiles))
1338 profile->Save();
1339
1340 QString pri_i = QString::number(m_items[indexA].GetPriority());
1341 QString pri_j = QString::number(m_items[indexB].GetPriority());
1342
1343 MythVideoProfileItem item = m_items[indexB];
1344 m_items[indexB] = m_items[indexA];
1345 m_items[indexA] = item;
1346
1347 m_items[indexA].Set("pref_priority", pri_i);
1348 m_items[indexB].Set("pref_priority", pri_j);
1349
1351}
1352
1354{
1355 auto *grouptrigger = new HostComboBoxSetting("DefaultVideoPlaybackProfile");
1356 grouptrigger->setLabel(
1357 QCoreApplication::translate("PlaybackProfileConfigs",
1358 "Current Video Playback Profile"));
1359
1360 QString host = gCoreContext->GetHostName();
1362 QStringList profiles = MythVideoProfile::GetProfiles(host);
1363
1365 if (!profiles.contains(profile))
1366 {
1367 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
1369 }
1370
1371 for (const auto & prof : std::as_const(profiles))
1372 {
1373 grouptrigger->addSelection(ProgramInfo::i18n(prof), prof);
1374 grouptrigger->addTargetedChild(prof,
1375 new PlaybackProfileConfig(prof, grouptrigger));
1376 }
1377
1378 return grouptrigger;
1379}
1380
1382{
1383 QString msg = tr("Enter Playback Profile Name");
1384
1385 MythScreenStack *popupStack =
1386 GetMythMainWindow()->GetStack("popup stack");
1387
1388 auto *settingdialog = new MythTextInputDialog(popupStack, msg);
1389
1390 if (settingdialog->Create())
1391 {
1392 connect(settingdialog, &MythTextInputDialog::haveResult,
1394 popupStack->AddScreen(settingdialog);
1395 }
1396 else
1397 {
1398 delete settingdialog;
1399 }
1400}
1401
1403{
1404 QString host = gCoreContext->GetHostName();
1405 QStringList not_ok_list = MythVideoProfile::GetProfiles(host);
1406
1407 if (not_ok_list.contains(name) || name.isEmpty())
1408 {
1409 QString msg = (name.isEmpty()) ?
1410 tr("Sorry, playback group\nname cannot be blank.") :
1411 tr("Sorry, playback group name\n"
1412 "'%1' is already being used.").arg(name);
1413
1414 ShowOkPopup(msg);
1415
1416 return;
1417 }
1418
1422
1423 m_playbackProfiles->addSelection(name, name, true);
1424}
1425
1427{
1428 std::array<QString,4> str
1429 {
1430 PlaybackSettings::tr("Sort all sub-titles/multi-titles Ascending"),
1431 PlaybackSettings::tr("Sort all sub-titles/multi-titles Descending"),
1432 PlaybackSettings::tr("Sort sub-titles Descending, multi-titles "
1433 "Ascending"),
1434 PlaybackSettings::tr("Sort sub-titles Ascending, multi-titles Descending"),
1435 };
1436
1437 QString help = PlaybackSettings::tr("Selects how to sort show episodes. "
1438 "Sub-titles refers to the episodes "
1439 "listed under a specific show title. "
1440 "Multi-title refers to sections (e.g. "
1441 "\"All Programs\") which list multiple "
1442 "titles. Sections in parentheses are "
1443 "not affected.");
1444
1445 auto *gc = new HostComboBoxSetting("PlayBoxOrdering");
1446
1447 gc->setLabel(PlaybackSettings::tr("Episode sort orderings"));
1448
1449 for (size_t i = 0; i < str.size(); ++i)
1450 gc->addSelection(str[i], QString::number(i));
1451
1452 gc->setValue(3);
1453 gc->setHelpText(help);
1454
1455 return gc;
1456}
1457
1459{
1460 auto *gc = new HostComboBoxSetting("PlayBoxEpisodeSort");
1461
1462 gc->setLabel(PlaybackSettings::tr("Sort episodes"));
1463
1464 gc->addSelection(PlaybackSettings::tr("Record date"), "Date");
1465 gc->addSelection(PlaybackSettings::tr("Season/Episode"), "Season");
1466 gc->addSelection(PlaybackSettings::tr("Original air date"), "OrigAirDate");
1467 gc->addSelection(PlaybackSettings::tr("Program ID"), "Id");
1468
1469 gc->setHelpText(PlaybackSettings::tr("Selects how to sort a show's "
1470 "episodes"));
1471
1472 return gc;
1473}
1474
1476{
1477 auto *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5);
1478
1479 gs->setLabel(PlaybackSettings::tr("Fast forward/rewind reposition amount"));
1480
1481 gs->setValue(100);
1482
1483 gs->setHelpText(PlaybackSettings::tr("When exiting sticky keys fast "
1484 "forward/rewind mode, reposition "
1485 "this many 1/100th seconds before "
1486 "resuming normal playback. This "
1487 "compensates for the reaction time "
1488 "between seeing where to resume "
1489 "playback and actually exiting "
1490 "seeking."));
1491 return gs;
1492}
1493
1495{
1496 auto *gc = new HostCheckBoxSetting("FFRewReverse");
1497
1498 gc->setLabel(PlaybackSettings::tr("Reverse direction in fast "
1499 "forward/rewind"));
1500
1501 gc->setValue(true);
1502
1503 gc->setHelpText(PlaybackSettings::tr("If enabled, pressing the sticky "
1504 "rewind key in fast forward mode "
1505 "switches to rewind mode, and "
1506 "vice versa. If disabled, it will "
1507 "decrease the current speed or "
1508 "switch to play mode if the speed "
1509 "can't be decreased further."));
1510 return gc;
1511}
1512
1513static void AddPaintEngine(GroupSetting* Group)
1514{
1515 if (!Group)
1516 return;
1517
1518 const QStringList options = MythPainterWindow::GetPainters();
1519
1520 // Don't show an option if there is no choice. Do not offer Qt painter (but
1521 // MythPainterWindow will accept 'Qt' if overriden from the command line)
1522 if (options.size() <= 1)
1523 return;
1524
1525 QString pref = GetMythDB()->GetSetting("PaintEngine", MythPainterWindow::GetDefaultPainter());
1526 auto* paint = new HostComboBoxSetting("PaintEngine");
1527 paint->setLabel(AppearanceSettings::tr("Paint engine"));
1528 for (const auto & option : options)
1529 paint->addSelection(option, option, option == pref);
1530
1531 paint->setHelpText(AppearanceSettings::tr("This selects what MythTV uses to draw. "));
1532 Group->addChild(paint);
1533}
1534
1536{
1537 auto *gc = new HostComboBoxSetting("MenuTheme");
1538
1539 gc->setLabel(AppearanceSettings::tr("Menu theme"));
1540
1541 QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
1542
1543 QList<ThemeInfo>::iterator it;
1544 for( it = themelist.begin(); it != themelist.end(); ++it )
1545 {
1546 gc->addSelection((*it).GetName(), (*it).GetDirectoryName(),
1547 (*it).GetDirectoryName() == "defaultmenu");
1548 }
1549
1550 return gc;
1551}
1552
1553#if 0
1554static HostComboBoxSetting *DecodeVBIFormat()
1555{
1556 QString beVBI = gCoreContext->GetSetting("VbiFormat");
1557 QString fmt = beVBI.toLower().left(4);
1558 int sel = (fmt == "pal ") ? 1 : ((fmt == "ntsc") ? 2 : 0);
1559
1560 HostComboBoxSetting *gc = new HostComboBoxSetting("DecodeVBIFormat");
1561
1562 gc->setLabel(OSDSettings::tr("Decode VBI format"));
1563
1564 gc->addSelection(OSDSettings::tr("None"), "none",
1565 0 == sel);
1566 gc->addSelection(OSDSettings::tr("PAL teletext"), "pal_txt",
1567 1 == sel);
1568 gc->addSelection(OSDSettings::tr("NTSC closed caption"), "ntsc_cc",
1569 2 == sel);
1570
1571 gc->setHelpText(
1572 OSDSettings::tr("If enabled, this overrides the mythtv-setup setting "
1573 "used during recording when decoding captions."));
1574
1575 return gc;
1576}
1577#endif
1578
1580{
1581 static const QRegularExpression crlf { "[\r\n]" };
1582 static const QRegularExpression suffix { "(//.*)" };
1583
1584 auto *gc = new HostComboBoxSetting("SubtitleCodec");
1585
1586 gc->setLabel(OSDSettings::tr("Subtitle Codec"));
1587
1588 // Translations are now done via FFmpeg(iconv). Get the list of
1589 // encodings that iconv supports.
1590 QScopedPointer<MythSystem>
1591 cmd(MythSystem::Create({"iconv", "-l"},
1593 cmd->Wait();
1594 QString results = cmd->GetStandardOutputStream()->readAll();
1595 QStringList list = results.toLower().split(crlf, Qt::SkipEmptyParts);
1596 list.replaceInStrings(suffix, "");
1597 list.sort();
1598
1599 for (const auto & codec : std::as_const(list))
1600 {
1601 QString val = QString(codec);
1602 gc->addSelection(val, val, val.toLower() == "utf-8");
1603 }
1604
1605 return gc;
1606}
1607
1609{
1610 auto *gc = new HostComboBoxSetting("ChannelOrdering");
1611
1612 gc->setLabel(GeneralSettings::tr("Channel ordering"));
1613
1614 gc->addSelection(GeneralSettings::tr("channel number"), "channum");
1615 gc->addSelection(GeneralSettings::tr("callsign"), "callsign");
1616
1617 return gc;
1618}
1619
1621{
1622 auto *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1);
1623
1624 gs->setLabel(PlaybackSettings::tr("Vertical scaling"));
1625
1626 gs->setValue(0);
1627
1628 gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1629 "fill your screen vertically. Range "
1630 "-100% to 100%"));
1631 return gs;
1632}
1633
1635{
1636 auto *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1);
1637
1638 gs->setLabel(PlaybackSettings::tr("Horizontal scaling"));
1639
1640 gs->setValue(0);
1641
1642 gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1643 "fill your screen horizontally. Range "
1644 "-100% to 100%"));
1645 return gs;
1646};
1647
1649{
1650 auto *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1);
1651
1652 gs->setLabel(PlaybackSettings::tr("Scan displacement (X)"));
1653
1654 gs->setValue(0);
1655
1656 gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1657 "horizontally."));
1658
1659 return gs;
1660}
1661
1663{
1664 auto *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1);
1665
1666 gs->setLabel(PlaybackSettings::tr("Scan displacement (Y)"));
1667
1668 gs->setValue(0);
1669
1670 gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1671 "vertically."));
1672
1673 return gs;
1674};
1675
1677{
1678 auto *gc = new HostCheckBoxSetting("DefaultCCMode");
1679
1680 gc->setLabel(OSDSettings::tr("Always display closed captioning or "
1681 "subtitles"));
1682
1683 gc->setValue(false);
1684
1685 gc->setHelpText(OSDSettings::tr("If enabled, captions will be displayed "
1686 "when playing back recordings or watching "
1687 "Live TV. Closed Captioning can be turned "
1688 "on or off by pressing \"T\" during"
1689 "playback."));
1690 return gc;
1691}
1692
1694{
1695 auto *gc = new HostCheckBoxSetting("EnableMHEG");
1696
1697 gc->setLabel(OSDSettings::tr("Enable interactive TV"));
1698
1699 gc->setValue(false);
1700
1701 gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1702 "(MHEG) will be activated. This is used "
1703 "for teletext and logos for radio and "
1704 "channels that are currently off-air."));
1705 return gc;
1706}
1707
1709{
1710 auto *gc = new HostCheckBoxSetting("EnableMHEGic");
1711 gc->setLabel(OSDSettings::tr("Enable network access for interactive TV"));
1712 gc->setValue(true);
1713 gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1714 "(MHEG) will be able to access interactive "
1715 "content over the Internet. This is used "
1716 "for BBC iPlayer."));
1717 return gc;
1718}
1719
1721{
1722 auto *combo = new HostComboBoxSetting("AudioVisualiser");
1723 combo->setLabel(OSDSettings::tr("Visualiser for audio only playback"));
1724 combo->setHelpText(OSDSettings::tr("Select a visualisation to use when there "
1725 "is no video. Defaults to none."));
1726 combo->addSelection("None", "");
1728 for (const auto & visual : std::as_const(visuals))
1729 combo->addSelection(visual, visual);
1730 return combo;
1731}
1732
1734{
1735 auto *gc = new HostCheckBoxSetting("PersistentBrowseMode");
1736
1737 gc->setLabel(OSDSettings::tr("Always use browse mode in Live TV"));
1738
1739 gc->setValue(true);
1740
1741 gc->setHelpText(OSDSettings::tr("If enabled, browse mode will "
1742 "automatically be activated whenever "
1743 "you use channel up/down while watching "
1744 "Live TV."));
1745 return gc;
1746}
1747
1749{
1750 auto *gc = new HostCheckBoxSetting("BrowseAllTuners");
1751
1752 gc->setLabel(OSDSettings::tr("Browse all channels"));
1753
1754 gc->setValue(false);
1755
1756 gc->setHelpText(OSDSettings::tr("If enabled, browse mode will show "
1757 "channels on all available recording "
1758 "devices, instead of showing channels "
1759 "on just the current recorder."));
1760 return gc;
1761}
1762
1764{
1765 auto *gc = new HostCheckBoxSetting("UseProgStartMark");
1766
1767 gc->setLabel(PlaybackSettings::tr("Playback from start of program"));
1768
1769 gc->setValue(false);
1770
1771 gc->setHelpText(PlaybackSettings::tr("If enabled and no bookmark is set, "
1772 "playback starts at the program "
1773 "scheduled start time rather than "
1774 "the beginning of the recording. "
1775 "Useful for automatically skipping "
1776 "'start early' parts of a recording."));
1777 return gc;
1778}
1779
1781{
1782 auto *gc = new HostComboBoxSetting("PlaybackExitPrompt");
1783
1784 gc->setLabel(PlaybackSettings::tr("Action on playback exit"));
1785
1786 gc->addSelection(PlaybackSettings::tr("Just exit"), "0");
1787 gc->addSelection(PlaybackSettings::tr("Clear last played position and exit"), "16");
1788 gc->addSelection(PlaybackSettings::tr("Always prompt (excluding Live TV)"),
1789 "1");
1790 gc->addSelection(PlaybackSettings::tr("Always prompt (including Live TV)"),
1791 "4");
1792 gc->addSelection(PlaybackSettings::tr("Prompt for Live TV only"), "8");
1793
1794 gc->setHelpText(PlaybackSettings::tr("If set to prompt, a menu will be "
1795 "displayed when you exit playback "
1796 "mode. The options available will "
1797 "allow you delete the recording, "
1798 "continue watching, or exit."));
1799 return gc;
1800}
1801
1803{
1804 auto *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt");
1805
1806 gc->setLabel(PlaybackSettings::tr("Prompt at end of recording"));
1807
1808 gc->setValue(false);
1809
1810 gc->setHelpText(PlaybackSettings::tr("If enabled, a menu will be displayed "
1811 "allowing you to delete the recording "
1812 "when it has finished playing."));
1813 return gc;
1814}
1815
1817{
1818 auto *gc = new HostCheckBoxSetting("MusicChoiceEnabled");
1819
1820 gc->setLabel(PlaybackSettings::tr("Enable Music Choice"));
1821
1822 gc->setValue(false);
1823
1824 gc->setHelpText(PlaybackSettings::tr("Enable this to improve playing of Music Choice channels "
1825 "or recordings from those channels. "
1826 "These are audio channels with slide show "
1827 "from some cable providers. "
1828 "In unusual situations this could cause lip sync problems "
1829 "watching normal videos or TV shows."));
1830 return gc;
1831}
1832
1834{
1835 auto *gc = new HostCheckBoxSetting("JumpToProgramOSD");
1836
1837 gc->setLabel(PlaybackSettings::tr("Jump to program OSD"));
1838
1839 gc->setValue(true);
1840
1841 gc->setHelpText(PlaybackSettings::tr("Set the choice between viewing the "
1842 "current recording group in the OSD, "
1843 "or showing the 'Watch Recording' "
1844 "screen when 'Jump to Program' is "
1845 "activated. If enabled, the "
1846 "recordings are shown in the OSD"));
1847 return gc;
1848}
1849
1851{
1852 auto *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay");
1853
1854 gc->setLabel(PlaybackSettings::tr("Continue playback when embedded"));
1855
1856 gc->setValue(false);
1857
1858 gc->setHelpText(PlaybackSettings::tr("If enabled, TV playback continues "
1859 "when the TV window is embedded in "
1860 "the upcoming program list or "
1861 "recorded list. The default is to "
1862 "pause the recorded show when "
1863 "embedded."));
1864 return gc;
1865}
1866
1868{
1869 auto *gc = new HostCheckBoxSetting("AutomaticSetWatched");
1870
1871 gc->setLabel(PlaybackSettings::tr("Automatically mark a recording as "
1872 "watched"));
1873
1874 gc->setValue(false);
1875
1876 gc->setHelpText(PlaybackSettings::tr("If enabled, when you exit near the "
1877 "end of a recording it will be marked "
1878 "as watched. The automatic detection "
1879 "is not foolproof, so do not enable "
1880 "this setting if you don't want an "
1881 "unwatched recording marked as "
1882 "watched."));
1883 return gc;
1884}
1885
1887{
1888 auto *gc = new HostCheckBoxSetting("AlwaysShowWatchedProgress");
1889
1890 gc->setLabel(PlaybackSettings::tr("Always show watched percent progress bar"));
1891
1892 gc->setValue(false);
1893
1894 gc->setHelpText(PlaybackSettings::tr("If enabled, shows the watched percent "
1895 "progress bar even if the recording or "
1896 "video is marked as watched. "
1897 "Having a watched percent progress bar at "
1898 "all depends on the currently used theme."));
1899 return gc;
1900}
1901
1903{
1904 auto *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1);
1905
1906 gs->setLabel(PlaybackSettings::tr("Live TV idle timeout (mins)"));
1907
1908 gs->setValue(0);
1909
1910 gs->setHelpText(PlaybackSettings::tr("Exit Live TV automatically if left "
1911 "idle for the specified number of "
1912 "minutes. 0 disables the timeout."));
1913 return gs;
1914}
1915
1916// static HostCheckBoxSetting *PlaybackPreview()
1917// {
1918// HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackPreview");
1919//
1920// gc->setLabel(PlaybackSettings::tr("Display live preview of recordings"));
1921//
1922// gc->setValue(true);
1923//
1924// gc->setHelpText(PlaybackSettings::tr("If enabled, a preview of the recording "
1925// "will play in a small window on the \"Watch a "
1926// "Recording\" menu."));
1927//
1928// return gc;
1929// }
1930//
1931// static HostCheckBoxSetting *HWAccelPlaybackPreview()
1932// {
1933// HostCheckBoxSetting *gc = new HostCheckBoxSetting("HWAccelPlaybackPreview");
1934//
1935// gc->setLabel(PlaybackSettings::tr("Use HW Acceleration for live recording preview"));
1936//
1937// gc->setValue(false);
1938//
1939// gc->setHelpText(
1940// PlaybackSettings::tr(
1941// "If enabled, live recording preview will use hardware "
1942// "acceleration. The video renderer used is determined by the "
1943// "selected CPU profile. Disable if playback is sluggish or "
1944// "causes high CPU load"));
1945//
1946// return gc;
1947// }
1948
1950{
1951 auto *gc = new HostCheckBoxSetting("UseVirtualKeyboard");
1952
1953 gc->setLabel(MainGeneralSettings::tr("Use line edit virtual keyboards"));
1954
1955 gc->setValue(true);
1956
1957 gc->setHelpText(MainGeneralSettings::tr("If enabled, you can use a virtual "
1958 "keyboard in MythTV's line edit "
1959 "boxes. To use, hit SELECT (Enter "
1960 "or Space) while a line edit is in "
1961 "focus."));
1962 return gc;
1963}
1964
1966{
1967 auto *gs = new HostSpinBoxSetting("FrontendIdleTimeout", 0, 360, 5);
1968
1969 gs->setLabel(MainGeneralSettings::tr("Idle time before entering standby "
1970 "mode (minutes)"));
1971
1972 gs->setValue(90);
1973
1974 gs->setHelpText(MainGeneralSettings::tr("Number of minutes to wait when "
1975 "the frontend is idle before "
1976 "entering standby mode. Standby "
1977 "mode allows the backend to power "
1978 "down if configured to do so. Any "
1979 "remote or mouse input will cause "
1980 "the countdown to start again "
1981 "and/or exit idle mode. Video "
1982 "playback suspends the countdown. "
1983 "A value of zero prevents the "
1984 "frontend automatically entering "
1985 "standby."));
1986 return gs;
1987}
1988
1990{
1991 auto * checkbox = new HostCheckBoxSetting("ConfirmPowerEvent");
1992 checkbox->setValue(true);
1993 checkbox->setLabel(MainGeneralSettings::tr("Confirm before suspending/shutting down"));
1994 checkbox->setHelpText(MainGeneralSettings::tr(
1995 "If enabled (the default) then the user will always be asked to confirm before the system "
1996 "is shutdown, suspended or rebooted."));
1997 return checkbox;
1998}
1999
2001{
2002 auto *gc = new HostComboBoxSetting("OverrideExitMenu");
2003
2004 gc->setLabel(MainGeneralSettings::tr("Customize exit menu options"));
2005
2006 gc->addSelection(MainGeneralSettings::tr("Default"), "0");
2007 gc->addSelection(MainGeneralSettings::tr("Show quit"), "1");
2008 gc->addSelection(MainGeneralSettings::tr("Show quit and suspend"), "9");
2009 gc->addSelection(MainGeneralSettings::tr("Show quit and shutdown"), "2");
2010 gc->addSelection(MainGeneralSettings::tr("Show quit, reboot and shutdown"), "3");
2011 gc->addSelection(MainGeneralSettings::tr("Show quit, reboot, shutdown and suspend"), "10");
2012 gc->addSelection(MainGeneralSettings::tr("Show shutdown"), "4");
2013 gc->addSelection(MainGeneralSettings::tr("Show reboot"), "5");
2014 gc->addSelection(MainGeneralSettings::tr("Show reboot and shutdown"), "6");
2015 gc->addSelection(MainGeneralSettings::tr("Show standby"), "7");
2016 gc->addSelection(MainGeneralSettings::tr("Show suspend"), "8");
2017
2018 QString helptext = MainGeneralSettings::tr("By default, only remote frontends are shown "
2019 "the shutdown option on the exit menu. Here "
2020 "you can force specific shutdown, reboot and suspend "
2021 "options to be displayed.");
2022 if (Power)
2023 {
2024 QStringList supported = Power->GetFeatureList();
2025 if (!supported.isEmpty())
2026 {
2027 helptext.prepend(MainGeneralSettings::tr(
2028 "This system supports '%1' without additional setup. ")
2029 .arg(supported.join(", ")));
2030 }
2031 else
2032 {
2033 helptext.append(MainGeneralSettings::tr(
2034 " This system appears to have no power options available. Try "
2035 "setting the Halt/Reboot/Suspend commands below."));
2036 }
2037 }
2038 gc->setHelpText(helptext);
2039
2040 return gc;
2041}
2042
2043#ifndef Q_OS_ANDROID
2045{
2046 auto *ge = new HostTextEditSetting("RebootCommand");
2047 ge->setLabel(MainGeneralSettings::tr("Reboot command"));
2048 ge->setValue("");
2049 QString help = MainGeneralSettings::tr(
2050 "Optional. Script to run if you select the reboot option from the "
2051 "exit menu, if the option is displayed. You must configure an "
2052 "exit key to display the exit menu.");
2053 if (Power && Power->IsFeatureSupported(MythPower::FeatureRestart))
2054 {
2055 help.append(MainGeneralSettings::tr(
2056 " Note: This system appears to support reboot without using this setting."));
2057 }
2058 ge->setHelpText(help);
2059 return ge;
2060}
2061
2063{
2064 auto *suspend = new HostTextEditSetting("SuspendCommand");
2065 suspend->setLabel(MainGeneralSettings::tr("Suspend command"));
2066 suspend->setValue("");
2067 QString help = MainGeneralSettings::tr(
2068 "Optional: Script to run if you select the suspend option from the "
2069 "exit menu, if the option is displayed.");
2070
2071 if (Power && Power->IsFeatureSupported(MythPower::FeatureSuspend))
2072 {
2073 help.append(MainGeneralSettings::tr(
2074 " Note: This system appears to support suspend without using this setting."));
2075 }
2076 suspend->setHelpText(help);
2077 return suspend;
2078}
2079
2081{
2082 auto *ge = new HostTextEditSetting("HaltCommand");
2083 ge->setLabel(MainGeneralSettings::tr("Halt command"));
2084 ge->setValue("");
2085 QString help = MainGeneralSettings::tr("Optional. Script to run if you "
2086 "select the shutdown option from "
2087 "the exit menu, if the option is "
2088 "displayed. You must configure an "
2089 "exit key to display the exit "
2090 "menu.");
2092 {
2093 help.append(MainGeneralSettings::tr(
2094 " Note: This system appears to support shutdown without using this setting."));
2095 }
2096
2097 ge->setHelpText(help);
2098 return ge;
2099}
2100#endif
2101
2103{
2104 auto *ge = new HostTextEditSetting("LircSocket");
2105
2106 ge->setLabel(MainGeneralSettings::tr("LIRC daemon socket"));
2107
2108 /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
2109 QString lirc_socket = "/dev/lircd";
2110
2111 if (!QFile::exists(lirc_socket))
2112 lirc_socket = "/var/run/lirc/lircd";
2113
2114 ge->setValue(lirc_socket);
2115
2116 QString help = MainGeneralSettings::tr("UNIX socket or IP address[:port] "
2117 "to connect in order to communicate "
2118 "with the LIRC Daemon.");
2119 ge->setHelpText(help);
2120
2121 return ge;
2122}
2123
2124#if CONFIG_LIBCEC
2125static HostTextEditSetting *CECDevice()
2126{
2127 auto *ge = new HostTextEditSetting("libCECDevice");
2128
2129 ge->setLabel(MainGeneralSettings::tr("CEC Device"));
2130
2131 ge->setValue("/dev/cec0");
2132
2133 QString help = MainGeneralSettings::tr("CEC Device. Default is /dev/cec0 "
2134 "if you have only 1 HDMI output "
2135 "port.");
2136 ge->setHelpText(help);
2137
2138 return ge;
2139}
2140#endif
2141
2142
2144{
2145 auto *ge = new HostTextEditSetting("ScreenShotPath");
2146
2147 ge->setLabel(MainGeneralSettings::tr("Screen shot path"));
2148
2149 ge->setValue("/tmp/");
2150
2151 ge->setHelpText(MainGeneralSettings::tr("Path to screenshot storage "
2152 "location. Should be writable "
2153 "by the frontend"));
2154
2155 return ge;
2156}
2157
2159{
2160 auto *ge = new HostTextEditSetting("SetupPinCode");
2161
2162 ge->setLabel(MainGeneralSettings::tr("Setup PIN code"));
2163
2164 ge->setHelpText(MainGeneralSettings::tr("This PIN is used to control "
2165 "access to the setup menus. "
2166 "If you want to use this feature, "
2167 "then setting the value to all "
2168 "numbers will make your life much "
2169 "easier. Set it to blank to "
2170 "disable. If enabled, you will not "
2171 "be able to return to this screen "
2172 "and reset the Setup PIN without "
2173 "first entering the current PIN."));
2174 return ge;
2175}
2176
2178{
2179 auto *gc = new HostComboBoxSetting("XineramaScreen", false);
2180 gc->setLabel(AppearanceSettings::tr("Display on screen"));
2181 gc->setValue(0);
2182 gc->setHelpText(AppearanceSettings::tr("Run on the specified screen or "
2183 "spanning all screens."));
2184 return gc;
2185}
2186
2187
2189{
2190 auto *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio");
2191
2192 gc->setLabel(AppearanceSettings::tr("Screen aspect ratio"));
2193 gc->addSelection(AppearanceSettings::tr("Auto (Assume square pixels)"), "-1.0");
2194 gc->addSelection(AppearanceSettings::tr("Auto (Detect from display)"), "0.0");
2195 gc->addSelection("16:9", "1.7777");
2196 gc->addSelection("16:10", "1.6");
2197 gc->addSelection("21:9", "2.3704"); // N.B. Actually 64:27
2198 gc->addSelection("32:9", "3.5555");
2199 gc->addSelection("256:135", "1.8963"); // '4K HD'
2200 gc->addSelection("3:2", "1.5");
2201 gc->addSelection("5:4", "1.25");
2202 gc->addSelection("4:3", "1.3333");
2203 gc->addSelection(AppearanceSettings::tr("16:18 (16:9 Above and below)"), "0.8888");
2204 gc->addSelection(AppearanceSettings::tr("32:10 (16:10 Side by side)"), "3.2");
2205 gc->addSelection(AppearanceSettings::tr("16:20 (16:10 Above and below)"), "0.8");
2206 gc->setHelpText(AppearanceSettings::tr(
2207 "This setting applies to video playback only, not to the GUI. "
2208 "Most modern displays have square pixels and the aspect ratio of the screen can be "
2209 "computed from the resolution (default). "
2210 "The aspect ratio can also be automatically detected from the connected display "
2211 "- though this may be slightly less accurate. If automatic detection fails, the correct "
2212 "aspect ratio can be specified here. Note: Some values (e.g 32:10) are "
2213 "primarily intended for multiscreen setups."));
2214 return gc;
2215}
2216
2218{
2219 auto *gc = new HostComboBoxSetting("LetterboxColour");
2220
2221 gc->setLabel(PlaybackSettings::tr("Letterboxing color"));
2222
2223 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
2224 gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
2225
2226 gc->setHelpText(PlaybackSettings::tr("By default MythTV uses black "
2227 "letterboxing to match broadcaster "
2228 "letterboxing, but those with plasma "
2229 "screens may prefer gray to minimize "
2230 "burn-in."));
2231 return gc;
2232}
2233
2235{
2236 auto * cb = new HostCheckBoxSetting("DiscardStereo3D");
2237 cb->setValue(true);
2238 cb->setLabel(PlaybackSettings::tr("Discard 3D stereoscopic fields"));
2239 cb->setHelpText(PlaybackSettings::tr(
2240 "If 'Side by Side' or 'Top and Bottom' 3D material is detected, "
2241 "enabling this setting will discard one field (enabled by default)."));
2242 return cb;
2243}
2244
2246{
2247 auto *gc = new HostComboBoxSetting("AspectOverride");
2248
2249 gc->setLabel(PlaybackSettings::tr("Video aspect override"));
2250
2251 for (int m = kAspect_Off; m < kAspect_END; ++m)
2252 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
2253
2254 gc->setHelpText(PlaybackSettings::tr("When enabled, these will override "
2255 "the aspect ratio specified by any "
2256 "broadcaster for all video streams."));
2257 return gc;
2258}
2259
2261{
2262 auto *gc = new HostComboBoxSetting("AdjustFill");
2263
2264 gc->setLabel(PlaybackSettings::tr("Zoom"));
2265
2266 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
2267 gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
2269 QString::number(kAdjustFill_AutoDetect_DefaultOff));
2271 QString::number(kAdjustFill_AutoDetect_DefaultHalf));
2272
2273 gc->setHelpText(PlaybackSettings::tr("When enabled, these will apply a "
2274 "predefined zoom to all video "
2275 "playback in MythTV."));
2276 return gc;
2277}
2278
2279// Theme settings
2280
2282{
2283 auto *gs = new HostSpinBoxSetting("GuiWidth", 0, 3840, 8, 1);
2284
2285 gs->setLabel(AppearanceSettings::tr("GUI width (pixels)"));
2286
2287 gs->setValue(0);
2288
2289 gs->setHelpText(AppearanceSettings::tr("The width of the GUI. Do not make "
2290 "the GUI wider than your actual "
2291 "screen resolution. Set to 0 to "
2292 "automatically scale to "
2293 "fullscreen."));
2294 return gs;
2295}
2296
2298{
2299 auto *gs = new HostSpinBoxSetting("GuiHeight", 0, 2160, 8, 1);
2300
2301 gs->setLabel(AppearanceSettings::tr("GUI height (pixels)"));
2302
2303 gs->setValue(0);
2304
2305 gs->setHelpText(AppearanceSettings::tr("The height of the GUI. Do not make "
2306 "the GUI taller than your actual "
2307 "screen resolution. Set to 0 to "
2308 "automatically scale to "
2309 "fullscreen."));
2310 return gs;
2311}
2312
2314{
2315 auto *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, 1);
2316
2317 gs->setLabel(AppearanceSettings::tr("GUI X offset"));
2318
2319 gs->setValue(0);
2320
2321 gs->setHelpText(AppearanceSettings::tr("The horizontal offset where the "
2322 "GUI will be displayed. May only "
2323 "work if run in a window."));
2324 return gs;
2325}
2326
2328{
2329 auto *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, 1);
2330
2331 gs->setLabel(AppearanceSettings::tr("GUI Y offset"));
2332
2333 gs->setValue(0);
2334
2335 gs->setHelpText(AppearanceSettings::tr("The vertical offset where the "
2336 "GUI will be displayed."));
2337 return gs;
2338}
2339
2341{
2342 auto *gc = new HostCheckBoxSetting("GuiSizeForTV");
2343
2344 gc->setLabel(AppearanceSettings::tr("Use GUI size for TV playback"));
2345
2346 gc->setValue(true);
2347
2348 gc->setHelpText(AppearanceSettings::tr("If enabled, use the above size for "
2349 "TV, otherwise use full screen."));
2350 return gc;
2351}
2352
2354{
2355 auto *gc = new HostCheckBoxSetting("ForceFullScreen");
2356
2357 gc->setLabel(AppearanceSettings::tr("Force Full Screen for GUI and TV playback"));
2358
2359 gc->setValue(false);
2360
2361 gc->setHelpText(AppearanceSettings::tr(
2362 "Use Full Screen for GUI and TV playback independent of the settings for "
2363 "the GUI dimensions. This does not change the values of the GUI dimensions "
2364 "so it is easy to switch from window mode to full screen and back."));
2365 return gc;
2366}
2367
2369{
2370 HostCheckBoxSetting *gc = new VideoModeSettings("UseVideoModes");
2371
2372 gc->setLabel(VideoModeSettings::tr("Separate video modes for GUI and "
2373 "TV playback"));
2374
2375 gc->setValue(false);
2376
2377 gc->setHelpText(VideoModeSettings::tr(
2378 "Switch video modes for playback depending on the source "
2379 "resolution and frame rate."));
2380 return gc;
2381}
2382
2384{
2385 auto *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
2386 0, 3840, 16, 1);
2387
2388 gs->setLabel(VideoModeSettings::tr("In X", "Video mode width"));
2389
2390 gs->setValue(0);
2391
2392 gs->setHelpText(VideoModeSettings::tr("Horizontal resolution of video "
2393 "which needs a special output "
2394 "resolution."));
2395 return gs;
2396}
2397
2399{
2400 auto *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
2401 0, 2160, 16, 1);
2402
2403 gs->setLabel(VideoModeSettings::tr("In Y", "Video mode height"));
2404
2405 gs->setValue(0);
2406
2407 gs->setHelpText(VideoModeSettings::tr("Vertical resolution of video "
2408 "which needs a special output "
2409 "resolution."));
2410 return gs;
2411}
2412
2414{
2415 auto *gc = new HostComboBoxSetting("GuiVidModeResolution");
2416
2417 gc->setLabel(VideoModeSettings::tr("GUI"));
2418
2419 gc->setHelpText(VideoModeSettings::tr("Resolution of screen when not "
2420 "watching a video."));
2421
2423 std::vector<MythDisplayMode> scr = display->GetVideoModes();
2424 for (auto & vmode : scr)
2425 {
2426 int w = vmode.Width();
2427 int h = vmode.Height();
2428 QString sel = QString("%1x%2").arg(w).arg(h);
2429 gc->addSelection(sel, sel);
2430 }
2431
2432 // if no resolution setting, set it with a reasonable initial value
2433 if (!scr.empty() && (gCoreContext->GetSetting("GuiVidModeResolution").isEmpty()))
2434 {
2435 int w = 0;
2436 int h = 0;
2437 gCoreContext->GetResolutionSetting("GuiVidMode", w, h);
2438 if ((w <= 0) || (h <= 0))
2439 {
2440 w = 640;
2441 h = 480;
2442 }
2443
2444 MythDisplayMode dscr(w, h, -1, -1, -1.0, 0);
2445 double rate = -1.0;
2446 int i = MythDisplayMode::FindBestMatch(scr, dscr, rate);
2447 gc->setValue((i >= 0) ? i : scr.size() - 1);
2448 }
2449
2450 return gc;
2451}
2452
2454{
2455 QString dhelp = VideoModeSettings::tr("Default screen resolution "
2456 "when watching a video.");
2457 QString ohelp = VideoModeSettings::tr("Screen resolution when watching a "
2458 "video at a specific resolution.");
2459
2460 QString qstr = (idx<0) ? "TVVidModeResolution" :
2461 QString("TVVidModeResolution%1").arg(idx);
2462 auto *gc = new HostComboBoxSetting(qstr);
2463 QString lstr = (idx<0) ? VideoModeSettings::tr("Video output") :
2464 VideoModeSettings::tr("Output");
2465 QString hstr = (idx<0) ? dhelp : ohelp;
2466
2467 gc->setLabel(lstr);
2468
2469 gc->setHelpText(hstr);
2470
2472 std::vector<MythDisplayMode> scr = display->GetVideoModes();
2473 for (auto & vmode : scr)
2474 {
2475 QString sel = QString("%1x%2").arg(vmode.Width()).arg(vmode.Height());
2476 gc->addSelection(sel, sel);
2477 }
2478
2479 return gc;
2480}
2481
2483{
2484 const QString previousValue = getValue();
2485 const bool wasUnchanged = !haveChanged();
2486
2488 QString resolution = setting->getValue();
2489 int hz50 = -1;
2490 int hz60 = -1;
2491 const std::vector<double> list = GetRefreshRates(resolution);
2492 addSelection(QObject::tr("Auto"), "0");
2493 for (size_t i = 0; i < list.size(); ++i)
2494 {
2495 QString sel = QString::number((double) list[i], 'f', 3);
2496 addSelection(sel + " Hz", sel, sel == previousValue);
2497 hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
2498 hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
2499 }
2500
2501 // addSelection() will cause setValue() to be called, marking the setting as
2502 // changed even though the previous value might still be available. Mark it
2503 // as unchanged in this case if it wasn't already changed.
2504 if (wasUnchanged && previousValue == getValue())
2505 setChanged(false);
2506 else
2507 {
2508 if ("640x480" == resolution || "720x480" == resolution)
2509 setValue(hz60+1);
2510 if ("640x576" == resolution || "720x576" == resolution)
2511 setValue(hz50+1);
2512 }
2513
2514 setEnabled(!list.empty());
2515}
2516
2517std::vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res)
2518{
2519 QStringList slist = res.split("x");
2520 int width = 0;
2521 int height = 0;
2522 bool ok0 = false;
2523 bool ok1 = false;
2524 if (2 == slist.size())
2525 {
2526 width = slist[0].toInt(&ok0);
2527 height = slist[1].toInt(&ok1);
2528 }
2529
2530 std::vector<double> result;
2531 if (ok0 && ok1)
2532 {
2533 QSize size(width, height);
2535 result = display->GetRefreshRates(size);
2536 }
2537 return result;
2538}
2539
2541{
2542 QString dhelp = VideoModeSettings::tr("Default refresh rate when watching "
2543 "a video. Leave at \"Auto\" to "
2544 "automatically use the best "
2545 "available");
2546 QString ohelp = VideoModeSettings::tr("Refresh rate when watching a "
2547 "video at a specific resolution. "
2548 "Leave at \"Auto\" to automatically "
2549 "use the best available");
2550
2551 QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
2552 QString("TVVidModeRefreshRate%1").arg(idx);
2553 auto *gc = new HostRefreshRateComboBoxSetting(qstr);
2554 QString lstr = VideoModeSettings::tr("Rate");
2555 QString hstr = (idx<0) ? dhelp : ohelp;
2556
2557 gc->setLabel(lstr);
2558 gc->setHelpText(hstr);
2559 gc->setEnabled(false);
2560 return gc;
2561}
2562
2564{
2565 QString dhelp = VideoModeSettings::tr("Aspect ratio when watching a "
2566 "video. Leave at \"%1\" to "
2567 "use ratio reported by the monitor. "
2568 "Set to 16:9 or 4:3 to force a "
2569 "specific aspect ratio.");
2570
2571
2572
2573 QString ohelp = VideoModeSettings::tr("Aspect ratio when watching a "
2574 "video at a specific resolution. "
2575 "Leave at \"%1\" to use ratio "
2576 "reported by the monitor. Set to "
2577 "16:9 or 4:3 to force a specific "
2578 "aspect ratio.");
2579
2580 QString qstr = (idx<0) ? "TVVidModeForceAspect" :
2581 QString("TVVidModeForceAspect%1").arg(idx);
2582
2583 auto *gc = new HostComboBoxSetting(qstr);
2584
2585 gc->setLabel(VideoModeSettings::tr("Aspect"));
2586
2587 QString hstr = (idx<0) ? dhelp : ohelp;
2588
2589 gc->setHelpText(hstr.arg(VideoModeSettings::tr("Default")));
2590
2591 gc->addSelection(VideoModeSettings::tr("Default"), "0.0");
2592 gc->addSelection("16:9", "1.77777777777");
2593 gc->addSelection("4:3", "1.33333333333");
2594
2595 return gc;
2596}
2597
2599{
2601 item->setDrawArrow(getValue() == "1");
2602}
2603
2605{
2606 auto *pause = new HostSpinBoxSetting("VideoModeChangePauseMS", 0, 5000, 100);
2607 pause->setLabel(VideoModeSettings::tr("Pause while switching video modes (ms)"));
2608 pause->setHelpText(VideoModeSettings::tr(
2609 "For most displays, switching video modes takes time and content can be missed. "
2610 "If non-zero, this setting will pause playback while the video mode is changed. "
2611 "The required pause length (in ms) will be dependant on the display's characteristics."));
2612 pause->setValue(0);
2613 return pause;
2614}
2615
2617{
2621
2623 addChild(res);
2624 addChild(rate);
2626 addChild(pause);
2627 connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2629
2630 auto *overrides = new GroupSetting();
2631
2632 overrides->setLabel(tr("Overrides for specific video sizes"));
2633
2634 for (int idx = 0; idx < 3; ++idx)
2635 {
2636 //input side
2637 overrides->addChild(VidModeWidth(idx));
2638 overrides->addChild(VidModeHeight(idx));
2639 // output side
2640 overrides->addChild(res = TVVidModeResolution(idx));
2641 overrides->addChild(rate = TVVidModeRefreshRate(idx));
2642 overrides->addChild(TVVidModeForceAspect(idx));
2643
2644 connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2646 }
2647
2648 addChild(overrides);
2649};
2650
2652{
2653 auto *gc = new HostCheckBoxSetting("HideMouseCursor");
2654
2655 gc->setLabel(AppearanceSettings::tr("Hide mouse cursor in MythTV"));
2656
2657 gc->setValue(false);
2658
2659 gc->setHelpText(AppearanceSettings::tr("Toggles mouse cursor visibility "
2660 "for touchscreens. By default "
2661 "MythTV will auto-hide the cursor "
2662 "if the mouse doesn't move for a "
2663 "period, this setting disables the "
2664 "cursor entirely."));
2665 return gc;
2666};
2667
2668
2670{
2671 auto *gc = new HostCheckBoxSetting("RunFrontendInWindow");
2672
2673 gc->setLabel(AppearanceSettings::tr("Use window border"));
2674
2675 gc->setValue(false);
2676
2677 gc->setHelpText(AppearanceSettings::tr("Toggles between windowed and "
2678 "borderless operation."));
2679 return gc;
2680}
2681
2683{
2684 auto *gc = new HostCheckBoxSetting("AlwaysOnTop");
2685
2686 gc->setLabel(AppearanceSettings::tr("Always On Top"));
2687
2688 gc->setValue(false);
2689
2690 gc->setHelpText(AppearanceSettings::tr("If enabled, MythTV will always be "
2691 "on top"));
2692 return gc;
2693}
2694
2696{
2697 auto *gc = new HostCheckBoxSetting("SmoothTransitions");
2698
2699 gc->setLabel(AppearanceSettings::tr("Smooth Transitions"));
2700
2701 gc->setValue(true);
2702
2703 gc->setHelpText(AppearanceSettings::tr("Enable smooth transitions with fade-in and fade-out of menu pages and enable GUI animations. "
2704 "Disabling this can make the GUI respond faster especially on low-powered machines."));
2705 return gc;
2706}
2707
2709{
2710 auto *gs = new HostSpinBoxSetting("StartupScreenDelay", -1, 60, 1, 1,
2711 "Never show startup screen");
2712
2713 gs->setLabel(AppearanceSettings::tr("Startup Screen Delay"));
2714
2715 gs->setValue(2);
2716
2717 gs->setHelpText(AppearanceSettings::tr(
2718 "The Startup Screen will show the progress of starting the frontend "
2719 "if frontend startup takes longer than this number of seconds."));
2720 return gs;
2721}
2722
2723
2725{
2726 auto *gs = new HostSpinBoxSetting("GUITEXTZOOM", 50, 150, 1, 1);
2727
2728 gs->setLabel(AppearanceSettings::tr("GUI text zoom percentage"));
2729
2730 gs->setValue(100);
2731
2732 gs->setHelpText(AppearanceSettings::tr
2733 ("Adjust the themed defined font size by this percentage. "
2734 "mythfrontend needs restart for this to take effect."));
2735 return gs;
2736}
2737
2738
2740{
2741 auto *gc = new HostComboBoxSetting("DateFormat");
2742 gc->setLabel(AppearanceSettings::tr("Date format"));
2743
2744 QDate sampdate = MythDate::current().toLocalTime().date();
2745 QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2746 "today's date.");
2747
2748 if (sampdate.month() == sampdate.day())
2749 {
2750 sampdate = sampdate.addDays(1);
2751 sampleStr = AppearanceSettings::tr("Samples are shown using "
2752 "tomorrow's date.");
2753 }
2754
2755 QLocale locale = gCoreContext->GetQLocale();
2756
2757 gc->addSelection(locale.toString(sampdate, "ddd MMM d"), "ddd MMM d");
2758 gc->addSelection(locale.toString(sampdate, "ddd d MMM"), "ddd d MMM");
2759 gc->addSelection(locale.toString(sampdate, "ddd MMMM d"), "ddd MMMM d");
2760 gc->addSelection(locale.toString(sampdate, "ddd d MMMM"), "ddd d MMMM");
2761 gc->addSelection(locale.toString(sampdate, "dddd MMM d"), "dddd MMM d");
2762 gc->addSelection(locale.toString(sampdate, "dddd d MMM"), "dddd d MMM");
2763 gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2764 gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2765 gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2766 gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2767 gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2768 gc->addSelection(locale.toString(sampdate, "dd.MM"), "dd.MM");
2769 gc->addSelection(locale.toString(sampdate, "M/d/yyyy"), "M/d/yyyy");
2770 gc->addSelection(locale.toString(sampdate, "d/M/yyyy"), "d/M/yyyy");
2771 gc->addSelection(locale.toString(sampdate, "MM.dd.yyyy"), "MM.dd.yyyy");
2772 gc->addSelection(locale.toString(sampdate, "dd.MM.yyyy"), "dd.MM.yyyy");
2773 gc->addSelection(locale.toString(sampdate, "yyyy-MM-dd"), "yyyy-MM-dd");
2774 gc->addSelection(locale.toString(sampdate, "ddd MMM d yyyy"), "ddd MMM d yyyy");
2775 gc->addSelection(locale.toString(sampdate, "ddd d MMM yyyy"), "ddd d MMM yyyy");
2776 gc->addSelection(locale.toString(sampdate, "ddd yyyy-MM-dd"), "ddd yyyy-MM-dd");
2777
2778 QString cn_long = QString("dddd yyyy") + QChar(0x5E74) +
2779 "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd yyyy年M月d日
2780 gc->addSelection(locale.toString(sampdate, cn_long), cn_long);
2781 QString cn_med = QString("dddd ") +
2782 "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd M月d日
2783
2784 gc->addSelection(locale.toString(sampdate, cn_med), cn_med);
2785
2786 //: %1 gives additional information regarding the date format
2787 gc->setHelpText(AppearanceSettings::tr("Your preferred date format. %1")
2788 .arg(sampleStr));
2789
2790 return gc;
2791}
2792
2794{
2795 auto *gc = new HostComboBoxSetting("ShortDateFormat");
2796 gc->setLabel(AppearanceSettings::tr("Short date format"));
2797
2798 QDate sampdate = MythDate::current().toLocalTime().date();
2799
2800 QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2801 "today's date.");
2802
2803 if (sampdate.month() == sampdate.day())
2804 {
2805 sampdate = sampdate.addDays(1);
2806 sampleStr = AppearanceSettings::tr("Samples are shown using "
2807 "tomorrow's date.");
2808 }
2809 QLocale locale = gCoreContext->GetQLocale();
2810
2811 gc->addSelection(locale.toString(sampdate, "M/d"), "M/d");
2812 gc->addSelection(locale.toString(sampdate, "d/M"), "d/M");
2813 gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2814 gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
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, "M.d."), "M.d.");
2818 gc->addSelection(locale.toString(sampdate, "d.M."), "d.M.");
2819 gc->addSelection(locale.toString(sampdate, "MM-dd"), "MM-dd");
2820 gc->addSelection(locale.toString(sampdate, "dd-MM"), "dd-MM");
2821 gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2822 gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2823 gc->addSelection(locale.toString(sampdate, "ddd d"), "ddd d");
2824 gc->addSelection(locale.toString(sampdate, "d ddd"), "d ddd");
2825 gc->addSelection(locale.toString(sampdate, "ddd M/d"), "ddd M/d");
2826 gc->addSelection(locale.toString(sampdate, "ddd d/M"), "ddd d/M");
2827 gc->addSelection(locale.toString(sampdate, "ddd d.M"), "ddd d.M");
2828 gc->addSelection(locale.toString(sampdate, "ddd dd.MM"), "ddd dd.MM");
2829 gc->addSelection(locale.toString(sampdate, "M/d ddd"), "M/d ddd");
2830 gc->addSelection(locale.toString(sampdate, "d/M ddd"), "d/M ddd");
2831
2832 QString cn_short1 = QString("M") + QChar(0x6708) + "d" + QChar(0x65E5); // M月d日
2833
2834 gc->addSelection(locale.toString(sampdate, cn_short1), cn_short1);
2835
2836 QString cn_short2 = QString("ddd M") + QChar(0x6708) + "d" + QChar(0x65E5); // ddd M月d日
2837
2838 gc->addSelection(locale.toString(sampdate, cn_short2), cn_short2);
2839
2840 //: %1 gives additional information regarding the date format
2841 gc->setHelpText(AppearanceSettings::tr("Your preferred short date format. %1")
2842 .arg(sampleStr));
2843 return gc;
2844}
2845
2847{
2848 auto *gc = new HostComboBoxSetting("TimeFormat");
2849
2850 gc->setLabel(AppearanceSettings::tr("Time format"));
2851
2852 QTime samptime = QTime::currentTime();
2853
2854 QLocale locale = gCoreContext->GetQLocale();
2855
2856 gc->addSelection(locale.toString(samptime, "h:mm AP"), "h:mm AP");
2857 gc->addSelection(locale.toString(samptime, "h:mm ap"), "h:mm ap");
2858 gc->addSelection(locale.toString(samptime, "hh:mm AP"), "hh:mm AP");
2859 gc->addSelection(locale.toString(samptime, "hh:mm ap"), "hh:mm ap");
2860 gc->addSelection(locale.toString(samptime, "h:mm"), "h:mm");
2861 gc->addSelection(locale.toString(samptime, "hh:mm"), "hh:mm");
2862 gc->addSelection(locale.toString(samptime, "hh.mm"), "hh.mm");
2863 gc->addSelection(locale.toString(samptime, "AP h:mm"), "AP h:mm");
2864
2865 gc->setHelpText(AppearanceSettings::tr("Your preferred time format. You "
2866 "must choose a format with \"AM\" "
2867 "or \"PM\" in it, otherwise your "
2868 "time display will be 24-hour or "
2869 "\"military\" time."));
2870 return gc;
2871}
2872
2874{
2875 auto *rgb = new HostCheckBoxSetting("GUIRGBLevels");
2876 rgb->setLabel(AppearanceSettings::tr("Use full range RGB output"));
2877 rgb->setValue(true);
2878 rgb->setHelpText(AppearanceSettings::tr(
2879 "Enable (recommended) to supply full range RGB output to your display device. "
2880 "Disable to supply limited range RGB output. This setting applies to both the "
2881 "GUI and media playback. Ideally the value of this setting should match a "
2882 "similar setting on your TV or monitor."));
2883 return rgb;
2884}
2885
2887{
2888 auto *gc = new HostComboBoxSetting("ChannelFormat");
2889
2890 gc->setLabel(GeneralSettings::tr("Channel format"));
2891
2892 gc->addSelection(GeneralSettings::tr("number"), "<num>");
2893 gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2894 gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2895 gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2896 gc->addSelection(GeneralSettings::tr("name"), "<name>");
2897
2898 gc->setHelpText(GeneralSettings::tr("Your preferred channel format."));
2899
2900 gc->setValue(1);
2901
2902 return gc;
2903}
2904
2906{
2907 auto *gc = new HostComboBoxSetting("LongChannelFormat");
2908
2909 gc->setLabel(GeneralSettings::tr("Long channel format"));
2910
2911 gc->addSelection(GeneralSettings::tr("number"), "<num>");
2912 gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2913 gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2914 gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2915 gc->addSelection(GeneralSettings::tr("name"), "<name>");
2916
2917 gc->setHelpText(GeneralSettings::tr("Your preferred long channel format."));
2918
2919 gc->setValue(2);
2920
2921 return gc;
2922}
2923
2925{
2926 auto *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
2927
2928 gc->setLabel(ChannelGroupSettings::tr("Remember last channel group"));
2929
2930 gc->setHelpText(ChannelGroupSettings::tr("If enabled, the EPG will "
2931 "initially display only the "
2932 "channels from the last channel "
2933 "group selected. Pressing \"4\" "
2934 "will toggle channel group."));
2935
2936 gc->setValue(false);
2937
2938 return gc;
2939}
2940
2942{
2943 auto *gc = new HostComboBoxSetting("ChannelGroupDefault");
2944
2945 gc->setLabel(ChannelGroupSettings::tr("Default channel group"));
2946
2947 ChannelGroupList changrplist;
2948
2949 changrplist = ChannelGroup::GetChannelGroups();
2950
2951 gc->addSelection(ChannelGroupSettings::tr("All Channels"), "-1");
2952
2953 ChannelGroupList::iterator it;
2954
2955 for (it = changrplist.begin(); it < changrplist.end(); ++it)
2956 gc->addSelection(it->m_name, QString("%1").arg(it->m_grpId));
2957
2958 gc->setHelpText(ChannelGroupSettings::tr("Default channel group to be "
2959 "shown in the EPG. Pressing "
2960 "GUIDE key will toggle channel "
2961 "group."));
2962 gc->setValue(0);
2963
2964 return gc;
2965}
2966
2968{
2969 auto *gc = new HostCheckBoxSetting("BrowseChannelGroup");
2970
2971 gc->setLabel(GeneralSettings::tr("Browse/change channels from Channel "
2972 "Group"));
2973
2974 gc->setHelpText(GeneralSettings::tr("If enabled, Live TV will browse or "
2975 "change channels from the selected "
2976 "channel group. The \"All Channels\" "
2977 "channel group may be selected to "
2978 "browse all channels."));
2979 gc->setValue(false);
2980
2981 return gc;
2982}
2983
2984#if 0
2985static GlobalCheckBoxSetting *SortCaseSensitive()
2986{
2987 auto *gc = new GlobalCheckBoxSetting("SortCaseSensitive");
2988 gc->setLabel(GeneralSettings::tr("Case-sensitive sorting"));
2989 gc->setValue(false);
2990 gc->setHelpText(GeneralSettings::tr("If enabled, all sorting will be "
2991 "case-sensitive. This would mean "
2992 "that \"bee movie\" would sort after "
2993 "\"Sea World\" as lower case letters "
2994 "sort after uppercase letters."));
2995 return gc;
2996}
2997#endif
2998
3000{
3001 auto *gc = new GlobalCheckBoxSetting("SortStripPrefixes");
3002
3003 gc->setLabel(GeneralSettings::tr("Remove prefixes when sorting"));
3004 gc->setValue(true);
3005 gc->setHelpText(GeneralSettings::tr(
3006 "If enabled, all sorting will remove the common "
3007 "prefixes (The, A, An) from a string prior to "
3008 "sorting. For example, this would sort the titles "
3009 "\"Earth 2\", \"The Flash\", and \"Kings\" in that "
3010 "order. If disabled, they would sort as \"Earth 2\", "
3011 "\"Kings\", \"The Flash\"."));
3012 return gc;
3013}
3014
3016{
3017 auto *gc = new GlobalTextEditSetting("SortPrefixExceptions");
3018
3019 gc->setLabel(MainGeneralSettings::tr("Names exempt from prefix removal"));
3020 gc->setValue("");
3021 gc->setHelpText(MainGeneralSettings::tr(
3022 "This list of names will be exempt from removing "
3023 "the common prefixes (The, A, An) from a title or "
3024 "filename. Enter multiple names separated by "
3025 "semicolons."));
3026 return gc;
3027}
3028
3030{
3031 auto *gc = new GlobalComboBoxSetting("ManualRecordStartChanType");
3032
3033 gc->setLabel(GeneralSettings::tr("Starting channel for Manual Record"));
3034 gc->addSelection(GeneralSettings::tr("Guide Starting Channel"), "1", true);
3035 gc->addSelection(GeneralSettings::tr("Last Manual Record Channel"), "2");
3036 gc->setHelpText(GeneralSettings::tr(
3037 "When entering a new Manual Record Rule, "
3038 "the starting channel will default to this."));
3039 return gc;
3040}
3041
3042// General RecPriorities settings
3043
3045{
3046 auto *bc = new GlobalComboBoxSetting("SchedOpenEnd");
3047
3048 bc->setLabel(GeneralRecPrioritiesSettings::tr("Avoid back to back "
3049 "recordings"));
3050
3051 bc->setHelpText(
3052 GeneralRecPrioritiesSettings::tr("Selects the situations where the "
3053 "scheduler will avoid assigning shows "
3054 "to the same card if their end time "
3055 "and start time match. This will be "
3056 "allowed when necessary in order to "
3057 "resolve conflicts."));
3058
3059 bc->addSelection(GeneralRecPrioritiesSettings::tr("Never"), "0");
3060 bc->addSelection(GeneralRecPrioritiesSettings::tr("Different Channels"),
3061 "1");
3062 bc->addSelection(GeneralRecPrioritiesSettings::tr("Always"), "2");
3063
3064 bc->setValue(0);
3065
3066 return bc;
3067}
3068
3070{
3071 auto *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
3072
3073 bs->setLabel(GeneralRecPrioritiesSettings::tr("Preferred input priority"));
3074
3075 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3076 "a showing matches the "
3077 "preferred input selected "
3078 "in the 'Scheduling "
3079 "Options' section of the "
3080 "recording rule."));
3081
3082 bs->setValue(2);
3083 return bs;
3084}
3085
3087{
3088 auto *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
3089
3090 bs->setLabel(GeneralRecPrioritiesSettings::tr("HDTV recording priority"));
3091
3092 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3093 "a showing is marked as an "
3094 "HDTV broadcast in the TV "
3095 "listings."));
3096
3097 bs->setValue(0);
3098
3099 return bs;
3100}
3101
3103{
3104 auto *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
3105
3106 bs->setLabel(GeneralRecPrioritiesSettings::tr("Widescreen recording "
3107 "priority"));
3108
3109 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3110 "a showing is marked as "
3111 "widescreen in the TV "
3112 "listings."));
3113
3114 bs->setValue(0);
3115
3116 return bs;
3117}
3118
3120{
3121 auto *bs = new GlobalSpinBoxSetting("SignLangRecPriority", -99, 99, 1);
3122
3123 bs->setLabel(GeneralRecPrioritiesSettings::tr("Sign language recording "
3124 "priority"));
3125
3126 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3127 "when a showing is "
3128 "marked as having "
3129 "in-vision sign "
3130 "language."));
3131
3132 bs->setValue(0);
3133
3134 return bs;
3135}
3136
3138{
3139 auto *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority", -99, 99, 1);
3140
3141 bs->setLabel(GeneralRecPrioritiesSettings::tr("In-vision Subtitles "
3142 "Recording Priority"));
3143
3144 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3145 "when a showing is marked "
3146 "as having in-vision "
3147 "subtitles."));
3148
3149 bs->setValue(0);
3150
3151 return bs;
3152}
3153
3155{
3156 auto *bs = new GlobalSpinBoxSetting("CCRecPriority", -99, 99, 1);
3157
3158 bs->setLabel(GeneralRecPrioritiesSettings::tr("Subtitles/CC recording "
3159 "priority"));
3160
3161 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3162 "a showing is marked as "
3163 "having subtitles or "
3164 "closed captioning (CC) "
3165 "available."));
3166
3167 bs->setValue(0);
3168
3169 return bs;
3170}
3171
3173{
3174 auto *bs = new GlobalSpinBoxSetting("HardHearRecPriority", -99, 99, 1);
3175
3176 bs->setLabel(GeneralRecPrioritiesSettings::tr("Hard of hearing priority"));
3177
3178 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3179 "a showing is marked as "
3180 "having support for "
3181 "viewers with impaired "
3182 "hearing."));
3183
3184 bs->setValue(0);
3185
3186 return bs;
3187}
3188
3190{
3191 auto *bs = new GlobalSpinBoxSetting("AudioDescRecPriority", -99, 99, 1);
3192
3193 bs->setLabel(GeneralRecPrioritiesSettings::tr("Audio described priority"));
3194
3195 bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3196 "a showing is marked as "
3197 "being Audio Described."));
3198
3199 bs->setValue(0);
3200
3201 return bs;
3202}
3203
3205{
3206 auto *ge = new HostTextEditSetting("DefaultTVChannel");
3207
3208 ge->setLabel(EPGSettings::tr("Guide starts at channel"));
3209
3210 ge->setValue("3");
3211
3212 ge->setHelpText(EPGSettings::tr("The program guide starts on this channel "
3213 "if it is run from outside of Live TV "
3214 "mode. Leave blank to enable Live TV "
3215 "automatic start channel."));
3216
3217 return ge;
3218}
3219
3221{
3222 auto *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
3223
3224 gs->setLabel(EPGSettings::tr("Record threshold"));
3225
3226 gs->setValue(16);
3227
3228 gs->setHelpText(EPGSettings::tr("Pressing SELECT on a show that is at "
3229 "least this many minutes into the future "
3230 "will schedule a recording."));
3231 return gs;
3232}
3233
3235{
3236 auto *gc = new GlobalComboBoxSetting("Language");
3237
3238 gc->setLabel(AppearanceSettings::tr("Menu Language"));
3239
3240 QMap<QString, QString> langMap = MythTranslation::getLanguages();
3241 QStringList langs = langMap.values();
3242 langs.sort();
3243 QString langCode = gCoreContext->GetSetting("Language").toLower();
3244
3245 if (langCode.isEmpty())
3246 langCode = "en_US";
3247
3248 gc->clearSelections();
3249
3250 for (const auto & label : std::as_const(langs))
3251 {
3252 QString value = langMap.key(label);
3253 gc->addSelection(label, value, (value.toLower() == langCode));
3254 }
3255
3256 gc->setHelpText(AppearanceSettings::tr("Your preferred language for the "
3257 "user interface."));
3258 return gc;
3259}
3260
3262{
3263 auto *gc = new GlobalComboBoxSetting("AudioLanguage");
3264
3265 gc->setLabel(AppearanceSettings::tr("Audio Language"));
3266
3267 QMap<QString, QString> langMap = MythTranslation::getLanguages();
3268 QStringList langs = langMap.values();
3269 langs.sort();
3270 QString langCode = gCoreContext->GetSetting("AudioLanguage").toLower();
3271
3272 if (langCode.isEmpty())
3273 {
3274 auto menuLangCode = gCoreContext->GetSetting("Language").toLower();
3275 langCode = menuLangCode.isEmpty() ? "en_US" : menuLangCode;
3276 }
3277
3278 gc->clearSelections();
3279
3280 for (const auto & label : std::as_const(langs))
3281 {
3282 QString value = langMap.key(label);
3283 gc->addSelection(label, value, (value.toLower() == langCode));
3284 }
3285
3286 gc->setHelpText(AppearanceSettings::tr("Preferred language for the "
3287 "audio track."));
3288 return gc;
3289}
3290
3292{
3293 widget->clearSelections();
3294 QString q = QString("ISO639Language%1").arg(i);
3295 QString lang = gCoreContext->GetSetting(q, "").toLower();
3296
3297 if ((lang.isEmpty() || lang == "aar") &&
3298 !gCoreContext->GetSetting("Language", "").isEmpty())
3299 {
3300 lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
3301 }
3302
3303 QMap<int,QString>::iterator it = iso639_key_to_english_name.begin();
3304 QMap<int,QString>::iterator ite = iso639_key_to_english_name.end();
3305
3306 for (; it != ite; ++it)
3307 {
3308 QString desc = (*it);
3309 int idx = desc.indexOf(";");
3310 if (idx > 0)
3311 desc = desc.left(idx);
3312
3313 const QString il = iso639_key_to_str3(it.key());
3314 widget->addSelection(desc, il, il == lang);
3315 }
3316}
3317
3319{
3320 auto *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
3321
3322 gc->setLabel(AppearanceSettings::tr("Guide language #%1").arg(i+1));
3323
3324 // We should try to get language from "MythLanguage"
3325 // then use code 2 to code 3 map in iso639.h
3327
3328 gc->setHelpText(AppearanceSettings::tr("Your #%1 preferred language for "
3329 "Program Guide data and captions.")
3330 .arg(i+1));
3331 return gc;
3332}
3333
3335{
3336 auto *gc = new HostCheckBoxSetting("NetworkControlEnabled");
3337
3338 gc->setLabel(MainGeneralSettings::tr("Enable Network Remote Control "
3339 "interface"));
3340
3341 gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3342 "controlling MythFrontend "
3343 "over the network."));
3344
3345 gc->setValue(false);
3346
3347 return gc;
3348}
3349
3351{
3352 auto *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
3353
3354 gs->setLabel(MainGeneralSettings::tr("Network Remote Control port"));
3355
3356 gs->setValue(6546);
3357
3358 gs->setHelpText(MainGeneralSettings::tr("This specifies what port the "
3359 "Network Remote Control "
3360 "interface will listen on for "
3361 "new connections."));
3362 return gs;
3363}
3364
3366{
3367 auto *ge = new HostTextEditSetting("UDPNotifyPort");
3368
3369 ge->setLabel(MainGeneralSettings::tr("UDP notify port"));
3370
3371 ge->setValue("6948");
3372
3373 ge->setHelpText(MainGeneralSettings::tr("MythTV will listen for "
3374 "connections from the "
3375 "\"mythutil\" program on "
3376 "this port."));
3377 return ge;
3378}
3379
3380#if CONFIG_LIBCEC
3381static HostCheckBoxSetting *CECEnabled()
3382{
3383 auto *gc = new HostCheckBoxSetting("libCECEnabled");
3384 gc->setLabel(MainGeneralSettings::tr("Enable CEC Control "
3385 "interface"));
3386 gc->setHelpText(MainGeneralSettings::tr("This enables "
3387 "controlling MythFrontend from a TV remote or powering the TV "
3388 "on and off from a MythTV remote "
3389 "if you have compatible hardware. "
3390 "These settings only take effect after a restart."));
3391 gc->setValue(true);
3392 return gc;
3393}
3394
3395static HostCheckBoxSetting *CECPowerOnTVAllowed()
3396{
3397 auto *gc = new HostCheckBoxSetting("PowerOnTVAllowed");
3398 gc->setLabel(MainGeneralSettings::tr("Allow Power On TV"));
3399 gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3400 "on from MythTV remote or when MythTV starts "
3401 "if you have compatible hardware."));
3402 gc->setValue(true);
3403 return gc;
3404}
3405
3406static HostCheckBoxSetting *CECPowerOffTVAllowed()
3407{
3408 auto *gc = new HostCheckBoxSetting("PowerOffTVAllowed");
3409 gc->setLabel(MainGeneralSettings::tr("Allow Power Off TV"));
3410 gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3411 "off from MythTV remote or when MythTV starts "
3412 "if you have compatible hardware."));
3413 gc->setValue(true);
3414 return gc;
3415}
3416
3417static HostCheckBoxSetting *CECPowerOnTVOnStart()
3418{
3419 auto *gc = new HostCheckBoxSetting("PowerOnTVOnStart");
3420 gc->setLabel(MainGeneralSettings::tr("Power on TV At Start"));
3421 gc->setHelpText(MainGeneralSettings::tr("Powers "
3422 "on your TV when you start MythTV "
3423 "if you have compatible hardware."));
3424 gc->setValue(true);
3425 return gc;
3426}
3427
3428static HostCheckBoxSetting *CECPowerOffTVOnExit()
3429{
3430 auto *gc = new HostCheckBoxSetting("PowerOffTVOnExit");
3431 gc->setLabel(MainGeneralSettings::tr("Power off TV At Exit"));
3432 gc->setHelpText(MainGeneralSettings::tr("Powers "
3433 "off your TV when you exit MythTV "
3434 "if you have compatible hardware."));
3435 gc->setValue(true);
3436 return gc;
3437}
3438
3439#endif // CONFIG_LIBCEC
3440
3441#if CONFIG_AIRPLAY
3442// AirPlay Settings
3443static HostCheckBoxSetting *AirPlayEnabled()
3444{
3445 auto *gc = new HostCheckBoxSetting("AirPlayEnabled");
3446
3447 gc->setLabel(MainGeneralSettings::tr("Enable AirPlay"));
3448
3449 gc->setHelpText(MainGeneralSettings::tr("AirPlay lets you wirelessly view "
3450 "content on your TV from your "
3451 "iPhone, iPad, iPod Touch, or "
3452 "iTunes on your computer."));
3453
3454 gc->setValue(true);
3455
3456 return gc;
3457}
3458
3459static HostCheckBoxSetting *AirPlayAudioOnly()
3460{
3461 auto *gc = new HostCheckBoxSetting("AirPlayAudioOnly");
3462
3463 gc->setLabel(MainGeneralSettings::tr("Only support AirTunes (no video)"));
3464
3465 gc->setHelpText(MainGeneralSettings::tr("Only stream audio from your "
3466 "iPhone, iPad, iPod Touch, or "
3467 "iTunes on your computer"));
3468
3469 gc->setValue(false);
3470
3471 return gc;
3472}
3473
3474static HostCheckBoxSetting *AirPlayPasswordEnabled()
3475{
3476 auto *gc = new HostCheckBoxSetting("AirPlayPasswordEnabled");
3477
3478 gc->setLabel(MainGeneralSettings::tr("Require password"));
3479
3480 gc->setValue(false);
3481
3482 gc->setHelpText(MainGeneralSettings::tr("Require a password to use "
3483 "AirPlay. Your iPhone, iPad, iPod "
3484 "Touch, or iTunes on your computer "
3485 "will prompt you when required"));
3486 return gc;
3487}
3488
3489static HostTextEditSetting *AirPlayPassword()
3490{
3491 auto *ge = new HostTextEditSetting("AirPlayPassword");
3492
3493 ge->setLabel(MainGeneralSettings::tr("Password"));
3494
3495 ge->setValue("0000");
3496
3497 ge->setHelpText(MainGeneralSettings::tr("Your iPhone, iPad, iPod Touch, or "
3498 "iTunes on your computer will "
3499 "prompt you for this password "
3500 "when required"));
3501 return ge;
3502}
3503
3504static GroupSetting *AirPlayPasswordSettings()
3505{
3506 auto *hc = new GroupSetting();
3507
3508 hc->setLabel(MainGeneralSettings::tr("AirPlay - Password"));
3509 hc->addChild(AirPlayPasswordEnabled());
3510 hc->addChild(AirPlayPassword());
3511
3512 return hc;
3513}
3514
3515static HostCheckBoxSetting *AirPlayFullScreen()
3516{
3517 auto *gc = new HostCheckBoxSetting("AirPlayFullScreen");
3518
3519 gc->setLabel(MainGeneralSettings::tr("AirPlay full screen playback"));
3520
3521 gc->setValue(false);
3522
3523 gc->setHelpText(MainGeneralSettings::tr("During music playback, displays "
3524 "album cover and various media "
3525 "information in full screen mode"));
3526 return gc;
3527}
3528
3529//static TransLabelSetting *AirPlayInfo()
3530//{
3531// TransLabelSetting *ts = new TransLabelSetting();
3532//
3533// ts->setValue(MainGeneralSettings::tr("All AirPlay settings take effect "
3534// "when you restart MythFrontend."));
3535// return ts;
3536//}
3537
3538//static TransLabelSetting *AirPlayRSAInfo()
3539//{
3540// TransLabelSetting *ts = new TransLabelSetting();
3541//
3542// if (MythRAOPConnection::LoadKey() == nullptr)
3543// {
3544// ts->setValue(MainGeneralSettings::tr("AirTunes RSA key couldn't be "
3545// "loaded. Check http://www.mythtv.org/wiki/AirTunes/AirPlay. "
3546// "Last Error: %1")
3547// .arg(MythRAOPConnection::RSALastError()));
3548// }
3549// else
3550// {
3551// ts->setValue(MainGeneralSettings::tr("AirTunes RSA key successfully "
3552// "loaded."));
3553// }
3554//
3555// return ts;
3556//}
3557#endif
3558
3560{
3561 auto *gc = new HostCheckBoxSetting("RealtimePriority");
3562
3563 gc->setLabel(PlaybackSettings::tr("Enable realtime priority threads"));
3564
3565 gc->setHelpText(PlaybackSettings::tr("When running mythfrontend with root "
3566 "privileges, some threads can be "
3567 "given enhanced priority. Disable "
3568 "this if MythFrontend freezes during "
3569 "video playback."));
3570 gc->setValue(true);
3571
3572 return gc;
3573}
3574
3576{
3577 auto *ge = new HostTextEditSetting("IgnoreDevices");
3578
3579 ge->setLabel(MainGeneralSettings::tr("Ignore devices"));
3580
3581 ge->setValue("");
3582
3583 ge->setHelpText(MainGeneralSettings::tr("If there are any devices that you "
3584 "do not want to be monitored, list "
3585 "them here with commas in-between. "
3586 "The plugins will ignore them. "
3587 "Requires restart."));
3588 return ge;
3589}
3590
3592{
3593 auto *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
3594
3595 gc->setLabel(PlaybackSettings::tr("Sort titles"));
3596
3597 gc->addSelection(PlaybackSettings::tr("Alphabetically"),
3598 QString::number(PlaybackBox::TitleSortAlphabetical));
3599 gc->addSelection(PlaybackSettings::tr("By recording priority"),
3600 QString::number(PlaybackBox::TitleSortRecPriority));
3601
3602 gc->setHelpText(PlaybackSettings::tr("Sets the title sorting order when "
3603 "the view is set to Titles only."));
3604 return gc;
3605}
3606
3608{
3609 auto *gc = new HostCheckBoxSetting("PlaybackWatchList");
3610
3611 gc->setLabel(WatchListSettings::tr("Include the 'Watch List' group"));
3612
3613 gc->setValue(true);
3614
3615 gc->setHelpText(WatchListSettings::tr("The 'Watch List' is an abbreviated "
3616 "list of recordings sorted to "
3617 "highlight series and shows that "
3618 "need attention in order to keep up "
3619 "to date."));
3620 return gc;
3621}
3622
3624{
3625 auto *gc = new HostCheckBoxSetting("PlaybackWLStart");
3626
3627 gc->setLabel(WatchListSettings::tr("Start from the Watch List view"));
3628
3629 gc->setValue(false);
3630
3631 gc->setHelpText(WatchListSettings::tr("If enabled, the 'Watch List' will "
3632 "be the initial view each time you "
3633 "enter the Watch Recordings screen"));
3634 return gc;
3635}
3636
3638{
3639 auto *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
3640
3641 gc->setLabel(WatchListSettings::tr("Exclude recordings not set for "
3642 "Auto-Expire"));
3643
3644 gc->setValue(false);
3645
3646 gc->setHelpText(WatchListSettings::tr("Set this if you turn off "
3647 "Auto-Expire only for recordings "
3648 "that you've seen and intend to "
3649 "keep. This option will exclude "
3650 "these recordings from the "
3651 "'Watch List'."));
3652 return gc;
3653}
3654
3656{
3657 auto *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
3658
3659 gs->setLabel(WatchListSettings::tr("Maximum days counted in the score"));
3660
3661 gs->setValue(60);
3662
3663 gs->setHelpText(WatchListSettings::tr("The 'Watch List' scores are based "
3664 "on 1 point equals one day since "
3665 "recording. This option limits the "
3666 "maximum score due to age and "
3667 "affects other weighting factors."));
3668 return gs;
3669}
3670
3672{
3673 auto *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
3674
3675 gs->setLabel(WatchListSettings::tr("Days to exclude weekly episodes after "
3676 "delete"));
3677
3678 gs->setValue(2);
3679
3680 gs->setHelpText(WatchListSettings::tr("When an episode is deleted or "
3681 "marked as watched, other episodes "
3682 "of the series are excluded from the "
3683 "'Watch List' for this interval of "
3684 "time. Daily shows also have a "
3685 "smaller interval based on this "
3686 "setting."));
3687 return gs;
3688}
3689
3691{
3692 auto *gc = new HostCheckBoxSetting("MonitorDrives");
3693
3694 gc->setLabel(MainGeneralSettings::tr("Media Monitor"));
3695
3696 gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3697 "monitoring your CD/DVD drives for "
3698 "new disks and launching the "
3699 "proper plugin to handle them. "
3700 "Requires restart."));
3701
3702 gc->setValue(false);
3703
3704 gc->addTargetedChild("1", IgnoreMedia());
3705
3706 return gc;
3707}
3708
3710{
3711 auto *gc = new HostCheckBoxSetting("LCDShowTime");
3712
3713 gc->setLabel(LcdSettings::tr("Display time"));
3714
3715 gc->setHelpText(LcdSettings::tr("Display current time on idle LCD "
3716 "display."));
3717
3718 gc->setValue(true);
3719
3720 return gc;
3721}
3722
3724{
3725 auto *gc = new HostCheckBoxSetting("LCDShowRecStatus");
3726
3727 gc->setLabel(LcdSettings::tr("Display recording status"));
3728
3729 gc->setHelpText(LcdSettings::tr("Display current recordings information "
3730 "on LCD display."));
3731
3732 gc->setValue(false);
3733
3734 return gc;
3735}
3736
3738{
3739 auto *gc = new HostCheckBoxSetting("LCDShowMenu");
3740
3741 gc->setLabel(LcdSettings::tr("Display menus"));
3742
3743 gc->setHelpText(LcdSettings::tr("Display selected menu on LCD display. "));
3744
3745 gc->setValue(true);
3746
3747 return gc;
3748}
3749
3751{
3752 auto *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, 1);
3753
3754 gs->setLabel(LcdSettings::tr("Menu pop-up time"));
3755
3756 gs->setHelpText(LcdSettings::tr("How many seconds the menu will remain "
3757 "visible after navigation."));
3758
3759 gs->setValue(5);
3760
3761 return gs;
3762}
3763
3765{
3766 auto *gc = new HostCheckBoxSetting("LCDShowMusic");
3767
3768 gc->setLabel(LcdSettings::tr("Display music artist and title"));
3769
3770 gc->setHelpText(LcdSettings::tr("Display playing artist and song title in "
3771 "MythMusic on LCD display."));
3772
3773 gc->setValue(true);
3774
3775 return gc;
3776}
3777
3779{
3780 auto *gc = new HostComboBoxSetting("LCDShowMusicItems");
3781
3782 gc->setLabel(LcdSettings::tr("Items"));
3783
3784 gc->addSelection(LcdSettings::tr("Artist - Title"), "ArtistTitle");
3785 gc->addSelection(LcdSettings::tr("Artist [Album] Title"),
3786 "ArtistAlbumTitle");
3787
3788 gc->setHelpText(LcdSettings::tr("Which items to show when playing music."));
3789
3790 return gc;
3791}
3792
3794{
3795 auto *gc = new HostCheckBoxSetting("LCDShowChannel");
3796
3797 gc->setLabel(LcdSettings::tr("Display channel information"));
3798
3799 gc->setHelpText(LcdSettings::tr("Display tuned channel information on LCD "
3800 "display."));
3801
3802 gc->setValue(true);
3803
3804 return gc;
3805}
3806
3808{
3809 auto *gc = new HostCheckBoxSetting("LCDShowVolume");
3810
3811 gc->setLabel(LcdSettings::tr("Display volume information"));
3812
3813 gc->setHelpText(LcdSettings::tr("Display volume level information "
3814 "on LCD display."));
3815
3816 gc->setValue(true);
3817
3818 return gc;
3819}
3820
3822{
3823 auto *gc = new HostCheckBoxSetting("LCDShowGeneric");
3824
3825 gc->setLabel(LcdSettings::tr("Display generic information"));
3826
3827 gc->setHelpText(LcdSettings::tr("Display generic information on LCD display."));
3828
3829 gc->setValue(true);
3830
3831 return gc;
3832}
3833
3835{
3836 auto *gc = new HostCheckBoxSetting("LCDBacklightOn");
3837
3838 gc->setLabel(LcdSettings::tr("Backlight always on"));
3839
3840 gc->setHelpText(LcdSettings::tr("Turn on the backlight permanently on the "
3841 "LCD display."));
3842 gc->setValue(true);
3843
3844 return gc;
3845}
3846
3848{
3849 auto *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
3850
3851 gc->setLabel(LcdSettings::tr("Heartbeat always on"));
3852
3853 gc->setHelpText(LcdSettings::tr("Turn on the LCD heartbeat."));
3854
3855 gc->setValue(false);
3856
3857 return gc;
3858}
3859
3861{
3862 auto *gc = new HostCheckBoxSetting("LCDBigClock");
3863
3864 gc->setLabel(LcdSettings::tr("Display large clock"));
3865
3866 gc->setHelpText(LcdSettings::tr("On multiline displays try and display the "
3867 "time as large as possible."));
3868
3869 gc->setValue(false);
3870
3871 return gc;
3872}
3873
3875{
3876 auto *ge = new HostTextEditSetting("LCDKeyString");
3877
3878 ge->setLabel(LcdSettings::tr("LCD key order"));
3879
3880 ge->setValue("ABCDEF");
3881
3882 ge->setHelpText(
3883 LcdSettings::tr("Enter the 6 Keypad Return Codes for your LCD keypad "
3884 "in the order in which you want the functions "
3885 "up/down/left/right/yes/no to operate. (See "
3886 "lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
3887 "or the matrix for your display)"));
3888 return ge;
3889}
3890
3892{
3893 auto *gc = new HostCheckBoxSetting("LCDEnable");
3894
3895 gc->setLabel(LcdSettings::tr("Enable LCD device"));
3896
3897 gc->setHelpText(LcdSettings::tr("Use an LCD display to view MythTV status "
3898 "information."));
3899
3900 gc->setValue(false);
3901 gc->addTargetedChild("1", LCDShowTime());
3902 gc->addTargetedChild("1", LCDShowMenu());
3903 gc->addTargetedChild("1", LCDShowMusic());
3905 gc->addTargetedChild("1", LCDShowChannel());
3907 gc->addTargetedChild("1", LCDShowVolume());
3908 gc->addTargetedChild("1", LCDShowGeneric());
3909 gc->addTargetedChild("1", LCDBacklightOn());
3910 gc->addTargetedChild("1", LCDHeartBeatOn());
3911 gc->addTargetedChild("1", LCDBigClock());
3912 gc->addTargetedChild("1", LCDKeyString());
3913 gc->addTargetedChild("1", LCDPopupTime());
3914 return gc;
3915}
3916
3917
3918#ifdef Q_OS_DARWIN
3919static HostCheckBoxSetting *MacGammaCorrect()
3920{
3921 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
3922
3923 gc->setLabel(PlaybackSettings::tr("Enable gamma correction for video"));
3924
3925 gc->setValue(false);
3926
3927 gc->setHelpText(PlaybackSettings::tr("If enabled, QuickTime will correct "
3928 "the gamma of the video to match "
3929 "your monitor. Turning this off can "
3930 "save some CPU cycles."));
3931 return gc;
3932}
3933
3934static HostCheckBoxSetting *MacScaleUp()
3935{
3936 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
3937
3938 gc->setLabel(PlaybackSettings::tr("Scale video as necessary"));
3939
3940 gc->setValue(true);
3941
3942 gc->setHelpText(PlaybackSettings::tr("If enabled, video will be scaled to "
3943 "fit your window or screen. If "
3944 "unchecked, video will never be made "
3945 "larger than its actual pixel size."));
3946 return gc;
3947}
3948
3949static HostSpinBoxSetting *MacFullSkip()
3950{
3951 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
3952
3953 gs->setLabel(PlaybackSettings::tr("Frames to skip in fullscreen mode"));
3954
3955 gs->setValue(0);
3956
3957 gs->setHelpText(PlaybackSettings::tr("Video displayed in fullscreen or "
3958 "non-windowed mode will skip this "
3959 "many frames for each frame drawn. "
3960 "Set to 0 to show every frame. Only "
3961 "valid when either \"Use GUI size for "
3962 "TV playback\" or \"Run the frontend "
3963 "in a window\" is not checked."));
3964 return gs;
3965}
3966
3967static HostCheckBoxSetting *MacMainEnabled()
3968{
3969 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
3970
3971 gc->setLabel(MacMainSettings::tr("Video in main window"));
3972
3973 gc->setValue(true);
3974
3975 gc->setHelpText(MacMainSettings::tr("If enabled, video will be displayed "
3976 "in the main GUI window. Disable this "
3977 "when you only want video on the "
3978 "desktop or in a floating window. Only "
3979 "valid when \"Use GUI size for TV "
3980 "playback\" and \"Run the frontend in "
3981 "a window\" are checked."));
3982 return gc;
3983}
3984
3985static HostSpinBoxSetting *MacMainSkip()
3986{
3987 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
3988
3989 gs->setLabel(MacMainSettings::tr("Frames to skip"));
3990
3991 gs->setValue(0);
3992
3993 gs->setHelpText(MacMainSettings::tr("Video in the main window will skip "
3994 "this many frames for each frame "
3995 "drawn. Set to 0 to show every "
3996 "frame."));
3997 return gs;
3998}
3999
4000static HostSpinBoxSetting *MacMainOpacity()
4001{
4002 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
4003
4004 gs->setLabel(MacMainSettings::tr("Opacity"));
4005
4006 gs->setValue(100);
4007
4008 gs->setHelpText(MacMainSettings::tr("The opacity of the main window. Set "
4009 "to 100 for completely opaque, set "
4010 "to 0 for completely transparent."));
4011 return gs;
4012}
4013
4014static HostCheckBoxSetting *MacFloatEnabled()
4015{
4016 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
4017
4018 gc->setLabel(MacFloatSettings::tr("Video in floating window"));
4019
4020 gc->setValue(false);
4021
4022 gc->setHelpText(MacFloatSettings::tr("If enabled, video will be displayed "
4023 "in a floating window. Only valid "
4024 "when \"Use GUI size for TV "
4025 "playback\" and \"Run the frontend "
4026 "in a window\" are checked."));
4027 return gc;
4028}
4029
4030static HostSpinBoxSetting *MacFloatSkip()
4031{
4032 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
4033
4034 gs->setLabel(MacFloatSettings::tr("Frames to skip"));
4035
4036 gs->setValue(0);
4037
4038 gs->setHelpText(MacFloatSettings::tr("Video in the floating window will "
4039 "skip this many frames for each "
4040 "frame drawn. Set to 0 to show "
4041 "every frame."));
4042 return gs;
4043}
4044
4045static HostSpinBoxSetting *MacFloatOpacity()
4046{
4047 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
4048
4049 gs->setLabel(MacFloatSettings::tr("Opacity"));
4050
4051 gs->setValue(100);
4052
4053 gs->setHelpText(MacFloatSettings::tr("The opacity of the floating window. "
4054 "Set to 100 for completely opaque, "
4055 "set to 0 for completely "
4056 "transparent."));
4057 return gs;
4058}
4059
4060static HostCheckBoxSetting *MacDockEnabled()
4061{
4062 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
4063
4064 gc->setLabel(MacDockSettings::tr("Video in the dock"));
4065
4066 gc->setValue(true);
4067
4068 gc->setHelpText(MacDockSettings::tr("If enabled, video will be displayed "
4069 "in the application's dock icon. Only "
4070 "valid when \"Use GUI size for TV "
4071 "playback\" and \"Run the frontend in "
4072 "a window\" are checked."));
4073 return gc;
4074}
4075
4076static HostSpinBoxSetting *MacDockSkip()
4077{
4078 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
4079
4080 gs->setLabel(MacDockSettings::tr("Frames to skip"));
4081
4082 gs->setValue(3);
4083
4084 gs->setHelpText(MacDockSettings::tr("Video in the dock icon will skip this "
4085 "many frames for each frame drawn. Set "
4086 "to 0 to show every frame."));
4087 return gs;
4088}
4089
4090static HostCheckBoxSetting *MacDesktopEnabled()
4091{
4092 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
4093
4094 gc->setLabel(MacDesktopSettings::tr("Video on the desktop"));
4095
4096 gc->setValue(false);
4097
4098 gc->setHelpText(MacDesktopSettings::tr("If enabled, video will be "
4099 "displayed on the desktop, "
4100 "behind the Finder icons. "
4101 "Only valid when \"Use GUI "
4102 "size for TV playback\" and "
4103 "\"Run the frontend in a "
4104 "window\" are checked."));
4105 return gc;
4106}
4107
4108static HostSpinBoxSetting *MacDesktopSkip()
4109{
4110 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
4111
4112 gs->setLabel(MacDesktopSettings::tr("Frames to skip"));
4113
4114 gs->setValue(0);
4115
4116 gs->setHelpText(MacDesktopSettings::tr("Video on the desktop will skip "
4117 "this many frames for each frame "
4118 "drawn. Set to 0 to show every "
4119 "frame."));
4120 return gs;
4121}
4122#endif
4123
4124
4126{
4127 public:
4129
4130 private slots:
4131 void childChanged(StandardSetting* /*unused*/) override;
4132
4133 private:
4139};
4140
4142{
4143 setLabel(MainGeneralSettings::tr("Shutdown/Reboot Settings"));
4144 auto *power = MythPower::AcquireRelease(this, true);
4147#ifndef Q_OS_ANDROID
4151#endif
4153 if (power)
4154 MythPower::AcquireRelease(this, false);
4155 connect(m_overrideExitMenu, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4157}
4158
4160{
4162 return;
4163
4164 bool confirmold = m_confirmCommand->isVisible();
4165 bool haltold = m_haltCommand->isVisible();
4166 bool rebootold = m_rebootCommand->isVisible();
4167 bool suspendold = m_suspendCommand->isVisible();
4168
4169 switch (m_overrideExitMenu->getValue().toInt())
4170 {
4171 case 2:
4172 case 4:
4177 break;
4178 case 3:
4179 case 6:
4184 break;
4185 case 5:
4186 m_haltCommand->setVisible(false);
4190 break;
4191 case 8:
4192 case 9:
4193 m_haltCommand->setVisible(false);
4197 break;
4198 case 10:
4203 break;
4204 case 0:
4205 case 1:
4206 default:
4207 m_haltCommand->setVisible(false);
4211 break;
4212 }
4213
4214 if (confirmold != m_confirmCommand->isVisible() ||
4215 haltold != m_haltCommand->isVisible() ||
4216 rebootold != m_rebootCommand->isVisible() ||
4217 suspendold != m_suspendCommand->isVisible())
4218 {
4219 emit settingsChanged();
4220 }
4221}
4222
4224{
4225// DatabaseSettings::addDatabaseSettings(this);
4226 setLabel(tr("Main Settings"));
4227
4229
4230 auto *pin = new GroupSetting();
4231 pin->setLabel(tr("Settings Access"));
4232 pin->addChild(SetupPinCode());
4233 addChild(pin);
4234
4235 auto *general = new GroupSetting();
4236 general->setLabel(tr("General"));
4237 general->addChild(UseVirtualKeyboard());
4238 general->addChild(ScreenShotPath());
4239
4240 auto sh = getMythSortHelper();
4241 if (sh->hasPrefixes()) {
4242#if 0
4243 // Last minute change. QStringRef::localeAwareCompare appears to
4244 // always do case insensitive sorting, so there's no point in
4245 // presenting this option to a user.
4246 general->addChild(SortCaseSensitive());
4247#endif
4248 auto *stripPrefixes = SortStripPrefixes();
4249 general->addChild(stripPrefixes);
4250 stripPrefixes->addTargetedChild("1", SortPrefixExceptions());
4251 }
4252 general->addChild(ManualRecordStartChanType());
4253 addChild(general);
4254
4256
4258
4259 auto *remotecontrol = new GroupSetting();
4260 remotecontrol->setLabel(tr("Remote Control"));
4261 remotecontrol->addChild(LircDaemonDevice());
4262 remotecontrol->addChild(NetworkControlEnabled());
4263 remotecontrol->addChild(NetworkControlPort());
4264 remotecontrol->addChild(UDPNotifyPort());
4265#if CONFIG_LIBCEC
4266 HostCheckBoxSetting *cec = CECEnabled();
4267 remotecontrol->addChild(cec);
4268 cec->addTargetedChild("1",CECDevice());
4269 m_cecPowerOnTVAllowed = CECPowerOnTVAllowed();
4270 m_cecPowerOffTVAllowed = CECPowerOffTVAllowed();
4271 m_cecPowerOnTVOnStart = CECPowerOnTVOnStart();
4272 m_cecPowerOffTVOnExit = CECPowerOffTVOnExit();
4273 cec->addTargetedChild("1",m_cecPowerOnTVAllowed);
4274 cec->addTargetedChild("1",m_cecPowerOffTVAllowed);
4275 cec->addTargetedChild("1",m_cecPowerOnTVOnStart);
4276 cec->addTargetedChild("1",m_cecPowerOffTVOnExit);
4277 connect(m_cecPowerOnTVAllowed, &MythUICheckBoxSetting::valueChanged,
4278 this, &MainGeneralSettings::cecChanged);
4279 connect(m_cecPowerOffTVAllowed, &MythUICheckBoxSetting::valueChanged,
4280 this, &MainGeneralSettings::cecChanged);
4281#endif // CONFIG_LIBCEC
4282 addChild(remotecontrol);
4283
4284#if CONFIG_AIRPLAY
4285 auto *airplay = new GroupSetting();
4286 airplay->setLabel(tr("AirPlay Settings"));
4287 airplay->addChild(AirPlayEnabled());
4288 airplay->addChild(AirPlayFullScreen());
4289 airplay->addChild(AirPlayAudioOnly());
4290 airplay->addChild(AirPlayPasswordSettings());
4291// airplay->addChild(AirPlayInfo());
4292// airplay->addChild(AirPlayRSAInfo());
4293 addChild(airplay);
4294#endif
4295}
4296
4297#if CONFIG_LIBCEC
4298void MainGeneralSettings::cecChanged(bool /*setting*/)
4299{
4300 if (m_cecPowerOnTVAllowed->boolValue())
4301 m_cecPowerOnTVOnStart->setEnabled(true);
4302 else
4303 {
4304 m_cecPowerOnTVOnStart->setEnabled(false);
4305 m_cecPowerOnTVOnStart->setValue(false);
4306 }
4307
4308 if (m_cecPowerOffTVAllowed->boolValue())
4309 m_cecPowerOffTVOnExit->setEnabled(true);
4310 else
4311 {
4312 m_cecPowerOffTVOnExit->setEnabled(false);
4313 m_cecPowerOffTVOnExit->setValue(false);
4314 }
4315}
4316#endif // CONFIG_LIBCEC
4317
4319{
4320 QStringList strlist( QString("REFRESH_BACKEND") );
4322 LOG(VB_GENERAL, LOG_ERR, QString("%1 called").arg(__FUNCTION__));
4324}
4325
4326
4328{
4329 public:
4331 void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4332
4333 private slots:
4334 void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4335
4336 private:
4341};
4342
4344{
4345 setLabel(PlaybackSettings::tr("Scaling"));
4350 connect(m_vertScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4352 connect(m_yScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4354 connect(m_horizScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4356 connect(m_xScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4358}
4359
4360
4362{
4364 if (m_vertScan->getValue() == "0" &&
4365 m_horizScan->getValue() == "0" &&
4366 m_yScan->getValue() == "0" &&
4367 m_xScan->getValue() == "0")
4368 {
4369 item->SetText(PlaybackSettings::tr("No scaling"), "value");
4370 }
4371 else
4372 {
4373 item->SetText(QString("%1%x%2%+%3%+%4%")
4374 .arg(m_horizScan->getValue(),
4376 m_xScan->getValue(),
4377 m_yScan->getValue()),
4378 "value");
4379 }
4380}
4381
4383{
4384 emit ShouldRedraw(this);
4385}
4386
4388 : StandardSettingDialog(stack, "playbacksettings", new PlaybackSettings())
4389{
4390}
4391
4393{
4395 if (item)
4396 {
4397 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4398 if (config)
4400 }
4401}
4402
4403
4405{
4406 auto *menu = new MythMenu(tr("Playback Profile Menu"), this, "mainmenu");
4407
4408 if (m_buttonList->GetItemPos(item) > 2)
4409 menu->AddItem(tr("Move Up"), &PlaybackSettingsDialog::MoveProfileItemUp);
4410 if (m_buttonList->GetItemPos(item) + 1 < m_buttonList->GetCount())
4411 menu->AddItem(tr("Move Down"), &PlaybackSettingsDialog::MoveProfileItemDown);
4412
4413 menu->AddItem(tr("Delete"), &PlaybackSettingsDialog::DeleteProfileItem);
4414
4415 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
4416
4417 auto *menuPopup = new MythDialogBox(menu, popupStack, "menudialog");
4418 menuPopup->SetReturnEvent(this, "mainmenu");
4419
4420 if (menuPopup->Create())
4421 popupStack->AddScreen(menuPopup);
4422 else
4423 delete menuPopup;
4424}
4425
4427{
4429 if (item)
4430 {
4431 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4432 if (config)
4433 {
4434 const int currentPos = m_buttonList->GetCurrentPos();
4435
4436 config->DecreasePriority();
4437
4438 m_buttonList->SetItemCurrent(currentPos + 1);
4439 }
4440 }
4441}
4442
4444{
4446 if (item)
4447 {
4448 auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4449 if (config)
4450 {
4451 const int currentPos = m_buttonList->GetCurrentPos();
4452
4453 config->IncreasePriority();
4454
4455 m_buttonList->SetItemCurrent(currentPos - 1);
4456 }
4457 }
4458}
4459
4461{
4462 auto *config = m_buttonList->GetDataValue().value<PlaybackProfileItemConfig*>();
4463 if (config)
4464 config->ShowDeleteDialog();
4465}
4466
4468{
4469 setLabel(tr("Playback settings"));
4470}
4471
4473{
4474 auto *general = new GroupSetting();
4475 general->setLabel(tr("General Playback"));
4476 general->addChild(JumpToProgramOSD());
4477 general->addChild(UseProgStartMark());
4478 general->addChild(AutomaticSetWatched());
4479 general->addChild(AlwaysShowWatchedProgress());
4480 general->addChild(ContinueEmbeddedTVPlay());
4481 general->addChild(LiveTVIdleTimeout());
4482
4483 general->addChild(FFmpegDemuxer());
4484
4485 general->addChild(new PlayBackScaling());
4486 general->addChild(StereoDiscard());
4487 general->addChild(AspectOverride());
4488 general->addChild(AdjustFill());
4489
4490 general->addChild(LetterboxingColour());
4491 general->addChild(PlaybackExitPrompt());
4492 general->addChild(EndOfRecordingExitPrompt());
4493 general->addChild(MusicChoiceEnabled());
4494 addChild(general);
4495
4496 auto *advanced = new GroupSetting();
4497 advanced->setLabel(tr("Advanced Playback Settings"));
4498 advanced->addChild(RealtimePriority());
4499 advanced->addChild(AudioReadAhead());
4500 advanced->addChild(ColourPrimaries());
4501 advanced->addChild(ChromaUpsampling());
4502#if CONFIG_VAAPI
4503 advanced->addChild(VAAPIDevice());
4504#endif
4505
4506 addChild(advanced);
4507
4510
4512 new ButtonStandardSetting(tr("Add a new playback profile"));
4516
4517 auto *pbox = new GroupSetting();
4518 pbox->setLabel(tr("View Recordings"));
4519 pbox->addChild(PlayBoxOrdering());
4520 pbox->addChild(PlayBoxEpisodeSort());
4521 // Disabled until we re-enable live previews
4522 // pbox->addChild(PlaybackPreview());
4523 // pbox->addChild(HWAccelPlaybackPreview());
4524 pbox->addChild(PBBStartInTitle());
4525
4526 auto *pbox2 = new GroupSetting();
4527 pbox2->setLabel(tr("Recording Groups"));
4528 pbox2->addChild(DisplayRecGroup());
4529 pbox2->addChild(QueryInitialFilter());
4530 pbox2->addChild(RememberRecGroup());
4531 pbox2->addChild(RecGroupMod());
4532
4533 pbox->addChild(pbox2);
4534
4535 pbox->addChild(DisplayGroupTitleSort());
4536
4537 StandardSetting *playbackWatchList = PlaybackWatchList();
4538 playbackWatchList->addTargetedChild("1", PlaybackWLStart());
4539 playbackWatchList->addTargetedChild("1", PlaybackWLAutoExpire());
4540 playbackWatchList->addTargetedChild("1", PlaybackWLMaxAge());
4541 playbackWatchList->addTargetedChild("1", PlaybackWLBlackOut());
4542 pbox->addChild(playbackWatchList);
4543 addChild(pbox);
4544
4545 auto *seek = new GroupSetting();
4546 seek->setLabel(tr("Seeking"));
4547 seek->addChild(SmartForward());
4548 seek->addChild(FFRewReposTime());
4549 seek->addChild(FFRewReverse());
4550
4551 addChild(seek);
4552
4553 auto *comms = new GroupSetting();
4554 comms->setLabel(tr("Commercial Skip"));
4555 comms->addChild(AutoCommercialSkip());
4556 comms->addChild(CommRewindAmount());
4557 comms->addChild(CommNotifyAmount());
4558 comms->addChild(MaximumCommercialSkip());
4559 comms->addChild(MergeShortCommBreaks());
4560
4561 addChild(comms);
4562
4563#ifdef Q_OS_DARWIN
4564 GroupSetting* mac = new GroupSetting();
4565 mac->setLabel(tr("Mac OS X Video Settings"));
4566 mac->addChild(MacGammaCorrect());
4567 mac->addChild(MacScaleUp());
4568 mac->addChild(MacFullSkip());
4569
4570 StandardSetting *floatEnabled = MacFloatEnabled();
4571 floatEnabled->addTargetedChild("1", MacFloatSkip());
4572 floatEnabled->addTargetedChild("1", MacFloatOpacity());
4573 mac->addChild(floatEnabled);
4574
4575 StandardSetting *macMainEnabled = MacMainEnabled();
4576 macMainEnabled->addTargetedChild("1", MacMainSkip());
4577 macMainEnabled->addTargetedChild("1", MacMainOpacity());
4578 mac->addChild(macMainEnabled);
4579
4580 StandardSetting *dockEnabled = MacDockEnabled();
4581 dockEnabled->addTargetedChild("1", MacDockSkip());
4582 mac->addChild(dockEnabled);
4583
4584 StandardSetting* desktopEnabled = MacDesktopEnabled();
4585 desktopEnabled->addTargetedChild("1", MacDesktopSkip());
4586 mac->addChild(desktopEnabled);
4587
4588 addChild(mac);
4589#endif
4590
4592}
4593
4595{
4596 setLabel(tr("On-screen Display"));
4597
4605
4606 //GroupSetting *cc = new GroupSetting();
4607 //cc->setLabel(tr("Closed Captions"));
4608 //cc->addChild(DecodeVBIFormat());
4609 //addChild(cc);
4610
4611#ifdef Q_OS_MACOS
4612 // Any Mac OS-specific OSD stuff would go here.
4613#endif
4614}
4615
4617{
4618 setLabel(tr("General (Basic)"));
4619 auto *general = new GroupSetting();
4620 general->setLabel(tr("General (Basic)"));
4621 general->addChild(ChannelOrdering());
4622 general->addChild(ChannelFormat());
4623 general->addChild(LongChannelFormat());
4624
4625 addChild(general);
4626
4627 auto *autoexp = new GroupSetting();
4628
4629 autoexp->setLabel(tr("General (Auto-Expire)"));
4630
4631 autoexp->addChild(AutoExpireMethod());
4632
4633 autoexp->addChild(RerecordWatched());
4634 autoexp->addChild(AutoExpireWatchedPriority());
4635
4636 autoexp->addChild(AutoExpireLiveTVMaxAge());
4637 autoexp->addChild(AutoExpireDayPriority());
4638 autoexp->addChild(AutoExpireExtraSpace());
4639
4640// autoexp->addChild(new DeletedExpireOptions());
4641 autoexp->addChild(DeletedMaxAge());
4642
4643 addChild(autoexp);
4644
4645 auto *jobs = new GroupSetting();
4646
4647 jobs->setLabel(tr("General (Jobs)"));
4648
4649 jobs->addChild(CommercialSkipMethod());
4650 jobs->addChild(CommFlagFast());
4651 jobs->addChild(AggressiveCommDetect());
4652 jobs->addChild(DeferAutoTranscodeDays());
4653
4654 addChild(jobs);
4655
4656 auto *general2 = new GroupSetting();
4657
4658 general2->setLabel(tr("General (Advanced)"));
4659
4660 general2->addChild(RecordPreRoll());
4661 general2->addChild(RecordOverTime());
4662 general2->addChild(MaxStartGap());
4663 general2->addChild(MaxEndGap());
4664 general2->addChild(MinimumRecordingQuality());
4665 general2->addChild(CategoryOverTimeSettings());
4666 addChild(general2);
4667
4668 auto *changrp = new GroupSetting();
4669
4670 changrp->setLabel(tr("General (Channel Groups)"));
4671
4672 changrp->addChild(ChannelGroupRememberLast());
4673 changrp->addChild(ChannelGroupDefault());
4674 changrp->addChild(BrowseChannelGroup());
4675
4676 addChild(changrp);
4677}
4678
4680{
4681 setLabel(tr("Program Guide"));
4682
4685}
4686
4688{
4689 auto *sched = new GroupSetting();
4690
4691 sched->setLabel(tr("Scheduler Options"));
4692
4693 sched->addChild(GRSchedOpenEnd());
4694 sched->addChild(GRPrefInputRecPriority());
4695 sched->addChild(GRHDTVRecPriority());
4696 sched->addChild(GRWSRecPriority());
4697
4698 addChild(sched);
4699
4700 auto *access = new GroupSetting();
4701
4702 access->setLabel(tr("Accessibility Options"));
4703
4704 access->addChild(GRSignLangRecPriority());
4705 access->addChild(GROnScrSubRecPriority());
4706 access->addChild(GRCCRecPriority());
4707 access->addChild(GRHardHearRecPriority());
4708 access->addChild(GRAudioDescRecPriority());
4709
4710 addChild(access);
4711}
4712
4714{
4715 public:
4716 GuiDimension();
4717 //QString getValue() override; // StandardSetting
4718 void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4719
4720 private slots:
4721 void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4722 private:
4727};
4728
4730{
4731 setLabel(AppearanceSettings::tr("GUI dimension"));
4736 connect(m_width, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4738 connect(m_height, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4740 connect(m_offsetX, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4742 connect(m_offsetY, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4744}
4745
4747{
4749 if ((m_width->getValue() == "0" ||
4750 m_height->getValue() == "0") &&
4751 m_offsetX->getValue() == "0" &&
4752 m_offsetY->getValue() == "0")
4753 {
4754 item->SetText(AppearanceSettings::tr("Fullscreen"), "value");
4755 }
4756 else
4757 {
4758 item->SetText(QString("%1x%2+%3+%4")
4759 .arg(m_width->getValue(),
4760 m_height->getValue(),
4762 m_offsetY->getValue()),
4763 "value");
4764 }
4765}
4766
4768{
4769 emit ShouldRedraw(this);
4770}
4771
4773{
4774 QCoreApplication::processEvents();
4775 GetMythMainWindow()->JumpTo("Reload Theme");
4776}
4777
4779{
4781 QList screens = QGuiApplication::screens();
4782 for (QScreen *qscreen : std::as_const(screens))
4783 {
4784 QString extra = MythDisplay::GetExtraScreenInfo(qscreen);
4785 m_screen->addSelection(qscreen->name() + extra, qscreen->name());
4786 }
4787 if (Screens > 1)
4788 m_screen->addSelection(AppearanceSettings::tr("All"), QString::number(-1));
4789}
4790
4792 : m_screen(ScreenSelection()),
4793 m_screenAspect(ScreenAspectRatio()),
4794 m_display(GetMythMainWindow()->GetDisplay())
4795{
4796 auto *screen = new GroupSetting();
4797 screen->setLabel(tr("Theme / Screen Settings"));
4798 addChild(screen);
4799
4800 AddPaintEngine(screen);
4801 screen->addChild(MenuTheme());
4802 screen->addChild(GUIRGBLevels());
4803
4804 screen->addChild(m_screen);
4805 screen->addChild(m_screenAspect);
4808
4809 screen->addChild(ForceFullScreen());
4810 screen->addChild(new GuiDimension());
4811
4812 screen->addChild(GuiSizeForTV());
4813 screen->addChild(HideMouseCursor());
4815 {
4816 screen->addChild(RunInWindow());
4817 screen->addChild(AlwaysOnTop());
4818 }
4819 screen->addChild(SmoothTransitions());
4820 screen->addChild(StartupScreenDelay());
4821 screen->addChild(GUIFontZoom());
4822#if CONFIG_AIRPLAY
4823 screen->addChild(AirPlayFullScreen());
4824#endif
4825
4827 if (display->VideoModesAvailable())
4828 {
4829 std::vector<MythDisplayMode> scr = display->GetVideoModes();
4830 if (!scr.empty())
4832 }
4833
4834 auto *dates = new GroupSetting();
4835
4836 dates->setLabel(tr("Localization"));
4837
4838 dates->addChild(MythLanguage());
4839 dates->addChild(AudioLanguage());
4840 dates->addChild(ISO639PreferredLanguage(0));
4841 dates->addChild(ISO639PreferredLanguage(1));
4842 dates->addChild(MythDateFormatCB());
4843 dates->addChild(MythShortDateFormat());
4844 dates->addChild(MythTimeFormat());
4845
4846 addChild(dates);
4847
4849}
4850
4851/*******************************************************************************
4852* Channel Groups *
4853*******************************************************************************/
4854
4856{
4857 auto *gc = new HostComboBoxSetting("Select from Channel Group");
4858 gc->setLabel(AppearanceSettings::tr("Select from Channel Group"));
4859 gc->addSelection("All Channels");
4860
4861 // All automatic channel groups that have at least one channel
4862 auto list = ChannelGroup::GetAutomaticChannelGroups(false);
4863 for (const auto &chgrp : list)
4864 {
4865 gc->addSelection(chgrp.m_name);
4866 }
4867 gc->setHelpText(AppearanceSettings::tr(
4868 "Select the channel group to select channels from. "
4869 "\"All Channels\" lets you choose from all channels of all video sources. "
4870 "\"Priority\" lets you choose from all channels that have recording priority. "
4871 "The other values let you select a video source to choose channels from."));
4872 return gc;
4873}
4874
4876{
4877 public:
4879 const QString &channum, const QString &name);
4881 private:
4883
4884};
4885
4887 const QString &channum, const QString &channame)
4888 : m_channelId(chanid)
4889{
4890 setLabel(QString("%1 %2").arg(channum, channame));
4891 setHelpText(ChannelGroupSettings::tr("Select/Unselect channels for this channel group"));
4892}
4893
4895 int groupId = -1)
4896 : m_groupId(groupId),
4897 m_groupName(new TransTextEditSetting())
4898{
4899 setLabel(groupName == "Favorites" ? tr("Favorites") : groupName);
4900 setValue(groupName);
4901 m_groupName->setLabel(groupName);
4902}
4903
4905{
4906 //Change the name
4908 || m_groupId == -1)
4909 {
4910 if (m_groupId == -1)//create a new group
4911 {
4913 QString newname = m_groupName ? m_groupName->getValue() : "undefined";
4915 }
4916 else
4917 {
4919 }
4920 }
4921
4922 if (m_groupId == -1)
4923 return;
4924
4925 QList<StandardSetting *> *children = getSubSettings();
4926 if (!children)
4927 return;
4928
4929 QList<StandardSetting *>::const_iterator i;
4930 for (i = children->constBegin(); i != children->constEnd(); ++i)
4931 {
4932 if ((*i)->haveChanged())
4933 {
4934 if ((*i) != m_groupName)
4935 {
4936 auto *channel = dynamic_cast<ChannelCheckBoxSetting *>(*i);
4937 if (channel)
4938 {
4939 if (channel->boolValue())
4940 {
4941 ChannelGroup::AddChannel(channel->getChannelId(),
4942 m_groupId);
4943 }
4944 else
4945 {
4946 ChannelGroup::DeleteChannel(channel->getChannelId(),
4947 m_groupId);
4948 }
4949 }
4950 }
4951 }
4952 }
4953}
4954
4956{
4957 if (VERBOSE_LEVEL_CHECK(VB_GENERAL, LOG_DEBUG))
4958 {
4959 QString group = m_groupSelection->getValue();
4960 int groupId = ChannelGroup::GetChannelGroupId(group);
4961 LOG(VB_GENERAL, LOG_INFO,
4962 QString("ChannelGroupSetting::LoadChannelGroup group:%1 groupId:%2")
4963 .arg(group).arg(groupId));
4964 }
4965
4966 // Set the old checkboxes from the previously selected channel group invisible
4967 for (const auto &it : m_boxMap)
4968 {
4969 it.second->setVisible(false);
4970 }
4971
4972 // And load the new collection
4974
4975 // Using m_groupSelection instead of nullptr keeps the focus in the "Select from Channel Group" box
4977}
4978
4980{
4981 QString fromGroup = m_groupSelection->getValue();
4982 int fromGroupId = ChannelGroup::GetChannelGroupId(fromGroup);
4983
4985
4986 if (fromGroupId == -1) // All Channels
4987 {
4988 query.prepare(
4989 "SELECT channel.chanid, channum, name, grpid FROM channel "
4990 "LEFT JOIN channelgroup "
4991 "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) "
4992 "WHERE deleted IS NULL "
4993 "AND visible > 0 "
4994 "ORDER BY channum+0; "); // Order by numeric value of channel number
4995 query.bindValue(":GRPID", m_groupId);
4996 }
4997 else
4998 {
4999 query.prepare(
5000 "SELECT channel.chanid, channum, name, cg2.grpid FROM channel "
5001 "RIGHT JOIN channelgroup AS cg1 "
5002 "ON (channel.chanid = cg1.chanid AND cg1.grpid = :FROMGRPID) "
5003 "LEFT JOIN channelgroup AS cg2 "
5004 "ON (channel.chanid = cg2.chanid AND cg2.grpid = :GRPID) "
5005 "WHERE deleted IS NULL "
5006 "AND visible > 0 "
5007 "ORDER BY channum+0; "); // Order by numeric value of channel number
5008 query.bindValue(":GRPID", m_groupId);
5009 query.bindValue(":FROMGRPID", fromGroupId);
5010 }
5011
5012 if (!query.exec() || !query.isActive())
5013 MythDB::DBError("ChannelGroupSetting::LoadChannelGroupChannels", query);
5014 else
5015 {
5016 while (query.next())
5017 {
5018 auto chanid = query.value(0).toUInt();
5019 auto channum = query.value(1).toString();
5020 auto name = query.value(2).toString();
5021 auto checked = !query.value(3).isNull();
5022 auto pair = std::make_pair(m_groupId, chanid);
5023
5024 TransMythUICheckBoxSetting *checkBox = nullptr;
5025 auto it = m_boxMap.find(pair);
5026 if (it != m_boxMap.end())
5027 {
5028 checkBox = it->second;
5029 checkBox->setVisible(true);
5030 }
5031 else
5032 {
5033 checkBox = new ChannelCheckBoxSetting(chanid, channum, name);
5034 checkBox->setValue(checked);
5035 m_boxMap[pair] = checkBox;
5036 addChild(checkBox);
5037 }
5038 }
5039 }
5040}
5041
5043{
5044 clearSettings();
5045
5046 // We cannot rename the Favorites group, make it readonly
5048 m_groupName->setLabel(tr("Group name"));
5052
5053 // Add channel group selection
5055 connect(m_groupSelection, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
5058
5060
5062}
5063
5065{
5066 // Cannot delete new group or Favorites
5067 return (m_groupId > 1);
5068}
5069
5071{
5073
5074 // Delete channels from this group
5075 query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
5076 query.bindValue(":GRPID", m_groupId);
5077 if (!query.exec())
5078 MythDB::DBError("ChannelGroupSetting::deleteEntry 1", query);
5079
5080 // Now delete the group from channelgroupnames
5081 query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
5082 query.bindValue(":GRPID", m_groupId);
5083 if (!query.exec())
5084 MythDB::DBError("ChannelGroupSetting::deleteEntry 2", query);
5085}
5086
5088{
5089 setLabel(tr("Channel Groups"));
5090}
5091
5093{
5094 clearSettings();
5095 auto *newGroup = new ButtonStandardSetting(tr("(Create New Channel Group)"));
5096 connect(newGroup, &ButtonStandardSetting::clicked,
5098 addChild(newGroup);
5099
5101 for (auto it = list.begin(); it < list.end(); ++it)
5102 {
5103 QString name = (it->m_name == "Favorites") ? tr("Favorites") : it->m_name;
5104 addChild(new ChannelGroupSetting(name, it->m_grpId));
5105 }
5106
5107 // Load all the groups
5109
5110 // TODO select the new one or the edited one
5111 emit settingsChanged(nullptr);
5112}
5113
5115{
5116 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
5117 auto *settingdialog = new MythTextInputDialog(popupStack,
5118 tr("Enter the name of the new channel group"));
5119
5120 if (settingdialog->Create())
5121 {
5122 connect(settingdialog, &MythTextInputDialog::haveResult,
5124 popupStack->AddScreen(settingdialog);
5125 }
5126 else
5127 {
5128 delete settingdialog;
5129 }
5130}
5131
5133{
5134 auto *button = new ChannelGroupSetting(name, -1);
5135 button->setLabel(name);
5136 button->Load();
5137 addChild(button);
5138 emit settingsChanged(this);
5139}
5140
5141// 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: freesurround.h:24
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 guint32 * tmp
Definition: goom_core.cpp:26
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