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