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