8#include <QCoreApplication>
56#define LOC QString("PlaybackBox: ")
57#define LOC_WARN QString("PlaybackBox Warning: ")
58#define LOC_ERR QString("PlaybackBox Error: ")
88 return (dt1 < dt2 ? 1 : -1);
101 return (dt1 > dt2 ? 1 : -1);
226 QString sTitle = sortTitle.isEmpty()
227 ? title : sortTitle +
" - " + title;
256 sortprefix = QString(
"+%1").arg(1000 - recpriority, 3, 10, QChar(
'0'));
258 sortprefix = QString(
"-%1").arg(-recpriority, 3, 10, QChar(
'0'));
260 sTitle = sortprefix +
'-' + sTitle;
267 QString state(
"normal");
283 if ((state ==
"normal" || state ==
"running") &&
294 QString job =
"default";
307 job =
"commflagging";
327 const ProgramInfo &pginfo,
const QString &groupname)
330 if (groupname != pginfo.
GetTitle().toLower())
337 if (subtitle.trimmed().isEmpty())
347 list.push_back(QString() );
348 list.push_back(QString());
359 recordingID = list[0].toUInt();
365 if (recordingID == 0U) {
366 LOG(VB_GENERAL, LOG_ERR,
LOC +
"extract_one_del() invalid entry");
376 auto *pbb =
new PlaybackBox(mainStack,
"playbackbox", (
TV *)player, showTV);
390 m_groupDisplayName(
ProgramInfo::i18n(
"All Programs")),
391 m_recGroup(
"All Programs"),
392 m_watchGroupName(tr(
"Watch List")),
393 m_watchGroupLabel(m_watchGroupName.toLower()),
396 m_programInfoCache(this),
422 "DisplayGroupDefaultViewMask",
464 (displayCat &&
m_recGroup !=
"All Programs") ?
"category" :
"recgroup";
517 LOG(VB_GENERAL, LOG_ERR,
LOC +
518 "Theme is missing critical theme elements.");
579 "titlesubtitle|shortdate|starttime");
623 QString label = tr(
"Password for group '%1':").arg(newRecGroup);
661 const QString &grouplabel)
667 infoMap[
"title"] = grouplabel;
674 if (!groupname.isEmpty() && !
m_progLists[groupname].empty())
699 if (countInGroup >= 1)
702 float groupSize = 0.0;
704 for (
auto *
info : group)
708 uint64_t filesize =
info->GetFilesize();
715 groupSize += filesize;
719 desc = tr(
"There is/are %n recording(s) in this display "
720 "group, which consume(s) %1 GiB.",
"", countInGroup)
721 .arg(groupSize / 1024.0F / 1024.0F / 1024.0F, 0,
'f', 2);
725 desc = tr(
"There is no recording in this display group.");
728 infoMap[
"description"] = desc;
729 infoMap[
"rec_count"] = QString(
"%1").arg(countInGroup);
738 ratingState->
Reset();
758 bool force_preview_reload)
774 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
775 QString(
"UpdateUIListItem called with a title unknown "
776 "to us in m_recordingList\n\t\t\t%1")
783 "playlist",
"watched",
"preserve",
784 "cutlist",
"autoexpire",
"editing",
785 "bookmark",
"inuse",
"transcoded"
800 disp_flag_stat[8] = ((pginfo->
GetProgramFlags() & FL_TRANSCODED) != 0U);
802 for (
size_t i = 0; i <
disp_flags.size(); ++i)
808 bool is_sel,
bool force_preview_reload)
825 pginfo->ToMap(infoMap);
833 if (groupname == pginfo->GetTitle().toLower())
835 item->
SetText(tempSubTitle,
"titlesubtitle");
839 "titlesubtitlefull");
856 QString
rating = QString::number(pginfo->GetStars(10));
861 if (oldimgfile.isEmpty() || force_preview_reload)
868 pginfo->CalculateProgress(pginfo->QueryLastPlayPos());
870 pginfo->ToMap(infoMap);
904 if (arthost.isEmpty())
911 pginfo->GetInetRef(), pginfo->GetSeason(),
933 if (item->
GetText(
"is_item_initialized").isNull())
935 QMap<AudioProps, QString> audioFlags;
936 audioFlags[AUD_DOLBY] =
"dolby";
937 audioFlags[AUD_SURROUND] =
"surround";
938 audioFlags[AUD_STEREO] =
"stereo";
939 audioFlags[AUD_MONO] =
"mono";
941 QMap<VideoProps, QString> codecFlags;
942 codecFlags[VID_MPEG2] =
"mpeg2";
943 codecFlags[VID_AVC] =
"avc";
944 codecFlags[VID_HEVC] =
"hevc";
946 QMap<SubtitleProps, QString> subtitleFlags;
947 subtitleFlags[SUB_SIGNED] =
"deafsigned";
948 subtitleFlags[SUB_ONSCREEN] =
"onscreensub";
949 subtitleFlags[SUB_NORMAL] =
"subtitles";
950 subtitleFlags[SUB_HARDHEAR] =
"cc";
960 pginfo->ToMap(infoMap);
965 if (groupname == pginfo->GetTitle().toLower())
967 item->
SetText(tempSubTitle,
"titlesubtitle");
971 "titlesubtitlefull");
976 item->
DisplayState(QString::number(pginfo->GetStars(10)),
981 QMap<AudioProps, QString>::iterator ait;
982 for (ait = audioFlags.begin(); ait != audioFlags.end(); ++ait)
984 if (pginfo->GetAudioProperties() & ait.key())
988 uint props = pginfo->GetVideoProperties();
990 QMap<VideoProps, QString>::iterator cit;
991 for (cit = codecFlags.begin(); cit != codecFlags.end(); ++cit)
993 if (props & cit.key())
1000 if (props & VID_PROGRESSIVE)
1005 if (props & VID_1080)
1012 if (props & VID_1080)
1015 if (props & VID_720)
1017 if (!(props & (VID_4K | VID_1080 | VID_720)))
1019 if (props & VID_HDTV)
1021 else if (props & VID_WIDESCREEN)
1027 QMap<SubtitleProps, QString>::iterator sit;
1028 for (sit = subtitleFlags.begin(); sit != subtitleFlags.end(); ++sit)
1030 if (pginfo->GetSubtitleType() & sit.key())
1034 item->
DisplayState(pginfo->GetCategoryTypeString(),
"categorytype");
1037 item->
SetText(
"yes",
"is_item_initialized");
1054 const auto watchedPercent = pginfo->GetWatchedPercent();
1056 item->
SetProgress1(0, showProgress ? 100 : 0, watchedPercent);
1057 item->
SetProgress2(0, 100, pginfo->GetRecordedPercent());
1064 if (token.isEmpty())
1071 (
asAvailable == sel_pginfo->GetAvailableStatus()))
1087 if (list.size() < 5)
1089 LOG(VB_GENERAL, LOG_ERR,
"HandlePreviewEvent() -- too few args");
1090 for (
uint i = 0; i < (
uint) list.size(); i++)
1092 LOG(VB_GENERAL, LOG_INFO, QString(
"%1: %2")
1093 .arg(i).arg(list[i]));
1098 uint recordingID = list[0].toUInt();
1099 const QString& previewFile = list[1];
1100 const QString& message = list[2];
1103 for (
uint i = 4; i < (
uint) list.size(); i++)
1105 const QString& token = list[i];
1116 QString tokens(
"\n\t\t\ttokens: ");
1117 for (
uint i = 4; i < (
uint) list.size(); i++)
1118 tokens += list[i] +
", ";
1119 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1120 "Ignoring PREVIEW_SUCCESS, no matcing token" + tokens);
1124 if (previewFile.isEmpty())
1126 LOG(VB_GENERAL, LOG_ERR,
LOC +
1127 "Ignoring PREVIEW_SUCCESS, no preview file.");
1139 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1140 "Ignoring PREVIEW_SUCCESS, item no longer on screen.");
1145 LOG(VB_GUI, LOG_INFO,
LOC + QString(
"Loading preview %1,\n\t\t\tmsg %2")
1146 .arg(previewFile, message));
1148 item->
SetImage(previewFile,
"preview",
true);
1162 uint32_t flags = FL_NONE;
1167 QMap <QString, int>::iterator it;
1170 iconMap[
"commflagged"] = FL_COMMFLAG;
1171 iconMap[
"cutlist"] = FL_CUTLIST;
1172 iconMap[
"autoexpire"] = FL_AUTOEXP;
1173 iconMap[
"processing"] = FL_COMMPROCESSING;
1174 iconMap[
"editing"] = FL_EDITING;
1175 iconMap[
"bookmark"] = FL_BOOKMARK;
1176 iconMap[
"inuse"] = (FL_INUSERECORDING |
1179 iconMap[
"transcoded"] = FL_TRANSCODED;
1180 iconMap[
"watched"] = FL_WATCHED;
1181 iconMap[
"preserved"] = FL_PRESERVED;
1189 iconImage->
SetVisible((flags & (*it)) != 0U);
1203 iconMap[
"1dolby"] = AUD_DOLBY;
1204 iconMap[
"2surround"] = AUD_SURROUND;
1205 iconMap[
"3stereo"] = AUD_STEREO;
1209 bool haveIcon =
false;
1210 if (pginfo && iconState)
1225 if (iconState && !haveIcon)
1230 if (pginfo && iconState)
1235 if (props & VID_PROGRESSIVE)
1238 iconMap[
"hd1080p"] = VID_1080;
1243 iconMap[
"hd1080i"] = VID_1080;
1248 iconMap[
"widescreen"] = VID_WIDESCREEN;
1263 if (iconState && !haveIcon)
1266 iconMap[
"damaged"] = VID_DAMAGED;
1270 if (pginfo && iconState)
1285 if (iconState && !haveIcon)
1288 iconMap[
"deafsigned"] = SUB_SIGNED;
1289 iconMap[
"onscreensub"] = SUB_ONSCREEN;
1290 iconMap[
"subtitles"] = SUB_NORMAL;
1295 if (pginfo && iconState)
1310 if (iconState && !haveIcon)
1335 if (!freereportText && !usedProgress && !
GetChild(
"diskspacetotal") &&
1345 usageMap[
"diskspacetotal"] = locale.toString((freeSpaceTotal / 1024.0),
1347 usageMap[
"diskspaceused"] = locale.toString((freeSpaceUsed / 1024.0),
1349 usageMap[
"diskspacefree"] = locale.toString(
1350 ((freeSpaceTotal - freeSpaceUsed) / 1024.0),
1354 if (freeSpaceTotal > 0.0)
1355 perc = (100.0 * freeSpaceUsed) / freeSpaceTotal;
1357 usageMap[
"diskspacepercentused"] = QString::number((
int)perc);
1358 usageMap[
"diskspacepercentfree"] = QString::number(100 - (
int)perc);
1360 QString size = locale.toString(((freeSpaceTotal - freeSpaceUsed) / 1024.0),
1363 QString usestr = tr(
"%1% used, %2 GB free",
"Diskspace")
1364 .arg(QString::number((
int)perc),
1368 freereportText->
SetText(usestr);
1372 usedProgress->
SetTotal((
int)freeSpaceTotal);
1373 usedProgress->
SetUsed((
int)freeSpaceUsed);
1396 const QString& key = (*it);
1397 QString
tmp = (key ==
"All Programs") ?
"All" : key;
1404 QVariant::fromValue(key));
1408 item->SetText(name);
1420 int best_pref = INT_MAX;
1423 QStringList::iterator it;
1426 const QString& groupname = (*it);
1429 QVariant::fromValue(groupname.toLower()));
1431 int pref = groupPreferences.indexOf(groupname.toLower());
1432 if ((pref >= 0) && (pref < best_pref))
1439 QString displayName = groupname;
1440 if (displayName.isEmpty())
1449 item->SetText(groupname,
"groupname");
1450 item->SetText(displayName,
"name");
1451 item->SetText(displayName);
1453 int count =
m_progLists[groupname.toLower()].size();
1454 item->SetText(QString::number(count),
"reccount");
1471 QVariant::fromValue(Iqs->first));
1472 item->SetText(Iqs->first);
1480 QString newRecGroup = sel_item->
GetData().toString();
1496 if (!nextGroup.isEmpty())
1505 QString groupname = sel_item->
GetData().toString();
1506 QString grouplabel = sel_item->
GetText();
1520 ProgramMap::iterator pmit =
m_progLists.find(groupname);
1526 for (
auto & prog : progList)
1529 prog->GetAvailableStatus() ==
asDeleted)
1538 if (!progList.
empty())
1543 tr(
"There are no recordings available") :
1544 tr(
"There are no recordings in your current view");
1552 if (grouplabel.startsWith(
"Watch List") ||
1553 grouplabel.startsWith(
"All Programs"))
1560 if (pginfo ==
nullptr)
1574 if (!item->
GetText().isEmpty())
1583 QStringList &groupSelPref, QStringList &itemSelPref,
1584 QStringList &itemTopPref)
1590 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1592 i < groupList->GetCount(); i++)
1596 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1600 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i++)
1604 itemSelPref.push_back(groupSelPref.front());
1605 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1607 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i--)
1611 itemSelPref.push_back(groupSelPref.front());
1612 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1616 for (
int i = topPos + 1; i >= topPos - 1; i--)
1618 if (i >= 0 && i < recordingList->GetCount())
1624 itemTopPref.push_front(QString::number(pginfo->GetRecordingID()));
1625 itemTopPref.push_front(groupSelPref.front());
1629 itemTopPref.push_back(groupSelPref.front());
1630 itemTopPref.push_back(QString::number(pginfo->GetRecordingID()));
1640 const QStringList &groupSelPref,
const QStringList &itemSelPref,
1641 const QStringList &itemTopPref)
1646 if (!prefSelGroup ||
1647 !groupSelPref.contains(prefSelGroup->
GetData().toString()) ||
1648 !itemSelPref.contains(prefSelGroup->
GetData().toString()))
1654 QString groupname = prefSelGroup->
GetData().toString();
1658 for (
uint i = 0; i+1 < (
uint)itemSelPref.size(); i+=2)
1660 if (itemSelPref[i] != groupname)
1663 uint recordingID = itemSelPref[i+1].toUInt();
1668 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1671 i = itemSelPref.size();
1679 for (
uint i = 0; i+1 < (
uint)itemTopPref.size(); i+=2)
1681 if (itemTopPref[i] != groupname)
1684 uint recordingID = itemTopPref[i+1].toUInt();
1689 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1692 i = itemTopPref.size();
1701 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect success (%1,%2)")
1702 .arg(sel).arg(top));
1709 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect failure (%1,%2)")
1710 .arg(sel).arg(top));
1720 QStringList groupSelPref;
1721 QStringList itemSelPref;
1722 QStringList itemTopPref;
1724 groupSelPref, itemSelPref, itemTopPref))
1733 QMap<uint, AvailableStatusType> asCache;
1739 uint asRecordingID = prog->GetRecordingID();
1740 asCache[asRecordingID] = prog->GetAvailableStatus();
1759 bool isAllProgsGroup = (
m_recGroup ==
"All Programs");
1760 QMap<QString, QString> sortedList;
1761 QMap<int, QString> searchRule;
1762 QMap<int, QDateTime> recidLastEventTime;
1763 QMap<int, ProgramInfo*> recidWatchListProgram;
1774 query.
prepare(
"SELECT recordid,title FROM record "
1775 "WHERE search > 0 AND search != :MANUAL;");
1780 while (query.
next())
1782 QString tmpTitle = query.
value(1).toString();
1784 searchRule[query.
value(0).toInt()] = tmpTitle;
1790 bool isUnknownCategory = (
m_recGroup == tr(
"Unknown"));
1791 bool isDeletedGroup = (
m_recGroup ==
"Deleted");
1792 bool isLiveTvGroup = (
m_recGroup ==
"LiveTV");
1794 std::vector<ProgramInfo*> list;
1797 for (
auto *
p : list)
1799 if (
p->IsDeletePending())
1804 const QString& pRecgroup(
p->GetRecordingGroup());
1805 const bool isLiveTVProg(pRecgroup ==
"LiveTV");
1812 if (pRecgroup ==
"Deleted")
1816 if (!isDeletedGroup)
1821 !isLiveTvGroup && isLiveTVProg)
1830 else if (isCategoryFilter)
1833 if (isUnknownCategory ? !
p->GetCategory().isEmpty()
1838 else if (!isAllProgsGroup && pRecgroup !=
m_recGroup)
1843 if (
p->GetTitle().isEmpty())
1844 p->SetTitle(tr(
"_NO_TITLE_"));
1851 uint asRecordingID =
p->GetRecordingID();
1852 if (asCache.contains(asRecordingID))
1853 p->SetAvailableStatus(asCache[asRecordingID],
"UpdateUILists");
1859 QString tmpTitle = tr(
"Live TV");
1860 sortedList[tmpTitle.toLower()] = tmpTitle;
1862 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1870 p->GetTitle(),
p->GetSortTitle(),
m_viewMask, titleSort,
1871 p->GetRecordingPriority());
1872 sTitle = sTitle.toLower();
1874 if (!sortedList.contains(sTitle))
1875 sortedList[sTitle] =
p->GetTitle();
1876 m_progLists[sortedList[sTitle].toLower()].push_front(
p);
1877 m_progLists[sortedList[sTitle].toLower()].setAutoDelete(
false);
1882 !pRecgroup.isEmpty() && !isLiveTVProg)
1884 sortedList[pRecgroup.toLower()] = pRecgroup;
1886 m_progLists[pRecgroup.toLower()].setAutoDelete(
false);
1892 QString catl =
p->GetCategory().toLower();
1893 sortedList[catl] =
p->GetCategory();
1899 !searchRule[
p->GetRecordingRuleID()].isEmpty() &&
1900 p->GetTitle() != searchRule[
p->GetRecordingRuleID()])
1902 QString tmpTitle = QString(
"(%1)")
1903 .arg(searchRule[
p->GetRecordingRuleID()]);
1904 sortedList[tmpTitle.toLower()] = tmpTitle;
1906 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1910 !isLiveTVProg && pRecgroup !=
"Deleted")
1912 int rid =
p->GetRecordingRuleID();
1913 auto letIt = recidLastEventTime.find(rid);
1914 if (letIt == recidLastEventTime.end() || *letIt < p->GetLastModifiedTime())
1916 recidLastEventTime[rid] =
p->GetLastModifiedTime();
1922 LOG(VB_FILE, LOG_INFO, QString(
"Auto-expire off: %1")
1923 .arg(
p->GetTitle()));
1925 else if (
p->IsWatched())
1928 LOG(VB_FILE, LOG_INFO,
1929 QString(
"Marked as 'watched': %1")
1930 .arg(
p->GetTitle()));
1934 auto wlpIt = recidWatchListProgram.find(rid);
1935 if (wlpIt == recidWatchListProgram.end())
1937 recidWatchListProgram[rid] =
p;
1941 (*wlpIt)->SetRecordingPriority2(
wlEarlier);
1942 LOG(VB_FILE, LOG_INFO,
1943 QString(
"Not the earliest: %1")
1944 .arg((*wlpIt)->GetTitle()));
1946 recidWatchListProgram[rid] =
p;
1951 LOG(VB_FILE, LOG_INFO,
1952 QString(
"Not the earliest: %1")
1953 .arg(
p->GetTitle()));
1961 for (
auto *
p : std::as_const(recidWatchListProgram))
1970 if (sortedList.empty())
1972 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"SortedList is Empty");
1976 if (!isAllProgsGroup)
1988 if (episodeSort ==
"OrigAirDate")
1990 QMap<QString, ProgramList>::Iterator Iprog;
1993 if (!Iprog.key().isEmpty())
1995 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
2002 else if (episodeSort ==
"Id")
2004 QMap<QString, ProgramList>::Iterator Iprog;
2007 if (!Iprog.key().isEmpty())
2009 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
2016 else if (episodeSort ==
"Date")
2018 QMap<QString, ProgramList>::iterator it;
2021 if (!it.key().isEmpty())
2023 std::stable_sort((*it).begin(), (*it).end(),
2030 else if (episodeSort ==
"Season")
2032 QMap<QString, ProgramList>::iterator it;
2035 if (!it.key().isEmpty())
2037 std::stable_sort((*it).begin(), (*it).end(),
2048 query.
prepare(
"SELECT recordid, last_delete FROM record;");
2052 while (query.
next())
2054 int recid = query.
value(0).toInt();
2056 QDateTime last_delete =
2059 if (last_delete.isValid())
2061 auto it = recidLastEventTime.find(recid);
2062 if (it != recidLastEventTime.end() && last_delete > *it)
2064 recidLastEventTime[recid] = last_delete;
2073 int recid = (*pit)->GetRecordingRuleID();
2075 (*pit)->SetRecordingPriority2(recidLastEventTime[recid].toSecsSinceEpoch()/60);
2077 LOG(VB_FILE, LOG_INFO, QString(
" %1 %2 %3")
2080 .arg((*pit)->GetRecordingPriority2())
2081 .arg((*pit)->GetTitle()));
2095 (
std::find(sortedList.cbegin(), sortedList.cend(), tr(
"Live TV"))
2096 == sortedList.cend()))
2112 query.
prepare(
"SELECT distinct recgroup from recorded WHERE "
2113 "deletepending = 0 ORDER BY recgroup");
2117 while (query.
next())
2119 name = query.
value(0).toString();
2120 if (name !=
"Deleted" && name !=
"LiveTV" && !name.startsWith(
'.'))
2134 for (
auto it = sortedList.keyValueBegin();
2135 it != sortedList.keyValueEnd(); ++it)
2137 first = (*it).first.at(0).toUpper();
2158 groupSelPref, itemSelPref, itemTopPref);
2171 while (!
tmp.isEmpty())
2183 QCoreApplication::postEvent(
2197 const bool ignoreBookmark =
false;
2198 const bool ignoreProgStart =
false;
2199 const bool ignoreLastPlayPos =
false;
2200 const bool underNetworkControl =
false;
2202 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2203 underNetworkControl);
2216 const bool ignoreBookmark =
false;
2217 const bool ignoreProgStart =
true;
2218 const bool ignoreLastPlayPos =
true;
2219 const bool underNetworkControl =
false;
2221 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2222 underNetworkControl);
2235 const bool ignoreBookmark =
true;
2236 const bool ignoreProgStart =
true;
2237 const bool ignoreLastPlayPos =
true;
2238 const bool underNetworkControl =
false;
2240 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2241 underNetworkControl);
2254 const bool ignoreBookmark =
true;
2255 const bool ignoreProgStart =
true;
2256 const bool ignoreLastPlayPos =
false;
2257 const bool underNetworkControl =
false;
2259 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2260 underNetworkControl);
2264 bool ignoreBookmark,
2265 bool ignoreProgStart,
2266 bool ignoreLastPlayPos,
2267 bool underNetworkControl)
2271 Play(pginfo,
false, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos, underNetworkControl);
2318 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2320 QString(
"availability status: %1 ")
2321 .arg(pginfo->GetAvailableStatus()));
2324 tr(
"This recording is already being deleted"));
2326 else if (!pginfo->QueryIsDeleteCandidate())
2329 pginfo->QueryIsInUse(byWho);
2331 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2333 QString(
"delete candidate: %1 in use by %2")
2334 .arg(pginfo->QueryIsDeleteCandidate()).arg(byWho));
2336 if (byWho.isEmpty())
2339 tr(
"This recording is already being deleted"));
2344 tr(
"This recording is currently in use by:") +
"\n" +
2392 if (which ==
"groupmenu")
2412 else if (which ==
"actionmenu")
2426 QString label = tr(
"Group List Menu");
2467 bool inPlaylist,
bool ignoreBookmark,
bool ignoreProgStart,
2468 bool ignoreLastPlayPos,
bool underNetworkControl)
2470 bool playCompleted =
false;
2498 ignoreProgStart =
true;
2514 QCoreApplication::postEvent(
2521 return playCompleted;
2525 bool forceMetadataDelete)
2532 if (!forceMetadataDelete &&
2542 if (!forceMetadataDelete)
2547 forceMetadataDelete, forgetHistory);
2577 label = tr(
"Are you sure you want to delete:");
break;
2579 label = tr(
"Recording file does not exist.\n"
2580 "Are you sure you want to delete:");
2583 label = tr(
"Are you sure you want to stop:");
break;
2590 if (delItem !=
nullptr)
2640 tr(
"Yes, delete it and the remaining %1 list items")
2649 nullptr, !defaultIsYes);
2653 nullptr, !defaultIsYes);
2660 tr(
"No, and keep the remaining %1 list items")
2661 .arg(other_delete_cnt),
2681 tr(
"This recording is currently in "
2682 "use by:") +
"\n" + byWho);
2688 tr(
"This recording is currently "
2695 tr(
"This recording is currently being "
2696 "deleted and is unavailable"));
2701 tr(
"This recording has been "
2702 "deleted and is unavailable"));
2707 tr(
"The file for this recording can "
2713 tr(
"The file for this recording is "
2719 tr(
"This recording is not yet "
2726 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2727 "all items in the playlist",
"",
m_playList.size());
2739 menu->AddItem(tr(
"Toggle playlist for this Category/Title"),
2744 menu->AddItem(tr(
"Toggle playlist for this Group"),
2750 menu->AddItem(tr(
"Toggle playlist for this recording"),
2757 menu->AddItem(tr(
"Delete, and allow re-record"),
2765 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2766 "all items in the playlist",
"",
m_playList.size());
2783 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2784 "all items in the playlist",
"",
m_playList.size());
2790 QList<uint>::Iterator it;
2791 bool isTranscoding =
true;
2792 bool isFlagging =
true;
2793 bool isMetadataLookup =
true;
2794 bool isRunningUserJob1 =
true;
2795 bool isRunningUserJob2 =
true;
2796 bool isRunningUserJob3 =
true;
2797 bool isRunningUserJob4 =
true;
2807 isTranscoding =
false;
2815 isMetadataLookup =
false;
2819 isRunningUserJob1 =
false;
2823 isRunningUserJob2 =
false;
2827 isRunningUserJob3 =
false;
2831 isRunningUserJob4 =
false;
2832 if (!isTranscoding && !isFlagging && !isRunningUserJob1 &&
2833 !isRunningUserJob2 && !isRunningUserJob3 && !isRunningUserJob4)
2848 if (!isMetadataLookup)
2854 if (!command.isEmpty())
2858 if (!isRunningUserJob1)
2860 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2865 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2871 if (!command.isEmpty())
2875 if (!isRunningUserJob2)
2877 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2882 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2888 if (!command.isEmpty())
2892 if (!isRunningUserJob3)
2894 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2899 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2905 if (!command.isEmpty())
2909 if (!isRunningUserJob4)
2911 menu->AddItem(QString(
"%1 %2").arg(tr(
"Begin"), jobTitle),
2916 menu->AddItem(QString(
"%1 %2").arg(tr(
"Stop"), jobTitle),
2987 menu->AddItem(tr(
"Play from last played position"),
2990 menu->AddItem(tr(
"Play from bookmark"),
2992 menu->AddItem(tr(
"Play from beginning"),
2995 menu->AddItem(tr(
"Clear last played position"),
3011 tr(
"Disable Auto Expire") : tr(
"Enable Auto Expire");
3013 tr(
"Do not preserve this episode") : tr(
"Preserve this episode");
3034 menu->AddItem(tr(
"Edit Recording Schedule"),
3048static const std::array<const int,kMaxJobs>
kJobs
3079 const std::array<const bool,kMaxJobs> add
3089 const std::array<const QString,kMaxJobs*2> desc
3092 tr(
"Stop Transcoding"), tr(
"Begin Transcoding"),
3093 tr(
"Stop Commercial Detection"), tr(
"Begin Commercial Detection"),
3094 tr(
"Stop Metadata Lookup"), tr(
"Begin Metadata Lookup"),
3101 for (
size_t i = 0; i <
kMaxJobs; i++)
3106 QString stop_desc = desc[(i*2)+0];
3107 QString start_desc = desc[(i*2)+1];
3109 if (start_desc.toUInt())
3112 "UserJobDesc"+start_desc, tr(
"User Job") +
" #" + start_desc);
3113 stop_desc = tr(
"Stop") +
' ' + jobTitle;
3114 start_desc = tr(
"Begin") +
' ' + jobTitle;
3122 menu->AddItem((running) ? stop_desc : start_desc,
3123 kMySlots[(i * 2) + (running ? 0 : 1)], submenu);
3131 QString label = tr(
"Transcoding profiles");
3135 menu->AddItemV(tr(
"Default"), QVariant::fromValue(-1));
3136 menu->AddItemV(tr(
"Autodetect"), QVariant::fromValue(0));
3139 query.
prepare(
"SELECT r.name, r.id "
3140 "FROM recordingprofiles r, profilegroups p "
3141 "WHERE p.name = 'Transcoders' "
3142 "AND r.profilegroup = p.id "
3143 "AND r.name != 'RTjpeg/MPEG4' "
3144 "AND r.name != 'MPEG2' ");
3152 while (query.
next())
3154 QString transcoder_name = query.
value(0).toString();
3155 int transcoder_id = query.
value(1).toInt();
3158 if (transcoder_name ==
"High Quality")
3159 transcoder_name = tr(
"High Quality");
3160 else if (transcoder_name ==
"Medium Quality")
3161 transcoder_name = tr(
"Medium Quality");
3162 else if (transcoder_name ==
"Low Quality")
3163 transcoder_name = tr(
"Low Quality");
3165 menu->AddItemV(transcoder_name, QVariant::fromValue(transcoder_id));
3190 label = tr(
"Recording file cannot be found");
3192 label = tr(
"Recording file contains no data");
3194 tr(
"Recording Options");
3236 bool sameProgram =
false;
3323 QString timedate = QString(
"%1 - %2")
3337 return QString(
"\n%1%2\n%3").arg(title, extra, timedate);
3342 QList<uint>::Iterator it;
3400 QList<uint>::Iterator it;
3405 if (pginfo !=
nullptr)
3476 "",
"", jobHost, jobFlags);
3483 QList<uint>::Iterator it;
3518 QString forceDeleteStr(
"0");
3528 list.push_back(forceDeleteStr);
3529 list.push_back(forgetHistory ?
"1" :
"0");
3550 uint recordingID = 0;
3557 uint recordingID = 0;
3573 QCoreApplication::postEvent(
this, e);
3581 QString title = pginfo->
GetTitle().toLower();
3613 const QString& recgroup)
3616 std::array<ProgramList::iterator,2> _it {
3618 std::array<ProgramList::iterator,2> _end {
3621 if (recgroup !=
"LiveTV")
3623 swap( _it[0], _it[1]);
3624 swap(_end[0], _end[1]);
3627 for (
uint i = 0; i < 2; i++)
3630 const auto& end = _end[i];
3631 for (; it != end; ++it)
3633 if ((*it)->GetRecordingID() == recordingID)
3656 pginfo->SaveWatched(on);
3697 pginfo->SavePreserve(on);
3716 for (
auto *pl : std::as_const(
m_progLists[groupname]))
3718 if (pl && (pl->GetAvailableStatus() ==
asAvailable))
3792 QStringList tokens = command.simplified().split(
" ");
3794 if (tokens.size() >= 4 && (tokens[1] ==
"PLAY" || tokens[1] ==
"RESUME"))
3796 if (tokens.size() == 6 && tokens[2] ==
"PROGRAM")
3798 int clientID = tokens[5].toInt();
3800 LOG(VB_GENERAL, LOG_INFO,
LOC +
3801 QString(
"NetworkControl: Trying to %1 program '%2' @ '%3'")
3802 .arg(tokens[1], tokens[3], tokens[4]));
3806 LOG(VB_GENERAL, LOG_ERR,
LOC +
3807 "NetworkControl: Already playing");
3809 QString msg = QString(
3810 "NETWORK_CONTROL RESPONSE %1 ERROR: Unable to play, "
3811 "player is already playing another recording.")
3819 uint chanid = tokens[3].toUInt();
3825 QString msg = QString(
"NETWORK_CONTROL RESPONSE %1 OK")
3832 const bool ignoreBookmark = (tokens[1] ==
"PLAY");
3833 const bool ignoreProgStart =
true;
3834 const bool ignoreLastPlayPos =
true;
3835 const bool underNetworkControl =
true;
3836 PlayX(pginfo, ignoreBookmark, ignoreProgStart,
3837 ignoreLastPlayPos, underNetworkControl);
3841 QString message = QString(
"NETWORK_CONTROL RESPONSE %1 "
3842 "ERROR: Could not find recording for "
3844 .arg(tokens[5], tokens[3], tokens[4]);
3855 if ((event->key() == Qt::Key_LaunchMedia) &&
3856 (event->modifiers() ==
3857 (Qt::ShiftModifier |
3858 Qt::ControlModifier |
3861 Qt::KeypadModifier)))
3875 QStringList actions;
3879 for (
int i = 0; i < actions.size() && !handled; ++i)
3881 const QString&
action = actions[i];
3886 else if (
action ==
"MENU")
3890 else if (
action ==
"NEXTFAV")
3897 else if (
action ==
"TOGGLEFAV")
3923 if (!nextGroup.isEmpty())
3926 else if (
action ==
"NEXTVIEW")
3933 else if (
action ==
"PREVVIEW")
3948 else if (
action ==
"CHANGERECGROUP")
3952 else if (
action ==
"CHANGEGROUPVIEW")
3956 else if (
action ==
"EDIT")
3968 else if (
action ==
"CUSTOMEDIT")
3970 else if (
action ==
"GUIDE")
3972 else if (
action ==
"UPCOMING")
4001 QString resultid = dce->
GetId();
4003 if (resultid ==
"transcode" && dce->GetResult() >= 0)
4008 auto *me =
dynamic_cast<MythEvent *
>(event);
4012 const QString& message = me->
Message();
4014 if (message.startsWith(
"RECORDING_LIST_CHANGE"))
4016 QStringList tokens = message.simplified().split(
" ");
4017 uint recordingID = 0;
4018 if (tokens.size() >= 3)
4019 recordingID = tokens[2].toUInt();
4021 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
4031 else if (recordingID && (tokens[1] ==
"ADD"))
4040 else if (recordingID && (tokens[1] ==
"DELETE"))
4049 else if (message.startsWith(
"NETWORK_CONTROL"))
4051 QStringList tokens = message.simplified().split(
" ");
4052 if ((tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
4059 Qt::KeyboardModifiers modifiers =
4061 Qt::ControlModifier |
4065 auto *keyevent =
new QKeyEvent(QEvent::KeyPress,
4066 Qt::Key_LaunchMedia, modifiers);
4069 keyevent =
new QKeyEvent(QEvent::KeyRelease,
4070 Qt::Key_LaunchMedia, modifiers);
4074 else if (message.startsWith(
"UPDATE_FILE_SIZE"))
4076 QStringList tokens = message.simplified().split(
" ");
4077 if (tokens.size() >= 3)
4080 uint recordingID = tokens[1].toUInt();
4081 uint64_t filesize = tokens[2].toLongLong(&ok);
4087 recordingID, filesize,
4092 else if (message ==
"UPDATE_UI_LIST")
4102 else if (message.startsWith(
"UPDATE_UI_ITEM"))
4104 QStringList tokens = message.simplified().split(
" ");
4105 if (tokens.size() < 3)
4108 uint recordingID = tokens[1].toUInt();
4114 else if (message ==
"UPDATE_USAGE_UI")
4118 else if (message ==
"RECONNECT_SUCCESS")
4122 else if (message ==
"LOCAL_PBB_DELETE_RECORDINGS")
4125 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i+=3)
4127 uint recordingID = me->ExtraDataList()[i+0].toUInt();
4133 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4134 QString(
"LOCAL_PBB_DELETE_RECORDINGS - "
4135 "No matching recording %1")
4140 QString forceDeleteStr = me->ExtraDataList()[i+1];
4141 QString forgetHistoryStr = me->ExtraDataList()[i+2];
4144 list.push_back(forceDeleteStr);
4145 list.push_back(forgetHistoryStr);
4147 "LOCAL_PBB_DELETE_RECORDINGS");
4159 else if (message ==
"DELETE_SUCCESSES")
4163 else if (message ==
"DELETE_FAILURES")
4165 if (me->ExtraDataList().size() < 3)
4168 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i += 3)
4171 me->ExtraDataList()[i+0].toUInt());
4179 bool forceDelete = me->ExtraDataList()[1].toUInt() != 0U;
4188 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4189 "Delete failures not handled due to "
4190 "pre-existing popup.");
4197 else if (message ==
"PREVIEW_SUCCESS")
4201 else if (message ==
"PREVIEW_FAILED" && me->ExtraDataCount() >= 5)
4203 for (
uint i = 4; i < (
uint) me->ExtraDataCount(); i++)
4205 const QString& token = me->ExtraData(i);
4211 else if (message ==
"AVAILABILITY" && me->ExtraDataCount() == 8)
4213 static constexpr std::chrono::milliseconds kMaxUIWaitTime = 10s;
4214 QStringList list = me->ExtraDataList();
4215 uint recordingID = list[0].toUInt();
4218 uint64_t fs = list[3].toULongLong();
4220 tm.setHMS(list[4].toUInt(), list[5].toUInt(),
4221 list[6].toUInt(), list[7].toUInt());
4222 QTime now = QTime::currentTime();
4223 auto time_elapsed = std::chrono::milliseconds(tm.msecsTo(now));
4224 if (time_elapsed < 0ms)
4225 time_elapsed += 24h;
4236 if (time_elapsed >= kMaxUIWaitTime)
4245 (time_elapsed < kMaxUIWaitTime))
4255 const bool ignoreBookmark =
false;
4256 const bool ignoreProgStart =
false;
4257 const bool ignoreLastPlayPos =
true;
4258 const bool underNetworkControl =
false;
4260 ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
4261 underNetworkControl);
4269 QCoreApplication::postEvent(
4273 if (old_avail != availableStatus)
4276 else if ((message ==
"PLAY_PLAYLIST") && !
m_playListPlay.empty())
4290 const bool ignoreBookmark =
false;
4291 const bool ignoreProgStart =
true;
4292 const bool ignoreLastPlayPos =
true;
4293 const bool underNetworkControl =
false;
4295 Play(*pginfo,
true, ignoreBookmark, ignoreProgStart,
4296 ignoreLastPlayPos, underNetworkControl);
4298 else if ((message ==
"SET_PLAYBACK_URL") && (me->ExtraDataCount() == 2))
4300 uint recordingID = me->ExtraData(0).toUInt();
4303 info->SetPathname(me->ExtraData(1));
4305 else if ((message ==
"FOUND_ARTWORK") && (me->ExtraDataCount() >= 5))
4308 uint recordingID = me->ExtraData(3).toUInt();
4309 const QString& group = me->ExtraData(4);
4310 const QString& fn = me->ExtraData(5);
4324 else if (!group.isEmpty() &&
4334 else if (message ==
"EXIT_TO_MENU" ||
4335 message ==
"CANCEL_PLAYLIST")
4350 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4351 QString(
"Failed to remove %1, reloading list")
4360 groupname = sel_item->
GetData().toString();
4365 auto pit = (*git).begin();
4366 while (pit != (*git).end())
4368 if ((*pit)->GetRecordingID() == recordingID)
4370 if (!git.key().isEmpty() && git.key() == groupname)
4374 QVariant::fromValue(*pit));
4378 if (item_cur && (item_by_data == item_cur))
4388 pit = (*git).erase(pit);
4398 if (!groupname.isEmpty() && (git.key() == groupname))
4407 sel_item = next_item;
4410 groupname = sel_item->
GetData().toString();
4439 if (pginfo ==
nullptr)
4449 QCoreApplication::postEvent(
this,
new MythEvent(
"UPDATE_UI_LIST"));
4456 if (helpPopup->Create())
4466 if (viewPopup->Create())
4488 QStringList groupNames;
4489 QStringList displayNames;
4491 QStringList displayGroups;
4497 uint totalItems = 0;
4500 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Groups")));
4501 groupNames.append(
"");
4504 query.
prepare(
"SELECT recgroup, COUNT(title) FROM recorded "
4505 "WHERE deletepending = 0 AND watched <= :WATCHED "
4506 "GROUP BY recgroup");
4510 while (query.
next())
4512 QString dispGroup = query.
value(0).toString();
4516 (dispGroup !=
"Deleted"))
4517 totalItems += items;
4519 groupNames.append(dispGroup);
4521 dispGroup = (dispGroup ==
"Default") ? tr(
"Default") : dispGroup;
4522 dispGroup = (dispGroup ==
"Deleted") ? tr(
"Deleted") : dispGroup;
4523 dispGroup = (dispGroup ==
"LiveTV") ? tr(
"Live TV") : dispGroup;
4525 displayNames.append(tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup));
4532 displayNames.push_front(tr(
"%1 [%n item(s)]",
nullptr, totalItems)
4534 groupNames.push_front(
"All Programs");
4538 query.
prepare(
"SELECT DISTINCT category, COUNT(title) FROM recorded "
4539 "WHERE deletepending = 0 AND watched <= :WATCHED "
4540 "GROUP BY category");
4544 int unknownCount = 0;
4545 while (query.
next())
4548 QString dispGroup = query.
value(0).toString();
4549 if (dispGroup.isEmpty())
4551 unknownCount += items;
4552 dispGroup = tr(
"Unknown");
4554 else if (dispGroup == tr(
"Unknown"))
4556 unknownCount += items;
4560 (dispGroup != tr(
"Unknown")))
4562 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4563 groups += dispGroup;
4569 if (unknownCount > 0)
4571 QString dispGroup = tr(
"Unknown");
4572 uint items = unknownCount;
4573 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4574 groups += dispGroup;
4581 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Categories")));
4582 groupNames.append(
"");
4584 displayGroups.sort();
4585 QStringList::iterator it;
4586 for (it = displayGroups.begin(); it != displayGroups.end(); ++it)
4587 displayNames.append(*it);
4588 for (it = groups.begin(); it != groups.end(); ++it)
4589 groupNames.append(*it);
4591 QString label = tr(
"Change Filter");
4596 if (recGroupPopup->Create())
4608 delete recGroupPopup;
4625 QString newRecGroup = recGroup;
4627 if (newRecGroup.isEmpty())
4634 newRecGroup =
"Default";
4636 newRecGroup =
"All Programs";
4638 newRecGroup =
"LiveTV";
4640 newRecGroup =
"Deleted";
4672 query.
prepare(
"SELECT recgroup, password FROM recgroups "
4673 "WHERE password IS NOT NULL AND password <> '';");
4677 while (query.
next())
4679 QString recgroup = query.
value(0).toString();
4682 recgroup =
"Default";
4684 recgroup =
"All Programs";
4686 recgroup =
"LiveTV";
4688 recgroup =
"Deleted";
4716 "SELECT g.recgroup, COUNT(r.title) FROM recgroups g "
4717 "LEFT JOIN recorded r ON g.recgroupid=r.recgroupid AND r.deletepending = 0 "
4718 "WHERE g.recgroupid != 2 AND g.recgroupid != 3 "
4719 "GROUP BY g.recgroupid ORDER BY g.recgroup");
4721 QStringList displayNames(tr(
"Add New"));
4722 QStringList groupNames(
"addnewgroup");
4727 while (query.
next())
4729 QString dispGroup = query.
value(0).toString();
4730 groupNames.push_back(dispGroup);
4732 if (dispGroup ==
"Default")
4733 dispGroup = tr(
"Default");
4734 else if (dispGroup ==
"LiveTV")
4735 dispGroup = tr(
"Live TV");
4736 else if (dispGroup ==
"Deleted")
4737 dispGroup = tr(
"Deleted");
4739 displayNames.push_back(tr(
"%1 [%n item(s)]",
"", query.
value(1).toInt())
4743 QString label = tr(
"Select Recording Group") +
4749 if (rgChanger->Create())
4779 QStringList groupNames(tr(
"Default"));
4780 QStringList displayNames(
"Default");
4783 for (
const auto& name : std::as_const(list))
4785 displayNames.push_back(name);
4786 groupNames.push_back(name);
4789 QString label = tr(
"Select Playback Group") +
4795 if (pgChanger->Create())
4809 QList<uint>::Iterator it;
4814 if (tmpItem !=
nullptr)
4826 QList<uint>::Iterator it;
4831 if (tmpItem !=
nullptr)
4849 if (editMetadata->Create())
4857 delete editMetadata;
4862 const QString &newSubtitle,
4863 const QString &newDescription,
4864 const QString &newInetref,
4880 if (groupname == pginfo->GetTitle().toLower() &&
4881 newTitle != pginfo->GetTitle())
4887 QString tempSubTitle = newTitle;
4888 if (!newSubtitle.trimmed().isEmpty())
4889 tempSubTitle = QString(
"%1 - \"%2\"")
4890 .arg(tempSubTitle, newSubtitle);
4896 if (newSeason > 0 || newEpisode > 0)
4900 seasone = QString(
"s%1e%2")
4903 seasonx = QString(
"%1x%2")
4908 item->
SetText(tempSubTitle,
"titlesubtitle");
4909 item->
SetText(newTitle,
"title");
4910 item->
SetText(newSubtitle,
"subtitle");
4911 item->
SetText(newInetref,
"inetref");
4912 item->
SetText(seasonx,
"00x00");
4913 item->
SetText(seasone,
"s00e00");
4914 item->
SetText(season,
"season");
4915 item->
SetText(episode,
"episode");
4916 if (newDescription !=
nullptr)
4917 item->
SetText(newDescription,
"description");
4920 pginfo->SaveInetRef(newInetref);
4921 pginfo->SaveSeasonEpisode(newSeason, newEpisode);
4930 newRecGroup = newRecGroup.simplified();
4932 if (newRecGroup.isEmpty())
4935 if (newRecGroup ==
"addnewgroup")
4941 tr(
"New Recording Group"));
4946 if (newgroup->Create())
4966 if ((
p->GetRecordingGroup() ==
"LiveTV") &&
4967 (newRecGroup !=
"LiveTV"))
4969 p->SaveAutoExpire(defaultAutoExpire);
4971 else if ((
p->GetRecordingGroup() !=
"LiveTV") &&
4972 (newRecGroup ==
"LiveTV"))
4990 if ((
p->GetRecordingGroup() ==
"LiveTV") && (newRecGroup !=
"LiveTV"))
4991 p->SaveAutoExpire(defaultAutoExpire);
4992 else if ((
p->GetRecordingGroup() !=
"LiveTV") && (newRecGroup ==
"LiveTV"))
5005 if (newPlayGroup.isEmpty() || !tmpItem)
5008 if (newPlayGroup == tr(
"Default"))
5009 newPlayGroup =
"Default";
5013 QList<uint>::Iterator it;
5046 if (pwChanger->Create())
5062 query.
prepare(
"UPDATE recgroups SET password = :PASSWD WHERE "
5063 "recgroup = :RECGROUP");
5065 query.
bindValue(
":PASSWD", newPassword);
5071 if (newPassword.isEmpty())
5090 LOG(VB_GENERAL, LOG_ERR,
LOC +
5091 "Theme is missing 'groups' button list.");
5098 for (
int i = 0; i <
m_list.size(); ++i)
5101 QVariant::fromValue(
m_data.at(i)));
5121 if (item->
GetData().toString().isEmpty())
5124 QString group = item->
GetData().toString();
5232 LOG(VB_GENERAL, LOG_ERR,
LOC +
5233 "Window 'passwordchanger' is missing required elements.");
5296 LOG(VB_GENERAL, LOG_ERR,
LOC +
5297 "Window 'editmetadata' is missing required elements.");
5338 QString newRecDescription =
nullptr;
5339 QString newRecInetref =
nullptr;
5340 uint newRecSeason = 0;
5341 uint newRecEpisode = 0;
5348 if (newRecTitle.isEmpty())
5351 emit
result(newRecTitle, newRecSubtitle, newRecDescription,
5352 newRecInetref, newRecSeason, newRecEpisode);
5362 "recording online..."),
5390 lookup->SetSubtype(
type);
5392 lookup->SetAllowGeneric(
true);
5393 lookup->SetHandleImages(
false);
5401 lookup->SetAutomatic(
false);
5450 Qt::QueuedConnection);
5452 if (resultsdialog->Create())
5465 if (!mfsr || !mfsr->m_result)
5483 QString title = tr(
"No match found for this recording. You can "
5484 "try entering a TVDB/TMDB number, season, and "
5485 "episode manually.");
5489 if (okPopup->Create())
5505 LOG(VB_GENERAL, LOG_ERR,
LOC +
5506 "Window 'iconhelp' is missing required elements.");
5512 addItem(
"watched", tr(
"Recording has been watched"));
5513 addItem(
"commflagged", tr(
"Commercials are flagged"));
5514 addItem(
"cutlist", tr(
"An editing cutlist is present"));
5515 addItem(
"autoexpire", tr(
"The program is able to auto-expire"));
5516 addItem(
"processing", tr(
"Commercials are being flagged"));
5517 addItem(
"bookmark", tr(
"A bookmark is set"));
5519 addItem(
"inuse", tr(
"Recording is in use"));
5520 addItem(
"transcoded", tr(
"Recording has been transcoded"));
5523 addItem(
"mono", tr(
"Recording is in Mono"));
5524 addItem(
"stereo", tr(
"Recording is in Stereo"));
5525 addItem(
"surround", tr(
"Recording is in Surround Sound"));
5526 addItem(
"dolby", tr(
"Recording is in Dolby Surround Sound"));
5528 addItem(
"cc", tr(
"Recording is Closed Captioned"));
5529 addItem(
"subtitles", tr(
"Recording has Subtitles Available"));
5530 addItem(
"onscreensub", tr(
"Recording is Subtitled"));
5532 addItem(
"SD", tr(
"Recording is in Standard Definition"));
5533 addItem(
"widescreen", tr(
"Recording is Widescreen"));
5534 addItem(
"hdtv", tr(
"Recording is in High Definition"));
5535 addItem(
"hd720", tr(
"Recording is in 720p High Definition"));
5536 addItem(
"hd1080i", tr(
"Recording is in 1080i High Definition"));
5537 addItem(
"hd1080p", tr(
"Recording is in 1080p High Definition"));
5538 addItem(
"uhd4Ki", tr(
"Recording is in 4k(interlaced) UHD resolution"));
5539 addItem(
"uhd4Kp", tr(
"Recording is in 4k UHD resolution"));
5540 addItem(
"mpeg2", tr(
"Recording is using MPEG-2 codec"));
5541 addItem(
"avchd", tr(
"Recording is using AVC/H.264 codec"));
5542 addItem(
"hevc", tr(
"Recording is using HEVC/H.265 codec"));
5551 item->DisplayState(state,
"icons");
5556 QDateTime now = QDateTime::currentDateTime();
5560 QMap<int, JobQueueEntry> jobs;
5563 for (
const auto& job : std::as_const(jobs))
5565 m_jobs.insert(qMakePair(job.chanid, job.recstartts), job);
5572 const QDateTime &recstartts)
5575 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5576 auto end = values.cend();
5577 for (
auto iter = values.cbegin(); iter != end; ++iter)
5579 if (iter->type == jobType)
5586 const QDateTime &recstartts)
5589 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5590 auto end = values.cend();
5591 for (
auto iter = values.cbegin(); iter != end; ++iter)
5593 if (iter->type == jobType)
5600 const QDateTime &recstartts)
5602 return IsJobQueued(jobType, chanid, recstartts) ||
5603 IsJobRunning(jobType, chanid, recstartts);
bool Create(void) override
PlaybackBox * m_parentScreen
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
bool Create(void) override
void AcceptItem(MythUIButtonListItem *item)
static bool ChangeJobCmds(int jobID, int newCmds)
static int GetJobsInQueue(QMap< int, JobQueueEntry > &jobs, int findJobs=JOB_LIST_NOT_DONE)
static bool QueueJob(int jobType, uint chanid, const QDateTime &recstartts, const QString &args="", const QString &comment="", QString host="", int flags=0, int status=JOB_QUEUED, QDateTime schedruntime=QDateTime())
static bool IsJobStatusQueued(int status)
static bool IsJobQueuedOrRunning(int jobType, uint chanid, const QDateTime &recstartts)
static bool IsJobStatusRunning(int status)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Dialog asking for user confirmation.
void SaveBoolSetting(const QString &key, bool newValue)
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
void dispatch(const MythEvent &event)
int GetNumSetting(const QString &key, int defaultval=0)
QString GetMasterHostName(void)
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
bool GetBoolSetting(const QString &key, bool defaultval=false)
static void DBError(const QString &where, const MSqlQuery &query)
Basic menu dialog, message and a list of options.
void Closed(QString, int)
bool Create(void) override
This class is used as a container for messages.
const QString & Message() const
static const Type kMythEventMessage
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.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void LoadInBackground(const QString &message="")
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
Dialog prompting the user to enter a text string.
bool Create(void) override
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
void SetCheckState(MythUIStateType::StateType state)
virtual void SetTextFromMap(const InfoMap &infoMap)
virtual void ResetMap(const InfoMap &infoMap)
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.
void Set(int start, int total, int used)
A widget for offering a range of numerical values where only the the bounding values and interval are...
void SetRange(int low, int high, int step, uint pageMultiple=5)
Set the lower and upper bounds of the spinbox, the interval and page amount.
void SetValue(int val) override
int GetIntValue(void) const override
This widget is used for grouping other widgets for display when a particular named state is called.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
bool DisplayState(const QString &name)
A text entry and edit widget.
void SetPassword(bool isPassword)
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
void SetMaxLength(int length)
All purpose text widget, displays a text string.
virtual void SetText(const QString &text)
void SetCanTakeFocus(bool set=true)
Set whether this widget can take focus.
virtual void SetVisible(bool visible)
void SetEnabled(bool enable)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
MythUIButton * m_okButton
MythUITextEdit * m_newPasswordEdit
bool Create(void) override
MythUITextEdit * m_oldPasswordEdit
void OldPasswordChanged(void)
void result(const QString &)
static QStringList GetNames(void)
QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability=true)
void DeleteRecording(uint recordingID, bool forceDelete, bool forgetHistory)
QString LocateArtwork(const QString &inetref, uint season, VideoArtworkType type, const ProgramInfo *pginfo, const QString &groupname=nullptr)
void DeleteRecordings(const QStringList &list)
uint64_t GetFreeSpaceTotalMB(void) const
void StopRecording(const ProgramInfo &pginfo)
void CheckAvailability(const ProgramInfo &pginfo, CheckAvailabilityType cat=kCheckForCache)
void UndeleteRecording(uint recordingID)
void ForceFreeSpaceUpdate(void)
uint64_t GetFreeSpaceUsedMB(void) const
bool IsJobQueued(int jobType, uint chanid, const QDateTime &recstartts)
static constexpr std::chrono::milliseconds kInvalidateTimeMs
bool IsJobRunning(int jobType, uint chanid, const QDateTime &recstartts)
bool IsJobQueuedOrRunning(int jobType, uint chanid, const QDateTime &recstartts)
void stopPlaylistUserJob2()
MythUIImage * m_previewImage
void UpdateUIGroupList(const QStringList &groupPreferences)
~PlaybackBox(void) override
void setRecGroup(QString newRecGroup)
void stopPlaylistUserJob4()
QList< uint > m_playList
list of selected items "play list"
void changeProfileAndTranscode(int id)
QString extract_commflag_state(const ProgramInfo &pginfo)
void doPlaylistBeginUserJob4()
void toggleLiveTVView(bool setOn)
std::array< QTimer *, kNumArtImages > m_artTimer
QString extract_job_state(const ProgramInfo &pginfo)
void doPlaylistBeginUserJob3()
static std::array< PlaybackBoxCb, kMaxJobs *2 > kMySlots
bool Create(void) override
void doPlaylistBeginUserJob2()
void ShowActionPopup(const ProgramInfo &pginfo)
void saveViewChanges(void)
bool m_playingSomething
playingSomething is set to true iff a full screen recording is playing
void toggleTitleView(bool setOn)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool IsUsageUIVisible(void) const
void updateRecGroup(MythUIButtonListItem *sel_item)
void stopPlaylistFlagging()
void SelectNextRecGroup(void)
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
QString m_watchGroupLabel
int m_allOrder
allOrder controls the ordering of the "All Programs" list
void ShowRecordedEpisodes()
void HandleRecordingAddEvent(const ProgramInfo &evinfo)
void ScheduleUpdateUIList(void)
void toggleWatchedView(bool setOn)
void ItemLoaded(MythUIButtonListItem *item)
void customEvent(QEvent *event) override
void PlaylistDelete(bool forgetHistory=false)
void doPlaylistWatchedSetOff()
void doPlaylistJobQueueJob(int jobType, int jobFlags=0)
void ItemVisible(MythUIButtonListItem *item)
void UpdateUIRecGroupList(void)
void saveRecMetadata(const QString &newTitle, const QString &newSubtitle, const QString &newDescription, const QString &newInetref, uint season, uint episode)
void ItemSelected(MythUIButtonListItem *item)
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void DeleteIgnoreAllRemaining(void)
void toggleCategoryView(bool setOn)
void ShowDeletePopup(DeletePopupType type)
void ShowGroupPopup(void)
void stopPlaylistLookup()
QStringList m_playerSelectedNewShow
std::chrono::hours m_watchListBlackOut
adjust exclusion of a title from the Watch List after a delete
void doPlaylistExpireSetOn()
MythMenu * createStorageMenu()
QStringList m_delList
Recording[s] currently selected for deletion.
void ShowRecGroupChanger(bool use_playlist=false)
Used to change the recording group of a program or playlist.
ProgramInfo * FindProgramInUILists(const ProgramInfo &pginfo)
void showViewChanger(void)
void stopPlaylistUserJob3()
void togglePlayListItem(void)
MythUIProgressBar * m_watchedProgress
static QString CreateProgramInfoString(const ProgramInfo &pginfo)
QSet< QString > m_previewTokens
Outstanding preview image requests.
bool m_needUpdate
Does the recording list need to be refilled.
MythUIProgressBar * m_recordedProgress
void selected(MythUIButtonListItem *item)
void DeleteForceAllRemaining(void)
void processNetworkControlCommand(const QString &command)
MythMenu * createTranscodingProfilesMenu()
class PlaybackBox::PbbJobQueue m_jobQueue
void doBeginTranscoding()
void stopPlaylistUserJob1()
void stopPlaylistJobQueueJob(int jobType)
int m_progsInDB
total number of recordings in DB
void doPlaylistBeginUserJob1()
ProgramMap m_progLists
lists of programs by page
QStringList m_titleList
list of pages
void updateRecList(MythUIButtonListItem *sel_item)
MythMenu * createRecordingMenu()
static void * RunPlaybackBox(void *player, bool showTV)
MythUIText * m_noRecordingsText
MythScreenStack * m_popupStack
MythMenu * createPlaylistJobMenu()
void displayRecGroup(const QString &newRecGroup="")
static constexpr int kNumArtImages
QList< uint > m_playListPlay
list of items being played.
void toggleRecGroupView(bool setOn)
void showRecGroupPasswordChanger()
int m_watchListMaxAge
add 1 to the Watch List scord up to this many days
void doPlaylistExpireSetting(bool turnOn)
void setGroupFilter(const QString &newRecGroup)
void PlaylistDeleteForgetHistory(void)
void doAllowRerecord()
Callback function when Allow Re-record is pressed in Watch Recordings.
void doPlaylistWatchedSetOn()
std::deque< QString > m_networkControlCommands
void RemoveProgram(uint recordingID, bool forgetHistory, bool forceMetadataDelete)
void showMetadataEditor()
void deleteSelected(MythUIButtonListItem *item)
MythDialogBox * m_menuDialog
void popupClosed(const QString &which, int result)
void toggleWatchListView(bool setOn)
void groupSelectorClosed(void)
void togglePreserveEpisode()
void PlayFromLastPlayPos()
QString m_currentGroup
Group currently selected.
void doJobQueueJob(int jobType, int jobFlags=0)
void togglePlayListTitle(void)
void doPlaylistBeginLookup()
MythMenu * createPlaylistStorageMenu()
void ShowPlayGroupChanger(bool use_playlist=false)
Used to change the play group of a program or playlist.
bool m_watchListStart
use the Watch List as the initial view
PlaybackBox(MythScreenStack *parent, const QString &name, TV *player=nullptr, bool showTV=false)
MythMenu * createPlayFromMenu()
std::array< MythUIImage *, kNumArtImages > m_artImage
QString m_curGroupPassword
MythUIButtonList * m_recordingList
void HandleRecordingRemoveEvent(uint recordingID)
void ShowPlayGroupChangerNoPlaylist(void)
ProgramInfoCache m_programInfoCache
MythUIButtonList * m_groupList
void ShowRecGroupChangerNoPlaylist(void)
QMap< QString, QString > m_recGroupPwCache
MythMenu * createPlaylistMenu()
void checkPassword(const QString &password)
bool m_watchListAutoExpire
exclude recording not marked for auto-expire from the Watch List
QString getRecGroupPassword(const QString &recGroup)
void SetItemIcons(MythUIButtonListItem *item, ProgramInfo *pginfo)
void toggleSearchView(bool setOn)
bool Play(const ProgramInfo &rec, bool inPlaylist, bool ignoreBookmark, bool ignoreProgStart, bool ignoreLastPlayPos, bool underNetworkControl)
void playSelectedPlaylist(bool Random)
void PlayX(const ProgramInfo &pginfo, bool ignoreBookmark, bool ignoreProgStart, bool ignoreLastPlayPos, bool underNetworkControl)
void stopPlaylistTranscoding()
MythUIButtonList * m_groupAlphaList
void doPlaylistBeginFlagging()
void ShowRecGroupChangerUsePlaylist(void)
void processNetworkControlCommands(void)
void fillRecGroupPasswordCache(void)
void UpdateUIListItem(ProgramInfo *pginfo, bool force_preview_reload)
MythUIButtonList * m_recgroupList
void selectUIGroupsAlphabet(MythUIButtonListItem *item)
void doPlaylistBeginTranscoding()
void passwordClosed(void)
QMap< QString, QString > m_recGroupType
void ShowPlayGroupChangerUsePlaylist(void)
bool m_alwaysShowWatchedProgress
void updateGroupInfo(const QString &groupname, const QString &grouplabel)
void DeleteForgetHistory(void)
PlaybackBoxHelper m_helper
Main helper thread.
ProgramInfo * GetCurrentProgram(void) const override
void doPlaylistAllowRerecord()
void HandlePreviewEvent(const QStringList &list)
Updates the UI properties for a new preview file.
static void ShowAvailabilityPopup(const ProgramInfo &pginfo)
friend class PlaybackBoxListItem
void ShowMenu(void) override
void doPlaylistWatchedSetting(bool turnOn)
void doPlaylistExpireSetOff()
void doCreateTranscodingProfilesMenu()
QString m_artHostOverride
bool m_usingGroupSelector
void toggleView(PlaybackBox::ViewMask itemMask, bool setOn)
void setPlayGroup(QString newPlayGroup)
void updateIcons(const ProgramInfo *pginfo=nullptr)
void DisplayPopupMenu(void)
QString m_groupDisplayName
void PlaylistDeleteKeepHistory(void)
QMap< QString, QString > m_groupAlphabet
MythMenu * createJobMenu()
int m_listOrder
listOrder controls the ordering of the recordings in the list
void HandleUpdateItemEvent(uint recordingId, uint flags)
void SetRecGroupPassword(const QString &newPassword)
static void AddListener(QObject *listener)
Request notifications when a preview event is generated.
static void RemoveListener(QObject *listener)
Stop receiving notifications when a preview event is generated.
void GetOrdered(std::vector< ProgramInfo * > &list, bool newest_first=false)
void Add(const ProgramInfo &pginfo)
Adds a ProgramInfo to the cache.
bool Remove(uint recordingID)
Marks a ProgramInfo in the cache for deletion on the next call to Refresh().
bool IsLoadInProgress(void) const
void Refresh(void)
Refreshed the cache.
void UpdateFileSize(uint recordingID, uint64_t filesize, UpdateStates flags)
Updates a ProgramInfo in the cache.
void ScheduleLoad(bool updateUI=true)
ProgramInfoCache::UpdateStates Update(const ProgramInfo &pginfo)
Updates a ProgramInfo in the cache.
void WaitForLoadToComplete(void) const
ProgramInfo * GetRecordingInfo(uint recordingID) const
Holds information on recordings and videos.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
void SetAvailableStatus(AvailableStatusType status, const QString &where)
bool IsInUsePlaying(void) const
void SetFlagging(bool flagging)
bool HasPathname(void) const
bool QueryIsInUse(QStringList &byWho) const
Returns true if Program is in use.
uint GetVideoProperties(void) const
bool IsAutoExpirable(void) const
bool IsPreserved(void) const
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
QString GetCategoryTypeString(void) const
Returns catType as a string.
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
uint GetEpisode(void) const
uint GetSubtitleType(void) const
void SaveWatched(bool watchedFlag)
Set "watched" field in recorded/videometadata to "watchedFlag".
QString GetProgramID(void) const
void SetEditing(bool editing)
QString GetRecordingGroup(void) const
void SaveAutoExpire(AutoExpireType autoExpire, bool updateDelete=false)
Set "autoexpire" field in "recorded" table to "autoExpire".
uint GetRecordingID(void) const
QString GetInetRef(void) const
void SetRecordingStatus(RecStatus::Type status)
AvailableStatusType GetAvailableStatus(void) const
bool HasCutlist(void) const
bool QueryIsDeleteCandidate(bool one_playback_allowed=false) const
Returns true iff this is a recording, it is not in use (except by the recorder), and at most one play...
uint GetAudioProperties(void) const
QString GetHostname(void) const
virtual void SetFilesize(uint64_t sz)
void UpdateLastDelete(bool setTime) const
Set or unset the record.last_delete field.
bool IsBookmarkSet(void) const
QString GetPlaybackGroup(void) const
QString GetDescription(void) const
QString GetTitle(void) const
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
void SaveLastPlayPos(uint64_t frame)
TODO Move to RecordingInfo.
QString GetSortTitle(void) const
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
QDate GetOriginalAirDate(void) const
int GetRecordingPriority2(void) const
virtual uint64_t GetFilesize(void) const
void ToStringList(QStringList &list) const
Serializes ProgramInfo into a QStringList which can be passed over a socket.
QString GetPlaybackURL(bool checkMaster=false, bool forceCheckLocal=false)
Returns filename or URL to be used to play back this recording.
bool IsWatched(void) const
bool IsPathSet(void) const
uint32_t GetProgramFlags(void) const
RecStatus::Type GetRecordingStatus(void) const
bool IsLastPlaySet(void) const
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
QString GetSubtitle(void) const
void SaveBookmark(uint64_t frame)
Clears any existing bookmark in DB and if frame is greater than 0 sets a new bookmark.
uint GetSeason(void) const
void SetPathname(const QString &pn)
Holds information on a TV Program one might wish to record.
void ApplyRecordPlayGroupChange(const QString &newplaygroup)
Sets the recording group, both in this RecordingInfo and in the database.
void ForgetHistory(void)
Forget the recording of a program so it will be recorded again.
void ApplyRecordRecTitleChange(const QString &newTitle, const QString &newSubtitle, const QString &newDescription)
Sets the recording title, subtitle, and description both in this RecordingInfo and in the database.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
static const QRegularExpression kReSearchTypeName
void ApplyTranscoderProfileChangeById(int id)
Internal representation of a recording rule, mirrors the record table.
bool LoadTemplate(const QString &title, const QString &category="Default", const QString &categoryType="Default")
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 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 ShowUpcomingScheduled(void) const
Show the upcoming recordings for this recording rule.
virtual void ShowGuide(void) const
Show the program guide.
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
QString GetRecordingGroup() const
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
bool IsSameProgram(const ProgramInfo *ProgInfo) const
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
static QMap< QString, QString > iconMap
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
void ShowNotificationError(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
convenience utility to display error message as notification
void ShowNotification(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
Convenience inline random number generator functions.
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
static constexpr const char * ACTION_1
void run(const QString &name, Class *object, void(Class::*fn)())
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kDateTimeFull
Default local time.
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
@ kTime
Default local time.
@ kDateShort
Default local time.
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
uint32_t MythRandom()
generate 32 random bits
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
def rating(profile, smoonURL, gate)
duration< CHRONO_TYPE, ratio< 86400 > > days
static bool comp_programid_less_than(const ProgramInfo *a, const ProgramInfo *b)
static int comp_season_rev(const ProgramInfo *a, const ProgramInfo *b)
static PlaybackBox::ViewMask m_viewMaskToggle(PlaybackBox::ViewMask mask, PlaybackBox::ViewMask toggle)
static bool save_position(const MythUIButtonList *groupList, const MythUIButtonList *recordingList, QStringList &groupSelPref, QStringList &itemSelPref, QStringList &itemTopPref)
static bool comp_season_less_than(const ProgramInfo *a, const ProgramInfo *b)
static const std::array< const uint, 3 > s_artDelay
static int comp_programid(const ProgramInfo *a, const ProgramInfo *b)
static int comp_recordDate_rev(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_recpriority2_less_than(const ProgramInfo *a, const ProgramInfo *b)
static QString construct_sort_title(QString title, const QString &sortTitle, PlaybackBox::ViewMask viewmask, PlaybackBox::ViewTitleSort sortType, int recpriority)
static void push_onto_del(QStringList &list, const ProgramInfo &pginfo)
static int comp_season(const ProgramInfo *a, const ProgramInfo *b)
static bool extract_one_del(QStringList &list, uint &recordingID)
static bool comp_originalAirDate_less_than(const ProgramInfo *a, const ProgramInfo *b)
static int comp_recordDate(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_programid_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_originalAirDate_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
static int comp_originalAirDate(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_season_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
static void restore_position(MythUIButtonList *groupList, MythUIButtonList *recordingList, const QStringList &groupSelPref, const QStringList &itemSelPref, const QStringList &itemTopPref)
static const std::array< const std::string, 9 > disp_flags
static bool comp_recordDate_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
static int comp_programid_rev(const ProgramInfo *a, const ProgramInfo *b)
static QString extract_subtitle(const ProgramInfo &pginfo, const QString &groupname)
static bool comp_recordDate_less_than(const ProgramInfo *a, const ProgramInfo *b)
static int comp_originalAirDate_rev(const ProgramInfo *a, const ProgramInfo *b)
static int comp_recpriority2(const ProgramInfo *a, const ProgramInfo *b)
static const std::array< const int, kMaxJobs > kJobs
static QString extract_main_state(const ProgramInfo &pginfo, const TV *player)
static const QString sLocation
static constexpr uint8_t kArtworkCoverTimeout
static constexpr uint8_t kArtworkBannerTimeout
static constexpr size_t kMaxJobs
static constexpr uint16_t kArtworkFanTimeout
@ kCheckForPlaylistAction
AutoDeleteDeque< ProgramInfo * > ProgramList
TVState
TVState is an enumeration of the states used by TV and TVRec.
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
#define ACTION_VIEWSCHEDULED
#define ACTION_TOGGLERECORD
#define ACTION_LISTRECORDEDEPISODES
#define ACTION_PREVRECORDED
@ kStartTVIgnoreLastPlayPos
@ kStartTVIgnoreProgStart
@ kStartTVByNetworkCommand