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  "This setting applies to video playback only, not to the GUI. "
2153  "Most modern displays have square pixels and the aspect ratio of the screen can be "
2154  "computed from the resolution (default). "
2155  "The aspect ratio can also be automatically detected from the connected display "
2156  "- though this may be slightly less accurate. If automatic detection fails, the correct "
2157  "aspect ratio can be specified here. Note: Some values (e.g 32:10) are "
2158  "primarily intended for multiscreen setups."));
2159  return gc;
2160 }
2161 
2163 {
2164  auto *gc = new HostComboBoxSetting("LetterboxColour");
2165 
2166  gc->setLabel(PlaybackSettings::tr("Letterboxing color"));
2167 
2168  for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
2169  gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
2170 
2171  gc->setHelpText(PlaybackSettings::tr("By default MythTV uses black "
2172  "letterboxing to match broadcaster "
2173  "letterboxing, but those with plasma "
2174  "screens may prefer gray to minimize "
2175  "burn-in."));
2176  return gc;
2177 }
2178 
2180 {
2181  auto * cb = new HostCheckBoxSetting("DiscardStereo3D");
2182  cb->setValue(true);
2183  cb->setLabel("Discard 3D stereoscopic fields");
2184  cb->setHelpText(PlaybackSettings::tr(
2185  "If 'Side by Side' or 'Top and Bottom' 3D material is detected, "
2186  "enabling this setting will discard one field (enabled by default)."));
2187  return cb;
2188 }
2189 
2191 {
2192  auto *gc = new HostComboBoxSetting("AspectOverride");
2193 
2194  gc->setLabel(PlaybackSettings::tr("Video aspect override"));
2195 
2196  for (int m = kAspect_Off; m < kAspect_END; ++m)
2197  gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
2198 
2199  gc->setHelpText(PlaybackSettings::tr("When enabled, these will override "
2200  "the aspect ratio specified by any "
2201  "broadcaster for all video streams."));
2202  return gc;
2203 }
2204 
2206 {
2207  auto *gc = new HostComboBoxSetting("AdjustFill");
2208 
2209  gc->setLabel(PlaybackSettings::tr("Zoom"));
2210 
2211  for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
2212  gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
2214  QString::number(kAdjustFill_AutoDetect_DefaultOff));
2216  QString::number(kAdjustFill_AutoDetect_DefaultHalf));
2217 
2218  gc->setHelpText(PlaybackSettings::tr("When enabled, these will apply a "
2219  "predefined zoom to all video "
2220  "playback in MythTV."));
2221  return gc;
2222 }
2223 
2224 // Theme settings
2225 
2227 {
2228  auto *gs = new HostSpinBoxSetting("GuiWidth", 0, 3840, 8, 1);
2229 
2230  gs->setLabel(AppearanceSettings::tr("GUI width (pixels)"));
2231 
2232  gs->setValue(0);
2233 
2234  gs->setHelpText(AppearanceSettings::tr("The width of the GUI. Do not make "
2235  "the GUI wider than your actual "
2236  "screen resolution. Set to 0 to "
2237  "automatically scale to "
2238  "fullscreen."));
2239  return gs;
2240 }
2241 
2243 {
2244  auto *gs = new HostSpinBoxSetting("GuiHeight", 0, 2160, 8, 1);
2245 
2246  gs->setLabel(AppearanceSettings::tr("GUI height (pixels)"));
2247 
2248  gs->setValue(0);
2249 
2250  gs->setHelpText(AppearanceSettings::tr("The height of the GUI. Do not make "
2251  "the GUI taller than your actual "
2252  "screen resolution. Set to 0 to "
2253  "automatically scale to "
2254  "fullscreen."));
2255  return gs;
2256 }
2257 
2259 {
2260  auto *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, 1);
2261 
2262  gs->setLabel(AppearanceSettings::tr("GUI X offset"));
2263 
2264  gs->setValue(0);
2265 
2266  gs->setHelpText(AppearanceSettings::tr("The horizontal offset where the "
2267  "GUI will be displayed. May only "
2268  "work if run in a window."));
2269  return gs;
2270 }
2271 
2273 {
2274  auto *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, 1);
2275 
2276  gs->setLabel(AppearanceSettings::tr("GUI Y offset"));
2277 
2278  gs->setValue(0);
2279 
2280  gs->setHelpText(AppearanceSettings::tr("The vertical offset where the "
2281  "GUI will be displayed."));
2282  return gs;
2283 }
2284 
2286 {
2287  auto *gc = new HostCheckBoxSetting("GuiSizeForTV");
2288 
2289  gc->setLabel(AppearanceSettings::tr("Use GUI size for TV playback"));
2290 
2291  gc->setValue(true);
2292 
2293  gc->setHelpText(AppearanceSettings::tr("If enabled, use the above size for "
2294  "TV, otherwise use full screen."));
2295  return gc;
2296 }
2297 
2299 {
2300  HostCheckBoxSetting *gc = new VideoModeSettings("UseVideoModes");
2301 
2302  gc->setLabel(VideoModeSettings::tr("Separate video modes for GUI and "
2303  "TV playback"));
2304 
2305  gc->setValue(false);
2306 
2307  gc->setHelpText(VideoModeSettings::tr(
2308  "Switch video modes for playback depending on the source "
2309  "resolution and frame rate."));
2310  return gc;
2311 }
2312 
2314 {
2315  auto *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
2316  0, 3840, 16, 1);
2317 
2318  gs->setLabel(VideoModeSettings::tr("In X", "Video mode width"));
2319 
2320  gs->setValue(0);
2321 
2322  gs->setHelpText(VideoModeSettings::tr("Horizontal resolution of video "
2323  "which needs a special output "
2324  "resolution."));
2325  return gs;
2326 }
2327 
2329 {
2330  auto *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
2331  0, 2160, 16, 1);
2332 
2333  gs->setLabel(VideoModeSettings::tr("In Y", "Video mode height"));
2334 
2335  gs->setValue(0);
2336 
2337  gs->setHelpText(VideoModeSettings::tr("Vertical resolution of video "
2338  "which needs a special output "
2339  "resolution."));
2340  return gs;
2341 }
2342 
2344 {
2345  auto *gc = new HostComboBoxSetting("GuiVidModeResolution");
2346 
2347  gc->setLabel(VideoModeSettings::tr("GUI"));
2348 
2349  gc->setHelpText(VideoModeSettings::tr("Resolution of screen when not "
2350  "watching a video."));
2351 
2352  MythDisplay* display = GetMythMainWindow()->GetDisplay();
2353  std::vector<MythDisplayMode> scr = display->GetVideoModes();
2354  for (auto & vmode : scr)
2355  {
2356  int w = vmode.Width();
2357  int h = vmode.Height();
2358  QString sel = QString("%1x%2").arg(w).arg(h);
2359  gc->addSelection(sel, sel);
2360  }
2361 
2362  // if no resolution setting, set it with a reasonable initial value
2363  if (!scr.empty() && (gCoreContext->GetSetting("GuiVidModeResolution").isEmpty()))
2364  {
2365  int w = 0;
2366  int h = 0;
2367  gCoreContext->GetResolutionSetting("GuiVidMode", w, h);
2368  if ((w <= 0) || (h <= 0))
2369  {
2370  w = 640;
2371  h = 480;
2372  }
2373 
2374  MythDisplayMode dscr(w, h, -1, -1, -1.0, 0);
2375  double rate = -1.0;
2376  int i = MythDisplayMode::FindBestMatch(scr, dscr, rate);
2377  gc->setValue((i >= 0) ? i : scr.size() - 1);
2378  }
2379 
2380  return gc;
2381 }
2382 
2384 {
2385  QString dhelp = VideoModeSettings::tr("Default screen resolution "
2386  "when watching a video.");
2387  QString ohelp = VideoModeSettings::tr("Screen resolution when watching a "
2388  "video at a specific resolution.");
2389 
2390  QString qstr = (idx<0) ? "TVVidModeResolution" :
2391  QString("TVVidModeResolution%1").arg(idx);
2392  auto *gc = new HostComboBoxSetting(qstr);
2393  QString lstr = (idx<0) ? VideoModeSettings::tr("Video output") :
2394  VideoModeSettings::tr("Output");
2395  QString hstr = (idx<0) ? dhelp : ohelp;
2396 
2397  gc->setLabel(lstr);
2398 
2399  gc->setHelpText(hstr);
2400 
2401  MythDisplay* display = GetMythMainWindow()->GetDisplay();
2402  std::vector<MythDisplayMode> scr = display->GetVideoModes();
2403  for (auto & vmode : scr)
2404  {
2405  QString sel = QString("%1x%2").arg(vmode.Width()).arg(vmode.Height());
2406  gc->addSelection(sel, sel);
2407  }
2408 
2409  return gc;
2410 }
2411 
2413 {
2414  const QString previousValue = getValue();
2415  const bool wasUnchanged = !haveChanged();
2416 
2417  clearSelections();
2418  QString resolution = setting->getValue();
2419  int hz50 = -1;
2420  int hz60 = -1;
2421  const std::vector<double> list = GetRefreshRates(resolution);
2422  addSelection(QObject::tr("Auto"), "0");
2423  for (size_t i = 0; i < list.size(); ++i)
2424  {
2425  QString sel = QString::number((double) list[i], 'f', 3);
2426  addSelection(sel + " Hz", sel, sel == previousValue);
2427  hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
2428  hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
2429  }
2430 
2431  // addSelection() will cause setValue() to be called, marking the setting as
2432  // changed even though the previous value might still be available. Mark it
2433  // as unchanged in this case if it wasn't already changed.
2434  if (wasUnchanged && previousValue == getValue())
2435  setChanged(false);
2436  else
2437  {
2438  if ("640x480" == resolution || "720x480" == resolution)
2439  setValue(hz60+1);
2440  if ("640x576" == resolution || "720x576" == resolution)
2441  setValue(hz50+1);
2442  }
2443 
2444  setEnabled(!list.empty());
2445 }
2446 
2447 std::vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res)
2448 {
2449  QStringList slist = res.split("x");
2450  int width = 0;
2451  int height = 0;
2452  bool ok0 = false;
2453  bool ok1 = false;
2454  if (2 == slist.size())
2455  {
2456  width = slist[0].toInt(&ok0);
2457  height = slist[1].toInt(&ok1);
2458  }
2459 
2460  std::vector<double> result;
2461  if (ok0 && ok1)
2462  {
2463  QSize size(width, height);
2464  MythDisplay* display = GetMythMainWindow()->GetDisplay();
2465  result = display->GetRefreshRates(size);
2466  }
2467  return result;
2468 }
2469 
2471 {
2472  QString dhelp = VideoModeSettings::tr("Default refresh rate when watching "
2473  "a video. Leave at \"Auto\" to "
2474  "automatically use the best "
2475  "available");
2476  QString ohelp = VideoModeSettings::tr("Refresh rate when watching a "
2477  "video at a specific resolution. "
2478  "Leave at \"Auto\" to automatically "
2479  "use the best available");
2480 
2481  QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
2482  QString("TVVidModeRefreshRate%1").arg(idx);
2483  auto *gc = new HostRefreshRateComboBoxSetting(qstr);
2484  QString lstr = VideoModeSettings::tr("Rate");
2485  QString hstr = (idx<0) ? dhelp : ohelp;
2486 
2487  gc->setLabel(lstr);
2488  gc->setHelpText(hstr);
2489  gc->setEnabled(false);
2490  return gc;
2491 }
2492 
2494 {
2495  QString dhelp = VideoModeSettings::tr("Aspect ratio when watching a "
2496  "video. Leave at \"%1\" to "
2497  "use ratio reported by the monitor. "
2498  "Set to 16:9 or 4:3 to force a "
2499  "specific aspect ratio.");
2500 
2501 
2502 
2503  QString ohelp = VideoModeSettings::tr("Aspect ratio when watching a "
2504  "video at a specific resolution. "
2505  "Leave at \"%1\" to use ratio "
2506  "reported by the monitor. Set to "
2507  "16:9 or 4:3 to force a specific "
2508  "aspect ratio.");
2509 
2510  QString qstr = (idx<0) ? "TVVidModeForceAspect" :
2511  QString("TVVidModeForceAspect%1").arg(idx);
2512 
2513  auto *gc = new HostComboBoxSetting(qstr);
2514 
2515  gc->setLabel(VideoModeSettings::tr("Aspect"));
2516 
2517  QString hstr = (idx<0) ? dhelp : ohelp;
2518 
2519  gc->setHelpText(hstr.arg(VideoModeSettings::tr("Default")));
2520 
2521  gc->addSelection(VideoModeSettings::tr("Default"), "0.0");
2522  gc->addSelection("16:9", "1.77777777777");
2523  gc->addSelection("4:3", "1.33333333333");
2524 
2525  return gc;
2526 }
2527 
2529 {
2531  item->setDrawArrow(getValue() == "1");
2532 }
2533 
2535 {
2536  auto *pause = new HostSpinBoxSetting("VideoModeChangePauseMS", 0, 5000, 100);
2537  pause->setLabel(VideoModeSettings::tr("Pause while switching video modes (ms)"));
2538  pause->setHelpText(VideoModeSettings::tr(
2539  "For most displays, switching video modes takes time and content can be missed. "
2540  "If non-zero, this setting will pause playback while the video mode is changed. "
2541  "The required pause length (in ms) will be dependant on the display's characteristics."));
2542  pause->setValue(0);
2543  return pause;
2544 }
2545 
2547 {
2551 
2553  addChild(res);
2554  addChild(rate);
2556  addChild(pause);
2557  connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2559 
2560  auto *overrides = new GroupSetting();
2561 
2562  overrides->setLabel(tr("Overrides for specific video sizes"));
2563 
2564  for (int idx = 0; idx < 3; ++idx)
2565  {
2566  //input side
2567  overrides->addChild(VidModeWidth(idx));
2568  overrides->addChild(VidModeHeight(idx));
2569  // output side
2570  overrides->addChild(res = TVVidModeResolution(idx));
2571  overrides->addChild(rate = TVVidModeRefreshRate(idx));
2572  overrides->addChild(TVVidModeForceAspect(idx));
2573 
2574  connect(res, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
2576  }
2577 
2578  addChild(overrides);
2579 };
2580 
2582 {
2583  auto *gc = new HostCheckBoxSetting("HideMouseCursor");
2584 
2585  gc->setLabel(AppearanceSettings::tr("Hide mouse cursor in MythTV"));
2586 
2587  gc->setValue(false);
2588 
2589  gc->setHelpText(AppearanceSettings::tr("Toggles mouse cursor visibility "
2590  "for touchscreens. By default "
2591  "MythTV will auto-hide the cursor "
2592  "if the mouse doesn't move for a "
2593  "period, this setting disables the "
2594  "cursor entirely."));
2595  return gc;
2596 };
2597 
2598 
2600 {
2601  auto *gc = new HostCheckBoxSetting("RunFrontendInWindow");
2602 
2603  gc->setLabel(AppearanceSettings::tr("Use window border"));
2604 
2605  gc->setValue(false);
2606 
2607  gc->setHelpText(AppearanceSettings::tr("Toggles between windowed and "
2608  "borderless operation."));
2609  return gc;
2610 }
2611 
2613 {
2614  auto *gc = new HostCheckBoxSetting("AlwaysOnTop");
2615 
2616  gc->setLabel(AppearanceSettings::tr("Always On Top"));
2617 
2618  gc->setValue(false);
2619 
2620  gc->setHelpText(AppearanceSettings::tr("If enabled, MythTV will always be "
2621  "on top"));
2622  return gc;
2623 }
2624 
2626 {
2627  auto *gs = new HostSpinBoxSetting("StartupScreenDelay", -1, 60, 1, 1,
2628  "Never show startup screen");
2629 
2630  gs->setLabel(AppearanceSettings::tr("Startup Screen Delay"));
2631 
2632  gs->setValue(2);
2633 
2634  gs->setHelpText(AppearanceSettings::tr(
2635  "The Startup Screen will show the progress of starting the frontend "
2636  "if frontend startup takes longer than this number of seconds."));
2637  return gs;
2638 }
2639 
2640 
2642 {
2643  auto *gs = new HostSpinBoxSetting("GUITEXTZOOM", 50, 150, 1, 1);
2644 
2645  gs->setLabel(AppearanceSettings::tr("GUI text zoom percentage"));
2646 
2647  gs->setValue(100);
2648 
2649  gs->setHelpText(AppearanceSettings::tr
2650  ("Adjust the themed defined font size by this percentage. "
2651  "mythfrontend needs restart for this to take effect."));
2652  return gs;
2653 }
2654 
2655 
2657 {
2658  auto *gc = new HostComboBoxSetting("DateFormat");
2659  gc->setLabel(AppearanceSettings::tr("Date format"));
2660 
2661  QDate sampdate = MythDate::current().toLocalTime().date();
2662  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2663  "today's date.");
2664 
2665  if (sampdate.month() == sampdate.day())
2666  {
2667  sampdate = sampdate.addDays(1);
2668  sampleStr = AppearanceSettings::tr("Samples are shown using "
2669  "tomorrow's date.");
2670  }
2671 
2672  QLocale locale = gCoreContext->GetQLocale();
2673 
2674  gc->addSelection(locale.toString(sampdate, "ddd MMM d"), "ddd MMM d");
2675  gc->addSelection(locale.toString(sampdate, "ddd d MMM"), "ddd d MMM");
2676  gc->addSelection(locale.toString(sampdate, "ddd MMMM d"), "ddd MMMM d");
2677  gc->addSelection(locale.toString(sampdate, "ddd d MMMM"), "ddd d MMMM");
2678  gc->addSelection(locale.toString(sampdate, "dddd MMM d"), "dddd MMM d");
2679  gc->addSelection(locale.toString(sampdate, "dddd d MMM"), "dddd d MMM");
2680  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2681  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2682  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2683  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2684  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2685  gc->addSelection(locale.toString(sampdate, "dd.MM"), "dd.MM");
2686  gc->addSelection(locale.toString(sampdate, "M/d/yyyy"), "M/d/yyyy");
2687  gc->addSelection(locale.toString(sampdate, "d/M/yyyy"), "d/M/yyyy");
2688  gc->addSelection(locale.toString(sampdate, "MM.dd.yyyy"), "MM.dd.yyyy");
2689  gc->addSelection(locale.toString(sampdate, "dd.MM.yyyy"), "dd.MM.yyyy");
2690  gc->addSelection(locale.toString(sampdate, "yyyy-MM-dd"), "yyyy-MM-dd");
2691  gc->addSelection(locale.toString(sampdate, "ddd MMM d yyyy"), "ddd MMM d yyyy");
2692  gc->addSelection(locale.toString(sampdate, "ddd d MMM yyyy"), "ddd d MMM yyyy");
2693  gc->addSelection(locale.toString(sampdate, "ddd yyyy-MM-dd"), "ddd yyyy-MM-dd");
2694 
2695  QString cn_long = QString("dddd yyyy") + QChar(0x5E74) +
2696  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd yyyy年M月d日
2697  gc->addSelection(locale.toString(sampdate, cn_long), cn_long);
2698  QString cn_med = QString("dddd ") +
2699  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd M月d日
2700 
2701  gc->addSelection(locale.toString(sampdate, cn_med), cn_med);
2702 
2703  //: %1 gives additional information regarding the date format
2704  gc->setHelpText(AppearanceSettings::tr("Your preferred date format. %1")
2705  .arg(sampleStr));
2706 
2707  return gc;
2708 }
2709 
2711 {
2712  auto *gc = new HostComboBoxSetting("ShortDateFormat");
2713  gc->setLabel(AppearanceSettings::tr("Short date format"));
2714 
2715  QDate sampdate = MythDate::current().toLocalTime().date();
2716 
2717  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2718  "today's date.");
2719 
2720  if (sampdate.month() == sampdate.day())
2721  {
2722  sampdate = sampdate.addDays(1);
2723  sampleStr = AppearanceSettings::tr("Samples are shown using "
2724  "tomorrow's date.");
2725  }
2726  QLocale locale = gCoreContext->GetQLocale();
2727 
2728  gc->addSelection(locale.toString(sampdate, "M/d"), "M/d");
2729  gc->addSelection(locale.toString(sampdate, "d/M"), "d/M");
2730  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2731  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2732  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2733  gc->addSelection(locale.toString(sampdate, "dd.MM."), "dd.MM.");
2734  gc->addSelection(locale.toString(sampdate, "M.d."), "M.d.");
2735  gc->addSelection(locale.toString(sampdate, "d.M."), "d.M.");
2736  gc->addSelection(locale.toString(sampdate, "MM-dd"), "MM-dd");
2737  gc->addSelection(locale.toString(sampdate, "dd-MM"), "dd-MM");
2738  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2739  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2740  gc->addSelection(locale.toString(sampdate, "ddd d"), "ddd d");
2741  gc->addSelection(locale.toString(sampdate, "d ddd"), "d ddd");
2742  gc->addSelection(locale.toString(sampdate, "ddd M/d"), "ddd M/d");
2743  gc->addSelection(locale.toString(sampdate, "ddd d/M"), "ddd d/M");
2744  gc->addSelection(locale.toString(sampdate, "ddd d.M"), "ddd d.M");
2745  gc->addSelection(locale.toString(sampdate, "ddd dd.MM"), "ddd dd.MM");
2746  gc->addSelection(locale.toString(sampdate, "M/d ddd"), "M/d ddd");
2747  gc->addSelection(locale.toString(sampdate, "d/M ddd"), "d/M ddd");
2748 
2749  QString cn_short1 = QString("M") + QChar(0x6708) + "d" + QChar(0x65E5); // M月d日
2750 
2751  gc->addSelection(locale.toString(sampdate, cn_short1), cn_short1);
2752 
2753  QString cn_short2 = QString("ddd M") + QChar(0x6708) + "d" + QChar(0x65E5); // ddd M月d日
2754 
2755  gc->addSelection(locale.toString(sampdate, cn_short2), cn_short2);
2756 
2757  //: %1 gives additional information regarding the date format
2758  gc->setHelpText(AppearanceSettings::tr("Your preferred short date format. %1")
2759  .arg(sampleStr));
2760  return gc;
2761 }
2762 
2764 {
2765  auto *gc = new HostComboBoxSetting("TimeFormat");
2766 
2767  gc->setLabel(AppearanceSettings::tr("Time format"));
2768 
2769  QTime samptime = QTime::currentTime();
2770 
2771  QLocale locale = gCoreContext->GetQLocale();
2772 
2773  gc->addSelection(locale.toString(samptime, "h:mm AP"), "h:mm AP");
2774  gc->addSelection(locale.toString(samptime, "h:mm ap"), "h:mm ap");
2775  gc->addSelection(locale.toString(samptime, "hh:mm AP"), "hh:mm AP");
2776  gc->addSelection(locale.toString(samptime, "hh:mm ap"), "hh:mm ap");
2777  gc->addSelection(locale.toString(samptime, "h:mm"), "h:mm");
2778  gc->addSelection(locale.toString(samptime, "hh:mm"), "hh:mm");
2779  gc->addSelection(locale.toString(samptime, "hh.mm"), "hh.mm");
2780  gc->addSelection(locale.toString(samptime, "AP h:mm"), "AP h:mm");
2781 
2782  gc->setHelpText(AppearanceSettings::tr("Your preferred time format. You "
2783  "must choose a format with \"AM\" "
2784  "or \"PM\" in it, otherwise your "
2785  "time display will be 24-hour or "
2786  "\"military\" time."));
2787  return gc;
2788 }
2789 
2791 {
2792  auto *rgb = new HostCheckBoxSetting("GUIRGBLevels");
2793  rgb->setLabel(AppearanceSettings::tr("Use full range RGB output"));
2794  rgb->setValue(true);
2795  rgb->setHelpText("Enable (recommended) to supply full range RGB output to your display device. "
2796  "Disable to supply limited range RGB output. This setting applies to both the "
2797  "GUI and media playback. Ideally the value of this setting should match a "
2798  "similar setting on your TV or monitor.");
2799  return rgb;
2800 }
2801 
2803 {
2804  auto *gc = new HostComboBoxSetting("ChannelFormat");
2805 
2806  gc->setLabel(GeneralSettings::tr("Channel format"));
2807 
2808  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2809  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2810  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2811  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2812  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2813 
2814  gc->setHelpText(GeneralSettings::tr("Your preferred channel format."));
2815 
2816  gc->setValue(1);
2817 
2818  return gc;
2819 }
2820 
2822 {
2823  auto *gc = new HostComboBoxSetting("LongChannelFormat");
2824 
2825  gc->setLabel(GeneralSettings::tr("Long channel format"));
2826 
2827  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2828  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2829  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2830  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2831  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2832 
2833  gc->setHelpText(GeneralSettings::tr("Your preferred long channel format."));
2834 
2835  gc->setValue(2);
2836 
2837  return gc;
2838 }
2839 
2841 {
2842  auto *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
2843 
2844  gc->setLabel(ChannelGroupSettings::tr("Remember last channel group"));
2845 
2846  gc->setHelpText(ChannelGroupSettings::tr("If enabled, the EPG will "
2847  "initially display only the "
2848  "channels from the last channel "
2849  "group selected. Pressing \"4\" "
2850  "will toggle channel group."));
2851 
2852  gc->setValue(false);
2853 
2854  return gc;
2855 }
2856 
2858 {
2859  auto *gc = new HostComboBoxSetting("ChannelGroupDefault");
2860 
2861  gc->setLabel(ChannelGroupSettings::tr("Default channel group"));
2862 
2863  ChannelGroupList changrplist;
2864 
2865  changrplist = ChannelGroup::GetChannelGroups();
2866 
2867  gc->addSelection(ChannelGroupSettings::tr("All Channels"), "-1");
2868 
2869  ChannelGroupList::iterator it;
2870 
2871  for (it = changrplist.begin(); it < changrplist.end(); ++it)
2872  gc->addSelection(it->m_name, QString("%1").arg(it->m_grpId));
2873 
2874  gc->setHelpText(ChannelGroupSettings::tr("Default channel group to be "
2875  "shown in the EPG. Pressing "
2876  "GUIDE key will toggle channel "
2877  "group."));
2878  gc->setValue(false);
2879 
2880  return gc;
2881 }
2882 
2884 {
2885  auto *gc = new HostCheckBoxSetting("BrowseChannelGroup");
2886 
2887  gc->setLabel(GeneralSettings::tr("Browse/change channels from Channel "
2888  "Group"));
2889 
2890  gc->setHelpText(GeneralSettings::tr("If enabled, Live TV will browse or "
2891  "change channels from the selected "
2892  "channel group. The \"All Channels\" "
2893  "channel group may be selected to "
2894  "browse all channels."));
2895  gc->setValue(false);
2896 
2897  return gc;
2898 }
2899 
2900 #if 0
2901 static GlobalCheckBoxSetting *SortCaseSensitive()
2902 {
2903  auto *gc = new GlobalCheckBoxSetting("SortCaseSensitive");
2904  gc->setLabel(GeneralSettings::tr("Case-sensitive sorting"));
2905  gc->setValue(false);
2906  gc->setHelpText(GeneralSettings::tr("If enabled, all sorting will be "
2907  "case-sensitive. This would mean "
2908  "that \"bee movie\" would sort after "
2909  "\"Sea World\" as lower case letters "
2910  "sort after uppercase letters."));
2911  return gc;
2912 }
2913 #endif
2914 
2916 {
2917  auto *gc = new GlobalCheckBoxSetting("SortStripPrefixes");
2918 
2919  gc->setLabel(GeneralSettings::tr("Remove prefixes when sorting"));
2920  gc->setValue(true);
2921  gc->setHelpText(GeneralSettings::tr(
2922  "If enabled, all sorting will remove the common "
2923  "prefixes (The, A, An) from a string prior to "
2924  "sorting. For example, this would sort the titles "
2925  "\"Earth 2\", \"The Flash\", and \"Kings\" in that "
2926  "order. If disabled, they would sort as \"Earth 2\", "
2927  "\"Kings\", \"The Flash\"."));
2928  return gc;
2929 }
2930 
2932 {
2933  auto *gc = new GlobalTextEditSetting("SortPrefixExceptions");
2934 
2935  gc->setLabel(MainGeneralSettings::tr("Names exempt from prefix removal"));
2936  gc->setValue("");
2937  gc->setHelpText(MainGeneralSettings::tr(
2938  "This list of names will be exempt from removing "
2939  "the common prefixes (The, A, An) from a title or "
2940  "filename. Enter multiple names separated by "
2941  "semicolons."));
2942  return gc;
2943 }
2944 
2946 {
2947  auto *gc = new GlobalComboBoxSetting("ManualRecordStartChanType");
2948 
2949  gc->setLabel(GeneralSettings::tr("Starting channel for Manual Record"));
2950  gc->addSelection(GeneralSettings::tr("Guide Starting Channel"), "1", true);
2951  gc->addSelection(GeneralSettings::tr("Last Manual Record Channel"), "2");
2952  gc->setHelpText(GeneralSettings::tr(
2953  "When entering a new Manual Record Rule, "
2954  "the starting channel will default to this."));
2955  return gc;
2956 }
2957 
2958 // General RecPriorities settings
2959 
2961 {
2962  auto *bc = new GlobalComboBoxSetting("SchedOpenEnd");
2963 
2964  bc->setLabel(GeneralRecPrioritiesSettings::tr("Avoid back to back "
2965  "recordings"));
2966 
2967  bc->setHelpText(
2968  GeneralRecPrioritiesSettings::tr("Selects the situations where the "
2969  "scheduler will avoid assigning shows "
2970  "to the same card if their end time "
2971  "and start time match. This will be "
2972  "allowed when necessary in order to "
2973  "resolve conflicts."));
2974 
2975  bc->addSelection(GeneralRecPrioritiesSettings::tr("Never"), "0");
2976  bc->addSelection(GeneralRecPrioritiesSettings::tr("Different Channels"),
2977  "1");
2978  bc->addSelection(GeneralRecPrioritiesSettings::tr("Always"), "2");
2979 
2980  bc->setValue(0);
2981 
2982  return bc;
2983 }
2984 
2986 {
2987  auto *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
2988 
2989  bs->setLabel(GeneralRecPrioritiesSettings::tr("Preferred input priority"));
2990 
2991  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2992  "a showing matches the "
2993  "preferred input selected "
2994  "in the 'Scheduling "
2995  "Options' section of the "
2996  "recording rule."));
2997 
2998  bs->setValue(2);
2999  return bs;
3000 }
3001 
3003 {
3004  auto *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
3005 
3006  bs->setLabel(GeneralRecPrioritiesSettings::tr("HDTV recording priority"));
3007 
3008  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3009  "a showing is marked as an "
3010  "HDTV broadcast in the TV "
3011  "listings."));
3012 
3013  bs->setValue(0);
3014 
3015  return bs;
3016 }
3017 
3019 {
3020  auto *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
3021 
3022  bs->setLabel(GeneralRecPrioritiesSettings::tr("Widescreen recording "
3023  "priority"));
3024 
3025  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3026  "a showing is marked as "
3027  "widescreen in the TV "
3028  "listings."));
3029 
3030  bs->setValue(0);
3031 
3032  return bs;
3033 }
3034 
3036 {
3037  auto *bs = new GlobalSpinBoxSetting("SignLangRecPriority", -99, 99, 1);
3038 
3039  bs->setLabel(GeneralRecPrioritiesSettings::tr("Sign language recording "
3040  "priority"));
3041 
3042  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3043  "when a showing is "
3044  "marked as having "
3045  "in-vision sign "
3046  "language."));
3047 
3048  bs->setValue(0);
3049 
3050  return bs;
3051 }
3052 
3054 {
3055  auto *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority", -99, 99, 1);
3056 
3057  bs->setLabel(GeneralRecPrioritiesSettings::tr("In-vision Subtitles "
3058  "Recording Priority"));
3059 
3060  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
3061  "when a showing is marked "
3062  "as having in-vision "
3063  "subtitles."));
3064 
3065  bs->setValue(0);
3066 
3067  return bs;
3068 }
3069 
3071 {
3072  auto *bs = new GlobalSpinBoxSetting("CCRecPriority", -99, 99, 1);
3073 
3074  bs->setLabel(GeneralRecPrioritiesSettings::tr("Subtitles/CC recording "
3075  "priority"));
3076 
3077  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3078  "a showing is marked as "
3079  "having subtitles or "
3080  "closed captioning (CC) "
3081  "available."));
3082 
3083  bs->setValue(0);
3084 
3085  return bs;
3086 }
3087 
3089 {
3090  auto *bs = new GlobalSpinBoxSetting("HardHearRecPriority", -99, 99, 1);
3091 
3092  bs->setLabel(GeneralRecPrioritiesSettings::tr("Hard of hearing priority"));
3093 
3094  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3095  "a showing is marked as "
3096  "having support for "
3097  "viewers with impaired "
3098  "hearing."));
3099 
3100  bs->setValue(0);
3101 
3102  return bs;
3103 }
3104 
3106 {
3107  auto *bs = new GlobalSpinBoxSetting("AudioDescRecPriority", -99, 99, 1);
3108 
3109  bs->setLabel(GeneralRecPrioritiesSettings::tr("Audio described priority"));
3110 
3111  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
3112  "a showing is marked as "
3113  "being Audio Described."));
3114 
3115  bs->setValue(0);
3116 
3117  return bs;
3118 }
3119 
3121 {
3122  auto *ge = new HostTextEditSetting("DefaultTVChannel");
3123 
3124  ge->setLabel(EPGSettings::tr("Guide starts at channel"));
3125 
3126  ge->setValue("3");
3127 
3128  ge->setHelpText(EPGSettings::tr("The program guide starts on this channel "
3129  "if it is run from outside of Live TV "
3130  "mode. Leave blank to enable Live TV "
3131  "automatic start channel."));
3132 
3133  return ge;
3134 }
3135 
3137 {
3138  auto *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
3139 
3140  gs->setLabel(EPGSettings::tr("Record threshold"));
3141 
3142  gs->setValue(16);
3143 
3144  gs->setHelpText(EPGSettings::tr("Pressing SELECT on a show that is at "
3145  "least this many minutes into the future "
3146  "will schedule a recording."));
3147  return gs;
3148 }
3149 
3151 {
3152  auto *gc = new GlobalComboBoxSetting("Language");
3153 
3154  gc->setLabel(AppearanceSettings::tr("Language"));
3155 
3156  QMap<QString, QString> langMap = MythTranslation::getLanguages();
3157  QStringList langs = langMap.values();
3158  langs.sort();
3159  QString langCode = gCoreContext->GetSetting("Language").toLower();
3160 
3161  if (langCode.isEmpty())
3162  langCode = "en_US";
3163 
3164  gc->clearSelections();
3165 
3166  for (const auto & label : qAsConst(langs))
3167  {
3168  QString value = langMap.key(label);
3169  gc->addSelection(label, value, (value.toLower() == langCode));
3170  }
3171 
3172  gc->setHelpText(AppearanceSettings::tr("Your preferred language for the "
3173  "user interface."));
3174  return gc;
3175 }
3176 
3178 {
3179  widget->clearSelections();
3180  QString q = QString("ISO639Language%1").arg(i);
3181  QString lang = gCoreContext->GetSetting(q, "").toLower();
3182 
3183  if ((lang.isEmpty() || lang == "aar") &&
3184  !gCoreContext->GetSetting("Language", "").isEmpty())
3185  {
3186  lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
3187  }
3188 
3189  QMap<int,QString>::iterator it = iso639_key_to_english_name.begin();
3190  QMap<int,QString>::iterator ite = iso639_key_to_english_name.end();
3191 
3192  for (; it != ite; ++it)
3193  {
3194  QString desc = (*it);
3195  int idx = desc.indexOf(";");
3196  if (idx > 0)
3197  desc = desc.left(idx);
3198 
3199  const QString il = iso639_key_to_str3(it.key());
3200  widget->addSelection(desc, il, il == lang);
3201  }
3202 }
3203 
3205 {
3206  auto *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
3207 
3208  gc->setLabel(AppearanceSettings::tr("Guide language #%1").arg(i+1));
3209 
3210  // We should try to get language from "MythLanguage"
3211  // then use code 2 to code 3 map in iso639.h
3212  ISO639_fill_selections(gc, i);
3213 
3214  gc->setHelpText(AppearanceSettings::tr("Your #%1 preferred language for "
3215  "Program Guide data and captions.")
3216  .arg(i+1));
3217  return gc;
3218 }
3219 
3221 {
3222  auto *gc = new HostCheckBoxSetting("NetworkControlEnabled");
3223 
3224  gc->setLabel(MainGeneralSettings::tr("Enable Network Remote Control "
3225  "interface"));
3226 
3227  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3228  "controlling MythFrontend "
3229  "over the network."));
3230 
3231  gc->setValue(false);
3232 
3233  return gc;
3234 }
3235 
3237 {
3238  auto *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
3239 
3240  gs->setLabel(MainGeneralSettings::tr("Network Remote Control port"));
3241 
3242  gs->setValue(6546);
3243 
3244  gs->setHelpText(MainGeneralSettings::tr("This specifies what port the "
3245  "Network Remote Control "
3246  "interface will listen on for "
3247  "new connections."));
3248  return gs;
3249 }
3250 
3252 {
3253  auto *ge = new HostTextEditSetting("UDPNotifyPort");
3254 
3255  ge->setLabel(MainGeneralSettings::tr("UDP notify port"));
3256 
3257  ge->setValue("6948");
3258 
3259  ge->setHelpText(MainGeneralSettings::tr("MythTV will listen for "
3260  "connections from the "
3261  "\"mythutil\" program on "
3262  "this port."));
3263  return ge;
3264 }
3265 
3266 #ifdef USING_LIBCEC
3267 static HostCheckBoxSetting *CECEnabled()
3268 {
3269  auto *gc = new HostCheckBoxSetting("libCECEnabled");
3270  gc->setLabel(MainGeneralSettings::tr("Enable CEC Control "
3271  "interface"));
3272  gc->setHelpText(MainGeneralSettings::tr("This enables "
3273  "controlling MythFrontend from a TV remote or powering the TV "
3274  "on and off from a MythTV remote "
3275  "if you have compatible hardware. "
3276  "These settings only take effect after a restart."));
3277  gc->setValue(true);
3278  return gc;
3279 }
3280 
3281 static HostCheckBoxSetting *CECPowerOnTVAllowed()
3282 {
3283  auto *gc = new HostCheckBoxSetting("PowerOnTVAllowed");
3284  gc->setLabel(MainGeneralSettings::tr("Allow Power On TV"));
3285  gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3286  "on from MythTV remote or when MythTV starts "
3287  "if you have compatible hardware."));
3288  gc->setValue(true);
3289  return gc;
3290 }
3291 
3292 static HostCheckBoxSetting *CECPowerOffTVAllowed()
3293 {
3294  auto *gc = new HostCheckBoxSetting("PowerOffTVAllowed");
3295  gc->setLabel(MainGeneralSettings::tr("Allow Power Off TV"));
3296  gc->setHelpText(MainGeneralSettings::tr("Enables your TV to be powered "
3297  "off from MythTV remote or when MythTV starts "
3298  "if you have compatible hardware."));
3299  gc->setValue(true);
3300  return gc;
3301 }
3302 
3303 static HostCheckBoxSetting *CECPowerOnTVOnStart()
3304 {
3305  auto *gc = new HostCheckBoxSetting("PowerOnTVOnStart");
3306  gc->setLabel(MainGeneralSettings::tr("Power on TV At Start"));
3307  gc->setHelpText(MainGeneralSettings::tr("Powers "
3308  "on your TV when you start MythTV "
3309  "if you have compatible hardware."));
3310  gc->setValue(true);
3311  return gc;
3312 }
3313 
3314 static HostCheckBoxSetting *CECPowerOffTVOnExit()
3315 {
3316  auto *gc = new HostCheckBoxSetting("PowerOffTVOnExit");
3317  gc->setLabel(MainGeneralSettings::tr("Power off TV At Exit"));
3318  gc->setHelpText(MainGeneralSettings::tr("Powers "
3319  "off your TV when you exit MythTV "
3320  "if you have compatible hardware."));
3321  gc->setValue(true);
3322  return gc;
3323 }
3324 
3325 #endif //USING_LIBCEC
3326 
3327 #ifdef USING_AIRPLAY
3328 // AirPlay Settings
3329 static HostCheckBoxSetting *AirPlayEnabled()
3330 {
3331  auto *gc = new HostCheckBoxSetting("AirPlayEnabled");
3332 
3333  gc->setLabel(MainGeneralSettings::tr("Enable AirPlay"));
3334 
3335  gc->setHelpText(MainGeneralSettings::tr("AirPlay lets you wirelessly view "
3336  "content on your TV from your "
3337  "iPhone, iPad, iPod Touch, or "
3338  "iTunes on your computer."));
3339 
3340  gc->setValue(true);
3341 
3342  return gc;
3343 }
3344 
3345 static HostCheckBoxSetting *AirPlayAudioOnly()
3346 {
3347  auto *gc = new HostCheckBoxSetting("AirPlayAudioOnly");
3348 
3349  gc->setLabel(MainGeneralSettings::tr("Only support AirTunes (no video)"));
3350 
3351  gc->setHelpText(MainGeneralSettings::tr("Only stream audio from your "
3352  "iPhone, iPad, iPod Touch, or "
3353  "iTunes on your computer"));
3354 
3355  gc->setValue(false);
3356 
3357  return gc;
3358 }
3359 
3360 static HostCheckBoxSetting *AirPlayPasswordEnabled()
3361 {
3362  auto *gc = new HostCheckBoxSetting("AirPlayPasswordEnabled");
3363 
3364  gc->setLabel(MainGeneralSettings::tr("Require password"));
3365 
3366  gc->setValue(false);
3367 
3368  gc->setHelpText(MainGeneralSettings::tr("Require a password to use "
3369  "AirPlay. Your iPhone, iPad, iPod "
3370  "Touch, or iTunes on your computer "
3371  "will prompt you when required"));
3372  return gc;
3373 }
3374 
3375 static HostTextEditSetting *AirPlayPassword()
3376 {
3377  auto *ge = new HostTextEditSetting("AirPlayPassword");
3378 
3379  ge->setLabel(MainGeneralSettings::tr("Password"));
3380 
3381  ge->setValue("0000");
3382 
3383  ge->setHelpText(MainGeneralSettings::tr("Your iPhone, iPad, iPod Touch, or "
3384  "iTunes on your computer will "
3385  "prompt you for this password "
3386  "when required"));
3387  return ge;
3388 }
3389 
3390 static GroupSetting *AirPlayPasswordSettings()
3391 {
3392  auto *hc = new GroupSetting();
3393 
3394  hc->setLabel(MainGeneralSettings::tr("AirPlay - Password"));
3395  hc->addChild(AirPlayPasswordEnabled());
3396  hc->addChild(AirPlayPassword());
3397 
3398  return hc;
3399 }
3400 
3401 static HostCheckBoxSetting *AirPlayFullScreen()
3402 {
3403  auto *gc = new HostCheckBoxSetting("AirPlayFullScreen");
3404 
3405  gc->setLabel(MainGeneralSettings::tr("AirPlay full screen playback"));
3406 
3407  gc->setValue(false);
3408 
3409  gc->setHelpText(MainGeneralSettings::tr("During music playback, displays "
3410  "album cover and various media "
3411  "information in full screen mode"));
3412  return gc;
3413 }
3414 
3415 //static TransLabelSetting *AirPlayInfo()
3416 //{
3417 // TransLabelSetting *ts = new TransLabelSetting();
3418 //
3419 // ts->setValue(MainGeneralSettings::tr("All AirPlay settings take effect "
3420 // "when you restart MythFrontend."));
3421 // return ts;
3422 //}
3423 
3424 //static TransLabelSetting *AirPlayRSAInfo()
3425 //{
3426 // TransLabelSetting *ts = new TransLabelSetting();
3427 //
3428 // if (MythRAOPConnection::LoadKey() == nullptr)
3429 // {
3430 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key couldn't be "
3431 // "loaded. Check http://www.mythtv.org/wiki/AirTunes/AirPlay. "
3432 // "Last Error: %1")
3433 // .arg(MythRAOPConnection::RSALastError()));
3434 // }
3435 // else
3436 // {
3437 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key successfully "
3438 // "loaded."));
3439 // }
3440 //
3441 // return ts;
3442 //}
3443 #endif
3444 
3446 {
3447  auto *gc = new HostCheckBoxSetting("RealtimePriority");
3448 
3449  gc->setLabel(PlaybackSettings::tr("Enable realtime priority threads"));
3450 
3451  gc->setHelpText(PlaybackSettings::tr("When running mythfrontend with root "
3452  "privileges, some threads can be "
3453  "given enhanced priority. Disable "
3454  "this if MythFrontend freezes during "
3455  "video playback."));
3456  gc->setValue(true);
3457 
3458  return gc;
3459 }
3460 
3462 {
3463  auto *ge = new HostTextEditSetting("IgnoreDevices");
3464 
3465  ge->setLabel(MainGeneralSettings::tr("Ignore devices"));
3466 
3467  ge->setValue("");
3468 
3469  ge->setHelpText(MainGeneralSettings::tr("If there are any devices that you "
3470  "do not want to be monitored, list "
3471  "them here with commas in-between. "
3472  "The plugins will ignore them. "
3473  "Requires restart."));
3474  return ge;
3475 }
3476 
3478 {
3479  auto *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
3480 
3481  gc->setLabel(PlaybackSettings::tr("Sort titles"));
3482 
3483  gc->addSelection(PlaybackSettings::tr("Alphabetically"),
3484  QString::number(PlaybackBox::TitleSortAlphabetical));
3485  gc->addSelection(PlaybackSettings::tr("By recording priority"),
3486  QString::number(PlaybackBox::TitleSortRecPriority));
3487 
3488  gc->setHelpText(PlaybackSettings::tr("Sets the title sorting order when "
3489  "the view is set to Titles only."));
3490  return gc;
3491 }
3492 
3494 {
3495  auto *gc = new HostCheckBoxSetting("PlaybackWatchList");
3496 
3497  gc->setLabel(WatchListSettings::tr("Include the 'Watch List' group"));
3498 
3499  gc->setValue(true);
3500 
3501  gc->setHelpText(WatchListSettings::tr("The 'Watch List' is an abbreviated "
3502  "list of recordings sorted to "
3503  "highlight series and shows that "
3504  "need attention in order to keep up "
3505  "to date."));
3506  return gc;
3507 }
3508 
3510 {
3511  auto *gc = new HostCheckBoxSetting("PlaybackWLStart");
3512 
3513  gc->setLabel(WatchListSettings::tr("Start from the Watch List view"));
3514 
3515  gc->setValue(false);
3516 
3517  gc->setHelpText(WatchListSettings::tr("If enabled, the 'Watch List' will "
3518  "be the initial view each time you "
3519  "enter the Watch Recordings screen"));
3520  return gc;
3521 }
3522 
3524 {
3525  auto *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
3526 
3527  gc->setLabel(WatchListSettings::tr("Exclude recordings not set for "
3528  "Auto-Expire"));
3529 
3530  gc->setValue(false);
3531 
3532  gc->setHelpText(WatchListSettings::tr("Set this if you turn off "
3533  "Auto-Expire only for recordings "
3534  "that you've seen and intend to "
3535  "keep. This option will exclude "
3536  "these recordings from the "
3537  "'Watch List'."));
3538  return gc;
3539 }
3540 
3542 {
3543  auto *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
3544 
3545  gs->setLabel(WatchListSettings::tr("Maximum days counted in the score"));
3546 
3547  gs->setValue(60);
3548 
3549  gs->setHelpText(WatchListSettings::tr("The 'Watch List' scores are based "
3550  "on 1 point equals one day since "
3551  "recording. This option limits the "
3552  "maximum score due to age and "
3553  "affects other weighting factors."));
3554  return gs;
3555 }
3556 
3558 {
3559  auto *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
3560 
3561  gs->setLabel(WatchListSettings::tr("Days to exclude weekly episodes after "
3562  "delete"));
3563 
3564  gs->setValue(2);
3565 
3566  gs->setHelpText(WatchListSettings::tr("When an episode is deleted or "
3567  "marked as watched, other episodes "
3568  "of the series are excluded from the "
3569  "'Watch List' for this interval of "
3570  "time. Daily shows also have a "
3571  "smaller interval based on this "
3572  "setting."));
3573  return gs;
3574 }
3575 
3577 {
3578  auto *gc = new HostCheckBoxSetting("MonitorDrives");
3579 
3580  gc->setLabel(MainGeneralSettings::tr("Media Monitor"));
3581 
3582  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3583  "monitoring your CD/DVD drives for "
3584  "new disks and launching the "
3585  "proper plugin to handle them. "
3586  "Requires restart."));
3587 
3588  gc->setValue(false);
3589 
3590  gc->addTargetedChild("1", IgnoreMedia());
3591 
3592  return gc;
3593 }
3594 
3596 {
3597  auto *gc = new HostCheckBoxSetting("LCDShowTime");
3598 
3599  gc->setLabel(LcdSettings::tr("Display time"));
3600 
3601  gc->setHelpText(LcdSettings::tr("Display current time on idle LCD "
3602  "display."));
3603 
3604  gc->setValue(true);
3605 
3606  return gc;
3607 }
3608 
3610 {
3611  auto *gc = new HostCheckBoxSetting("LCDShowRecStatus");
3612 
3613  gc->setLabel(LcdSettings::tr("Display recording status"));
3614 
3615  gc->setHelpText(LcdSettings::tr("Display current recordings information "
3616  "on LCD display."));
3617 
3618  gc->setValue(false);
3619 
3620  return gc;
3621 }
3622 
3624 {
3625  auto *gc = new HostCheckBoxSetting("LCDShowMenu");
3626 
3627  gc->setLabel(LcdSettings::tr("Display menus"));
3628 
3629  gc->setHelpText(LcdSettings::tr("Display selected menu on LCD display. "));
3630 
3631  gc->setValue(true);
3632 
3633  return gc;
3634 }
3635 
3637 {
3638  auto *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, 1);
3639 
3640  gs->setLabel(LcdSettings::tr("Menu pop-up time"));
3641 
3642  gs->setHelpText(LcdSettings::tr("How many seconds the menu will remain "
3643  "visible after navigation."));
3644 
3645  gs->setValue(5);
3646 
3647  return gs;
3648 }
3649 
3651 {
3652  auto *gc = new HostCheckBoxSetting("LCDShowMusic");
3653 
3654  gc->setLabel(LcdSettings::tr("Display music artist and title"));
3655 
3656  gc->setHelpText(LcdSettings::tr("Display playing artist and song title in "
3657  "MythMusic on LCD display."));
3658 
3659  gc->setValue(true);
3660 
3661  return gc;
3662 }
3663 
3665 {
3666  auto *gc = new HostComboBoxSetting("LCDShowMusicItems");
3667 
3668  gc->setLabel(LcdSettings::tr("Items"));
3669 
3670  gc->addSelection(LcdSettings::tr("Artist - Title"), "ArtistTitle");
3671  gc->addSelection(LcdSettings::tr("Artist [Album] Title"),
3672  "ArtistAlbumTitle");
3673 
3674  gc->setHelpText(LcdSettings::tr("Which items to show when playing music."));
3675 
3676  return gc;
3677 }
3678 
3680 {
3681  auto *gc = new HostCheckBoxSetting("LCDShowChannel");
3682 
3683  gc->setLabel(LcdSettings::tr("Display channel information"));
3684 
3685  gc->setHelpText(LcdSettings::tr("Display tuned channel information on LCD "
3686  "display."));
3687 
3688  gc->setValue(true);
3689 
3690  return gc;
3691 }
3692 
3694 {
3695  auto *gc = new HostCheckBoxSetting("LCDShowVolume");
3696 
3697  gc->setLabel(LcdSettings::tr("Display volume information"));
3698 
3699  gc->setHelpText(LcdSettings::tr("Display volume level information "
3700  "on LCD display."));
3701 
3702  gc->setValue(true);
3703 
3704  return gc;
3705 }
3706 
3708 {
3709  auto *gc = new HostCheckBoxSetting("LCDShowGeneric");
3710 
3711  gc->setLabel(LcdSettings::tr("Display generic information"));
3712 
3713  gc->setHelpText(LcdSettings::tr("Display generic information on LCD display."));
3714 
3715  gc->setValue(true);
3716 
3717  return gc;
3718 }
3719 
3721 {
3722  auto *gc = new HostCheckBoxSetting("LCDBacklightOn");
3723 
3724  gc->setLabel(LcdSettings::tr("Backlight always on"));
3725 
3726  gc->setHelpText(LcdSettings::tr("Turn on the backlight permanently on the "
3727  "LCD display."));
3728  gc->setValue(true);
3729 
3730  return gc;
3731 }
3732 
3734 {
3735  auto *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
3736 
3737  gc->setLabel(LcdSettings::tr("Heartbeat always on"));
3738 
3739  gc->setHelpText(LcdSettings::tr("Turn on the LCD heartbeat."));
3740 
3741  gc->setValue(false);
3742 
3743  return gc;
3744 }
3745 
3747 {
3748  auto *gc = new HostCheckBoxSetting("LCDBigClock");
3749 
3750  gc->setLabel(LcdSettings::tr("Display large clock"));
3751 
3752  gc->setHelpText(LcdSettings::tr("On multiline displays try and display the "
3753  "time as large as possible."));
3754 
3755  gc->setValue(false);
3756 
3757  return gc;
3758 }
3759 
3761 {
3762  auto *ge = new HostTextEditSetting("LCDKeyString");
3763 
3764  ge->setLabel(LcdSettings::tr("LCD key order"));
3765 
3766  ge->setValue("ABCDEF");
3767 
3768  ge->setHelpText(
3769  LcdSettings::tr("Enter the 6 Keypad Return Codes for your LCD keypad "
3770  "in the order in which you want the functions "
3771  "up/down/left/right/yes/no to operate. (See "
3772  "lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
3773  "or the matrix for your display)"));
3774  return ge;
3775 }
3776 
3778 {
3779  auto *gc = new HostCheckBoxSetting("LCDEnable");
3780 
3781  gc->setLabel(LcdSettings::tr("Enable LCD device"));
3782 
3783  gc->setHelpText(LcdSettings::tr("Use an LCD display to view MythTV status "
3784  "information."));
3785 
3786  gc->setValue(false);
3787  gc->addTargetedChild("1", LCDShowTime());
3788  gc->addTargetedChild("1", LCDShowMenu());
3789  gc->addTargetedChild("1", LCDShowMusic());
3790  gc->addTargetedChild("1", LCDShowMusicItems());
3791  gc->addTargetedChild("1", LCDShowChannel());
3792  gc->addTargetedChild("1", LCDShowRecStatus());
3793  gc->addTargetedChild("1", LCDShowVolume());
3794  gc->addTargetedChild("1", LCDShowGeneric());
3795  gc->addTargetedChild("1", LCDBacklightOn());
3796  gc->addTargetedChild("1", LCDHeartBeatOn());
3797  gc->addTargetedChild("1", LCDBigClock());
3798  gc->addTargetedChild("1", LCDKeyString());
3799  gc->addTargetedChild("1", LCDPopupTime());
3800  return gc;
3801 }
3802 
3803 
3804 #ifdef Q_OS_DARWIN
3805 static HostCheckBoxSetting *MacGammaCorrect()
3806 {
3807  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
3808 
3809  gc->setLabel(PlaybackSettings::tr("Enable gamma correction for video"));
3810 
3811  gc->setValue(false);
3812 
3813  gc->setHelpText(PlaybackSettings::tr("If enabled, QuickTime will correct "
3814  "the gamma of the video to match "
3815  "your monitor. Turning this off can "
3816  "save some CPU cycles."));
3817  return gc;
3818 }
3819 
3820 static HostCheckBoxSetting *MacScaleUp()
3821 {
3822  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
3823 
3824  gc->setLabel(PlaybackSettings::tr("Scale video as necessary"));
3825 
3826  gc->setValue(true);
3827 
3828  gc->setHelpText(PlaybackSettings::tr("If enabled, video will be scaled to "
3829  "fit your window or screen. If "
3830  "unchecked, video will never be made "
3831  "larger than its actual pixel size."));
3832  return gc;
3833 }
3834 
3835 static HostSpinBoxSetting *MacFullSkip()
3836 {
3837  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
3838 
3839  gs->setLabel(PlaybackSettings::tr("Frames to skip in fullscreen mode"));
3840 
3841  gs->setValue(0);
3842 
3843  gs->setHelpText(PlaybackSettings::tr("Video displayed in fullscreen or "
3844  "non-windowed mode will skip this "
3845  "many frames for each frame drawn. "
3846  "Set to 0 to show every frame. Only "
3847  "valid when either \"Use GUI size for "
3848  "TV playback\" or \"Run the frontend "
3849  "in a window\" is not checked."));
3850  return gs;
3851 }
3852 
3853 static HostCheckBoxSetting *MacMainEnabled()
3854 {
3855  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
3856 
3857  gc->setLabel(MacMainSettings::tr("Video in main window"));
3858 
3859  gc->setValue(true);
3860 
3861  gc->setHelpText(MacMainSettings::tr("If enabled, video will be displayed "
3862  "in the main GUI window. Disable this "
3863  "when you only want video on the "
3864  "desktop or in a floating window. Only "
3865  "valid when \"Use GUI size for TV "
3866  "playback\" and \"Run the frontend in "
3867  "a window\" are checked."));
3868  return gc;
3869 }
3870 
3871 static HostSpinBoxSetting *MacMainSkip()
3872 {
3873  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
3874 
3875  gs->setLabel(MacMainSettings::tr("Frames to skip"));
3876 
3877  gs->setValue(0);
3878 
3879  gs->setHelpText(MacMainSettings::tr("Video in the main window will skip "
3880  "this many frames for each frame "
3881  "drawn. Set to 0 to show every "
3882  "frame."));
3883  return gs;
3884 }
3885 
3886 static HostSpinBoxSetting *MacMainOpacity()
3887 {
3888  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
3889 
3890  gs->setLabel(MacMainSettings::tr("Opacity"));
3891 
3892  gs->setValue(100);
3893 
3894  gs->setHelpText(MacMainSettings::tr("The opacity of the main window. Set "
3895  "to 100 for completely opaque, set "
3896  "to 0 for completely transparent."));
3897  return gs;
3898 }
3899 
3900 static HostCheckBoxSetting *MacFloatEnabled()
3901 {
3902  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
3903 
3904  gc->setLabel(MacFloatSettings::tr("Video in floating window"));
3905 
3906  gc->setValue(false);
3907 
3908  gc->setHelpText(MacFloatSettings::tr("If enabled, video will be displayed "
3909  "in a floating window. Only valid "
3910  "when \"Use GUI size for TV "
3911  "playback\" and \"Run the frontend "
3912  "in a window\" are checked."));
3913  return gc;
3914 }
3915 
3916 static HostSpinBoxSetting *MacFloatSkip()
3917 {
3918  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
3919 
3920  gs->setLabel(MacFloatSettings::tr("Frames to skip"));
3921 
3922  gs->setValue(0);
3923 
3924  gs->setHelpText(MacFloatSettings::tr("Video in the floating window will "
3925  "skip this many frames for each "
3926  "frame drawn. Set to 0 to show "
3927  "every frame."));
3928  return gs;
3929 }
3930 
3931 static HostSpinBoxSetting *MacFloatOpacity()
3932 {
3933  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
3934 
3935  gs->setLabel(MacFloatSettings::tr("Opacity"));
3936 
3937  gs->setValue(100);
3938 
3939  gs->setHelpText(MacFloatSettings::tr("The opacity of the floating window. "
3940  "Set to 100 for completely opaque, "
3941  "set to 0 for completely "
3942  "transparent."));
3943  return gs;
3944 }
3945 
3946 static HostCheckBoxSetting *MacDockEnabled()
3947 {
3948  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
3949 
3950  gc->setLabel(MacDockSettings::tr("Video in the dock"));
3951 
3952  gc->setValue(true);
3953 
3954  gc->setHelpText(MacDockSettings::tr("If enabled, video will be displayed "
3955  "in the application's dock icon. Only "
3956  "valid when \"Use GUI size for TV "
3957  "playback\" and \"Run the frontend in "
3958  "a window\" are checked."));
3959  return gc;
3960 }
3961 
3962 static HostSpinBoxSetting *MacDockSkip()
3963 {
3964  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
3965 
3966  gs->setLabel(MacDockSettings::tr("Frames to skip"));
3967 
3968  gs->setValue(3);
3969 
3970  gs->setHelpText(MacDockSettings::tr("Video in the dock icon will skip this "
3971  "many frames for each frame drawn. Set "
3972  "to 0 to show every frame."));
3973  return gs;
3974 }
3975 
3976 static HostCheckBoxSetting *MacDesktopEnabled()
3977 {
3978  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
3979 
3980  gc->setLabel(MacDesktopSettings::tr("Video on the desktop"));
3981 
3982  gc->setValue(false);
3983 
3984  gc->setHelpText(MacDesktopSettings::tr("If enabled, video will be "
3985  "displayed on the desktop, "
3986  "behind the Finder icons. "
3987  "Only valid when \"Use GUI "
3988  "size for TV playback\" and "
3989  "\"Run the frontend in a "
3990  "window\" are checked."));
3991  return gc;
3992 }
3993 
3994 static HostSpinBoxSetting *MacDesktopSkip()
3995 {
3996  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
3997 
3998  gs->setLabel(MacDesktopSettings::tr("Frames to skip"));
3999 
4000  gs->setValue(0);
4001 
4002  gs->setHelpText(MacDesktopSettings::tr("Video on the desktop will skip "
4003  "this many frames for each frame "
4004  "drawn. Set to 0 to show every "
4005  "frame."));
4006  return gs;
4007 }
4008 #endif
4009 
4010 
4012 {
4013  public:
4015 
4016  private slots:
4017  void childChanged(StandardSetting* /*unused*/) override;
4018 
4019  private:
4025 };
4026 
4028 {
4029  setLabel(MainGeneralSettings::tr("Shutdown/Reboot Settings"));
4030  auto *power = MythPower::AcquireRelease(this, true);
4033 #ifndef Q_OS_ANDROID
4037 #endif
4039  if (power)
4040  MythPower::AcquireRelease(this, false);
4041  connect(m_overrideExitMenu, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4043 }
4044 
4046 {
4048  return;
4049 
4050  bool confirmold = m_confirmCommand->isVisible();
4051  bool haltold = m_haltCommand->isVisible();
4052  bool rebootold = m_rebootCommand->isVisible();
4053  bool suspendold = m_suspendCommand->isVisible();
4054 
4055  switch (m_overrideExitMenu->getValue().toInt())
4056  {
4057  case 2:
4058  case 4:
4059  m_haltCommand->setVisible(true);
4060  m_rebootCommand->setVisible(false);
4061  m_suspendCommand->setVisible(false);
4063  break;
4064  case 3:
4065  case 6:
4066  m_haltCommand->setVisible(true);
4067  m_rebootCommand->setVisible(true);
4068  m_suspendCommand->setVisible(false);
4070  break;
4071  case 5:
4072  m_haltCommand->setVisible(false);
4073  m_rebootCommand->setVisible(true);
4074  m_suspendCommand->setVisible(false);
4076  break;
4077  case 8:
4078  case 9:
4079  m_haltCommand->setVisible(false);
4080  m_rebootCommand->setVisible(false);
4083  break;
4084  case 10:
4085  m_haltCommand->setVisible(true);
4086  m_rebootCommand->setVisible(true);
4089  break;
4090  case 0:
4091  case 1:
4092  default:
4093  m_haltCommand->setVisible(false);
4094  m_rebootCommand->setVisible(false);
4095  m_suspendCommand->setVisible(false);
4096  m_confirmCommand->setVisible(false);
4097  break;
4098  }
4099 
4100  if (confirmold != m_confirmCommand->isVisible() ||
4101  haltold != m_haltCommand->isVisible() ||
4102  rebootold != m_rebootCommand->isVisible() ||
4103  suspendold != m_suspendCommand->isVisible())
4104  {
4105  emit settingsChanged();
4106  }
4107 }
4108 
4110 {
4111 // DatabaseSettings::addDatabaseSettings(this);
4112  setLabel(tr("Main Settings"));
4113 
4114  addChild(new DatabaseSettings());
4115 
4116  auto *pin = new GroupSetting();
4117  pin->setLabel(tr("Settings Access"));
4118  pin->addChild(SetupPinCode());
4119  addChild(pin);
4120 
4121  auto *general = new GroupSetting();
4122  general->setLabel(tr("General"));
4123  general->addChild(UseVirtualKeyboard());
4124  general->addChild(ScreenShotPath());
4125 
4126  auto sh = getMythSortHelper();
4127  if (sh->hasPrefixes()) {
4128 #if 0
4129  // Last minute change. QStringRef::localeAwareCompare appears to
4130  // always do case insensitive sorting, so there's no point in
4131  // presenting this option to a user.
4132  general->addChild(SortCaseSensitive());
4133 #endif
4134  auto *stripPrefixes = SortStripPrefixes();
4135  general->addChild(stripPrefixes);
4136  stripPrefixes->addTargetedChild("1", SortPrefixExceptions());
4137  }
4138  general->addChild(ManualRecordStartChanType());
4139  addChild(general);
4140 
4142 
4144 
4145  auto *remotecontrol = new GroupSetting();
4146  remotecontrol->setLabel(tr("Remote Control"));
4147  remotecontrol->addChild(LircDaemonDevice());
4148  remotecontrol->addChild(NetworkControlEnabled());
4149  remotecontrol->addChild(NetworkControlPort());
4150  remotecontrol->addChild(UDPNotifyPort());
4151 #ifdef USING_LIBCEC
4152  HostCheckBoxSetting *cec = CECEnabled();
4153  remotecontrol->addChild(cec);
4154  m_cecPowerOnTVAllowed = CECPowerOnTVAllowed();
4155  m_cecPowerOffTVAllowed = CECPowerOffTVAllowed();
4156  m_cecPowerOnTVOnStart = CECPowerOnTVOnStart();
4157  m_cecPowerOffTVOnExit = CECPowerOffTVOnExit();
4158  cec->addTargetedChild("1",m_cecPowerOnTVAllowed);
4159  cec->addTargetedChild("1",m_cecPowerOffTVAllowed);
4160  cec->addTargetedChild("1",m_cecPowerOnTVOnStart);
4161  cec->addTargetedChild("1",m_cecPowerOffTVOnExit);
4162  connect(m_cecPowerOnTVAllowed, &MythUICheckBoxSetting::valueChanged,
4163  this, &MainGeneralSettings::cecChanged);
4164  connect(m_cecPowerOffTVAllowed, &MythUICheckBoxSetting::valueChanged,
4165  this, &MainGeneralSettings::cecChanged);
4166 #endif // USING_LIBCEC
4167  addChild(remotecontrol);
4168 
4169 #ifdef USING_AIRPLAY
4170  auto *airplay = new GroupSetting();
4171  airplay->setLabel(tr("AirPlay Settings"));
4172  airplay->addChild(AirPlayEnabled());
4173  airplay->addChild(AirPlayFullScreen());
4174  airplay->addChild(AirPlayAudioOnly());
4175  airplay->addChild(AirPlayPasswordSettings());
4176 // airplay->addChild(AirPlayInfo());
4177 // airplay->addChild(AirPlayRSAInfo());
4178  addChild(airplay);
4179 #endif
4180 }
4181 
4182 #ifdef USING_LIBCEC
4183 void MainGeneralSettings::cecChanged(bool /*setting*/)
4184 {
4185  if (m_cecPowerOnTVAllowed->boolValue())
4186  m_cecPowerOnTVOnStart->setEnabled(true);
4187  else
4188  {
4189  m_cecPowerOnTVOnStart->setEnabled(false);
4190  m_cecPowerOnTVOnStart->setValue(false);
4191  }
4192 
4193  if (m_cecPowerOffTVAllowed->boolValue())
4194  m_cecPowerOffTVOnExit->setEnabled(true);
4195  else
4196  {
4197  m_cecPowerOffTVOnExit->setEnabled(false);
4198  m_cecPowerOffTVOnExit->setValue(false);
4199  }
4200 }
4201 #endif // USING_LIBCEC
4202 
4204 {
4205  QStringList strlist( QString("REFRESH_BACKEND") );
4207  LOG(VB_GENERAL, LOG_ERR, QString("%1 called").arg(__FUNCTION__));
4209 }
4210 
4211 
4213 {
4214  public:
4215  PlayBackScaling();
4216  void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4217 
4218  private slots:
4219  void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4220 
4221  private:
4226 };
4227 
4229 {
4230  setLabel(PlaybackSettings::tr("Scaling"));
4235  connect(m_vertScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4237  connect(m_yScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4239  connect(m_horizScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4241  connect(m_xScan, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4243 }
4244 
4245 
4247 {
4249  if (m_vertScan->getValue() == "0" &&
4250  m_horizScan->getValue() == "0" &&
4251  m_yScan->getValue() == "0" &&
4252  m_xScan->getValue() == "0")
4253  {
4254  item->SetText(PlaybackSettings::tr("No scaling"), "value");
4255  }
4256  else
4257  {
4258  item->SetText(QString("%1%x%2%+%3%+%4%")
4259  .arg(m_horizScan->getValue(),
4260  m_vertScan->getValue(),
4261  m_xScan->getValue(),
4262  m_yScan->getValue()),
4263  "value");
4264  }
4265 }
4266 
4268 {
4269  emit ShouldRedraw(this);
4270 }
4271 
4273  : StandardSettingDialog(stack, "playbacksettings", new PlaybackSettings())
4274 {
4275 }
4276 
4278 {
4280  if (item)
4281  {
4282  auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4283  if (config)
4285  }
4286 }
4287 
4288 
4290 {
4291  auto *menu = new MythMenu(tr("Playback Profile Menu"), this, "mainmenu");
4292 
4293  if (m_buttonList->GetItemPos(item) > 2)
4294  menu->AddItem(tr("Move Up"), &PlaybackSettingsDialog::MoveProfileItemUp);
4295  if (m_buttonList->GetItemPos(item) + 1 < m_buttonList->GetCount())
4296  menu->AddItem(tr("Move Down"), &PlaybackSettingsDialog::MoveProfileItemDown);
4297 
4298  menu->AddItem(tr("Delete"), &PlaybackSettingsDialog::DeleteProfileItem);
4299 
4300  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
4301 
4302  auto *menuPopup = new MythDialogBox(menu, popupStack, "menudialog");
4303  menuPopup->SetReturnEvent(this, "mainmenu");
4304 
4305  if (menuPopup->Create())
4306  popupStack->AddScreen(menuPopup);
4307  else
4308  delete menuPopup;
4309 }
4310 
4312 {
4314  if (item)
4315  {
4316  auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4317  if (config)
4318  {
4319  const int currentPos = m_buttonList->GetCurrentPos();
4320 
4321  config->DecreasePriority();
4322 
4323  m_buttonList->SetItemCurrent(currentPos + 1);
4324  }
4325  }
4326 }
4327 
4329 {
4331  if (item)
4332  {
4333  auto *config = item->GetData().value<PlaybackProfileItemConfig*>();
4334  if (config)
4335  {
4336  const int currentPos = m_buttonList->GetCurrentPos();
4337 
4338  config->IncreasePriority();
4339 
4340  m_buttonList->SetItemCurrent(currentPos - 1);
4341  }
4342  }
4343 }
4344 
4346 {
4347  auto *config = m_buttonList->GetDataValue().value<PlaybackProfileItemConfig*>();
4348  if (config)
4349  config->ShowDeleteDialog();
4350 }
4351 
4353 {
4354  setLabel(tr("Playback settings"));
4355 }
4356 
4358 {
4359  auto *general = new GroupSetting();
4360  general->setLabel(tr("General Playback"));
4361  general->addChild(JumpToProgramOSD());
4362  general->addChild(UseProgStartMark());
4363  general->addChild(AutomaticSetWatched());
4364  general->addChild(ContinueEmbeddedTVPlay());
4365  general->addChild(LiveTVIdleTimeout());
4366 
4367  general->addChild(FFmpegDemuxer());
4368 
4369  general->addChild(new PlayBackScaling());
4370  general->addChild(StereoDiscard());
4371  general->addChild(AspectOverride());
4372  general->addChild(AdjustFill());
4373 
4374  general->addChild(LetterboxingColour());
4375  general->addChild(PlaybackExitPrompt());
4376  general->addChild(EndOfRecordingExitPrompt());
4377  general->addChild(MusicChoiceEnabled());
4378  addChild(general);
4379 
4380  auto *advanced = new GroupSetting();
4381  advanced->setLabel(tr("Advanced Playback Settings"));
4382  advanced->addChild(RealtimePriority());
4383  advanced->addChild(AudioReadAhead());
4384  advanced->addChild(ColourPrimaries());
4385  advanced->addChild(ChromaUpsampling());
4386 #ifdef USING_VAAPI
4387  advanced->addChild(VAAPIDevice());
4388 #endif
4389 
4390  addChild(advanced);
4391 
4394 
4396  new ButtonStandardSetting(tr("Add a new playback profile"));
4400 
4401  auto *pbox = new GroupSetting();
4402  pbox->setLabel(tr("View Recordings"));
4403  pbox->addChild(PlayBoxOrdering());
4404  pbox->addChild(PlayBoxEpisodeSort());
4405  // Disabled until we re-enable live previews
4406  // pbox->addChild(PlaybackPreview());
4407  // pbox->addChild(HWAccelPlaybackPreview());
4408  pbox->addChild(PBBStartInTitle());
4409 
4410  auto *pbox2 = new GroupSetting();
4411  pbox2->setLabel(tr("Recording Groups"));
4412  pbox2->addChild(DisplayRecGroup());
4413  pbox2->addChild(QueryInitialFilter());
4414  pbox2->addChild(RememberRecGroup());
4415  pbox2->addChild(RecGroupMod());
4416 
4417  pbox->addChild(pbox2);
4418 
4419  pbox->addChild(DisplayGroupTitleSort());
4420 
4421  StandardSetting *playbackWatchList = PlaybackWatchList();
4422  playbackWatchList->addTargetedChild("1", PlaybackWLStart());
4423  playbackWatchList->addTargetedChild("1", PlaybackWLAutoExpire());
4424  playbackWatchList->addTargetedChild("1", PlaybackWLMaxAge());
4425  playbackWatchList->addTargetedChild("1", PlaybackWLBlackOut());
4426  pbox->addChild(playbackWatchList);
4427  addChild(pbox);
4428 
4429  auto *seek = new GroupSetting();
4430  seek->setLabel(tr("Seeking"));
4431  seek->addChild(SmartForward());
4432  seek->addChild(FFRewReposTime());
4433  seek->addChild(FFRewReverse());
4434 
4435  addChild(seek);
4436 
4437  auto *comms = new GroupSetting();
4438  comms->setLabel(tr("Commercial Skip"));
4439  comms->addChild(AutoCommercialSkip());
4440  comms->addChild(CommRewindAmount());
4441  comms->addChild(CommNotifyAmount());
4442  comms->addChild(MaximumCommercialSkip());
4443  comms->addChild(MergeShortCommBreaks());
4444 
4445  addChild(comms);
4446 
4447 #ifdef Q_OS_DARWIN
4448  GroupSetting* mac = new GroupSetting();
4449  mac->setLabel(tr("Mac OS X Video Settings"));
4450  mac->addChild(MacGammaCorrect());
4451  mac->addChild(MacScaleUp());
4452  mac->addChild(MacFullSkip());
4453 
4454  StandardSetting *floatEnabled = MacFloatEnabled();
4455  floatEnabled->addTargetedChild("1", MacFloatSkip());
4456  floatEnabled->addTargetedChild("1", MacFloatOpacity());
4457  mac->addChild(floatEnabled);
4458 
4459  StandardSetting *macMainEnabled = MacMainEnabled();
4460  macMainEnabled->addTargetedChild("1", MacMainSkip());
4461  macMainEnabled->addTargetedChild("1", MacMainOpacity());
4462  mac->addChild(macMainEnabled);
4463 
4464  StandardSetting *dockEnabled = MacDockEnabled();
4465  dockEnabled->addTargetedChild("1", MacDockSkip());
4466  mac->addChild(dockEnabled);
4467 
4468  StandardSetting* desktopEnabled = MacDesktopEnabled();
4469  desktopEnabled->addTargetedChild("1", MacDesktopSkip());
4470  mac->addChild(desktopEnabled);
4471 
4472  addChild(mac);
4473 #endif
4474 
4476 }
4477 
4479 {
4480  setLabel(tr("On-screen Display"));
4481 
4482  addChild(EnableMHEG());
4484  addChild(Visualiser());
4489 
4490  //GroupSetting *cc = new GroupSetting();
4491  //cc->setLabel(tr("Closed Captions"));
4492  //cc->addChild(DecodeVBIFormat());
4493  //addChild(cc);
4494 
4495 #ifdef Q_OS_MACOS
4496  // Any Mac OS-specific OSD stuff would go here.
4497 #endif
4498 }
4499 
4501 {
4502  setLabel(tr("General (Basic)"));
4503  auto *general = new GroupSetting();
4504  general->setLabel(tr("General (Basic)"));
4505  general->addChild(ChannelOrdering());
4506  general->addChild(ChannelFormat());
4507  general->addChild(LongChannelFormat());
4508 
4509  addChild(general);
4510 
4511  auto *autoexp = new GroupSetting();
4512 
4513  autoexp->setLabel(tr("General (Auto-Expire)"));
4514 
4515  autoexp->addChild(AutoExpireMethod());
4516 
4517  autoexp->addChild(RerecordWatched());
4518  autoexp->addChild(AutoExpireWatchedPriority());
4519 
4520  autoexp->addChild(AutoExpireLiveTVMaxAge());
4521  autoexp->addChild(AutoExpireDayPriority());
4522  autoexp->addChild(AutoExpireExtraSpace());
4523 
4524 // autoexp->addChild(new DeletedExpireOptions());
4525  autoexp->addChild(DeletedMaxAge());
4526 
4527  addChild(autoexp);
4528 
4529  auto *jobs = new GroupSetting();
4530 
4531  jobs->setLabel(tr("General (Jobs)"));
4532 
4533  jobs->addChild(CommercialSkipMethod());
4534  jobs->addChild(CommFlagFast());
4535  jobs->addChild(AggressiveCommDetect());
4536  jobs->addChild(DeferAutoTranscodeDays());
4537 
4538  addChild(jobs);
4539 
4540  auto *general2 = new GroupSetting();
4541 
4542  general2->setLabel(tr("General (Advanced)"));
4543 
4544  general2->addChild(RecordPreRoll());
4545  general2->addChild(RecordOverTime());
4546  general2->addChild(MaxStartGap());
4547  general2->addChild(MaxEndGap());
4548  general2->addChild(MinimumRecordingQuality());
4549  general2->addChild(CategoryOverTimeSettings());
4550  addChild(general2);
4551 
4552  auto *changrp = new GroupSetting();
4553 
4554  changrp->setLabel(tr("General (Channel Groups)"));
4555 
4556  changrp->addChild(ChannelGroupRememberLast());
4557  changrp->addChild(ChannelGroupDefault());
4558  changrp->addChild(BrowseChannelGroup());
4559 
4560  addChild(changrp);
4561 }
4562 
4564 {
4565  setLabel(tr("Program Guide"));
4566 
4569 }
4570 
4572 {
4573  auto *sched = new GroupSetting();
4574 
4575  sched->setLabel(tr("Scheduler Options"));
4576 
4577  sched->addChild(GRSchedOpenEnd());
4578  sched->addChild(GRPrefInputRecPriority());
4579  sched->addChild(GRHDTVRecPriority());
4580  sched->addChild(GRWSRecPriority());
4581 
4582  addChild(sched);
4583 
4584  auto *access = new GroupSetting();
4585 
4586  access->setLabel(tr("Accessibility Options"));
4587 
4588  access->addChild(GRSignLangRecPriority());
4589  access->addChild(GROnScrSubRecPriority());
4590  access->addChild(GRCCRecPriority());
4591  access->addChild(GRHardHearRecPriority());
4592  access->addChild(GRAudioDescRecPriority());
4593 
4594  addChild(access);
4595 }
4596 
4598 {
4599  public:
4600  GuiDimension();
4601  //QString getValue() override; // StandardSetting
4602  void updateButton(MythUIButtonListItem *item) override; // GroupSetting
4603 
4604  private slots:
4605  void childChanged(StandardSetting * /*setting*/) override; // StandardSetting
4606  private:
4611 };
4612 
4614 {
4615  setLabel(AppearanceSettings::tr("GUI dimension"));
4616  addChild(m_width = GuiWidth());
4620  connect(m_width, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4622  connect(m_height, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4624  connect(m_offsetX, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4626  connect(m_offsetY, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4628 }
4629 
4631 {
4633  if ((m_width->getValue() == "0" ||
4634  m_height->getValue() == "0") &&
4635  m_offsetX->getValue() == "0" &&
4636  m_offsetY->getValue() == "0")
4637  {
4638  item->SetText(AppearanceSettings::tr("Fullscreen"), "value");
4639  }
4640  else
4641  {
4642  item->SetText(QString("%1x%2+%3+%4")
4643  .arg(m_width->getValue(),
4644  m_height->getValue(),
4645  m_offsetX->getValue(),
4646  m_offsetY->getValue()),
4647  "value");
4648  }
4649 }
4650 
4652 {
4653  emit ShouldRedraw(this);
4654 }
4655 
4657 {
4658  QCoreApplication::processEvents();
4659  GetMythMainWindow()->JumpTo("Reload Theme");
4660 }
4661 
4663 {
4665  QList screens = QGuiApplication::screens();
4666  for (QScreen *qscreen : qAsConst(screens))
4667  {
4668  QString extra = MythDisplay::GetExtraScreenInfo(qscreen);
4669  m_screen->addSelection(qscreen->name() + extra, qscreen->name());
4670  }
4671  if (Screens > 1)
4672  m_screen->addSelection(AppearanceSettings::tr("All"), QString::number(-1));
4673 }
4674 
4676 {
4677  auto *screen = new GroupSetting();
4678  screen->setLabel(tr("Theme / Screen Settings"));
4679  addChild(screen);
4680 
4681  AddPaintEngine(screen);
4682  screen->addChild(MenuTheme());
4683  screen->addChild(GUIRGBLevels());
4684 
4688  screen->addChild(m_screen);
4689  screen->addChild(m_screenAspect);
4692 
4693  screen->addChild(new GuiDimension());
4694 
4695  screen->addChild(GuiSizeForTV());
4696  screen->addChild(HideMouseCursor());
4698  {
4699  screen->addChild(RunInWindow());
4700  screen->addChild(AlwaysOnTop());
4701  }
4702  screen->addChild(StartupScreenDelay());
4703  screen->addChild(GUIFontZoom());
4704 #ifdef USING_AIRPLAY
4705  screen->addChild(AirPlayFullScreen());
4706 #endif
4707 
4708  MythDisplay* display = GetMythMainWindow()->GetDisplay();
4709  if (display->VideoModesAvailable())
4710  {
4711  std::vector<MythDisplayMode> scr = display->GetVideoModes();
4712  if (!scr.empty())
4714  }
4715 
4716  auto *dates = new GroupSetting();
4717 
4718  dates->setLabel(tr("Localization"));
4719 
4720  dates->addChild(MythLanguage());
4721  dates->addChild(ISO639PreferredLanguage(0));
4722  dates->addChild(ISO639PreferredLanguage(1));
4723  dates->addChild(MythDateFormatCB());
4724  dates->addChild(MythShortDateFormat());
4725  dates->addChild(MythTimeFormat());
4726 
4727  addChild(dates);
4728 
4729  addChild(LCDEnable());
4730 }
4731 
4732 /*******************************************************************************
4733 * Channel Groups *
4734 *******************************************************************************/
4735 
4737 {
4738  auto *gc = new HostComboBoxSetting("Select from Channel Group");
4739  gc->setLabel(AppearanceSettings::tr("Select from Channel Group"));
4740  gc->addSelection("All Channels");
4741 
4742  // All automatic channel groups that have at least one channel
4743  auto list = ChannelGroup::GetAutomaticChannelGroups(false);
4744  for (const auto &chgrp : list)
4745  {
4746  gc->addSelection(chgrp.m_name);
4747  }
4748  gc->setHelpText(AppearanceSettings::tr(
4749  "Select the channel group to select channels from. "
4750  "\"All Channels\" lets you choose from all channels of all video sources. "
4751  "\"Priority\" lets you choose from all channels that have recording priority. "
4752  "The other values let you select a video source to choose channels from."));
4753  return gc;
4754 }
4755 
4757 {
4758  public:
4760  const QString &channum, const QString &name);
4761  uint getChannelId() const{return m_channelId;};
4762  private:
4763  uint m_channelId;
4764 
4765 };
4766 
4768  const QString &channum, const QString &channame)
4769  : m_channelId(chanid)
4770 {
4771  setLabel(QString("%1 %2").arg(channum, channame));
4772  setHelpText(ChannelGroupSettings::tr("Select/Unselect channels for this channel group"));
4773 }
4774 
4776  int groupId = -1)
4777  : m_groupId(groupId)
4778 {
4779  setLabel(groupName == "Favorites" ? tr("Favorites") : groupName);
4780  setValue(groupName);
4782  m_groupName->setLabel(groupName);
4783 }
4784 
4786 {
4787  //Change the name
4788  if ((m_groupName && m_groupName->haveChanged())
4789  || m_groupId == -1)
4790  {
4791  if (m_groupId == -1)//create a new group
4792  {
4793  MSqlQuery query(MSqlQuery::InitCon());
4794  QString newname = m_groupName ? m_groupName->getValue() : "undefined";
4795  QString qstr =
4796  "INSERT INTO channelgroupnames (name) VALUE (:NEWNAME);";
4797  query.prepare(qstr);
4798  query.bindValue(":NEWNAME", newname);
4799 
4800  if (!query.exec())
4801  MythDB::DBError("ChannelGroupSetting::Save 1", query);
4802  else
4803  {
4804  //update m_groupId
4805  QString qstr2 = "SELECT grpid FROM channelgroupnames "
4806  "WHERE name = :NEWNAME;";
4807  query.prepare(qstr2);
4808  query.bindValue(":NEWNAME", newname);
4809  if (!query.exec())
4810  MythDB::DBError("ChannelGroupSetting::Save 2", query);
4811  else
4812  if (query.next())
4813  m_groupId = query.value(0).toUInt();
4814  }
4815  }
4816  else
4817  {
4818  MSqlQuery query(MSqlQuery::InitCon());
4819  QString qstr = "UPDATE channelgroupnames set name = :NEWNAME "
4820  " WHERE name = :OLDNAME ;";
4821  query.prepare(qstr);
4822  query.bindValue(":NEWNAME", m_groupName->getValue());
4823  query.bindValue(":OLDNAME", getValue());
4824 
4825  if (!query.exec())
4826  MythDB::DBError("ChannelGroupSetting::Save 3", query);
4827  else
4828  if (query.next())
4829  m_groupId = query.value(0).toUInt();
4830  }
4831  }
4832 
4833  if (m_groupId == -1)
4834  return;
4835 
4836  QList<StandardSetting *> *children = getSubSettings();
4837  if (!children)
4838  return;
4839 
4840  QList<StandardSetting *>::const_iterator i;
4841  for (i = children->constBegin(); i != children->constEnd(); ++i)
4842  {
4843  if ((*i)->haveChanged())
4844  {
4845  if ((*i) != m_groupName)
4846  {
4847  auto *channel = dynamic_cast<ChannelCheckBoxSetting *>(*i);
4848  if (channel)
4849  {
4850  if (channel->boolValue())
4851  {
4852  ChannelGroup::AddChannel(channel->getChannelId(),
4853  m_groupId);
4854  }
4855  else
4856  {
4857  ChannelGroup::DeleteChannel(channel->getChannelId(),
4858  m_groupId);
4859  }
4860  }
4861  }
4862  }
4863  }
4864 }
4865 
4867 {
4868  if (VERBOSE_LEVEL_CHECK(VB_GENERAL, LOG_DEBUG))
4869  {
4870  QString group = m_groupSelection->getValue();
4871  int groupId = ChannelGroup::GetChannelGroupId(group);
4872  LOG(VB_GENERAL, LOG_INFO,
4873  QString("ChannelGroupSetting::LoadChannelGroup group:%1 groupId:%2")
4874  .arg(group).arg(groupId));
4875  }
4876 
4877  // Set the old checkboxes from the previously selected channel group invisible
4878  for (const auto &it : m_boxMap)
4879  {
4880  it.second->setVisible(false);
4881  }
4882 
4883  // And load the new collection
4885 
4886  // Using m_groupSelection instead of nullptr keeps the focus in the "Select from Channel Group" box
4888 }
4889 
4891 {
4892  QString fromGroup = m_groupSelection->getValue();
4893  int fromGroupId = ChannelGroup::GetChannelGroupId(fromGroup);
4894 
4895  MSqlQuery query(MSqlQuery::InitCon());
4896 
4897  if (fromGroupId == -1) // All Channels
4898  {
4899  query.prepare(
4900  "SELECT channel.chanid, channum, name, grpid FROM channel "
4901  "LEFT JOIN channelgroup "
4902  "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) "
4903  "WHERE deleted IS NULL "
4904  "AND visible > 0 "
4905  "ORDER BY channum+0; "); // Order by numeric value of channel number
4906  query.bindValue(":GRPID", m_groupId);
4907  }
4908  else
4909  {
4910  query.prepare(
4911  "SELECT channel.chanid, channum, name, cg2.grpid FROM channel "
4912  "RIGHT JOIN channelgroup AS cg1 "
4913  "ON (channel.chanid = cg1.chanid AND cg1.grpid = :FROMGRPID) "
4914  "LEFT JOIN channelgroup AS cg2 "
4915  "ON (channel.chanid = cg2.chanid AND cg2.grpid = :GRPID) "
4916  "WHERE deleted IS NULL "
4917  "AND visible > 0 "
4918  "ORDER BY channum+0; "); // Order by numeric value of channel number
4919  query.bindValue(":GRPID", m_groupId);
4920  query.bindValue(":FROMGRPID", fromGroupId);
4921  }
4922 
4923  if (!query.exec() || !query.isActive())
4924  MythDB::DBError("ChannelGroupSetting::LoadChannelGroupChannels", query);
4925  else
4926  {
4927  while (query.next())
4928  {
4929  auto chanid = query.value(0).toUInt();
4930  auto channum = query.value(1).toString();
4931  auto name = query.value(2).toString();
4932  auto checked = !query.value(3).isNull();
4933  auto pair = std::make_pair(m_groupId, chanid);
4934 
4935  TransMythUICheckBoxSetting *checkBox = nullptr;
4936  auto it = m_boxMap.find(pair);
4937  if (it != m_boxMap.end())
4938  {
4939  checkBox = it->second;
4940  checkBox->setVisible(true);
4941  }
4942  else
4943  {
4944  checkBox = new ChannelCheckBoxSetting(chanid, channum, name);
4945  checkBox->setValue(checked);
4946  m_boxMap[pair] = checkBox;
4947  addChild(checkBox);
4948  }
4949  }
4950  }
4951 }
4952 
4954 {
4955  clearSettings();
4956 
4957  // We cannot rename the Favorites group, make it readonly
4959  m_groupName->setLabel(tr("Group name"));
4963 
4964  // Add channel group selection
4966  connect(m_groupSelection, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
4969 
4971 
4973 }
4974 
4976 {
4977  // Cannot delete new group or Favorites
4978  return (m_groupId > 1);
4979 }
4980 
4982 {
4983  MSqlQuery query(MSqlQuery::InitCon());
4984 
4985  // Delete channels from this group
4986  query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
4987  query.bindValue(":GRPID", m_groupId);
4988  if (!query.exec())
4989  MythDB::DBError("ChannelGroupSetting::deleteEntry 1", query);
4990 
4991  // Now delete the group from channelgroupnames
4992  query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
4993  query.bindValue(":GRPID", m_groupId);
4994  if (!query.exec())
4995  MythDB::DBError("ChannelGroupSetting::deleteEntry 2", query);
4996 }
4997 
4999 {
5000  setLabel(tr("Channel Groups"));
5001 }
5002 
5004 {
5005  clearSettings();
5006  auto *newGroup = new ButtonStandardSetting(tr("(Create New Channel Group)"));
5007  connect(newGroup, &ButtonStandardSetting::clicked,
5009  addChild(newGroup);
5010 
5012  for (auto it = list.begin(); it < list.end(); ++it)
5013  {
5014  QString name = (it->m_name == "Favorites") ? tr("Favorites") : it->m_name;
5015  addChild(new ChannelGroupSetting(name, it->m_grpId));
5016  }
5017 
5018  // Load all the groups
5020 
5021  // TODO select the new one or the edited one
5022  emit settingsChanged(nullptr);
5023 }
5024 
5026 {
5027  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
5028  auto *settingdialog = new MythTextInputDialog(popupStack,
5029  tr("Enter the name of the new channel group"));
5030 
5031  if (settingdialog->Create())
5032  {
5033  connect(settingdialog, &MythTextInputDialog::haveResult,
5035  popupStack->AddScreen(settingdialog);
5036  }
5037  else
5038  {
5039  delete settingdialog;
5040  }
5041 }
5042 
5043 void ChannelGroupsSetting::CreateNewGroup(const QString& name)
5044 {
5045  auto *button = new ChannelGroupSetting(name, -1);
5046  button->setLabel(name);
5047  button->Load();
5048  addChild(button);
5049  emit settingsChanged(this);
5050 }
5051 
5052 // vim:set sw=4 ts=4 expandtab:
RunInWindow
static HostCheckBoxSetting * RunInWindow()
Definition: globalsettings.cpp:2599
PlaybackProfileConfig::InitUI
void InitUI(StandardSetting *parent)
Definition: globalsettings.cpp:1233
LCDPopupTime
static HostSpinBoxSetting * LCDPopupTime()
Definition: globalsettings.cpp:3636
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:216
LCDBacklightOn
static HostCheckBoxSetting * LCDBacklightOn()
Definition: globalsettings.cpp:3720
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:4609
PlaybackWLStart
static HostCheckBoxSetting * PlaybackWLStart()
Definition: globalsettings.cpp:3509
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:4224
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1587
PrimariesRelaxed
@ PrimariesRelaxed
Definition: videoouttypes.h:145
LCDShowMenu
static HostCheckBoxSetting * LCDShowMenu()
Definition: globalsettings.cpp:3623
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:2931
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:3760
MythLanguage
static GlobalComboBoxSetting * MythLanguage()
Definition: globalsettings.cpp:3150
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:3707
GuiSizeForTV
static HostCheckBoxSetting * GuiSizeForTV()
Definition: globalsettings.cpp:2285
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:2985
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:2493
AlwaysOnTop
static HostCheckBoxSetting * AlwaysOnTop()
Definition: globalsettings.cpp:2612
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:4021
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:4630
ChannelOrdering
static HostComboBoxSetting * ChannelOrdering()
Definition: globalsettings.cpp:1588
GRHardHearRecPriority
static GlobalSpinBoxSetting * GRHardHearRecPriority()
Definition: globalsettings.cpp:3088
AutoExpireDayPriority
static GlobalSpinBoxSetting * AutoExpireDayPriority()
Definition: globalsettings.cpp:534
GRSignLangRecPriority
static GlobalSpinBoxSetting * GRSignLangRecPriority()
Definition: globalsettings.cpp:3035
AdjustFill
static HostComboBoxSetting * AdjustFill()
Definition: globalsettings.cpp:2205
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:3541
GuiVidModeResolution
static HostComboBoxSetting * GuiVidModeResolution()
Definition: globalsettings.cpp:2343
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:2763
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:2581
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:3650
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:4203
mythdbcon.h
LongChannelFormat
static HostComboBoxSetting * LongChannelFormat()
Definition: globalsettings.cpp:2821
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:2960
AppearanceSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4656
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
ManualRecordStartChanType
static GlobalComboBoxSetting * ManualRecordStartChanType()
Definition: globalsettings.cpp:2945
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:3204
PlaybackSettingsDialog::ShowPlaybackProfileMenu
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
Definition: globalsettings.cpp:4289
StandardSetting::clearSettings
virtual void clearSettings()
Definition: standardsettings.cpp:160
GuiHeight
static HostSpinBoxSetting * GuiHeight()
Definition: globalsettings.cpp:2242
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:3177
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:4223
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:3493
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:3053
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:3523
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:2840
MythVideoProfile::GetVideoRendererName
static QString GetVideoRendererName(const QString &Renderer)
Definition: mythvideoprofile.cpp:847
PlaybackWLBlackOut
static HostSpinBoxSetting * PlaybackWLBlackOut()
Definition: globalsettings.cpp:3557
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:4222
AutoExpireWatchedPriority
static GlobalCheckBoxSetting * AutoExpireWatchedPriority()
Definition: globalsettings.cpp:519
LCDBigClock
static HostCheckBoxSetting * LCDBigClock()
Definition: globalsettings.cpp:3746
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:4109
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:4785
PlaybackSettingsDialog::ShowMenu
void ShowMenu(void) override
Definition: globalsettings.cpp:4277
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:2328
PlaybackSettingsDialog::DeleteProfileItem
void DeleteProfileItem(void)
Definition: globalsettings.cpp:4345
GRAudioDescRecPriority
static GlobalSpinBoxSetting * GRAudioDescRecPriority()
Definition: globalsettings.cpp:3105
MythVideoProfile::GetProfiles
static QStringList GetProfiles(const QString &HostName)
Definition: mythvideoprofile.cpp:865
EPGSettings::EPGSettings
EPGSettings()
Definition: globalsettings.cpp:4563
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:2447
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:4866
ShutDownRebootSetting::childChanged
void childChanged(StandardSetting *) override
Definition: globalsettings.cpp:4045
ShutDownRebootSetting::ShutDownRebootSetting
ShutDownRebootSetting()
Definition: globalsettings.cpp:4027
VideoModeSettings::VideoModeSettings
VideoModeSettings(const char *c)
Definition: globalsettings.cpp:2546
ConfirmPowerEvent
static HostCheckBoxSetting * ConfirmPowerEvent()
Definition: globalsettings.cpp:1953
LircDaemonDevice
static HostTextEditSetting * LircDaemonDevice()
Definition: globalsettings.cpp:2066
ChannelGroupsSetting::Load
void Load() override
Definition: globalsettings.cpp:5003
mythdisplay.h
LCDEnable
static HostCheckBoxSetting * LCDEnable()
Definition: globalsettings.cpp:3777
ShutDownRebootSetting::m_overrideExitMenu
StandardSetting * m_overrideExitMenu
Definition: globalsettings.cpp:4020
FFRewReverse
static HostCheckBoxSetting * FFRewReverse()
Definition: globalsettings.cpp:1486