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 "libmyth/programinfo.h"
13 #include "libmyth/remoteutil.h"
14 #include "libmythbase/autodeletedeque.h" // for AutoDeleteDeque, etc
16 #include "libmythbase/mythdate.h"
17 #include "libmythbase/mythdbcon.h"
18 #include "libmythbase/mythevent.h" // for MythEvent, etc
20 #include "libmythbase/mythtypes.h" // for InfoMap
21 #include "libmythbase/programtypes.h" // for RecStatus, etc
22 #include "libmythbase/recordingtypes.h" // for toString, etc
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 Type kEventType;
350 };
351 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 
590  int maxchannel = std::max((int)GetChannelCount() - 1, 0);
592  m_channelCount = std::min(m_channelCount, maxchannel + 1);
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  if (chanNum < 0)
603  chanNum = 0;
604 
605  delete m_programs[y];
607  }
608 }
609 
610 void GuideGrid::Init(void)
611 {
613  m_currentCol = 0;
614 
615  fillTimeInfos();
616 
617  updateChannels();
618 
619  fillProgramInfos(true);
620 
621  m_updateTimer->start(kUpdateMS);
622 
623  updateDateText();
624 
625  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
626 
627  if (m_changroupname)
628  m_changroupname->SetText(changrpname);
629 
630  gCoreContext->addListener(this);
631 }
632 
634 {
635  m_updateTimer->disconnect(this);
636  m_updateTimer = nullptr;
637 
638  GuideHelper::Wait(this);
639 
641 
642  while (!m_programs.empty())
643  {
644  if (m_programs.back())
645  delete m_programs.back();
646  m_programs.pop_back();
647  }
648 
649  m_channelInfos.clear();
650 
651  gCoreContext->SaveSetting("EPGSortReverse", m_sortReverse ? "1" : "0");
652 
653  if (m_player)
654  {
655  // if we have a player and we are returning to it we need
656  // to tell it to stop embedding and return to fullscreen
657  if (m_allowFinder)
658  emit m_player->RequestEmbedding(false);
659 
660  // maybe the user selected a different channel group,
661  // tell the player to update its channel list just in case
663  m_player->DecrRef();
664  }
665 
666  if (gCoreContext->GetBoolSetting("ChannelGroupRememberLast", false))
667  gCoreContext->SaveSetting("ChannelGroupDefault", m_changrpid);
668 }
669 
670 bool GuideGrid::keyPressEvent(QKeyEvent *event)
671 {
672  QStringList actions;
673  bool handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", event, actions);
674 
675  if (handled)
676  return true;
677 
678  if (!actions.empty())
679  {
680  QMutexLocker locker(&m_jumpToChannelLock);
681 
682  if (!m_jumpToChannel)
683  {
684  QString chanNum = actions[0];
685  bool isNum = false;
686  (void)chanNum.toInt(&isNum);
687  if (isNum)
688  {
689  // see if we can find a matching channel before creating the JumpToChannel otherwise
690  // JumpToChannel will delete itself in the ctor leading to a segfault
691  int i = FindChannel(0, chanNum, false);
692  if (i >= 0)
693  {
694  m_jumpToChannel = new JumpToChannel(this, chanNum,
698  }
699 
700  handled = true;
701  }
702  }
703 
704  if (m_jumpToChannel && !handled)
705  handled = m_jumpToChannel->ProcessEntry(actions, event);
706  }
707 
708  for (int i = 0; i < actions.size() && !handled; ++i)
709  {
710  QString action = actions[i];
711  handled = true;
712  if (action == ACTION_UP)
713  {
714  if (m_verticalLayout)
715  cursorLeft();
716  else
717  cursorUp();
718  }
719  else if (action == ACTION_DOWN)
720  {
721  if (m_verticalLayout)
722  cursorRight();
723  else
724  cursorDown();
725  }
726  else if (action == ACTION_LEFT)
727  {
728  if (m_verticalLayout)
729  cursorUp();
730  else
731  cursorLeft();
732  }
733  else if (action == ACTION_RIGHT)
734  {
735  if (m_verticalLayout)
736  cursorDown();
737  else
738  cursorRight();
739  }
740  else if (action == "PAGEUP")
741  {
742  if (m_verticalLayout)
744  else
746  }
747  else if (action == "PAGEDOWN")
748  {
749  if (m_verticalLayout)
751  else
753  }
754  else if (action == ACTION_PAGELEFT)
755  {
756  if (m_verticalLayout)
758  else
760  }
761  else if (action == ACTION_PAGERIGHT)
762  {
763  if (m_verticalLayout)
765  else
767  }
768  else if (action == ACTION_DAYLEFT)
770  else if (action == ACTION_DAYRIGHT)
772  else if (action == "NEXTFAV")
774  else if (action == ACTION_FINDER)
775  showProgFinder();
776  else if (action == ACTION_CHANNELSEARCH)
778  else if (action == "MENU")
779  ShowMenu();
780  else if (action == "ESCAPE" || action == ACTION_GUIDE)
781  Close();
782  else if (action == ACTION_SELECT)
783  {
784  ProgramInfo *pginfo =
786  auto secsTillStart = (pginfo)
789  {
790  // See if this show is far enough into the future that it's
791  // probable that the user wanted to schedule it to record
792  // instead of changing the channel.
793  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
794  (secsTillStart >= m_selectRecThreshold))
795  {
796  EditRecording();
797  }
798  else
799  {
800  enter();
801  }
802  }
803  else
804  {
805  // Edit Recording should include "Watch this channel"
806  // is we selected a show that is current.
809  && (secsTillStart < m_selectRecThreshold));
810  }
811  }
812  else if (action == "EDIT")
813  EditScheduled();
814  else if (action == "CUSTOMEDIT")
815  EditCustom();
816  else if (action == "DELETE")
817  deleteRule();
818  else if (action == "UPCOMING")
819  ShowUpcoming();
820  else if (action == "PREVRECORDED")
821  ShowPrevious();
822  else if (action == "DETAILS" || action == "INFO")
823  ShowDetails();
824  else if (action == ACTION_TOGGLERECORD)
825  QuickRecord();
826  else if (action == ACTION_TOGGLEFAV)
827  {
828  if (m_changrpid == -1)
829  ChannelGroupMenu(0);
830  else
832  }
833  else if (action == "CHANUPDATE")
834  channelUpdate();
835  else if (action == ACTION_VOLUMEUP)
836  emit ChangeVolume(true);
837  else if (action == ACTION_VOLUMEDOWN)
838  emit ChangeVolume(false);
839  else if (action == "CYCLEAUDIOCHAN")
840  emit ToggleMute(true);
841  else if (action == ACTION_MUTEAUDIO)
842  emit ToggleMute(false);
843  else if (action == ACTION_TOGGLEPGORDER)
844  {
847  updateChannels();
848  }
849  else
850  handled = false;
851  }
852 
853  if (!handled && MythScreenType::keyPressEvent(event))
854  handled = true;
855 
856  return handled;
857 }
858 
860 {
861  bool handled = true;
862 
863  if (!event)
864  {
865  LOG(VB_GENERAL, LOG_INFO, LOC + "Guide Gesture no event");
866  return false;
867  }
868 
869  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture event %1")
870  .arg(QString::number(event->GetGesture())));
871  switch (event->GetGesture())
872  {
874  {
875  handled = false;
876 
877  // We want the relative position of the click
878  QPoint position = event->GetPosition();
879  if (m_parent)
880  position -= m_parent->GetArea().topLeft();
881 
882  MythUIType *type = GetChildAt(position, false, false);
883 
884  if (!type)
885  return false;
886 
887  auto *object = dynamic_cast<MythUIStateType *>(type);
888 
889  if (object)
890  {
891  QString name = object->objectName();
892  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click name %1").arg(name));
893 
894  if (name.startsWith("channellist"))
895  {
896  auto* channelList = qobject_cast<MythUIButtonList*>(object);
897 
898  if (channelList)
899  {
900  handled = channelList->gestureEvent(event);
901  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click channel list %1").arg(handled));
902  }
903  }
904  else if (name.startsWith("guidegrid"))
905  {
906  auto* guidegrid = qobject_cast<MythUIGuideGrid*>(object);
907 
908  if (guidegrid)
909  {
910  handled = true;
911 
912  QPoint rowCol = guidegrid->GetRowAndColumn(position - guidegrid->GetArea().topLeft());
913 
914  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg %1,%2 (%3,%4)")
915  .arg(rowCol.y())
916  .arg(rowCol.x())
917  .arg(m_currentRow)
918  .arg(m_currentCol)
919  );
920  if ((rowCol.y() >= 0) && (rowCol.x() >= 0))
921  {
922  if ((rowCol.y() == m_currentRow) && (rowCol.x() == m_currentCol))
923  {
925  {
926  // See if this show is far enough into the future that it's
927  // probable that the user wanted to schedule it to record
928  // instead of changing the channel.
929  ProgramInfo *pginfo =
931  auto secsTillStart = (pginfo)
933  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
934  (secsTillStart >= m_selectRecThreshold))
935  {
936  //EditRecording();
937  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg EditRec"));
938  }
939  else
940  {
941  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg enter"));
942  enter();
943  }
944  }
945  else
946  {
947  //EditRecording();
948  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg not live"));
949  }
950  }
951  else
952  {
953  bool rowChanged = (rowCol.y() != m_currentRow);
954  bool colChanged = (rowCol.x() != m_currentCol);
955  if (rowChanged)
957 
958  m_currentRow = rowCol.y();
959  m_currentCol = rowCol.x();
960 
962  if (colChanged)
963  {
964  m_currentStartTime = m_programInfos[m_currentRow][m_currentCol]->GetScheduledStartTime();
965  fillTimeInfos();
966  }
967  if (rowChanged)
968  updateChannels();
969  if (colChanged)
970  updateDateText();
971  }
972  }
973  }
974  }
975 
976  }
977  }
978  break;
979 
981  if (m_verticalLayout)
982  cursorLeft();
983  else
984  cursorUp();
985  break;
986 
988  if (m_verticalLayout)
989  cursorRight();
990  else
991  cursorDown();
992  break;
993 
995  if (m_verticalLayout)
996  cursorUp();
997  else
998  cursorLeft();
999  break;
1000 
1002  if (m_verticalLayout)
1003  cursorDown();
1004  else
1005  cursorRight();
1006  break;
1007 
1009  if (m_verticalLayout)
1011  else
1013  break;
1014 
1016  if (m_verticalLayout)
1018  else
1020  break;
1021 
1023  if (m_verticalLayout)
1025  else
1027  break;
1028 
1030  if (m_verticalLayout)
1032  else
1034  break;
1035 
1038  break;
1039 
1042  break;
1043 
1045  enter();
1046  break;
1047 
1048  default:
1049  handled = false;
1050  break;
1051  }
1052 
1053  if (!handled && MythScreenType::gestureEvent(event))
1054  handled = true;
1055 
1056  return handled;
1057 }
1058 
1059 static bool SelectionIsTunable(const ChannelInfoList &selection)
1060 {
1061  return std::any_of(selection.cbegin(), selection.cend(),
1062  [selection](const auto & chan){ return TV::IsTunable(chan.m_chanId); } );
1063 }
1064 
1066 {
1067  QString label = tr("Guide Options");
1068 
1069  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1070  auto *menuPopup = new MythDialogBox(label, popupStack, "guideMenuPopup");
1071 
1072  if (menuPopup->Create())
1073  {
1074  menuPopup->SetReturnEvent(this, "guidemenu");
1075 
1077  menuPopup->AddButton(tr("Change to Channel"));
1078  else if (!m_player && SelectionIsTunable(GetSelection()))
1079  menuPopup->AddButton(tr("Watch This Channel"));
1080 
1081  menuPopup->AddButton(tr("Record This"));
1082 
1083  menuPopup->AddButton(tr("Recording Options"), nullptr, true);
1084 
1085  menuPopup->AddButton(tr("Program Details"));
1086 
1087  menuPopup->AddButton(tr("Jump to Time"), nullptr, true);
1088 
1089  menuPopup->AddButton(tr("Reverse Channel Order"));
1090 
1091  menuPopup->AddButton(tr("Channel Search"));
1092 
1093  if (!m_changrplist.empty())
1094  {
1095  menuPopup->AddButton(tr("Choose Channel Group"));
1096 
1098  menuPopup->AddButton(tr("Add To Channel Group"), nullptr, true);
1099  else
1100  menuPopup->AddButton(tr("Remove from Channel Group"));
1101  }
1102 
1103  popupStack->AddScreen(menuPopup);
1104  }
1105  else
1106  {
1107  delete menuPopup;
1108  }
1109 }
1110 
1112 {
1113  QString label = tr("Recording Options");
1114 
1115  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1116  auto *menuPopup = new MythDialogBox(label, popupStack, "recMenuPopup");
1117 
1118  if (menuPopup->Create())
1119  {
1120  menuPopup->SetReturnEvent(this, "recmenu");
1121 
1123 
1124  if (pginfo && pginfo->GetRecordingRuleID())
1125  menuPopup->AddButton(tr("Edit Recording Status"));
1126  menuPopup->AddButton(tr("Edit Schedule"));
1127  menuPopup->AddButton(tr("Show Upcoming"));
1128  menuPopup->AddButton(tr("Previously Recorded"));
1129  menuPopup->AddButton(tr("Custom Edit"));
1130 
1131  if (pginfo && pginfo->GetRecordingRuleID())
1132  menuPopup->AddButton(tr("Delete Rule"));
1133 
1134  popupStack->AddScreen(menuPopup);
1135  }
1136  else
1137  {
1138  delete menuPopup;
1139  }
1140 }
1141 
1143 {
1144  sel = (sel >= 0) ? sel : m_channelInfoIdx[chan_idx];
1145 
1146  if (chan_idx >= GetChannelCount())
1147  return nullptr;
1148 
1149  if (sel >= (int) m_channelInfos[chan_idx].size())
1150  return nullptr;
1151 
1152  return &(m_channelInfos[chan_idx][sel]);
1153 }
1154 
1155 const ChannelInfo *GuideGrid::GetChannelInfo(uint chan_idx, int sel) const
1156 {
1157  return ((GuideGrid*)this)->GetChannelInfo(chan_idx, sel);
1158 }
1159 
1161 {
1162  return m_channelInfos.size();
1163 }
1164 
1166 {
1167  uint cnt = GetChannelCount();
1168  if (!cnt)
1169  return -1;
1170 
1171  row = (row < 0) ? m_currentRow : row;
1172  return (row + m_currentStartChannel) % cnt;
1173 }
1174 
1176 {
1177  ProgramList proglist;
1178  MSqlBindings bindings;
1179  QString querystr =
1180  "WHERE program.chanid = :CHANID AND "
1181  " program.endtime >= :STARTTS AND "
1182  " program.starttime <= :ENDTS AND "
1183  " program.starttime >= :STARTLIMITTS AND "
1184  " program.manualid = 0 ";
1185  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1186  bindings[":STARTTS"] = starttime;
1187  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1188  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1189  bindings[":CHANID"] = chanid;
1190 
1191  ProgramList dummy;
1192  LoadFromProgram(proglist, querystr, bindings, dummy);
1193 
1194  return proglist;
1195 }
1196 
1198 {
1199  if (!proglist)
1200  return nullptr;
1201  auto *result = new ProgramList();
1202  // AutoDeleteDeque doesn't work with std::back_inserter
1203  for (auto & pi : *proglist)
1204  result->push_back(new ProgramInfo(*pi)); // cppcheck-suppress useStlAlgorithm
1205  return result;
1206 }
1207 
1209  uint chan_idx, bool with_same_channum) const
1210 {
1211  uint si = m_channelInfoIdx[chan_idx];
1212  const ChannelInfo *chinfo = GetChannelInfo(chan_idx, si);
1213 
1216 
1217  const uint cnt = (ctx && chinfo) ? m_channelInfos[chan_idx].size() : 0;
1218  for (uint i = 0; i < cnt; ++i)
1219  {
1220  if (i == si)
1221  continue;
1222 
1223  const ChannelInfo *ciinfo = GetChannelInfo(chan_idx, i);
1224  if (!ciinfo)
1225  continue;
1226 
1227  bool same_channum = ciinfo->m_chanNum == chinfo->m_chanNum;
1228 
1229  if (with_same_channum != same_channum)
1230  continue;
1231 
1232  if (!TV::IsTunable(ciinfo->m_chanId))
1233  continue;
1234 
1235  if (with_same_channum)
1236  {
1237  si = i;
1238  break;
1239  }
1240 
1241  ProgramList proglist = GetProgramList(chinfo->m_chanId);
1242  ProgramList ch_proglist = GetProgramList(ciinfo->m_chanId);
1243 
1244  if (proglist.empty() ||
1245  proglist.size() != ch_proglist.size())
1246  continue;
1247 
1248  bool isAlt = true;
1249  for (size_t j = 0; j < proglist.size(); ++j)
1250  {
1251  isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1252  }
1253 
1254  if (isAlt)
1255  {
1256  si = i;
1257  break;
1258  }
1259  }
1260 
1262 
1263  return si;
1264 }
1265 
1266 
1267 static constexpr uint64_t MKKEY(uint64_t IDX, uint64_t SEL)
1268  { return (IDX << 32) | SEL; }
1269 
1271 {
1272  ChannelInfoList selected;
1273 
1274  int idx = GetStartChannelOffset();
1275  if (idx < 0)
1276  return selected;
1277 
1278  uint si = m_channelInfoIdx[idx];
1279 
1280  std::vector<uint64_t> sel;
1281  sel.push_back( MKKEY(idx, si) );
1282 
1283  const ChannelInfo *ch = GetChannelInfo(sel[0]>>32, sel[0]&0xffff);
1284  if (!ch)
1285  return selected;
1286 
1287  selected.push_back(*ch);
1288  if (m_channelInfos[idx].size() <= 1)
1289  return selected;
1290 
1291  ProgramList proglist = GetProgramList(selected[0].m_chanId);
1292 
1293  if (proglist.empty())
1294  return selected;
1295 
1296  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1297  {
1298  const ChannelInfo *ci = GetChannelInfo(idx, i);
1299  if (ci && (i != si) &&
1300  (ci->m_callSign == ch->m_callSign) && (ci->m_chanNum == ch->m_chanNum))
1301  {
1302  sel.push_back( MKKEY(idx, i) );
1303  }
1304  }
1305 
1306  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1307  {
1308  const ChannelInfo *ci = GetChannelInfo(idx, i);
1309  if (ci && (i != si) &&
1310  (ci->m_callSign == ch->m_callSign) && (ci->m_chanNum != ch->m_chanNum))
1311  {
1312  sel.push_back( MKKEY(idx, i) );
1313  }
1314  }
1315 
1316  for (size_t i = 0; i < m_channelInfos[idx].size(); ++i)
1317  {
1318  const ChannelInfo *ci = GetChannelInfo(idx, i);
1319  if ((i != si) && (ci->m_callSign != ch->m_callSign))
1320  {
1321  sel.push_back( MKKEY(idx, i) );
1322  }
1323  }
1324 
1325  for (size_t i = 1; i < sel.size(); ++i)
1326  {
1327  const ChannelInfo *ci = GetChannelInfo(sel[i]>>32, sel[i]&0xffff);
1328  const ProgramList ch_proglist = GetProgramList(ch->m_chanId);
1329 
1330  if (!ci || proglist.size() != ch_proglist.size())
1331  continue;
1332 
1333  bool isAlt = true;
1334  for (size_t j = 0; j < proglist.size(); ++j)
1335  {
1336  isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1337  }
1338 
1339  if (isAlt)
1340  selected.push_back(*ci);
1341  }
1342 
1343  return selected;
1344 }
1345 #undef MKKEY
1346 
1348 {
1349  m_updateTimer->stop();
1350  fillProgramInfos();
1351  m_updateTimer->start(kUpdateMS);
1352 }
1353 
1354 void GuideGrid::fillChannelInfos(bool gotostartchannel)
1355 {
1356  m_channelInfos.clear();
1357  m_channelInfoIdx.clear();
1359 
1360  uint avail = 0;
1361  const ChannelUtil::OrderBy ordering = m_channelOrdering == "channum" ?
1363  ChannelInfoList channels = ChannelUtil::LoadChannels(0, 0, avail, true,
1364  ordering,
1366  0,
1367  (m_changrpid < 0) ? 0 : m_changrpid);
1368 
1369  using uint_list_t = std::vector<unsigned int>;
1370  QMap<QString,uint_list_t> channum_to_index_map;
1371  QMap<QString,uint_list_t> callsign_to_index_map;
1372 
1373  for (size_t i = 0; i < channels.size(); ++i)
1374  {
1375  uint chan = i;
1376  if (m_sortReverse)
1377  {
1378  chan = channels.size() - i - 1;
1379  }
1380 
1381  bool ndup = !channum_to_index_map[channels[chan].m_chanNum].empty();
1382  bool cdup = !callsign_to_index_map[channels[chan].m_callSign].empty();
1383 
1384  if (ndup && cdup)
1385  continue;
1386 
1387  ChannelInfo val(channels[chan]);
1388 
1389  channum_to_index_map[val.m_chanNum].push_back(GetChannelCount());
1390  callsign_to_index_map[val.m_callSign].push_back(GetChannelCount());
1391 
1392  // add the new channel to the list
1394  tmp.push_back(val);
1395  m_channelInfos.push_back(tmp);
1396  }
1397 
1398  // handle duplicates
1399  for (auto & channel : channels)
1400  {
1401  const uint_list_t &ndups = channum_to_index_map[channel.m_chanNum];
1402  for (unsigned int ndup : ndups)
1403  {
1404  if (channel.m_chanId != m_channelInfos[ndup][0].m_chanId &&
1405  channel.m_callSign == m_channelInfos[ndup][0].m_callSign)
1406  m_channelInfos[ndup].push_back(channel);
1407  }
1408 
1409  const uint_list_t &cdups = callsign_to_index_map[channel.m_callSign];
1410  for (unsigned int cdup : cdups)
1411  {
1412  if (channel.m_chanId != m_channelInfos[cdup][0].m_chanId)
1413  m_channelInfos[cdup].push_back(channel);
1414  }
1415  }
1416 
1417  if (gotostartchannel)
1418  {
1419  int ch = FindChannel(m_startChanID, m_startChanNum, false);
1420  m_currentStartChannel = (uint) std::max(0, ch);
1421  }
1422 
1423  if (m_channelInfos.empty())
1424  {
1425  LOG(VB_GENERAL, LOG_ERR, "GuideGrid: "
1426  "\n\t\t\tYou don't have any channels defined in the database."
1427  "\n\t\t\tGuide grid will have nothing to show you.");
1428  }
1429 }
1430 
1431 int GuideGrid::FindChannel(uint chanid, const QString &channum,
1432  bool exact) const
1433 {
1434  // first check chanid
1435  uint i = (chanid) ? 0 : GetChannelCount();
1436  for (; i < GetChannelCount(); ++i)
1437  {
1438  if (m_channelInfos[i][0].m_chanId == chanid)
1439  return i;
1440  }
1441 
1442  // then check for chanid in duplicates
1443  i = (chanid) ? 0 : GetChannelCount();
1444  for (; i < GetChannelCount(); ++i)
1445  {
1446  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1447  {
1448  if (m_channelInfos[i][j].m_chanId == chanid)
1449  return i;
1450  }
1451  }
1452 
1453  // then check channum, first only
1454  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1455  for (; i < GetChannelCount(); ++i)
1456  {
1457  if (m_channelInfos[i][0].m_chanNum == channum)
1458  return i;
1459  }
1460 
1461  // then check channum duplicates
1462  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1463  for (; i < GetChannelCount(); ++i)
1464  {
1465  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1466  {
1467  if (m_channelInfos[i][j].m_chanNum == channum)
1468  return i;
1469  }
1470  }
1471 
1472  if (exact || channum.isEmpty())
1473  return -1;
1474 
1475  ChannelInfoList list;
1476  QVector<int> idxList;
1477  for (i = 0; i < GetChannelCount(); ++i)
1478  {
1479  for (size_t j = 0; j < m_channelInfos[i].size(); ++j)
1480  {
1481  list.push_back(m_channelInfos[i][j]);
1482  idxList.push_back(i);
1483  }
1484  }
1485  int result = ChannelUtil::GetNearestChannel(list, channum);
1486  if (result >= 0)
1487  result = idxList[result];
1488  return result;
1489 }
1490 
1492 {
1493  m_timeList->Reset();
1494 
1495  QDateTime starttime = m_currentStartTime;
1496 
1499 
1500  for (int x = 0; x < m_timeCount; ++x)
1501  {
1502  int mins = starttime.time().minute();
1503  mins = 5 * (mins / 5);
1504  if (mins % 30 == 0)
1505  {
1506  QString timeStr = MythDate::toString(starttime, MythDate::kTime);
1507 
1508  InfoMap infomap;
1509  infomap["starttime"] = timeStr;
1510 
1511  QDateTime endtime = starttime.addSecs(kThirtyMinutes);
1512 
1513  infomap["endtime"] = MythDate::toString(endtime, MythDate::kTime);
1514 
1515  auto *item = new MythUIButtonListItem(m_timeList, timeStr);
1516 
1517  item->SetTextFromMap(infomap);
1518  }
1519 
1520  starttime = starttime.addSecs(kFiveMinutes);
1521  }
1522  m_currentEndTime = starttime;
1523 }
1524 
1525 void GuideGrid::fillProgramInfos(bool useExistingData)
1526 {
1527  fillProgramRowInfos(-1, useExistingData);
1528 }
1529 
1531 {
1532  auto *proglist = new ProgramList();
1533 
1534  if (proglist)
1535  {
1536  MSqlBindings bindings;
1537  QString querystr = "WHERE program.chanid = :CHANID "
1538  " AND program.endtime >= :STARTTS "
1539  " AND program.starttime <= :ENDTS "
1540  " AND program.starttime >= :STARTLIMITTS "
1541  " AND program.manualid = 0 ";
1542  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1543  bindings[":CHANID"] = GetChannelInfo(chanNum)->m_chanId;
1544  bindings[":STARTTS"] = starttime;
1545  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1546  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1547 
1548  LoadFromProgram(*proglist, querystr, bindings, m_recList);
1549  }
1550 
1551  return proglist;
1552 }
1553 
1554 void GuideGrid::fillProgramRowInfos(int firstRow, bool useExistingData)
1555 {
1556  bool allRows = false;
1557  unsigned int numRows = 1;
1558  if (firstRow < 0)
1559  {
1560  firstRow = 0;
1561  allRows = true;
1562  numRows = std::min((unsigned int)m_channelInfos.size(),
1563  (unsigned int)m_guideGrid->getChannelCount());
1564  }
1565  QVector<int> chanNums;
1566  QVector<ProgramList*> proglists;
1567 
1568  for (unsigned int i = 0; i < numRows; ++i)
1569  {
1570  unsigned int row = i + firstRow;
1571  // never divide by zero..
1573  return;
1574 
1575  for (int x = 0; x < m_timeCount; ++x)
1576  {
1577  m_programInfos[row][x] = nullptr;
1578  }
1579 
1580  if (m_channelInfos.empty())
1581  return;
1582 
1583  int chanNum = row + m_currentStartChannel;
1584  if (chanNum >= (int) m_channelInfos.size())
1585  chanNum -= (int) m_channelInfos.size();
1586  if (chanNum >= (int) m_channelInfos.size())
1587  return;
1588 
1589  if (chanNum < 0)
1590  chanNum = 0;
1591 
1592  ProgramList *proglist = nullptr;
1593  if (useExistingData)
1594  proglist = CopyProglist(m_programs[row]);
1595  chanNums.push_back(chanNum);
1596  proglists.push_back(proglist);
1597  }
1598  if (allRows)
1599  {
1600  for (unsigned int i = numRows;
1601  i < (unsigned int) m_guideGrid->getChannelCount(); ++i)
1602  {
1603  delete m_programs[i];
1604  m_programs[i] = nullptr;
1605  m_guideGrid->ResetRow(i);
1606  }
1607  }
1608 
1610 
1611  GuideStatus gs(firstRow, chanNums.size(), chanNums,
1616  auto *updater = new GuideUpdateProgramRow(this, gs, proglists);
1617  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
1618 }
1619 
1621  const QDateTime& start,
1622  ProgramList *proglist)
1623 {
1624  if (row < 0 || row >= m_channelCount ||
1625  start != m_currentStartTime)
1626  {
1627  delete proglist;
1628  return;
1629  }
1630 
1631  QDateTime ts = m_currentStartTime;
1632 
1633  QDateTime tnow = MythDate::current();
1634  int progPast = 0;
1635  if (tnow > m_currentEndTime)
1636  progPast = 100;
1637  else if (tnow < m_currentStartTime)
1638  progPast = 0;
1639  else
1640  {
1641  int played = m_currentStartTime.secsTo(tnow);
1642  int length = m_currentStartTime.secsTo(m_currentEndTime);
1643  if (length)
1644  progPast = played * 100 / length;
1645  }
1646 
1647  m_progPast = progPast;
1648 
1649  auto program = proglist->begin();
1650  std::vector<ProgramInfo*> unknownlist;
1651  bool unknown = false;
1652  ProgramInfo *proginfo = nullptr;
1653  for (int x = 0; x < m_timeCount; ++x)
1654  {
1655  if (program != proglist->end() &&
1656  (ts >= (*program)->GetScheduledEndTime()))
1657  {
1658  ++program;
1659  }
1660 
1661  if ((program == proglist->end()) ||
1662  (ts < (*program)->GetScheduledStartTime()))
1663  {
1664  if (unknown)
1665  {
1666  if (proginfo)
1667  {
1668  proginfo->m_spread++;
1669  proginfo->SetScheduledEndTime(proginfo->GetScheduledEndTime().addSecs(kFiveMinutes));
1670  }
1671  }
1672  else
1673  {
1674  proginfo = new ProgramInfo(kUnknownTitle,
1675  GuideGrid::tr("Unknown", "Unknown program title"),
1676  ts, ts.addSecs(kFiveMinutes));
1677  unknownlist.push_back(proginfo);
1678  proginfo->m_startCol = x;
1679  proginfo->m_spread = 1;
1680  unknown = true;
1681  }
1682  }
1683  else
1684  {
1685  if (proginfo && proginfo == *program)
1686  {
1687  proginfo->m_spread++;
1688  }
1689  else
1690  {
1691  proginfo = *program;
1692  if (proginfo)
1693  {
1694  proginfo->m_startCol = x;
1695  proginfo->m_spread = 1;
1696  unknown = false;
1697  }
1698  }
1699  }
1700  m_programInfos[row][x] = proginfo;
1701  ts = ts.addSecs(kFiveMinutes);
1702  }
1703 
1704  // AutoDeleteDeque doesn't work with std::back_inserter
1705  for (auto & pi : unknownlist)
1706  proglist->push_back(pi); // cppcheck-suppress useStlAlgorithm
1707 
1708  MythRect programRect = m_ggProgramRect;
1709 
1711  double ydifference = 0.0;
1712  double xdifference = 0.0;
1713 
1714  if (m_verticalLayout)
1715  {
1716  ydifference = programRect.width() /
1717  (double) m_ggChannelCount;
1718  xdifference = programRect.height() /
1719  (double) m_timeCount;
1720  }
1721  else
1722  {
1723  ydifference = programRect.height() /
1724  (double) m_ggChannelCount;
1725  xdifference = programRect.width() /
1726  (double) m_timeCount;
1727  }
1728 
1729  int arrow = GridTimeNormal;
1730  int cnt = 0;
1731  int8_t spread = 1;
1732  QDateTime lastprog;
1733  QRect tempRect;
1734  bool isCurrent = false;
1735 
1736  for (int x = 0; x < m_timeCount; ++x)
1737  {
1738  ProgramInfo *pginfo = m_programInfos[row][x];
1739  if (!pginfo)
1740  continue;
1741 
1742  spread = 1;
1743  if (pginfo->GetScheduledStartTime() != lastprog)
1744  {
1745  arrow = GridTimeNormal;
1746  if (pginfo->GetScheduledStartTime() < m_firstTime.addSecs(-300))
1747  arrow |= GridTimeStartsBefore;
1748  if (pginfo->GetScheduledEndTime() > m_lastTime.addSecs(2100))
1749  arrow |= GridTimeEndsAfter;
1750 
1751  if (pginfo->m_spread != -1)
1752  {
1753  spread = pginfo->m_spread;
1754  }
1755  else
1756  {
1757  for (int z = x + 1; z < m_timeCount; ++z)
1758  {
1759  ProgramInfo *test = m_programInfos[row][z];
1760  if (test && (test->GetScheduledStartTime() ==
1761  pginfo->GetScheduledStartTime()))
1762  spread++;
1763  }
1764  pginfo->m_spread = spread;
1765  pginfo->m_startCol = x;
1766 
1767  for (int z = x + 1; z < x + spread; ++z)
1768  {
1769  ProgramInfo *test = m_programInfos[row][z];
1770  if (test)
1771  {
1772  test->m_spread = spread;
1773  test->m_startCol = x;
1774  }
1775  }
1776  }
1777 
1778  if (m_verticalLayout)
1779  {
1780  tempRect = QRect((int)(row * ydifference),
1781  (int)(x * xdifference),
1782  (int)(ydifference),
1783  (int)(xdifference * pginfo->m_spread));
1784  }
1785  else
1786  {
1787  tempRect = QRect((int)(x * xdifference),
1788  (int)(row * ydifference),
1789  (int)(xdifference * pginfo->m_spread),
1790  (int)ydifference);
1791  }
1792 
1793  // snap to right edge for last entry.
1794  if (tempRect.right() + 2 >= programRect.width())
1795  tempRect.setRight(programRect.width());
1796  if (tempRect.bottom() + 2 >= programRect.bottom())
1797  tempRect.setBottom(programRect.bottom());
1798 
1799  isCurrent = m_currentRow == row && (m_currentCol >= x) &&
1800  (m_currentCol < (x + spread));
1801 
1802  int recFlag = 0;
1803  switch (pginfo->GetRecordingRuleType())
1804  {
1805  case kSingleRecord:
1806  recFlag = 1;
1807  break;
1808  case kDailyRecord:
1809  recFlag = 2;
1810  break;
1811  case kAllRecord:
1812  recFlag = 4;
1813  break;
1814  case kWeeklyRecord:
1815  recFlag = 5;
1816  break;
1817  case kOneRecord:
1818  recFlag = 6;
1819  break;
1820  case kOverrideRecord:
1821  case kDontRecord:
1822  recFlag = 7;
1823  break;
1824  case kNotRecording:
1825  default:
1826  recFlag = 0;
1827  break;
1828  }
1829 
1830  int recStat = 0;
1831  if (pginfo->GetRecordingStatus() == RecStatus::Conflict ||
1833  recStat = 2;
1834  else if (pginfo->GetRecordingStatus() <= RecStatus::WillRecord)
1835  recStat = 1;
1836  else
1837  recStat = 0;
1838 
1839  QString title = (pginfo->GetTitle() == kUnknownTitle) ?
1840  GuideGrid::tr("Unknown", "Unknown program title") :
1841  pginfo->GetTitle();
1842  m_result.emplace_back(
1843  row, cnt, tempRect, title,
1844  pginfo->GetCategory(), arrow, recFlag,
1845  recStat, isCurrent);
1846 
1847  cnt++;
1848  }
1849 
1850  lastprog = pginfo->GetScheduledStartTime();
1851  }
1852 }
1853 
1854 void GuideGrid::customEvent(QEvent *event)
1855 {
1856  if (event->type() == MythEvent::MythEventMessage)
1857  {
1858  auto *me = dynamic_cast<MythEvent *>(event);
1859  if (me == nullptr)
1860  return;
1861 
1862  const QString& message = me->Message();
1863 
1864  if (message == "SCHEDULE_CHANGE")
1865  {
1866  GuideHelper::Wait(this);
1868  fillProgramInfos();
1869  }
1870  }
1871  else if (event->type() == DialogCompletionEvent::kEventType)
1872  {
1873  auto *dce = (DialogCompletionEvent*)(event);
1874 
1875  QString resultid = dce->GetId();
1876  QString resulttext = dce->GetResultText();
1877  int buttonnum = dce->GetResult();
1878 
1879  if (resultid == "deleterule")
1880  {
1881  auto *record = dce->GetData().value<RecordingRule *>();
1882  if (record)
1883  {
1884  if ((buttonnum > 0) && !record->Delete())
1885  LOG(VB_GENERAL, LOG_ERR, "Failed to delete recording rule");
1886  delete record;
1887  }
1888  }
1889  // Test for this here because it can come from
1890  // different menus.
1891  else if (resulttext == tr("Watch This Channel"))
1892  {
1893  ChannelInfoList selection = GetSelection();
1894  if (SelectionIsTunable(selection))
1895  TV::StartTV(nullptr, kStartTVNoFlags, selection);
1896  }
1897  else if (resultid == "guidemenu")
1898  {
1899  if (resulttext == tr("Record This"))
1900  {
1901  QuickRecord();
1902  }
1903  else if (resulttext == tr("Change to Channel"))
1904  {
1905  enter();
1906  }
1907  else if (resulttext == tr("Program Details"))
1908  {
1909  ShowDetails();
1910  }
1911  else if (resulttext == tr("Reverse Channel Order"))
1912  {
1914  generateListings();
1915  updateChannels();
1916  }
1917  else if (resulttext == tr("Channel Search"))
1918  {
1920  }
1921  else if (resulttext == tr("Add To Channel Group"))
1922  {
1924  ChannelGroupMenu(2);
1925  }
1926  else if (resulttext == tr("Remove from Channel Group"))
1927  {
1929  }
1930  else if (resulttext == tr("Choose Channel Group"))
1931  {
1932  ChannelGroupMenu(1);
1933  }
1934  else if (resulttext == tr("Recording Options"))
1935  {
1937  }
1938  else if (resulttext == tr("Jump to Time"))
1939  {
1940  ShowJumpToTime();
1941  }
1942  }
1943  else if (resultid == "recmenu")
1944  {
1945  if (resulttext == tr("Edit Recording Status"))
1946  {
1947  EditRecording();
1948  }
1949  else if (resulttext == tr("Edit Schedule"))
1950  {
1951  EditScheduled();
1952  }
1953  else if (resulttext == tr("Show Upcoming"))
1954  {
1955  ShowUpcoming();
1956  }
1957  else if (resulttext == tr("Previously Recorded"))
1958  {
1959  ShowPrevious();
1960  }
1961  else if (resulttext == tr("Custom Edit"))
1962  {
1963  EditCustom();
1964  }
1965  else if (resulttext == tr("Delete Rule"))
1966  {
1967  deleteRule();
1968  }
1969 
1970  }
1971  else if (resultid == "channelgrouptogglemenu")
1972  {
1973  int changroupid = ChannelGroup::GetChannelGroupId(resulttext);
1974 
1975  if (changroupid > 0)
1976  toggleChannelFavorite(changroupid);
1977  }
1978  else if (resultid == "channelgroupmenu")
1979  {
1980  if (buttonnum >= 0)
1981  {
1982  int changroupid = -1;
1983 
1984  if (resulttext == QObject::tr("All Channels"))
1985  changroupid = -1;
1986  else
1987  changroupid = ChannelGroup::GetChannelGroupId(resulttext);
1988 
1989  m_changrpid = changroupid;
1990  generateListings();
1991  updateChannels();
1992  updateInfo();
1993 
1994  QString changrpname;
1996 
1997  if (m_changroupname)
1998  m_changroupname->SetText(changrpname);
1999  }
2000  }
2001  else if (resultid == "jumptotime")
2002  {
2003  QDateTime datetime = dce->GetData().toDateTime();
2004  moveToTime(datetime);
2005  }
2006  else
2008  }
2009  else if (event->type() == UpdateGuideEvent::kEventType)
2010  {
2011  auto *uge = dynamic_cast<UpdateGuideEvent*>(event);
2012  if (uge && uge->m_updater)
2013  {
2014  uge->m_updater->ExecuteUI();
2015  delete uge->m_updater;
2016  uge->m_updater = nullptr;
2017  }
2018  }
2019 }
2020 
2022 {
2023  if (m_dateText)
2025  if (m_longdateText)
2028 }
2029 
2030 void GuideGrid::updateProgramsUI(unsigned int firstRow, unsigned int numRows,
2031  int progPast,
2032  const QVector<ProgramList*> &proglists,
2033  const ProgInfoGuideArray &programInfos,
2034  const std::list<GuideUIElement> &elements)
2035 {
2036  for (unsigned int i = 0; i < numRows; ++i)
2037  {
2038  unsigned int row = i + firstRow;
2039  m_guideGrid->ResetRow(row);
2040  if (m_programs[row] != proglists[i])
2041  {
2042  delete m_programs[row];
2043  m_programs[row] = proglists[i];
2044  }
2045  }
2046  m_guideGrid->SetProgPast(progPast);
2047  for (const auto & r : elements)
2048  {
2049  m_guideGrid->SetProgramInfo(r.m_row, r.m_col, r.m_area, r.m_title,
2050  r.m_category, r.m_arrow, r.m_recType,
2051  r.m_recStat, r.m_selected);
2052  }
2053  for (unsigned int i = firstRow; i < firstRow + numRows; ++i)
2054  {
2055  for (int j = 0; j < MAX_DISPLAY_TIMES; ++j)
2056  m_programInfos[i][j] = programInfos[i][j];
2057  if (i == (unsigned int)m_currentRow)
2058  updateInfo();
2059  }
2061 }
2062 
2064 {
2065  auto *updater = new GuideUpdateChannels(this, m_currentStartChannel);
2066  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
2067 }
2068 
2069 void GuideGrid::updateChannelsNonUI(QVector<ChannelInfo *> &chinfos,
2070  QVector<bool> &unavailables)
2071 {
2073 
2074  for (unsigned int y = 0; (y < (unsigned int)m_channelCount) && chinfo; ++y)
2075  {
2076  unsigned int chanNumber = y + m_currentStartChannel;
2077  if (chanNumber >= m_channelInfos.size())
2078  chanNumber -= m_channelInfos.size();
2079  if (chanNumber >= m_channelInfos.size())
2080  break;
2081 
2082  chinfo = GetChannelInfo(chanNumber);
2083 
2084  bool unavailable = false;
2085  bool try_alt = false;
2086 
2087  if (m_player)
2088  {
2090  const PlayerContext* ctx = m_player->GetPlayerContext();
2091  if (ctx && chinfo)
2092  try_alt = !TV::IsTunable(chinfo->m_chanId);
2094  }
2095 
2096  if (try_alt)
2097  {
2098  unavailable = true;
2099 
2100  // Try alternates with same channum if applicable
2101  uint alt = GetAlternateChannelIndex(chanNumber, true);
2102  if (alt != m_channelInfoIdx[chanNumber])
2103  {
2104  unavailable = false;
2105  m_channelInfoIdx[chanNumber] = alt;
2106  chinfo = GetChannelInfo(chanNumber);
2107  }
2108 
2109  // Try alternates with different channum if applicable
2110  if (unavailable && chinfo &&
2111  !GetProgramList(chinfo->m_chanId).empty())
2112  {
2113  alt = GetAlternateChannelIndex(chanNumber, false);
2114  unavailable = (alt == m_channelInfoIdx[chanNumber]);
2115  }
2116  }
2117  chinfos.push_back(chinfo);
2118  unavailables.push_back(unavailable);
2119  }
2120 }
2121 
2122 void GuideGrid::updateChannelsUI(const QVector<ChannelInfo *> &chinfos,
2123  const QVector<bool> &unavailables)
2124 {
2125  m_channelList->Reset();
2126  for (int i = 0; i < chinfos.size(); ++i)
2127  {
2128  ChannelInfo *chinfo = chinfos[i];
2129  bool unavailable = unavailables[i];
2130  auto *item = new MythUIButtonListItem(m_channelList,
2131  chinfo ? chinfo->GetFormatted(ChannelInfo::kChannelShort) : QString());
2132 
2133  QString state = "available";
2134  if (unavailable)
2135  state = (m_changrpid == -1) ? "unavailable" : "favunavailable";
2136  else
2137  state = (m_changrpid == -1) ? "available" : "favourite";
2138 
2139  item->SetFontState(state);
2140  item->DisplayState(state, "chanstatus");
2141 
2142  if (chinfo)
2143  {
2144  InfoMap infomap;
2145  chinfo->ToMap(infomap);
2146  item->SetTextFromMap(infomap);
2147 
2148  if (!chinfo->m_icon.isEmpty())
2149  {
2150  QString iconurl =
2151  gCoreContext->GetMasterHostPrefix("ChannelIcons",
2152  chinfo->m_icon);
2153  item->SetImage(iconurl, "channelicon");
2154  }
2155  }
2156  }
2158 }
2159 
2161 {
2162  if (m_currentRow < 0 || m_currentCol < 0)
2163  return;
2164 
2166  if (!pginfo)
2167  return;
2168 
2169  InfoMap infoMap;
2170 
2171  int chanNum = m_currentRow + m_currentStartChannel;
2172  if (chanNum >= (int)m_channelInfos.size())
2173  chanNum -= (int)m_channelInfos.size();
2174  if (chanNum >= (int)m_channelInfos.size())
2175  return;
2176  if (chanNum < 0)
2177  chanNum = 0;
2178 
2179  ChannelInfo *chinfo = GetChannelInfo(chanNum);
2180 
2181  if (m_channelImage)
2182  {
2183  m_channelImage->Reset();
2184  if (!chinfo->m_icon.isEmpty())
2185  {
2186  QString iconurl = gCoreContext->GetMasterHostPrefix("ChannelIcons",
2187  chinfo->m_icon);
2188 
2189  m_channelImage->SetFilename(iconurl);
2190  m_channelImage->Load();
2191  }
2192  }
2193 
2194  chinfo->ToMap(infoMap);
2195  pginfo->ToMap(infoMap);
2196  // HACK - This should be done in ProgramInfo, but that needs more careful
2197  // review since it may have unintended consequences so we're doing it here
2198  // for now
2199  if (infoMap["title"] == kUnknownTitle)
2200  {
2201  infoMap["title"] = tr("Unknown", "Unknown program title");
2202  infoMap["titlesubtitle"] = tr("Unknown", "Unknown program title");
2203  }
2204 
2205  SetTextFromMap(infoMap);
2206 
2207  MythUIStateType *ratingState = dynamic_cast<MythUIStateType*>
2208  (GetChild("ratingstate"));
2209  if (ratingState)
2210  {
2211  QString rating = QString::number(pginfo->GetStars(10));
2212  ratingState->DisplayState(rating);
2213  }
2215 }
2216 
2218 {
2219  int oldchangrpid = m_changrpid;
2220 
2222 
2223  if (oldchangrpid != m_changrpid)
2224  generateListings();
2225 
2226  updateChannels();
2227  updateInfo();
2228 
2229  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
2230 
2231  if (m_changroupname)
2232  m_changroupname->SetText(changrpname);
2233 }
2234 
2236 {
2238  m_currentRow = 0;
2239 
2240  int maxchannel = 0;
2241  fillChannelInfos();
2242  maxchannel = std::max((int)GetChannelCount() - 1, 0);
2243  m_channelCount = std::min(m_guideGrid->getChannelCount(), maxchannel + 1);
2244 
2246  fillProgramInfos();
2247 }
2248 
2249 // mode 0 Include empty channel groups
2250 // mode 1 Exclude empty channel groups
2251 // mode 2 Only Manual channel groups
2253 {
2254  ChannelGroupList channels;
2255  if (mode == 2)
2256  channels = ChannelGroup::GetManualChannelGroups(true);
2257  else
2258  channels = ChannelGroup::GetChannelGroups(mode == 0);
2259 
2260  if (channels.empty())
2261  {
2262  QString message = tr("You don't have any channel groups defined");
2263 
2264  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2265 
2266  auto *okPopup = new MythConfirmationDialog(popupStack, message, false);
2267  if (okPopup->Create())
2268  popupStack->AddScreen(okPopup);
2269  else
2270  delete okPopup;
2271 
2272  return;
2273  }
2274 
2275  QString label = tr("Select Channel Group");
2276 
2277  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2278  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
2279 
2280  if (menuPopup->Create())
2281  {
2282  if (mode == 0 || mode == 2)
2283  {
2284  // add channel to group menu
2285  menuPopup->SetReturnEvent(this, "channelgrouptogglemenu");
2286  }
2287  else
2288  {
2289  // switch to channel group menu
2290  menuPopup->SetReturnEvent(this, "channelgroupmenu");
2291  menuPopup->AddButton(QObject::tr("All Channels"));
2292  }
2293 
2294  for (auto & channel : channels)
2295  {
2296  menuPopup->AddButton(channel.m_name);
2297  }
2298 
2299  popupStack->AddScreen(menuPopup);
2300  }
2301  else
2302  {
2303  delete menuPopup;
2304  }
2305 }
2306 
2308 {
2309  MSqlQuery query(MSqlQuery::InitCon());
2310 
2311  if (grpid == -1)
2312  {
2313  if (m_changrpid == -1)
2314  return;
2315  grpid = m_changrpid;
2316  }
2317 
2318  // Get current channel id, and make sure it exists...
2319  int chanNum = m_currentRow + m_currentStartChannel;
2320  if (chanNum >= (int)m_channelInfos.size())
2321  chanNum -= (int)m_channelInfos.size();
2322  if (chanNum >= (int)m_channelInfos.size())
2323  return;
2324  if (chanNum < 0)
2325  chanNum = 0;
2326 
2327  ChannelInfo *ch = GetChannelInfo(chanNum);
2328  uint chanid = ch->m_chanId;
2329 
2330  // All Channels plus all automatic channel groups
2332  {
2333  // If currently viewing all channels, allow to add only not delete
2334  ChannelGroup::ToggleChannel(chanid, grpid, false);
2335  }
2336  else
2337  {
2338  // Only allow delete if viewing the favorite group in question
2339  ChannelGroup::ToggleChannel(chanid, grpid, true);
2340  }
2341 
2342  // Regenerate the list of non empty groups in case it did change
2344 
2345  // If viewing a manual group such as Favorites, refresh because a channel was removed
2347  {
2348  generateListings();
2349  updateChannels();
2350  updateInfo();
2351  }
2352 }
2353 
2355 {
2357 
2358  if (!test)
2359  {
2361  return;
2362  }
2363 
2364  int8_t startCol = test->m_startCol;
2365  m_currentCol = startCol - 1;
2366 
2367  if (m_currentCol < 0)
2368  {
2369  m_currentCol = 0;
2371  }
2372  else
2373  {
2375  }
2376 }
2377 
2379 {
2381 
2382  if (!test)
2383  {
2385  return;
2386  }
2387 
2388  int8_t spread = test->m_spread;
2389  int8_t startCol = test->m_startCol;
2390 
2391  m_currentCol = startCol + spread;
2392 
2393  if (m_currentCol > m_timeCount - 1)
2394  {
2395  m_currentCol = m_timeCount - 1;
2397  }
2398  else
2399  {
2401  }
2402 }
2403 
2405 {
2406  m_currentRow++;
2407 
2408  if (m_currentRow > m_channelCount - 1)
2409  {
2412  }
2413  else
2414  {
2416  }
2417 }
2418 
2420 {
2421  m_currentRow--;
2422 
2423  if (m_currentRow < 0)
2424  {
2425  m_currentRow = 0;
2427  }
2428  else
2429  {
2431  }
2432 }
2433 
2435 {
2436  switch (movement)
2437  {
2438  case kScrollLeft :
2440  break;
2441  case kScrollRight :
2443  break;
2444  case kPageLeft :
2446  break;
2447  case kPageRight :
2449  break;
2450  case kDayLeft :
2452  break;
2453  case kDayRight :
2455  break;
2456  default :
2457  break;
2458  }
2459 
2460  fillTimeInfos();
2461  fillProgramInfos();
2462  updateDateText();
2463 }
2464 
2466 {
2467  switch (movement)
2468  {
2469  case kScrollDown :
2471  break;
2472  case kScrollUp :
2474  break;
2475  case kPageDown :
2477  break;
2478  case kPageUp :
2480  break;
2481  default :
2482  break;
2483  }
2484 
2485  fillProgramInfos();
2486  updateChannels();
2487 }
2488 
2489 void GuideGrid::moveToTime(const QDateTime& datetime)
2490 {
2491  if (!datetime.isValid())
2492  return;
2493 
2494  m_currentStartTime = datetime;
2495 
2496  fillTimeInfos();
2497  fillProgramInfos();
2498  updateDateText();
2499 }
2500 
2501 void GuideGrid::setStartChannel(int newStartChannel)
2502 {
2503  if (newStartChannel < 0)
2504  m_currentStartChannel = newStartChannel + GetChannelCount();
2505  else if (newStartChannel >= (int) GetChannelCount())
2506  m_currentStartChannel = newStartChannel - GetChannelCount();
2507  else
2508  m_currentStartChannel = newStartChannel;
2509 }
2510 
2512 {
2513  if (m_allowFinder)
2515 }
2516 
2518 {
2519  if (!m_player)
2520  return;
2521 
2522  m_updateTimer->stop();
2523 
2524  channelUpdate();
2525 
2526  // Don't perform transition effects when guide is being used during playback
2527  GetScreenStack()->PopScreen(this, false);
2528 
2529  epgIsVisibleCond.wakeAll();
2530 }
2531 
2533 {
2534  // HACK: Do not allow exit if we have a popup menu open, not convinced
2535  // that this is the right solution
2536  if (GetMythMainWindow()->GetStack("popup stack")->TotalScreens() > 0)
2537  return;
2538 
2539  m_updateTimer->stop();
2540 
2541  // don't fade the screen if we are returning to the player
2542  if (m_player)
2543  GetScreenStack()->PopScreen(this, false);
2544  else
2545  GetScreenStack()->PopScreen(this, true);
2546 
2547  epgIsVisibleCond.wakeAll();
2548 }
2549 
2551 {
2553 
2554  if (!pginfo || !pginfo->GetRecordingRuleID())
2555  return;
2556 
2557  auto *record = new RecordingRule();
2558  if (!record->LoadByProgram(pginfo))
2559  {
2560  delete record;
2561  return;
2562  }
2563 
2564  QString message = tr("Delete '%1' %2 rule?")
2565  .arg(record->m_title, toString(pginfo->GetRecordingRuleType()));
2566 
2567  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2568 
2569  auto *okPopup = new MythConfirmationDialog(popupStack, message, true);
2570 
2571  okPopup->SetReturnEvent(this, "deleterule");
2572  okPopup->SetData(QVariant::fromValue(record));
2573 
2574  if (okPopup->Create())
2575  popupStack->AddScreen(okPopup);
2576  else
2577  delete okPopup;
2578 }
2579 
2581 {
2582  if (!m_player)
2583  return;
2584 
2585  ChannelInfoList sel = GetSelection();
2586 
2587  if (!sel.empty())
2588  {
2590  m_player->ChangeChannel(sel);
2592  }
2593 }
2594 
2595 void GuideGrid::GoTo(int start, int cur_row)
2596 {
2597  setStartChannel(start);
2598  m_currentRow = cur_row % m_channelCount;
2599  updateChannels();
2600  fillProgramInfos();
2602 }
2603 
2605 {
2606  QString txt;
2607  {
2608  QMutexLocker locker(&m_jumpToChannelLock);
2609  if (m_jumpToChannel)
2610  txt = m_jumpToChannel->GetEntry();
2611  }
2612 
2613  if (txt.isEmpty())
2614  return;
2615 
2616  if (m_jumpToText)
2617  m_jumpToText->SetText(txt);
2618 }
2619 
2621 {
2622  QMutexLocker locker(&m_jumpToChannelLock);
2623  m_jumpToChannel = ptr;
2624 
2625  if (!m_jumpToChannel)
2626  {
2627  if (m_jumpToText)
2628  m_jumpToText->Reset();
2629 
2630  updateDateText();
2631  }
2632 }
2633 
2635 {
2636  GetMythMainWindow()->GetPaintWindow()->clearMask();
2637 }
2638 
2640 {
2641  emit m_player->RequestEmbedding(true, m_videoRect);
2642  QRegion r1 = QRegion(m_area);
2643  QRegion r2 = QRegion(m_videoRect);
2644  GetMythMainWindow()->GetPaintWindow()->setMask(r1.xored(r2));
2645 }
2646 
2648 {
2649  if (m_player)
2650  HideTVWindow();
2651 
2653 }
2654 
2656 {
2657  if (m_player)
2658  EmbedTVWindow();
2659 
2661 }
2662 
2664 {
2665  QString message = tr("Jump to a specific date and time in the guide");
2668 
2669  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2670  auto *timedlg = new MythTimeInputDialog(popupStack, message, flags);
2671 
2672  if (timedlg->Create())
2673  {
2674  timedlg->SetReturnEvent(this, "jumptotime");
2675  popupStack->AddScreen(timedlg);
2676  }
2677  else
2678  delete timedlg;
2679 }
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:1065
GuideGrid::m_guideGrid
MythUIGuideGrid * m_guideGrid
Definition: guidegrid.h:294
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:101
GuideUpdaterBase::~GuideUpdaterBase
virtual ~GuideUpdaterBase()=default
GuideGrid::GetChannelCount
uint GetChannelCount(void) const
Definition: guidegrid.cpp:1160
MythGestureEvent::Down
@ Down
Definition: mythgesture.h:50
MythGestureEvent::LeftThenUp
@ LeftThenUp
Definition: mythgesture.h:65
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:286
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:315
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:845
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:84
tv.h
TV::GetState
TVState GetState() const
Definition: tv_play.cpp:1319
MythEvent::MythEventMessage
static Type MythEventMessage
Definition: mythevent.h:79
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
GuideGrid::moveUpDown
void moveUpDown(MoveVector movement)
Definition: guidegrid.cpp:2465
ACTION_DOWN
static constexpr const char * ACTION_DOWN
Definition: mythuiactions.h:17
GuideStatus::m_channelCount
const int m_channelCount
Definition: guidegrid.cpp:220
GuideGrid::EmbedTVWindow
void EmbedTVWindow(void)
Definition: guidegrid.cpp:2639
MythTimeInputDialog::kHours
@ kHours
Definition: mythdialogbox.h:458
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:2580
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:912
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:82
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:298
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:859
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:89
MythGestureEvent::GetGesture
Gesture GetGesture() const
Definition: mythgesture.h:85
ChannelInfo::kChannelShort
@ kChannelShort
Definition: channelinfo.h:49
MythUIType::GetChildAt
MythUIType * GetChildAt(QPoint p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
Definition: mythuitype.cpp:236
ChannelInfo::m_chanId
uint m_chanId
Definition: channelinfo.h:85
ChannelInfo::ToMap
void ToMap(InfoMap &infoMap)
Definition: channelinfo.cpp:219
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:2410
MythGestureEvent::Up
@ Up
Definition: mythgesture.h:49
MythTimeInputDialog::kDay
@ kDay
Definition: mythdialogbox.h:454
ChannelGroup
Definition: channelgroup.h:35
GuideGrid::Close
void Close() override
Definition: guidegrid.cpp:2532
ScheduleCommon::customEvent
void customEvent(QEvent *event) override
Definition: schedulecommon.cpp:481
GuideGrid::ShowRecordingMenu
void ShowRecordingMenu(void)
Definition: guidegrid.cpp:1111
UpdateGuideEvent::kEventType
static Type kEventType
Definition: guidegrid.cpp:349
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:24
GuideGrid::m_allowFinder
bool m_allowFinder
Definition: guidegrid.h:242
GuideUpdaterBase::GuideUpdaterBase
GuideUpdaterBase(GuideGrid *guide)
Definition: guidegrid.cpp:228
GuideGrid::kPageRight
@ kPageRight
Definition: guidegrid.h:193
GuideGrid::m_channelGroupListManual
ChannelGroupList m_channelGroupListManual
Definition: guidegrid.h:283
GuideGrid::ToggleMute
void ToggleMute(bool CycleChannels)
GuideGrid::m_channelImage
MythUIImage * m_channelImage
Definition: guidegrid.h:299
GuideGrid::GetAlternateChannelIndex
uint GetAlternateChannelIndex(uint chan_idx, bool with_same_channum) const
Definition: guidegrid.cpp:1208
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:288
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:133
MythUIGuideGrid::SetProgPast
void SetProgPast(int ppast)
Definition: mythuiguidegrid.cpp:807
mythscreenstack.h
MythGestureEvent::RightThenDown
@ RightThenDown
Definition: mythgesture.h:68
GuideGrid::m_currentEndTime
QDateTime m_currentEndTime
Definition: guidegrid.h:252
ChannelUtil::OrderBy
OrderBy
Definition: channelutil.h:198
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:969
GuideGrid::updateChannels
void updateChannels(void)
Definition: guidegrid.cpp:2063
GuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: guidegrid.h:264
ChannelGroup::InChannelGroupList
static bool InChannelGroupList(const ChannelGroupList &groupList, int grpid)
Definition: channelgroup.cpp:363
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
GuideGrid::setStartChannel
void setStartChannel(int newStartChannel)
Definition: guidegrid.cpp:2501
ChannelUtil::kChanGroupByChanid
@ kChanGroupByChanid
Definition: channelutil.h:209
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
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:113
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
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
GuideHelper::s_wait
static QWaitCondition s_wait
Definition: guidegrid.cpp:404
mythdbcon.h
ProgramInfo::GetCategory
QString GetCategory(void) const
Definition: programinfo.h:369
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:1165
ChannelGroup::GetManualChannelGroups
static ChannelGroupList GetManualChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:189
GuideGrid::toggleChannelFavorite
void toggleChannelFavorite(int grpid=-1)
Definition: guidegrid.cpp:2307
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:610
GuideUpdateProgramRow::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:300
TV::ChangeChannel
void ChangeChannel(const ChannelInfoList &Options)
Definition: tv_play.cpp:6115
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:2663
GuideUpdateProgramRow::m_numRows
const unsigned int m_numRows
Definition: guidegrid.cpp:301
GuideGrid::m_channelList
MythUIButtonList * m_channelList
Definition: guidegrid.h:293
GuideGrid::cursorUp
void cursorUp()
Definition: guidegrid.cpp:2419
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:397
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
ChannelUtil::kChanOrderByName
@ kChanOrderByName
Definition: channelutil.h:201
kUnknownTitle
const QString kUnknownTitle
Definition: guidegrid.cpp:55
autodeletedeque.h
ChannelGroup::GetChannelGroups
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:328
GuideGrid::kScrollDown
@ kScrollDown
Definition: guidegrid.h:187
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:646
MythGestureEvent::UpThenLeft
@ UpThenLeft
Definition: mythgesture.h:61
progfind.h
GuideGrid::cursorRight
void cursorRight()
Definition: guidegrid.cpp:2378
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:2069
remoteutil.h
mythuibuttonlist.h
GuideGrid::deleteRule
void deleteRule()
Definition: guidegrid.cpp:2550
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:14
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:256
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:274
GuideGrid::aboutToShow
void aboutToShow() override
Definition: guidegrid.cpp:2655
ScheduleCommon::EditScheduled
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
Definition: schedulecommon.cpp:166
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:884
programtypes.h
GuideGrid::aboutToHide
void aboutToHide() override
Definition: guidegrid.cpp:2647
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
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:191
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
GuideGrid::kScrollUp
@ kScrollUp
Definition: guidegrid.h:186
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:208
ScheduleCommon::ShowPrevious
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
Definition: schedulecommon.cpp:248
GuideStatus::m_timeCount
const int m_timeCount
Definition: guidegrid.cpp:220
GuideGrid::customEvent
void customEvent(QEvent *event) override
Definition: guidegrid.cpp:1854
mythdate.h
GuideGrid::cursorDown
void cursorDown()
Definition: guidegrid.cpp:2404
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:1059
programinfo.h
RemoteRequestFreeInputList
std::vector< uint > RemoteRequestFreeInputList(uint excluded_input)
Definition: tvremoteutil.cpp:245
GuideGrid::fillChannelInfos
void fillChannelInfos(bool gotostartchannel=true)
Definition: guidegrid.cpp:1354
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:390
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:202
mythlogging.h
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:447
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:296
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:1104
GuideUpdateChannels::m_chinfos
QVector< ChannelInfo * > m_chinfos
Definition: guidegrid.cpp:339
ProgramInfo::SetScheduledEndTime
void SetScheduledEndTime(const QDateTime &dt)
Definition: programinfo.h:524
GuideGrid::m_recList
ProgramList m_recList
Definition: guidegrid.h:248
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:798
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
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:540
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:361
GuideGrid::m_threadPool
MThreadPool m_threadPool
Definition: guidegrid.h:279
GuideGrid::showProgFinder
void showProgFinder()
Definition: guidegrid.cpp:2511
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:2030
GuideGrid::fillTimeInfos
void fillTimeInfos(void)
Definition: guidegrid.cpp:1491
GuideGrid::enter
void enter()
Definition: guidegrid.cpp:2517
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:206
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:39
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
MythGestureEvent::Right
@ Right
Definition: mythgesture.h:52
RecStatus::Conflict
@ Conflict
Definition: recordingstatus.h:39
LOC
#define LOC
Definition: guidegrid.cpp:51
GuideGrid::kDayRight
@ kDayRight
Definition: guidegrid.h:195
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:1542
GuideGrid::m_updateTimer
QTimer * m_updateTimer
Definition: guidegrid.h:277
MythGestureEvent::DownThenRight
@ DownThenRight
Definition: mythgesture.h:64
TV::IsTunable
static bool IsTunable(uint ChanId)
Definition: tv_play.cpp:6639
MythGestureEvent::Click
@ Click
Definition: mythgesture.h:77
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
MythMainWindow::GetPaintWindow
QWidget * GetPaintWindow()
Definition: mythmainwindow.cpp:265
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:1620
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:243
GuideGrid::m_timeList
MythUIButtonList * m_timeList
Definition: guidegrid.h:292
uint
unsigned int uint
Definition: compat.h:79
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
GuideStatus::m_currentCol
const int m_currentCol
Definition: guidegrid.cpp:219
GuideStatus::m_numRows
const unsigned int m_numRows
Definition: guidegrid.cpp:213
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::~GuideGrid
~GuideGrid() override
Definition: guidegrid.cpp:633
AutoDeleteDeque::end
iterator end(void)
Definition: autodeletedeque.h:51
GuideGrid::kPageDown
@ kPageDown
Definition: guidegrid.h:191
MythGestureEvent::Left
@ Left
Definition: mythgesture.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:912
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:217
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
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:28
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:844
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:670
GuideGrid::kScrollRight
@ kScrollRight
Definition: guidegrid.h:189
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:906
GuideGrid::MoveVector
MoveVector
Definition: guidegrid.h:185
GuideStatus::m_verticalLayout
const bool m_verticalLayout
Definition: guidegrid.cpp:221
AutoDeleteDeque< ProgramInfo * >
GuideGrid::moveLeftRight
void moveLeftRight(MoveVector movement)
Definition: guidegrid.cpp:2434
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:2122
kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:27
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:297
GuideGrid::kDayLeft
@ kDayLeft
Definition: guidegrid.h:194
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:451
ChannelGroup::GetNextChannelGroup
static int GetNextChannelGroup(const ChannelGroupList &sorted, int grpid)
Definition: channelgroup.cpp:338
TV::ReturnPlayerLock
void ReturnPlayerLock() const
Definition: tv_play.cpp:10103
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:404
TV::VolumeChange
void VolumeChange(bool Up, int NewVolume=-1)
Definition: tv_play.cpp:6885
GuideGrid::GetCurrentStartTime
QDateTime GetCurrentStartTime(void) const
Definition: guidegrid.h:132
GuideGrid::generateListings
void generateListings()
Definition: guidegrid.cpp:2235
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
MythGestureEvent::LeftThenDown
@ LeftThenDown
Definition: mythgesture.h:66
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:290
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:695
cardutil.h
kOverrideRecord
@ kOverrideRecord
Definition: recordingtypes.h:29
TV::GetPlayerContext
PlayerContext * GetPlayerContext()
Return a pointer to TV::m_playerContext.
Definition: tv_play.cpp:162
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:680
ChannelGroup::GetChannelGroupId
static int GetChannelGroupId(const QString &changroupname)
Definition: channelgroup.cpp:396
GuideGrid::cursorLeft
void cursorLeft()
Definition: guidegrid.cpp:2354
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:22
GuideUpdateProgramRow::m_result
std::list< GuideUIElement > m_result
Definition: guidegrid.cpp:319
kFourMinutes
static constexpr int64_t kFourMinutes
Definition: guidegrid.cpp:58
std
Definition: mythchrono.h:23
GuideGrid::fillProgramRowInfos
void fillProgramRowInfos(int row, bool useExistingData)
Definition: guidegrid.cpp:1554
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:5642
TV::UpdateChannelList
void UpdateChannelList(int GroupID)
update the channel list with channels from the selected channel group
Definition: tv_play.cpp:1296
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
MythTimeInputDialog::kAllDates
@ kAllDates
Definition: mythdialogbox.h:464
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:23
MAX_DISPLAY_CHANS
static constexpr int MAX_DISPLAY_CHANS
Definition: mythuiguidegrid.h:24
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:132
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:84
ScheduleCommon::ShowUpcoming
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
Definition: schedulecommon.cpp:67
UpdateGuideEvent::m_updater
GuideUpdaterBase * m_updater
Definition: guidegrid.cpp:348
GuideGrid::toggleGuideListing
void toggleGuideListing()
Definition: guidegrid.cpp:2217
ScheduleCommon::QuickRecord
virtual void QuickRecord(void)
Create a kSingleRecord or bring up recording dialog.
Definition: schedulecommon.cpp:147
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:102
GuideGrid::GetSelection
ChannelInfoList GetSelection(void) const
Definition: guidegrid.cpp:1270
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:63
PlayerContext
Definition: playercontext.h:53
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1554
GuideUpdateProgramRow::m_proglists
QVector< ProgramList * > m_proglists
Definition: guidegrid.cpp:316
GuideGrid::m_dateText
MythUIText * m_dateText
Definition: guidegrid.h:295
ACTION_PAGELEFT
#define ACTION_PAGELEFT
Definition: tv_actions.h:11
build_compdb.action
action
Definition: build_compdb.py:9
ACTION_GUIDE
#define ACTION_GUIDE
Definition: tv_actions.h:26
GuideGrid::updateDateText
void updateDateText(void)
Definition: guidegrid.cpp:2021
GuideGrid::ChannelGroupMenu
void ChannelGroupMenu(int mode=0)
Definition: guidegrid.cpp:2252
GuideGrid::kPageLeft
@ kPageLeft
Definition: guidegrid.h:192
GuideGrid::HideTVWindow
static void HideTVWindow(void)
Definition: guidegrid.cpp:2634
MythScreenType::gestureEvent
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: mythscreentype.cpp:446
GuideGrid::m_channelInfoIdx
QMap< uint, uint > m_channelInfoIdx
Definition: guidegrid.h:244
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:320
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
kAllRecord
@ kAllRecord
Definition: recordingtypes.h:26
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:113
MythScreenType::aboutToHide
virtual void aboutToHide(void)
Definition: mythscreentype.cpp:222
MThreadPool::setMaxThreadCount
void setMaxThreadCount(int maxThreadCount)
Definition: mthreadpool.cpp:527
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:1197
GuideStatus::m_lastTime
const QDateTime m_lastTime
Definition: guidegrid.cpp:222
GuideUpdaterBase
Definition: guidegrid.cpp:225
Player
Definition: zmliveplayer.h:34
GuideHelper::m_guide
GuideGrid * m_guide
Definition: guidegrid.cpp:400
GuideGrid::kPageUp
@ kPageUp
Definition: guidegrid.h:190
GuideGrid::m_lastTime
QDateTime m_lastTime
Definition: guidegrid.h:267
TV::GetPlayerReadLock
void GetPlayerReadLock() const
Definition: tv_play.cpp:10098
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:881
GuideStatus::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:213
GuideGrid::kScrollLeft
@ kScrollLeft
Definition: guidegrid.h:188
MythGestureEvent::RightThenLeft
@ RightThenLeft
Definition: mythgesture.h:69
MythCoreContext::GetMasterHostPrefix
QString GetMasterHostPrefix(const QString &storageGroup=QString(), const QString &path=QString())
Definition: mythcorecontext.cpp:798
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:449
ChannelUtil::GetNearestChannel
static int GetNearestChannel(const ChannelInfoList &list, const QString &channum)
Definition: channelutil.cpp:2313
MythScreenType::aboutToShow
virtual void aboutToShow(void)
Definition: mythscreentype.cpp:238
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:1347
recordingrule.h
MythGestureEvent::RightThenUp
@ RightThenUp
Definition: mythgesture.h:67
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
GuideGrid::moveToTime
void moveToTime(const QDateTime &datetime)
Definition: guidegrid.cpp:2489
mythmainwindow.h
ACTION_MUTEAUDIO
#define ACTION_MUTEAUDIO
Definition: tv_actions.h:106
MythTimeInputDialog
Definition: mythdialogbox.h:443
GuideHelper::Wait
static void Wait(GuideGrid *guide)
Definition: guidegrid.cpp:390
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:308
GuideGrid::GetProgramList
ProgramList GetProgramList(uint chanid) const
Definition: guidegrid.cpp:1175
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:563
GuideGrid::fillProgramInfos
void fillProgramInfos(bool useExistingData=false)
Definition: guidegrid.cpp:1525
GuideGrid::getProgramListFromProgram
ProgramList * getProgramListFromProgram(int chanNum)
Definition: guidegrid.cpp:1530
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:1142
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:1431
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:30
CardUtil::GetStartChannel
static QString GetStartChannel(uint inputid)
Definition: cardutil.cpp:1751
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
ChannelInfo::m_callSign
QString m_callSign
Definition: channelinfo.h:91
MThreadPool::start
void start(QRunnable *runnable, const QString &debugName, int priority=0)
Definition: mthreadpool.cpp:352
GuideStatus::m_currentStartTime
const QDateTime m_currentStartTime
Definition: guidegrid.cpp:217
mythscreentype.h
AutoDeleteDeque::size
size_t size(void) const
Definition: autodeletedeque.h:67
ChannelUtil::kChanOrderByChanNum
@ kChanOrderByChanNum
Definition: channelutil.h:200
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
GuideGrid::updateInfo
void updateInfo(void)
Definition: guidegrid.cpp:2160
MKKEY
static constexpr uint64_t MKKEY(uint64_t IDX, uint64_t SEL)
Definition: guidegrid.cpp:1267
tv_play.h
GuideHelper::run
void run(void) override
Definition: guidegrid.cpp:363
GuideGrid::updateJumpToChannel
void updateJumpToChannel(void)
Definition: guidegrid.cpp:2604
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:2595
ProgramInfo::GetStars
float GetStars(void) const
Definition: programinfo.h:442
GuideGrid::SetJumpToChannel
void SetJumpToChannel(JumpToChannel *ptr) override
Definition: guidegrid.cpp:2620
GuideGrid::m_changrplist
ChannelGroupList m_changrplist
Definition: guidegrid.h:282