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