MythTV  master
mythtv/programs/mythfrontend/main.cpp
Go to the documentation of this file.
1 #include <cerrno>
2 #include <csignal>
3 #include <cstdlib>
4 #include <fcntl.h>
5 #include <iostream>
6 #include <memory>
7 
8 #include <QFile>
9 #include <QFileInfo>
10 #include <QMap>
11 #include <QKeyEvent>
12 #include <QEvent>
13 #include <QDir>
14 #include <QTextCodec>
15 #include <QApplication>
16 #include <QTimer>
17 #ifdef Q_OS_MAC
18 #include <QProcessEnvironment>
19 #endif
20 
21 #ifdef Q_OS_ANDROID
22 #include <QtAndroidExtras>
23 #endif
24 
25 #include "previewgeneratorqueue.h"
26 #include "referencecounter.h"
27 #include "mythmiscutil.h"
28 #include "mythconfig.h"
29 #include "mythcdrom.h"
30 #include "mythsystemlegacy.h"
31 #include "tv.h"
32 #include "proglist.h"
33 #include "prevreclist.h"
34 #include "progfind.h"
35 #include "scheduleeditor.h"
36 #include "manualschedule.h"
37 #include "playbackbox.h"
38 #include "themechooser.h"
39 #include "setupwizard_general.h"
40 #include "customedit.h"
41 #include "viewscheduled.h"
42 #include "programrecpriority.h"
43 #include "channelrecpriority.h"
44 #include "custompriority.h"
45 #include "audiooutput.h"
46 #include "globalsettings.h"
47 #include "audiogeneralsettings.h"
48 #include "grabbersettings.h"
49 #include "playgroup.h"
50 #include "networkcontrol.h"
51 #include "scheduledrecording.h"
52 #include "mythsystemevent.h"
53 #include "hardwareprofile.h"
54 #include "signalhandling.h"
55 #include "loggingserver.h"
56 
57 #include "compat.h" // For SIG* on MinGW
58 #include "exitcodes.h"
59 #include "exitprompt.h"
60 #include "programinfo.h"
61 #include "mythcontext.h"
62 #include "mythdbcon.h"
63 #include "guidegrid.h"
64 #include "mythplugin.h"
65 #include "remoteutil.h"
66 #include "dbcheck.h"
67 #include "mythmediamonitor.h"
68 #include "statusbox.h"
69 #include "idlescreen.h"
70 #include "lcddevice.h"
71 #include "langsettings.h"
72 #include "mythtranslation.h"
73 #include "commandlineparser.h"
74 #include "tvremoteutil.h"
75 #include "channelutil.h"
76 
77 #include "myththemedmenu.h"
78 #include "mediarenderer.h"
79 #include "mythmainwindow.h"
80 #include "mythcontrols.h"
81 #include "mythuihelper.h"
82 #include "mythdirs.h"
83 #include "mythdb.h"
85 #include "themechooser.h"
86 #include "mythversion.h"
87 #include "taskqueue.h"
88 #include "cleanupguard.h"
89 #include "standardsettings.h"
90 #include "settingshelper.h"
91 
92 // Video
93 #include "cleanup.h"
94 #include "globals.h"
95 #include "videodlg.h"
96 #include "videoglobalsettings.h"
97 #include "videofileassoc.h"
98 #include "videoplayersettings.h"
99 #include "videometadatasettings.h"
100 #include "videolist.h"
101 
102 // Gallery
103 #include "gallerythumbview.h"
104 
105 // DVD & Bluray
106 #include "DVD/mythdvdbuffer.h"
107 #include "Bluray/mythbdinfo.h"
108 #include "Bluray/mythbdbuffer.h"
109 
110 // AirPlay
111 #ifdef USING_AIRPLAY
112 #include "AirPlay/mythraopdevice.h"
114 #endif
115 
116 #ifdef USING_LIBDNS_SD
117 #include <QScopedPointer>
118 #include "bonjourregister.h"
119 #endif
120 #if CONFIG_SYSTEMD_NOTIFY
121 #include <systemd/sd-daemon.h>
122 #define fe_sd_notify(x) \
123  (void)sd_notify(0, x);
124 #else
125 #define fe_sd_notify(x)
126 #endif
127 
129 
130 static MediaRenderer *g_pUPnp = nullptr;
131 static MythPluginManager *g_pmanager = nullptr;
132 
134 
135 static void handleExit(bool prompt);
136 static void resetAllKeys(void);
137 void handleSIGUSR1(void);
138 void handleSIGUSR2(void);
139 
140 #if CONFIG_DARWIN
141 static bool gLoaded = false;
142 #endif
143 
144 static const QString sLocation = QCoreApplication::translate("(Common)",
145  "MythFrontend");
146 
147 namespace
148 {
149  class RunSettingsCompletion : public QObject
150  {
151  Q_OBJECT
152 
153  public:
154  static void Create(bool check)
155  {
156  new RunSettingsCompletion(check);
157  }
158 
159  private:
160  explicit RunSettingsCompletion(bool check)
161  {
162  if (check)
163  {
165  this, &RunSettingsCompletion::OnPasswordResultReady);
167  }
168  else
169  {
170  OnPasswordResultReady(true, ParentalLevel::plHigh);
171  }
172  }
173 
174  ~RunSettingsCompletion() override = default;
175 
176  private slots:
177  void OnPasswordResultReady(bool passwordValid,
178  ParentalLevel::Level newLevel)
179  {
180  (void) newLevel;
181 
182  if (passwordValid)
183  {
185  auto *ssd =
186  new StandardSettingDialog(mainStack, "videogeneralsettings",
187  new VideoGeneralSettings());
188 
189  if (ssd->Create())
190  {
191  mainStack->AddScreen(ssd);
192  }
193  else
194  delete ssd;
195  }
196  else
197  {
198  LOG(VB_GENERAL, LOG_WARNING,
199  "Aggressive Parental Controls Warning: "
200  "invalid password. An attempt to enter a "
201  "MythVideo settings screen was prevented.");
202  }
203 
204  deleteLater();
205  }
206 
207  public:
209  };
210 
211  class BookmarkDialog : MythScreenType
212  {
213  Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)
214 
215  public:
216  BookmarkDialog(ProgramInfo *pginfo, MythScreenStack *parent) :
217  MythScreenType(parent, "bookmarkdialog"),
218  m_pgi(pginfo)
219  {
220  }
221 
222  bool Create() override // MythScreenType
223  {
224  QString msg = tr("DVD/Video contains a bookmark");
225  QString btn0msg = tr("Play from bookmark");
226  QString btn1msg = tr("Play from beginning");
227 
228  auto *popup = new MythDialogBox(msg, GetScreenStack(), "bookmarkdialog");
229  if (!popup->Create())
230  {
231  delete popup;
232  return false;
233  }
234 
235  GetScreenStack()->AddScreen(popup);
236 
237  popup->SetReturnEvent(this, "bookmarkdialog");
238  popup->AddButton(btn0msg);
239  popup->AddButton(btn1msg);
240  return true;
241  }
242 
243  void customEvent(QEvent *event) override // MythUIType
244  {
245  if (event->type() == DialogCompletionEvent::kEventType)
246  {
247  auto *dce = (DialogCompletionEvent*)(event);
248  int buttonnum = dce->GetResult();
249 
250  if (dce->GetId() == "bookmarkdialog")
251  {
252  uint flags = kStartTVNoFlags;
253  if (buttonnum == 1)
254  {
255  flags |= kStartTVIgnoreBookmark;
256  }
257  else if (buttonnum != 0)
258  {
259  delete m_pgi;
260  return;
261  }
262 
263  TV::StartTV(m_pgi, flags);
264 
265  delete m_pgi;
266  }
267  }
268  }
269 
270  private:
271  ProgramInfo* m_pgi {nullptr};
272  };
273 
274  void cleanup()
275  {
276  QCoreApplication::processEvents();
278 #ifdef USING_AIRPLAY
281 #endif
282 
284 
285  if (g_pUPnp)
286  {
287  // This takes a few seconds, so inform the user:
288  LOG(VB_GENERAL, LOG_INFO, "Shutting down UPnP client...");
289  delete g_pUPnp;
290  g_pUPnp = nullptr;
291  }
292 
293  if (g_pmanager)
294  {
295  delete g_pmanager;
296  g_pmanager = nullptr;
297  }
298 
299  if (g_settingsHelper)
300  {
301  delete g_settingsHelper;
302  g_settingsHelper = nullptr;
303  }
304 
305  delete gContext;
306  gContext = nullptr;
307 
309 
311  }
312 }
313 
314 static void startAppearWiz(void)
315 {
316  int curX = gCoreContext->GetNumSetting("GuiOffsetX", 0);
317  int curY = gCoreContext->GetNumSetting("GuiOffsetY", 0);
318  int curW = gCoreContext->GetNumSetting("GuiWidth", 0);
319  int curH = gCoreContext->GetNumSetting("GuiHeight", 0);
320 
321  bool isWindowed =
322  (gCoreContext->GetNumSetting("RunFrontendInWindow", 0) == 1);
323 
324  bool reload = false;
325 
326  if (isWindowed)
327  {
328  ShowOkPopup(QCoreApplication::translate("(MythFrontendMain)",
329  "The ScreenSetupWizard cannot be used while "
330  "mythfrontend is operating in windowed mode."));
331  }
332  else
333  {
334  auto *wizard = new MythSystemLegacy(
335  GetAppBinDir() + "mythscreenwizard",
336  QStringList(),
338  wizard->Run();
339 
340  if (!wizard->Wait())
341  {
342  // no reported errors, check for changed geometry parameters
343  gCoreContext->ClearSettingsCache("GuiOffsetX");
344  gCoreContext->ClearSettingsCache("GuiOffsetY");
345  gCoreContext->ClearSettingsCache("GuiWidth");
346  gCoreContext->ClearSettingsCache("GuiHeight");
347 
348  if ((curX != gCoreContext->GetNumSetting("GuiOffsetX", 0)) ||
349  (curY != gCoreContext->GetNumSetting("GuiOffsetY", 0)) ||
350  (curW != gCoreContext->GetNumSetting("GuiWidth", 0)) ||
351  (curH != gCoreContext->GetNumSetting("GuiHeight", 0)))
352  reload = true;
353  }
354 
355  delete wizard;
356  wizard = nullptr;
357  }
358 
359  if (reload)
360  GetMythMainWindow()->JumpTo("Reload Theme");
361 }
362 
363 static void startKeysSetup()
364 {
366 
367  auto *mythcontrols = new MythControls(mainStack, "mythcontrols");
368 
369  if (mythcontrols->Create())
370  mainStack->AddScreen(mythcontrols);
371  else
372  delete mythcontrols;
373 }
374 
375 static void startGuide(void)
376 {
377  uint chanid = 0;
378  QString channum = gCoreContext->GetSetting("DefaultTVChannel");
379  QDateTime startTime;
380  GuideGrid::RunProgramGuide(chanid, channum, startTime, nullptr, false, true, -2);
381 }
382 
383 static void startFinder(void)
384 {
386 }
387 
388 static void startSearchTitle(void)
389 {
391  auto *pl = new ProgLister(mainStack, plTitleSearch, "", "");
392  if (pl->Create())
393  mainStack->AddScreen(pl);
394  else
395  delete pl;
396 }
397 
398 static void startSearchKeyword(void)
399 {
401  auto *pl = new ProgLister(mainStack, plKeywordSearch, "", "");
402  if (pl->Create())
403  mainStack->AddScreen(pl);
404  else
405  delete pl;
406 }
407 
408 static void startSearchPeople(void)
409 {
411  auto *pl = new ProgLister(mainStack, plPeopleSearch, "", "");
412  if (pl->Create())
413  mainStack->AddScreen(pl);
414  else
415  delete pl;
416 }
417 
418 static void startSearchPower(void)
419 {
421  auto *pl = new ProgLister(mainStack, plPowerSearch, "", "");
422  if (pl->Create())
423  mainStack->AddScreen(pl);
424  else
425  delete pl;
426 }
427 
428 static void startSearchStored(void)
429 {
431  auto *pl = new ProgLister(mainStack, plStoredSearch, "", "");
432  if (pl->Create())
433  mainStack->AddScreen(pl);
434  else
435  delete pl;
436 }
437 
438 static void startSearchChannel(void)
439 {
441  auto *pl = new ProgLister(mainStack, plChannel, "", "");
442  if (pl->Create())
443  mainStack->AddScreen(pl);
444  else
445  delete pl;
446 }
447 
448 static void startSearchCategory(void)
449 {
451  auto *pl = new ProgLister(mainStack, plCategory, "", "");
452  if (pl->Create())
453  mainStack->AddScreen(pl);
454  else
455  delete pl;
456 }
457 
458 static void startSearchMovie(void)
459 {
461  auto *pl = new ProgLister(mainStack, plMovies, "", "");
462  if (pl->Create())
463  mainStack->AddScreen(pl);
464  else
465  delete pl;
466 }
467 
468 static void startSearchNew(void)
469 {
471  auto *pl = new ProgLister(mainStack, plNewListings, "", "");
472  if (pl->Create())
473  mainStack->AddScreen(pl);
474  else
475  delete pl;
476 }
477 
478 static void startSearchTime(void)
479 {
481  auto *pl = new ProgLister(mainStack, plTime, "", "");
482  if (pl->Create())
483  mainStack->AddScreen(pl);
484  else
485  delete pl;
486 }
487 
488 static void startManaged(void)
489 {
491 
492  auto *viewsched = new ViewScheduled(mainStack);
493 
494  if (viewsched->Create())
495  mainStack->AddScreen(viewsched);
496  else
497  delete viewsched;
498 }
499 
500 static void startManageRecordingRules(void)
501 {
503 
504  auto *progRecPrior = new ProgramRecPriority(mainStack, "ManageRecRules");
505 
506  if (progRecPrior->Create())
507  mainStack->AddScreen(progRecPrior);
508  else
509  delete progRecPrior;
510 }
511 
512 static void startChannelRecPriorities(void)
513 {
515 
516  auto *chanRecPrior = new ChannelRecPriority(mainStack);
517 
518  if (chanRecPrior->Create())
519  mainStack->AddScreen(chanRecPrior);
520  else
521  delete chanRecPrior;
522 }
523 
524 static void startCustomPriority(void)
525 {
527 
528  auto *custom = new CustomPriority(mainStack);
529 
530  if (custom->Create())
531  mainStack->AddScreen(custom);
532  else
533  delete custom;
534 }
535 
536 static void startPlaybackWithGroup(const QString& recGroup = "")
537 {
539 
540  auto *pbb = new PlaybackBox(mainStack, "playbackbox");
541 
542  if (pbb->Create())
543  {
544  if (!recGroup.isEmpty())
545  pbb->setInitialRecGroup(recGroup);
546 
547  mainStack->AddScreen(pbb);
548  }
549  else
550  delete pbb;
551 }
552 
553 static void startPlayback(void)
554 {
556 }
557 
558 static void startPrevious(void)
559 {
561  auto *pl = new PrevRecordedList(mainStack);
562  if (pl->Create())
563  mainStack->AddScreen(pl);
564  else
565  delete pl;
566 }
567 
568 static void startPreviousOld(void)
569 {
571  auto *pl = new ProgLister(mainStack);
572  if (pl->Create())
573  mainStack->AddScreen(pl);
574  else
575  delete pl;
576 }
577 
578 static void startCustomEdit(void)
579 {
581  auto *custom = new CustomEdit(mainStack);
582 
583  if (custom->Create())
584  mainStack->AddScreen(custom);
585  else
586  delete custom;
587 }
588 
589 static void startManualSchedule(void)
590 {
592 
593  auto *mansched= new ManualSchedule(mainStack);
594 
595  if (mansched->Create())
596  mainStack->AddScreen(mansched);
597  else
598  delete mansched;
599 }
600 
601 static bool isLiveTVAvailable(void)
602 {
603  if (RemoteGetFreeRecorderCount() > 0)
604  return true;
605 
606  QString msg = QCoreApplication::translate("(Common)", "All tuners are currently busy.");
607 
608  if (TV::ConfiguredTunerCards() < 1)
609  msg = QCoreApplication::translate("(Common)", "There are no configured tuners.");
610 
611  ShowOkPopup(msg);
612  return false;
613 }
614 
615 static void startTVNormal(void)
616 {
617  if (!isLiveTVAvailable())
618  return;
619 
620  // Get the default channel keys (callsign(0) and channum(1)) and
621  // use them to generate the ordered list of channels.
622  QStringList keylist = gCoreContext->GetSettingOnHost(
623  "DefaultChanKeys", gCoreContext->GetHostName()).split("[]:[]");
624  while (keylist.size() < 2)
625  keylist << "";
626  uint dummy = 0;
628  0, // startIndex
629  0, // count
630  dummy, // totalAvailable
631  true, // ignoreHidden
634  0, // sourceID
635  0, // channelGroupID
636  true, // liveTVOnly
637  keylist[0], // callsign
638  keylist[1]); // channum
639 
640  TV::StartTV(nullptr, kStartTVNoFlags, livetvchannels);
641 }
642 
643 static void showStatus(void)
644 {
646 
647  auto *statusbox = new StatusBox(mainStack);
648 
649  if (statusbox->Create())
650  mainStack->AddScreen(statusbox);
651  else
652  delete statusbox;
653 }
654 
655 
656 static void standbyScreen(void)
657 {
659 
660  auto *idlescreen = new IdleScreen(mainStack);
661 
662  if (idlescreen->Create())
663  mainStack->AddScreen(idlescreen);
664  else
665  delete idlescreen;
666 }
667 
668 static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump = false)
669 {
670  QString message = QCoreApplication::translate("(MythFrontendMain)",
671  "Loading videos ...");
672 
673  MythScreenStack *popupStack =
674  GetMythMainWindow()->GetStack("popup stack");
675 
676  auto *busyPopup = new MythUIBusyDialog(message, popupStack,
677  "mythvideobusydialog");
678 
679  if (busyPopup->Create())
680  popupStack->AddScreen(busyPopup, false);
681 
683 
684  VideoDialog::VideoListPtr video_list;
685  if (fromJump)
686  {
689  if (!saved.isNull())
690  {
691  video_list = saved->GetSaved();
692  LOG(VB_GENERAL, LOG_INFO,
693  QString("Reusing saved video list because MythVideo was resumed"
694  " within %1ms").arg(VideoListDeathDelay::kDelayTimeMS.count()));
695  }
696  }
697 
698  VideoDialog::BrowseType browse = static_cast<VideoDialog::BrowseType>(
699  gCoreContext->GetNumSetting("mythvideo.db_group_type",
701 
702  if (!video_list)
703  video_list = new VideoList;
704 
705  auto *mythvideo =
706  new VideoDialog(mainStack, "mythvideo", video_list, type, browse);
707 
708  if (mythvideo->Create())
709  {
710  busyPopup->Close();
711  mainStack->AddScreen(mythvideo);
712  }
713  else
714  busyPopup->Close();
715 }
716 
722 
723 static void RunGallery()
724 {
726  auto *galleryView = new GalleryThumbView(mainStack, "galleryview");
727  if (galleryView->Create())
728  {
729  mainStack->AddScreen(galleryView);
730  galleryView->Start();
731  }
732  else
733  {
734  delete galleryView;
735  }
736 }
737 
738 static void playDisc()
739 {
740  //
741  // Get the command string to play a DVD
742  //
743 
744  bool isBD = false;
745 
746  QString command_string =
747  gCoreContext->GetSetting("mythdvd.DVDPlayerCommand");
748  QString bluray_mountpoint =
749  gCoreContext->GetSetting("BluRayMountpoint", "/media/cdrom");
750  QDir bdtest(bluray_mountpoint + "/BDMV");
751 
752  if (bdtest.exists() || MythCDROM::inspectImage(bluray_mountpoint) == MythCDROM::kBluray)
753  isBD = true;
754 
755  if (isBD)
756  {
757  GetMythUI()->AddCurrentLocation("playdisc");
758 
759  QString filename = QString("bd:/%1").arg(bluray_mountpoint);
760 
761  GetMythMainWindow()->HandleMedia("Internal", filename, "", "", "", "",
762  0, 0, "", 0min, "", "", true);
763 
765  }
766  else
767  {
768  QString dvd_device = MediaMonitor::defaultDVDdevice();
769 
770  if (dvd_device.isEmpty())
771  return; // User cancelled in the Popup
772 
773  GetMythUI()->AddCurrentLocation("playdisc");
774 
775  if ((command_string.indexOf("internal", 0, Qt::CaseInsensitive) > -1) ||
776  (command_string.length() < 1))
777  {
778 #ifdef Q_OS_MAC
779  // Convert a BSD 'leaf' name into a raw device path
780  QString filename = "dvd://dev/r"; // e.g. 'dvd://dev/rdisk2'
781 #elif _WIN32
782  QString filename = "dvd:"; // e.g. 'dvd:E\\'
783 #else
784  QString filename = "dvd:/"; // e.g. 'dvd://dev/sda'
785 #endif
786  filename += dvd_device;
787 
788  command_string = "Internal";
789  GetMythMainWindow()->HandleMedia(command_string, filename, "", "",
790  "", "", 0, 0, "", 0min, "", "", true);
792 
793  return;
794  }
795 
796  if (command_string.contains("%d"))
797  {
798  //
799  // Need to do device substitution
800  //
801  command_string = command_string.replace("%d", dvd_device);
802  }
805  myth_system(command_string);
808  if (GetMythMainWindow())
809  {
810  GetMythMainWindow()->raise();
811  GetMythMainWindow()->activateWindow();
812  }
814  }
815 }
816 
821 {
822  if (!dvd)
823  return;
824 
825  if (!dvd->isUsable()) // This isn't infallible, on some drives both a mount and libudf fail
826  return;
827 
828  switch (gCoreContext->GetNumSetting("DVDOnInsertDVD", 1))
829  {
830  case 0 : // Do nothing
831  case 1 : // Display menu (mythdvd)*/
832  break;
833  case 2 : // play DVD or Blu-ray
834  playDisc();
835  break;
836  default:
837  LOG(VB_GENERAL, LOG_ERR,
838  "mythdvd main.o: handleMedia() does not know what to do");
839  }
840 }
841 
843 {
844  // Only handle events for media that are newly mounted
845  if (!dev || (dev->getStatus() != MEDIASTAT_MOUNTED
846  && dev->getStatus() != MEDIASTAT_USEABLE))
847  return;
848 
849  // Check if gallery is already running
850  QVector<MythScreenType*> screens;
852 
853 
854  for (const auto *screen : qAsConst(screens))
855  {
856  if (qobject_cast<const GalleryThumbView*>(screen))
857  {
858  // Running gallery will receive this event later
859  LOG(VB_MEDIA, LOG_INFO, "Main: Ignoring new gallery media - already running");
860  return;
861  }
862  }
863 
864  if (gCoreContext->GetBoolSetting("GalleryAutoLoad", false))
865  {
866  LOG(VB_GUI, LOG_INFO, "Main: Autostarting Gallery for new media");
868  }
869  else
870  LOG(VB_MEDIA, LOG_INFO, "Main: Ignoring new gallery media - autorun not set");
871 }
872 
873 static void TVMenuCallback(void *data, QString &selection)
874 {
875  (void)data;
876  QString sel = selection.toLower();
877 
878  if (sel.startsWith("settings ") || sel == "video_settings_general")
879  {
880  if (!g_settingsHelper)
882 
884  }
885 
886  if (sel == "tv_watch_live")
887  startTVNormal();
888  else if (sel.startsWith("tv_watch_recording"))
889  {
890  // use selection here because its case is untouched
891  if ((selection.length() > 19) && (selection.mid(18, 1) == " "))
892  startPlaybackWithGroup(selection.mid(19));
893  else
894  startPlayback();
895  }
896  else if (sel == "tv_schedule")
897  startGuide();
898  else if (sel == "tv_manualschedule")
900  else if (sel == "tv_custom_record")
901  startCustomEdit();
902  else if (sel == "tv_fix_conflicts")
903  startManaged();
904  else if (sel == "tv_manage_recording_rules")
906  else if (sel == "tv_progfind")
907  startFinder();
908  else if (sel == "tv_search_title")
910  else if (sel == "tv_search_keyword")
912  else if (sel == "tv_search_people")
914  else if (sel == "tv_search_power")
916  else if (sel == "tv_search_stored")
918  else if (sel == "tv_search_channel")
920  else if (sel == "tv_search_category")
922  else if (sel == "tv_search_movie")
924  else if (sel == "tv_search_new")
925  startSearchNew();
926  else if (sel == "tv_search_time")
927  startSearchTime();
928  else if (sel == "tv_previous")
929  startPrevious();
930  else if (sel == "tv_previous_old")
932  else if (sel == "settings appearance")
933  {
935  auto *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings",
936  new AppearanceSettings());
937 
938  if (ssd->Create())
939  {
940  mainStack->AddScreen(ssd);
941  }
942  else
943  delete ssd;
944  }
945  else if (sel == "settings themechooser")
946  {
948  auto *tp = new ThemeChooser(mainStack);
949 
950  if (tp->Create())
951  mainStack->AddScreen(tp);
952  else
953  delete tp;
954  }
955  else if (sel == "settings setupwizard")
956  {
958  auto *sw = new GeneralSetupWizard(mainStack, "setupwizard");
959 
960  if (sw->Create())
961  mainStack->AddScreen(sw);
962  else
963  delete sw;
964  }
965  else if (sel == "settings grabbers")
966  {
968  auto *gs = new GrabberSettings(mainStack, "grabbersettings");
969 
970  if (gs->Create())
971  mainStack->AddScreen(gs);
972  else
973  delete gs;
974  }
975  else if (sel == "screensetupwizard")
976  {
977  startAppearWiz();
978  }
979  else if (sel == "setup_keys")
980  {
981  startKeysSetup();
982  }
983  else if (sel == "settings playgroup")
984  {
986  auto *ssd = new StandardSettingDialog(mainStack, "playbackgroupsetting",
987  new PlayGroupEditor());
988 
989  if (ssd->Create())
990  {
991  mainStack->AddScreen(ssd);
992  }
993  else
994  delete ssd;
995  }
996  else if (sel == "settings general")
997  {
999  auto *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings",
1000  new GeneralSettings());
1001 
1002  if (ssd->Create())
1003  {
1004  mainStack->AddScreen(ssd);
1005  }
1006  else
1007  delete ssd;
1008  }
1009  else if (sel == "settings audiogeneral")
1010  {
1012  StandardSettingDialog *ssd =
1013  new AudioConfigScreen(mainStack, "audiogeneralsettings",
1014  new AudioConfigSettings());
1015 
1016  if (ssd->Create())
1017  {
1018  mainStack->AddScreen(ssd);
1019  }
1020  else
1021  delete ssd;
1022  }
1023  else if (sel == "settings maingeneral")
1024  {
1026  auto *ssd = new StandardSettingDialog(mainStack, "maingeneralsettings",
1027  new MainGeneralSettings());
1028 
1029  if (ssd->Create())
1030  {
1031  mainStack->AddScreen(ssd);
1032  }
1033  else
1034  delete ssd;
1035  }
1036  else if (sel == "settings playback")
1037  {
1039  StandardSettingDialog *ssd =
1040  new PlaybackSettingsDialog(mainStack);
1041 
1042  if (ssd->Create())
1043  {
1044  mainStack->AddScreen(ssd);
1045  }
1046  else
1047  delete ssd;
1048  }
1049  else if (sel == "settings osd")
1050  {
1052  auto *ssd = new StandardSettingDialog(mainStack, "osdsettings",
1053  new OSDSettings());
1054 
1055  if (ssd->Create())
1056  {
1057  mainStack->AddScreen(ssd);
1058  }
1059  else
1060  delete ssd;
1061  }
1062  else if (sel == "settings epg")
1063  {
1065  auto *ssd = new StandardSettingDialog(mainStack, "epgsettings",
1066  new EPGSettings());
1067 
1068  if (ssd->Create())
1069  {
1070  mainStack->AddScreen(ssd);
1071  }
1072  else
1073  delete ssd;
1074  }
1075  else if (sel == "settings channelgroups")
1076  {
1078  auto *ssd = new StandardSettingDialog(mainStack, "channelgroupssettings",
1079  new ChannelGroupsSetting());
1080 
1081  if (ssd->Create())
1082  {
1083  mainStack->AddScreen(ssd);
1084  }
1085  else
1086  delete ssd;
1087  }
1088  else if (sel == "settings generalrecpriorities")
1089  {
1091  auto *ssd = new StandardSettingDialog(mainStack,
1092  "generalrecprioritiessettings",
1094 
1095  if (ssd->Create())
1096  {
1097  mainStack->AddScreen(ssd);
1098  }
1099  else
1100  delete ssd;
1101  }
1102  else if (sel == "settings channelrecpriorities")
1103  {
1105  }
1106  else if (sel == "settings custompriority")
1107  {
1109  }
1110  else if (sel == "system_events")
1111  {
1113 
1114  auto *msee = new MythSystemEventEditor(mainStack, "System Event Editor");
1115 
1116  if (msee->Create())
1117  mainStack->AddScreen(msee);
1118  else
1119  delete msee;
1120  }
1121  else if (sel == "video_settings_general")
1122  {
1123  RunSettingsCompletion::Create(gCoreContext->
1124  GetBoolSetting("VideoAggressivePC", false));
1125  }
1126  else if (sel == "video_settings_player")
1127  {
1129 
1130  auto *ps = new PlayerSettings(mainStack, "player settings");
1131 
1132  if (ps->Create())
1133  mainStack->AddScreen(ps);
1134  else
1135  delete ps;
1136  }
1137  else if (sel == "video_settings_metadata")
1138  {
1140 
1141  auto *ms = new MetadataSettings(mainStack, "metadata settings");
1142 
1143  if (ms->Create())
1144  mainStack->AddScreen(ms);
1145  else
1146  delete ms;
1147  }
1148  else if (sel == "video_settings_associations")
1149  {
1151 
1152  auto *fa = new FileAssocDialog(mainStack, "fa dialog");
1153 
1154  if (fa->Create())
1155  mainStack->AddScreen(fa);
1156  }
1157  else if (sel == "manager")
1159  else if (sel == "browser")
1161  else if (sel == "listing")
1163  else if (sel == "gallery")
1165  else if (sel == "disc_play")
1166  {
1167  playDisc();
1168  }
1169  else if (sel == "tv_status")
1170  showStatus();
1171  else if (sel == "exiting_app_prompt")
1172  handleExit(true);
1173  else if (sel == "exiting_app")
1174  handleExit(false);
1175  else if (sel == "standby_mode")
1176  standbyScreen();
1177  else if (sel == "exiting_menu")
1178  {
1179  //ignore
1180  }
1181  else
1182  LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
1183 
1184  if (sel.startsWith("settings ") || sel == "video_settings_general")
1185  {
1186  if (g_settingsHelper)
1187  {
1188  QObject::connect(GetMythMainWindow()->GetMainStack()->GetTopScreen(),
1191  }
1192  }
1193 }
1194 
1195 static void handleExit(bool prompt)
1196 {
1197  if (prompt)
1198  {
1199  auto * prompter = new ExitPrompter();
1200  prompter->HandleExit();
1201  }
1202  else
1203  {
1205  }
1206 }
1207 
1208 static bool RunMenu(const QString& themedir, const QString& themename)
1209 {
1210  QByteArray tmp = themedir.toLocal8Bit();
1211  g_menu = new MythThemedMenu(QString(tmp.constData()), "mainmenu.xml",
1212  GetMythMainWindow()->GetMainStack(), "mainmenu");
1213 
1214  if (g_menu->foundTheme())
1215  {
1216  LOG(VB_GENERAL, LOG_NOTICE, QString("Found mainmenu.xml for theme '%1'")
1217  .arg(themename));
1220  return true;
1221  }
1222 
1223  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find mainmenu.xml for theme '%1'")
1224  .arg(themename));
1225  delete g_menu;
1226  g_menu = nullptr;
1227  return false;
1228 }
1229 
1230 // If any settings are missing from the database, this will write
1231 // the default values
1232 static void WriteDefaults()
1233 {
1234  PlaybackSettings ps;
1235  ps.Load();
1236  ps.Save();
1237  OSDSettings os;
1238  os.Load();
1239  os.Save();
1240  GeneralSettings gs;
1241  gs.Load();
1242  gs.Save();
1243  EPGSettings es;
1244  es.Load();
1245  es.Save();
1246  AppearanceSettings as;
1247  as.Load();
1248  as.Save();
1249  MainGeneralSettings mgs;
1250  mgs.Load();
1251  mgs.Save();
1253  grs.Load();
1254  grs.Save();
1256  vgs.Load();
1257  vgs.Save();
1258  //TODo Playback group not loaded?
1259  //TODo Channel group not loaded?
1260 }
1261 
1262 static int internal_play_media(const QString &mrl, const QString &plot,
1263  const QString &title, const QString &subtitle,
1264  const QString &director, int season, int episode,
1265  const QString &inetref, std::chrono::minutes lenMins,
1266  const QString &year,
1267  const QString &id, const bool useBookmark)
1268 {
1269  int res = -1;
1270 
1271  QFile checkFile(mrl);
1272  if ((!checkFile.exists() && !mrl.startsWith("dvd:")
1273  && !mrl.startsWith("bd:")
1274  && !mrl.startsWith("myth:")
1275  && !mrl.startsWith("http://")
1276  && !mrl.startsWith("https://")))
1277  {
1278  QString errorText = QCoreApplication::translate("(MythFrontendMain)",
1279  "Failed to open \n '%1' in %2 \n"
1280  "Check if the video exists")
1281  .arg(mrl.section('/', -1))
1282  .arg(mrl.section('/', 0, -2));
1283 
1284  ShowOkPopup(errorText);
1285  return res;
1286  }
1287 
1288  auto *pginfo = new ProgramInfo(
1289  mrl, plot, title, QString(), subtitle, QString(),
1290  director, season, episode, inetref, lenMins,
1291  (year.toUInt()) ? year.toUInt() : 1900, id);
1292 
1293  pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1294 
1295  bool bookmarkPresent = false;
1296 
1297  if (pginfo->IsVideoDVD())
1298  {
1299  auto *dvd = new MythDVDInfo(pginfo->GetPlaybackURL());
1300  if (dvd->IsValid())
1301  {
1302  QString name;
1303  QString serialid;
1304  if (dvd->GetNameAndSerialNum(name, serialid))
1305  {
1306  QStringList fields = pginfo->QueryDVDBookmark(serialid);
1307  bookmarkPresent = (fields.count() > 0);
1308  }
1309  }
1310  else
1311  {
1312  ShowNotificationError(QCoreApplication::translate("(MythFrontendMain)",
1313  "DVD Failure"),
1314  sLocation,
1315  dvd->GetLastError());
1316  delete dvd;
1317  delete pginfo;
1318  return res;
1319  }
1320  delete dvd;
1321  }
1322  else if (pginfo->IsVideoBD())
1323  {
1324  MythBDInfo bd(pginfo->GetPlaybackURL());
1325  if (bd.IsValid())
1326  {
1327  QString name;
1328  QString serialid;
1329  if (bd.GetNameAndSerialNum(name, serialid))
1330  {
1331  QStringList fields = pginfo->QueryBDBookmark(serialid);
1332  bookmarkPresent = (fields.count() > 0);
1333  }
1334  }
1335  else
1336  {
1337  // ToDo: Change string to "BD Failure" after 0.28 is released
1338  ShowNotificationError(QCoreApplication::translate("(MythFrontendMain)",
1339  "DVD Failure"),
1340  sLocation,
1341  bd.GetLastError());
1342  delete pginfo;
1343  return res;
1344  }
1345  }
1346  else if (pginfo->IsVideo())
1347  bookmarkPresent = (pginfo->QueryBookmark() > 0);
1348 
1349  if (useBookmark && bookmarkPresent)
1350  {
1352  auto *bookmarkdialog = new BookmarkDialog(pginfo, mainStack);
1353  if (!bookmarkdialog->Create())
1354  {
1355  delete bookmarkdialog;
1356  delete pginfo;
1357  return res;
1358  }
1359  }
1360  else
1361  {
1363 
1364  res = 0;
1365 
1366  delete pginfo;
1367  }
1368 
1369  return res;
1370 }
1371 
1372 static void gotoMainMenu(void)
1373 {
1374  // Reset the selected button to the first item.
1375  auto *lmenu = qobject_cast<MythThemedMenuState *>
1376  (GetMythMainWindow()->GetMainStack()->GetTopScreen());
1377  if (lmenu)
1378  lmenu->m_buttonList->SetItemCurrent(0);
1379 }
1380 
1381 // If the theme specified in the DB is somehow broken, try a standard one:
1382 //
1383 static bool resetTheme(QString themedir, const QString &badtheme)
1384 {
1385  QString themename = DEFAULT_UI_THEME;
1386 
1387  if (badtheme == DEFAULT_UI_THEME)
1388  themename = FALLBACK_UI_THEME;
1389 
1390  LOG(VB_GENERAL, LOG_WARNING, QString("Overriding broken theme '%1' with '%2'")
1391  .arg(badtheme).arg(themename));
1392 
1393  gCoreContext->OverrideSettingForSession("Theme", themename);
1394  themedir = GetMythUI()->FindThemeDir(themename);
1395 
1398  GetMythMainWindow()->Init();
1400 
1401  return RunMenu(themedir, themename);
1402 }
1403 
1404 static int reloadTheme(void)
1405 {
1406 #ifdef Q_OS_ANDROID
1407  // jni code to launch the application again
1408  // reinitializing the main windows causes a segfault
1409  // with android
1410 
1411  auto activity = QtAndroid::androidActivity();
1412  auto packageManager = activity.callObjectMethod
1413  ( "getPackageManager",
1414  "()Landroid/content/pm/PackageManager;" );
1415 
1416  auto activityIntent = packageManager.callObjectMethod
1417  ( "getLaunchIntentForPackage",
1418  "(Ljava/lang/String;)Landroid/content/Intent;",
1419  activity.callObjectMethod("getPackageName",
1420  "()Ljava/lang/String;").object() );
1421 
1422  auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1423  ( "android/app/PendingIntent",
1424  "getActivity",
1425  "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1426  activity.object(),
1427  0,
1428  activityIntent.object(),
1429  QAndroidJniObject::getStaticField<jint>("android/content/Intent",
1430  "FLAG_ACTIVITY_CLEAR_TOP") );
1431 
1432  auto alarmManager = activity.callObjectMethod
1433  ( "getSystemService",
1434  "(Ljava/lang/String;)Ljava/lang/Object;",
1435  QAndroidJniObject::getStaticObjectField("android/content/Context",
1436  "ALARM_SERVICE",
1437  "Ljava/lang/String;").object() );
1438 
1439  alarmManager.callMethod<void>
1440  ( "set",
1441  "(IJLandroid/app/PendingIntent;)V",
1442  QAndroidJniObject::getStaticField<jint>("android/app/AlarmManager", "RTC"),
1443  jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1444  pendingIntent.object() );
1445 
1446  qApp->quit();
1447  // QString title = QObject::tr("Your change will take effect the next time "
1448  // "mythfrontend is started.");
1449  // MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythConfirmationDialog *okPopup =
1450  // new MythConfirmationDialog(popupStack, title, false);
1451  // if (okPopup->Create())
1452  // popupStack->AddScreen(okPopup);
1453  return 0;
1454 #else
1456  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
1457  QString themedir = GetMythUI()->FindThemeDir(themename);
1458  if (themedir.isEmpty())
1459  {
1460  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'").arg(themename));
1461  return GENERIC_EXIT_NO_THEME;
1462  }
1463 
1467  if (g_menu)
1468  g_menu->Close();
1469  GetMythMainWindow()->Init();
1472  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
1473  return GENERIC_EXIT_NO_THEME;
1474 
1475  LCD::SetupLCD();
1476  if (LCD *lcd = LCD::Get())
1477  {
1478  lcd->setupLEDs(RemoteGetRecordingMask);
1479  lcd->resetServer();
1480  }
1481 
1482  return 0;
1483 #endif
1484 }
1485 
1486 static void reloadTheme_void(void)
1487 {
1488  int err = reloadTheme();
1489  if (err)
1490  exit(err);
1491 }
1492 
1493 static void setDebugShowBorders(void)
1494 {
1495  MythMainWindow* window = GetMythMainWindow();
1496  MythPainter* painter = window->GetPainter();
1497  painter->SetDebugMode(!painter->ShowBorders(), painter->ShowTypeNames());
1498  if (window->GetMainStack()->GetTopScreen())
1499  window->GetMainStack()->GetTopScreen()->SetRedraw();
1500 }
1501 
1502 static void setDebugShowNames(void)
1503 {
1504  MythMainWindow* window = GetMythMainWindow();
1505  MythPainter* painter = window->GetPainter();
1506  painter->SetDebugMode(painter->ShowBorders(), !painter->ShowTypeNames());
1507  if (window->GetMainStack()->GetTopScreen())
1508  window->GetMainStack()->GetTopScreen()->SetRedraw();
1509 }
1510 
1511 static void InitJumpPoints(void)
1512 {
1513  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Reload Theme"),
1514  "", "", reloadTheme_void);
1515  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Main Menu"),
1516  "", "", gotoMainMenu);
1517  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Program Guide"),
1518  "", "", startGuide, "GUIDE");
1519  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Program Finder"),
1520  "", "", startFinder, "FINDER");
1521  //REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Search Listings"),
1522  // "", "", startSearch);
1523  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Manage Recordings / "
1524  "Fix Conflicts"), "", "", startManaged, "VIEWSCHEDULED");
1525  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Manage Recording Rules"),
1526  "", "", startManageRecordingRules);
1527  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Channel Recording "
1528  "Priorities"), "", "", startChannelRecPriorities);
1529  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "TV Recording Playback"),
1530  "", "", startPlayback, "JUMPREC");
1531  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Live TV"),
1532  "", "", startTVNormal);
1533  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Status Screen"),
1534  "", "", showStatus);
1535  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Previously Recorded"),
1536  "", "", startPrevious);
1537 
1538  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Standby Mode"),
1539  "", "", standbyScreen);
1540 
1541  // Video
1542 
1543  REG_JUMP(JUMP_VIDEO_DEFAULT, QT_TRANSLATE_NOOP("MythControls",
1544  "The Video Default View"), "", jumpScreenVideoDefault);
1545  REG_JUMP(JUMP_VIDEO_MANAGER, QT_TRANSLATE_NOOP("MythControls",
1546  "The Video Manager"), "", jumpScreenVideoManager);
1547  REG_JUMP(JUMP_VIDEO_BROWSER, QT_TRANSLATE_NOOP("MythControls",
1548  "The Video Browser"), "", jumpScreenVideoBrowser);
1549  REG_JUMP(JUMP_VIDEO_TREE, QT_TRANSLATE_NOOP("MythControls",
1550  "The Video Listings"), "", jumpScreenVideoTree);
1551  REG_JUMP(JUMP_VIDEO_GALLERY, QT_TRANSLATE_NOOP("MythControls",
1552  "The Video Gallery"), "", jumpScreenVideoGallery);
1553  REG_JUMP("Play Disc", QT_TRANSLATE_NOOP("MythControls",
1554  "Play an Optical Disc"), "", playDisc);
1555 
1556  // Gallery
1557 
1558  REG_JUMP(JUMP_GALLERY_DEFAULT, QT_TRANSLATE_NOOP("MythControls",
1559  "Image Gallery"), "", RunGallery);
1560 
1561  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Toggle Show Widget Borders"),
1562  "", "", setDebugShowBorders, false);
1563  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Toggle Show Widget Names"),
1564  "", "", setDebugShowNames, false);
1565  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Reset All Keys"),
1566  QT_TRANSLATE_NOOP("MythControls", "Reset all keys to defaults"),
1567  "", resetAllKeys, false);
1568 }
1569 
1570 static void ReloadJumpPoints(void)
1571 {
1572  MythMainWindow *mainWindow = GetMythMainWindow();
1573  mainWindow->ClearAllJumps();
1574  InitJumpPoints();
1575 }
1576 
1577 static void InitKeys(void)
1578 {
1579  REG_KEY("Video","PLAYALT", QT_TRANSLATE_NOOP("MythControls",
1580  "Play selected item in alternate player"), "ALT+P");
1581  REG_KEY("Video","FILTER", QT_TRANSLATE_NOOP("MythControls",
1582  "Open video filter dialog"), "F");
1583  REG_KEY("Video","INCPARENT", QT_TRANSLATE_NOOP("MythControls",
1584  "Increase Parental Level"), "],},F11");
1585  REG_KEY("Video","DECPARENT", QT_TRANSLATE_NOOP("MythControls",
1586  "Decrease Parental Level"), "[,{,F10");
1587  REG_KEY("Video","INCSEARCH", QT_TRANSLATE_NOOP("MythControls",
1588  "Show Incremental Search Dialog"), "Ctrl+S");
1589  REG_KEY("Video","DOWNLOADDATA", QT_TRANSLATE_NOOP("MythControls",
1590  "Download metadata for current item"), "W");
1591  REG_KEY("Video","ITEMDETAIL", QT_TRANSLATE_NOOP("MythControls",
1592  "Display Item Detail Popup"), "");
1593 
1594  // Gallery keybindings
1595  REG_KEY("Images", "PLAY", QT_TRANSLATE_NOOP("MythControls",
1596  "Start/Stop Slideshow"), "P");
1597  REG_KEY("Images", "RECURSIVESHOW", QT_TRANSLATE_NOOP("MythControls",
1598  "Start Recursive Slideshow"), "R");
1599  REG_KEY("Images", "ROTRIGHT", QT_TRANSLATE_NOOP("MythControls",
1600  "Rotate image right 90 degrees"), "],3");
1601  REG_KEY("Images", "ROTLEFT", QT_TRANSLATE_NOOP("MythControls",
1602  "Rotate image left 90 degrees"), "[,1");
1603  REG_KEY("Images", "FLIPHORIZONTAL", QT_TRANSLATE_NOOP("MythControls",
1604  "Flip image horizontally"), "");
1605  REG_KEY("Images", "FLIPVERTICAL", QT_TRANSLATE_NOOP("MythControls",
1606  "Flip image vertically"), "");
1607  REG_KEY("Images", "ZOOMOUT", QT_TRANSLATE_NOOP("MythControls",
1608  "Zoom image out"), "7");
1609  REG_KEY("Images", "ZOOMIN", QT_TRANSLATE_NOOP("MythControls",
1610  "Zoom image in"), "9");
1611  REG_KEY("Images", "FULLSIZE", QT_TRANSLATE_NOOP("MythControls",
1612  "Full-size (un-zoom) image"), "0");
1613  REG_KEY("Images", "MARK", QT_TRANSLATE_NOOP("MythControls",
1614  "Mark image"), "T");
1615  REG_KEY("Images", "SCROLLUP", QT_TRANSLATE_NOOP("MythControls",
1616  "Scroll image up"), "2");
1617  REG_KEY("Images", "SCROLLLEFT", QT_TRANSLATE_NOOP("MythControls",
1618  "Scroll image left"), "4");
1619  REG_KEY("Images", "SCROLLRIGHT", QT_TRANSLATE_NOOP("MythControls",
1620  "Scroll image right"), "6");
1621  REG_KEY("Images", "SCROLLDOWN", QT_TRANSLATE_NOOP("MythControls",
1622  "Scroll image down"), "8");
1623  REG_KEY("Images", "RECENTER", QT_TRANSLATE_NOOP("MythControls",
1624  "Recenter image"), "5");
1625  REG_KEY("Images", "COVER", QT_TRANSLATE_NOOP("MythControls",
1626  "Set or clear cover image"), "C");
1627 }
1628 
1629 static void ReloadKeys(void)
1630 {
1631  MythMainWindow* mainwindow = GetMythMainWindow();
1632  if (mainwindow)
1633  mainwindow->ClearKeyContext("Video");
1634  InitKeys();
1635  if (mainwindow)
1636  mainwindow->ReloadKeys();
1637 }
1638 
1639 static void SetFuncPtrs(void)
1640 {
1641  TV::SetFuncPtr("playbackbox", (void *)PlaybackBox::RunPlaybackBox);
1642  TV::SetFuncPtr("viewscheduled", (void *)ViewScheduled::RunViewScheduled);
1643  TV::SetFuncPtr("programguide", (void *)GuideGrid::RunProgramGuide);
1644  TV::SetFuncPtr("programfinder", (void *)RunProgramFinder);
1645  TV::SetFuncPtr("scheduleeditor", (void *)ScheduleEditor::RunScheduleEditor);
1646 }
1647 
1651 static void clearAllKeys(void)
1652 {
1653  MSqlQuery query(MSqlQuery::InitCon());
1654 
1655  query.prepare("DELETE FROM keybindings "
1656  "WHERE hostname = :HOSTNAME;");
1657  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1658  if (!query.exec())
1659  MythDB::DBError("Deleting keybindings", query);
1660  query.prepare("DELETE FROM jumppoints "
1661  "WHERE hostname = :HOSTNAME;");
1662  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1663  if (!query.exec())
1664  MythDB::DBError("Deleting jumppoints", query);
1665 }
1666 
1670 static void resetAllKeys(void)
1671 {
1672  clearAllKeys();
1673  // Reload MythMainWindow bindings
1675  // Reload Jump Points
1676  ReloadJumpPoints();
1677  // Reload mythfrontend and TV bindings
1678  ReloadKeys();
1679 }
1680 
1682 {
1683  REG_MEDIAPLAYER("Internal", QT_TRANSLATE_NOOP("MythControls",
1684  "MythTV's native media player."), internal_play_media);
1685  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1686  "MythDVD DVD Media Handler"), "", handleDVDMedia,
1687  MEDIATYPE_DVD, QString());
1688  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1689  "MythImage Media Handler 1/2"), "", handleGalleryMedia,
1690  MEDIATYPE_DATA | MEDIATYPE_MIXED, QString());
1691 
1692  QStringList extensions(ImageAdapterBase::SupportedImages()
1694 
1695  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1696  "MythImage Media Handler 2/2"), "", handleGalleryMedia,
1697  MEDIATYPE_MGALLERY | MEDIATYPE_MVIDEO, extensions.join(","));
1698  return 0;
1699 }
1700 
1701 static void CleanupMyOldInUsePrograms(void)
1702 {
1703  MSqlQuery query(MSqlQuery::InitCon());
1704 
1705  query.prepare("DELETE FROM inuseprograms "
1706  "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1707  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1708  if (!query.exec())
1709  MythDB::DBError("CleanupMyOldInUsePrograms", query);
1710 }
1711 
1712 static bool WasAutomaticStart(void)
1713 {
1714  bool autoStart = false;
1715 
1716  // Is backend running?
1717  //
1719  {
1720  QDateTime startupTime = QDateTime();
1721 
1722  if( gCoreContext->IsMasterHost() )
1723  {
1724  QString s = gCoreContext->GetSetting("MythShutdownWakeupTime", "");
1725  if (!s.isEmpty())
1726  startupTime = MythDate::fromString(s);
1727 
1728  // if we don't have a valid startup time assume we were started manually
1729  if (startupTime.isValid())
1730  {
1731  auto startupSecs = gCoreContext->GetDurSetting<std::chrono::seconds>("StartupSecsBeforeRecording");
1732  startupSecs = std::max(startupSecs, 15 * 60s);
1733  // If we started within 'StartupSecsBeforeRecording' OR 15 minutes
1734  // of the saved wakeup time assume we either started automatically
1735  // to record, to obtain guide data or or for a
1736  // daily wakeup/shutdown period
1737  if (abs(MythDate::secsInPast(startupTime)) < startupSecs)
1738  {
1739  LOG(VB_GENERAL, LOG_INFO,
1740  "Close to auto-start time, AUTO-Startup assumed");
1741 
1742  QString str = gCoreContext->GetSetting("MythFillSuggestedRunTime");
1743  QDateTime guideRunTime = MythDate::fromString(str);
1744  if (MythDate::secsInPast(guideRunTime) < startupSecs)
1745  {
1746  LOG(VB_GENERAL, LOG_INFO,
1747  "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1748  }
1749  autoStart = true;
1750  }
1751  else
1752  LOG(VB_GENERAL, LOG_DEBUG,
1753  "NOT close to auto-start time, USER-initiated startup assumed");
1754  }
1755  }
1756  else
1757  {
1758  QString wakeupCmd = gCoreContext->GetSetting("WakeUpCommand");
1759 
1760  // A slave backend that has no wakeup command cannot be woken
1761  // automatically so can be ignored.
1762  if (!wakeupCmd.isEmpty())
1763  {
1764  ProgramList progList;
1765  bool bConflicts = false;
1766  QDateTime nextRecordingStart;
1767 
1768  if (LoadFromScheduler(progList, bConflicts))
1769  {
1770  // Find the first recording to be recorded
1771  // on this machine
1772  QString hostname = gCoreContext->GetHostName();
1773  for (auto *prog : progList)
1774  {
1775  if ((prog->GetRecordingStatus() == RecStatus::WillRecord ||
1776  prog->GetRecordingStatus() == RecStatus::Pending) &&
1777  (prog->GetHostname() == hostname) &&
1778  (nextRecordingStart.isNull() ||
1779  nextRecordingStart > prog->GetRecordingStartTime()))
1780  {
1781  nextRecordingStart = prog->GetRecordingStartTime();
1782  }
1783  }
1784 
1785  if (!nextRecordingStart.isNull() &&
1786  (abs(MythDate::secsInPast(nextRecordingStart)) < 4min))
1787  {
1788  LOG(VB_GENERAL, LOG_INFO,
1789  "Close to start time, AUTO-Startup assumed");
1790 
1791  // If we started within 4 minutes of the next recording,
1792  // we almost certainly started automatically.
1793  autoStart = true;
1794  }
1795  else
1796  LOG(VB_GENERAL, LOG_DEBUG,
1797  "NOT close to auto-start time, USER-initiated startup assumed");
1798 
1799  }
1800  }
1801  }
1802  }
1803 
1804  return autoStart;
1805 }
1806 
1807 // from https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=16897
1808 // The old way of revoking root with setuid(getuid())
1809 // causes system hang in certain cases on raspberry pi
1810 
1811 static int revokeRoot (void)
1812 {
1813  if (getuid () == 0 && geteuid () == 0) // Really running as root
1814  return 0;
1815 
1816  if (geteuid () == 0) // Running setuid root
1817  return seteuid (getuid ()) ; // Change effective uid to the uid of the caller
1818  return 0;
1819 }
1820 
1821 
1822 int main(int argc, char **argv)
1823 {
1824  bool bPromptForBackend = false;
1825  bool bBypassAutoDiscovery = false;
1826 
1828  if (!cmdline.Parse(argc, argv))
1829  {
1830  cmdline.PrintHelp();
1832  }
1833 
1834  if (cmdline.toBool("showhelp"))
1835  {
1836  cmdline.PrintHelp();
1837  return GENERIC_EXIT_OK;
1838  }
1839 
1840  if (cmdline.toBool("showversion"))
1841  {
1843  return GENERIC_EXIT_OK;
1844  }
1845 
1847  QApplication::setSetuidAllowed(true);
1848  QApplication a(argc, argv);
1849  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHFRONTEND);
1850  CleanupGuard callCleanup(cleanup);
1851 
1852 #ifdef Q_OS_MAC
1853  QString path = QCoreApplication::applicationDirPath();
1854  setenv("PYTHONPATH",
1855  QString("%1/../Resources/lib/%2/site-packages:%3")
1856  .arg(path)
1857  .arg(QFileInfo(PYTHON_EXE).fileName())
1858  .arg(QProcessEnvironment::systemEnvironment().value("PYTHONPATH"))
1859  .toUtf8().constData(), 1);
1860 #endif
1861 
1862 #ifndef _WIN32
1863  QList<int> signallist;
1864  signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
1865  << SIGILL;
1866 #if ! CONFIG_DARWIN
1867  signallist << SIGRTMIN;
1868 #endif
1869  SignalHandler::Init(signallist);
1872  SignalHandler::SetHandler(SIGHUP, logSigHup);
1873 #endif
1874 
1875  int retval = cmdline.ConfigureLogging();
1876  if (retval != GENERIC_EXIT_OK)
1877  return retval;
1878 
1879  bool ResetSettings = false;
1880 
1881  if (cmdline.toBool("prompt"))
1882  bPromptForBackend = true;
1883  if (cmdline.toBool("noautodiscovery"))
1884  bBypassAutoDiscovery = true;
1885 
1886  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
1887  std::cerr << "Unable to ignore SIGPIPE\n";
1888 
1889  if (!cmdline.toString("geometry").isEmpty())
1891 
1892  fe_sd_notify("STATUS=Connecting to database.");
1894  gCoreContext->SetAsFrontend(true);
1895 
1897  if (!gContext->Init(true, bPromptForBackend, bBypassAutoDiscovery))
1898  {
1899  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
1900  gCoreContext->SetExiting(true);
1902  }
1903 
1905 
1906  if (!GetMythDB()->HaveSchema())
1907  {
1908  if (!InitializeMythSchema())
1909  return GENERIC_EXIT_DB_ERROR;
1910  }
1911 
1912  if (cmdline.toBool("reset"))
1913  ResetSettings = true;
1914 
1915  if (!cmdline.toBool("noupnp"))
1916  {
1917  fe_sd_notify("STATUS=Creating UPnP media renderer");
1918  g_pUPnp = new MediaRenderer();
1919  if (!g_pUPnp->isInitialized())
1920  {
1921  delete g_pUPnp;
1922  g_pUPnp = nullptr;
1923  }
1924  }
1925 
1926  QString fileprefix = GetConfDir();
1927 
1928  QDir dir(fileprefix);
1929  if (!dir.exists())
1930  dir.mkdir(fileprefix);
1931 
1932  if (ResetSettings)
1933  {
1934  AppearanceSettings as;
1935  as.Save();
1936 
1938  gCoreContext->GetDB()->ClearSetting("Language");
1939  gCoreContext->GetDB()->ClearSettingOnHost("Language", nullptr);
1940  gCoreContext->GetDB()->ClearSetting("Country");
1941  gCoreContext->GetDB()->ClearSettingOnHost("Country", nullptr);
1942 
1943  LOG(VB_GENERAL, LOG_NOTICE, "Appearance settings and language have "
1944  "been reset to defaults. You will need to "
1945  "restart the frontend.");
1946  gContext-> saveSettingsCache();
1947  return GENERIC_EXIT_OK;
1948  }
1949 
1950  QCoreApplication::setSetuidAllowed(true);
1951 
1952  if (revokeRoot() != 0)
1953  {
1954  LOG(VB_GENERAL, LOG_ERR, "Failed to revokeRoot(), exiting.");
1955  return GENERIC_EXIT_NOT_OK;
1956  }
1957 
1958 #ifdef USING_LIBDNS_SD
1959  // this needs to come after gCoreContext has been initialised
1960  // (for hostname) - hence it is not in MediaRenderer
1961  QScopedPointer<BonjourRegister> bonjour(new BonjourRegister());
1962  if (bonjour.data())
1963  {
1964  fe_sd_notify("STATUS=Registering frontend with bonjour");
1965  QByteArray dummy;
1966  int port = gCoreContext->GetNumSetting("UPnP/MythFrontend/ServicePort", 6547);
1967  QByteArray name("Mythfrontend on ");
1968  name.append(gCoreContext->GetHostName().toUtf8());
1969  bonjour->Register(port, "_mythfrontend._tcp",
1970  name, dummy);
1971  }
1972 #endif
1973 
1974  fe_sd_notify("STATUS=Initializing LCD");
1975  LCD::SetupLCD();
1976  if (LCD *lcd = LCD::Get())
1977  lcd->setupLEDs(RemoteGetRecordingMask);
1978 
1979  fe_sd_notify("STATUS=Loading translation");
1980  MythTranslation::load("mythfrontend");
1981 
1982  fe_sd_notify("STATUS=Loading themes");
1983  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
1984 
1985  QString themedir = GetMythUI()->FindThemeDir(themename);
1986  if (themedir.isEmpty())
1987  {
1988  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
1989  .arg(themename));
1990  return GENERIC_EXIT_NO_THEME;
1991  }
1992 
1993  themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
1994  themedir = GetMythUI()->FindThemeDir(themename);
1995  if (themedir.isEmpty())
1996  {
1997  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
1998  .arg(themename));
1999  return GENERIC_EXIT_NO_THEME;
2000  }
2001 
2002  auto * mainWindow = GetMythMainWindow();
2003 
2004  // Force an update of our hardware decoder/render support once the window is
2005  // ready and we have a render device (and after each window re-initialisation
2006  // when we may have a new render device). This also ensures the support checks
2007  // are done immediately and are not reliant on semi-random settings initialisation.
2008  QObject::connect(mainWindow, &MythMainWindow::SignalWindowReady,
2009  []() { MythVideoProfile::InitStatics(true); } );
2010 
2011  mainWindow->Init(false);
2012  mainWindow->setWindowTitle(QCoreApplication::translate("(MythFrontendMain)",
2013  "MythTV Frontend",
2014  "Main window title"));
2015 
2016 #ifdef USING_AIRPLAY
2017  if (gCoreContext->GetBoolSetting("AirPlayEnabled", true))
2018  {
2019  fe_sd_notify("STATUS=Initializing AirPlay");
2021  if (!gCoreContext->GetBoolSetting("AirPlayAudioOnly", false))
2022  {
2024  }
2025  }
2026 #endif
2027 
2028  // We must reload the translation after a language change and this
2029  // also means clearing the cached/loaded theme strings, so reload the
2030  // theme which also triggers a translation reload
2032  {
2033  if (!reloadTheme())
2034  return GENERIC_EXIT_NO_THEME;
2035  }
2036 
2037  if (!UpgradeTVDatabaseSchema(false, false, true))
2038  {
2039  LOG(VB_GENERAL, LOG_ERR,
2040  "Couldn't upgrade database to new schema, exiting.");
2042  }
2043 
2044  WriteDefaults();
2045 
2046  // Refresh Global/Main Menu keys after DB update in case there was no DB
2047  // when they were written originally
2048  mainWindow->ReloadKeys();
2049 
2050  fe_sd_notify("STATUS=Initializing jump points");
2051  InitJumpPoints();
2052  InitKeys();
2053  TV::InitKeys();
2054  SetFuncPtrs();
2055 
2057 
2059 
2060  setHttpProxy();
2061 
2062  fe_sd_notify("STATUS=Initializing plugins");
2063  g_pmanager = new MythPluginManager();
2065 
2066  fe_sd_notify("STATUS=Initializing media monitor");
2068  if (mon)
2069  {
2070  mon->StartMonitoring();
2071  mainWindow->installEventFilter(mon);
2072  }
2073 
2074  fe_sd_notify("STATUS=Initializing network control");
2075  NetworkControl *networkControl = nullptr;
2076  if (gCoreContext->GetBoolSetting("NetworkControlEnabled", false))
2077  {
2078  int port = gCoreContext->GetNumSetting("NetworkControlPort", 6546);
2079  networkControl = new NetworkControl();
2080  if (!networkControl->listen(port))
2081  {
2082  LOG(VB_GENERAL, LOG_ERR,
2083  QString("NetworkControl failed to bind to port %1.")
2084  .arg(port));
2085  }
2086  }
2087 
2088 #if CONFIG_DARWIN
2090  GetMythMainWindow()->Init();
2093  gLoaded = true;
2094 #endif
2095  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
2096  {
2097  return GENERIC_EXIT_NO_THEME;
2098  }
2099  fe_sd_notify("STATUS=Loading theme updates");
2100  std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2101  if (gCoreContext->GetBoolSetting("ThemeUpdateNofications", true))
2102  themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2103 
2105 
2107 
2109  PreviewGenerator::kRemote, 50, 60s);
2110 
2111  fe_sd_notify("STATUS=Creating housekeeper");
2112  auto *housekeeping = new HouseKeeper();
2113 #ifdef __linux__
2114  #ifdef CONFIG_BINDINGS_PYTHON
2116  #endif
2117 #endif
2118  housekeeping->Start();
2119 
2120 
2121  if (cmdline.toBool("runplugin"))
2122  {
2123  QStringList plugins = g_pmanager->EnumeratePlugins();
2124 
2125  if (plugins.contains(cmdline.toString("runplugin")))
2126  g_pmanager->run_plugin(cmdline.toString("runplugin"));
2127  else if (plugins.contains("myth" + cmdline.toString("runplugin")))
2128  g_pmanager->run_plugin("myth" + cmdline.toString("runplugin"));
2129  else
2130  {
2131  LOG(VB_GENERAL, LOG_ERR,
2132  QString("Invalid plugin name supplied on command line: '%1'")
2133  .arg(cmdline.toString("runplugin")));
2134  LOG(VB_GENERAL, LOG_ERR,
2135  QString("Available plugins: %1")
2136  .arg(plugins.join(", ")));
2138  }
2139  }
2140  else if (cmdline.toBool("jumppoint"))
2141  {
2143 
2144  if (mmw->DestinationExists(cmdline.toString("jumppoint")))
2145  mmw->JumpTo(cmdline.toString("jumppoint"));
2146  else
2147  {
2148  LOG(VB_GENERAL, LOG_ERR,
2149  QString("Invalid jump point supplied on the command line: %1")
2150  .arg(cmdline.toString("jumppoint")));
2151  LOG(VB_GENERAL, LOG_ERR,
2152  QString("Available jump points: %2")
2153  .arg(mmw->EnumerateDestinations().join(", ")));
2155  }
2156  }
2157 
2158  if (WasAutomaticStart())
2159  {
2160  // We appear to have been started automatically
2161  // so enter standby so that the machine can
2162  // shutdown again as soon as possible if necessary.
2163  standbyScreen();
2164  }
2165 
2166  // Provide systemd ready notification (for type=notify units)
2167  fe_sd_notify("STATUS=")
2168  fe_sd_notify("READY=1")
2169 
2170  int ret = QCoreApplication::exec();
2171 
2172  fe_sd_notify("STOPPING=1\nSTATUS=Exiting")
2173  if (ret==0)
2174  gContext-> saveSettingsCache();
2175 
2176  DestroyMythUI();
2178 
2179  delete housekeeping;
2180 
2182 
2183  if (mon)
2184  mon->deleteLater();
2185 
2186  delete networkControl;
2187  return ret;
2188 }
2189 
2190 void handleSIGUSR1(void)
2191 {
2192  LOG(VB_GENERAL, LOG_INFO, "Reloading theme");
2193  gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
2195  GetMythMainWindow()->JumpTo("Reload Theme");
2197 }
2198 
2199 void handleSIGUSR2(void)
2200 {
2201  LOG(VB_GENERAL, LOG_INFO, "Restarting LIRC handler");
2203 }
2204 
2205 #include "main.moc"
2206 /* vim: set expandtab tabstop=4 shiftwidth=4: */
MythMediaDevice::isUsable
bool isUsable() const
Is this device "ready", for a plugin to access?
Definition: mythmedia.h:84
resetAllKeys
static void resetAllKeys(void)
Reset this host's key bindings and jump points to default values.
Definition: mythtv/programs/mythfrontend/main.cpp:1670
scheduleeditor.h
MythCoreContext::SetPluginManager
void SetPluginManager(MythPluginManager *pmanager)
Definition: mythcorecontext.cpp:2079
themedir
static QString themedir
Definition: mythdirs.cpp:21
globalsettings.h
MEDIATYPE_MIXED
@ MEDIATYPE_MIXED
Definition: mythmedia.h:27
TV::InitKeys
static void InitKeys()
Definition: tv_play.cpp:468
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:124
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:317
startSearchTime
static void startSearchTime(void)
Definition: mythtv/programs/mythfrontend/main.cpp:478
hardwareprofile.h
MythVideoProfile::InitStatics
static void InitStatics(bool Reinit=false)
Definition: mythvideoprofile.cpp:1311
PlaybackBox::RunPlaybackBox
static void * RunPlaybackBox(void *player, bool showTV)
Definition: playbackbox.cpp:368
HouseKeeper
Manages registered HouseKeeperTasks and queues tasks for operation.
Definition: housekeeper.h:150
MythCoreContext::SendMessage
void SendMessage(const QString &message)
Definition: mythcorecontext.cpp:1531
tv.h
MEDIATYPE_DVD
@ MEDIATYPE_DVD
Definition: mythmedia.h:29
plPeopleSearch
@ plPeopleSearch
Definition: proglist.h:18
videometadatasettings.h
GENERIC_EXIT_OK
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
MythUILocation::RemoveCurrentLocation
QString RemoveCurrentLocation()
Definition: mythuilocation.cpp:12
GuideGrid::RunProgramGuide
static void RunProgramGuide(uint startChanId, const QString &startChanNum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
Definition: guidegrid.cpp:414
ThemeChooser
View and select installed themes.
Definition: themechooser.h:27
GeneralSetupWizard
Definition: setupwizard_general.h:14
setHttpProxy
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
Definition: mythmiscutil.cpp:854
MythPluginManager
Definition: mythplugin.h:62
MythMainWindow::Init
void Init(bool MayReInit=true)
Definition: mythmainwindow.cpp:640
MythUIScreenBounds::ParseGeometryOverride
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
Definition: mythuiscreenbounds.cpp:39
MythMainWindow::ReinitDone
void ReinitDone()
Definition: mythmainwindow.cpp:959
sysEventHandler
MythSystemEventHandler * sysEventHandler
Definition: backendcontext.cpp:15
LoadFromScheduler
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
Definition: programinfo.h:892
ShowNotificationError
void ShowNotificationError(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
convenience utility to display error message as notification
Definition: mythnotificationcenter.cpp:1428
ManualSchedule
Definition: manualschedule.h:20
startSearchStored
static void startSearchStored(void)
Definition: mythtv/programs/mythfrontend/main.cpp:428
customedit.h
guidegrid.h
startPreviousOld
static void startPreviousOld(void)
Definition: mythtv/programs/mythfrontend/main.cpp:568
mythdb.h
MythTranslation::reload
static void reload()
Reload all active translators based on the current language setting.
Definition: mythtranslation.cpp:98
PlaybackSettingsDialog
Definition: globalsettings.h:17
MythSystemLegacy
Definition: mythsystemlegacy.h:67
reloadTheme_void
static void reloadTheme_void(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1486
MythAirplayServer::Create
static bool Create(void)
Definition: mythairplayserver.cpp:356
exitprompt.h
ChannelUtil::LoadChannels
static ChannelInfoList LoadChannels(uint startIndex, uint count, uint &totalAvailable, bool ignoreHidden=true, OrderBy orderBy=kChanOrderByChanNum, GroupBy groupBy=kChanGroupByChanid, uint sourceID=0, uint channelGroupID=0, bool liveTVOnly=false, const QString &callsign="", const QString &channum="", bool ignoreUntunable=true)
Load channels from database into a list of ChannelInfo objects.
Definition: channelutil.cpp:2408
UpgradeTVDatabaseSchema
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
Definition: dbcheck.cpp:361
PreviewGenerator::kRemote
@ kRemote
Definition: previewgenerator.h:43
startKeysSetup
static void startKeysSetup()
Definition: mythtv/programs/mythfrontend/main.cpp:363
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
startTVNormal
static void startTVNormal(void)
Definition: mythtv/programs/mythfrontend/main.cpp:615
MediaMonitor::GetMediaMonitor
static MediaMonitor * GetMediaMonitor(void)
Definition: mythmediamonitor.cpp:83
MythCDROM::kBluray
@ kBluray
Definition: mythcdrom.h:29
GrabberSettings
Definition: grabbersettings.h:13
MythMainWindow::SignalWindowReady
void SignalWindowReady()
ReloadKeys
static void ReloadKeys(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1629
MythPluginManager::run_plugin
bool run_plugin(const QString &plugname)
Definition: mythplugin.cpp:159
setDebugShowBorders
static void setDebugShowBorders(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1493
simple_ref_ptr< class VideoList >
MythCoreContext::emitTVPlaybackStopped
void emitTVPlaybackStopped(void)
Definition: mythcorecontext.h:288
jumpScreenVideoTree
static void jumpScreenVideoTree()
Definition: mythtv/programs/mythfrontend/main.cpp:719
RunProgramFinder
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
Definition: progfind.cpp:35
ProgramRecPriority
Definition: programrecpriority.h:60
mythplugin.h
REG_MEDIAPLAYER
#define REG_MEDIAPLAYER(a, b, c)
Definition: mythmainwindow.h:24
MythMainWindow::JumpTo
void JumpTo(const QString &Destination, bool Pop=true)
Definition: mythmainwindow.cpp:1452
mythcdrom.h
plChannel
@ plChannel
Definition: proglist.h:24
startPlaybackWithGroup
static void startPlaybackWithGroup(const QString &recGroup="")
Definition: mythtv/programs/mythfrontend/main.cpp:536
NetworkControl
Definition: networkcontrol.h:97
ChannelGroupsSetting
Definition: globalsettings.h:303
internal_media_init
static int internal_media_init()
Definition: mythtv/programs/mythfrontend/main.cpp:1681
ParentalLevel::plMedium
@ plMedium
Definition: parentalcontrols.h:12
MythContext
Startup context for MythTV.
Definition: mythcontext.h:43
PlaybackSettings
Definition: globalsettings.h:32
ExitPrompter
Definition: mythfrontend/exitprompt.h:6
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
ParentalLevel::plHigh
@ plHigh
Definition: parentalcontrols.h:13
MythCoreContext::OverrideSettingForSession
void OverrideSettingForSession(const QString &key, const QString &value)
Definition: mythcorecontext.cpp:1350
VideoDialog::DLG_BROWSER
@ DLG_BROWSER
Definition: videodlg.h:36
ChannelUtil::kChanGroupByChanid
@ kChanGroupByChanid
Definition: channelutil.h:209
MediaMonitor::StartMonitoring
virtual void StartMonitoring(void)
Start the monitoring thread if needed.
Definition: mythmediamonitor.cpp:456
MythMainWindow::ClearAllJumps
void ClearAllJumps()
Definition: mythmainwindow.cpp:1444
WriteDefaults
static void WriteDefaults()
Definition: mythtv/programs/mythfrontend/main.cpp:1232
mythdvdbuffer.h
RemoteGetFreeRecorderCount
int RemoteGetFreeRecorderCount(void)
Definition: tvremoteutil.cpp:167
setupwizard_general.h
BackendConnectionManager
Definition: backendconnectionmanager.h:7
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:113
setenv
#define setenv(x, y, z)
Definition: compat.h:157
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:265
mythdbcon.h
plCategory
@ plCategory
Definition: proglist.h:23
CleanupMyOldInUsePrograms
static void CleanupMyOldInUsePrograms(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1701
jumpScreenVideoManager
static void jumpScreenVideoManager()
Definition: mythtv/programs/mythfrontend/main.cpp:717
ProgLister
Definition: proglist.h:31
mythmediamonitor.h
MEDIASTAT_USEABLE
@ MEDIASTAT_USEABLE
Definition: mythmedia.h:19
MythMainWindow::ReloadKeys
void ReloadKeys()
Definition: mythmainwindow.cpp:951
PreviewGeneratorQueue::CreatePreviewGeneratorQueue
static void CreatePreviewGeneratorQueue(PreviewGenerator::Mode mode, uint maxAttempts, std::chrono::seconds minBlockSeconds)
Create the singleton queue of preview generators.
Definition: previewgeneratorqueue.cpp:43
REG_JUMPLOC
#define REG_JUMPLOC(a, b, c, d, e)
Definition: mythmainwindow.h:22
MythCoreContext::emitTVPlaybackStarted
void emitTVPlaybackStarted(void)
Definition: mythcorecontext.h:287
MythUIType::customEvent
void customEvent(QEvent *event) override
Definition: mythuitype.cpp:984
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:604
isLiveTVAvailable
static bool isLiveTVAvailable(void)
Definition: mythtv/programs/mythfrontend/main.cpp:601
grabbersettings.h
ReferenceCounter::PrintDebug
static void PrintDebug(void)
Print out any leaks if that level of debugging is enabled.
Definition: referencecounter.cpp:72
RemoteGetRecordingMask
int RemoteGetRecordingMask(void)
Definition: remoteutil.cpp:384
MythMediaDevice::getStatus
MythMediaStatus getStatus() const
Definition: mythmedia.h:70
ChannelUtil::kChanOrderByLiveTV
@ kChanOrderByLiveTV
Definition: channelutil.h:202
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
BonjourRegister
Definition: bonjourregister.h:11
playgroup.h
SettingsHelper::RunEpilog
void RunEpilog(void)
Definition: settingshelper.h:29
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
MythThemedMenu::foundTheme
bool foundTheme(void) const
Returns true iff a theme has been found by a previous call to SetMenuTheme().
Definition: myththemedmenu.cpp:144
MYTH_APPNAME_MYTHFRONTEND
#define MYTH_APPNAME_MYTHFRONTEND
Definition: mythcorecontext.h:21
cleanup.h
statusbox.h
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:46
mythsystemevent.h
MEDIASTAT_MOUNTED
@ MEDIASTAT_MOUNTED
Definition: mythmedia.h:21
VideoDialog::GetSavedVideoList
static VideoListDeathDelayPtr & GetSavedVideoList()
Definition: videodlg.cpp:843
HouseKeeper::RegisterTask
void RegisterTask(HouseKeeperTask *task)
Definition: housekeeper.cpp:635
mythdirs.h
GENERIC_EXIT_INVALID_CMDLINE
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
Definition: exitcodes.h:15
MythAirplayServer::Cleanup
static void Cleanup(void)
Definition: mythairplayserver.cpp:395
progfind.h
startManageRecordingRules
static void startManageRecordingRules(void)
Definition: mythtv/programs/mythfrontend/main.cpp:500
myth_system
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
Definition: mythsystemlegacy.cpp:502
MythMainWindow::GetPainter
MythPainter * GetPainter()
Definition: mythmainwindow.cpp:257
MythBDInfo::IsValid
bool IsValid(void) const
Definition: mythbdinfo.cpp:157
startSearchChannel
static void startSearchChannel(void)
Definition: mythtv/programs/mythfrontend/main.cpp:438
ParentalLevelChangeChecker
Definition: parentalcontrols.h:43
networkcontrol.h
remoteutil.h
g_pUPnp
static MediaRenderer * g_pUPnp
Definition: mythtv/programs/mythfrontend/main.cpp:130
LCD::Get
static LCD * Get(void)
Definition: lcddevice.cpp:68
OSDSettings
Definition: globalsettings.h:110
MythMainWindow::HandleMedia
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
Definition: mythmainwindow.cpp:1491
AudioConfigScreen
Definition: audiogeneralsettings.h:24
ReloadJumpPoints
static void ReloadJumpPoints(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1570
TV::StartTV
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
Definition: tv_play.cpp:265
VideoDialog::DialogType
DialogType
Definition: videodlg.h:36
JUMP_VIDEO_TREE
const QString JUMP_VIDEO_TREE
Definition: globals.cpp:38
proglist.h
langsettings.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:31
mythairplayserver.h
channelrecpriority.h
MythMainWindow::SetEffectsEnabled
void SetEffectsEnabled(bool Enable)
Definition: mythmainwindow.cpp:1033
prevreclist.h
mythversion.h
mythsystemlegacy.h
MythDisplay::ConfigureQtGUI
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialistaion code for all MythTV GUI applications.
Definition: mythdisplay.cpp:1152
PlayGroupEditor
Definition: playgroup.h:25
RecStatus::WillRecord
@ WillRecord
Definition: recStatus.h:31
main
int main(int argc, char **argv)
Definition: mythtv/programs/mythfrontend/main.cpp:1822
MythScreenStack::GetScreenList
void GetScreenList(QVector< MythScreenType * > &screens)
Definition: mythscreenstack.cpp:198
quit
@ quit
Definition: lirc_client.h:30
MythCommandLineParser::Parse
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
Definition: mythcommandlineparser.cpp:1435
playbackbox.h
startSearchKeyword
static void startSearchKeyword(void)
Definition: mythtv/programs/mythfrontend/main.cpp:398
IdleScreen
Definition: idlescreen.h:12
StandardSettingDialog
Definition: standardsettings.h:468
InitializeMythSchema
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
Definition: dbcheck.cpp:3853
StandardSettingDialog::Create
bool Create(void) override
Definition: standardsettings.cpp:769
REG_KEY
#define REG_KEY(a, b, c, d)
Definition: mythmainwindow.h:19
plTitleSearch
@ plTitleSearch
Definition: proglist.h:16
MythFrontendCommandLineParser
Definition: mythfrontend/commandlineparser.h:6
startAppearWiz
static void startAppearWiz(void)
Definition: mythtv/programs/mythfrontend/main.cpp:314
programinfo.h
programrecpriority.h
resetTheme
static bool resetTheme(QString themedir, const QString &badtheme)
Definition: mythtv/programs/mythfrontend/main.cpp:1383
g_pmanager
static MythPluginManager * g_pmanager
Definition: mythtv/programs/mythfrontend/main.cpp:131
playDisc
static void playDisc()
Definition: mythtv/programs/mythfrontend/main.cpp:738
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
TV::ConfiguredTunerCards
static int ConfiguredTunerCards()
If any cards are configured, return the number.
Definition: tv_play.cpp:96
videolist.h
FileAssocDialog
Definition: videofileassoc.h:13
MythCoreContext::BackendIsRunning
static bool BackendIsRunning(void)
a backend process is running on this host
Definition: mythcorecontext.cpp:725
MythCoreContext::SetAsFrontend
void SetAsFrontend(bool frontend)
Definition: mythcorecontext.cpp:674
startGuide
static void startGuide(void)
Definition: mythtv/programs/mythfrontend/main.cpp:375
startSearchPeople
static void startSearchPeople(void)
Definition: mythtv/programs/mythfrontend/main.cpp:408
startSearchPower
static void startSearchPower(void)
Definition: mythtv/programs/mythfrontend/main.cpp:418
VideoDialog::VideoListDeathDelayPtr
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
Definition: videodlg.h:45
dbcheck.h
handleSIGUSR2
void handleSIGUSR2(void)
Definition: mythtv/programs/mythfrontend/main.cpp:2199
ParentalLevel::Level
Level
Definition: parentalcontrols.h:12
JUMP_VIDEO_MANAGER
const QString JUMP_VIDEO_MANAGER
Definition: globals.cpp:36
signalhandling.h
globals.h
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:536
CleanupGuard
Definition: cleanupguard.h:6
compat.h
kStartTVIgnoreBookmark
@ kStartTVIgnoreBookmark
Definition: tv_play.h:116
FALLBACK_UI_THEME
#define FALLBACK_UI_THEME
Definition: mythuithemehelper.h:8
VideoDialog::DLG_GALLERY
@ DLG_GALLERY
Definition: videodlg.h:36
mythcontrols.h
Main header for mythcontrols.
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:194
bonjourregister.h
custompriority.h
MythCoreContext::GetDurSetting
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
Definition: mythcorecontext.h:170
startSearchNew
static void startSearchNew(void)
Definition: mythtv/programs/mythfrontend/main.cpp:468
PrevRecordedList
Definition: prevreclist.h:29
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:214
SIGUSR1
#define SIGUSR1
Definition: compat.h:217
gallerythumbview.h
Implements Gallery Thumbnail screen.
VideoGeneralSettings
Definition: videoglobalsettings.h:10
mediarenderer.h
MythMainWindow::DestinationExists
bool DestinationExists(const QString &Destination) const
Definition: mythmainwindow.cpp:1465
DestroyMythMainWindow
void DestroyMythMainWindow(void)
Definition: mythmainwindow.cpp:114
MediaRenderer
Definition: mediarenderer.h:29
UPnp::isInitialized
bool isInitialized()
Definition: upnp.h:126
ImageAdapterBase::SupportedImages
static QStringList SupportedImages()
Return recognised pictures.
Definition: imagemanager.cpp:334
sLocation
static const QString sLocation
Definition: mythtv/programs/mythfrontend/main.cpp:144
videofileassoc.h
MythCoreContext::GetDB
MythDB * GetDB(void)
Definition: mythcorecontext.cpp:1773
SIGHUP
#define SIGHUP
Definition: compat.h:214
MythUIThemeHelper::FindThemeDir
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
Definition: mythuithemehelper.cpp:47
SIGPIPE
#define SIGPIPE
Definition: compat.h:219
g_menu
static MythThemedMenu * g_menu
Definition: mythtv/programs/mythfrontend/main.cpp:128
MythCommandLineParser::PrintVersion
static void PrintVersion(void)
Print application version information.
Definition: mythcommandlineparser.cpp:1263
ScheduleEditor::RunScheduleEditor
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
Definition: scheduleeditor.cpp:66
PlaybackSettings::Load
void Load(void) override
Definition: globalsettings.cpp:4312
mythtranslation.h
StandardSetting::Save
virtual void Save(void)
Definition: standardsettings.cpp:233
JUMP_VIDEO_GALLERY
const QString JUMP_VIDEO_GALLERY
Definition: globals.cpp:39
RunGallery
static void RunGallery()
Definition: mythtv/programs/mythfrontend/main.cpp:723
HardwareProfileTask
Definition: hardwareprofile.h:52
startSearchCategory
static void startSearchCategory(void)
Definition: mythtv/programs/mythfrontend/main.cpp:448
scheduledrecording.h
plPowerSearch
@ plPowerSearch
Definition: proglist.h:19
MEDIATYPE_MVIDEO
@ MEDIATYPE_MVIDEO
Definition: mythmedia.h:32
REG_JUMP
#define REG_JUMP(a, b, c, d)
Definition: mythmainwindow.h:21
MythUIBusyDialog
Definition: mythprogressdialog.h:36
TVMenuCallback
static void TVMenuCallback(void *data, QString &selection)
Definition: mythtv/programs/mythfrontend/main.cpp:873
MythBDInfo::GetNameAndSerialNum
bool GetNameAndSerialNum(QString &Name, QString &SerialNum)
Definition: mythbdinfo.cpp:162
VideoDialog::BRS_FOLDER
@ BRS_FOLDER
Definition: videodlg.h:39
RunVideoScreen
static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump=false)
Definition: mythtv/programs/mythfrontend/main.cpp:668
MythCommandLineParser::PrintHelp
void PrintHelp(void) const
Print command line option help.
Definition: mythcommandlineparser.cpp:1279
MythSystemEventEditor
An editor for MythSystemEvent handler commands.
Definition: mythsystemevent.h:50
handleExit
static void handleExit(bool prompt)
Definition: mythtv/programs/mythfrontend/main.cpp:1195
JUMP_VIDEO_BROWSER
const QString JUMP_VIDEO_BROWSER
Definition: globals.cpp:37
GeneralRecPrioritiesSettings
Definition: globalsettings.h:188
GeneralSettings
Definition: globalsettings.h:118
audiogeneralsettings.h
startManualSchedule
static void startManualSchedule(void)
Definition: mythtv/programs/mythfrontend/main.cpp:589
startCustomPriority
static void startCustomPriority(void)
Definition: mythtv/programs/mythfrontend/main.cpp:524
getuid
#define getuid()
Definition: compat.h:261
VideoDialog
Definition: videodlg.h:31
RunMenu
static bool RunMenu(const QString &themedir, const QString &themename)
Definition: mythtv/programs/mythfrontend/main.cpp:1208
kMSPropagateLogs
@ kMSPropagateLogs
add arguments for MythTV log propagation
Definition: mythsystem.h:52
setDebugShowNames
static void setDebugShowNames(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1502
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
JUMP_GALLERY_DEFAULT
const QString JUMP_GALLERY_DEFAULT
Definition: globals.cpp:42
videoglobalsettings.h
ParentalLevelChangeChecker::SigResultReady
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
MythCommandLineParser::ApplySettingsOverride
void ApplySettingsOverride(void)
Apply all overrides to the global context.
Definition: mythcommandlineparser.cpp:2787
MediaMonitor
Definition: mythmediamonitor.h:47
startManaged
static void startManaged(void)
Definition: mythtv/programs/mythfrontend/main.cpp:488
MythMainWindow::EnumerateDestinations
QStringList EnumerateDestinations() const
Definition: mythmainwindow.cpp:1470
handleDVDMedia
static void handleDVDMedia(MythMediaDevice *dvd)
Definition: mythtv/programs/mythfrontend/main.cpp:820
VideoList
Definition: videolist.h:23
CustomEdit
A screen to create a fully custom recording.
Definition: customedit.h:17
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:937
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:216
REG_MEDIA_HANDLER
#define REG_MEDIA_HANDLER(a, b, c, d, e)
Definition: mythmediamonitor.h:143
ViewScheduled::RunViewScheduled
static void * RunViewScheduled(void *player, bool showTv)
Definition: viewscheduled.cpp:32
handleGalleryMedia
static void handleGalleryMedia(MythMediaDevice *dev)
Definition: mythtv/programs/mythfrontend/main.cpp:842
cleanup
static QString cleanup(const QString &str)
Definition: remoteencoder.cpp:672
referencecounter.h
jumpScreenVideoBrowser
static void jumpScreenVideoBrowser()
Definition: mythtv/programs/mythfrontend/main.cpp:718
plStoredSearch
@ plStoredSearch
Definition: proglist.h:27
DEFAULT_UI_THEME
#define DEFAULT_UI_THEME
Definition: mythuithemehelper.h:7
MythUIThemeHelper::InitThemeHelper
void InitThemeHelper()
Definition: mythuithemehelper.cpp:13
channelutil.h
InitJumpPoints
static void InitJumpPoints(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1511
tvremoteutil.h
mythraopdevice.h
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
settingshelper.h
RecStatus::Pending
@ Pending
Definition: recStatus.h:17
taskqueue.h
InitKeys
static void InitKeys(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1577
housekeeping
HouseKeeper * housekeeping
Definition: backendcontext.cpp:10
MythPainter::ShowBorders
bool ShowBorders(void) const
Definition: mythpainter.h:95
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:931
SettingsHelper
Definition: settingshelper.h:7
reloadTheme
static int reloadTheme(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1404
standardsettings.h
AutoDeleteDeque< ProgramInfo * >
StatusBox
Reports on various status items.
Definition: statusbox.h:37
startPrevious
static void startPrevious(void)
Definition: mythtv/programs/mythfrontend/main.cpp:558
MythCDROM::inspectImage
static ImageType inspectImage(const QString &path)
Definition: mythcdrom.cpp:179
PreviewGeneratorQueue::TeardownPreviewGeneratorQueue
static void TeardownPreviewGeneratorQueue()
Destroy the singleton queue of preview generators.
Definition: previewgeneratorqueue.cpp:56
mythuihelper.h
ChannelRecPriority
Screen for managing channel priorities in recording scheduling decisions.
Definition: channelrecpriority.h:22
MYTH_BINARY_VERSION
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:15
mythbdbuffer.h
revokeRoot
static int revokeRoot(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1811
MythPainter::ShowTypeNames
bool ShowTypeNames(void) const
Definition: mythpainter.h:96
GENERIC_EXIT_DB_ERROR
#define GENERIC_EXIT_DB_ERROR
Database error.
Definition: exitcodes.h:17
MythPainter::SetDebugMode
void SetDebugMode(bool showBorders, bool showNames)
Definition: mythpainter.h:89
PlaybackBox
Definition: playbackbox.h:62
cmdline
MythCommFlagCommandLineParser cmdline
Definition: mythtv/programs/mythcommflag/main.cpp:74
kMSDisableUDPListener
@ kMSDisableUDPListener
disable MythMessage UDP listener for the duration of application.
Definition: mythsystem.h:50
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
mythmiscutil.h
seteuid
#define seteuid(x)
Definition: compat.h:264
MythDate::secsInPast
std::chrono::seconds secsInPast(const QDateTime &past)
Definition: mythdate.cpp:199
MetadataSettings
Definition: videometadatasettings.h:12
themechooser.h
VideoDialog::DLG_DEFAULT
@ DLG_DEFAULT
Definition: videodlg.h:36
MythCommandLineParser::toString
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
Definition: mythcommandlineparser.cpp:2224
LCD::SetupLCD
static void SetupLCD(void)
Definition: lcddevice.cpp:75
standbyScreen
static void standbyScreen(void)
Definition: mythtv/programs/mythfrontend/main.cpp:656
MythBDInfo
Definition: mythbdinfo.h:13
GENERIC_EXIT_NOT_OK
#define GENERIC_EXIT_NOT_OK
Exited with error.
Definition: exitcodes.h:11
gotoMainMenu
static void gotoMainMenu(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1372
MythCommandLineParser::toBool
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
Definition: mythcommandlineparser.cpp:2067
startChannelRecPriorities
static void startChannelRecPriorities(void)
Definition: mythtv/programs/mythfrontend/main.cpp:512
MythPainter
Definition: mythpainter.h:32
jumpScreenVideoDefault
static void jumpScreenVideoDefault()
Definition: mythtv/programs/mythfrontend/main.cpp:721
MEDIATYPE_MGALLERY
@ MEDIATYPE_MGALLERY
Definition: mythmedia.h:33
plTime
@ plTime
Definition: proglist.h:25
cleanupguard.h
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:951
EPGSettings
Definition: globalsettings.h:126
LanguageSelection::prompt
static bool prompt(bool force=false)
Ask the user for the language to use.
Definition: langsettings.cpp:173
MainGeneralSettings
Definition: globalsettings.h:169
VideoDialog::BrowseType
BrowseType
Definition: videodlg.h:39
VideoDialog::DLG_MANAGER
@ DLG_MANAGER
Definition: videodlg.h:37
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:888
MythRAOPDevice::Cleanup
static void Cleanup(void)
Definition: mythraopdevice.cpp:74
MythRAOPDevice::Create
static bool Create(void)
Definition: mythraopdevice.cpp:28
AppearanceSettings
Definition: globalsettings.h:135
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
audiooutput.h
startSearchTitle
static void startSearchTitle(void)
Definition: mythtv/programs/mythfrontend/main.cpp:388
MythPluginManager::EnumeratePlugins
QStringList EnumeratePlugins(void)
Definition: mythplugin.cpp:232
SIGUSR2
#define SIGUSR2
Definition: compat.h:218
AudioConfigSettings
Definition: audiogeneralsettings.h:36
ViewScheduled
Screen for viewing and managing upcoming and conflicted recordings.
Definition: viewscheduled.h:27
mythcontext.h
TV::SetFuncPtr
static void SetFuncPtr(const char *Name, void *Pointer)
Import pointers to functions used to embed the TV window into other containers e.g.
Definition: tv_play.cpp:453
MythThemedMenu::setCallback
void setCallback(void(*lcallback)(void *, QString &), void *data)
Set the themed menus callback function and data for that function.
Definition: myththemedmenu.cpp:158
startPlayback
static void startPlayback(void)
Definition: mythtv/programs/mythfrontend/main.cpp:553
GENERIC_EXIT_NO_MYTHCONTEXT
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
Definition: exitcodes.h:13
plMovies
@ plMovies
Definition: proglist.h:22
WasAutomaticStart
static bool WasAutomaticStart(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1712
GetAppBinDir
QString GetAppBinDir(void)
Definition: mythdirs.cpp:221
SignalHandler::SetHandler
static void SetHandler(int signum, SigHandlerFunc handler)
Definition: signalhandling.cpp:138
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
previewgeneratorqueue.h
startSearchMovie
static void startSearchMovie(void)
Definition: mythtv/programs/mythfrontend/main.cpp:458
showStatus
static void showStatus(void)
Definition: mythtv/programs/mythfrontend/main.cpp:643
MythBDInfo::GetLastError
QString GetLastError(void) const
Definition: mythbdinfo.cpp:169
MythCoreContext::ActivateSettingsCache
void ActivateSettingsCache(bool activate=true)
Definition: mythcorecontext.cpp:858
MythScreenType::Exiting
void Exiting()
g_settingsHelper
static SettingsHelper * g_settingsHelper
Definition: mythtv/programs/mythfrontend/main.cpp:133
MediaMonitor::defaultDVDdevice
static QString defaultDVDdevice()
DVDDeviceLocation, user-selected drive, or /dev/dvd.
Definition: mythmediamonitor.cpp:917
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
VideoListDeathDelay::kDelayTimeMS
static constexpr std::chrono::milliseconds kDelayTimeMS
Definition: videodlg.h:231
REG_JUMPEX
#define REG_JUMPEX(a, b, c, d, e)
Definition: mythmainwindow.h:23
ServerPool::listen
bool listen(QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
Definition: serverpool.cpp:389
MythMainWindow::ClearKeyContext
void ClearKeyContext(const QString &Context)
Definition: mythmainwindow.cpp:1207
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:863
MythThemedMenu
Themed menu class, used for main menus in MythTV frontend.
Definition: myththemedmenu.h:57
MythCoreContext::ReInitLocale
void ReInitLocale(void)
Definition: mythcorecontext.cpp:1847
SettingsHelper::RunProlog
void RunProlog(const QString &settingsPage)
Definition: settingshelper.h:18
MythMediaDevice
Definition: mythmedia.h:48
VideoDialog::DLG_TREE
@ DLG_TREE
Definition: videodlg.h:37
myththemedmenu.h
manualschedule.h
plNewListings
@ plNewListings
Definition: proglist.h:21
MythCommandLineParser::ConfigureLogging
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
Definition: mythcommandlineparser.cpp:2718
MythControls
Screen for managing and configuring keyboard input bindings.
Definition: mythcontrols.h:48
MythCoreContext::ClearSettingsCache
void ClearSettingsCache(const QString &myKey=QString(""))
Definition: mythcorecontext.cpp:853
startFinder
static void startFinder(void)
Definition: mythtv/programs/mythfrontend/main.cpp:383
MythCoreContext::IsMasterHost
bool IsMasterHost(void)
is this the same host as the master
Definition: mythcorecontext.cpp:684
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
MythUILocation::AddCurrentLocation
void AddCurrentLocation(const QString &Location)
Definition: mythuilocation.cpp:5
fe_sd_notify
#define fe_sd_notify(x)
Definition: mythtv/programs/mythfrontend/main.cpp:125
MediaMonitor::deleteLater
virtual void deleteLater(void)
Definition: mythmediamonitor.cpp:381
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:906
SetFuncPtrs
static void SetFuncPtrs(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1639
lcddevice.h
AudioOutput::Cleanup
static void Cleanup(void)
Definition: audiooutput.cpp:49
CustomPriority
Definition: custompriority.h:14
MythPluginManager::DestroyAllPlugins
void DestroyAllPlugins()
Definition: mythplugin.cpp:220
geteuid
#define geteuid()
Definition: compat.h:262
MythTranslation::load
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
Definition: mythtranslation.cpp:37
exitcodes.h
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:66
backendconnectionmanager.h
internal_play_media
static int internal_play_media(const QString &mrl, const QString &plot, const QString &title, const QString &subtitle, const QString &director, int season, int episode, const QString &inetref, std::chrono::minutes lenMins, const QString &year, const QString &id, const bool useBookmark)
Definition: mythtv/programs/mythfrontend/main.cpp:1262
build_compdb.filename
filename
Definition: build_compdb.py:21
MythMainWindow::RestartInputHandlers
void RestartInputHandlers()
Definition: mythmainwindow.cpp:2067
mythmainwindow.h
jumpScreenVideoGallery
static void jumpScreenVideoGallery()
Definition: mythtv/programs/mythfrontend/main.cpp:720
GENERIC_EXIT_NO_THEME
#define GENERIC_EXIT_NO_THEME
No Theme available.
Definition: exitcodes.h:14
commandlineparser.h
loggingserver.h
MythSystemEventHandler
Handles incoming MythSystemEvent messages.
Definition: mythsystemevent.h:24
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:294
clearAllKeys
static void clearAllKeys(void)
Deletes all key bindings and jump points for this host.
Definition: mythtv/programs/mythfrontend/main.cpp:1651
MythDVDInfo
Definition: mythdvdinfo.h:19
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:558
handleSIGUSR1
void handleSIGUSR1(void)
Definition: mythtv/programs/mythfrontend/main.cpp:2190
gContext
MythContext * gContext
This global variable contains the MythContext instance for the application.
Definition: mythcontext.cpp:64
HouseKeeper::Start
void Start(void)
Definition: housekeeper.cpp:669
GalleryThumbView
Thumbnail screen.
Definition: gallerythumbview.h:23
MythContext::Init
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
Definition: mythcontext.cpp:1569
MythMainWindow
Definition: mythmainwindow.h:35
LCD
Definition: lcddevice.h:173
idlescreen.h
SignalHandler::Done
static void Done(void)
Definition: signalhandling.cpp:131
MythCoreContext::SetExiting
void SetExiting(bool exiting=true)
Definition: mythcorecontext.cpp:2098
videodlg.h
startCustomEdit
static void startCustomEdit(void)
Definition: mythtv/programs/mythfrontend/main.cpp:578
mythbdinfo.h
DestroyMythUI
void DestroyMythUI()
Definition: mythuihelper.cpp:71
MEDIATYPE_DATA
@ MEDIATYPE_DATA
Definition: mythmedia.h:26
viewscheduled.h
JUMP_VIDEO_DEFAULT
const QString JUMP_VIDEO_DEFAULT
Definition: globals.cpp:40
MythMainWindow::PauseIdleTimer
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
Definition: mythmainwindow.cpp:2119
plKeywordSearch
@ plKeywordSearch
Definition: proglist.h:17
videoplayersettings.h
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:923
ImageAdapterBase::SupportedVideos
static QStringList SupportedVideos()
Return recognised video extensions.
Definition: imagemanager.cpp:349
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
MythScreenStack::GetTopScreen
virtual MythScreenType * GetTopScreen(void) const
Definition: mythscreenstack.cpp:180
SignalHandler::Init
static void Init(QList< int > &signallist, QObject *parent=nullptr)
Definition: signalhandling.cpp:124
ChannelInfoList
std::vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:131
GENERIC_EXIT_DB_OUTOFDATE
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Definition: exitcodes.h:16
PlayerSettings
Definition: videoplayersettings.h:11