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