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