7#include <QCoreApplication>
50#define LOC QString("GuideGrid: ")
51#define LOC_ERR QString("GuideGrid, Error: ")
52#define LOC_WARN QString("GuideGrid, Warning: ")
56static constexpr std::chrono::milliseconds
kUpdateMS { 60s };
61static constexpr int64_t
kOneDay { 24 * 60LL * 60 };
66 int start_chan_idx,
int cur_chan_idx,
uint rows_disp) :
68 m_entry(
std::move(start_entry)),
69 m_previousStartChannelIndex(start_chan_idx),
70 m_previousCurrentChannelIndex(cur_chan_idx),
71 m_rowsDisplayed(rows_disp),
72 m_timer(new QTimer(this))
97 QObject::deleteLater();
103 QStringList::const_iterator it;
104 for (it = actions.begin(); it != actions.end(); ++it)
140 QString txt = e->text();
151 if (!
m_entry.isEmpty() && (txt==
"_" || txt==
"-" || txt==
"#" || txt==
"."))
193 QVector<int> channums,
196 QDateTime currentStartTime,
197 QDateTime currentEndTime,
198 uint currentStartChannel,
199 int currentRow,
int currentCol,
200 int channelCount,
int timeCount,
202 QDateTime firstTime, QDateTime lastTime)
246 QVector<ProgramList*> proglists)
276 for (
unsigned int i = 0; i <
m_numRows; ++i)
351 (QEvent::Type) QEvent::registerEventType();
359 QMutexLocker locker(&
s_lock);
364 QThread::currentThread()->setPriority(QThread::IdlePriority);
369 QCoreApplication::postEvent(
m_guide,
379 QMutexLocker locker(&
s_lock);
386 QMutexLocker locker(&
s_lock);
391 QMutexLocker locker(&
s_lock);
394 if (!
s_wait.wait(locker.mutex(), 15000UL))
411 const QDateTime &startTime,
412 TV *player,
bool embedVideo,
413 bool allowFinder,
int changrpid)
421 0,
true,
"", (changrpid<0) ? 0 : changrpid);
424 if (channels.empty() && changrpid != -1)
426 LOG(VB_GENERAL, LOG_WARNING,
LOC +
427 QString(
"Channelgroup '%1' is empty, changing to 'All Programs'")
433 if (channels.empty())
438 message = tr(
"You don't have any channels defined in the database."
439 "\n\t\t\tThe program guide will have nothing to show you.");
443 message = tr(
"Channel group '%1' doesn't have any channels defined."
444 "\n\t\t\tThe program guide will have nothing to show you.")
448 LOG(VB_GENERAL, LOG_WARNING,
LOC + message);
452 else if (allowFinder)
461 QString actualChannum = channum;
462 if (chanid == 0 && actualChannum.isEmpty())
466 chanid = defaultChanid;
468 if (chanid == 0 && actualChannum.isEmpty())
471 if (!inputIDs.empty())
476 auto *gg =
new GuideGrid(mainStack, chanid, actualChannum, startTime,
477 player, embedVideo, allowFinder, changrpid);
480 mainStack->
AddScreen(gg, (player ==
nullptr));
486 uint chanid, QString channum,
const QDateTime &startTime,
487 TV *player,
bool embedVideo,
488 bool allowFinder,
int changrpid)
490 m_selectRecThreshold(
gCoreContext->GetDurSetting<
std::chrono::minutes>(
"SelChangeRecThreshold", 16min)),
491 m_allowFinder(allowFinder),
492 m_startChanID(chanid),
493 m_startChanNum(
std::move(channum)),
496 m_embedVideo(embedVideo),
497 m_channelOrdering(
gCoreContext->GetSetting(
"ChannelOrdering",
"channum")),
498 m_updateTimer(new QTimer(this)),
499 m_threadPool(
"GuideGridHelperPool"),
500 m_changrpid(changrpid),
510 if (startTime.isValid() &&
541 QString windowName =
"programguide";
544 windowName =
"programguide-video";
561 LOG(VB_GENERAL, LOG_ERR,
562 QString(
"Cannot load screen '%1'").arg(windowName));
601 chanNum = std::max(chanNum, 0);
676 if (!actions.empty())
682 const QString& chanNum = actions[0];
684 (void)chanNum.toInt(&isNum);
706 for (
int i = 0; i < actions.size() && !handled; ++i)
708 const QString&
action = actions[i];
738 else if (
action ==
"PAGEUP")
745 else if (
action ==
"PAGEDOWN")
774 else if (
action ==
"NEXTFAV")
786 else if (
action ==
"MENU")
798 auto secsTillStart = (pginfo)
824 else if (
action ==
"EDIT")
828 else if (
action ==
"CUSTOMEDIT")
832 else if (
action ==
"DELETE")
836 else if (
action ==
"UPCOMING")
840 else if (
action ==
"PREVRECORDED")
859 else if (
action ==
"CHANUPDATE")
871 else if (
action ==
"CYCLEAUDIOCHAN")
903 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Guide Gesture no event");
907 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture event %1")
916 QPoint position =
event->GetPosition();
929 QString name =
object->objectName();
930 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click name %1").arg(name));
932 if (name.startsWith(
"channellist"))
934 auto* channelList = qobject_cast<MythUIButtonList*>(
object);
938 handled = channelList->gestureEvent(event);
939 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click channel list %1").arg(handled));
942 else if (name.startsWith(
"guidegrid"))
944 auto* guidegrid = qobject_cast<MythUIGuideGrid*>(
object);
950 QPoint rowCol = guidegrid->GetRowAndColumn(position - guidegrid->GetArea().topLeft());
952 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg %1,%2 (%3,%4)")
958 if ((rowCol.y() >= 0) && (rowCol.x() >= 0))
969 auto secsTillStart = (pginfo)
975 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg EditRec"));
979 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg enter"));
986 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Guide Gesture Click gg not live"));
1099 return std::any_of(selection.cbegin(), selection.cend(),
1100 [selection](
const auto & chan){ return TV::IsTunable(chan.m_chanId); } );
1105 QString label = tr(
"Guide Options");
1108 auto *menuPopup =
new MythDialogBox(label, popupStack,
"guideMenuPopup");
1110 if (menuPopup->Create())
1112 menuPopup->SetReturnEvent(
this,
"guidemenu");
1115 menuPopup->AddButton(tr(
"Change to Channel"));
1117 menuPopup->AddButton(tr(
"Watch This Channel"));
1119 menuPopup->AddButton(tr(
"Record This"));
1121 menuPopup->AddButton(tr(
"Recording Options"),
nullptr,
true);
1123 menuPopup->AddButton(tr(
"Program Details"));
1125 menuPopup->AddButton(tr(
"Jump to Time"),
nullptr,
true);
1127 menuPopup->AddButton(tr(
"Reverse Channel Order"));
1129 menuPopup->AddButton(tr(
"Channel Search"));
1133 menuPopup->AddButton(tr(
"Choose Channel Group"));
1136 menuPopup->AddButton(tr(
"Add To Channel Group"),
nullptr,
true);
1138 menuPopup->AddButton(tr(
"Remove from Channel Group"));
1151 QString label = tr(
"Recording Options");
1154 auto *menuPopup =
new MythDialogBox(label, popupStack,
"recMenuPopup");
1156 if (menuPopup->Create())
1158 menuPopup->SetReturnEvent(
this,
"recmenu");
1163 menuPopup->AddButton(tr(
"Edit Recording Status"));
1164 menuPopup->AddButton(tr(
"Edit Schedule"));
1165 menuPopup->AddButton(tr(
"Show Upcoming"));
1166 menuPopup->AddButton(tr(
"Previously Recorded"));
1167 menuPopup->AddButton(tr(
"Custom Edit"));
1170 menuPopup->AddButton(tr(
"Delete Rule"));
1195 return ((
GuideGrid*)
this)->GetChannelInfo(chan_idx, sel);
1218 "WHERE program.chanid = :CHANID AND "
1219 " program.endtime >= :STARTTS AND "
1220 " program.starttime <= :ENDTS AND "
1221 " program.starttime >= :STARTLIMITTS AND "
1222 " program.manualid = 0 ";
1224 bindings[
":STARTTS"] = starttime;
1225 bindings[
":STARTLIMITTS"] = starttime.addDays(-1);
1227 bindings[
":CHANID"] = chanid;
1241 for (
auto & pi : *proglist)
1247 uint chan_idx,
bool with_same_channum)
const
1256 for (
uint i = 0; i < cnt; ++i)
1267 if (with_same_channum != same_channum)
1273 if (with_same_channum)
1282 if (proglist.
empty() ||
1283 proglist.
size() != ch_proglist.
size())
1287 for (
size_t j = 0; j < proglist.
size(); ++j)
1289 isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1305static constexpr uint64_t
MKKEY(uint64_t IDX, uint64_t
SEL)
1306 {
return (IDX << 32) | SEL; }
1318 std::vector<uint64_t> sel;
1319 sel.push_back(
MKKEY(idx, si) );
1325 selected.push_back(*ch);
1331 if (proglist.
empty())
1337 if (ci && (i != si) &&
1340 sel.push_back(
MKKEY(idx, i) );
1347 if (ci && (i != si) &&
1350 sel.push_back(
MKKEY(idx, i) );
1359 sel.push_back(
MKKEY(idx, i) );
1363 for (
size_t i = 1; i < sel.size(); ++i)
1368 if (!ci || proglist.
size() != ch_proglist.
size())
1372 for (
size_t j = 0; j < proglist.
size(); ++j)
1374 isAlt &= proglist[j]->IsSameTitleTimeslotAndChannel(*ch_proglist[j]);
1407 using uint_list_t = std::vector<unsigned int>;
1408 QMap<QString,uint_list_t> channum_to_index_map;
1409 QMap<QString,uint_list_t> callsign_to_index_map;
1411 for (
size_t i = 0; i < channels.size(); ++i)
1416 chan = channels.size() - i - 1;
1419 bool ndup = !channum_to_index_map[channels[chan].m_chanNum].empty();
1420 bool cdup = !callsign_to_index_map[channels[chan].m_callSign].empty();
1437 for (
auto & channel : channels)
1439 const uint_list_t &ndups = channum_to_index_map[channel.m_chanNum];
1440 for (
unsigned int ndup : ndups)
1447 const uint_list_t &cdups = callsign_to_index_map[channel.m_callSign];
1448 for (
unsigned int cdup : cdups)
1455 if (gotostartchannel)
1463 LOG(VB_GENERAL, LOG_ERR,
"GuideGrid: "
1464 "\n\t\t\tYou don't have any channels defined in the database."
1465 "\n\t\t\tGuide grid will have nothing to show you.");
1510 if (exact || channum.isEmpty())
1514 QVector<int> idxList;
1520 idxList.push_back(i);
1525 result = idxList[result];
1540 int mins = starttime.time().minute();
1541 mins = 5 * (mins / 5);
1547 infomap[
"starttime"] = timeStr;
1555 item->SetTextFromMap(infomap);
1575 QString querystr =
"WHERE program.chanid = :CHANID "
1576 " AND program.endtime >= :STARTTS "
1577 " AND program.starttime <= :ENDTS "
1578 " AND program.starttime >= :STARTLIMITTS "
1579 " AND program.manualid = 0 ";
1582 bindings[
":STARTTS"] = starttime;
1583 bindings[
":STARTLIMITTS"] = starttime.addDays(-1);
1595 bool allRows =
false;
1596 unsigned int numRows = 1;
1604 QVector<int> chanNums;
1605 QVector<ProgramList*> proglists;
1607 for (
unsigned int i = 0; i < numRows; ++i)
1609 unsigned int row = i + firstRow;
1628 chanNum = std::max(chanNum, 0);
1631 if (useExistingData)
1633 chanNums.push_back(chanNum);
1634 proglists.push_back(proglist);
1638 for (
unsigned int i = numRows;
1649 GuideStatus gs(firstRow, chanNums.size(), chanNums,
1660 const QDateTime& start,
1683 progPast = played * 100 / length;
1688 auto program = proglist->
begin();
1689 std::vector<ProgramInfo*> unknownlist;
1690 bool unknown =
false;
1694 if (program != proglist->
end() &&
1695 (ts >= (*program)->GetScheduledEndTime()))
1700 if ((program == proglist->
end()) ||
1701 (ts < (*program)->GetScheduledStartTime()))
1714 GuideGrid::tr(
"Unknown",
"Unknown program title"),
1716 unknownlist.push_back(proginfo);
1724 if (proginfo && proginfo == *program)
1730 proginfo = *program;
1744 for (
auto & pi : unknownlist)
1750 double ydifference = 0.0;
1751 double xdifference = 0.0;
1755 ydifference = programRect.width() /
1757 xdifference = programRect.height() /
1762 ydifference = programRect.height() /
1764 xdifference = programRect.width() /
1773 bool isCurrent =
false;
1806 for (
int z = x + 1; z < x + spread; ++z)
1819 tempRect = QRect((
int)(row * ydifference),
1820 (
int)(x * xdifference),
1822 (
int)(xdifference * pginfo->
m_spread));
1826 tempRect = QRect((
int)(x * xdifference),
1827 (
int)(row * ydifference),
1828 (
int)(xdifference * pginfo->
m_spread),
1833 if (tempRect.right() + 2 >= programRect.width())
1834 tempRect.setRight(programRect.width());
1835 if (tempRect.bottom() + 2 >= programRect.bottom())
1836 tempRect.setBottom(programRect.bottom());
1879 GuideGrid::tr(
"Unknown",
"Unknown program title") :
1882 row, cnt, tempRect, title,
1884 recStat, isCurrent);
1897 auto *me =
dynamic_cast<MythEvent *
>(event);
1901 const QString& message = me->
Message();
1903 if (message ==
"SCHEDULE_CHANGE")
1914 QString resultid = dce->GetId();
1915 QString resulttext = dce->GetResultText();
1916 int buttonnum = dce->GetResult();
1918 if (resultid ==
"deleterule")
1923 if ((buttonnum > 0) && !record->Delete())
1924 LOG(VB_GENERAL, LOG_ERR,
"Failed to delete recording rule");
1930 else if (resulttext == tr(
"Watch This Channel"))
1936 else if (resultid ==
"guidemenu")
1938 if (resulttext == tr(
"Record This"))
1942 else if (resulttext == tr(
"Change to Channel"))
1946 else if (resulttext == tr(
"Program Details"))
1950 else if (resulttext == tr(
"Reverse Channel Order"))
1956 else if (resulttext == tr(
"Channel Search"))
1960 else if (resulttext == tr(
"Add To Channel Group"))
1965 else if (resulttext == tr(
"Remove from Channel Group"))
1969 else if (resulttext == tr(
"Choose Channel Group"))
1973 else if (resulttext == tr(
"Recording Options"))
1977 else if (resulttext == tr(
"Jump to Time"))
1982 else if (resultid ==
"recmenu")
1984 if (resulttext == tr(
"Edit Recording Status"))
1988 else if (resulttext == tr(
"Edit Schedule"))
1992 else if (resulttext == tr(
"Show Upcoming"))
1996 else if (resulttext == tr(
"Previously Recorded"))
2000 else if (resulttext == tr(
"Custom Edit"))
2004 else if (resulttext == tr(
"Delete Rule"))
2010 else if (resultid ==
"channelgrouptogglemenu")
2014 if (changroupid > 0)
2017 else if (resultid ==
"channelgroupmenu")
2021 int changroupid = -1;
2023 if (resulttext == QObject::tr(
"All Channels"))
2033 QString changrpname;
2040 else if (resultid ==
"jumptotime")
2042 QDateTime datetime = dce->GetData().toDateTime();
2053 if (uge && uge->m_updater)
2056 delete uge->m_updater;
2057 uge->m_updater =
nullptr;
2073 const QVector<ProgramList*> &proglists,
2075 const std::list<GuideUIElement> &elements)
2077 for (
unsigned int i = 0; i < numRows; ++i)
2079 unsigned int row = i + firstRow;
2088 for (
const auto & r : elements)
2091 r.m_category, r.m_arrow, r.m_recType,
2092 r.m_recStat, r.m_selected);
2094 for (
unsigned int i = firstRow; i < firstRow + numRows; ++i)
2111 QVector<bool> &unavailables)
2115 for (
unsigned int y = 0; (y < (
unsigned int)
m_channelCount) && chinfo; ++y)
2125 bool unavailable =
false;
2126 bool try_alt =
false;
2145 unavailable =
false;
2151 if (unavailable && chinfo &&
2158 chinfos.push_back(chinfo);
2159 unavailables.push_back(unavailable);
2164 const QVector<bool> &unavailables)
2167 for (
int i = 0; i < chinfos.size(); ++i)
2170 bool unavailable = unavailables[i];
2174 QString state =
"available";
2176 state = (
m_changrpid == -1) ?
"unavailable" :
"favunavailable";
2178 state = (
m_changrpid == -1) ?
"available" :
"favourite";
2180 item->SetFontState(state);
2181 item->DisplayState(state,
"chanstatus");
2186 chinfo->
ToMap(infomap);
2187 item->SetTextFromMap(infomap);
2189 if (!chinfo->
m_icon.isEmpty())
2194 item->SetImage(iconurl,
"channelicon");
2217 chanNum = std::max(chanNum, 0);
2224 if (!chinfo->
m_icon.isEmpty())
2234 chinfo->
ToMap(infoMap);
2235 pginfo->
ToMap(infoMap);
2241 infoMap[
"title"] = tr(
"Unknown",
"Unknown program title");
2242 infoMap[
"titlesubtitle"] = tr(
"Unknown",
"Unknown program title");
2300 if (channels.empty())
2302 QString message = tr(
"You don't have any channel groups defined");
2307 if (okPopup->Create())
2315 QString label = tr(
"Select Channel Group");
2318 auto *menuPopup =
new MythDialogBox(label, popupStack,
"menuPopup");
2320 if (menuPopup->Create())
2322 if (mode == 0 || mode == 2)
2325 menuPopup->SetReturnEvent(
this,
"channelgrouptogglemenu");
2330 menuPopup->SetReturnEvent(
this,
"channelgroupmenu");
2331 menuPopup->AddButton(QObject::tr(
"All Channels"));
2334 for (
auto & channel : channels)
2336 menuPopup->AddButton(channel.m_name);
2364 chanNum = std::max(chanNum, 0);
2530 if (!datetime.isValid())
2542 if (newStartChannel < 0)
2597 if (!record->LoadByProgram(pginfo))
2603 QString message = tr(
"Delete '%1' %2 rule?")
2610 okPopup->SetReturnEvent(
this,
"deleterule");
2611 okPopup->SetData(QVariant::fromValue(record));
2613 if (okPopup->Create())
2681 QRegion r1 = QRegion(
m_area);
2704 QString message = tr(
"Jump to a specific date and time in the guide");
2711 if (timedlg->Create())
2713 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