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