7#include <QCoreApplication>
51#define LOC QString("GuideGrid: ")
52#define LOC_ERR QString("GuideGrid, Error: ")
53#define LOC_WARN QString("GuideGrid, Warning: ")
57static constexpr std::chrono::milliseconds
kUpdateMS { 60s };
62static constexpr int64_t
kOneDay { 24 * 60LL * 60 };
67 int start_chan_idx,
int cur_chan_idx,
uint rows_disp) :
69 m_entry(
std::move(start_entry)),
70 m_previousStartChannelIndex(start_chan_idx),
71 m_previousCurrentChannelIndex(cur_chan_idx),
72 m_rowsDisplayed(rows_disp),
73 m_timer(new QTimer(this))
98 QObject::deleteLater();
104 QStringList::const_iterator it;
105 for (it = actions.begin(); it != actions.end(); ++it)
141 QString txt = e->text();
152 if (!
m_entry.isEmpty() && (txt==
"_" || txt==
"-" || txt==
"#" || txt==
"."))
194 QVector<int> channums,
197 QDateTime currentStartTime,
198 QDateTime currentEndTime,
199 uint currentStartChannel,
200 int currentRow,
int currentCol,
201 int channelCount,
int timeCount,
203 QDateTime firstTime, QDateTime lastTime)
247 QVector<ProgramList*> proglists)
277 for (
unsigned int i = 0; i <
m_numRows; ++i)
352 (QEvent::Type) QEvent::registerEventType();
360 QMutexLocker locker(&
s_lock);
365 QThread::currentThread()->setPriority(QThread::IdlePriority);
370 QCoreApplication::postEvent(
m_guide,
380 QMutexLocker locker(&
s_lock);
387 QMutexLocker locker(&
s_lock);
392 QMutexLocker locker(&
s_lock);
395 if (!
s_wait.wait(locker.mutex(), 15000UL))
412 const QDateTime &startTime,
413 TV *player,
bool embedVideo,
414 bool allowFinder,
int changrpid)
422 0,
true,
"", (changrpid<0) ? 0 : changrpid);
425 if (channels.empty() && changrpid != -1)
427 LOG(VB_GENERAL, LOG_WARNING,
LOC +
428 QString(
"Channelgroup '%1' is empty, changing to 'All Programs'")
434 if (channels.empty())
439 message = tr(
"You don't have any channels defined in the database."
440 "\n\t\t\tThe program guide will have nothing to show you.");
444 message = tr(
"Channel group '%1' doesn't have any channels defined."
445 "\n\t\t\tThe program guide will have nothing to show you.")
449 LOG(VB_GENERAL, LOG_WARNING,
LOC + message);
453 else if (allowFinder)
462 QString actualChannum = channum;
463 if (chanid == 0 && actualChannum.isEmpty())
467 chanid = defaultChanid;
469 if (chanid == 0 && actualChannum.isEmpty())
472 if (!inputIDs.empty())
477 auto *gg =
new GuideGrid(mainStack, chanid, actualChannum, startTime,
478 player, embedVideo, allowFinder, changrpid);
481 mainStack->
AddScreen(gg, (player ==
nullptr));
487 uint chanid, QString channum,
const QDateTime &startTime,
488 TV *player,
bool embedVideo,
489 bool allowFinder,
int changrpid)
491 m_selectRecThreshold(
gCoreContext->GetDurSetting<
std::chrono::minutes>(
"SelChangeRecThreshold", 16min)),
492 m_allowFinder(allowFinder),
493 m_startChanID(chanid),
494 m_startChanNum(
std::move(channum)),
497 m_embedVideo(embedVideo),
498 m_channelOrdering(
gCoreContext->GetSetting(
"ChannelOrdering",
"channum")),
499 m_updateTimer(new QTimer(this)),
500 m_threadPool(
"GuideGridHelperPool"),
501 m_changrpid(changrpid),
511 if (startTime.isValid() &&
542 QString windowName =
"programguide";
545 windowName =
"programguide-video";
562 LOG(VB_GENERAL, LOG_ERR,
563 QString(
"Cannot load screen '%1'").arg(windowName));
602 chanNum = std::max(chanNum, 0);
677 if (!actions.empty())
683 const QString& chanNum = actions[0];
685 (void)chanNum.toInt(&isNum);
707 for (
int i = 0; i < actions.size() && !handled; ++i)
709 const QString&
action = actions[i];
739 else if (
action ==
"PAGEUP")
746 else if (
action ==
"PAGEDOWN")
775 else if (
action ==
"NEXTFAV")
787 else if (
action ==
"MENU")
799 auto secsTillStart = (pginfo)
825 else if (
action ==
"EDIT")
829 else if (
action ==
"CUSTOMEDIT")
833 else if (
action ==
"DELETE")
837 else if (
action ==
"UPCOMING")
841 else if (
action ==
"PREVRECORDED")
860 else if (
action ==
"CHANUPDATE")
872 else if (
action ==
"CYCLEAUDIOCHAN")
904 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Guide Gesture no event");
908 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture event %1")
917 QPoint position =
event->GetPosition();
930 QString name =
object->objectName();
931 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click name %1").arg(name));
933 if (name.startsWith(
"channellist"))
935 auto* channelList = qobject_cast<MythUIButtonList*>(
object);
939 handled = channelList->gestureEvent(event);
940 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click channel list %1").arg(handled));
943 else if (name.startsWith(
"guidegrid"))
945 auto* guidegrid = qobject_cast<MythUIGuideGrid*>(
object);
951 QPoint rowCol = guidegrid->GetRowAndColumn(position - guidegrid->GetArea().topLeft());
953 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg %1,%2 (%3,%4)")
959 if ((rowCol.y() >= 0) && (rowCol.x() >= 0))
970 auto secsTillStart = (pginfo)
976 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg EditRec"));
980 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg enter"));
987 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg not live"));
1100 return std::any_of(selection.cbegin(), selection.cend(),
1101 [selection](
const auto & chan){ return TV::IsTunable(chan.m_chanId); } );
1106 QString label = tr(
"Guide Options");
1109 auto *menuPopup =
new MythDialogBox(label, popupStack,
"guideMenuPopup");
1111 if (menuPopup->Create())
1113 menuPopup->SetReturnEvent(
this,
"guidemenu");
1116 menuPopup->AddButton(tr(
"Change to Channel"));
1118 menuPopup->AddButton(tr(
"Watch This Channel"));
1120 menuPopup->AddButton(tr(
"Record This"));
1122 menuPopup->AddButton(tr(
"Recording Options"),
nullptr,
true);
1124 menuPopup->AddButton(tr(
"Program Details"));
1126 menuPopup->AddButton(tr(
"Jump to Time"),
nullptr,
true);
1128 menuPopup->AddButton(tr(
"Reverse Channel Order"));
1130 menuPopup->AddButton(tr(
"Channel Search"));
1134 menuPopup->AddButton(tr(
"Choose Channel Group"));
1137 menuPopup->AddButton(tr(
"Add To Channel Group"),
nullptr,
true);
1139 menuPopup->AddButton(tr(
"Remove from Channel Group"));
1152 QString label = tr(
"Recording Options");
1155 auto *menuPopup =
new MythDialogBox(label, popupStack,
"recMenuPopup");
1157 if (menuPopup->Create())
1159 menuPopup->SetReturnEvent(
this,
"recmenu");
1164 menuPopup->AddButton(tr(
"Edit Recording Status"));
1165 menuPopup->AddButton(tr(
"Edit Schedule"));
1166 menuPopup->AddButton(tr(
"Show Upcoming"));
1167 menuPopup->AddButton(tr(
"Previously Recorded"));
1168 menuPopup->AddButton(tr(
"Custom Edit"));
1171 menuPopup->AddButton(tr(
"Delete Rule"));
1196 return ((
GuideGrid*)
this)->GetChannelInfo(chan_idx, sel);
1219 "WHERE program.chanid = :CHANID AND "
1220 " program.endtime >= :STARTTS AND "
1221 " program.starttime <= :ENDTS AND "
1222 " program.starttime >= :STARTLIMITTS AND "
1223 " program.manualid = 0 ";
1225 bindings[
":STARTTS"] = starttime;
1226 bindings[
":STARTLIMITTS"] = starttime.addDays(-1);
1228 bindings[
":CHANID"] = chanid;
1242 for (
auto & pi : *proglist)
1248 uint chan_idx,
bool with_same_channum)
const
1257 for (
uint i = 0; i < cnt; ++i)
1268 if (with_same_channum != same_channum)
1274 if (with_same_channum)
1283 if (proglist.
empty() ||
1284 proglist.
size() != ch_proglist.
size())
1288 for (
size_t j = 0; j < proglist.
size(); ++j)
1290 isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1306static constexpr uint64_t
MKKEY(uint64_t IDX, uint64_t
SEL)
1307 {
return (IDX << 32) | SEL; }
1319 std::vector<uint64_t> sel;
1320 sel.push_back(
MKKEY(idx, si) );
1326 selected.push_back(*ch);
1332 if (proglist.
empty())
1338 if (ci && (i != si) &&
1341 sel.push_back(
MKKEY(idx, i) );
1348 if (ci && (i != si) &&
1351 sel.push_back(
MKKEY(idx, i) );
1360 sel.push_back(
MKKEY(idx, i) );
1364 for (
size_t i = 1; i < sel.size(); ++i)
1369 if (!ci || proglist.
size() != ch_proglist.
size())
1373 for (
size_t j = 0; j < proglist.
size(); ++j)
1375 isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1408 using uint_list_t = std::vector<unsigned int>;
1409 QMap<QString,uint_list_t> channum_to_index_map;
1410 QMap<QString,uint_list_t> callsign_to_index_map;
1412 for (
size_t i = 0; i < channels.size(); ++i)
1417 chan = channels.size() - i - 1;
1420 bool ndup = !channum_to_index_map[channels[chan].m_chanNum].empty();
1421 bool cdup = !callsign_to_index_map[channels[chan].m_callSign].empty();
1438 for (
auto & channel : channels)
1440 const uint_list_t &ndups = channum_to_index_map[channel.m_chanNum];
1441 for (
unsigned int ndup : ndups)
1448 const uint_list_t &cdups = callsign_to_index_map[channel.m_callSign];
1449 for (
unsigned int cdup : cdups)
1456 if (gotostartchannel)
1464 LOG(VB_GENERAL, LOG_ERR,
"GuideGrid: "
1465 "\n\t\t\tYou don't have any channels defined in the database."
1466 "\n\t\t\tGuide grid will have nothing to show you.");
1511 if (exact || channum.isEmpty())
1515 QVector<int> idxList;
1521 idxList.push_back(i);
1526 result = idxList[result];
1541 int mins = starttime.time().minute();
1542 mins = 5 * (mins / 5);
1548 infomap[
"starttime"] = timeStr;
1556 item->SetTextFromMap(infomap);
1576 QString querystr =
"WHERE program.chanid = :CHANID "
1577 " AND program.endtime >= :STARTTS "
1578 " AND program.starttime <= :ENDTS "
1579 " AND program.starttime >= :STARTLIMITTS "
1580 " AND program.manualid = 0 ";
1583 bindings[
":STARTTS"] = starttime;
1584 bindings[
":STARTLIMITTS"] = starttime.addDays(-1);
1596 bool allRows =
false;
1597 unsigned int numRows = 1;
1605 QVector<int> chanNums;
1606 QVector<ProgramList*> proglists;
1608 for (
unsigned int i = 0; i < numRows; ++i)
1610 unsigned int row = i + firstRow;
1629 chanNum = std::max(chanNum, 0);
1632 if (useExistingData)
1634 chanNums.push_back(chanNum);
1635 proglists.push_back(proglist);
1639 for (
unsigned int i = numRows;
1650 GuideStatus gs(firstRow, chanNums.size(), chanNums,
1661 const QDateTime& start,
1684 progPast = played * 100 / length;
1689 auto program = proglist->
begin();
1690 std::vector<ProgramInfo*> unknownlist;
1691 bool unknown =
false;
1695 if (program != proglist->
end() &&
1696 (ts >= (*program)->GetScheduledEndTime()))
1701 if ((program == proglist->
end()) ||
1702 (ts < (*program)->GetScheduledStartTime()))
1715 GuideGrid::tr(
"Unknown",
"Unknown program title"),
1717 unknownlist.push_back(proginfo);
1725 if (proginfo && proginfo == *program)
1731 proginfo = *program;
1745 for (
auto & pi : unknownlist)
1751 double ydifference = 0.0;
1752 double xdifference = 0.0;
1756 ydifference = programRect.width() /
1758 xdifference = programRect.height() /
1763 ydifference = programRect.height() /
1765 xdifference = programRect.width() /
1774 bool isCurrent =
false;
1807 for (
int z = x + 1; z < x + spread; ++z)
1820 tempRect = QRect((
int)(row * ydifference),
1821 (
int)(x * xdifference),
1823 (
int)(xdifference * pginfo->
m_spread));
1827 tempRect = QRect((
int)(x * xdifference),
1828 (
int)(row * ydifference),
1829 (
int)(xdifference * pginfo->
m_spread),
1834 if (tempRect.right() + 2 >= programRect.width())
1835 tempRect.setRight(programRect.width());
1836 if (tempRect.bottom() + 2 >= programRect.bottom())
1837 tempRect.setBottom(programRect.bottom());
1880 GuideGrid::tr(
"Unknown",
"Unknown program title") :
1883 row, cnt, tempRect, title,
1885 recStat, isCurrent);
1898 auto *me =
dynamic_cast<MythEvent *
>(event);
1902 const QString& message = me->
Message();
1904 if (message ==
"SCHEDULE_CHANGE")
1915 QString resultid = dce->GetId();
1916 QString resulttext = dce->GetResultText();
1917 int buttonnum = dce->GetResult();
1919 if (resultid ==
"deleterule")
1924 if ((buttonnum > 0) && !record->Delete())
1925 LOG(VB_GENERAL, LOG_ERR,
"Failed to delete recording rule");
1931 else if (resulttext == tr(
"Watch This Channel"))
1937 else if (resultid ==
"guidemenu")
1939 if (resulttext == tr(
"Record This"))
1943 else if (resulttext == tr(
"Change to Channel"))
1947 else if (resulttext == tr(
"Program Details"))
1951 else if (resulttext == tr(
"Reverse Channel Order"))
1957 else if (resulttext == tr(
"Channel Search"))
1961 else if (resulttext == tr(
"Add To Channel Group"))
1966 else if (resulttext == tr(
"Remove from Channel Group"))
1970 else if (resulttext == tr(
"Choose Channel Group"))
1974 else if (resulttext == tr(
"Recording Options"))
1978 else if (resulttext == tr(
"Jump to Time"))
1983 else if (resultid ==
"recmenu")
1985 if (resulttext == tr(
"Edit Recording Status"))
1989 else if (resulttext == tr(
"Edit Schedule"))
1993 else if (resulttext == tr(
"Show Upcoming"))
1997 else if (resulttext == tr(
"Previously Recorded"))
2001 else if (resulttext == tr(
"Custom Edit"))
2005 else if (resulttext == tr(
"Delete Rule"))
2011 else if (resultid ==
"channelgrouptogglemenu")
2015 if (changroupid > 0)
2018 else if (resultid ==
"channelgroupmenu")
2022 int changroupid = -1;
2024 if (resulttext == QObject::tr(
"All Channels"))
2034 QString changrpname;
2041 else if (resultid ==
"jumptotime")
2043 QDateTime datetime = dce->GetData().toDateTime();
2054 if (uge && uge->m_updater)
2057 delete uge->m_updater;
2058 uge->m_updater =
nullptr;
2074 const QVector<ProgramList*> &proglists,
2076 const std::list<GuideUIElement> &elements)
2078 for (
unsigned int i = 0; i < numRows; ++i)
2080 unsigned int row = i + firstRow;
2089 for (
const auto & r : elements)
2092 r.m_category, r.m_arrow, r.m_recType,
2093 r.m_recStat, r.m_selected);
2095 for (
unsigned int i = firstRow; i < firstRow + numRows; ++i)
2112 QVector<bool> &unavailables)
2116 for (
unsigned int y = 0; (y < (
unsigned int)
m_channelCount) && chinfo; ++y)
2126 bool unavailable =
false;
2127 bool try_alt =
false;
2146 unavailable =
false;
2152 if (unavailable && chinfo &&
2159 chinfos.push_back(chinfo);
2160 unavailables.push_back(unavailable);
2165 const QVector<bool> &unavailables)
2168 for (
int i = 0; i < chinfos.size(); ++i)
2171 bool unavailable = unavailables[i];
2175 QString state =
"available";
2177 state = (
m_changrpid == -1) ?
"unavailable" :
"favunavailable";
2179 state = (
m_changrpid == -1) ?
"available" :
"favourite";
2181 item->SetFontState(state);
2182 item->DisplayState(state,
"chanstatus");
2187 chinfo->
ToMap(infomap);
2188 item->SetTextFromMap(infomap);
2190 if (!chinfo->
m_icon.isEmpty())
2195 item->SetImage(iconurl,
"channelicon");
2218 chanNum = std::max(chanNum, 0);
2225 if (!chinfo->
m_icon.isEmpty())
2235 chinfo->
ToMap(infoMap);
2236 pginfo->
ToMap(infoMap);
2242 infoMap[
"title"] = tr(
"Unknown",
"Unknown program title");
2243 infoMap[
"titlesubtitle"] = tr(
"Unknown",
"Unknown program title");
2301 if (channels.empty())
2303 QString message = tr(
"You don't have any channel groups defined");
2308 if (okPopup->Create())
2316 QString label = tr(
"Select Channel Group");
2319 auto *menuPopup =
new MythDialogBox(label, popupStack,
"menuPopup");
2321 if (menuPopup->Create())
2323 if (mode == 0 || mode == 2)
2326 menuPopup->SetReturnEvent(
this,
"channelgrouptogglemenu");
2331 menuPopup->SetReturnEvent(
this,
"channelgroupmenu");
2332 menuPopup->AddButton(QObject::tr(
"All Channels"));
2335 for (
auto & channel : channels)
2337 menuPopup->AddButton(channel.m_name);
2365 chanNum = std::max(chanNum, 0);
2531 if (!datetime.isValid())
2543 if (newStartChannel < 0)
2598 if (!record->LoadByProgram(pginfo))
2604 QString message = tr(
"Delete '%1' %2 rule?")
2611 okPopup->SetReturnEvent(
this,
"deleterule");
2612 okPopup->SetData(QVariant::fromValue(record));
2614 if (okPopup->Create())
2682 QRegion r1 = QRegion(
m_area);
2705 QString message = tr(
"Jump to a specific date and time in the guide");
2712 if (timedlg->Create())
2714 timedlg->SetReturnEvent(
this,
"jumptotime");
std::vector< ChannelGroupItem > ChannelGroupList
std::vector< ChannelInfo > ChannelInfoList
static QString GetStartChannel(uint inputid)
static bool NotInChannelGroupList(const ChannelGroupList &groupList, int grpid)
static bool InChannelGroupList(const ChannelGroupList &groupList, int grpid)
static QString GetChannelGroupName(int grpid)
static int GetNextChannelGroup(const ChannelGroupList &sorted, int grpid)
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
static bool ToggleChannel(uint chanid, int changrpid, bool delete_chan)
static ChannelGroupList GetManualChannelGroups(bool includeEmpty=true)
static int GetChannelGroupId(const QString &changroupname)
void ToMap(InfoMap &infoMap)
QString GetFormatted(ChannelFormat format) const
static int GetNearestChannel(const ChannelInfoList &list, const QString &channum)
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.
static ChannelInfoList GetChannels(uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void moveToTime(const QDateTime &datetime)
void moveUpDown(MoveVector movement)
MythUIText * m_jumpToText
ChannelGroupList m_changrplist
db_chan_list_list_t m_channelInfos
ProgInfoGuideArray m_programInfos
void PlayerExiting(TV *Player)
MythUIImage * m_channelImage
MythUIButtonList * m_channelList
void GoTo(int start, int cur_row) override
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
MythUIButtonList * m_timeList
ChannelGroupList m_channelGroupListManual
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
ProgramList GetProgramList(uint chanid) const
ProgramList * getProgramListFromProgram(int chanNum)
void updateChannelsUI(const QVector< ChannelInfo * > &chinfos, const QVector< bool > &unavailables)
QRecursiveMutex m_jumpToChannelLock
QDateTime GetCurrentStartTime(void) const
void ShowMenu(void) override
MythUIText * m_changroupname
int GetStartChannelOffset(int row=-1) const
void updateChannelsNonUI(QVector< ChannelInfo * > &chinfos, QVector< bool > &unavailables)
void updateProgramsUI(unsigned int firstRow, unsigned int numRows, int progPast, const QVector< ProgramList * > &proglists, const ProgInfoGuideArray &programInfos, const std::list< GuideUIElement > &elements)
void setStartChannel(int newStartChannel)
QMap< uint, uint > m_channelInfoIdx
void SetJumpToChannel(JumpToChannel *ptr) override
JumpToChannel * m_jumpToChannel
uint GetCurrentStartChannel(void) const
uint m_currentStartChannel
bool Create(void) override
std::vector< ProgramList * > m_programs
int FindChannel(uint chanid, const QString &channum, bool exact=true) const override
void updateJumpToChannel(void)
void updateChannels(void)
GuideGrid(MythScreenStack *parentStack, uint chanid, QString channum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
QString m_channelOrdering
void aboutToShow() override
uint GetChannelCount(void) const
void fillChannelInfos(bool gotostartchannel=true)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
ChannelInfo * GetChannelInfo(uint chan_idx, int sel=-1)
void toggleGuideListing()
void ToggleMute(bool CycleChannels)
QDateTime m_currentEndTime
void ShowJumpToTime(void)
void ShowRecordingMenu(void)
uint GetAlternateChannelIndex(uint chan_idx, bool with_same_channum) const
static void HideTVWindow(void)
void fillProgramRowInfos(int row, bool useExistingData)
void ChannelGroupMenu(int mode=0)
void fillProgramInfos(bool useExistingData=false)
void updateDateText(void)
ChannelInfoList GetSelection(void) const
void customEvent(QEvent *event) override
MythUIText * m_longdateText
QDateTime m_originalStartTime
QDateTime m_currentStartTime
void toggleChannelFavorite(int grpid=-1)
void aboutToHide() override
void ChangeVolume(bool Up, int NewVolume=-1)
static void RunProgramGuide(uint startChanId, const QString &startChanNum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
std::chrono::minutes m_selectRecThreshold
void moveLeftRight(MoveVector movement)
MythUIGuideGrid * m_guideGrid
GuideHelper(GuideGrid *guide, GuideUpdaterBase *updater)
static QWaitCondition s_wait
static bool IsLoading(GuideGrid *guide)
static void Wait(GuideGrid *guide)
GuideUpdaterBase * m_updater
static QHash< GuideGrid *, uint > s_loading
const bool m_verticalLayout
const QDateTime m_firstTime
const uint m_currentStartChannel
const QVector< int > m_chanNums
const MythRect m_ggProgramRect
const int m_ggChannelCount
const unsigned int m_firstRow
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)
const QDateTime m_currentStartTime
const unsigned int m_numRows
const QDateTime m_currentEndTime
const QDateTime m_lastTime
void ExecuteUI(void) override
QVector< ChannelInfo * > m_chinfos
bool ExecuteNonUI(void) override
QVector< bool > m_unavailables
GuideUpdateChannels(GuideGrid *guide, uint startChan)
uint m_currentStartChannel
const QDateTime m_currentStartTime
const QDateTime m_firstTime
const MythRect m_ggProgramRect
GuideUpdateProgramRow(GuideGrid *guide, const GuideStatus &gs, QVector< ProgramList * > proglists)
const QDateTime m_currentEndTime
const int m_ggChannelCount
bool ExecuteNonUI(void) override
const QVector< int > m_chanNums
ProgInfoGuideArray m_programInfos
const uint m_currentStartChannel
~GuideUpdateProgramRow() override=default
void ExecuteUI(void) override
const bool m_verticalLayout
const unsigned int m_firstRow
const QDateTime m_lastTime
const unsigned int m_numRows
void fillProgramRowInfosWith(int row, const QDateTime &start, ProgramList *proglist)
QVector< ProgramList * > m_proglists
std::list< GuideUIElement > m_result
virtual ~GuideUpdaterBase()=default
virtual bool ExecuteNonUI(void)=0
GuideUpdaterBase(GuideGrid *guide)
virtual void ExecuteUI(void)=0
virtual void SetJumpToChannel(JumpToChannel *ptr)=0
virtual void GoTo(int start, int cur_row)=0
virtual int FindChannel(uint chanid, const QString &channum, bool exact=true) const =0
virtual void deleteLater(void)
JumpToChannel(JumpToChannelListener *parent, QString start_entry, int start_chan_idx, int cur_chan_idx, uint rows_disp)
JumpToChannelListener * m_listener
int m_previousStartChannelIndex
int m_previousCurrentChannelIndex
static const uint kJumpToChannelTimeout
bool ProcessEntry(const QStringList &actions, const QKeyEvent *e)
QString GetEntry(void) const
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
void setMaxThreadCount(int maxThreadCount)
void start(QRunnable *runnable, const QString &debugName, int priority=0)
Dialog asking for user confirmation.
void SaveSetting(const QString &key, int newValue)
QString GetMasterHostPrefix(const QString &storageGroup=QString(), const QString &path=QString())
int GetNumSetting(const QString &key, int defaultval=0)
bool GetBoolSetting(const QString &key, bool defaultval=false)
Basic menu dialog, message and a list of options.
This class is used as a container for messages.
const QString & Message() const
static const Type kMythEventMessage
A custom event that represents a mouse gesture.
Gesture GetGesture() const
QWidget * GetPaintWindow()
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
void addListener(QObject *listener)
Add a listener to the observable.
void removeListener(QObject *listener)
Remove a listener to the observable.
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
MythPoint topLeft(void) const
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
void LoadInBackground(const QString &message="")
virtual void aboutToShow(void)
virtual void aboutToHide(void)
void BuildFocusList(void)
MythScreenStack * GetScreenStack() const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
virtual void SetTextFromMap(const InfoMap &infoMap)
int getChannelCount(void) const
bool isVerticalLayout(void) const
void SetProgramInfo(int row, int col, QRect area, const QString &title, const QString &genre, int arrow, int recType, int recStat, bool selected)
void SetProgPast(int ppast)
int getTimeCount(void) const
Image widget, displays a single image or multiple images in sequence.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void Reset(void) override
Reset the image back to the default defined in the theme.
This widget is used for grouping other widgets for display when a particular named state is called.
bool DisplayState(const QString &name)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
The base class on which all widgets and screens are based.
MythUIType * GetChildAt(QPoint p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Holds information on recordings and videos.
float GetStars(void) const
uint GetRecordingRuleID(void) const
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
void SetScheduledEndTime(const QDateTime &dt)
QString GetTitle(void) const
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
RecStatus::Type GetRecordingStatus(void) const
QString GetCategory(void) const
RecordingType GetRecordingRuleType(void) const
Internal representation of a recording rule, mirrors the record table.
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
virtual int IncrRef(void)
Increments reference count.
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
virtual void EditRecording(bool may_watch_now=false)
Creates a dialog for editing the recording status, blocking until user leaves dialog.
virtual void ShowDetails(void) const
Show the Program Details screen.
void customEvent(QEvent *event) override
virtual void EditCustom(void)
Creates a dialog for creating a custom recording rule.
virtual void QuickRecord(void)
Create a kSingleRecord or bring up recording dialog.
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
virtual void ShowChannelSearch(void) const
Show the channel search.
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
void ChangeMuteState(bool CycleChannels=false)
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
void VolumeChange(bool Up, int NewVolume=-1)
PlayerContext * GetPlayerContext()
Return a pointer to TV::m_playerContext.
void GetPlayerReadLock() const
void PlaybackExiting(TV *Player)
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
static bool IsTunable(uint ChanId)
void ReturnPlayerLock() const
void UpdateChannelList(int GroupID)
update the channel list with channels from the selected channel group
void ChangeChannel(const ChannelInfoList &Options)
GuideUpdaterBase * m_updater
static const Type kEventType
UpdateGuideEvent(GuideUpdaterBase *updater)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
static ProgramList * CopyProglist(ProgramList *proglist)
static constexpr int64_t kFiveMinutes
static constexpr int64_t kEightHours
static constexpr int64_t kThirtyMinutes
static constexpr uint64_t MKKEY(uint64_t IDX, uint64_t SEL)
static bool SelectionIsTunable(const ChannelInfoList &selection)
const QString kUnknownTitle
QWaitCondition epgIsVisibleCond
static bool has_action(const QString &action, const QStringList &actions)
static constexpr int64_t kFourMinutes
static constexpr int64_t kOneDay
static constexpr std::chrono::milliseconds kUpdateMS
std::array< std::array< ProgramInfo *, MAX_DISPLAY_TIMES >, MAX_DISPLAY_CHANS > ProgInfoGuideArray
std::vector< ChannelInfo > db_chan_list_t
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
A C++ ripoff of the stroke library for MythTV.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
QHash< QString, QString > InfoMap
static constexpr const char * ACTION_LEFT
static constexpr const char * ACTION_DOWN
static constexpr const char * ACTION_RIGHT
static constexpr const char * ACTION_SELECT
static constexpr const char * ACTION_UP
static constexpr int MAX_DISPLAY_TIMES
static constexpr uint8_t GridTimeNormal
static constexpr int MAX_DISPLAY_CHANS
static constexpr uint8_t GridTimeEndsAfter
static constexpr uint8_t GridTimeStartsBefore
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
@ kDateFull
Default local time.
@ kTime
Default local time.
@ kDateShort
Default local time.
std::chrono::seconds secsInFuture(const QDateTime &future)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
def rating(profile, smoonURL, gate)
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
bool LoadFromProgram(ProgramList &destination, const QString &where, const QString &groupBy, const QString &orderBy, const MSqlBindings &bindings, const ProgramList &schedList)
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
AutoDeleteDeque< ProgramInfo * > ProgramList
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
#define ACTION_TOGGLEPGORDER
#define ACTION_CHANNELSEARCH
#define ACTION_TOGGLERECORD
#define ACTION_VOLUMEDOWN
std::vector< uint > RemoteRequestFreeInputList(uint excluded_input)
VERBOSE_PREAMBLE Most true