MythTV  master
guidegrid.cpp
Go to the documentation of this file.
1 // C/C++
2 #include <algorithm>
3 #include <cstdint> // for uint64_t
4 #include <deque> // for _Deque_iterator, operator!=, etc
5 
6 // Qt
7 #include <QCoreApplication>
8 #include <QDateTime>
9 #include <QKeyEvent>
10 
11 // MythTV
12 #include "libmythbase/autodeletedeque.h" // for AutoDeleteDeque, etc
14 #include "libmythbase/mythdate.h"
15 #include "libmythbase/mythdbcon.h"
16 #include "libmythbase/mythevent.h" // for MythEvent, etc
18 #include "libmythbase/mythtypes.h" // for InfoMap
20 #include "libmythbase/programtypes.h" // for RecStatus, etc
21 #include "libmythbase/recordingtypes.h" // for toString, etc
22 #include "libmythbase/remoteutil.h"
23 #include "libmythtv/cardutil.h"
24 #include "libmythtv/channelinfo.h"
25 #include "libmythtv/channelutil.h"
27 #include "libmythtv/tv.h" // for ::kState_WatchingLiveTV
28 #include "libmythtv/tv_actions.h" // for ACTION_CHANNELSEARCH, etc
29 #include "libmythtv/tv_play.h"
30 #include "libmythtv/tvremoteutil.h"
32 #include "libmythui/mythgesture.h"
33 #include "libmythui/mythmainwindow.h" // for GetMythMainWindow, etc
34 #include "libmythui/mythrect.h" // for MythRect
35 #include "libmythui/mythscreenstack.h" // for MythScreenStack
36 #include "libmythui/mythscreentype.h" // for MythScreenType
37 #include "libmythui/mythuiactions.h" // for ACTION_SELECT, ACTION_DOWN, etc
40 #include "libmythui/mythuiimage.h"
42 #include "libmythui/mythuitext.h"
43 #include "libmythui/mythuiutils.h" // for UIUtilW, UIUtilE
44 
45 // MythFrontend
46 #include "guidegrid.h"
47 #include "progfind.h"
48 
49 QWaitCondition epgIsVisibleCond;
50 
51 #define LOC QString("GuideGrid: ")
52 #define LOC_ERR QString("GuideGrid, Error: ")
53 #define LOC_WARN QString("GuideGrid, Warning: ")
54 
55 const QString kUnknownTitle = "";
56 //const QString kUnknownCategory = QObject::tr("Unknown");
57 static constexpr std::chrono::milliseconds kUpdateMS { 60s }; // Grid update interval
58 static constexpr int64_t kFourMinutes { 4LL * 60 };
59 static constexpr int64_t kFiveMinutes { 5LL * 60 };
60 static constexpr int64_t kThirtyMinutes { 30LL * 60 };
61 static constexpr int64_t kEightHours { 8 * 60LL * 60 };
62 static constexpr int64_t kOneDay { 24 * 60LL * 60 };
63 static bool SelectionIsTunable(const ChannelInfoList &selection);
64 
66  JumpToChannelListener *parent, QString start_entry,
67  int start_chan_idx, int cur_chan_idx, uint rows_disp) :
68  m_listener(parent),
69  m_entry(std::move(start_entry)),
70  m_previousStartChannelIndex(start_chan_idx),
71  m_previousCurrentChannelIndex(cur_chan_idx),
72  m_rowsDisplayed(rows_disp),
73  m_timer(new QTimer(this))
74 {
75  if (parent && m_timer)
76  {
78  m_timer->setSingleShot(true);
79  }
80  Update();
81 }
82 
83 
85 {
86  if (m_listener)
87  {
88  m_listener->SetJumpToChannel(nullptr);
89  m_listener = nullptr;
90  }
91 
92  if (m_timer)
93  {
94  m_timer->stop();
95  m_timer = nullptr;
96  }
97 
98  QObject::deleteLater();
99 }
100 
101 
102 static bool has_action(const QString& action, const QStringList &actions)
103 {
104  QStringList::const_iterator it;
105  for (it = actions.begin(); it != actions.end(); ++it)
106  {
107  if (action == *it)
108  return true;
109  }
110  return false;
111 }
112 
113 bool JumpToChannel::ProcessEntry(const QStringList &actions, const QKeyEvent *e)
114 {
115  if (!m_listener)
116  return false;
117 
118  if (has_action("ESCAPE", actions))
119  {
122  deleteLater();
123  return true;
124  }
125 
126  if (has_action("DELETE", actions))
127  {
128  if (!m_entry.isEmpty())
129  m_entry = m_entry.left(m_entry.length()-1);
130  Update();
131  return true;
132  }
133 
134  if (has_action(ACTION_SELECT, actions))
135  {
136  if (Update())
137  deleteLater();
138  return true;
139  }
140 
141  QString txt = e->text();
142  bool isUInt = false;
143  // cppcheck-suppress ignoredReturnValue
144  txt.toUInt(&isUInt);
145  if (isUInt)
146  {
147  m_entry += txt;
148  Update();
149  return true;
150  }
151 
152  if (!m_entry.isEmpty() && (txt=="_" || txt=="-" || txt=="#" || txt=="."))
153  {
154  m_entry += txt;
155  Update();
156  return true;
157  }
158 
159  return false;
160 }
161 
163 {
164  if (!m_timer || !m_listener)
165  return false;
166 
167  m_timer->stop();
168 
169  // find the closest channel ...
170  int i = m_listener->FindChannel(0, m_entry, false);
171  if (i >= 0)
172  {
173  // setup the timeout timer for jump mode
175 
176  // rows_displayed to center
177  int start = i - (m_rowsDisplayed/2);
178  int cur = m_rowsDisplayed/2;
179  m_listener->GoTo(start, cur);
180  return true;
181  }
182 
183  // prefix must be invalid.. reset entry..
185  return false;
186 }
187 
188 // GuideStatus is used for transferring the relevant read-only data
189 // from GuideGrid to the GuideUpdateProgramRow constructor.
191 {
192 public:
193  GuideStatus(unsigned int firstRow, unsigned int numRows,
194  QVector<int> channums,
195  const MythRect &gg_programRect,
196  int gg_channelCount,
197  QDateTime currentStartTime,
198  QDateTime currentEndTime,
199  uint currentStartChannel,
200  int currentRow, int currentCol,
201  int channelCount, int timeCount,
202  bool verticalLayout,
203  QDateTime firstTime, QDateTime lastTime)
204  : m_firstRow(firstRow), m_numRows(numRows),
205  m_chanNums(std::move(channums)),
206  m_ggProgramRect(gg_programRect), m_ggChannelCount(gg_channelCount),
207  m_currentStartTime(std::move(currentStartTime)),
208  m_currentEndTime(std::move(currentEndTime)),
209  m_currentStartChannel(currentStartChannel), m_currentRow(currentRow),
210  m_currentCol(currentCol), m_channelCount(channelCount),
211  m_timeCount(timeCount), m_verticalLayout(verticalLayout),
212  m_firstTime(std::move(firstTime)), m_lastTime(std::move(lastTime)) {}
213  const unsigned int m_firstRow, m_numRows;
214  const QVector<int> m_chanNums;
216  const int m_ggChannelCount;
221  const bool m_verticalLayout;
222  const QDateTime m_firstTime, m_lastTime;
223 };
224 
226 {
227 public:
228  explicit GuideUpdaterBase(GuideGrid *guide) : m_guide(guide) {}
229  virtual ~GuideUpdaterBase() = default;
230 
231  // Execute the initial non-UI part (in a separate thread). Return
232  // true if ExecuteUI() should be run later, or false if the work
233  // is no longer relevant (e.g., the UI elements have scrolled
234  // offscreen by now).
235  virtual bool ExecuteNonUI(void) = 0;
236  // Execute the UI part in the UI thread.
237  virtual void ExecuteUI(void) = 0;
238 
239 protected:
240  GuideGrid *m_guide {nullptr};
241 };
242 
244 {
245 public:
247  QVector<ProgramList*> proglists)
248  : GuideUpdaterBase(guide),
250  m_numRows(gs.m_numRows),
264  m_proglists(std::move(proglists)) {}
265  ~GuideUpdateProgramRow() override = default;
266  bool ExecuteNonUI(void) override // GuideUpdaterBase
267  {
268  // Don't bother to do any work if the starting coordinates of
269  // the guide have changed while the thread was waiting to
270  // start.
273  {
274  return false;
275  }
276 
277  for (unsigned int i = 0; i < m_numRows; ++i)
278  {
279  unsigned int row = i + m_firstRow;
280  if (!m_proglists[i])
281  m_proglists[i] =
285  m_proglists[i]);
286  }
287  return true;
288  }
289  void ExecuteUI(void) override // GuideUpdaterBase
290  {
294  }
295 
296 private:
297  void fillProgramRowInfosWith(int row, const QDateTime& start,
298  ProgramList *proglist);
299 
300  const unsigned int m_firstRow;
301  const unsigned int m_numRows;
302  const QVector<int> m_chanNums;
304  const int m_ggChannelCount;
305  const QDateTime m_currentStartTime;
306  const QDateTime m_currentEndTime;
308  const int m_currentRow;
309  const int m_currentCol;
310  const int m_channelCount;
311  const int m_timeCount;
312  const bool m_verticalLayout;
313  const QDateTime m_firstTime;
314  const QDateTime m_lastTime;
315 
316  QVector<ProgramList*> m_proglists;
318  int m_progPast {0};
319  std::list<GuideUIElement> m_result;
320 };
321 
323 {
324 public:
325  GuideUpdateChannels(GuideGrid *guide, uint startChan)
326  : GuideUpdaterBase(guide), m_currentStartChannel(startChan) {}
327  bool ExecuteNonUI(void) override // GuideUpdaterBase
328  {
330  return false;
332  return true;
333  }
334  void ExecuteUI(void) override // GuideUpdaterBase
335  {
337  }
339  QVector<ChannelInfo *> m_chinfos;
340  QVector<bool> m_unavailables;
341 };
342 
343 class UpdateGuideEvent : public QEvent
344 {
345 public:
346  explicit UpdateGuideEvent(GuideUpdaterBase *updater) :
347  QEvent(kEventType), m_updater(updater) {}
349  static const Type kEventType;
350 };
351 const QEvent::Type UpdateGuideEvent::kEventType =
352  (QEvent::Type) QEvent::registerEventType();
353 
354 class GuideHelper : public QRunnable
355 {
356 public:
358  : m_guide(guide), m_updater(updater)
359  {
360  QMutexLocker locker(&s_lock);
361  ++s_loading[m_guide];
362  }
363  void run(void) override // QRunnable
364  {
365  QThread::currentThread()->setPriority(QThread::IdlePriority);
366  if (m_updater)
367  {
368  if (m_updater->ExecuteNonUI())
369  {
370  QCoreApplication::postEvent(m_guide,
372  }
373  else
374  {
375  delete m_updater;
376  m_updater = nullptr;
377  }
378  }
379 
380  QMutexLocker locker(&s_lock);
381  --s_loading[m_guide];
382  if (!s_loading[m_guide])
383  s_wait.wakeAll();
384  }
385  static bool IsLoading(GuideGrid *guide)
386  {
387  QMutexLocker locker(&s_lock);
388  return s_loading[guide] != 0U;
389  }
390  static void Wait(GuideGrid *guide)
391  {
392  QMutexLocker locker(&s_lock);
393  while (s_loading[guide])
394  {
395  if (!s_wait.wait(locker.mutex(), 15000UL))
396  return;
397  }
398  }
399 private:
400  GuideGrid *m_guide {nullptr};
402 
403  static QMutex s_lock;
404  static QWaitCondition s_wait;
405  static QHash<GuideGrid*,uint> s_loading;
406 };
407 QMutex GuideHelper::s_lock;
408 QWaitCondition GuideHelper::s_wait;
409 QHash<GuideGrid*,uint> GuideHelper::s_loading;
410 
411 void GuideGrid::RunProgramGuide(uint chanid, const QString &channum,
412  const QDateTime &startTime,
413  TV *player, bool embedVideo,
414  bool allowFinder, int changrpid)
415 {
416  // which channel group should we default to
417  if (changrpid == -2)
418  changrpid = gCoreContext->GetNumSetting("ChannelGroupDefault", -1);
419 
420  // check there are some channels setup
422  0, true, "", (changrpid<0) ? 0 : changrpid);
423 
424  // Fallback to All Programs if the selected group does not exist or is empty
425  if (channels.empty() && changrpid != -1)
426  {
427  LOG(VB_GENERAL, LOG_WARNING, LOC +
428  QString("Channelgroup '%1' is empty, changing to 'All Programs'")
429  .arg(ChannelGroup::GetChannelGroupName(changrpid)));
430  changrpid = -1;
431  channels = ChannelUtil::GetChannels(0, true, "", 0);
432  }
433 
434  if (channels.empty())
435  {
436  QString message;
437  if (changrpid == -1)
438  {
439  message = tr("You don't have any channels defined in the database."
440  "\n\t\t\tThe program guide will have nothing to show you.");
441  }
442  else
443  {
444  message = tr("Channel group '%1' doesn't have any channels defined."
445  "\n\t\t\tThe program guide will have nothing to show you.")
446  .arg(ChannelGroup::GetChannelGroupName(changrpid));
447  }
448 
449  LOG(VB_GENERAL, LOG_WARNING, LOC + message);
450 
451  if (!player)
452  ShowOkPopup(message);
453  else if (allowFinder)
454  emit player->RequestEmbedding(false);
455  return;
456  }
457 
458  // If chanid/channum are unset, find the channel that would
459  // naturally be selected when Live TV is started. This depends on
460  // the available tuners, their capturecard.livetvorder values, and
461  // their capturecard.startchan values.
462  QString actualChannum = channum;
463  if (chanid == 0 && actualChannum.isEmpty())
464  {
465  uint defaultChanid = gCoreContext->GetNumSetting("DefaultChanid", 0);
466  if (defaultChanid && TV::IsTunable(defaultChanid))
467  chanid = defaultChanid;
468  }
469  if (chanid == 0 && actualChannum.isEmpty())
470  {
471  std::vector<unsigned int> inputIDs = RemoteRequestFreeInputList(0);
472  if (!inputIDs.empty())
473  actualChannum = CardUtil::GetStartChannel(inputIDs[0]);
474  }
475 
477  auto *gg = new GuideGrid(mainStack, chanid, actualChannum, startTime,
478  player, embedVideo, allowFinder, changrpid);
479 
480  if (gg->Create())
481  mainStack->AddScreen(gg, (player == nullptr));
482  else
483  delete gg;
484 }
485 
487  uint chanid, QString channum, const QDateTime &startTime,
488  TV *player, bool embedVideo,
489  bool allowFinder, int changrpid)
490  : ScheduleCommon(parent, "guidegrid"),
491  m_selectRecThreshold(gCoreContext->GetDurSetting<std::chrono::minutes>("SelChangeRecThreshold", 16min)),
492  m_allowFinder(allowFinder),
493  m_startChanID(chanid),
494  m_startChanNum(std::move(channum)),
495  m_sortReverse(gCoreContext->GetBoolSetting("EPGSortReverse", false)),
496  m_player(player),
497  m_embedVideo(embedVideo),
498  m_channelOrdering(gCoreContext->GetSetting("ChannelOrdering", "channum")),
499  m_updateTimer(new QTimer(this)),
500  m_threadPool("GuideGridHelperPool"),
501  m_changrpid(changrpid),
502  m_changrplist(ChannelGroup::GetChannelGroups(false)),
503  m_channelGroupListManual(ChannelGroup::GetManualChannelGroups(true))
504 {
506 
507  for (uint i = 0; i < MAX_DISPLAY_CHANS; i++)
508  m_programs.push_back(nullptr);
509 
511  if (startTime.isValid() &&
512  startTime > m_originalStartTime.addSecs(-kEightHours))
513  m_originalStartTime = startTime;
514 
515  int secsoffset = -(((m_originalStartTime.time().minute() % 30) * 60) +
516  m_originalStartTime.time().second());
517  m_currentStartTime = m_originalStartTime.addSecs(secsoffset);
519 
520  if (m_player)
521  {
522  m_player->IncrRef();
526  }
527 }
528 
530 {
531  if (Player && (Player == m_player))
532  {
533  emit m_player->RequestEmbedding(false);
534  HideTVWindow();
535  m_player->DecrRef();
536  m_player = nullptr;
537  }
538 }
539 
541 {
542  QString windowName = "programguide";
543 
544  if (m_embedVideo)
545  windowName = "programguide-video";
546 
547  if (!LoadWindowFromXML("schedule-ui.xml", windowName, this))
548  return false;
549 
550  bool err = false;
551  UIUtilE::Assign(this, m_timeList, "timelist", &err);
552  UIUtilE::Assign(this, m_channelList, "channellist", &err);
553  UIUtilE::Assign(this, m_guideGrid, "guidegrid", &err);
554  UIUtilW::Assign(this, m_dateText, "datetext");
555  UIUtilW::Assign(this, m_longdateText, "longdatetext");
556  UIUtilW::Assign(this, m_changroupname, "channelgroup");
557  UIUtilW::Assign(this, m_channelImage, "channelicon");
558  UIUtilW::Assign(this, m_jumpToText, "jumptotext");
559 
560  if (err)
561  {
562  LOG(VB_GENERAL, LOG_ERR,
563  QString("Cannot load screen '%1'").arg(windowName));
564  return false;
565  }
566 
567  BuildFocusList();
568 
569  MythUIImage *videoImage = dynamic_cast<MythUIImage *>(GetChild("video"));
570  if (videoImage && m_embedVideo)
571  m_videoRect = videoImage->GetArea();
572  else
573  m_videoRect = QRect(0,0,0,0);
574 
578 
580 
582  return true;
583 }
584 
585 void GuideGrid::Load(void)
586 {
589 
591  int maxchannel = GetChannelCount();
592  m_channelCount = std::min(m_channelCount, maxchannel);
593 
594  for (int y = 0; y < m_channelCount; ++y)
595  {
596  int chanNum = y + m_currentStartChannel;
597  if (chanNum >= (int) m_channelInfos.size())
598  chanNum -= (int) m_channelInfos.size();
599  if (chanNum >= (int) m_channelInfos.size())
600  continue;
601 
602  chanNum = std::max(chanNum, 0);
603 
604  delete m_programs[y];
606  }
607 }
608 
609 void GuideGrid::Init(void)
610 {
612  m_currentCol = 0;
613 
614  fillTimeInfos();
615 
616  updateChannels();
617 
618  fillProgramInfos(true);
619 
620  m_updateTimer->start(kUpdateMS);
621 
622  updateDateText();
623 
624  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
625 
626  if (m_changroupname)
627  m_changroupname->SetText(changrpname);
628 
629  gCoreContext->addListener(this);
630 }
631 
633 {
634  m_updateTimer->disconnect(this);
635  m_updateTimer = nullptr;
636 
637  GuideHelper::Wait(this);
638 
640 
641  while (!m_programs.empty())
642  {
643  if (m_programs.back())
644  delete m_programs.back();
645  m_programs.pop_back();
646  }
647 
648  m_channelInfos.clear();
649 
650  gCoreContext->SaveSetting("EPGSortReverse", m_sortReverse ? "1" : "0");
651 
652  if (m_player)
653  {
654  // if we have a player and we are returning to it we need
655  // to tell it to stop embedding and return to fullscreen
656  if (m_allowFinder)
657  emit m_player->RequestEmbedding(false);
658 
659  // maybe the user selected a different channel group,
660  // tell the player to update its channel list just in case
662  m_player->DecrRef();
663  }
664 
665  if (gCoreContext->GetBoolSetting("ChannelGroupRememberLast", false))
666  gCoreContext->SaveSetting("ChannelGroupDefault", m_changrpid);
667 }
668 
669 bool GuideGrid::keyPressEvent(QKeyEvent *event)
670 {
671  QStringList actions;
672  bool handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", event, actions);
673 
674  if (handled)
675  return true;
676 
677  if (!actions.empty())
678  {
679  QMutexLocker locker(&m_jumpToChannelLock);
680 
681  if (!m_jumpToChannel)
682  {
683  const QString& chanNum = actions[0];
684  bool isNum = false;
685  (void)chanNum.toInt(&isNum);
686  if (isNum)
687  {
688  // see if we can find a matching channel before creating the JumpToChannel otherwise
689  // JumpToChannel will delete itself in the ctor leading to a segfault
690  int i = FindChannel(0, chanNum, false);
691  if (i >= 0)
692  {
693  m_jumpToChannel = new JumpToChannel(this, chanNum,
697  }
698 
699  handled = true;
700  }
701  }
702 
703  if (m_jumpToChannel && !handled)
704  handled = m_jumpToChannel->ProcessEntry(actions, event);
705  }
706 
707  for (int i = 0; i < actions.size() && !handled; ++i)
708  {
709  const QString& action = actions[i];
710  handled = true;
711  if (action == ACTION_UP)
712  {
713  if (m_verticalLayout)
714  cursorLeft();
715  else
716  cursorUp();
717  }
718  else if (action == ACTION_DOWN)
719  {
720  if (m_verticalLayout)
721  cursorRight();
722  else
723  cursorDown();
724  }
725  else if (action == ACTION_LEFT)
726  {
727  if (m_verticalLayout)
728  cursorUp();
729  else
730  cursorLeft();
731  }
732  else if (action == ACTION_RIGHT)
733  {
734  if (m_verticalLayout)
735  cursorDown();
736  else
737  cursorRight();
738  }
739  else if (action == "PAGEUP")
740  {
741  if (m_verticalLayout)
743  else
745  }
746  else if (action == "PAGEDOWN")
747  {
748  if (m_verticalLayout)
750  else
752  }
753  else if (action == ACTION_PAGELEFT)
754  {
755  if (m_verticalLayout)
757  else
759  }
760  else if (action == ACTION_PAGERIGHT)
761  {
762  if (m_verticalLayout)
764  else
766  }
767  else if (action == ACTION_DAYLEFT)
768  {
770  }
771  else if (action == ACTION_DAYRIGHT)
772  {
774  }
775  else if (action == "NEXTFAV")
776  {
778  }
779  else if (action == ACTION_FINDER)
780  {
781  showProgFinder();
782  }
783  else if (action == ACTION_CHANNELSEARCH)
784  {
786  }
787  else if (action == "MENU")
788  {
789  ShowMenu();
790  }
791  else if (action == "ESCAPE" || action == ACTION_GUIDE)
792  {
793  Close();
794  }
795  else if (action == ACTION_SELECT)
796  {
797  ProgramInfo *pginfo =
799  auto secsTillStart = (pginfo)
802  {
803  // See if this show is far enough into the future that it's
804  // probable that the user wanted to schedule it to record
805  // instead of changing the channel.
806  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
807  (secsTillStart >= m_selectRecThreshold))
808  {
809  EditRecording();
810  }
811  else
812  {
813  enter();
814  }
815  }
816  else
817  {
818  // Edit Recording should include "Watch this channel"
819  // is we selected a show that is current.
822  && (secsTillStart < m_selectRecThreshold));
823  }
824  }
825  else if (action == "EDIT")
826  {
827  EditScheduled();
828  }
829  else if (action == "CUSTOMEDIT")
830  {
831  EditCustom();
832  }
833  else if (action == "DELETE")
834  {
835  deleteRule();
836  }
837  else if (action == "UPCOMING")
838  {
839  ShowUpcoming();
840  }
841  else if (action == "PREVRECORDED")
842  {
843  ShowPrevious();
844  }
845  else if (action == "DETAILS" || action == "INFO")
846  {
847  ShowDetails();
848  }
849  else if (action == ACTION_TOGGLERECORD)
850  {
851  QuickRecord();
852  }
853  else if (action == ACTION_TOGGLEFAV)
854  {
855  if (m_changrpid == -1)
856  ChannelGroupMenu(0);
857  else
859  }
860  else if (action == "CHANUPDATE")
861  {
862  channelUpdate();
863  }
864  else if (action == ACTION_VOLUMEUP)
865  {
866  emit ChangeVolume(true);
867  }
868  else if (action == ACTION_VOLUMEDOWN)
869  {
870  emit ChangeVolume(false);
871  }
872  else if (action == "CYCLEAUDIOCHAN")
873  {
874  emit ToggleMute(true);
875  }
876  else if (action == ACTION_MUTEAUDIO)
877  {
878  emit ToggleMute(false);
879  }
880  else if (action == ACTION_TOGGLEPGORDER)
881  {
884  updateChannels();
885  }
886  else
887  {
888  handled = false;
889  }
890  }
891 
892  if (!handled && MythScreenType::keyPressEvent(event))
893  handled = true;
894 
895  return handled;
896 }
897 
899 {
900  bool handled = true;
901 
902  if (!event)
903  {
904  LOG(VB_GENERAL, LOG_INFO, LOC + "Guide Gesture no event");
905  return false;
906  }
907 
908  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture event %1")
909  .arg(QString::number(event->GetGesture())));
910  switch (event->GetGesture())
911  {
913  {
914  handled = false;
915 
916  // We want the relative position of the click
917  QPoint position = event->GetPosition();
918  if (m_parent)
919  position -= m_parent->GetArea().topLeft();
920 
921  MythUIType *type = GetChildAt(position, false, false);
922 
923  if (!type)
924  return false;
925 
926  auto *object = dynamic_cast<MythUIStateType *>(type);
927 
928  if (object)
929  {
930  QString name = object->objectName();
931  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click name %1").arg(name));
932 
933  if (name.startsWith("channellist"))
934  {
935  auto* channelList = qobject_cast<MythUIButtonList*>(object);
936 
937  if (channelList)
938  {
939  handled = channelList->gestureEvent(event);
940  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click channel list %1").arg(handled));
941  }
942  }
943  else if (name.startsWith("guidegrid"))
944  {
945  auto* guidegrid = qobject_cast<MythUIGuideGrid*>(object);
946 
947  if (guidegrid)
948  {
949  handled = true;
950 
951  QPoint rowCol = guidegrid->GetRowAndColumn(position - guidegrid->GetArea().topLeft());
952 
953  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg %1,%2 (%3,%4)")
954  .arg(rowCol.y())
955  .arg(rowCol.x())
956  .arg(m_currentRow)
957  .arg(m_currentCol)
958  );
959  if ((rowCol.y() >= 0) && (rowCol.x() >= 0))
960  {
961  if ((rowCol.y() == m_currentRow) && (rowCol.x() == m_currentCol))
962  {
964  {
965  // See if this show is far enough into the future that it's
966  // probable that the user wanted to schedule it to record
967  // instead of changing the channel.
968  ProgramInfo *pginfo =
970  auto secsTillStart = (pginfo)
972  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
973  (secsTillStart >= m_selectRecThreshold))
974  {
975  //EditRecording();
976  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg EditRec"));
977  }
978  else
979  {
980  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg enter"));
981  enter();
982  }
983  }
984  else
985  {
986  //EditRecording();
987  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg not live"));
988  }
989  }
990  else
991  {
992  bool rowChanged = (rowCol.y() != m_currentRow);
993  bool colChanged = (rowCol.x() != m_currentCol);
994  if (rowChanged)
996 
997  m_currentRow = rowCol.y();
998  m_currentCol = rowCol.x();
999 
1000  fillProgramInfos();
1001  if (colChanged)
1002  {
1003  m_currentStartTime = m_programInfos[m_currentRow][m_currentCol]->GetScheduledStartTime();
1004  fillTimeInfos();
1005  }
1006  if (rowChanged)
1007  updateChannels();
1008  if (colChanged)
1009  updateDateText();
1010  }
1011  }
1012  }
1013  }
1014 
1015  }
1016  }
1017  break;
1018 
1019  case MythGestureEvent::Up:
1020  if (m_verticalLayout)
1021  cursorLeft();
1022  else
1023  cursorUp();
1024  break;
1025 
1027  if (m_verticalLayout)
1028  cursorRight();
1029  else
1030  cursorDown();
1031  break;
1032 
1034  if (m_verticalLayout)
1035  cursorUp();
1036  else
1037  cursorLeft();
1038  break;
1039 
1041  if (m_verticalLayout)
1042  cursorDown();
1043  else
1044  cursorRight();
1045  break;
1046 
1048  if (m_verticalLayout)
1050  else
1052  break;
1053 
1055  if (m_verticalLayout)
1057  else
1059  break;
1060 
1062  if (m_verticalLayout)
1064  else
1066  break;
1067 
1069  if (m_verticalLayout)
1071  else
1073  break;
1074 
1077  break;
1078 
1081  break;
1082 
1084  enter();
1085  break;
1086 
1087  default:
1088  handled = false;
1089  break;
1090  }
1091 
1092  if (!handled && MythScreenType::gestureEvent(event))
1093  handled = true;
1094 
1095  return handled;
1096 }
1097 
1098 static bool SelectionIsTunable(const ChannelInfoList &selection)
1099 {
1100  return std::any_of(selection.cbegin(), selection.cend(),
1101  [selection](const auto & chan){ return TV::IsTunable(chan.m_chanId); } );
1102 }
1103 
1105 {
1106  QString label = tr("Guide Options");
1107 
1108  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1109  auto *menuPopup = new MythDialogBox(label, popupStack, "guideMenuPopup");
1110 
1111  if (menuPopup->Create())
1112  {
1113  menuPopup->SetReturnEvent(this, "guidemenu");
1114 
1116  menuPopup->AddButton(tr("Change to Channel"));
1117  else if (!m_player && SelectionIsTunable(GetSelection()))
1118  menuPopup->AddButton(tr("Watch This Channel"));
1119 
1120  menuPopup->AddButton(tr("Record This"));
1121 
1122  menuPopup->AddButton(tr("Recording Options"), nullptr, true);
1123 
1124  menuPopup->AddButton(tr("Program Details"));
1125 
1126  menuPopup->AddButton(tr("Jump to Time"), nullptr, true);
1127 
1128  menuPopup->AddButton(tr("Reverse Channel Order"));
1129 
1130  menuPopup->AddButton(tr("Channel Search"));
1131 
1132  if (!m_changrplist.empty())
1133  {
1134  menuPopup->AddButton(tr("Choose Channel Group"));
1135 
1137  menuPopup->AddButton(tr("Add To Channel Group"), nullptr, true);
1138  else
1139  menuPopup->AddButton(tr("Remove from Channel Group"));
1140  }
1141 
1142  popupStack->AddScreen(menuPopup);
1143  }
1144  else
1145  {
1146  delete menuPopup;
1147  }
1148 }
1149 
1151 {
1152  QString label = tr("Recording Options");
1153 
1154  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1155  auto *menuPopup = new MythDialogBox(label, popupStack, "recMenuPopup");
1156 
1157  if (menuPopup->Create())
1158  {
1159  menuPopup->SetReturnEvent(this, "recmenu");
1160 
1162 
1163  if (pginfo && pginfo->GetRecordingRuleID())
1164  menuPopup->AddButton(tr("Edit Recording Status"));
1165  menuPopup->AddButton(tr("Edit Schedule"));
1166  menuPopup->AddButton(tr("Show Upcoming"));
1167  menuPopup->AddButton(tr("Previously Recorded"));
1168  menuPopup->AddButton(tr("Custom Edit"));
1169 
1170  if (pginfo && pginfo->GetRecordingRuleID())
1171  menuPopup->AddButton(tr("Delete Rule"));
1172 
1173  popupStack->AddScreen(menuPopup);
1174  }
1175  else
1176  {
1177  delete menuPopup;
1178  }
1179 }
1180 
1182 {
1183  sel = (sel >= 0) ? sel : m_channelInfoIdx[chan_idx];
1184 
1185  if (chan_idx >= GetChannelCount())
1186  return nullptr;
1187 
1188  if (sel >= (int) m_channelInfos[chan_idx].size())
1189  return nullptr;
1190 
1191  return &(m_channelInfos[chan_idx][sel]);
1192 }
1193 
1194 const ChannelInfo *GuideGrid::GetChannelInfo(uint chan_idx, int sel) const
1195 {
1196  return ((GuideGrid*)this)->GetChannelInfo(chan_idx, sel);
1197 }
1198 
1200 {
1201  return m_channelInfos.size();
1202 }
1203 
1205 {
1206  uint cnt = GetChannelCount();
1207  if (!cnt)
1208  return -1;
1209 
1210  row = (row < 0) ? m_currentRow : row;
1211  return (row + m_currentStartChannel) % cnt;
1212 }
1213 
1215 {
1216  ProgramList proglist;
1217  MSqlBindings bindings;
1218  QString querystr =
1219  "WHERE program.chanid = :CHANID AND "
1220  " program.endtime >= :STARTTS AND "
1221  " program.starttime <= :ENDTS AND "
1222  " program.starttime >= :STARTLIMITTS AND "
1223  " program.manualid = 0 ";
1224  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1225  bindings[":STARTTS"] = starttime;
1226  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1227  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1228  bindings[":CHANID"] = chanid;
1229 
1230  ProgramList dummy;
1231  LoadFromProgram(proglist, querystr, bindings, dummy);
1232 
1233  return proglist;
1234 }
1235 
1237 {
1238  if (!proglist)
1239  return nullptr;
1240  auto *result = new ProgramList();
1241  // AutoDeleteDeque doesn't work with std::back_inserter
1242  for (auto & pi : *proglist)
1243  result->push_back(new ProgramInfo(*pi)); // cppcheck-suppress useStlAlgorithm
1244  return result;
1245 }
1246 
1248  uint chan_idx, bool with_same_channum) const
1249 {
1250  uint si = m_channelInfoIdx[chan_idx];
1251  const ChannelInfo *chinfo = GetChannelInfo(chan_idx, si);
1252 
1255 
1256  const uint cnt = (ctx && chinfo) ? m_channelInfos[chan_idx].size() : 0;
1257  for (uint i = 0; i < cnt; ++i)
1258  {
1259  if (i == si)
1260  continue;
1261 
1262  const ChannelInfo *ciinfo = GetChannelInfo(chan_idx, i);
1263  if (!ciinfo)
1264  continue;
1265 
1266  bool same_channum = ciinfo->m_chanNum == chinfo->m_chanNum;
1267 
1268  if (with_same_channum != same_channum)
1269  continue;
1270 
1271  if (!TV::IsTunable(ciinfo->m_chanId))
1272  continue;
1273 
1274  if (with_same_channum)
1275  {
1276  si = i;
1277  break;
1278  }
1279 
1280  ProgramList proglist = GetProgramList(chinfo->m_chanId);
1281  ProgramList ch_proglist = GetProgramList(ciinfo->m_chanId);
1282 
1283  if (proglist.empty() ||
1284  proglist.size() != ch_proglist.size())
1285  continue;
1286 
1287  bool isAlt = true;
1288  for (size_t j = 0; j < proglist.size(); ++j)
1289  {
1290  isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1291  }
1292 
1293  if (isAlt)
1294  {
1295  si = i;
1296  break;
1297  }
1298  }
1299 
1301 
1302  return si;
1303 }
1304 
1305 
1306 static constexpr uint64_t MKKEY(uint64_t IDX, uint64_t SEL)
1307  { return (IDX << 32) | SEL; }
1308 
1310 {
1311  ChannelInfoList selected;
1312 
1313  int idx = GetStartChannelOffset();
1314  if (idx < 0)
1315  return selected;
1316 
1317  uint si = m_channelInfoIdx[idx];
1318 
1319  std::vector<uint64_t> sel;
1320  sel.push_back( MKKEY(idx, si) );
1321 
1322  const ChannelInfo *ch = GetChannelInfo(sel[0]>>32, sel[0]&0xffff);
1323  if (!ch)
1324  return selected;
1325 
1326  selected.push_back(*ch);
1327  if (m_channelInfos[idx].size() <= 1)
1328  return selected;
1329 
1330  ProgramList proglist = GetProgramList(selected[0].m_chanId);
1331 
1332  if (proglist.empty())
1333  return selected;
1334 
1335  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1336  {
1337  const ChannelInfo *ci = GetChannelInfo(idx, i);
1338  if (ci && (i != si) &&
1339  (ci->m_callSign == ch->m_callSign) && (ci->m_chanNum == ch->m_chanNum))
1340  {
1341  sel.push_back( MKKEY(idx, i) );
1342  }
1343  }
1344 
1345  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1346  {
1347  const ChannelInfo *ci = GetChannelInfo(idx, i);
1348  if (ci && (i != si) &&
1349  (ci->m_callSign == ch->m_callSign) && (ci->m_chanNum != ch->m_chanNum))
1350  {
1351  sel.push_back( MKKEY(idx, i) );
1352  }
1353  }
1354 
1355  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1356  {
1357  const ChannelInfo *ci = GetChannelInfo(idx, i);
1358  if ((i != si) && (ci->m_callSign != ch->m_callSign))
1359  {
1360  sel.push_back( MKKEY(idx, i) );
1361  }
1362  }
1363 
1364  for (size_t i = 1; i < sel.size(); ++i)
1365  {
1366  const ChannelInfo *ci = GetChannelInfo(sel[i]>>32, sel[i]&0xffff);
1367  const ProgramList ch_proglist = GetProgramList(ch->m_chanId);
1368 
1369  if (!ci || proglist.size() != ch_proglist.size())
1370  continue;
1371 
1372  bool isAlt = true;
1373  for (size_t j = 0; j < proglist.size(); ++j)
1374  {
1375  isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1376  }
1377 
1378  if (isAlt)
1379  selected.push_back(*ci);
1380  }
1381 
1382  return selected;
1383 }
1384 #undef MKKEY
1385 
1387 {
1388  m_updateTimer->stop();
1389  fillProgramInfos();
1390  m_updateTimer->start(kUpdateMS);
1391 }
1392 
1393 void GuideGrid::fillChannelInfos(bool gotostartchannel)
1394 {
1395  m_channelInfos.clear();
1396  m_channelInfoIdx.clear();
1398 
1399  uint avail = 0;
1400  const ChannelUtil::OrderBy ordering = m_channelOrdering == "channum" ?
1402  ChannelInfoList channels = ChannelUtil::LoadChannels(0, 0, avail, true,
1403  ordering,
1405  0,
1406  (m_changrpid < 0) ? 0 : m_changrpid);
1407 
1408  using uint_list_t = std::vector<unsigned int>;
1409  QMap<QString,uint_list_t> channum_to_index_map;
1410  QMap<QString,uint_list_t> callsign_to_index_map;
1411 
1412  for (size_t i = 0; i < channels.size(); ++i)
1413  {
1414  uint chan = i;
1415  if (m_sortReverse)
1416  {
1417  chan = channels.size() - i - 1;
1418  }
1419 
1420  bool ndup = !channum_to_index_map[channels[chan].m_chanNum].empty();
1421  bool cdup = !callsign_to_index_map[channels[chan].m_callSign].empty();
1422 
1423  if (ndup && cdup)
1424  continue;
1425 
1426  const ChannelInfo& val(channels[chan]);
1427 
1428  channum_to_index_map[val.m_chanNum].push_back(GetChannelCount());
1429  callsign_to_index_map[val.m_callSign].push_back(GetChannelCount());
1430 
1431  // add the new channel to the list
1433  tmp.push_back(val);
1434  m_channelInfos.push_back(tmp);
1435  }
1436 
1437  // handle duplicates
1438  for (auto & channel : channels)
1439  {
1440  const uint_list_t &ndups = channum_to_index_map[channel.m_chanNum];
1441  for (unsigned int ndup : ndups)
1442  {
1443  if (channel.m_chanId != m_channelInfos[ndup][0].m_chanId &&
1444  channel.m_callSign == m_channelInfos[ndup][0].m_callSign)
1445  m_channelInfos[ndup].push_back(channel);
1446  }
1447 
1448  const uint_list_t &cdups = callsign_to_index_map[channel.m_callSign];
1449  for (unsigned int cdup : cdups)
1450  {
1451  if (channel.m_chanId != m_channelInfos[cdup][0].m_chanId)
1452  m_channelInfos[cdup].push_back(channel);
1453  }
1454  }
1455 
1456  if (gotostartchannel)
1457  {
1458  int ch = FindChannel(m_startChanID, m_startChanNum, false);
1459  m_currentStartChannel = (uint) std::max(0, ch);
1460  }
1461 
1462  if (m_channelInfos.empty())
1463  {
1464  LOG(VB_GENERAL, LOG_ERR, "GuideGrid: "
1465  "\n\t\t\tYou don't have any channels defined in the database."
1466  "\n\t\t\tGuide grid will have nothing to show you.");
1467  }
1468 }
1469 
1470 int GuideGrid::FindChannel(uint chanid, const QString &channum,
1471  bool exact) const
1472 {
1473  // first check chanid
1474  uint i = (chanid) ? 0 : GetChannelCount();
1475  for (; i < GetChannelCount(); ++i)
1476  {
1477  if (m_channelInfos[i][0].m_chanId == chanid)
1478  return i;
1479  }
1480 
1481  // then check for chanid in duplicates
1482  i = (chanid) ? 0 : GetChannelCount();
1483  for (; i < GetChannelCount(); ++i)
1484  {
1485  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1486  {
1487  if (m_channelInfos[i][j].m_chanId == chanid)
1488  return i;
1489  }
1490  }
1491 
1492  // then check channum, first only
1493  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1494  for (; i < GetChannelCount(); ++i)
1495  {
1496  if (m_channelInfos[i][0].m_chanNum == channum)
1497  return i;
1498  }
1499 
1500  // then check channum duplicates
1501  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1502  for (; i < GetChannelCount(); ++i)
1503  {
1504  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1505  {
1506  if (m_channelInfos[i][j].m_chanNum == channum)
1507  return i;
1508  }
1509  }
1510 
1511  if (exact || channum.isEmpty())
1512  return -1;
1513 
1514  ChannelInfoList list;
1515  QVector<int> idxList;
1516  for (i = 0; i < GetChannelCount(); ++i)
1517  {
1518  for (size_t j = 0; j < m_channelInfos[i].size(); ++j)
1519  {
1520  list.push_back(m_channelInfos[i][j]);
1521  idxList.push_back(i);
1522  }
1523  }
1524  int result = ChannelUtil::GetNearestChannel(list, channum);
1525  if (result >= 0)
1526  result = idxList[result];
1527  return result;
1528 }
1529 
1531 {
1532  m_timeList->Reset();
1533 
1534  QDateTime starttime = m_currentStartTime;
1535 
1538 
1539  for (int x = 0; x < m_timeCount; ++x)
1540  {
1541  int mins = starttime.time().minute();
1542  mins = 5 * (mins / 5);
1543  if (mins % 30 == 0)
1544  {
1545  QString timeStr = MythDate::toString(starttime, MythDate::kTime);
1546 
1547  InfoMap infomap;
1548  infomap["starttime"] = timeStr;
1549 
1550  QDateTime endtime = starttime.addSecs(kThirtyMinutes);
1551 
1552  infomap["endtime"] = MythDate::toString(endtime, MythDate::kTime);
1553 
1554  auto *item = new MythUIButtonListItem(m_timeList, timeStr);
1555 
1556  item->SetTextFromMap(infomap);
1557  }
1558 
1559  starttime = starttime.addSecs(kFiveMinutes);
1560  }
1561  m_currentEndTime = starttime;
1562 }
1563 
1564 void GuideGrid::fillProgramInfos(bool useExistingData)
1565 {
1566  fillProgramRowInfos(-1, useExistingData);
1567 }
1568 
1570 {
1571  auto *proglist = new ProgramList();
1572 
1573  if (proglist)
1574  {
1575  MSqlBindings bindings;
1576  QString querystr = "WHERE program.chanid = :CHANID "
1577  " AND program.endtime >= :STARTTS "
1578  " AND program.starttime <= :ENDTS "
1579  " AND program.starttime >= :STARTLIMITTS "
1580  " AND program.manualid = 0 ";
1581  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1582  bindings[":CHANID"] = GetChannelInfo(chanNum)->m_chanId;
1583  bindings[":STARTTS"] = starttime;
1584  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1585  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1586 
1587  LoadFromProgram(*proglist, querystr, bindings, m_recList);
1588  }
1589 
1590  return proglist;
1591 }
1592 
1593 void GuideGrid::fillProgramRowInfos(int firstRow, bool useExistingData)
1594 {
1595  bool allRows = false;
1596  unsigned int numRows = 1;
1597  if (firstRow < 0)
1598  {
1599  firstRow = 0;
1600  allRows = true;
1601  numRows = std::min((unsigned int)m_channelInfos.size(),
1602  (unsigned int)m_guideGrid->getChannelCount());
1603  }
1604  QVector<int> chanNums;
1605  QVector<ProgramList*> proglists;
1606 
1607  for (unsigned int i = 0; i < numRows; ++i)
1608  {
1609  unsigned int row = i + firstRow;
1610  // never divide by zero..
1612  return;
1613 
1614  for (int x = 0; x < m_timeCount; ++x)
1615  {
1616  m_programInfos[row][x] = nullptr;
1617  }
1618 
1619  if (m_channelInfos.empty())
1620  return;
1621 
1622  int chanNum = row + m_currentStartChannel;
1623  if (chanNum >= (int) m_channelInfos.size())
1624  chanNum -= (int) m_channelInfos.size();
1625  if (chanNum >= (int) m_channelInfos.size())
1626  return;
1627 
1628  chanNum = std::max(chanNum, 0);
1629 
1630  ProgramList *proglist = nullptr;
1631  if (useExistingData)
1632  proglist = CopyProglist(m_programs[row]);
1633  chanNums.push_back(chanNum);
1634  proglists.push_back(proglist);
1635  }
1636  if (allRows)
1637  {
1638  for (unsigned int i = numRows;
1639  i < (unsigned int) m_guideGrid->getChannelCount(); ++i)
1640  {
1641  delete m_programs[i];
1642  m_programs[i] = nullptr;
1643  m_guideGrid->ResetRow(i);
1644  }
1645  }
1646 
1648 
1649  GuideStatus gs(firstRow, chanNums.size(), chanNums,
1654  auto *updater = new GuideUpdateProgramRow(this, gs, proglists);
1655  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
1656 }
1657 
1659  const QDateTime& start,
1660  ProgramList *proglist)
1661 {
1662  if (row < 0 || row >= m_channelCount ||
1663  start != m_currentStartTime)
1664  {
1665  delete proglist;
1666  return;
1667  }
1668 
1669  QDateTime ts = m_currentStartTime;
1670 
1671  QDateTime tnow = MythDate::current();
1672  int progPast = 0;
1673  if (tnow > m_currentEndTime)
1674  progPast = 100;
1675  else if (tnow < m_currentStartTime)
1676  progPast = 0;
1677  else
1678  {
1679  int played = m_currentStartTime.secsTo(tnow);
1680  int length = m_currentStartTime.secsTo(m_currentEndTime);
1681  if (length)
1682  progPast = played * 100 / length;
1683  }
1684 
1685  m_progPast = progPast;
1686 
1687  auto program = proglist->begin();
1688  std::vector<ProgramInfo*> unknownlist;
1689  bool unknown = false;
1690  ProgramInfo *proginfo = nullptr;
1691  for (int x = 0; x < m_timeCount; ++x)
1692  {
1693  if (program != proglist->end() &&
1694  (ts >= (*program)->GetScheduledEndTime()))
1695  {
1696  ++program;
1697  }
1698 
1699  if ((program == proglist->end()) ||
1700  (ts < (*program)->GetScheduledStartTime()))
1701  {
1702  if (unknown)
1703  {
1704  if (proginfo)
1705  {
1706  proginfo->m_spread++;
1707  proginfo->SetScheduledEndTime(proginfo->GetScheduledEndTime().addSecs(kFiveMinutes));
1708  }
1709  }
1710  else
1711  {
1712  proginfo = new ProgramInfo(kUnknownTitle,
1713  GuideGrid::tr("Unknown", "Unknown program title"),
1714  ts, ts.addSecs(kFiveMinutes));
1715  unknownlist.push_back(proginfo);
1716  proginfo->m_startCol = x;
1717  proginfo->m_spread = 1;
1718  unknown = true;
1719  }
1720  }
1721  else
1722  {
1723  if (proginfo && proginfo == *program)
1724  {
1725  proginfo->m_spread++;
1726  }
1727  else
1728  {
1729  proginfo = *program;
1730  if (proginfo)
1731  {
1732  proginfo->m_startCol = x;
1733  proginfo->m_spread = 1;
1734  unknown = false;
1735  }
1736  }
1737  }
1738  m_programInfos[row][x] = proginfo;
1739  ts = ts.addSecs(kFiveMinutes);
1740  }
1741 
1742  // AutoDeleteDeque doesn't work with std::back_inserter
1743  for (auto & pi : unknownlist)
1744  proglist->push_back(pi); // cppcheck-suppress useStlAlgorithm
1745 
1746  MythRect programRect = m_ggProgramRect;
1747 
1749  double ydifference = 0.0;
1750  double xdifference = 0.0;
1751 
1752  if (m_verticalLayout)
1753  {
1754  ydifference = programRect.width() /
1755  (double) m_ggChannelCount;
1756  xdifference = programRect.height() /
1757  (double) m_timeCount;
1758  }
1759  else
1760  {
1761  ydifference = programRect.height() /
1762  (double) m_ggChannelCount;
1763  xdifference = programRect.width() /
1764  (double) m_timeCount;
1765  }
1766 
1767  int arrow = GridTimeNormal;
1768  int cnt = 0;
1769  int8_t spread = 1;
1770  QDateTime lastprog;
1771  QRect tempRect;
1772  bool isCurrent = false;
1773 
1774  for (int x = 0; x < m_timeCount; ++x)
1775  {
1776  ProgramInfo *pginfo = m_programInfos[row][x];
1777  if (!pginfo)
1778  continue;
1779 
1780  spread = 1;
1781  if (pginfo->GetScheduledStartTime() != lastprog)
1782  {
1783  arrow = GridTimeNormal;
1784  if (pginfo->GetScheduledStartTime() < m_firstTime.addSecs(-300))
1785  arrow |= GridTimeStartsBefore;
1786  if (pginfo->GetScheduledEndTime() > m_lastTime.addSecs(2100))
1787  arrow |= GridTimeEndsAfter;
1788 
1789  if (pginfo->m_spread != -1)
1790  {
1791  spread = pginfo->m_spread;
1792  }
1793  else
1794  {
1795  for (int z = x + 1; z < m_timeCount; ++z)
1796  {
1797  ProgramInfo *test = m_programInfos[row][z];
1798  if (test && (test->GetScheduledStartTime() ==
1799  pginfo->GetScheduledStartTime()))
1800  spread++;
1801  }
1802  pginfo->m_spread = spread;
1803  pginfo->m_startCol = x;
1804 
1805  for (int z = x + 1; z < x + spread; ++z)
1806  {
1807  ProgramInfo *test = m_programInfos[row][z];
1808  if (test)
1809  {
1810  test->m_spread = spread;
1811  test->m_startCol = x;
1812  }
1813  }
1814  }
1815 
1816  if (m_verticalLayout)
1817  {
1818  tempRect = QRect((int)(row * ydifference),
1819  (int)(x * xdifference),
1820  (int)(ydifference),
1821  (int)(xdifference * pginfo->m_spread));
1822  }
1823  else
1824  {
1825  tempRect = QRect((int)(x * xdifference),
1826  (int)(row * ydifference),
1827  (int)(xdifference * pginfo->m_spread),
1828  (int)ydifference);
1829  }
1830 
1831  // snap to right edge for last entry.
1832  if (tempRect.right() + 2 >= programRect.width())
1833  tempRect.setRight(programRect.width());
1834  if (tempRect.bottom() + 2 >= programRect.bottom())
1835  tempRect.setBottom(programRect.bottom());
1836 
1837  isCurrent = m_currentRow == row && (m_currentCol >= x) &&
1838  (m_currentCol < (x + spread));
1839 
1840  int recFlag = 0;
1841  switch (pginfo->GetRecordingRuleType())
1842  {
1843  case kSingleRecord:
1844  recFlag = 1;
1845  break;
1846  case kDailyRecord:
1847  recFlag = 2;
1848  break;
1849  case kAllRecord:
1850  recFlag = 4;
1851  break;
1852  case kWeeklyRecord:
1853  recFlag = 5;
1854  break;
1855  case kOneRecord:
1856  recFlag = 6;
1857  break;
1858  case kOverrideRecord:
1859  case kDontRecord:
1860  recFlag = 7;
1861  break;
1862  case kNotRecording:
1863  default:
1864  recFlag = 0;
1865  break;
1866  }
1867 
1868  int recStat = 0;
1869  if (pginfo->GetRecordingStatus() == RecStatus::Conflict ||
1871  recStat = 2;
1872  else if (pginfo->GetRecordingStatus() <= RecStatus::WillRecord)
1873  recStat = 1;
1874  else
1875  recStat = 0;
1876 
1877  QString title = (pginfo->GetTitle() == kUnknownTitle) ?
1878  GuideGrid::tr("Unknown", "Unknown program title") :
1879  pginfo->GetTitle();
1880  m_result.emplace_back(
1881  row, cnt, tempRect, title,
1882  pginfo->GetCategory(), arrow, recFlag,
1883  recStat, isCurrent);
1884 
1885  cnt++;
1886  }
1887 
1888  lastprog = pginfo->GetScheduledStartTime();
1889  }
1890 }
1891 
1892 void GuideGrid::customEvent(QEvent *event)
1893 {
1894  if (event->type() == MythEvent::kMythEventMessage)
1895  {
1896  auto *me = dynamic_cast<MythEvent *>(event);
1897  if (me == nullptr)
1898  return;
1899 
1900  const QString& message = me->Message();
1901 
1902  if (message == "SCHEDULE_CHANGE")
1903  {
1904  GuideHelper::Wait(this);
1906  fillProgramInfos();
1907  }
1908  }
1909  else if (event->type() == DialogCompletionEvent::kEventType)
1910  {
1911  auto *dce = (DialogCompletionEvent*)(event);
1912 
1913  QString resultid = dce->GetId();
1914  QString resulttext = dce->GetResultText();
1915  int buttonnum = dce->GetResult();
1916 
1917  if (resultid == "deleterule")
1918  {
1919  auto *record = dce->GetData().value<RecordingRule *>();
1920  if (record)
1921  {
1922  if ((buttonnum > 0) && !record->Delete())
1923  LOG(VB_GENERAL, LOG_ERR, "Failed to delete recording rule");
1924  delete record;
1925  }
1926  }
1927  // Test for this here because it can come from
1928  // different menus.
1929  else if (resulttext == tr("Watch This Channel"))
1930  {
1931  ChannelInfoList selection = GetSelection();
1932  if (SelectionIsTunable(selection))
1933  TV::StartTV(nullptr, kStartTVNoFlags, selection);
1934  }
1935  else if (resultid == "guidemenu")
1936  {
1937  if (resulttext == tr("Record This"))
1938  {
1939  QuickRecord();
1940  }
1941  else if (resulttext == tr("Change to Channel"))
1942  {
1943  enter();
1944  }
1945  else if (resulttext == tr("Program Details"))
1946  {
1947  ShowDetails();
1948  }
1949  else if (resulttext == tr("Reverse Channel Order"))
1950  {
1952  generateListings();
1953  updateChannels();
1954  }
1955  else if (resulttext == tr("Channel Search"))
1956  {
1958  }
1959  else if (resulttext == tr("Add To Channel Group"))
1960  {
1962  ChannelGroupMenu(2);
1963  }
1964  else if (resulttext == tr("Remove from Channel Group"))
1965  {
1967  }
1968  else if (resulttext == tr("Choose Channel Group"))
1969  {
1970  ChannelGroupMenu(1);
1971  }
1972  else if (resulttext == tr("Recording Options"))
1973  {
1975  }
1976  else if (resulttext == tr("Jump to Time"))
1977  {
1978  ShowJumpToTime();
1979  }
1980  }
1981  else if (resultid == "recmenu")
1982  {
1983  if (resulttext == tr("Edit Recording Status"))
1984  {
1985  EditRecording();
1986  }
1987  else if (resulttext == tr("Edit Schedule"))
1988  {
1989  EditScheduled();
1990  }
1991  else if (resulttext == tr("Show Upcoming"))
1992  {
1993  ShowUpcoming();
1994  }
1995  else if (resulttext == tr("Previously Recorded"))
1996  {
1997  ShowPrevious();
1998  }
1999  else if (resulttext == tr("Custom Edit"))
2000  {
2001  EditCustom();
2002  }
2003  else if (resulttext == tr("Delete Rule"))
2004  {
2005  deleteRule();
2006  }
2007 
2008  }
2009  else if (resultid == "channelgrouptogglemenu")
2010  {
2011  int changroupid = ChannelGroup::GetChannelGroupId(resulttext);
2012 
2013  if (changroupid > 0)
2014  toggleChannelFavorite(changroupid);
2015  }
2016  else if (resultid == "channelgroupmenu")
2017  {
2018  if (buttonnum >= 0)
2019  {
2020  int changroupid = -1;
2021 
2022  if (resulttext == QObject::tr("All Channels"))
2023  changroupid = -1;
2024  else
2025  changroupid = ChannelGroup::GetChannelGroupId(resulttext);
2026 
2027  m_changrpid = changroupid;
2028  generateListings();
2029  updateChannels();
2030  updateInfo();
2031 
2032  QString changrpname;
2034 
2035  if (m_changroupname)
2036  m_changroupname->SetText(changrpname);
2037  }
2038  }
2039  else if (resultid == "jumptotime")
2040  {
2041  QDateTime datetime = dce->GetData().toDateTime();
2042  moveToTime(datetime);
2043  }
2044  else
2045  {
2047  }
2048  }
2049  else if (event->type() == UpdateGuideEvent::kEventType)
2050  {
2051  auto *uge = dynamic_cast<UpdateGuideEvent*>(event);
2052  if (uge && uge->m_updater)
2053  {
2054  uge->m_updater->ExecuteUI();
2055  delete uge->m_updater;
2056  uge->m_updater = nullptr;
2057  }
2058  }
2059 }
2060 
2062 {
2063  if (m_dateText)
2065  if (m_longdateText)
2068 }
2069 
2070 void GuideGrid::updateProgramsUI(unsigned int firstRow, unsigned int numRows,
2071  int progPast,
2072  const QVector<ProgramList*> &proglists,
2073  const ProgInfoGuideArray &programInfos,
2074  const std::list<GuideUIElement> &elements)
2075 {
2076  for (unsigned int i = 0; i < numRows; ++i)
2077  {
2078  unsigned int row = i + firstRow;
2079  m_guideGrid->ResetRow(row);
2080  if (m_programs[row] != proglists[i])
2081  {
2082  delete m_programs[row];
2083  m_programs[row] = proglists[i];
2084  }
2085  }
2086  m_guideGrid->SetProgPast(progPast);
2087  for (const auto & r : elements)
2088  {
2089  m_guideGrid->SetProgramInfo(r.m_row, r.m_col, r.m_area, r.m_title,
2090  r.m_category, r.m_arrow, r.m_recType,
2091  r.m_recStat, r.m_selected);
2092  }
2093  for (unsigned int i = firstRow; i < firstRow + numRows; ++i)
2094  {
2095  for (int j = 0; j < MAX_DISPLAY_TIMES; ++j)
2096  m_programInfos[i][j] = programInfos[i][j];
2097  if (i == (unsigned int)m_currentRow)
2098  updateInfo();
2099  }
2101 }
2102 
2104 {
2105  auto *updater = new GuideUpdateChannels(this, m_currentStartChannel);
2106  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
2107 }
2108 
2109 void GuideGrid::updateChannelsNonUI(QVector<ChannelInfo *> &chinfos,
2110  QVector<bool> &unavailables)
2111 {
2113 
2114  for (unsigned int y = 0; (y < (unsigned int)m_channelCount) && chinfo; ++y)
2115  {
2116  unsigned int chanNumber = y + m_currentStartChannel;
2117  if (chanNumber >= m_channelInfos.size())
2118  chanNumber -= m_channelInfos.size();
2119  if (chanNumber >= m_channelInfos.size())
2120  break;
2121 
2122  chinfo = GetChannelInfo(chanNumber);
2123 
2124  bool unavailable = false;
2125  bool try_alt = false;
2126 
2127  if (m_player)
2128  {
2130  const PlayerContext* ctx = m_player->GetPlayerContext();
2131  if (ctx && chinfo)
2132  try_alt = !TV::IsTunable(chinfo->m_chanId);
2134  }
2135 
2136  if (try_alt)
2137  {
2138  unavailable = true;
2139 
2140  // Try alternates with same channum if applicable
2141  uint alt = GetAlternateChannelIndex(chanNumber, true);
2142  if (alt != m_channelInfoIdx[chanNumber])
2143  {
2144  unavailable = false;
2145  m_channelInfoIdx[chanNumber] = alt;
2146  chinfo = GetChannelInfo(chanNumber);
2147  }
2148 
2149  // Try alternates with different channum if applicable
2150  if (unavailable && chinfo &&
2151  !GetProgramList(chinfo->m_chanId).empty())
2152  {
2153  alt = GetAlternateChannelIndex(chanNumber, false);
2154  unavailable = (alt == m_channelInfoIdx[chanNumber]);
2155  }
2156  }
2157  chinfos.push_back(chinfo);
2158  unavailables.push_back(unavailable);
2159  }
2160 }
2161 
2162 void GuideGrid::updateChannelsUI(const QVector<ChannelInfo *> &chinfos,
2163  const QVector<bool> &unavailables)
2164 {
2165  m_channelList->Reset();
2166  for (int i = 0; i < chinfos.size(); ++i)
2167  {
2168  ChannelInfo *chinfo = chinfos[i];
2169  bool unavailable = unavailables[i];
2170  auto *item = new MythUIButtonListItem(m_channelList,
2171  chinfo ? chinfo->GetFormatted(ChannelInfo::kChannelShort) : QString());
2172 
2173  QString state = "available";
2174  if (unavailable)
2175  state = (m_changrpid == -1) ? "unavailable" : "favunavailable";
2176  else
2177  state = (m_changrpid == -1) ? "available" : "favourite";
2178 
2179  item->SetFontState(state);
2180  item->DisplayState(state, "chanstatus");
2181 
2182  if (chinfo)
2183  {
2184  InfoMap infomap;
2185  chinfo->ToMap(infomap);
2186  item->SetTextFromMap(infomap);
2187 
2188  if (!chinfo->m_icon.isEmpty())
2189  {
2190  QString iconurl =
2191  gCoreContext->GetMasterHostPrefix("ChannelIcons",
2192  chinfo->m_icon);
2193  item->SetImage(iconurl, "channelicon");
2194  }
2195  }
2196  }
2198 }
2199 
2201 {
2202  if (m_currentRow < 0 || m_currentCol < 0)
2203  return;
2204 
2206  if (!pginfo)
2207  return;
2208 
2209  InfoMap infoMap;
2210 
2211  int chanNum = m_currentRow + m_currentStartChannel;
2212  if (chanNum >= (int)m_channelInfos.size())
2213  chanNum -= (int)m_channelInfos.size();
2214  if (chanNum >= (int)m_channelInfos.size())
2215  return;
2216  chanNum = std::max(chanNum, 0);
2217 
2218  ChannelInfo *chinfo = GetChannelInfo(chanNum);
2219 
2220  if (m_channelImage)
2221  {
2222  m_channelImage->Reset();
2223  if (!chinfo->m_icon.isEmpty())
2224  {
2225  QString iconurl = gCoreContext->GetMasterHostPrefix("ChannelIcons",
2226  chinfo->m_icon);
2227 
2228  m_channelImage->SetFilename(iconurl);
2229  m_channelImage->Load();
2230  }
2231  }
2232 
2233  chinfo->ToMap(infoMap);
2234  pginfo->ToMap(infoMap);
2235  // HACK - This should be done in ProgramInfo, but that needs more careful
2236  // review since it may have unintended consequences so we're doing it here
2237  // for now
2238  if (infoMap["title"] == kUnknownTitle)
2239  {
2240  infoMap["title"] = tr("Unknown", "Unknown program title");
2241  infoMap["titlesubtitle"] = tr("Unknown", "Unknown program title");
2242  }
2243 
2244  SetTextFromMap(infoMap);
2245 
2246  MythUIStateType *ratingState = dynamic_cast<MythUIStateType*>
2247  (GetChild("ratingstate"));
2248  if (ratingState)
2249  {
2250  QString rating = QString::number(pginfo->GetStars(10));
2251  ratingState->DisplayState(rating);
2252  }
2254 }
2255 
2257 {
2258  int oldchangrpid = m_changrpid;
2259 
2261 
2262  if (oldchangrpid != m_changrpid)
2263  generateListings();
2264 
2265  updateChannels();
2266  updateInfo();
2267 
2268  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
2269 
2270  if (m_changroupname)
2271  m_changroupname->SetText(changrpname);
2272 }
2273 
2275 {
2277  m_currentRow = 0;
2278 
2279  int maxchannel = 0;
2280  fillChannelInfos();
2281  maxchannel = std::max((int)GetChannelCount() - 1, 0);
2282  m_channelCount = std::min(m_guideGrid->getChannelCount(), maxchannel + 1);
2283 
2285  fillProgramInfos();
2286 }
2287 
2288 // mode 0 Include empty channel groups
2289 // mode 1 Exclude empty channel groups
2290 // mode 2 Only Manual channel groups
2292 {
2293  ChannelGroupList channels;
2294  if (mode == 2)
2295  channels = ChannelGroup::GetManualChannelGroups(true);
2296  else
2297  channels = ChannelGroup::GetChannelGroups(mode == 0);
2298 
2299  if (channels.empty())
2300  {
2301  QString message = tr("You don't have any channel groups defined");
2302 
2303  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2304 
2305  auto *okPopup = new MythConfirmationDialog(popupStack, message, false);
2306  if (okPopup->Create())
2307  popupStack->AddScreen(okPopup);
2308  else
2309  delete okPopup;
2310 
2311  return;
2312  }
2313 
2314  QString label = tr("Select Channel Group");
2315 
2316  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2317  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
2318 
2319  if (menuPopup->Create())
2320  {
2321  if (mode == 0 || mode == 2)
2322  {
2323  // add channel to group menu
2324  menuPopup->SetReturnEvent(this, "channelgrouptogglemenu");
2325  }
2326  else
2327  {
2328  // switch to channel group menu
2329  menuPopup->SetReturnEvent(this, "channelgroupmenu");
2330  menuPopup->AddButton(QObject::tr("All Channels"));
2331  }
2332 
2333  for (auto & channel : channels)
2334  {
2335  menuPopup->AddButton(channel.m_name);
2336  }
2337 
2338  popupStack->AddScreen(menuPopup);
2339  }
2340  else
2341  {
2342  delete menuPopup;
2343  }
2344 }
2345 
2347 {
2348  MSqlQuery query(MSqlQuery::InitCon());
2349 
2350  if (grpid == -1)
2351  {
2352  if (m_changrpid == -1)
2353  return;
2354  grpid = m_changrpid;
2355  }
2356 
2357  // Get current channel id, and make sure it exists...
2358  int chanNum = m_currentRow + m_currentStartChannel;
2359  if (chanNum >= (int)m_channelInfos.size())
2360  chanNum -= (int)m_channelInfos.size();
2361  if (chanNum >= (int)m_channelInfos.size())
2362  return;
2363  chanNum = std::max(chanNum, 0);
2364 
2365  ChannelInfo *ch = GetChannelInfo(chanNum);
2366  uint chanid = ch->m_chanId;
2367 
2368  // All Channels plus all automatic channel groups
2370  {
2371  // If currently viewing all channels, allow to add only not delete
2372  ChannelGroup::ToggleChannel(chanid, grpid, false);
2373  }
2374  else
2375  {
2376  // Only allow delete if viewing the favorite group in question
2377  ChannelGroup::ToggleChannel(chanid, grpid, true);
2378  }
2379 
2380  // Regenerate the list of non empty groups in case it did change
2382 
2383  // If viewing a manual group such as Favorites, refresh because a channel was removed
2385  {
2386  generateListings();
2387  updateChannels();
2388  updateInfo();
2389  }
2390 }
2391 
2393 {
2395 
2396  if (!test)
2397  {
2399  return;
2400  }
2401 
2402  int8_t startCol = test->m_startCol;
2403  m_currentCol = startCol - 1;
2404 
2405  if (m_currentCol < 0)
2406  {
2407  m_currentCol = 0;
2409  }
2410  else
2411  {
2413  }
2414 }
2415 
2417 {
2419 
2420  if (!test)
2421  {
2423  return;
2424  }
2425 
2426  int8_t spread = test->m_spread;
2427  int8_t startCol = test->m_startCol;
2428 
2429  m_currentCol = startCol + spread;
2430 
2431  if (m_currentCol > m_timeCount - 1)
2432  {
2433  m_currentCol = m_timeCount - 1;
2435  }
2436  else
2437  {
2439  }
2440 }
2441 
2443 {
2444  m_currentRow++;
2445 
2446  if (m_currentRow > m_channelCount - 1)
2447  {
2450  }
2451  else
2452  {
2454  }
2455 }
2456 
2458 {
2459  m_currentRow--;
2460 
2461  if (m_currentRow < 0)
2462  {
2463  m_currentRow = 0;
2465  }
2466  else
2467  {
2469  }
2470 }
2471 
2473 {
2474  switch (movement)
2475  {
2476  case kScrollLeft :
2478  break;
2479  case kScrollRight :
2481  break;
2482  case kPageLeft :
2484  break;
2485  case kPageRight :
2487  break;
2488  case kDayLeft :
2490  break;
2491  case kDayRight :
2493  break;
2494  default :
2495  break;
2496  }
2497 
2498  fillTimeInfos();
2499  fillProgramInfos();
2500  updateDateText();
2501 }
2502 
2504 {
2505  switch (movement)
2506  {
2507  case kScrollDown :
2509  break;
2510  case kScrollUp :
2512  break;
2513  case kPageDown :
2515  break;
2516  case kPageUp :
2518  break;
2519  default :
2520  break;
2521  }
2522 
2523  fillProgramInfos();
2524  updateChannels();
2525 }
2526 
2527 void GuideGrid::moveToTime(const QDateTime& datetime)
2528 {
2529  if (!datetime.isValid())
2530  return;
2531 
2532  m_currentStartTime = datetime;
2533 
2534  fillTimeInfos();
2535  fillProgramInfos();
2536  updateDateText();
2537 }
2538 
2539 void GuideGrid::setStartChannel(int newStartChannel)
2540 {
2541  if (newStartChannel < 0)
2542  m_currentStartChannel = newStartChannel + GetChannelCount();
2543  else if (newStartChannel >= (int) GetChannelCount())
2544  m_currentStartChannel = newStartChannel - GetChannelCount();
2545  else
2546  m_currentStartChannel = newStartChannel;
2547 }
2548 
2550 {
2551  if (m_allowFinder)
2553 }
2554 
2556 {
2557  if (!m_player)
2558  return;
2559 
2560  m_updateTimer->stop();
2561 
2562  channelUpdate();
2563 
2564  // Don't perform transition effects when guide is being used during playback
2565  GetScreenStack()->PopScreen(this, false);
2566 
2567  epgIsVisibleCond.wakeAll();
2568 }
2569 
2571 {
2572  // HACK: Do not allow exit if we have a popup menu open, not convinced
2573  // that this is the right solution
2574  if (GetMythMainWindow()->GetStack("popup stack")->TotalScreens() > 0)
2575  return;
2576 
2577  m_updateTimer->stop();
2578 
2579  // don't fade the screen if we are returning to the player
2580  if (m_player)
2581  GetScreenStack()->PopScreen(this, false);
2582  else
2583  GetScreenStack()->PopScreen(this, true);
2584 
2585  epgIsVisibleCond.wakeAll();
2586 }
2587 
2589 {
2591 
2592  if (!pginfo || !pginfo->GetRecordingRuleID())
2593  return;
2594 
2595  auto *record = new RecordingRule();
2596  if (!record->LoadByProgram(pginfo))
2597  {
2598  delete record;
2599  return;
2600  }
2601 
2602  QString message = tr("Delete '%1' %2 rule?")
2603  .arg(record->m_title, toString(pginfo->GetRecordingRuleType()));
2604 
2605  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2606 
2607  auto *okPopup = new MythConfirmationDialog(popupStack, message, true);
2608 
2609  okPopup->SetReturnEvent(this, "deleterule");
2610  okPopup->SetData(QVariant::fromValue(record));
2611 
2612  if (okPopup->Create())
2613  popupStack->AddScreen(okPopup);
2614  else
2615  delete okPopup;
2616 }
2617 
2619 {
2620  if (!m_player)
2621  return;
2622 
2623  ChannelInfoList sel = GetSelection();
2624 
2625  if (!sel.empty())
2626  {
2628  m_player->ChangeChannel(sel);
2630  }
2631 }
2632 
2633 void GuideGrid::GoTo(int start, int cur_row)
2634 {
2635  setStartChannel(start);
2636  m_currentRow = cur_row % m_channelCount;
2637  updateChannels();
2638  fillProgramInfos();
2640 }
2641 
2643 {
2644  QString txt;
2645  {
2646  QMutexLocker locker(&m_jumpToChannelLock);
2647  if (m_jumpToChannel)
2648  txt = m_jumpToChannel->GetEntry();
2649  }
2650 
2651  if (txt.isEmpty())
2652  return;
2653 
2654  if (m_jumpToText)
2655  m_jumpToText->SetText(txt);
2656 }
2657 
2659 {
2660  QMutexLocker locker(&m_jumpToChannelLock);
2661  m_jumpToChannel = ptr;
2662 
2663  if (!m_jumpToChannel)
2664  {
2665  if (m_jumpToText)
2666  m_jumpToText->Reset();
2667 
2668  updateDateText();
2669  }
2670 }
2671 
2673 {
2674  GetMythMainWindow()->GetPaintWindow()->clearMask();
2675 }
2676 
2678 {
2679  emit m_player->RequestEmbedding(true, m_videoRect);
2680  QRegion r1 = QRegion(m_area);
2681  QRegion r2 = QRegion(m_videoRect);
2682  GetMythMainWindow()->GetPaintWindow()->setMask(r1.xored(r2));
2683 }
2684 
2686 {
2687  if (m_player)
2688  HideTVWindow();
2689 
2691 }
2692 
2694 {
2695  if (m_player)
2696  EmbedTVWindow();
2697 
2699 }
2700 
2702 {
2703  QString message = tr("Jump to a specific date and time in the guide");
2706 
2707  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2708  auto *timedlg = new MythTimeInputDialog(popupStack, message, flags);
2709 
2710  if (timedlg->Create())
2711  {
2712  timedlg->SetReturnEvent(this, "jumptotime");
2713  popupStack->AddScreen(timedlg);
2714  }
2715  else
2716  {
2717  delete timedlg;
2718  }
2719 }
ChannelInfo
Definition: channelinfo.h:31
has_action
static bool has_action(const QString &action, const QStringList &actions)
Definition: guidegrid.cpp:102
GuideGrid::ShowMenu
void ShowMenu(void) override
Definition: guidegrid.cpp:1104
GuideGrid::m_guideGrid
MythUIGuideGrid * m_guideGrid
Definition: guidegrid.h:290
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:100
GuideUpdaterBase::~GuideUpdaterBase
virtual ~GuideUpdaterBase()=default
GuideGrid::GetChannelCount
uint GetChannelCount(void) const
Definition: guidegrid.cpp:1199
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:274
GuideUpdateChannels::ExecuteNonUI
bool ExecuteNonUI(void) override
Definition: guidegrid.cpp:327
MythScreenType::LoadInBackground
void LoadInBackground(const QString &message="")
Definition: mythscreentype.cpp:283
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:317
GuideStatus::m_currentStartChannel
const uint m_currentStartChannel
Definition: guidegrid.cpp:218
TVPlaybackState::RequestEmbedding
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
GuideGrid::m_embedVideo
bool m_embedVideo
Definition: guidegrid.h:270
mythrect.h
mythevent.h
ProgramInfo::m_startCol
int8_t m_startCol
Definition: programinfo.h:849
MythGestureEvent::Click
@ Click
Definition: mythgesture.h:77
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:93
tv.h
TV::GetState
TVState GetState() const
Definition: tv_play.cpp:1357
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:102
GuideGrid::moveUpDown
void moveUpDown(MoveVector movement)
Definition: guidegrid.cpp:2503
ACTION_DOWN
static constexpr const char * ACTION_DOWN
Definition: mythuiactions.h:17
kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:26
GuideStatus::m_channelCount
const int m_channelCount
Definition: guidegrid.cpp:220
GuideGrid::EmbedTVWindow
void EmbedTVWindow(void)
Definition: guidegrid.cpp:2677
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
JumpToChannelListener::FindChannel
virtual int FindChannel(uint chanid, const QString &channum, bool exact=true) const =0
mythuitext.h
GuideGrid::channelUpdate
void channelUpdate()
Definition: guidegrid.cpp:2618
MythEvent::kMythEventMessage
static const Type kMythEventMessage
Definition: mythevent.h:79
GuideUpdateProgramRow::m_currentStartTime
const QDateTime m_currentStartTime
Definition: guidegrid.cpp:305
GuideGrid::m_timeCount
int m_timeCount
Definition: guidegrid.h:263
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
ChannelGroup::GetChannelGroupName
static QString GetChannelGroupName(int grpid)
Definition: channelgroup.cpp:374
LoadFromScheduler
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
Definition: programinfo.h:916
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:65
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
GuideGrid::m_changroupname
MythUIText * m_changroupname
Definition: guidegrid.h:294
ACTION_PAGERIGHT
#define ACTION_PAGERIGHT
Definition: tv_actions.h:12
JumpToChannel
Definition: guidegrid.h:47
guidegrid.h
GuideGrid::gestureEvent
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: guidegrid.cpp:898
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:89
MythGestureEvent::GetGesture
Gesture GetGesture() const
Definition: mythgesture.h:85
MythUIType::GetChildAt
MythUIType * GetChildAt(QPoint p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
Definition: mythuitype.cpp:241
ChannelInfo::m_chanId
uint m_chanId
Definition: channelinfo.h:85
ChannelInfo::ToMap
void ToMap(InfoMap &infoMap)
Definition: channelinfo.cpp:220
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:2469
ChannelGroup
Definition: channelgroup.h:35
GuideGrid::Close
void Close() override
Definition: guidegrid.cpp:2570
ScheduleCommon::customEvent
void customEvent(QEvent *event) override
Definition: schedulecommon.cpp:483
GuideGrid::ShowRecordingMenu
void ShowRecordingMenu(void)
Definition: guidegrid.cpp:1150
GuideGrid::kDayRight
@ kDayRight
Definition: guidegrid.h:195
GuideGrid::m_allowFinder
bool m_allowFinder
Definition: guidegrid.h:242
GuideUpdaterBase::GuideUpdaterBase
GuideUpdaterBase(GuideGrid *guide)
Definition: guidegrid.cpp:228
GuideGrid::m_channelGroupListManual
ChannelGroupList m_channelGroupListManual
Definition: guidegrid.h:283
GuideGrid::ToggleMute
void ToggleMute(bool CycleChannels)
MythTimeInputDialog::kHours
@ kHours
Definition: mythdialogbox.h:473
GuideGrid::m_channelImage
MythUIImage * m_channelImage
Definition: guidegrid.h:295
GuideGrid::GetAlternateChannelIndex
uint GetAlternateChannelIndex(uint chan_idx, bool with_same_channum) const
Definition: guidegrid.cpp:1247
ACTION_FINDER
#define ACTION_FINDER
Definition: tv_actions.h:27
RunProgramFinder
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
Definition: progfind.cpp:31
MythUIGuideGrid::isVerticalLayout
bool isVerticalLayout(void) const
Definition: mythuiguidegrid.h:55
GuideGrid::m_jumpToChannelLock
QRecursiveMutex m_jumpToChannelLock
Definition: guidegrid.h:285
GuideGrid::m_startChanID
uint m_startChanID
Definition: guidegrid.h:254
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:138
MythGestureEvent::LeftThenDown
@ LeftThenDown
Definition: mythgesture.h:66
MythUIGuideGrid::SetProgPast
void SetProgPast(int ppast)
Definition: mythuiguidegrid.cpp:823
mythscreenstack.h
MythGestureEvent::Down
@ Down
Definition: mythgesture.h:50
GuideGrid::m_currentEndTime
QDateTime m_currentEndTime
Definition: guidegrid.h:252
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:971
GuideGrid::updateChannels
void updateChannels(void)
Definition: guidegrid.cpp:2103
GuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: guidegrid.h:264
ChannelGroup::InChannelGroupList
static bool InChannelGroupList(const ChannelGroupList &groupList, int grpid)
Definition: channelgroup.cpp:363
GuideGrid::setStartChannel
void setStartChannel(int newStartChannel)
Definition: guidegrid.cpp:2539
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
JumpToChannelListener
Definition: guidegrid.h:37
ACTION_TOGGLERECORD
#define ACTION_TOGGLERECORD
Definition: tv_actions.h:19
GuideUpdaterBase::ExecuteUI
virtual void ExecuteUI(void)=0
AutoDeleteDeque::empty
bool empty(void) const
Definition: autodeletedeque.h:66
MythGestureEvent::Left
@ Left
Definition: mythgesture.h:51
GuideGrid::m_currentStartChannel
uint m_currentStartChannel
Definition: guidegrid.h:253
JumpToChannel::kJumpToChannelTimeout
static const uint kJumpToChannelTimeout
Definition: guidegrid.h:75
GuideUpdateProgramRow::m_timeCount
const int m_timeCount
Definition: guidegrid.cpp:311
ChannelUtil::OrderBy
OrderBy
Definition: channelutil.h:206
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
GuideHelper::s_wait
static QWaitCondition s_wait
Definition: guidegrid.cpp:404
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:21
mythdbcon.h
ProgramInfo::GetCategory
QString GetCategory(void) const
Definition: programinfo.h:370
ACTION_LEFT
static constexpr const char * ACTION_LEFT
Definition: mythuiactions.h:18
ProgInfoGuideArray
std::array< std::array< ProgramInfo *, MAX_DISPLAY_TIMES >, MAX_DISPLAY_CHANS > ProgInfoGuideArray
Definition: guidegrid.h:34
ACTION_VOLUMEUP
#define ACTION_VOLUMEUP
Definition: tv_actions.h:110
GuideUpdateProgramRow::m_ggChannelCount
const int m_ggChannelCount
Definition: guidegrid.cpp:304
RecordingRule
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:28
GuideGrid::GetStartChannelOffset
int GetStartChannelOffset(int row=-1) const
Definition: guidegrid.cpp:1204
ChannelGroup::GetManualChannelGroups
static ChannelGroupList GetManualChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:189
GuideGrid::toggleChannelFavorite
void toggleChannelFavorite(int grpid=-1)
Definition: guidegrid.cpp:2346
GuideGrid::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: guidegrid.cpp:609
GuideUpdateProgramRow::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:300
TV::ChangeChannel
void ChangeChannel(const ChannelInfoList &Options)
Definition: tv_play.cpp:6233
JumpToChannel::m_timer
QTimer * m_timer
Definition: guidegrid.h:73
ACTION_TOGGLEPGORDER
#define ACTION_TOGGLEPGORDER
Definition: tv_actions.h:13
GuideGrid::ShowJumpToTime
void ShowJumpToTime(void)
Definition: guidegrid.cpp:2701
GuideUpdateProgramRow::m_numRows
const unsigned int m_numRows
Definition: guidegrid.cpp:301
GuideGrid::m_channelList
MythUIButtonList * m_channelList
Definition: guidegrid.h:289
GuideGrid::cursorUp
void cursorUp()
Definition: guidegrid.cpp:2457
GuideUpdateChannels::m_unavailables
QVector< bool > m_unavailables
Definition: guidegrid.cpp:340
GuideStatus::m_ggChannelCount
const int m_ggChannelCount
Definition: guidegrid.cpp:216
GuideUpdateProgramRow::m_programInfos
ProgInfoGuideArray m_programInfos
Definition: guidegrid.cpp:317
GuideUpdateProgramRow::m_currentEndTime
const QDateTime m_currentEndTime
Definition: guidegrid.cpp:306
GuideHelper
Definition: guidegrid.cpp:354
ProgramInfo::GetScheduledEndTime
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
Definition: programinfo.h:398
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
GuideGrid::GuideGrid
GuideGrid(MythScreenStack *parentStack, uint chanid, QString channum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
Definition: guidegrid.cpp:486
GuideStatus::m_firstTime
const QDateTime m_firstTime
Definition: guidegrid.cpp:222
mythuistatetype.h
MAX_DISPLAY_TIMES
static constexpr int MAX_DISPLAY_TIMES
Definition: mythuiguidegrid.h:27
GuideStatus::m_currentRow
const int m_currentRow
Definition: guidegrid.cpp:219
GuideGrid::m_currentCol
int m_currentCol
Definition: guidegrid.h:258
GuideGrid::PlayerExiting
void PlayerExiting(TV *Player)
Definition: guidegrid.cpp:529
kUnknownTitle
const QString kUnknownTitle
Definition: guidegrid.cpp:55
autodeletedeque.h
ChannelGroup::GetChannelGroups
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:328
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:22
kThirtyMinutes
static constexpr int64_t kThirtyMinutes
Definition: guidegrid.cpp:60
JumpToChannel::deleteLater
virtual void deleteLater(void)
Definition: guidegrid.cpp:84
recordingtypes.h
JumpToChannel::m_rowsDisplayed
uint m_rowsDisplayed
Definition: guidegrid.h:72
GuideGrid::Create
bool Create(void) override
Definition: guidegrid.cpp:540
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:644
progfind.h
GuideGrid::cursorRight
void cursorRight()
Definition: guidegrid.cpp:2416
UpdateGuideEvent::UpdateGuideEvent
UpdateGuideEvent(GuideUpdaterBase *updater)
Definition: guidegrid.cpp:346
ACTION_SELECT
static constexpr const char * ACTION_SELECT
Definition: mythuiactions.h:15
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
GuideUpdateProgramRow::m_currentCol
const int m_currentCol
Definition: guidegrid.cpp:309
GridTimeStartsBefore
static constexpr uint8_t GridTimeStartsBefore
Definition: mythuiguidegrid.h:31
MythUIGuideGrid::getChannelCount
int getChannelCount(void) const
Definition: mythuiguidegrid.h:56
GuideGrid::updateChannelsNonUI
void updateChannelsNonUI(QVector< ChannelInfo * > &chinfos, QVector< bool > &unavailables)
Definition: guidegrid.cpp:2109
remoteutil.h
mythuibuttonlist.h
GuideGrid::kScrollDown
@ kScrollDown
Definition: guidegrid.h:187
GuideGrid::deleteRule
void deleteRule()
Definition: guidegrid.cpp:2588
mythuiimage.h
ScheduleCommon::ShowDetails
virtual void ShowDetails(void) const
Show the Program Details screen.
Definition: schedulecommon.cpp:27
ChannelInfo::m_icon
QString m_icon
Definition: channelinfo.h:93
GuideUpdateProgramRow::ExecuteNonUI
bool ExecuteNonUI(void) override
Definition: guidegrid.cpp:266
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15
GuideGrid::kScrollLeft
@ kScrollLeft
Definition: guidegrid.h:188
MythEvent::Message
const QString & Message() const
Definition: mythevent.h:65
mythuiguidegrid.h
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
GuideGrid::m_channelCount
int m_channelCount
Definition: guidegrid.h:262
TV::StartTV
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
Definition: tv_play.cpp:287
ScheduleCommon::EditRecording
virtual void EditRecording(bool may_watch_now=false)
Creates a dialog for editing the recording status, blocking until user leaves dialog.
Definition: schedulecommon.cpp:276
GuideGrid::aboutToShow
void aboutToShow() override
Definition: guidegrid.cpp:2693
ScheduleCommon::EditScheduled
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
Definition: schedulecommon.cpp:168
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
GuideUpdaterBase::ExecuteNonUI
virtual bool ExecuteNonUI(void)=0
JumpToChannel::Update
bool Update(void)
Definition: guidegrid.cpp:162
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:885
programtypes.h
GuideGrid::aboutToHide
void aboutToHide() override
Definition: guidegrid.cpp:2685
db_chan_list_t
std::vector< ChannelInfo > db_chan_list_t
Definition: guidegrid.h:32
GuideUpdateProgramRow::m_verticalLayout
const bool m_verticalLayout
Definition: guidegrid.cpp:312
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:29
GuideGrid::m_programs
std::vector< ProgramList * > m_programs
Definition: guidegrid.h:246
MythObservable::addListener
void addListener(QObject *listener)
Add a listener to the observable.
Definition: mythobservable.cpp:38
ChannelInfo::GetFormatted
QString GetFormatted(ChannelFormat format) const
Definition: channelinfo.cpp:192
AutoDeleteDeque::begin
iterator begin(void)
Definition: autodeletedeque.h:50
GuideUpdateProgramRow::ExecuteUI
void ExecuteUI(void) override
Definition: guidegrid.cpp:289
RecStatus::WillRecord
@ WillRecord
Definition: recordingstatus.h:31
mythuiutils.h
GuideGrid::m_startChanNum
QString m_startChanNum
Definition: guidegrid.h:255
GuideGrid::m_currentStartTime
QDateTime m_currentStartTime
Definition: guidegrid.h:251
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
JumpToChannelListener::GoTo
virtual void GoTo(int start, int cur_row)=0
GuideGrid::m_selectRecThreshold
std::chrono::minutes m_selectRecThreshold
Definition: guidegrid.h:240
GuideHelper::GuideHelper
GuideHelper(GuideGrid *guide, GuideUpdaterBase *updater)
Definition: guidegrid.cpp:357
MythDate::secsInFuture
std::chrono::seconds secsInFuture(const QDateTime &future)
Definition: mythdate.cpp:217
GuideGrid::kDayLeft
@ kDayLeft
Definition: guidegrid.h:194
ScheduleCommon::ShowPrevious
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
Definition: schedulecommon.cpp:250
GuideStatus::m_timeCount
const int m_timeCount
Definition: guidegrid.cpp:220
GuideGrid::customEvent
void customEvent(QEvent *event) override
Definition: guidegrid.cpp:1892
mythdate.h
GuideGrid::cursorDown
void cursorDown()
Definition: guidegrid.cpp:2442
MythGestureEvent::RightThenDown
@ RightThenDown
Definition: mythgesture.h:68
GuideGrid::m_originalStartTime
QDateTime m_originalStartTime
Definition: guidegrid.h:250
GuideGrid::m_videoRect
QRect m_videoRect
Definition: guidegrid.h:273
SelectionIsTunable
static bool SelectionIsTunable(const ChannelInfoList &selection)
Definition: guidegrid.cpp:1098
programinfo.h
RemoteRequestFreeInputList
std::vector< uint > RemoteRequestFreeInputList(uint excluded_input)
Definition: tvremoteutil.cpp:245
GuideGrid::fillChannelInfos
void fillChannelInfos(bool gotostartchannel=true)
Definition: guidegrid.cpp:1393
GuideUpdateProgramRow::m_chanNums
const QVector< int > m_chanNums
Definition: guidegrid.cpp:302
ProgramInfo::GetScheduledStartTime
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:391
GuideStatus::m_chanNums
const QVector< int > m_chanNums
Definition: guidegrid.cpp:214
ScheduleCommon::EditCustom
virtual void EditCustom(void)
Creates a dialog for creating a custom recording rule.
Definition: schedulecommon.cpp:204
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:27
mythlogging.h
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:451
GuideGrid::m_sortReverse
bool m_sortReverse
Definition: guidegrid.h:260
GuideStatus::m_ggProgramRect
const MythRect m_ggProgramRect
Definition: guidegrid.cpp:215
kUpdateMS
static constexpr std::chrono::milliseconds kUpdateMS
Definition: guidegrid.cpp:57
GuideStatus::m_currentEndTime
const QDateTime m_currentEndTime
Definition: guidegrid.cpp:217
GuideGrid::m_longdateText
MythUIText * m_longdateText
Definition: guidegrid.h:292
GuideGrid::m_firstTime
QDateTime m_firstTime
Definition: guidegrid.h:266
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1111
GuideUpdateChannels::m_chinfos
QVector< ChannelInfo * > m_chinfos
Definition: guidegrid.cpp:339
ProgramInfo::SetScheduledEndTime
void SetScheduledEndTime(const QDateTime &dt)
Definition: programinfo.h:528
GuideGrid::m_recList
ProgramList m_recList
Definition: guidegrid.h:248
GuideGrid::kPageRight
@ kPageRight
Definition: guidegrid.h:193
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:814
tv_actions.h
GuideHelper::s_lock
static QMutex s_lock
Definition: guidegrid.cpp:403
GuideUpdaterBase::m_guide
GuideGrid * m_guide
Definition: guidegrid.cpp:240
GuideStatus
Definition: guidegrid.cpp:190
MythGestureEvent::DownThenRight
@ DownThenRight
Definition: mythgesture.h:64
GuideGrid::MoveVector
MoveVector
Definition: guidegrid.h:185
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:550
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:362
GuideGrid::m_threadPool
MThreadPool m_threadPool
Definition: guidegrid.h:279
GuideGrid::showProgFinder
void showProgFinder()
Definition: guidegrid.cpp:2549
MythGestureEvent::UpThenLeft
@ UpThenLeft
Definition: mythgesture.h:61
GuideGrid::updateProgramsUI
void updateProgramsUI(unsigned int firstRow, unsigned int numRows, int progPast, const QVector< ProgramList * > &proglists, const ProgInfoGuideArray &programInfos, const std::list< GuideUIElement > &elements)
Definition: guidegrid.cpp:2070
GuideGrid::fillTimeInfos
void fillTimeInfos(void)
Definition: guidegrid.cpp:1530
GuideGrid::enter
void enter()
Definition: guidegrid.cpp:2555
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:203
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:37
GuideUpdateChannels::ExecuteUI
void ExecuteUI(void) override
Definition: guidegrid.cpp:334
GuideUpdateProgramRow::m_progPast
int m_progPast
Definition: guidegrid.cpp:318
ACTION_CHANNELSEARCH
#define ACTION_CHANNELSEARCH
Definition: tv_actions.h:28
GuideUpdateProgramRow::GuideUpdateProgramRow
GuideUpdateProgramRow(GuideGrid *guide, const GuideStatus &gs, QVector< ProgramList * > proglists)
Definition: guidegrid.cpp:246
ChannelInfo::m_chanNum
QString m_chanNum
Definition: channelinfo.h:86
GuideUpdateProgramRow::~GuideUpdateProgramRow
~GuideUpdateProgramRow() override=default
GuideGrid
Definition: guidegrid.h:101
mythtypes.h
MythUIComposite::SetTextFromMap
virtual void SetTextFromMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:9
ScheduleCommon
Definition: schedulecommon.h:15
MythDate::kDateShort
@ kDateShort
Default local time.
Definition: mythdate.h:20
MythUIType::m_parent
MythUIType * m_parent
Definition: mythuitype.h:294
RecStatus::Conflict
@ Conflict
Definition: recordingstatus.h:39
LOC
#define LOC
Definition: guidegrid.cpp:51
GuideUpdateProgramRow::m_lastTime
const QDateTime m_lastTime
Definition: guidegrid.cpp:314
ProgramInfo::ToMap
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
Definition: programinfo.cpp:1553
GuideGrid::m_updateTimer
QTimer * m_updateTimer
Definition: guidegrid.h:277
TV::IsTunable
static bool IsTunable(uint ChanId)
Definition: tv_play.cpp:6757
GuideGrid::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: guidegrid.cpp:585
GuideGrid::GetCurrentStartChannel
uint GetCurrentStartChannel(void) const
Definition: guidegrid.h:131
kOverrideRecord
@ kOverrideRecord
Definition: recordingtypes.h:28
kState_WatchingLiveTV
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:66
MythMainWindow::GetPaintWindow
QWidget * GetPaintWindow()
Definition: mythmainwindow.cpp:267
ChannelUtil::kChanOrderByName
@ kChanOrderByName
Definition: channelutil.h:209
MythGestureEvent::Right
@ Right
Definition: mythgesture.h:52
GuideGrid::m_channelInfos
db_chan_list_list_t m_channelInfos
Definition: guidegrid.h:243
GuideUpdateProgramRow::fillProgramRowInfosWith
void fillProgramRowInfosWith(int row, const QDateTime &start, ProgramList *proglist)
Definition: guidegrid.cpp:1658
ChannelGroupList
std::vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:31
GuideUpdateChannels
Definition: guidegrid.cpp:322
ChannelUtil::GetChannels
static ChannelInfoList GetChannels(uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0)
Definition: channelutil.h:251
GuideGrid::m_timeList
MythUIButtonList * m_timeList
Definition: guidegrid.h:288
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:23
GuideUpdateChannels::m_currentStartChannel
uint m_currentStartChannel
Definition: guidegrid.cpp:338
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
UpdateGuideEvent
Definition: guidegrid.cpp:343
MythGestureEvent::Up
@ Up
Definition: mythgesture.h:49
GuideStatus::m_currentCol
const int m_currentCol
Definition: guidegrid.cpp:219
GuideStatus::m_numRows
const unsigned int m_numRows
Definition: guidegrid.cpp:213
GuideGrid::kScrollRight
@ kScrollRight
Definition: guidegrid.h:189
JumpToChannel::JumpToChannel
JumpToChannel(JumpToChannelListener *parent, QString start_entry, int start_chan_idx, int cur_chan_idx, uint rows_disp)
Definition: guidegrid.cpp:65
kEightHours
static constexpr int64_t kEightHours
Definition: guidegrid.cpp:61
GuideGrid::kPageUp
@ kPageUp
Definition: guidegrid.h:190
GuideGrid::~GuideGrid
~GuideGrid() override
Definition: guidegrid.cpp:632
AutoDeleteDeque::end
iterator end(void)
Definition: autodeletedeque.h:51
ChannelGroup::NotInChannelGroupList
static bool NotInChannelGroupList(const ChannelGroupList &groupList, int grpid)
Definition: channelgroup.cpp:369
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:916
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:214
mythgesture.h
A C++ ripoff of the stroke library for MythTV.
RecStatus::Offline
@ Offline
Definition: recordingstatus.h:44
GuideUpdateProgramRow::m_firstTime
const QDateTime m_firstTime
Definition: guidegrid.cpp:313
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
GuideHelper::s_loading
static QHash< GuideGrid *, uint > s_loading
Definition: guidegrid.cpp:405
GridTimeNormal
static constexpr uint8_t GridTimeNormal
Definition: mythuiguidegrid.h:30
GuideHelper::m_updater
GuideUpdaterBase * m_updater
Definition: guidegrid.cpp:401
channelutil.h
ProgramInfo::m_spread
int8_t m_spread
Definition: programinfo.h:848
GuideGrid::m_player
TV * m_player
Definition: guidegrid.h:269
tvremoteutil.h
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
GridTimeEndsAfter
static constexpr uint8_t GridTimeEndsAfter
Definition: mythuiguidegrid.h:32
GuideGrid::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: guidegrid.cpp:669
ACTION_UP
static constexpr const char * ACTION_UP
Definition: mythuiactions.h:16
GuideGrid::m_channelOrdering
QString m_channelOrdering
Definition: guidegrid.h:275
MythDate::kSimplify
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
Definition: mythdate.h:26
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:910
GuideStatus::m_verticalLayout
const bool m_verticalLayout
Definition: guidegrid.cpp:221
AutoDeleteDeque< ProgramInfo * >
GuideGrid::moveLeftRight
void moveLeftRight(MoveVector movement)
Definition: guidegrid.cpp:2472
GuideGrid::m_changrpid
int m_changrpid
Definition: guidegrid.h:281
JumpToChannelListener::SetJumpToChannel
virtual void SetJumpToChannel(JumpToChannel *ptr)=0
ChannelGroup::ToggleChannel
static bool ToggleChannel(uint chanid, int changrpid, bool delete_chan)
Definition: channelgroup.cpp:19
channelinfo.h
GuideGrid::updateChannelsUI
void updateChannelsUI(const QVector< ChannelInfo * > &chinfos, const QVector< bool > &unavailables)
Definition: guidegrid.cpp:2162
ProgramList
AutoDeleteDeque< ProgramInfo * > ProgramList
Definition: programinfo.h:31
GuideUpdateProgramRow::m_channelCount
const int m_channelCount
Definition: guidegrid.cpp:310
GuideGrid::m_jumpToText
MythUIText * m_jumpToText
Definition: guidegrid.h:293
MythUIGuideGrid::getTimeCount
int getTimeCount(void) const
Definition: mythuiguidegrid.h:57
GuideUpdateChannels::GuideUpdateChannels
GuideUpdateChannels(GuideGrid *guide, uint startChan)
Definition: guidegrid.cpp:325
ProgramInfo::GetRecordingRuleType
RecordingType GetRecordingRuleType(void) const
Definition: programinfo.h:455
ChannelGroup::GetNextChannelGroup
static int GetNextChannelGroup(const ChannelGroupList &sorted, int grpid)
Definition: channelgroup.cpp:338
TV::ReturnPlayerLock
void ReturnPlayerLock() const
Definition: tv_play.cpp:10496
AutoDeleteDeque::push_back
void push_back(T info)
Definition: autodeletedeque.h:69
JumpToChannel::m_previousCurrentChannelIndex
int m_previousCurrentChannelIndex
Definition: guidegrid.h:71
JumpToChannel::ProcessEntry
bool ProcessEntry(const QStringList &actions, const QKeyEvent *e)
Definition: guidegrid.cpp:113
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:401
TV::VolumeChange
void VolumeChange(bool Up, int NewVolume=-1)
Definition: tv_play.cpp:7013
MythGestureEvent::LeftThenUp
@ LeftThenUp
Definition: mythgesture.h:65
GuideGrid::GetCurrentStartTime
QDateTime GetCurrentStartTime(void) const
Definition: guidegrid.h:132
GuideGrid::generateListings
void generateListings()
Definition: guidegrid.cpp:2274
GuideGrid::kPageDown
@ kPageDown
Definition: guidegrid.h:191
ACTION_RIGHT
static constexpr const char * ACTION_RIGHT
Definition: mythuiactions.h:19
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:272
GuideUpdateProgramRow::m_ggProgramRect
const MythRect m_ggProgramRect
Definition: guidegrid.cpp:303
mythcorecontext.h
MythRect::topLeft
MythPoint topLeft(void) const
Definition: mythrect.cpp:288
kOneDay
static constexpr int64_t kOneDay
Definition: guidegrid.cpp:62
GuideGrid::m_jumpToChannel
JumpToChannel * m_jumpToChannel
Definition: guidegrid.h:286
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:701
cardutil.h
TV::GetPlayerContext
PlayerContext * GetPlayerContext()
Return a pointer to TV::m_playerContext.
Definition: tv_play.cpp:193
MythUIGuideGrid::SetProgramInfo
void SetProgramInfo(int row, int col, QRect area, const QString &title, const QString &genre, int arrow, int recType, int recStat, bool selected)
Definition: mythuiguidegrid.cpp:683
ChannelGroup::GetChannelGroupId
static int GetChannelGroupId(const QString &changroupname)
Definition: channelgroup.cpp:396
GuideGrid::cursorLeft
void cursorLeft()
Definition: guidegrid.cpp:2392
GuideUpdateProgramRow::m_result
std::list< GuideUIElement > m_result
Definition: guidegrid.cpp:319
kFourMinutes
static constexpr int64_t kFourMinutes
Definition: guidegrid.cpp:58
GuideGrid::fillProgramRowInfos
void fillProgramRowInfos(int row, bool useExistingData)
Definition: guidegrid.cpp:1593
JumpToChannel::m_entry
QString m_entry
Definition: guidegrid.h:69
LoadFromProgram
bool LoadFromProgram(ProgramList &destination, const QString &where, const QString &groupBy, const QString &orderBy, const MSqlBindings &bindings, const ProgramList &schedList)
Definition: programinfo.cpp:5744
TV::UpdateChannelList
void UpdateChannelList(int GroupID)
update the channel list with channels from the selected channel group
Definition: tv_play.cpp:1334
TV::PlaybackExiting
void PlaybackExiting(TV *Player)
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
MAX_DISPLAY_CHANS
static constexpr int MAX_DISPLAY_CHANS
Definition: mythuiguidegrid.h:24
MythGestureEvent::RightThenLeft
@ RightThenLeft
Definition: mythgesture.h:69
GuideGrid::ChangeVolume
void ChangeVolume(bool Up, int NewVolume=-1)
TVPlaybackState::ChangeMuteState
void ChangeMuteState(bool CycleChannels=false)
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
epgIsVisibleCond
QWaitCondition epgIsVisibleCond
Definition: guidegrid.cpp:49
GuideUpdateProgramRow::m_currentRow
const int m_currentRow
Definition: guidegrid.cpp:308
ACTION_DAYRIGHT
#define ACTION_DAYRIGHT
Definition: tv_actions.h:10
kFiveMinutes
static constexpr int64_t kFiveMinutes
Definition: guidegrid.cpp:59
MythScreenStack::PopScreen
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
Definition: mythscreenstack.cpp:86
ChannelUtil::kChanGroupByChanid
@ kChanGroupByChanid
Definition: channelutil.h:217
ScheduleCommon::ShowUpcoming
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
Definition: schedulecommon.cpp:69
UpdateGuideEvent::m_updater
GuideUpdaterBase * m_updater
Definition: guidegrid.cpp:348
GuideGrid::toggleGuideListing
void toggleGuideListing()
Definition: guidegrid.cpp:2256
DialogCompletionEvent::kEventType
static const Type kEventType
Definition: mythdialogbox.h:57
ScheduleCommon::QuickRecord
virtual void QuickRecord(void)
Create a kSingleRecord or bring up recording dialog.
Definition: schedulecommon.cpp:149
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:116
ACTION_DAYLEFT
#define ACTION_DAYLEFT
Definition: tv_actions.h:9
JumpToChannel::m_previousStartChannelIndex
int m_previousStartChannelIndex
Definition: guidegrid.h:70
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
GuideGrid::GetSelection
ChannelInfoList GetSelection(void) const
Definition: guidegrid.cpp:1309
PlayerContext
Definition: playercontext.h:49
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1581
GuideUpdateProgramRow::m_proglists
QVector< ProgramList * > m_proglists
Definition: guidegrid.cpp:316
GuideGrid::m_dateText
MythUIText * m_dateText
Definition: guidegrid.h:291
ACTION_PAGELEFT
#define ACTION_PAGELEFT
Definition: tv_actions.h:11
build_compdb.action
action
Definition: build_compdb.py:9
kAllRecord
@ kAllRecord
Definition: recordingtypes.h:25
ChannelUtil::kChanOrderByChanNum
@ kChanOrderByChanNum
Definition: channelutil.h:208
ACTION_GUIDE
#define ACTION_GUIDE
Definition: tv_actions.h:26
GuideGrid::updateDateText
void updateDateText(void)
Definition: guidegrid.cpp:2061
GuideGrid::ChannelGroupMenu
void ChannelGroupMenu(int mode=0)
Definition: guidegrid.cpp:2291
GuideGrid::HideTVWindow
static void HideTVWindow(void)
Definition: guidegrid.cpp:2672
MythScreenType::gestureEvent
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: mythscreentype.cpp:455
GuideGrid::m_channelInfoIdx
QMap< uint, uint > m_channelInfoIdx
Definition: guidegrid.h:244
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
GuideUpdateProgramRow::m_currentStartChannel
const uint m_currentStartChannel
Definition: guidegrid.cpp:307
mythuiactions.h
ScheduleCommon::ShowChannelSearch
virtual void ShowChannelSearch(void) const
Show the channel search.
Definition: schedulecommon.cpp:115
MythScreenType::aboutToHide
virtual void aboutToHide(void)
Definition: mythscreentype.cpp:219
MThreadPool::setMaxThreadCount
void setMaxThreadCount(int maxThreadCount)
Definition: mthreadpool.cpp:518
MythGestureEvent
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
ACTION_TOGGLEFAV
#define ACTION_TOGGLEFAV
Definition: tv_actions.h:20
CopyProglist
static ProgramList * CopyProglist(ProgramList *proglist)
Definition: guidegrid.cpp:1236
GuideStatus::m_lastTime
const QDateTime m_lastTime
Definition: guidegrid.cpp:222
UpdateGuideEvent::kEventType
static const Type kEventType
Definition: guidegrid.cpp:349
GuideUpdaterBase
Definition: guidegrid.cpp:225
Player
Definition: zmliveplayer.h:34
GuideHelper::m_guide
GuideGrid * m_guide
Definition: guidegrid.cpp:400
GuideGrid::m_lastTime
QDateTime m_lastTime
Definition: guidegrid.h:267
TV::GetPlayerReadLock
void GetPlayerReadLock() const
Definition: tv_play.cpp:10491
GuideStatus::GuideStatus
GuideStatus(unsigned int firstRow, unsigned int numRows, QVector< int > channums, const MythRect &gg_programRect, int gg_channelCount, QDateTime currentStartTime, QDateTime currentEndTime, uint currentStartChannel, int currentRow, int currentCol, int channelCount, int timeCount, bool verticalLayout, QDateTime firstTime, QDateTime lastTime)
Definition: guidegrid.cpp:193
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:885
GuideStatus::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:213
MythCoreContext::GetMasterHostPrefix
QString GetMasterHostPrefix(const QString &storageGroup=QString(), const QString &path=QString())
Definition: mythcorecontext.cpp:802
ACTION_VOLUMEDOWN
#define ACTION_VOLUMEDOWN
Definition: tv_actions.h:111
MythDate::kTime
@ kTime
Default local time.
Definition: mythdate.h:22
JumpToChannel::m_listener
JumpToChannelListener * m_listener
Definition: guidegrid.h:68
GuideGrid::m_programInfos
ProgInfoGuideArray m_programInfos
Definition: guidegrid.h:247
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:453
ChannelUtil::GetNearestChannel
static int GetNearestChannel(const ChannelInfoList &list, const QString &channum)
Definition: channelutil.cpp:2370
MythScreenType::aboutToShow
virtual void aboutToShow(void)
Definition: mythscreentype.cpp:235
GuideUpdateProgramRow
Definition: guidegrid.cpp:243
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:677
GuideHelper::IsLoading
static bool IsLoading(GuideGrid *guide)
Definition: guidegrid.cpp:385
GuideGrid::updateTimeout
void updateTimeout(void)
Definition: guidegrid.cpp:1386
recordingrule.h
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
MythGestureEvent::RightThenUp
@ RightThenUp
Definition: mythgesture.h:67
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:113
GuideGrid::moveToTime
void moveToTime(const QDateTime &datetime)
Definition: guidegrid.cpp:2527
mythmainwindow.h
ACTION_MUTEAUDIO
#define ACTION_MUTEAUDIO
Definition: tv_actions.h:106
MythTimeInputDialog
Definition: mythdialogbox.h:458
GuideHelper::Wait
static void Wait(GuideGrid *guide)
Definition: guidegrid.cpp:390
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
MythTimeInputDialog::kAllDates
@ kAllDates
Definition: mythdialogbox.h:479
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:313
GuideGrid::GetProgramList
ProgramList GetProgramList(uint chanid) const
Definition: guidegrid.cpp:1214
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:566
GuideGrid::fillProgramInfos
void fillProgramInfos(bool useExistingData=false)
Definition: guidegrid.cpp:1564
GuideGrid::getProgramListFromProgram
ProgramList * getProgramListFromProgram(int chanNum)
Definition: guidegrid.cpp:1569
GuideGrid::kScrollUp
@ kScrollUp
Definition: guidegrid.h:186
MythObservable::removeListener
void removeListener(QObject *listener)
Remove a listener to the observable.
Definition: mythobservable.cpp:55
JumpToChannel::GetEntry
QString GetEntry(void) const
Definition: guidegrid.h:58
GuideGrid::GetChannelInfo
ChannelInfo * GetChannelInfo(uint chan_idx, int sel=-1)
Definition: guidegrid.cpp:1181
GuideGrid::m_currentRow
int m_currentRow
Definition: guidegrid.h:257
GuideGrid::FindChannel
int FindChannel(uint chanid, const QString &channum, bool exact=true) const override
Definition: guidegrid.cpp:1470
CardUtil::GetStartChannel
static QString GetStartChannel(uint inputid)
Definition: cardutil.cpp:1790
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
GuideGrid::kPageLeft
@ kPageLeft
Definition: guidegrid.h:192
ChannelInfo::m_callSign
QString m_callSign
Definition: channelinfo.h:91
ChannelInfo::kChannelShort
@ kChannelShort
Definition: channelinfo.h:49
MThreadPool::start
void start(QRunnable *runnable, const QString &debugName, int priority=0)
Definition: mthreadpool.cpp:342
GuideStatus::m_currentStartTime
const QDateTime m_currentStartTime
Definition: guidegrid.cpp:217
mythscreentype.h
AutoDeleteDeque::size
size_t size(void) const
Definition: autodeletedeque.h:67
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
GuideGrid::updateInfo
void updateInfo(void)
Definition: guidegrid.cpp:2200
uint
unsigned int uint
Definition: freesurround.h:24
MythTimeInputDialog::kDay
@ kDay
Definition: mythdialogbox.h:469
MKKEY
static constexpr uint64_t MKKEY(uint64_t IDX, uint64_t SEL)
Definition: guidegrid.cpp:1306
tv_play.h
GuideHelper::run
void run(void) override
Definition: guidegrid.cpp:363
GuideGrid::updateJumpToChannel
void updateJumpToChannel(void)
Definition: guidegrid.cpp:2642
TV
Control TV playback.
Definition: tv_play.h:154
ChannelInfoList
std::vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:131
GuideGrid::GoTo
void GoTo(int start, int cur_row) override
Definition: guidegrid.cpp:2633
ProgramInfo::GetStars
float GetStars(void) const
Definition: programinfo.h:446
GuideGrid::SetJumpToChannel
void SetJumpToChannel(JumpToChannel *ptr) override
Definition: guidegrid.cpp:2658
GuideGrid::m_changrplist
ChannelGroupList m_changrplist
Definition: guidegrid.h:282