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 using namespace std;
9 
10 //qt
11 #include <QCoreApplication>
12 #include <QDateTime>
13 #include <QKeyEvent>
14 
15 // libmythbase
16 #include "mythdate.h"
17 #include "mythcorecontext.h"
18 #include "mythdbcon.h"
19 #include "mythlogging.h"
20 #include "autodeletedeque.h" // for AutoDeleteDeque, etc
21 #include "mythevent.h" // for MythEvent, etc
22 #include "mythtypes.h" // for InfoMap
23 
24 // libmyth
25 #include "programtypes.h" // for RecStatus, etc
26 
27 // libmythtv
28 #include "remoteutil.h"
29 #include "channelutil.h"
30 #include "cardutil.h"
31 #include "tvremoteutil.h"
32 #include "channelinfo.h"
33 #include "programinfo.h"
34 #include "recordingrule.h"
35 #include "tv_play.h"
36 #include "tv.h" // for ::kState_WatchingLiveTV
37 #include "tv_actions.h" // for ACTION_CHANNELSEARCH, etc
38 #include "recordingtypes.h" // for toString, etc
39 
40 // libmythui
41 #include "mythuibuttonlist.h"
42 #include "mythuiguidegrid.h"
43 #include "mythuistatetype.h"
44 #include "mythdialogbox.h"
45 #include "mythuiimage.h"
46 #include "mythuitext.h"
47 #include "mythmainwindow.h" // for GetMythMainWindow, etc
48 #include "mythrect.h" // for MythRect
49 #include "mythscreenstack.h" // for MythScreenStack
50 #include "mythscreentype.h" // for MythScreenType
51 #include "mythuiactions.h" // for ACTION_SELECT, ACTION_DOWN, etc
52 #include "mythuiutils.h" // for UIUtilW, UIUtilE
53 #include "mythgesture.h"
54 
55 // mythfrontend
56 #include "progfind.h"
57 
58 QWaitCondition epgIsVisibleCond;
59 
60 #define LOC QString("GuideGrid: ")
61 #define LOC_ERR QString("GuideGrid, Error: ")
62 #define LOC_WARN QString("GuideGrid, Warning: ")
63 
64 const QString kUnknownTitle = "";
65 //const QString kUnknownCategory = QObject::tr("Unknown");
66 const unsigned long kUpdateMS = 60 * 1000UL; // Grid update interval (mS)
67 static bool SelectionIsTunable(const ChannelInfoList &selection);
68 
70  JumpToChannelListener *parent, QString start_entry,
71  int start_chan_idx, int cur_chan_idx, uint rows_disp) :
72  m_listener(parent),
73  m_entry(std::move(start_entry)),
74  m_previousStartChannelIndex(start_chan_idx),
75  m_previousCurrentChannelIndex(cur_chan_idx),
76  m_rowsDisplayed(rows_disp),
77  m_timer(new QTimer(this))
78 {
79  if (parent && m_timer)
80  {
81  connect(m_timer, SIGNAL(timeout()), SLOT(deleteLater()));
82  m_timer->setSingleShot(true);
83  }
84  Update();
85 }
86 
87 
89 {
90  if (m_listener)
91  {
92  m_listener->SetJumpToChannel(nullptr);
93  m_listener = nullptr;
94  }
95 
96  if (m_timer)
97  {
98  m_timer->stop();
99  m_timer = nullptr;
100  }
101 
102  QObject::deleteLater();
103 }
104 
105 
106 static bool has_action(const QString& action, const QStringList &actions)
107 {
108  QStringList::const_iterator it;
109  for (it = actions.begin(); it != actions.end(); ++it)
110  {
111  if (action == *it)
112  return true;
113  }
114  return false;
115 }
116 
117 bool JumpToChannel::ProcessEntry(const QStringList &actions, const QKeyEvent *e)
118 {
119  if (!m_listener)
120  return false;
121 
122  if (has_action("ESCAPE", actions))
123  {
126  deleteLater();
127  return true;
128  }
129 
130  if (has_action("DELETE", actions))
131  {
132  if (!m_entry.isEmpty())
133  m_entry = m_entry.left(m_entry.length()-1);
134  Update();
135  return true;
136  }
137 
138  if (has_action(ACTION_SELECT, actions))
139  {
140  if (Update())
141  deleteLater();
142  return true;
143  }
144 
145  QString txt = e->text();
146  bool isUInt = false;
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  //QVector<GuideUIElement> m_result;
323  QLinkedList<GuideUIElement> m_result;
324 };
325 
327 {
328 public:
329  GuideUpdateChannels(GuideGrid *guide, uint startChan)
330  : GuideUpdaterBase(guide), m_currentStartChannel(startChan) {}
331  bool ExecuteNonUI(void) override // GuideUpdaterBase
332  {
334  return false;
336  return true;
337  }
338  void ExecuteUI(void) override // GuideUpdaterBase
339  {
341  }
343  QVector<ChannelInfo *> m_chinfos;
344  QVector<bool> m_unavailables;
345 };
346 
347 class UpdateGuideEvent : public QEvent
348 {
349 public:
350  explicit UpdateGuideEvent(GuideUpdaterBase *updater) :
351  QEvent(kEventType), m_updater(updater) {}
353  static Type kEventType;
354 };
355 QEvent::Type UpdateGuideEvent::kEventType =
356  (QEvent::Type) QEvent::registerEventType();
357 
358 class GuideHelper : public QRunnable
359 {
360 public:
362  : m_guide(guide), m_updater(updater)
363  {
364  QMutexLocker locker(&s_lock);
365  ++s_loading[m_guide];
366  }
367  void run(void) override // QRunnable
368  {
369  QThread::currentThread()->setPriority(QThread::IdlePriority);
370  if (m_updater)
371  {
372  if (m_updater->ExecuteNonUI())
373  {
374  QCoreApplication::postEvent(m_guide,
376  }
377  else
378  {
379  delete m_updater;
380  m_updater = nullptr;
381  }
382  }
383 
384  QMutexLocker locker(&s_lock);
385  --s_loading[m_guide];
386  if (!s_loading[m_guide])
387  s_wait.wakeAll();
388  }
389  static bool IsLoading(GuideGrid *guide)
390  {
391  QMutexLocker locker(&s_lock);
392  return s_loading[guide] != 0U;
393  }
394  static void Wait(GuideGrid *guide)
395  {
396  QMutexLocker locker(&s_lock);
397  while (s_loading[guide])
398  {
399  if (!s_wait.wait(locker.mutex(), 15000UL))
400  return;
401  }
402  }
403 private:
404  GuideGrid *m_guide {nullptr};
406 
407  static QMutex s_lock;
408  static QWaitCondition s_wait;
409  static QMap<GuideGrid*,uint> s_loading;
410 };
411 QMutex GuideHelper::s_lock;
412 QWaitCondition GuideHelper::s_wait;
413 QMap<GuideGrid*,uint> GuideHelper::s_loading;
414 
415 void GuideGrid::RunProgramGuide(uint chanid, const QString &channum,
416  const QDateTime &startTime,
417  TV *player, bool embedVideo,
418  bool allowFinder, int changrpid)
419 {
420  // which channel group should we default to
421  if (changrpid == -2)
422  changrpid = gCoreContext->GetNumSetting("ChannelGroupDefault", -1);
423 
424  // check there are some channels setup
426  0, true, "", (changrpid<0) ? 0 : changrpid);
427  if (channels.empty())
428  {
429  QString message;
430  if (changrpid == -1)
431  {
432  message = tr("You don't have any channels defined in the database."
433  "\n\t\t\tThe program guide will have nothing to show you.");
434  }
435  else
436  {
437  message = tr("Channel group '%1' doesn't have any channels defined."
438  "\n\t\t\tThe program guide will have nothing to show you.")
439  .arg(ChannelGroup::GetChannelGroupName(changrpid));
440  }
441 
442  LOG(VB_GENERAL, LOG_WARNING, LOC + message);
443 
444  if (!player)
445  ShowOkPopup(message);
446  else
447  {
448  if (player && allowFinder)
449  {
450  message = QString("EPG_EXITING");
451  QCoreApplication::postEvent(player, new MythEvent(message));
452  }
453  }
454 
455  return;
456  }
457 
458  // If chanid/channum are unset, find the channel that would
459  // naturally be selected when Live TV is started. This depends on
460  // the available tuners, their capturecard.livetvorder values, and
461  // their capturecard.startchan values.
462  QString actualChannum = channum;
463  if (chanid == 0 && actualChannum.isEmpty())
464  {
465  uint defaultChanid = gCoreContext->GetNumSetting("DefaultChanid", 0);
466  if (defaultChanid && TV::IsTunable(defaultChanid))
467  chanid = defaultChanid;
468  }
469  if (chanid == 0 && actualChannum.isEmpty())
470  {
471  vector<uint> inputIDs = RemoteRequestFreeInputList(0);
472  if (!inputIDs.empty())
473  actualChannum = CardUtil::GetStartingChannel(inputIDs[0]);
474  }
475 
477  auto *gg = new GuideGrid(mainStack, chanid, actualChannum, startTime,
478  player, embedVideo, allowFinder, changrpid);
479 
480  if (gg->Create())
481  mainStack->AddScreen(gg, (player == nullptr));
482  else
483  delete gg;
484 }
485 
487  uint chanid, QString channum, const QDateTime &startTime,
488  TV *player, bool embedVideo,
489  bool allowFinder, int changrpid)
490  : ScheduleCommon(parent, "guidegrid"),
491  m_selectRecThreshold(gCoreContext->GetNumSetting("SelChangeRecThreshold", 16)),
492  m_allowFinder(allowFinder),
493  m_startChanID(chanid),
494  m_startChanNum(std::move(channum)),
495  m_sortReverse(gCoreContext->GetBoolSetting("EPGSortReverse", false)),
496  m_player(player),
497  m_embedVideo(embedVideo),
498  m_previewVideoRefreshTimer(new QTimer(this)),
499  m_channelOrdering(gCoreContext->GetSetting("ChannelOrdering", "channum")),
500  m_updateTimer(new QTimer(this)),
501  m_threadPool("GuideGridHelperPool"),
502  m_changrpid(changrpid),
503  m_changrplist(ChannelGroup::GetChannelGroups(false))
504 {
505  connect(m_previewVideoRefreshTimer, SIGNAL(timeout()),
506  this, SLOT(refreshVideo()));
507  connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateTimeout()) );
508 
509  for (uint i = 0; i < MAX_DISPLAY_CHANS; i++)
510  m_programs.push_back(nullptr);
511 
513  if (startTime.isValid() &&
514  startTime > m_originalStartTime.addSecs(-8 * 3600))
515  m_originalStartTime = startTime;
516 
517  int secsoffset = -((m_originalStartTime.time().minute() % 30) * 60 +
518  m_originalStartTime.time().second());
519  m_currentStartTime = m_originalStartTime.addSecs(secsoffset);
521 }
522 
524 {
525  QString windowName = "programguide";
526 
527  if (m_embedVideo)
528  windowName = "programguide-video";
529 
530  if (!LoadWindowFromXML("schedule-ui.xml", windowName, this))
531  return false;
532 
533  bool err = false;
534  UIUtilE::Assign(this, m_timeList, "timelist", &err);
535  UIUtilE::Assign(this, m_channelList, "channellist", &err);
536  UIUtilE::Assign(this, m_guideGrid, "guidegrid", &err);
537  UIUtilW::Assign(this, m_dateText, "datetext");
538  UIUtilW::Assign(this, m_longdateText, "longdatetext");
539  UIUtilW::Assign(this, m_changroupname, "channelgroup");
540  UIUtilW::Assign(this, m_channelImage, "channelicon");
541  UIUtilW::Assign(this, m_jumpToText, "jumptotext");
542 
543  if (err)
544  {
545  LOG(VB_GENERAL, LOG_ERR,
546  QString("Cannot load screen '%1'").arg(windowName));
547  return false;
548  }
549 
550  BuildFocusList();
551 
552  MythUIImage *videoImage = dynamic_cast<MythUIImage *>(GetChild("video"));
553  if (videoImage && m_embedVideo)
554  m_videoRect = videoImage->GetArea();
555  else
556  m_videoRect = QRect(0,0,0,0);
557 
561 
562  m_currentEndTime = m_currentStartTime.addSecs(m_timeCount * 60 * 5);
563 
565  return true;
566 }
567 
568 void GuideGrid::Load(void)
569 {
572 
573  int maxchannel = max((int)GetChannelCount() - 1, 0);
575  m_channelCount = min(m_channelCount, maxchannel + 1);
576 
577  for (int y = 0; y < m_channelCount; ++y)
578  {
579  int chanNum = y + m_currentStartChannel;
580  if (chanNum >= (int) m_channelInfos.size())
581  chanNum -= (int) m_channelInfos.size();
582  if (chanNum >= (int) m_channelInfos.size())
583  continue;
584 
585  if (chanNum < 0)
586  chanNum = 0;
587 
588  delete m_programs[y];
590  }
591 }
592 
593 void GuideGrid::Init(void)
594 {
596  m_currentCol = 0;
597 
598  fillTimeInfos();
599 
600  updateChannels();
601 
602  fillProgramInfos(true);
603 
604  m_updateTimer->start(kUpdateMS);
605 
606  updateDateText();
607 
608  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
609 
610  if (m_changroupname)
611  m_changroupname->SetText(changrpname);
612 
613  gCoreContext->addListener(this);
614 }
615 
617 {
618  m_updateTimer->disconnect(this);
619  m_updateTimer = nullptr;
620 
621  GuideHelper::Wait(this);
622 
624 
625  while (!m_programs.empty())
626  {
627  if (m_programs.back())
628  delete m_programs.back();
629  m_programs.pop_back();
630  }
631 
632  m_channelInfos.clear();
633 
635  {
636  m_previewVideoRefreshTimer->disconnect(this);
637  m_previewVideoRefreshTimer = nullptr;
638  }
639 
640  gCoreContext->SaveSetting("EPGSortReverse", m_sortReverse ? "1" : "0");
641 
642  // if we have a player and we are returning to it we need
643  // to tell it to stop embedding and return to fullscreen
644  if (m_player && m_allowFinder)
645  {
646  QString message = QString("EPG_EXITING");
647  QCoreApplication::postEvent(m_player, new MythEvent(message));
648  }
649 
650  // maybe the user selected a different channel group,
651  // tell the player to update its channel list just in case
652  if (m_player)
654 
655  if (gCoreContext->GetBoolSetting("ChannelGroupRememberLast", false))
656  gCoreContext->SaveSetting("ChannelGroupDefault", m_changrpid);
657 }
658 
659 bool GuideGrid::keyPressEvent(QKeyEvent *event)
660 {
661  QStringList actions;
662  bool handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", event, actions);
663 
664  if (handled)
665  return true;
666 
667  if (!actions.empty())
668  {
669  QMutexLocker locker(&m_jumpToChannelLock);
670 
671  if (!m_jumpToChannel)
672  {
673  QString chanNum = actions[0];
674  bool isNum = false;
675  (void)chanNum.toInt(&isNum);
676  if (isNum)
677  {
678  // see if we can find a matching channel before creating the JumpToChannel otherwise
679  // JumpToChannel will delete itself in the ctor leading to a segfault
680  int i = FindChannel(0, chanNum, false);
681  if (i >= 0)
682  {
683  m_jumpToChannel = new JumpToChannel(this, chanNum,
687  }
688 
689  handled = true;
690  }
691  }
692 
693  if (m_jumpToChannel && !handled)
694  handled = m_jumpToChannel->ProcessEntry(actions, event);
695  }
696 
697  for (int i = 0; i < actions.size() && !handled; ++i)
698  {
699  QString action = actions[i];
700  handled = true;
701  if (action == ACTION_UP)
702  {
703  if (m_verticalLayout)
704  cursorLeft();
705  else
706  cursorUp();
707  }
708  else if (action == ACTION_DOWN)
709  {
710  if (m_verticalLayout)
711  cursorRight();
712  else
713  cursorDown();
714  }
715  else if (action == ACTION_LEFT)
716  {
717  if (m_verticalLayout)
718  cursorUp();
719  else
720  cursorLeft();
721  }
722  else if (action == ACTION_RIGHT)
723  {
724  if (m_verticalLayout)
725  cursorDown();
726  else
727  cursorRight();
728  }
729  else if (action == "PAGEUP")
730  {
731  if (m_verticalLayout)
733  else
735  }
736  else if (action == "PAGEDOWN")
737  {
738  if (m_verticalLayout)
740  else
742  }
743  else if (action == ACTION_PAGELEFT)
744  {
745  if (m_verticalLayout)
747  else
749  }
750  else if (action == ACTION_PAGERIGHT)
751  {
752  if (m_verticalLayout)
754  else
756  }
757  else if (action == ACTION_DAYLEFT)
759  else if (action == ACTION_DAYRIGHT)
761  else if (action == "NEXTFAV")
763  else if (action == ACTION_FINDER)
764  showProgFinder();
765  else if (action == ACTION_CHANNELSEARCH)
767  else if (action == "MENU")
768  ShowMenu();
769  else if (action == "ESCAPE" || action == ACTION_GUIDE)
770  Close();
771  else if (action == ACTION_SELECT)
772  {
773  ProgramInfo *pginfo =
775  int secsTillStart =
776  (pginfo) ? MythDate::current().secsTo(
777  pginfo->GetScheduledStartTime()) : 0;
779  {
780  // See if this show is far enough into the future that it's
781  // probable that the user wanted to schedule it to record
782  // instead of changing the channel.
783  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
784  ((secsTillStart / 60) >= m_selectRecThreshold))
785  {
786  EditRecording();
787  }
788  else
789  {
790  enter();
791  }
792  }
793  else
794  {
795  // Edit Recording should include "Watch this channel"
796  // is we selected a show that is current.
799  && (secsTillStart / 60) < m_selectRecThreshold);
800  }
801  }
802  else if (action == "EDIT")
803  EditScheduled();
804  else if (action == "CUSTOMEDIT")
805  EditCustom();
806  else if (action == "DELETE")
807  deleteRule();
808  else if (action == "UPCOMING")
809  ShowUpcoming();
810  else if (action == "PREVRECORDED")
811  ShowPrevious();
812  else if (action == "DETAILS" || action == "INFO")
813  ShowDetails();
814  else if (action == ACTION_TOGGLERECORD)
815  QuickRecord();
816  else if (action == ACTION_TOGGLEFAV)
817  {
818  if (m_changrpid == -1)
819  ChannelGroupMenu(0);
820  else
822  }
823  else if (action == "CHANUPDATE")
824  channelUpdate();
825  else if (action == ACTION_VOLUMEUP)
826  volumeUpdate(true);
827  else if (action == ACTION_VOLUMEDOWN)
828  volumeUpdate(false);
829  else if (action == "CYCLEAUDIOCHAN")
830  toggleMute(true);
831  else if (action == ACTION_MUTEAUDIO)
832  toggleMute();
833  else if (action == ACTION_TOGGLEPGORDER)
834  {
837  updateChannels();
838  }
839  else
840  handled = false;
841  }
842 
843  if (!handled && MythScreenType::keyPressEvent(event))
844  handled = true;
845 
846  return handled;
847 }
848 
850 {
851  bool handled = true;
852 
853  if (!event)
854  {
855  LOG(VB_GENERAL, LOG_INFO, LOC + "Guide Gesture no event");
856  return false;
857  }
858 
859  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture event %1")
860  .arg((QString)event->gesture()));
861  switch (event->gesture())
862  {
864  {
865  handled = false;
866 
867  // We want the relative position of the click
868  QPoint position = event->GetPosition();
869  if (m_parent)
870  position -= m_parent->GetArea().topLeft();
871 
872  MythUIType *type = GetChildAt(position, false, false);
873 
874  if (!type)
875  return false;
876 
877  auto *object = dynamic_cast<MythUIStateType *>(type);
878 
879  if (object)
880  {
881  QString name = object->objectName();
882  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click name %1").arg(name));
883 
884  if (name.startsWith("channellist"))
885  {
886  auto* channelList = dynamic_cast<MythUIButtonList*>(object);
887 
888  if (channelList)
889  {
890  handled = channelList->gestureEvent(event);
891  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click channel list %1").arg(handled));
892  }
893  }
894  else if (name.startsWith("guidegrid"))
895  {
896  auto* guidegrid = dynamic_cast<MythUIGuideGrid*>(object);
897 
898  if (guidegrid)
899  {
900  handled = true;
901 
902  QPoint rowCol = guidegrid->GetRowAndColumn(position - guidegrid->GetArea().topLeft());
903 
904  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg %1,%2 (%3,%4)")
905  .arg(rowCol.y())
906  .arg(rowCol.x())
907  .arg(m_currentRow)
908  .arg(m_currentCol)
909  );
910  if ((rowCol.y() >= 0) && (rowCol.x() >= 0))
911  {
912  if ((rowCol.y() == m_currentRow) && (rowCol.x() == m_currentCol))
913  {
915  {
916  // See if this show is far enough into the future that it's
917  // probable that the user wanted to schedule it to record
918  // instead of changing the channel.
919  ProgramInfo *pginfo =
921  int secsTillStart =
922  (pginfo) ? MythDate::current().secsTo(
923  pginfo->GetScheduledStartTime()) : 0;
924  if (pginfo && (pginfo->GetTitle() != kUnknownTitle) &&
925  ((secsTillStart / 60) >= m_selectRecThreshold))
926  {
927  //EditRecording();
928  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg EditRec"));
929  }
930  else
931  {
932  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg enter"));
933  enter();
934  }
935  }
936  else
937  {
938  //EditRecording();
939  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Guide Gesture Click gg not live"));
940  }
941  }
942  else
943  {
944  bool rowChanged = (rowCol.y() != m_currentRow);
945  bool colChanged = (rowCol.x() != m_currentCol);
946  if (rowChanged)
948 
949  m_currentRow = rowCol.y();
950  m_currentCol = rowCol.x();
951 
953  if (colChanged)
954  {
955  m_currentStartTime = m_programInfos[m_currentRow][m_currentCol]->GetScheduledStartTime();
956  fillTimeInfos();
957  }
958  if (rowChanged)
959  updateChannels();
960  if (colChanged)
961  updateDateText();
962  }
963  }
964  }
965  }
966 
967  }
968  }
969  break;
970 
972  if (m_verticalLayout)
973  cursorLeft();
974  else
975  cursorUp();
976  break;
977 
979  if (m_verticalLayout)
980  cursorRight();
981  else
982  cursorDown();
983  break;
984 
986  if (m_verticalLayout)
987  cursorUp();
988  else
989  cursorLeft();
990  break;
991 
993  if (m_verticalLayout)
994  cursorDown();
995  else
996  cursorRight();
997  break;
998 
1000  if (m_verticalLayout)
1002  else
1004  break;
1005 
1007  if (m_verticalLayout)
1009  else
1011  break;
1012 
1014  if (m_verticalLayout)
1016  else
1018  break;
1019 
1021  if (m_verticalLayout)
1023  else
1025  break;
1026 
1029  break;
1030 
1033  break;
1034 
1036  enter();
1037  break;
1038 
1039  default:
1040  handled = false;
1041  break;
1042  }
1043 
1044  if (!handled && MythScreenType::gestureEvent(event))
1045  handled = true;
1046 
1047  return handled;
1048 }
1049 
1050 static bool SelectionIsTunable(const ChannelInfoList &selection)
1051 {
1052  for (const auto & chan : selection)
1053  {
1054  if (TV::IsTunable(chan.m_chanId))
1055  return true;
1056  }
1057  return false;
1058 }
1059 
1061 {
1062  QString label = tr("Guide Options");
1063 
1064  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1065  auto *menuPopup = new MythDialogBox(label, popupStack, "guideMenuPopup");
1066 
1067  if (menuPopup->Create())
1068  {
1069  menuPopup->SetReturnEvent(this, "guidemenu");
1070 
1072  menuPopup->AddButton(tr("Change to Channel"));
1073  else if (!m_player && SelectionIsTunable(GetSelection()))
1074  menuPopup->AddButton(tr("Watch This Channel"));
1075 
1076  menuPopup->AddButton(tr("Record This"));
1077 
1078  menuPopup->AddButton(tr("Recording Options"), nullptr, true);
1079 
1080  menuPopup->AddButton(tr("Program Details"));
1081 
1082  menuPopup->AddButton(tr("Jump to Time"), nullptr, true);
1083 
1084  menuPopup->AddButton(tr("Reverse Channel Order"));
1085 
1086  menuPopup->AddButton(tr("Channel Search"));
1087 
1088  if (!m_changrplist.empty())
1089  {
1090  menuPopup->AddButton(tr("Choose Channel Group"));
1091 
1092  if (m_changrpid == -1)
1093  menuPopup->AddButton(tr("Add To Channel Group"), nullptr, true);
1094  else
1095  menuPopup->AddButton(tr("Remove from Channel Group"), nullptr, true);
1096  }
1097 
1098  popupStack->AddScreen(menuPopup);
1099  }
1100  else
1101  {
1102  delete menuPopup;
1103  }
1104 }
1105 
1107 {
1108  QString label = tr("Recording Options");
1109 
1110  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1111  auto *menuPopup = new MythDialogBox(label, popupStack, "recMenuPopup");
1112 
1113  if (menuPopup->Create())
1114  {
1115  menuPopup->SetReturnEvent(this, "recmenu");
1116 
1118 
1119  if (pginfo && pginfo->GetRecordingRuleID())
1120  menuPopup->AddButton(tr("Edit Recording Status"));
1121  menuPopup->AddButton(tr("Edit Schedule"));
1122  menuPopup->AddButton(tr("Show Upcoming"));
1123  menuPopup->AddButton(tr("Previously Recorded"));
1124  menuPopup->AddButton(tr("Custom Edit"));
1125 
1126  if (pginfo && pginfo->GetRecordingRuleID())
1127  menuPopup->AddButton(tr("Delete Rule"));
1128 
1129  popupStack->AddScreen(menuPopup);
1130  }
1131  else
1132  {
1133  delete menuPopup;
1134  }
1135 }
1136 
1138 {
1139  sel = (sel >= 0) ? sel : m_channelInfoIdx[chan_idx];
1140 
1141  if (chan_idx >= GetChannelCount())
1142  return nullptr;
1143 
1144  if (sel >= (int) m_channelInfos[chan_idx].size())
1145  return nullptr;
1146 
1147  return &(m_channelInfos[chan_idx][sel]);
1148 }
1149 
1150 const ChannelInfo *GuideGrid::GetChannelInfo(uint chan_idx, int sel) const
1151 {
1152  return ((GuideGrid*)this)->GetChannelInfo(chan_idx, sel);
1153 }
1154 
1156 {
1157  return m_channelInfos.size();
1158 }
1159 
1161 {
1162  uint cnt = GetChannelCount();
1163  if (!cnt)
1164  return -1;
1165 
1166  row = (row < 0) ? m_currentRow : row;
1167  return (row + m_currentStartChannel) % cnt;
1168 }
1169 
1171 {
1172  ProgramList proglist;
1173  MSqlBindings bindings;
1174  QString querystr =
1175  "WHERE program.chanid = :CHANID AND "
1176  " program.endtime >= :STARTTS AND "
1177  " program.starttime <= :ENDTS AND "
1178  " program.starttime >= :STARTLIMITTS AND "
1179  " program.manualid = 0 ";
1180  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1181  bindings[":STARTTS"] = starttime;
1182  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1183  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1184  bindings[":CHANID"] = chanid;
1185 
1186  ProgramList dummy;
1187  LoadFromProgram(proglist, querystr, bindings, dummy);
1188 
1189  return proglist;
1190 }
1191 
1193 {
1194  if (!proglist)
1195  return nullptr;
1196  auto *result = new ProgramList();
1197  for (auto & pi : *proglist)
1198  result->push_back(new ProgramInfo(*pi));
1199  return result;
1200 }
1201 
1203  uint chan_idx, bool with_same_channum) const
1204 {
1205  uint si = m_channelInfoIdx[chan_idx];
1206  const ChannelInfo *chinfo = GetChannelInfo(chan_idx, si);
1207 
1208  PlayerContext *ctx = m_player->GetPlayerReadLock(-1, __FILE__, __LINE__);
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(ctx, 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 
1254  m_player->ReturnPlayerLock(ctx);
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) 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  static QMutex s_chanSepRegExpLock;
1426  static QRegExp s_chanSepRegExp(ChannelUtil::kATSCSeparators);
1427 
1428  // first check chanid
1429  uint i = (chanid) ? 0 : GetChannelCount();
1430  for (; i < GetChannelCount(); ++i)
1431  {
1432  if (m_channelInfos[i][0].m_chanId == chanid)
1433  return i;
1434  }
1435 
1436  // then check for chanid in duplicates
1437  i = (chanid) ? 0 : GetChannelCount();
1438  for (; i < GetChannelCount(); ++i)
1439  {
1440  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1441  {
1442  if (m_channelInfos[i][j].m_chanId == chanid)
1443  return i;
1444  }
1445  }
1446 
1447  // then check channum, first only
1448  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1449  for (; i < GetChannelCount(); ++i)
1450  {
1451  if (m_channelInfos[i][0].m_chanNum == channum)
1452  return i;
1453  }
1454 
1455  // then check channum duplicates
1456  i = (channum.isEmpty()) ? GetChannelCount() : 0;
1457  for (; i < GetChannelCount(); ++i)
1458  {
1459  for (size_t j = 1; j < m_channelInfos[i].size(); ++j)
1460  {
1461  if (m_channelInfos[i][j].m_chanNum == channum)
1462  return i;
1463  }
1464  }
1465 
1466  if (exact || channum.isEmpty())
1467  return -1;
1468 
1469  ChannelInfoList list;
1470  QVector<int> idxList;
1471  for (i = 0; i < GetChannelCount(); ++i)
1472  {
1473  for (size_t j = 0; j < m_channelInfos[i].size(); ++j)
1474  {
1475  list.push_back(m_channelInfos[i][j]);
1476  idxList.push_back(i);
1477  }
1478  }
1479  int result = ChannelUtil::GetNearestChannel(list, channum);
1480  if (result >= 0)
1481  result = idxList[result];
1482  return result;
1483 }
1484 
1486 {
1487  m_timeList->Reset();
1488 
1489  QDateTime starttime = m_currentStartTime;
1490 
1492  m_lastTime = m_firstTime.addSecs(m_timeCount * 60 * 4);
1493 
1494  for (int x = 0; x < m_timeCount; ++x)
1495  {
1496  int mins = starttime.time().minute();
1497  mins = 5 * (mins / 5);
1498  if (mins % 30 == 0)
1499  {
1500  QString timeStr = MythDate::toString(starttime, MythDate::kTime);
1501 
1502  InfoMap infomap;
1503  infomap["starttime"] = timeStr;
1504 
1505  QDateTime endtime = starttime.addSecs(60 * 30);
1506 
1507  infomap["endtime"] = MythDate::toString(endtime, MythDate::kTime);
1508 
1509  auto *item = new MythUIButtonListItem(m_timeList, timeStr);
1510 
1511  item->SetTextFromMap(infomap);
1512  }
1513 
1514  starttime = starttime.addSecs(5 * 60);
1515  }
1516  m_currentEndTime = starttime;
1517 }
1518 
1519 void GuideGrid::fillProgramInfos(bool useExistingData)
1520 {
1521  fillProgramRowInfos(-1, useExistingData);
1522 }
1523 
1525 {
1526  auto *proglist = new ProgramList();
1527 
1528  if (proglist)
1529  {
1530  MSqlBindings bindings;
1531  QString querystr = "WHERE program.chanid = :CHANID "
1532  " AND program.endtime >= :STARTTS "
1533  " AND program.starttime <= :ENDTS "
1534  " AND program.starttime >= :STARTLIMITTS "
1535  " AND program.manualid = 0 ";
1536  QDateTime starttime = m_currentStartTime.addSecs(0 - m_currentStartTime.time().second());
1537  bindings[":CHANID"] = GetChannelInfo(chanNum)->m_chanId;
1538  bindings[":STARTTS"] = starttime;
1539  bindings[":STARTLIMITTS"] = starttime.addDays(-1);
1540  bindings[":ENDTS"] = m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
1541 
1542  LoadFromProgram(*proglist, querystr, bindings, m_recList);
1543  }
1544 
1545  return proglist;
1546 }
1547 
1548 void GuideGrid::fillProgramRowInfos(int firstRow, bool useExistingData)
1549 {
1550  bool allRows = false;
1551  unsigned int numRows = 1;
1552  if (firstRow < 0)
1553  {
1554  firstRow = 0;
1555  allRows = true;
1556  numRows = min((unsigned int)m_channelInfos.size(),
1557  (unsigned int)m_guideGrid->getChannelCount());
1558  }
1559  QVector<int> chanNums;
1560  QVector<ProgramList*> proglists;
1561 
1562  for (unsigned int i = 0; i < numRows; ++i)
1563  {
1564  unsigned int row = i + firstRow;
1565  // never divide by zero..
1567  return;
1568 
1569  for (int x = 0; x < m_timeCount; ++x)
1570  {
1571  m_programInfos[row][x] = nullptr;
1572  }
1573 
1574  if (m_channelInfos.empty())
1575  return;
1576 
1577  int chanNum = row + m_currentStartChannel;
1578  if (chanNum >= (int) m_channelInfos.size())
1579  chanNum -= (int) m_channelInfos.size();
1580  if (chanNum >= (int) m_channelInfos.size())
1581  return;
1582 
1583  if (chanNum < 0)
1584  chanNum = 0;
1585 
1586  ProgramList *proglist = nullptr;
1587  if (useExistingData)
1588  proglist = CopyProglist(m_programs[row]);
1589  chanNums.push_back(chanNum);
1590  proglists.push_back(proglist);
1591  }
1592  if (allRows)
1593  {
1594  for (unsigned int i = numRows;
1595  i < (unsigned int) m_guideGrid->getChannelCount(); ++i)
1596  {
1597  delete m_programs[i];
1598  m_programs[i] = nullptr;
1599  m_guideGrid->ResetRow(i);
1600  }
1601  }
1602 
1604 
1605  GuideStatus gs(firstRow, chanNums.size(), chanNums,
1610  auto *updater = new GuideUpdateProgramRow(this, gs, proglists);
1611  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
1612 }
1613 
1615  const QDateTime& start,
1616  ProgramList *proglist)
1617 {
1618  if (row < 0 || row >= m_channelCount ||
1619  start != m_currentStartTime)
1620  {
1621  delete proglist;
1622  return;
1623  }
1624 
1625  QDateTime ts = m_currentStartTime;
1626 
1627  QDateTime tnow = MythDate::current();
1628  int progPast = 0;
1629  if (tnow > m_currentEndTime)
1630  progPast = 100;
1631  else if (tnow < m_currentStartTime)
1632  progPast = 0;
1633  else
1634  {
1635  int played = m_currentStartTime.secsTo(tnow);
1636  int length = m_currentStartTime.secsTo(m_currentEndTime);
1637  if (length)
1638  progPast = played * 100 / length;
1639  }
1640 
1641  m_progPast = progPast;
1642 
1643  auto program = proglist->begin();
1644  vector<ProgramInfo*> unknownlist;
1645  bool unknown = false;
1646  ProgramInfo *proginfo = nullptr;
1647  for (int x = 0; x < m_timeCount; ++x)
1648  {
1649  if (program != proglist->end() &&
1650  (ts >= (*program)->GetScheduledEndTime()))
1651  {
1652  ++program;
1653  }
1654 
1655  if ((program == proglist->end()) ||
1656  (ts < (*program)->GetScheduledStartTime()))
1657  {
1658  if (unknown)
1659  {
1660  if (proginfo)
1661  {
1662  proginfo->m_spread++;
1663  proginfo->SetScheduledEndTime(proginfo->GetScheduledEndTime().addSecs(5 * 60));
1664  }
1665  }
1666  else
1667  {
1668  proginfo = new ProgramInfo(kUnknownTitle,
1669  GuideGrid::tr("Unknown", "Unknown program title"),
1670  ts, ts.addSecs(5*60));
1671  unknownlist.push_back(proginfo);
1672  proginfo->m_startCol = x;
1673  proginfo->m_spread = 1;
1674  unknown = true;
1675  }
1676  }
1677  else
1678  {
1679  if (proginfo && proginfo == *program)
1680  {
1681  proginfo->m_spread++;
1682  }
1683  else
1684  {
1685  proginfo = *program;
1686  if (proginfo)
1687  {
1688  proginfo->m_startCol = x;
1689  proginfo->m_spread = 1;
1690  unknown = false;
1691  }
1692  }
1693  }
1694  m_programInfos[row][x] = proginfo;
1695  ts = ts.addSecs(5 * 60);
1696  }
1697 
1698  for (auto & pi : unknownlist)
1699  proglist->push_back(pi);
1700 
1701  MythRect programRect = m_ggProgramRect;
1702 
1704  double ydifference = 0.0;
1705  double xdifference = 0.0;
1706 
1707  if (m_verticalLayout)
1708  {
1709  ydifference = programRect.width() /
1710  (double) m_ggChannelCount;
1711  xdifference = programRect.height() /
1712  (double) m_timeCount;
1713  }
1714  else
1715  {
1716  ydifference = programRect.height() /
1717  (double) m_ggChannelCount;
1718  xdifference = programRect.width() /
1719  (double) m_timeCount;
1720  }
1721 
1722  int arrow = GridTimeNormal;
1723  int cnt = 0;
1724  int8_t spread = 1;
1725  QDateTime lastprog;
1726  QRect tempRect;
1727  bool isCurrent = false;
1728 
1729  for (int x = 0; x < m_timeCount; ++x)
1730  {
1731  ProgramInfo *pginfo = m_programInfos[row][x];
1732  if (!pginfo)
1733  continue;
1734 
1735  spread = 1;
1736  if (pginfo->GetScheduledStartTime() != lastprog)
1737  {
1738  arrow = GridTimeNormal;
1739  if (pginfo->GetScheduledStartTime() < m_firstTime.addSecs(-300))
1740  arrow |= GridTimeStartsBefore;
1741  if (pginfo->GetScheduledEndTime() > m_lastTime.addSecs(2100))
1742  arrow |= GridTimeEndsAfter;
1743 
1744  if (pginfo->m_spread != -1)
1745  {
1746  spread = pginfo->m_spread;
1747  }
1748  else
1749  {
1750  for (int z = x + 1; z < m_timeCount; ++z)
1751  {
1752  ProgramInfo *test = m_programInfos[row][z];
1753  if (test && (test->GetScheduledStartTime() ==
1754  pginfo->GetScheduledStartTime()))
1755  spread++;
1756  }
1757  pginfo->m_spread = spread;
1758  pginfo->m_startCol = x;
1759 
1760  for (int z = x + 1; z < x + spread; ++z)
1761  {
1762  ProgramInfo *test = m_programInfos[row][z];
1763  if (test)
1764  {
1765  test->m_spread = spread;
1766  test->m_startCol = x;
1767  }
1768  }
1769  }
1770 
1771  if (m_verticalLayout)
1772  {
1773  tempRect = QRect((int)(row * ydifference),
1774  (int)(x * xdifference),
1775  (int)(ydifference),
1776  (int)(xdifference * pginfo->m_spread));
1777  }
1778  else
1779  {
1780  tempRect = QRect((int)(x * xdifference),
1781  (int)(row * ydifference),
1782  (int)(xdifference * pginfo->m_spread),
1783  (int)ydifference);
1784  }
1785 
1786  // snap to right edge for last entry.
1787  if (tempRect.right() + 2 >= programRect.width())
1788  tempRect.setRight(programRect.width());
1789  if (tempRect.bottom() + 2 >= programRect.bottom())
1790  tempRect.setBottom(programRect.bottom());
1791 
1792  isCurrent = m_currentRow == row && (m_currentCol >= x) &&
1793  (m_currentCol < (x + spread));
1794 
1795  int recFlag = 0;
1796  switch (pginfo->GetRecordingRuleType())
1797  {
1798  case kSingleRecord:
1799  recFlag = 1;
1800  break;
1801  case kDailyRecord:
1802  recFlag = 2;
1803  break;
1804  case kAllRecord:
1805  recFlag = 4;
1806  break;
1807  case kWeeklyRecord:
1808  recFlag = 5;
1809  break;
1810  case kOneRecord:
1811  recFlag = 6;
1812  break;
1813  case kOverrideRecord:
1814  case kDontRecord:
1815  recFlag = 7;
1816  break;
1817  case kNotRecording:
1818  default:
1819  recFlag = 0;
1820  break;
1821  }
1822 
1823  int recStat = 0;
1824  if (pginfo->GetRecordingStatus() == RecStatus::Conflict ||
1826  recStat = 2;
1827  else if (pginfo->GetRecordingStatus() <= RecStatus::WillRecord)
1828  recStat = 1;
1829  else
1830  recStat = 0;
1831 
1832  QString title = (pginfo->GetTitle() == kUnknownTitle) ?
1833  GuideGrid::tr("Unknown", "Unknown program title") :
1834  pginfo->GetTitle();
1835  m_result.push_back(GuideUIElement(
1836  row, cnt, tempRect, title,
1837  pginfo->GetCategory(), arrow, recFlag,
1838  recStat, isCurrent));
1839 
1840  cnt++;
1841  }
1842 
1843  lastprog = pginfo->GetScheduledStartTime();
1844  }
1845 }
1846 
1847 void GuideGrid::customEvent(QEvent *event)
1848 {
1849  if (event->type() == MythEvent::MythEventMessage)
1850  {
1851  auto *me = dynamic_cast<MythEvent *>(event);
1852  if (me == nullptr)
1853  return;
1854 
1855  const QString& message = me->Message();
1856 
1857  if (message == "SCHEDULE_CHANGE")
1858  {
1859  GuideHelper::Wait(this);
1861  fillProgramInfos();
1862  }
1863  else if (message == "STOP_VIDEO_REFRESH_TIMER")
1864  {
1866  }
1867  else if (message == "START_VIDEO_REFRESH_TIMER")
1868  {
1869  m_previewVideoRefreshTimer->start(66);
1870  }
1871  }
1872  else if (event->type() == DialogCompletionEvent::kEventType)
1873  {
1874  auto *dce = (DialogCompletionEvent*)(event);
1875 
1876  QString resultid = dce->GetId();
1877  QString resulttext = dce->GetResultText();
1878  int buttonnum = dce->GetResult();
1879 
1880  if (resultid == "deleterule")
1881  {
1882  auto *record = dce->GetData().value<RecordingRule *>();
1883  if (record)
1884  {
1885  if ((buttonnum > 0) && !record->Delete())
1886  LOG(VB_GENERAL, LOG_ERR, "Failed to delete recording rule");
1887  delete record;
1888  }
1889  }
1890  // Test for this here because it can come from
1891  // different menus.
1892  else if (resulttext == tr("Watch This Channel"))
1893  {
1894  ChannelInfoList selection = GetSelection();
1895  if (SelectionIsTunable(selection))
1896  TV::StartTV(nullptr, kStartTVNoFlags, selection);
1897  }
1898  else if (resultid == "guidemenu")
1899  {
1900  if (resulttext == tr("Record This"))
1901  {
1902  QuickRecord();
1903  }
1904  else if (resulttext == tr("Change to Channel"))
1905  {
1906  enter();
1907  }
1908  else if (resulttext == tr("Program Details"))
1909  {
1910  ShowDetails();
1911  }
1912  else if (resulttext == tr("Reverse Channel Order"))
1913  {
1915  generateListings();
1916  updateChannels();
1917  }
1918  else if (resulttext == tr("Channel Search"))
1919  {
1921  }
1922  else if (resulttext == tr("Add To Channel Group"))
1923  {
1924  if (m_changrpid == -1)
1925  ChannelGroupMenu(0);
1926  }
1927  else if (resulttext == tr("Remove from Channel Group"))
1928  {
1930  }
1931  else if (resulttext == tr("Choose Channel Group"))
1932  {
1933  ChannelGroupMenu(1);
1934  }
1935  else if (resulttext == tr("Recording Options"))
1936  {
1938  }
1939  else if (resulttext == tr("Jump to Time"))
1940  {
1941  ShowJumpToTime();
1942  }
1943  }
1944  else if (resultid == "recmenu")
1945  {
1946  if (resulttext == tr("Edit Recording Status"))
1947  {
1948  EditRecording();
1949  }
1950  else if (resulttext == tr("Edit Schedule"))
1951  {
1952  EditScheduled();
1953  }
1954  else if (resulttext == tr("Show Upcoming"))
1955  {
1956  ShowUpcoming();
1957  }
1958  else if (resulttext == tr("Previously Recorded"))
1959  {
1960  ShowPrevious();
1961  }
1962  else if (resulttext == tr("Custom Edit"))
1963  {
1964  EditCustom();
1965  }
1966  else if (resulttext == tr("Delete Rule"))
1967  {
1968  deleteRule();
1969  }
1970 
1971  }
1972  else if (resultid == "channelgrouptogglemenu")
1973  {
1974  int changroupid = ChannelGroup::GetChannelGroupId(resulttext);
1975 
1976  if (changroupid > 0)
1977  toggleChannelFavorite(changroupid);
1978  }
1979  else if (resultid == "channelgroupmenu")
1980  {
1981  if (buttonnum >= 0)
1982  {
1983  int changroupid = -1;
1984 
1985  if (resulttext == QObject::tr("All Channels"))
1986  changroupid = -1;
1987  else
1988  changroupid = ChannelGroup::GetChannelGroupId(resulttext);
1989 
1990  m_changrpid = changroupid;
1991  generateListings();
1992  updateChannels();
1993  updateInfo();
1994 
1995  QString changrpname;
1997 
1998  if (m_changroupname)
1999  m_changroupname->SetText(changrpname);
2000  }
2001  }
2002  else if (resultid == "jumptotime")
2003  {
2004  QDateTime datetime = dce->GetData().toDateTime();
2005  moveToTime(datetime);
2006  }
2007  else
2009  }
2010  else if (event->type() == UpdateGuideEvent::kEventType)
2011  {
2012  auto *uge = dynamic_cast<UpdateGuideEvent*>(event);
2013  if (uge && uge->m_updater)
2014  {
2015  uge->m_updater->ExecuteUI();
2016  delete uge->m_updater;
2017  uge->m_updater = nullptr;
2018  }
2019  }
2020 }
2021 
2023 {
2024  if (m_dateText)
2026  if (m_longdateText)
2029 }
2030 
2031 void GuideGrid::updateProgramsUI(unsigned int firstRow, unsigned int numRows,
2032  int progPast,
2033  const QVector<ProgramList*> &proglists,
2034  const ProgInfoGuideArray &programInfos,
2035  const QLinkedList<GuideUIElement> &elements)
2036 {
2037  for (unsigned int i = 0; i < numRows; ++i)
2038  {
2039  unsigned int row = i + firstRow;
2040  m_guideGrid->ResetRow(row);
2041  if (m_programs[row] != proglists[i])
2042  {
2043  delete m_programs[row];
2044  m_programs[row] = proglists[i];
2045  }
2046  }
2047  m_guideGrid->SetProgPast(progPast);
2048  for (const auto & r : qAsConst(elements))
2049  {
2050  m_guideGrid->SetProgramInfo(r.m_row, r.m_col, r.m_area, r.m_title,
2051  r.m_category, r.m_arrow, r.m_recType,
2052  r.m_recStat, r.m_selected);
2053  }
2054  for (unsigned int i = firstRow; i < firstRow + numRows; ++i)
2055  {
2056  for (int j = 0; j < MAX_DISPLAY_TIMES; ++j)
2057  m_programInfos[i][j] = programInfos[i][j];
2058  if (i == (unsigned int)m_currentRow)
2059  updateInfo();
2060  }
2062 }
2063 
2065 {
2066  auto *updater = new GuideUpdateChannels(this, m_currentStartChannel);
2067  m_threadPool.start(new GuideHelper(this, updater), "GuideHelper");
2068 }
2069 
2070 void GuideGrid::updateChannelsNonUI(QVector<ChannelInfo *> &chinfos,
2071  QVector<bool> &unavailables)
2072 {
2074 
2075  for (unsigned int y = 0; (y < (unsigned int)m_channelCount) && chinfo; ++y)
2076  {
2077  unsigned int chanNumber = y + m_currentStartChannel;
2078  if (chanNumber >= m_channelInfos.size())
2079  chanNumber -= m_channelInfos.size();
2080  if (chanNumber >= m_channelInfos.size())
2081  break;
2082 
2083  chinfo = GetChannelInfo(chanNumber);
2084 
2085  bool unavailable = false;
2086  bool try_alt = false;
2087 
2088  if (m_player)
2089  {
2091  -1, __FILE__, __LINE__);
2092  if (ctx && chinfo)
2093  try_alt = !TV::IsTunable(ctx, chinfo->m_chanId);
2094  m_player->ReturnPlayerLock(ctx);
2095  }
2096 
2097  if (try_alt)
2098  {
2099  unavailable = true;
2100 
2101  // Try alternates with same channum if applicable
2102  uint alt = GetAlternateChannelIndex(chanNumber, true);
2103  if (alt != m_channelInfoIdx[chanNumber])
2104  {
2105  unavailable = false;
2106  m_channelInfoIdx[chanNumber] = alt;
2107  chinfo = GetChannelInfo(chanNumber);
2108  }
2109 
2110  // Try alternates with different channum if applicable
2111  if (unavailable && chinfo &&
2112  !GetProgramList(chinfo->m_chanId).empty())
2113  {
2114  alt = GetAlternateChannelIndex(chanNumber, false);
2115  unavailable = (alt == m_channelInfoIdx[chanNumber]);
2116  }
2117  }
2118  chinfos.push_back(chinfo);
2119  unavailables.push_back(unavailable);
2120  }
2121 }
2122 
2123 void GuideGrid::updateChannelsUI(const QVector<ChannelInfo *> &chinfos,
2124  const QVector<bool> &unavailables)
2125 {
2126  m_channelList->Reset();
2127  for (int i = 0; i < chinfos.size(); ++i)
2128  {
2129  ChannelInfo *chinfo = chinfos[i];
2130  bool unavailable = unavailables[i];
2131  auto *item = new MythUIButtonListItem(m_channelList,
2132  chinfo ? chinfo->GetFormatted(ChannelInfo::kChannelShort) : QString());
2133 
2134  QString state = "available";
2135  if (unavailable)
2136  state = (m_changrpid == -1) ? "unavailable" : "favunavailable";
2137  else
2138  state = (m_changrpid == -1) ? "available" : "favourite";
2139 
2140  item->SetFontState(state);
2141  item->DisplayState(state, "chanstatus");
2142 
2143  if (chinfo)
2144  {
2145  InfoMap infomap;
2146  chinfo->ToMap(infomap);
2147  item->SetTextFromMap(infomap);
2148 
2149  if (!chinfo->m_icon.isEmpty())
2150  {
2151  QString iconurl =
2152  gCoreContext->GetMasterHostPrefix("ChannelIcons",
2153  chinfo->m_icon);
2154  item->SetImage(iconurl, "channelicon");
2155  }
2156  }
2157  }
2159 }
2160 
2162 {
2163  if (m_currentRow < 0 || m_currentCol < 0)
2164  return;
2165 
2167  if (!pginfo)
2168  return;
2169 
2170  InfoMap infoMap;
2171 
2172  int chanNum = m_currentRow + m_currentStartChannel;
2173  if (chanNum >= (int)m_channelInfos.size())
2174  chanNum -= (int)m_channelInfos.size();
2175  if (chanNum >= (int)m_channelInfos.size())
2176  return;
2177  if (chanNum < 0)
2178  chanNum = 0;
2179 
2180  ChannelInfo *chinfo = GetChannelInfo(chanNum);
2181 
2182  if (m_channelImage)
2183  {
2184  m_channelImage->Reset();
2185  if (!chinfo->m_icon.isEmpty())
2186  {
2187  QString iconurl = gCoreContext->GetMasterHostPrefix("ChannelIcons",
2188  chinfo->m_icon);
2189 
2190  m_channelImage->SetFilename(iconurl);
2191  m_channelImage->Load();
2192  }
2193  }
2194 
2195  chinfo->ToMap(infoMap);
2196  pginfo->ToMap(infoMap);
2197  // HACK - This should be done in ProgramInfo, but that needs more careful
2198  // review since it may have unintended consequences so we're doing it here
2199  // for now
2200  if (infoMap["title"] == kUnknownTitle)
2201  {
2202  infoMap["title"] = tr("Unknown", "Unknown program title");
2203  infoMap["titlesubtitle"] = tr("Unknown", "Unknown program title");
2204  }
2205 
2206  SetTextFromMap(infoMap);
2207 
2208  MythUIStateType *ratingState = dynamic_cast<MythUIStateType*>
2209  (GetChild("ratingstate"));
2210  if (ratingState)
2211  {
2212  QString rating = QString::number(pginfo->GetStars(10));
2213  ratingState->DisplayState(rating);
2214  }
2216 }
2217 
2219 {
2220  int oldchangrpid = m_changrpid;
2221 
2223 
2224  if (oldchangrpid != m_changrpid)
2225  generateListings();
2226 
2227  updateChannels();
2228  updateInfo();
2229 
2230  QString changrpname = ChannelGroup::GetChannelGroupName(m_changrpid);
2231 
2232  if (m_changroupname)
2233  m_changroupname->SetText(changrpname);
2234 }
2235 
2237 {
2239  m_currentRow = 0;
2240 
2241  int maxchannel = 0;
2242  fillChannelInfos();
2243  maxchannel = max((int)GetChannelCount() - 1, 0);
2244  m_channelCount = min(m_guideGrid->getChannelCount(), maxchannel + 1);
2245 
2247  fillProgramInfos();
2248 }
2249 
2251 {
2252  ChannelGroupList channels = ChannelGroup::GetChannelGroups(mode == 0);
2253 
2254  if (channels.empty())
2255  {
2256  QString message = tr("You don't have any channel groups defined");
2257 
2258  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2259 
2260  auto *okPopup = new MythConfirmationDialog(popupStack, message, false);
2261  if (okPopup->Create())
2262  popupStack->AddScreen(okPopup);
2263  else
2264  delete okPopup;
2265 
2266  return;
2267  }
2268 
2269  QString label = tr("Select Channel Group");
2270 
2271  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2272  auto *menuPopup = new MythDialogBox(label, popupStack, "menuPopup");
2273 
2274  if (menuPopup->Create())
2275  {
2276  if (mode == 0)
2277  {
2278  // add channel to group menu
2279  menuPopup->SetReturnEvent(this, "channelgrouptogglemenu");
2280  }
2281  else
2282  {
2283  // switch to channel group menu
2284  menuPopup->SetReturnEvent(this, "channelgroupmenu");
2285  menuPopup->AddButton(QObject::tr("All Channels"));
2286  }
2287 
2288  for (auto & channel : channels)
2289  {
2290  menuPopup->AddButton(channel.m_name);
2291  }
2292 
2293  popupStack->AddScreen(menuPopup);
2294  }
2295  else
2296  {
2297  delete menuPopup;
2298  }
2299 }
2300 
2302 {
2304 
2305  if (grpid == -1)
2306  {
2307  if (m_changrpid == -1)
2308  return;
2309  grpid = m_changrpid;
2310  }
2311 
2312  // Get current channel id, and make sure it exists...
2313  int chanNum = m_currentRow + m_currentStartChannel;
2314  if (chanNum >= (int)m_channelInfos.size())
2315  chanNum -= (int)m_channelInfos.size();
2316  if (chanNum >= (int)m_channelInfos.size())
2317  return;
2318  if (chanNum < 0)
2319  chanNum = 0;
2320 
2321  ChannelInfo *ch = GetChannelInfo(chanNum);
2322  uint chanid = ch->m_chanId;
2323 
2324  if (m_changrpid == -1)
2325  {
2326  // If currently viewing all channels, allow to add only not delete
2327  ChannelGroup::ToggleChannel(chanid, grpid, false);
2328  }
2329  else
2330  {
2331  // Only allow delete if viewing the favorite group in question
2332  ChannelGroup::ToggleChannel(chanid, grpid, true);
2333  }
2334 
2335  //regenerate the list of non empty group in case it did change
2337 
2338  // If viewing favorites, refresh because a channel was removed
2339  if (m_changrpid != -1)
2340  {
2341  generateListings();
2342  updateChannels();
2343  updateInfo();
2344  }
2345 }
2346 
2348 {
2350 
2351  if (!test)
2352  {
2354  return;
2355  }
2356 
2357  int8_t startCol = test->m_startCol;
2358  m_currentCol = startCol - 1;
2359 
2360  if (m_currentCol < 0)
2361  {
2362  m_currentCol = 0;
2364  }
2365  else
2366  {
2368  }
2369 }
2370 
2372 {
2374 
2375  if (!test)
2376  {
2378  return;
2379  }
2380 
2381  int8_t spread = test->m_spread;
2382  int8_t startCol = test->m_startCol;
2383 
2384  m_currentCol = startCol + spread;
2385 
2386  if (m_currentCol > m_timeCount - 1)
2387  {
2388  m_currentCol = m_timeCount - 1;
2390  }
2391  else
2392  {
2394  }
2395 }
2396 
2398 {
2399  m_currentRow++;
2400 
2401  if (m_currentRow > m_channelCount - 1)
2402  {
2405  }
2406  else
2407  {
2409  }
2410 }
2411 
2413 {
2414  m_currentRow--;
2415 
2416  if (m_currentRow < 0)
2417  {
2418  m_currentRow = 0;
2420  }
2421  else
2422  {
2424  }
2425 }
2426 
2428 {
2429  switch (movement)
2430  {
2431  case kScrollLeft :
2432  m_currentStartTime = m_currentStartTime.addSecs(-30 * 60);
2433  break;
2434  case kScrollRight :
2435  m_currentStartTime = m_currentStartTime.addSecs(30 * 60);
2436  break;
2437  case kPageLeft :
2438  m_currentStartTime = m_currentStartTime.addSecs(-5 * 60 * m_timeCount);
2439  break;
2440  case kPageRight :
2442  break;
2443  case kDayLeft :
2444  m_currentStartTime = m_currentStartTime.addSecs(-24 * 60 * 60);
2445  break;
2446  case kDayRight :
2447  m_currentStartTime = m_currentStartTime.addSecs(24 * 60 * 60);
2448  break;
2449  default :
2450  break;
2451  }
2452 
2453  fillTimeInfos();
2454  fillProgramInfos();
2455  updateDateText();
2456 }
2457 
2459 {
2460  switch (movement)
2461  {
2462  case kScrollDown :
2464  break;
2465  case kScrollUp :
2467  break;
2468  case kPageDown :
2470  break;
2471  case kPageUp :
2473  break;
2474  default :
2475  break;
2476  }
2477 
2478  fillProgramInfos();
2479  updateChannels();
2480 }
2481 
2482 void GuideGrid::moveToTime(const QDateTime& datetime)
2483 {
2484  if (!datetime.isValid())
2485  return;
2486 
2487  m_currentStartTime = datetime;
2488 
2489  fillTimeInfos();
2490  fillProgramInfos();
2491  updateDateText();
2492 }
2493 
2494 void GuideGrid::setStartChannel(int newStartChannel)
2495 {
2496  if (newStartChannel < 0)
2497  m_currentStartChannel = newStartChannel + GetChannelCount();
2498  else if (newStartChannel >= (int) GetChannelCount())
2499  m_currentStartChannel = newStartChannel - GetChannelCount();
2500  else
2501  m_currentStartChannel = newStartChannel;
2502 }
2503 
2505 {
2506  if (m_allowFinder)
2508 }
2509 
2511 {
2512  if (!m_player)
2513  return;
2514 
2515  m_updateTimer->stop();
2516 
2517  channelUpdate();
2518 
2519  // Don't perform transition effects when guide is being used during playback
2520  GetScreenStack()->PopScreen(this, false);
2521 
2522  epgIsVisibleCond.wakeAll();
2523 }
2524 
2526 {
2527  // HACK: Do not allow exit if we have a popup menu open, not convinced
2528  // that this is the right solution
2529  if (GetMythMainWindow()->GetStack("popup stack")->TotalScreens() > 0)
2530  return;
2531 
2532  m_updateTimer->stop();
2533 
2534  // don't fade the screen if we are returning to the player
2535  if (m_player)
2536  GetScreenStack()->PopScreen(this, false);
2537  else
2538  GetScreenStack()->PopScreen(this, true);
2539 
2540  epgIsVisibleCond.wakeAll();
2541 }
2542 
2544 {
2546 
2547  if (!pginfo || !pginfo->GetRecordingRuleID())
2548  return;
2549 
2550  auto *record = new RecordingRule();
2551  if (!record->LoadByProgram(pginfo))
2552  {
2553  delete record;
2554  return;
2555  }
2556 
2557  QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
2558  .arg(toString(pginfo->GetRecordingRuleType()));
2559 
2560  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2561 
2562  auto *okPopup = new MythConfirmationDialog(popupStack, message, true);
2563 
2564  okPopup->SetReturnEvent(this, "deleterule");
2565  okPopup->SetData(QVariant::fromValue(record));
2566 
2567  if (okPopup->Create())
2568  popupStack->AddScreen(okPopup);
2569  else
2570  delete okPopup;
2571 }
2572 
2574 {
2575  if (!m_player)
2576  return;
2577 
2578  ChannelInfoList sel = GetSelection();
2579 
2580  if (!sel.empty())
2581  {
2582  PlayerContext *ctx = m_player->GetPlayerReadLock(-1, __FILE__, __LINE__);
2583  m_player->ChangeChannel(ctx, sel);
2584  m_player->ReturnPlayerLock(ctx);
2585  }
2586 }
2587 
2589 {
2590  if (m_player)
2591  {
2592  PlayerContext *ctx = m_player->GetPlayerReadLock(-1, __FILE__, __LINE__);
2593  m_player->ChangeVolume(ctx, up);
2594  m_player->ReturnPlayerLock(ctx);
2595  }
2596 }
2597 
2598 void GuideGrid::toggleMute(const bool muteIndividualChannels)
2599 {
2600  if (m_player)
2601  {
2602  PlayerContext *ctx = m_player->GetPlayerReadLock(-1, __FILE__, __LINE__);
2603  m_player->ToggleMute(ctx, muteIndividualChannels);
2604  m_player->ReturnPlayerLock(ctx);
2605  }
2606 }
2607 
2608 void GuideGrid::GoTo(int start, int cur_row)
2609 {
2610  setStartChannel(start);
2611  m_currentRow = cur_row % m_channelCount;
2612  updateChannels();
2613  fillProgramInfos();
2615 }
2616 
2618 {
2619  QString txt;
2620  {
2621  QMutexLocker locker(&m_jumpToChannelLock);
2622  if (m_jumpToChannel)
2623  txt = m_jumpToChannel->GetEntry();
2624  }
2625 
2626  if (txt.isEmpty())
2627  return;
2628 
2629  if (m_jumpToText)
2630  m_jumpToText->SetText(txt);
2631 }
2632 
2634 {
2635  QMutexLocker locker(&m_jumpToChannelLock);
2636  m_jumpToChannel = ptr;
2637 
2638  if (!m_jumpToChannel)
2639  {
2640  if (m_jumpToText)
2641  m_jumpToText->Reset();
2642 
2643  updateDateText();
2644  }
2645 }
2646 
2648 {
2649  GetMythMainWindow()->GetPaintWindow()->clearMask();
2650 }
2651 
2653 {
2654  auto *me = new MythEvent("STOP_VIDEO_REFRESH_TIMER");
2655  QCoreApplication::postEvent(this, me);
2656 
2658  if (!m_usingNullVideo)
2659  {
2660  QRegion r1 = QRegion(m_area);
2661  QRegion r2 = QRegion(m_videoRect);
2662  GetMythMainWindow()->GetPaintWindow()->setMask(r1.xored(r2));
2663  }
2664  else
2665  {
2666  me = new MythEvent("START_VIDEO_REFRESH_TIMER");
2667  QCoreApplication::postEvent(this, me);
2668  }
2669 }
2670 
2672 {
2673  if (m_player && m_usingNullVideo)
2674  {
2676  }
2677 }
2678 
2680 {
2681  if (m_player)
2682  HideTVWindow();
2683 
2685 }
2686 
2688 {
2689  if (m_player)
2690  EmbedTVWindow();
2691 
2693 }
2694 
2696 {
2697  QString message = tr("Jump to a specific date and time in the guide");
2700 
2701  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2702  auto *timedlg = new MythTimeInputDialog(popupStack, message, flags);
2703 
2704  if (timedlg->Create())
2705  {
2706  timedlg->SetReturnEvent(this, "jumptotime");
2707  popupStack->AddScreen(timedlg);
2708  }
2709  else
2710  delete timedlg;
2711 }
ChannelInfo
Definition: channelinfo.h:34
has_action
static bool has_action(const QString &action, const QStringList &actions)
Definition: guidegrid.cpp:106
GuideGrid::ShowMenu
void ShowMenu(void) override
Definition: guidegrid.cpp:1060
MythUIGuideGrid::GetRowAndColumn
QPoint GetRowAndColumn(QPoint position)
Definition: mythuiguidegrid.cpp:660
GuideGrid::m_guideGrid
MythUIGuideGrid * m_guideGrid
Definition: guidegrid.h:289
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:1155
MythGestureEvent::Down
@ Down
Definition: mythgesture.h:50
MythGestureEvent::LeftThenUp
@ LeftThenUp
Definition: mythgesture.h:65
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:250
GuideUpdateChannels::ExecuteNonUI
bool ExecuteNonUI(void) override
Definition: guidegrid.cpp:331
MythScreenType::LoadInBackground
void LoadInBackground(const QString &message="")
Definition: mythscreentype.cpp:302
GuideGrid::m_selectRecThreshold
int m_selectRecThreshold
Definition: guidegrid.h:238
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:187
ACTION_UP
#define ACTION_UP
Definition: mythuiactions.h:16
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:304
GuideStatus::m_currentStartChannel
const uint m_currentStartChannel
Definition: guidegrid.cpp:221
GuideGrid::m_embedVideo
bool m_embedVideo
Definition: guidegrid.h:269
mythrect.h
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1417
mythevent.h
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:498
ProgramInfo::m_startCol
int8_t m_startCol
Definition: programinfo.h:817
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:80
tv.h
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:2458
GuideStatus::m_channelCount
const int m_channelCount
Definition: guidegrid.cpp:223
TV::StartTV
static bool StartTV(ProgramInfo *tvrec, uint flags, const ChannelInfoList &selection=ChannelInfoList())
returns true if the recording completed when exiting.
Definition: tv_play.cpp:278
GuideGrid::EmbedTVWindow
void EmbedTVWindow(void)
Definition: guidegrid.cpp:2652
MythTimeInputDialog::kHours
@ kHours
Definition: mythdialogbox.h:407
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:415
JumpToChannelListener::FindChannel
virtual int FindChannel(uint chanid, const QString &channum, bool exact=true) const =0
mythuitext.h
GuideGrid::channelUpdate
void channelUpdate()
Definition: guidegrid.cpp:2573
GuideUpdateProgramRow::m_currentStartTime
const QDateTime m_currentStartTime
Definition: guidegrid.cpp:308
GuideGrid::m_timeCount
int m_timeCount
Definition: guidegrid.h:261
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:880
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
GuideHelper::s_loading
static QMap< GuideGrid *, uint > s_loading
Definition: guidegrid.cpp:409
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:550
GuideGrid::m_changroupname
MythUIText * m_changroupname
Definition: guidegrid.h:293
ACTION_PAGERIGHT
#define ACTION_PAGERIGHT
Definition: tv_actions.h:12
JumpToChannel
Definition: guidegrid.h:51
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:849
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
ChannelInfo::kChannelShort
@ kChannelShort
Definition: channelinfo.h:51
ChannelInfo::m_chanId
uint m_chanId
Definition: channelinfo.h:87
ACTION_DOWN
#define ACTION_DOWN
Definition: mythuiactions.h:17
ChannelInfo::ToMap
void ToMap(InfoMap &infoMap)
Definition: channelinfo.cpp:215
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:2407
MythGestureEvent::Up
@ Up
Definition: mythgesture.h:49
MythTimeInputDialog::kDay
@ kDay
Definition: mythdialogbox.h:403
ChannelGroup
Definition: channelgroup.h:37
GuideGrid::Close
void Close() override
Definition: guidegrid.cpp:2525
ScheduleCommon::customEvent
void customEvent(QEvent *event) override
Definition: schedulecommon.cpp:475
GuideGrid::ShowRecordingMenu
void ShowRecordingMenu(void)
Definition: guidegrid.cpp:1106
UpdateGuideEvent::kEventType
static Type kEventType
Definition: guidegrid.cpp:353
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:240
GuideUpdaterBase::GuideUpdaterBase
GuideUpdaterBase(GuideGrid *guide)
Definition: guidegrid.cpp:231
GuideGrid::kPageRight
@ kPageRight
Definition: guidegrid.h:191
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:633
MythUIButtonList::gestureEvent
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: mythuibuttonlist.cpp:2624
GuideGrid::m_channelImage
MythUIImage * m_channelImage
Definition: guidegrid.h:294
GuideGrid::GetAlternateChannelIndex
uint GetAlternateChannelIndex(uint chan_idx, bool with_same_channum) const
Definition: guidegrid.cpp:1202
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:1106
MythUIGuideGrid::isVerticalLayout
bool isVerticalLayout(void) const
Definition: mythuiguidegrid.h:52
GuideGrid::m_startChanID
uint m_startChanID
Definition: guidegrid.h:252
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:130
MythUIGuideGrid::SetProgPast
void SetProgPast(int ppast)
Definition: mythuiguidegrid.cpp:807
mythscreenstack.h
MythGestureEvent::RightThenDown
@ RightThenDown
Definition: mythgesture.h:68
GuideGrid::m_currentEndTime
QDateTime m_currentEndTime
Definition: guidegrid.h:250
GuideGrid::updateProgramsUI
void updateProgramsUI(unsigned int firstRow, unsigned int numRows, int progPast, const QVector< ProgramList * > &proglists, const ProgInfoGuideArray &programInfos, const QLinkedList< GuideUIElement > &elements)
Definition: guidegrid.cpp:2031
ChannelUtil::OrderBy
OrderBy
Definition: channelutil.h:197
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:967
GuideGrid::updateChannels
void updateChannels(void)
Definition: guidegrid.cpp:2064
GuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: guidegrid.h:262
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
GuideGrid::setStartChannel
void setStartChannel(int newStartChannel)
Definition: guidegrid.cpp:2494
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:41
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:251
JumpToChannel::kJumpToChannelTimeout
static const uint kJumpToChannelTimeout
Definition: guidegrid.h:78
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:408
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
ProgramInfo::GetCategory
QString GetCategory(void) const
Definition: programinfo.h:364
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:1160
GuideGrid::toggleChannelFavorite
void toggleChannelFavorite(int grpid=-1)
Definition: guidegrid.cpp:2301
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:593
GuideUpdateProgramRow::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:303
JumpToChannel::m_timer
QTimer * m_timer
Definition: guidegrid.h:76
ACTION_TOGGLEPGORDER
#define ACTION_TOGGLEPGORDER
Definition: tv_actions.h:13
GuideGrid::ShowJumpToTime
void ShowJumpToTime(void)
Definition: guidegrid.cpp:2695
GuideUpdateProgramRow::m_numRows
const unsigned int m_numRows
Definition: guidegrid.cpp:304
ChannelGroupList
vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:32
GuideGrid::m_channelList
MythUIButtonList * m_channelList
Definition: guidegrid.h:288
GuideGrid::cursorUp
void cursorUp()
Definition: guidegrid.cpp:2412
GuideUpdateChannels::m_unavailables
QVector< bool > m_unavailables
Definition: guidegrid.cpp:344
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:359
ProgramInfo::GetScheduledEndTime
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
Definition: programinfo.h:392
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:486
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:256
ChannelUtil::kChanOrderByName
@ kChanOrderByName
Definition: channelutil.h:199
kUnknownTitle
const QString kUnknownTitle
Definition: guidegrid.cpp:64
autodeletedeque.h
ChannelGroup::GetChannelGroups
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
Definition: channelgroup.cpp:172
GuideGrid::kScrollDown
@ kScrollDown
Definition: guidegrid.h:185
JumpToChannel::deleteLater
virtual void deleteLater(void)
Definition: guidegrid.cpp:88
recordingtypes.h
JumpToChannel::m_rowsDisplayed
uint m_rowsDisplayed
Definition: guidegrid.h:75
GuideGrid::Create
bool Create(void) override
Definition: guidegrid.cpp:523
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:644
MythGestureEvent::UpThenLeft
@ UpThenLeft
Definition: mythgesture.h:61
progfind.h
MythUIGuideGrid
A narrow purpose widget used to show television programs and the timeslots they occupy on channels....
Definition: mythuiguidegrid.h:42
GuideGrid::cursorRight
void cursorRight()
Definition: guidegrid.cpp:2371
UpdateGuideEvent::UpdateGuideEvent
UpdateGuideEvent(GuideUpdaterBase *updater)
Definition: guidegrid.cpp:350
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:53
GuideGrid::updateChannelsNonUI
void updateChannelsNonUI(QVector< ChannelInfo * > &chinfos, QVector< bool > &unavailables)
Definition: guidegrid.cpp:2070
remoteutil.h
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:309
mythuibuttonlist.h
TV::ChangeChannel
void ChangeChannel(const PlayerContext *ctx, const ChannelInfoList &options)
Definition: tv_play.cpp:7784
GuideGrid::deleteRule
void deleteRule()
Definition: guidegrid.cpp:2543
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:95
GuideGrid::m_jumpToChannelLock
QMutex m_jumpToChannelLock
Definition: guidegrid.h:284
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:260
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:2687
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:30
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:869
programtypes.h
GuideGrid::aboutToHide
void aboutToHide() override
Definition: guidegrid.cpp:2679
GuideUpdateProgramRow::m_verticalLayout
const bool m_verticalLayout
Definition: guidegrid.cpp:315
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythObservable::addListener
void addListener(QObject *listener)
Add a listener to the observable.
Definition: mythobservable.cpp:38
TV::StartEmbedding
bool StartEmbedding(const QRect &embedRect)
Definition: tv_play.cpp:8459
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:253
GuideGrid::m_currentStartTime
QDateTime m_currentStartTime
Definition: guidegrid.h:249
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
GuideGrid::kScrollUp
@ kScrollUp
Definition: guidegrid.h:184
JumpToChannelListener::GoTo
virtual void GoTo(int start, int cur_row)=0
GuideHelper::GuideHelper
GuideHelper(GuideGrid *guide, GuideUpdaterBase *updater)
Definition: guidegrid.cpp:361
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:1847
MAX_DISPLAY_TIMES
#define MAX_DISPLAY_TIMES
Definition: mythuiguidegrid.h:26
mythdate.h
GuideGrid::cursorDown
void cursorDown()
Definition: guidegrid.cpp:2397
GuideGrid::m_originalStartTime
QDateTime m_originalStartTime
Definition: guidegrid.h:248
TV::GetState
TVState GetState(int player_idx) const
get tv state of active player context
Definition: tv_play.cpp:1403
GuideGrid::m_videoRect
QRect m_videoRect
Definition: guidegrid.h:273
SelectionIsTunable
static bool SelectionIsTunable(const ChannelInfoList &selection)
Definition: guidegrid.cpp:1050
programinfo.h
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:385
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:442
GuideGrid::m_sortReverse
bool m_sortReverse
Definition: guidegrid.h:258
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:291
GuideGrid::m_firstTime
QDateTime m_firstTime
Definition: guidegrid.h:264
GuideUpdateChannels::m_chinfos
QVector< ChannelInfo * > m_chinfos
Definition: guidegrid.cpp:343
ProgramInfo::SetScheduledEndTime
void SetScheduledEndTime(const QDateTime &dt)
Definition: programinfo.h:512
TV::GetPlayerReadLock
PlayerContext * GetPlayerReadLock(int which, const char *file, int location)
Definition: tv_play.cpp:13240
GuideGrid::m_recList
ProgramList m_recList
Definition: guidegrid.h:246
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:798
TV::ReturnPlayerLock
void ReturnPlayerLock(PlayerContext *&ctx)
Definition: tv_play.cpp:13303
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:407
GuideUpdaterBase::m_guide
GuideGrid * m_guide
Definition: guidegrid.cpp:243
GuideStatus
Definition: guidegrid.cpp:194
MythGestureEvent::gesture
Gesture gesture(void) const
Get the gesture type.
Definition: mythgesture.h:109
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
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:356
GuideGrid::m_threadPool
MThreadPool m_threadPool
Definition: guidegrid.h:279
GuideGrid::showProgFinder
void showProgFinder()
Definition: guidegrid.cpp:2504
GuideGrid::m_programs
vector< ProgramList * > m_programs
Definition: guidegrid.h:244
GuideGrid::fillTimeInfos
void fillTimeInfos(void)
Definition: guidegrid.cpp:1485
GuideGrid::enter
void enter()
Definition: guidegrid.cpp:2510
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:338
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:88
GuideUpdateProgramRow::~GuideUpdateProgramRow
~GuideUpdateProgramRow() override=default
GuideGrid
Definition: guidegrid.h:105
RemoteRequestFreeInputList
vector< uint > RemoteRequestFreeInputList(uint excluded_input)
Definition: tvremoteutil.cpp:244
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:270
MythGestureEvent::Right
@ Right
Definition: mythgesture.h:52
RecStatus::Conflict
@ Conflict
Definition: recStatus.h:39
GuideGrid::volumeUpdate
void volumeUpdate(bool up)
Definition: guidegrid.cpp:2588
LOC
#define LOC
Definition: guidegrid.cpp:60
GuideGrid::kDayRight
@ kDayRight
Definition: guidegrid.h:193
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:277
MythGestureEvent::DownThenRight
@ DownThenRight
Definition: mythgesture.h:64
MythGestureEvent::Click
@ Click
Definition: mythgesture.h:75
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:568
GuideGrid::GetCurrentStartChannel
uint GetCurrentStartChannel(void) const
Definition: guidegrid.h:134
MythMainWindow::GetPaintWindow
QWidget * GetPaintWindow()
Definition: mythmainwindow.cpp:254
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::refreshVideo
void refreshVideo(void)
Definition: guidegrid.cpp:2671
GuideGrid::m_channelInfos
db_chan_list_list_t m_channelInfos
Definition: guidegrid.h:241
GuideUpdateProgramRow::fillProgramRowInfosWith
void fillProgramRowInfosWith(int row, const QDateTime &start, ProgramList *proglist)
Definition: guidegrid.cpp:1614
ChannelInfoList
vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:133
GridTimeEndsAfter
#define GridTimeEndsAfter
Definition: mythuiguidegrid.h:30
GuideUpdateChannels
Definition: guidegrid.cpp:327
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:287
uint
unsigned int uint
Definition: compat.h:140
GuideUpdateChannels::m_currentStartChannel
uint m_currentStartChannel
Definition: guidegrid.cpp:342
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
UpdateGuideEvent
Definition: guidegrid.cpp:348
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:69
GuideGrid::~GuideGrid
~GuideGrid() override
Definition: guidegrid.cpp:616
AutoDeleteDeque::end
iterator end(void)
Definition: autodeletedeque.h:51
GuideGrid::kPageDown
@ kPageDown
Definition: guidegrid.h:189
MythGestureEvent::Left
@ Left
Definition: mythgesture.h:51
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:930
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::m_updater
GuideUpdaterBase * m_updater
Definition: guidegrid.cpp:405
channelutil.h
ProgramInfo::m_spread
int8_t m_spread
Definition: programinfo.h:816
GuideGrid::m_player
TV * m_player
Definition: guidegrid.h:267
tvremoteutil.h
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:64
GuideGrid::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: guidegrid.cpp:659
TV::IsTunable
static bool IsTunable(uint chanid)
Definition: tv_play.cpp:8388
GuideGrid::kScrollRight
@ kScrollRight
Definition: guidegrid.h:187
GuideGrid::m_channelOrdering
QString m_channelOrdering
Definition: guidegrid.h:275
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:924
GuideGrid::MoveVector
MoveVector
Definition: guidegrid.h:183
GuideStatus::m_verticalLayout
const bool m_verticalLayout
Definition: guidegrid.cpp:224
AutoDeleteDeque< ProgramInfo * >
GuideGrid::moveLeftRight
void moveLeftRight(MoveVector movement)
Definition: guidegrid.cpp:2427
GuideGrid::m_changrpid
int m_changrpid
Definition: guidegrid.h:281
JumpToChannelListener::SetJumpToChannel
virtual void SetJumpToChannel(JumpToChannel *ptr)=0
ChannelGroup::ToggleChannel
static bool ToggleChannel(uint chanid, int changrpid, bool delete_chan)
Definition: channelgroup.cpp:16
channelinfo.h
GuideGrid::m_usingNullVideo
bool m_usingNullVideo
Definition: guidegrid.h:268
GuideGrid::updateChannelsUI
void updateChannelsUI(const QVector< ChannelInfo * > &chinfos, const QVector< bool > &unavailables)
Definition: guidegrid.cpp:2123
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:292
GuideGrid::kDayLeft
@ kDayLeft
Definition: guidegrid.h:192
MythUIGuideGrid::getTimeCount
int getTimeCount(void) const
Definition: mythuiguidegrid.h:54
GuideUpdateChannels::GuideUpdateChannels
GuideUpdateChannels(GuideGrid *guide, uint startChan)
Definition: guidegrid.cpp:329
ProgramInfo::GetRecordingRuleType
RecordingType GetRecordingRuleType(void) const
Definition: programinfo.h:446
ChannelGroup::GetNextChannelGroup
static int GetNextChannelGroup(const ChannelGroupList &sorted, int grpid)
Definition: channelgroup.cpp:206
db_chan_list_t
vector< ChannelInfo > db_chan_list_t
Definition: guidegrid.h:35
AutoDeleteDeque::push_back
void push_back(T info)
Definition: autodeletedeque.h:69
JumpToChannel::m_previousCurrentChannelIndex
int m_previousCurrentChannelIndex
Definition: guidegrid.h:74
JumpToChannel::ProcessEntry
bool ProcessEntry(const QStringList &actions, const QKeyEvent *e)
Definition: guidegrid.cpp:117
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
GuideGrid::GetCurrentStartTime
QDateTime GetCurrentStartTime(void) const
Definition: guidegrid.h:135
GuideGrid::generateListings
void generateListings()
Definition: guidegrid.cpp:2236
GuideUIElement
Definition: guidegrid.h:85
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:222
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:285
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::ToggleMute
void ToggleMute(PlayerContext *ctx, bool muteIndividualChannels=false)
Definition: tv_play.cpp:8931
ChannelGroup::GetChannelGroupId
static int GetChannelGroupId(const QString &changroupname)
Definition: channelgroup.cpp:253
GuideGrid::toggleMute
void toggleMute(bool muteIndividualChannels=false)
Definition: guidegrid.cpp:2598
GuideGrid::cursorLeft
void cursorLeft()
Definition: guidegrid.cpp:2347
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:21
GuideGrid::m_previewVideoRefreshTimer
QTimer * m_previewVideoRefreshTimer
Definition: guidegrid.h:270
GuideGrid::fillProgramRowInfos
void fillProgramRowInfos(int row, bool useExistingData)
Definition: guidegrid.cpp:1548
JumpToChannel::m_entry
QString m_entry
Definition: guidegrid.h:72
LoadFromProgram
bool LoadFromProgram(ProgramList &destination, const QString &where, const QString &groupBy, const QString &orderBy, const MSqlBindings &bindings, const ProgramList &schedList)
Definition: programinfo.cpp:5464
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:413
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:22
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:221
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:58
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:108
GuideUpdateProgramRow::m_result
QLinkedList< GuideUIElement > m_result
Definition: guidegrid.cpp:323
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:352
GuideGrid::toggleGuideListing
void toggleGuideListing()
Definition: guidegrid.cpp:2218
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:73
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
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:290
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:2022
GuideGrid::ChannelGroupMenu
void ChannelGroupMenu(int mode=0)
Definition: guidegrid.cpp:2250
GuideGrid::kPageLeft
@ kPageLeft
Definition: guidegrid.h:190
GuideGrid::HideTVWindow
static void HideTVWindow(void)
Definition: guidegrid.cpp:2647
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:242
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
TV::ChangeVolume
void ChangeVolume(PlayerContext *ctx, bool up, int newvolume=-1)
Definition: tv_play.cpp:8698
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:516
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:1192
GuideStatus::m_lastTime
const QDateTime m_lastTime
Definition: guidegrid.cpp:225
GuideUpdaterBase
Definition: guidegrid.cpp:229
ProgInfoGuideArray
ProgramInfo *[MAX_DISPLAY_CHANS][MAX_DISPLAY_TIMES] ProgInfoGuideArray
Definition: guidegrid.h:37
GuideHelper::m_guide
GuideGrid * m_guide
Definition: guidegrid.cpp:404
GuideGrid::kPageUp
@ kPageUp
Definition: guidegrid.h:188
GuideGrid::m_lastTime
QDateTime m_lastTime
Definition: guidegrid.h:265
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:899
GuideStatus::m_firstRow
const unsigned int m_firstRow
Definition: guidegrid.cpp:216
GuideGrid::kScrollLeft
@ kScrollLeft
Definition: guidegrid.h:186
MythGestureEvent::RightThenLeft
@ RightThenLeft
Definition: mythgesture.h:69
TV::UpdateChannelList
void UpdateChannelList(int groupID)
update the channel list with channels from the selected channel group
Definition: tv_play.cpp:1376
MythCoreContext::GetMasterHostPrefix
QString GetMasterHostPrefix(const QString &storageGroup=QString(), const QString &path=QString())
Definition: mythcorecontext.cpp:816
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:71
GuideGrid::m_programInfos
ProgInfoGuideArray m_programInfos
Definition: guidegrid.h:245
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:444
ChannelUtil::GetNearestChannel
static int GetNearestChannel(const ChannelInfoList &list, const QString &channum)
Definition: channelutil.cpp:2315
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:675
GuideHelper::IsLoading
static bool IsLoading(GuideGrid *guide)
Definition: guidegrid.cpp:389
GuideGrid::updateTimeout
void updateTimeout(void)
Definition: guidegrid.cpp:1338
recordingrule.h
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
MythGestureEvent::RightThenUp
@ RightThenUp
Definition: mythgesture.h:67
GuideGrid::moveToTime
void moveToTime(const QDateTime &datetime)
Definition: guidegrid.cpp:2482
mythmainwindow.h
ACTION_MUTEAUDIO
#define ACTION_MUTEAUDIO
Definition: tv_actions.h:106
MythTimeInputDialog
Definition: mythdialogbox.h:393
GuideHelper::Wait
static void Wait(GuideGrid *guide)
Definition: guidegrid.cpp:394
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
CardUtil::GetStartingChannel
static QString GetStartingChannel(uint inputid)
Definition: cardutil.cpp:1724
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:293
query
MSqlQuery query(MSqlQuery::InitCon())
GuideGrid::GetProgramList
ProgramList GetProgramList(uint chanid) const
Definition: guidegrid.cpp:1170
kUpdateMS
const unsigned long kUpdateMS
Definition: guidegrid.cpp:66
GuideGrid::fillProgramInfos
void fillProgramInfos(bool useExistingData=false)
Definition: guidegrid.cpp:1519
GuideGrid::getProgramListFromProgram
ProgramList * getProgramListFromProgram(int chanNum)
Definition: guidegrid.cpp:1524
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:61
GuideGrid::GetChannelInfo
ChannelInfo * GetChannelInfo(uint chan_idx, int sel=-1)
Definition: guidegrid.cpp:1137
GuideGrid::m_currentRow
int m_currentRow
Definition: guidegrid.h:255
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:93
MThreadPool::start
void start(QRunnable *runnable, const QString &debugName, int priority=0)
Definition: mthreadpool.cpp:342
ChannelUtil::kATSCSeparators
static const QString kATSCSeparators
Definition: channelutil.h:330
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:198
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
GuideGrid::updateInfo
void updateInfo(void)
Definition: guidegrid.cpp:2161
tv_play.h
GuideHelper::run
void run(void) override
Definition: guidegrid.cpp:367
GuideGrid::updateJumpToChannel
void updateJumpToChannel(void)
Definition: guidegrid.cpp:2617
TV
Control TV playback.
Definition: tv_play.h:281
GuideGrid::GoTo
void GoTo(int start, int cur_row) override
Definition: guidegrid.cpp:2608
ProgramInfo::GetStars
float GetStars(void) const
Definition: programinfo.h:437
GuideGrid::SetJumpToChannel
void SetJumpToChannel(JumpToChannel *ptr) override
Definition: guidegrid.cpp:2633
GuideGrid::m_changrplist
ChannelGroupList m_changrplist
Definition: guidegrid.h:282