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"))
1571 if (!item->
GetText().isEmpty())
1580 QStringList &groupSelPref, QStringList &itemSelPref,
1581 QStringList &itemTopPref)
1587 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1589 i < groupList->GetCount(); i++)
1593 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1597 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i++)
1601 itemSelPref.push_back(groupSelPref.front());
1602 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1604 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i--)
1608 itemSelPref.push_back(groupSelPref.front());
1609 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1613 for (
int i = topPos + 1; i >= topPos - 1; i--)
1615 if (i >= 0 && i < recordingList->GetCount())
1621 itemTopPref.push_front(QString::number(pginfo->GetRecordingID()));
1622 itemTopPref.push_front(groupSelPref.front());
1626 itemTopPref.push_back(groupSelPref.front());
1627 itemTopPref.push_back(QString::number(pginfo->GetRecordingID()));
1637 const QStringList &groupSelPref,
const QStringList &itemSelPref,
1638 const QStringList &itemTopPref)
1643 if (!prefSelGroup ||
1644 !groupSelPref.contains(prefSelGroup->
GetData().toString()) ||
1645 !itemSelPref.contains(prefSelGroup->
GetData().toString()))
1651 QString groupname = prefSelGroup->
GetData().toString();
1655 for (
uint i = 0; i+1 < (
uint)itemSelPref.size(); i+=2)
1657 if (itemSelPref[i] != groupname)
1660 uint recordingID = itemSelPref[i+1].toUInt();
1665 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1668 i = itemSelPref.size();
1676 for (
uint i = 0; i+1 < (
uint)itemTopPref.size(); i+=2)
1678 if (itemTopPref[i] != groupname)
1681 uint recordingID = itemTopPref[i+1].toUInt();
1686 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1689 i = itemTopPref.size();
1698 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect success (%1,%2)")
1699 .arg(sel).arg(top));
1706 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect failure (%1,%2)")
1707 .arg(sel).arg(top));
1717 QStringList groupSelPref;
1718 QStringList itemSelPref;
1719 QStringList itemTopPref;
1721 groupSelPref, itemSelPref, itemTopPref))
1730 QMap<uint, AvailableStatusType> asCache;
1736 uint asRecordingID = prog->GetRecordingID();
1737 asCache[asRecordingID] = prog->GetAvailableStatus();
1756 bool isAllProgsGroup = (
m_recGroup ==
"All Programs");
1757 QMap<QString, QString> sortedList;
1758 QMap<int, QString> searchRule;
1759 QMap<int, QDateTime> recidLastEventTime;
1760 QMap<int, ProgramInfo*> recidWatchListProgram;
1771 query.
prepare(
"SELECT recordid,title FROM record "
1772 "WHERE search > 0 AND search != :MANUAL;");
1777 while (query.
next())
1779 QString tmpTitle = query.
value(1).toString();
1781 searchRule[query.
value(0).toInt()] = tmpTitle;
1787 bool isUnknownCategory = (
m_recGroup == tr(
"Unknown"));
1788 bool isDeletedGroup = (
m_recGroup ==
"Deleted");
1789 bool isLiveTvGroup = (
m_recGroup ==
"LiveTV");
1791 std::vector<ProgramInfo*> list;
1794 for (
auto *
p : list)
1796 if (
p->IsDeletePending())
1801 const QString& pRecgroup(
p->GetRecordingGroup());
1802 const bool isLiveTVProg(pRecgroup ==
"LiveTV");
1809 if (pRecgroup ==
"Deleted")
1813 if (!isDeletedGroup)
1818 !isLiveTvGroup && isLiveTVProg)
1827 else if (isCategoryFilter)
1830 if (isUnknownCategory ? !
p->GetCategory().isEmpty()
1835 else if (!isAllProgsGroup && pRecgroup !=
m_recGroup)
1840 if (
p->GetTitle().isEmpty())
1841 p->SetTitle(tr(
"_NO_TITLE_"));
1848 uint asRecordingID =
p->GetRecordingID();
1849 if (asCache.contains(asRecordingID))
1850 p->SetAvailableStatus(asCache[asRecordingID],
"UpdateUILists");
1856 QString tmpTitle = tr(
"Live TV");
1857 sortedList[tmpTitle.toLower()] = tmpTitle;
1859 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1867 p->GetTitle(),
p->GetSortTitle(),
m_viewMask, titleSort,
1868 p->GetRecordingPriority());
1869 sTitle = sTitle.toLower();
1871 if (!sortedList.contains(sTitle))
1872 sortedList[sTitle] =
p->GetTitle();
1873 m_progLists[sortedList[sTitle].toLower()].push_front(
p);
1874 m_progLists[sortedList[sTitle].toLower()].setAutoDelete(
false);
1879 !pRecgroup.isEmpty() && !isLiveTVProg)
1881 sortedList[pRecgroup.toLower()] = pRecgroup;
1883 m_progLists[pRecgroup.toLower()].setAutoDelete(
false);
1889 QString catl =
p->GetCategory().toLower();
1890 sortedList[catl] =
p->GetCategory();
1896 !searchRule[
p->GetRecordingRuleID()].isEmpty() &&
1897 p->GetTitle() != searchRule[
p->GetRecordingRuleID()])
1899 QString tmpTitle = QString(
"(%1)")
1900 .arg(searchRule[
p->GetRecordingRuleID()]);
1901 sortedList[tmpTitle.toLower()] = tmpTitle;
1903 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1907 !isLiveTVProg && pRecgroup !=
"Deleted")
1909 int rid =
p->GetRecordingRuleID();
1910 auto letIt = recidLastEventTime.find(rid);
1911 if (letIt == recidLastEventTime.end() || *letIt < p->GetLastModifiedTime())
1913 recidLastEventTime[rid] =
p->GetLastModifiedTime();
1919 LOG(VB_FILE, LOG_INFO, QString(
"Auto-expire off: %1")
1920 .arg(
p->GetTitle()));
1922 else if (
p->IsWatched())
1925 LOG(VB_FILE, LOG_INFO,
1926 QString(
"Marked as 'watched': %1")
1927 .arg(
p->GetTitle()));
1931 auto wlpIt = recidWatchListProgram.find(rid);
1932 if (wlpIt == recidWatchListProgram.end())
1934 recidWatchListProgram[rid] =
p;
1938 (*wlpIt)->SetRecordingPriority2(
wlEarlier);
1939 LOG(VB_FILE, LOG_INFO,
1940 QString(
"Not the earliest: %1")
1941 .arg((*wlpIt)->GetTitle()));
1943 recidWatchListProgram[rid] =
p;
1948 LOG(VB_FILE, LOG_INFO,
1949 QString(
"Not the earliest: %1")
1950 .arg(
p->GetTitle()));
1958 for (
auto *
p : std::as_const(recidWatchListProgram))
1967 if (sortedList.empty())
1969 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"SortedList is Empty");
1973 if (!isAllProgsGroup)
1985 if (episodeSort ==
"OrigAirDate")
1987 QMap<QString, ProgramList>::Iterator Iprog;
1990 if (!Iprog.key().isEmpty())
1992 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
1999 else if (episodeSort ==
"Id")
2001 QMap<QString, ProgramList>::Iterator Iprog;
2004 if (!Iprog.key().isEmpty())
2006 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
2013 else if (episodeSort ==
"Date")
2015 QMap<QString, ProgramList>::iterator it;
2018 if (!it.key().isEmpty())
2020 std::stable_sort((*it).begin(), (*it).end(),
2027 else if (episodeSort ==
"Season")
2029 QMap<QString, ProgramList>::iterator it;
2032 if (!it.key().isEmpty())
2034 std::stable_sort((*it).begin(), (*it).end(),
2045 query.
prepare(
"SELECT recordid, last_delete FROM record;");
2049 while (query.
next())
2051 int recid = query.
value(0).toInt();
2053 QDateTime last_delete =
2056 if (last_delete.isValid())
2058 auto it = recidLastEventTime.find(recid);
2059 if (it != recidLastEventTime.end() && last_delete > *it)
2061 recidLastEventTime[recid] = last_delete;
2070 int recid = (*pit)->GetRecordingRuleID();
2072 (*pit)->SetRecordingPriority2(recidLastEventTime[recid].toSecsSinceEpoch()/60);
2074 LOG(VB_FILE, LOG_INFO, QString(
" %1 %2 %3")
2077 .arg((*pit)->GetRecordingPriority2())
2078 .arg((*pit)->GetTitle()));
2092 (
std::find(sortedList.cbegin(), sortedList.cend(), tr(
"Live TV"))
2093 == sortedList.cend()))
2109 query.
prepare(
"SELECT distinct recgroup from recorded WHERE "
2110 "deletepending = 0 ORDER BY recgroup");
2114 while (query.
next())
2116 name = query.
value(0).toString();
2117 if (name !=
"Deleted" && name !=
"LiveTV" && !name.startsWith(
'.'))
2131 for (
auto it = sortedList.keyValueBegin();
2132 it != sortedList.keyValueEnd(); ++it)
2134 first = (*it).first.at(0).toUpper();
2155 groupSelPref, itemSelPref, itemTopPref);
2168 while (!
tmp.isEmpty())
2180 QCoreApplication::postEvent(
2194 const bool ignoreBookmark =
false;
2195 const bool ignoreProgStart =
false;
2196 const bool ignoreLastPlayPos =
false;
2197 const bool underNetworkControl =
false;
2199 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2200 underNetworkControl);
2213 const bool ignoreBookmark =
false;
2214 const bool ignoreProgStart =
true;
2215 const bool ignoreLastPlayPos =
true;
2216 const bool underNetworkControl =
false;
2218 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2219 underNetworkControl);
2232 const bool ignoreBookmark =
true;
2233 const bool ignoreProgStart =
true;
2234 const bool ignoreLastPlayPos =
true;
2235 const bool underNetworkControl =
false;
2237 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2238 underNetworkControl);
2251 const bool ignoreBookmark =
true;
2252 const bool ignoreProgStart =
true;
2253 const bool ignoreLastPlayPos =
false;
2254 const bool underNetworkControl =
false;
2256 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2257 underNetworkControl);
2261 bool ignoreBookmark,
2262 bool ignoreProgStart,
2263 bool ignoreLastPlayPos,
2264 bool underNetworkControl)
2268 Play(pginfo,
false, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos, underNetworkControl);
2315 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2317 QString(
"availability status: %1 ")
2318 .arg(pginfo->GetAvailableStatus()));
2321 tr(
"This recording is already being deleted"));
2323 else if (!pginfo->QueryIsDeleteCandidate())
2326 pginfo->QueryIsInUse(byWho);
2328 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2330 QString(
"delete candidate: %1 in use by %2")
2331 .arg(pginfo->QueryIsDeleteCandidate()).arg(byWho));
2333 if (byWho.isEmpty())
2336 tr(
"This recording is already being deleted"));
2341 tr(
"This recording is currently in use by:") +
"\n" +
2389 if (which ==
"groupmenu")
2409 else if (which ==
"actionmenu")
2423 QString label = tr(
"Group List Menu");
2464 bool inPlaylist,
bool ignoreBookmark,
bool ignoreProgStart,
2465 bool ignoreLastPlayPos,
bool underNetworkControl)
2467 bool playCompleted =
false;
2495 ignoreProgStart =
true;
2511 QCoreApplication::postEvent(
2518 return playCompleted;
2522 bool forceMetadataDelete)
2529 if (!forceMetadataDelete &&
2539 if (!forceMetadataDelete)
2544 forceMetadataDelete, forgetHistory);
2574 label = tr(
"Are you sure you want to delete:");
break;
2576 label = tr(
"Recording file does not exist.\n"
2577 "Are you sure you want to delete:");
2580 label = tr(
"Are you sure you want to stop:");
break;
2587 if (delItem !=
nullptr)
2637 tr(
"Yes, delete it and the remaining %1 list items")
2646 nullptr, !defaultIsYes);
2650 nullptr, !defaultIsYes);
2657 tr(
"No, and keep the remaining %1 list items")
2658 .arg(other_delete_cnt),
2678 tr(
"This recording is currently in "
2679 "use by:") +
"\n" + byWho);
2685 tr(
"This recording is currently "
2692 tr(
"This recording is currently being "
2693 "deleted and is unavailable"));
2698 tr(
"This recording has been "
2699 "deleted and is unavailable"));
2704 tr(
"The file for this recording can "
2710 tr(
"The file for this recording is "
2716 tr(
"This recording is not yet "
2723 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2724 "all items in the playlist",
"",
m_playList.size());
2736 menu->AddItem(tr(
"Toggle playlist for this Category/Title"),
2741 menu->AddItem(tr(
"Toggle playlist for this Group"),
2747 menu->AddItem(tr(
"Toggle playlist for this recording"),
2754 menu->AddItem(tr(
"Delete, and allow re-record"),
2762 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2763 "all items in the playlist",
"",
m_playList.size());
2780 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2781 "all items in the playlist",
"",
m_playList.size());
2787 QList<uint>::Iterator it;
2788 bool isTranscoding =
true;
2789 bool isFlagging =
true;
2790 bool isMetadataLookup =
true;
2791 bool isRunningUserJob1 =
true;
2792 bool isRunningUserJob2 =
true;
2793 bool isRunningUserJob3 =
true;
2794 bool isRunningUserJob4 =
true;
2804 isTranscoding =
false;
2812 isMetadataLookup =
false;
2816 isRunningUserJob1 =
false;
2820 isRunningUserJob2 =
false;
2824 isRunningUserJob3 =
false;
2828 isRunningUserJob4 =
false;
2829 if (!isTranscoding && !isFlagging && !isRunningUserJob1 &&
2830 !isRunningUserJob2 && !isRunningUserJob3 && !isRunningUserJob4)
2845 if (!isMetadataLookup)
2851 if (!command.isEmpty())
2855 if (!isRunningUserJob1)
2857 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2862 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2868 if (!command.isEmpty())
2872 if (!isRunningUserJob2)
2874 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2879 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2885 if (!command.isEmpty())
2889 if (!isRunningUserJob3)
2891 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2896 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2902 if (!command.isEmpty())
2906 if (!isRunningUserJob4)
2908 menu->AddItem(QString(
"%1 %2").arg(tr(
"Begin"), jobTitle),
2913 menu->AddItem(QString(
"%1 %2").arg(tr(
"Stop"), jobTitle),
2984 menu->AddItem(tr(
"Play from last played position"),
2987 menu->AddItem(tr(
"Play from bookmark"),
2989 menu->AddItem(tr(
"Play from beginning"),
2992 menu->AddItem(tr(
"Clear last played position"),
3008 tr(
"Disable Auto Expire") : tr(
"Enable Auto Expire");
3010 tr(
"Do not preserve this episode") : tr(
"Preserve this episode");
3031 menu->AddItem(tr(
"Edit Recording Schedule"),
3045static const std::array<const int,kMaxJobs>
kJobs
3076 const std::array<const bool,kMaxJobs> add
3086 const std::array<const QString,kMaxJobs*2> desc
3089 tr(
"Stop Transcoding"), tr(
"Begin Transcoding"),
3090 tr(
"Stop Commercial Detection"), tr(
"Begin Commercial Detection"),
3091 tr(
"Stop Metadata Lookup"), tr(
"Begin Metadata Lookup"),
3098 for (
size_t i = 0; i <
kMaxJobs; i++)
3103 QString stop_desc = desc[(i*2)+0];
3104 QString start_desc = desc[(i*2)+1];
3106 if (start_desc.toUInt())
3109 "UserJobDesc"+start_desc, tr(
"User Job") +
" #" + start_desc);
3110 stop_desc = tr(
"Stop") +
' ' + jobTitle;
3111 start_desc = tr(
"Begin") +
' ' + jobTitle;
3119 menu->AddItem((running) ? stop_desc : start_desc,
3120 kMySlots[(i * 2) + (running ? 0 : 1)], submenu);
3128 QString label = tr(
"Transcoding profiles");
3132 menu->AddItemV(tr(
"Default"), QVariant::fromValue(-1));
3133 menu->AddItemV(tr(
"Autodetect"), QVariant::fromValue(0));
3136 query.
prepare(
"SELECT r.name, r.id "
3137 "FROM recordingprofiles r, profilegroups p "
3138 "WHERE p.name = 'Transcoders' "
3139 "AND r.profilegroup = p.id "
3140 "AND r.name != 'RTjpeg/MPEG4' "
3141 "AND r.name != 'MPEG2' ");
3149 while (query.
next())
3151 QString transcoder_name = query.
value(0).toString();
3152 int transcoder_id = query.
value(1).toInt();
3155 if (transcoder_name ==
"High Quality")
3156 transcoder_name = tr(
"High Quality");
3157 else if (transcoder_name ==
"Medium Quality")
3158 transcoder_name = tr(
"Medium Quality");
3159 else if (transcoder_name ==
"Low Quality")
3160 transcoder_name = tr(
"Low Quality");
3162 menu->AddItemV(transcoder_name, QVariant::fromValue(transcoder_id));
3187 label = tr(
"Recording file cannot be found");
3189 label = tr(
"Recording file contains no data");
3191 tr(
"Recording Options");
3233 bool sameProgram =
false;
3320 QString timedate = QString(
"%1 - %2")
3334 return QString(
"\n%1%2\n%3").arg(title, extra, timedate);
3339 QList<uint>::Iterator it;
3397 QList<uint>::Iterator it;
3402 if (pginfo !=
nullptr)
3473 "",
"", jobHost, jobFlags);
3480 QList<uint>::Iterator it;
3515 QString forceDeleteStr(
"0");
3525 list.push_back(forceDeleteStr);
3526 list.push_back(forgetHistory ?
"1" :
"0");
3547 uint recordingID = 0;
3554 uint recordingID = 0;
3570 QCoreApplication::postEvent(
this, e);
3578 QString title = pginfo->
GetTitle().toLower();
3610 const QString& recgroup)
3613 std::array<ProgramList::iterator,2> _it {
3615 std::array<ProgramList::iterator,2> _end {
3618 if (recgroup !=
"LiveTV")
3620 swap( _it[0], _it[1]);
3621 swap(_end[0], _end[1]);
3624 for (
uint i = 0; i < 2; i++)
3627 const auto& end = _end[i];
3628 for (; it != end; ++it)
3630 if ((*it)->GetRecordingID() == recordingID)
3653 pginfo->SaveWatched(on);
3694 pginfo->SavePreserve(on);
3713 for (
auto *pl : std::as_const(
m_progLists[groupname]))
3715 if (pl && (pl->GetAvailableStatus() ==
asAvailable))
3789 QStringList tokens = command.simplified().split(
" ");
3791 if (tokens.size() >= 4 && (tokens[1] ==
"PLAY" || tokens[1] ==
"RESUME"))
3793 if (tokens.size() == 6 && tokens[2] ==
"PROGRAM")
3795 int clientID = tokens[5].toInt();
3797 LOG(VB_GENERAL, LOG_INFO,
LOC +
3798 QString(
"NetworkControl: Trying to %1 program '%2' @ '%3'")
3799 .arg(tokens[1], tokens[3], tokens[4]));
3803 LOG(VB_GENERAL, LOG_ERR,
LOC +
3804 "NetworkControl: Already playing");
3806 QString msg = QString(
3807 "NETWORK_CONTROL RESPONSE %1 ERROR: Unable to play, "
3808 "player is already playing another recording.")
3816 uint chanid = tokens[3].toUInt();
3822 QString msg = QString(
"NETWORK_CONTROL RESPONSE %1 OK")
3829 const bool ignoreBookmark = (tokens[1] ==
"PLAY");
3830 const bool ignoreProgStart =
true;
3831 const bool ignoreLastPlayPos =
true;
3832 const bool underNetworkControl =
true;
3833 PlayX(pginfo, ignoreBookmark, ignoreProgStart,
3834 ignoreLastPlayPos, underNetworkControl);
3838 QString message = QString(
"NETWORK_CONTROL RESPONSE %1 "
3839 "ERROR: Could not find recording for "
3841 .arg(tokens[5], tokens[3], tokens[4]);
3852 if ((event->key() == Qt::Key_LaunchMedia) &&
3853 (event->modifiers() ==
3854 (Qt::ShiftModifier |
3855 Qt::ControlModifier |
3858 Qt::KeypadModifier)))
3872 QStringList actions;
3876 for (
int i = 0; i < actions.size() && !handled; ++i)
3878 const QString&
action = actions[i];
3883 else if (
action ==
"MENU")
3887 else if (
action ==
"NEXTFAV")
3894 else if (
action ==
"TOGGLEFAV")
3920 if (!nextGroup.isEmpty())
3923 else if (
action ==
"NEXTVIEW")
3930 else if (
action ==
"PREVVIEW")
3945 else if (
action ==
"CHANGERECGROUP")
3949 else if (
action ==
"CHANGEGROUPVIEW")
3953 else if (
action ==
"EDIT")
3965 else if (
action ==
"CUSTOMEDIT")
3967 else if (
action ==
"GUIDE")
3969 else if (
action ==
"UPCOMING")
3998 QString resultid = dce->
GetId();
4000 if (resultid ==
"transcode" && dce->GetResult() >= 0)
4005 auto *me =
dynamic_cast<MythEvent *
>(event);
4009 const QString& message = me->
Message();
4011 if (message.startsWith(
"RECORDING_LIST_CHANGE"))
4013 QStringList tokens = message.simplified().split(
" ");
4014 uint recordingID = 0;
4015 if (tokens.size() >= 3)
4016 recordingID = tokens[2].toUInt();
4018 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
4028 else if (recordingID && (tokens[1] ==
"ADD"))
4037 else if (recordingID && (tokens[1] ==
"DELETE"))
4046 else if (message.startsWith(
"NETWORK_CONTROL"))
4048 QStringList tokens = message.simplified().split(
" ");
4049 if ((tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
4056 Qt::KeyboardModifiers modifiers =
4058 Qt::ControlModifier |
4062 auto *keyevent =
new QKeyEvent(QEvent::KeyPress,
4063 Qt::Key_LaunchMedia, modifiers);
4066 keyevent =
new QKeyEvent(QEvent::KeyRelease,
4067 Qt::Key_LaunchMedia, modifiers);
4071 else if (message.startsWith(
"UPDATE_FILE_SIZE"))
4073 QStringList tokens = message.simplified().split(
" ");
4074 if (tokens.size() >= 3)
4077 uint recordingID = tokens[1].toUInt();
4078 uint64_t filesize = tokens[2].toLongLong(&ok);
4084 recordingID, filesize,
4089 else if (message ==
"UPDATE_UI_LIST")
4099 else if (message.startsWith(
"UPDATE_UI_ITEM"))
4101 QStringList tokens = message.simplified().split(
" ");
4102 if (tokens.size() < 3)
4105 uint recordingID = tokens[1].toUInt();
4111 else if (message ==
"UPDATE_USAGE_UI")
4115 else if (message ==
"RECONNECT_SUCCESS")
4119 else if (message ==
"LOCAL_PBB_DELETE_RECORDINGS")
4122 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i+=3)
4124 uint recordingID = me->ExtraDataList()[i+0].toUInt();
4130 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4131 QString(
"LOCAL_PBB_DELETE_RECORDINGS - "
4132 "No matching recording %1")
4137 QString forceDeleteStr = me->ExtraDataList()[i+1];
4138 QString forgetHistoryStr = me->ExtraDataList()[i+2];
4141 list.push_back(forceDeleteStr);
4142 list.push_back(forgetHistoryStr);
4144 "LOCAL_PBB_DELETE_RECORDINGS");
4156 else if (message ==
"DELETE_SUCCESSES")
4160 else if (message ==
"DELETE_FAILURES")
4162 if (me->ExtraDataList().size() < 3)
4165 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i += 3)
4168 me->ExtraDataList()[i+0].toUInt());
4176 bool forceDelete = me->ExtraDataList()[1].toUInt() != 0U;
4185 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4186 "Delete failures not handled due to "
4187 "pre-existing popup.");
4194 else if (message ==
"PREVIEW_SUCCESS")
4198 else if (message ==
"PREVIEW_FAILED" && me->ExtraDataCount() >= 5)
4200 for (
uint i = 4; i < (
uint) me->ExtraDataCount(); i++)
4202 const QString& token = me->ExtraData(i);
4208 else if (message ==
"AVAILABILITY" && me->ExtraDataCount() == 8)
4210 static constexpr std::chrono::milliseconds kMaxUIWaitTime = 10s;
4211 QStringList list = me->ExtraDataList();
4212 uint recordingID = list[0].toUInt();
4215 uint64_t fs = list[3].toULongLong();
4217 tm.setHMS(list[4].toUInt(), list[5].toUInt(),
4218 list[6].toUInt(), list[7].toUInt());
4219 QTime now = QTime::currentTime();
4220 auto time_elapsed = std::chrono::milliseconds(tm.msecsTo(now));
4221 if (time_elapsed < 0ms)
4222 time_elapsed += 24h;
4233 if (time_elapsed >= kMaxUIWaitTime)
4242 (time_elapsed < kMaxUIWaitTime))
4252 const bool ignoreBookmark =
false;
4253 const bool ignoreProgStart =
false;
4254 const bool ignoreLastPlayPos =
true;
4255 const bool underNetworkControl =
false;
4257 ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
4258 underNetworkControl);
4266 QCoreApplication::postEvent(
4270 if (old_avail != availableStatus)
4273 else if ((message ==
"PLAY_PLAYLIST") && !
m_playListPlay.empty())
4287 const bool ignoreBookmark =
false;
4288 const bool ignoreProgStart =
true;
4289 const bool ignoreLastPlayPos =
true;
4290 const bool underNetworkControl =
false;
4292 Play(*pginfo,
true, ignoreBookmark, ignoreProgStart,
4293 ignoreLastPlayPos, underNetworkControl);
4295 else if ((message ==
"SET_PLAYBACK_URL") && (me->ExtraDataCount() == 2))
4297 uint recordingID = me->ExtraData(0).toUInt();
4300 info->SetPathname(me->ExtraData(1));
4302 else if ((message ==
"FOUND_ARTWORK") && (me->ExtraDataCount() >= 5))
4305 uint recordingID = me->ExtraData(3).toUInt();
4306 const QString& group = me->ExtraData(4);
4307 const QString& fn = me->ExtraData(5);
4321 else if (!group.isEmpty() &&
4331 else if (message ==
"EXIT_TO_MENU" ||
4332 message ==
"CANCEL_PLAYLIST")
4347 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4348 QString(
"Failed to remove %1, reloading list")
4357 groupname = sel_item->
GetData().toString();
4362 auto pit = (*git).begin();
4363 while (pit != (*git).end())
4365 if ((*pit)->GetRecordingID() == recordingID)
4367 if (!git.key().isEmpty() && git.key() == groupname)
4371 QVariant::fromValue(*pit));
4375 if (item_cur && (item_by_data == item_cur))
4385 pit = (*git).erase(pit);
4395 if (!groupname.isEmpty() && (git.key() == groupname))
4404 sel_item = next_item;
4407 groupname = sel_item->
GetData().toString();
4436 if (pginfo ==
nullptr)
4446 QCoreApplication::postEvent(
this,
new MythEvent(
"UPDATE_UI_LIST"));
4453 if (helpPopup->Create())
4463 if (viewPopup->Create())
4485 QStringList groupNames;
4486 QStringList displayNames;
4488 QStringList displayGroups;
4494 uint totalItems = 0;
4497 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Groups")));
4498 groupNames.append(
"");
4501 query.
prepare(
"SELECT recgroup, COUNT(title) FROM recorded "
4502 "WHERE deletepending = 0 AND watched <= :WATCHED "
4503 "GROUP BY recgroup");
4507 while (query.
next())
4509 QString dispGroup = query.
value(0).toString();
4513 (dispGroup !=
"Deleted"))
4514 totalItems += items;
4516 groupNames.append(dispGroup);
4518 dispGroup = (dispGroup ==
"Default") ? tr(
"Default") : dispGroup;
4519 dispGroup = (dispGroup ==
"Deleted") ? tr(
"Deleted") : dispGroup;
4520 dispGroup = (dispGroup ==
"LiveTV") ? tr(
"Live TV") : dispGroup;
4522 displayNames.append(tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup));
4529 displayNames.push_front(tr(
"%1 [%n item(s)]",
nullptr, totalItems)
4531 groupNames.push_front(
"All Programs");
4535 query.
prepare(
"SELECT DISTINCT category, COUNT(title) FROM recorded "
4536 "WHERE deletepending = 0 AND watched <= :WATCHED "
4537 "GROUP BY category");
4541 int unknownCount = 0;
4542 while (query.
next())
4545 QString dispGroup = query.
value(0).toString();
4546 if (dispGroup.isEmpty())
4548 unknownCount += items;
4549 dispGroup = tr(
"Unknown");
4551 else if (dispGroup == tr(
"Unknown"))
4553 unknownCount += items;
4557 (dispGroup != tr(
"Unknown")))
4559 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4560 groups += dispGroup;
4566 if (unknownCount > 0)
4568 QString dispGroup = tr(
"Unknown");
4569 uint items = unknownCount;
4570 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4571 groups += dispGroup;
4578 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Categories")));
4579 groupNames.append(
"");
4581 displayGroups.sort();
4582 QStringList::iterator it;
4583 for (it = displayGroups.begin(); it != displayGroups.end(); ++it)
4584 displayNames.append(*it);
4585 for (it = groups.begin(); it != groups.end(); ++it)
4586 groupNames.append(*it);
4588 QString label = tr(
"Change Filter");
4593 if (recGroupPopup->Create())
4605 delete recGroupPopup;
4622 QString newRecGroup = recGroup;
4624 if (newRecGroup.isEmpty())
4631 newRecGroup =
"Default";
4633 newRecGroup =
"All Programs";
4635 newRecGroup =
"LiveTV";
4637 newRecGroup =
"Deleted";
4669 query.
prepare(
"SELECT recgroup, password FROM recgroups "
4670 "WHERE password IS NOT NULL AND password <> '';");
4674 while (query.
next())
4676 QString recgroup = query.
value(0).toString();
4679 recgroup =
"Default";
4681 recgroup =
"All Programs";
4683 recgroup =
"LiveTV";
4685 recgroup =
"Deleted";
4713 "SELECT g.recgroup, COUNT(r.title) FROM recgroups g "
4714 "LEFT JOIN recorded r ON g.recgroupid=r.recgroupid AND r.deletepending = 0 "
4715 "WHERE g.recgroupid != 2 AND g.recgroupid != 3 "
4716 "GROUP BY g.recgroupid ORDER BY g.recgroup");
4718 QStringList displayNames(tr(
"Add New"));
4719 QStringList groupNames(
"addnewgroup");
4724 while (query.
next())
4726 QString dispGroup = query.
value(0).toString();
4727 groupNames.push_back(dispGroup);
4729 if (dispGroup ==
"Default")
4730 dispGroup = tr(
"Default");
4731 else if (dispGroup ==
"LiveTV")
4732 dispGroup = tr(
"Live TV");
4733 else if (dispGroup ==
"Deleted")
4734 dispGroup = tr(
"Deleted");
4736 displayNames.push_back(tr(
"%1 [%n item(s)]",
"", query.
value(1).toInt())
4740 QString label = tr(
"Select Recording Group") +
4746 if (rgChanger->Create())
4776 QStringList groupNames(tr(
"Default"));
4777 QStringList displayNames(
"Default");
4780 for (
const auto& name : std::as_const(list))
4782 displayNames.push_back(name);
4783 groupNames.push_back(name);
4786 QString label = tr(
"Select Playback Group") +
4792 if (pgChanger->Create())
4806 QList<uint>::Iterator it;
4811 if (tmpItem !=
nullptr)
4823 QList<uint>::Iterator it;
4828 if (tmpItem !=
nullptr)
4846 if (editMetadata->Create())
4854 delete editMetadata;
4859 const QString &newSubtitle,
4860 const QString &newDescription,
4861 const QString &newInetref,
4877 if (groupname == pginfo->GetTitle().toLower() &&
4878 newTitle != pginfo->GetTitle())
4884 QString tempSubTitle = newTitle;
4885 if (!newSubtitle.trimmed().isEmpty())
4886 tempSubTitle = QString(
"%1 - \"%2\"")
4887 .arg(tempSubTitle, newSubtitle);
4893 if (newSeason > 0 || newEpisode > 0)
4897 seasone = QString(
"s%1e%2")
4900 seasonx = QString(
"%1x%2")
4905 item->
SetText(tempSubTitle,
"titlesubtitle");
4906 item->
SetText(newTitle,
"title");
4907 item->
SetText(newSubtitle,
"subtitle");
4908 item->
SetText(newInetref,
"inetref");
4909 item->
SetText(seasonx,
"00x00");
4910 item->
SetText(seasone,
"s00e00");
4911 item->
SetText(season,
"season");
4912 item->
SetText(episode,
"episode");
4913 if (newDescription !=
nullptr)
4914 item->
SetText(newDescription,
"description");
4917 pginfo->SaveInetRef(newInetref);
4918 pginfo->SaveSeasonEpisode(newSeason, newEpisode);
4927 newRecGroup = newRecGroup.simplified();
4929 if (newRecGroup.isEmpty())
4932 if (newRecGroup ==
"addnewgroup")
4938 tr(
"New Recording Group"));
4943 if (newgroup->Create())
4963 if ((
p->GetRecordingGroup() ==
"LiveTV") &&
4964 (newRecGroup !=
"LiveTV"))
4966 p->SaveAutoExpire(defaultAutoExpire);
4968 else if ((
p->GetRecordingGroup() !=
"LiveTV") &&
4969 (newRecGroup ==
"LiveTV"))
4987 if ((
p->GetRecordingGroup() ==
"LiveTV") && (newRecGroup !=
"LiveTV"))
4988 p->SaveAutoExpire(defaultAutoExpire);
4989 else if ((
p->GetRecordingGroup() !=
"LiveTV") && (newRecGroup ==
"LiveTV"))
5002 if (newPlayGroup.isEmpty() || !tmpItem)
5005 if (newPlayGroup == tr(
"Default"))
5006 newPlayGroup =
"Default";
5010 QList<uint>::Iterator it;
5043 if (pwChanger->Create())
5059 query.
prepare(
"UPDATE recgroups SET password = :PASSWD WHERE "
5060 "recgroup = :RECGROUP");
5062 query.
bindValue(
":PASSWD", newPassword);
5068 if (newPassword.isEmpty())
5087 LOG(VB_GENERAL, LOG_ERR,
LOC +
5088 "Theme is missing 'groups' button list.");
5095 for (
int i = 0; i <
m_list.size(); ++i)
5098 QVariant::fromValue(
m_data.at(i)));
5118 if (item->
GetData().toString().isEmpty())
5121 QString group = item->
GetData().toString();
5229 LOG(VB_GENERAL, LOG_ERR,
LOC +
5230 "Window 'passwordchanger' is missing required elements.");
5293 LOG(VB_GENERAL, LOG_ERR,
LOC +
5294 "Window 'editmetadata' is missing required elements.");
5335 QString newRecDescription =
nullptr;
5336 QString newRecInetref =
nullptr;
5337 uint newRecSeason = 0;
5338 uint newRecEpisode = 0;
5345 if (newRecTitle.isEmpty())
5348 emit
result(newRecTitle, newRecSubtitle, newRecDescription,
5349 newRecInetref, newRecSeason, newRecEpisode);
5359 "recording online..."),
5387 lookup->SetSubtype(
type);
5389 lookup->SetAllowGeneric(
true);
5390 lookup->SetHandleImages(
false);
5398 lookup->SetAutomatic(
false);
5447 Qt::QueuedConnection);
5449 if (resultsdialog->Create())
5462 if (!mfsr || !mfsr->m_result)
5480 QString title = tr(
"No match found for this recording. You can "
5481 "try entering a TVDB/TMDB number, season, and "
5482 "episode manually.");
5486 if (okPopup->Create())
5502 LOG(VB_GENERAL, LOG_ERR,
LOC +
5503 "Window 'iconhelp' is missing required elements.");
5509 addItem(
"watched", tr(
"Recording has been watched"));
5510 addItem(
"commflagged", tr(
"Commercials are flagged"));
5511 addItem(
"cutlist", tr(
"An editing cutlist is present"));
5512 addItem(
"autoexpire", tr(
"The program is able to auto-expire"));
5513 addItem(
"processing", tr(
"Commercials are being flagged"));
5514 addItem(
"bookmark", tr(
"A bookmark is set"));
5516 addItem(
"inuse", tr(
"Recording is in use"));
5517 addItem(
"transcoded", tr(
"Recording has been transcoded"));
5520 addItem(
"mono", tr(
"Recording is in Mono"));
5521 addItem(
"stereo", tr(
"Recording is in Stereo"));
5522 addItem(
"surround", tr(
"Recording is in Surround Sound"));
5523 addItem(
"dolby", tr(
"Recording is in Dolby Surround Sound"));
5525 addItem(
"cc", tr(
"Recording is Closed Captioned"));
5526 addItem(
"subtitles", tr(
"Recording has Subtitles Available"));
5527 addItem(
"onscreensub", tr(
"Recording is Subtitled"));
5529 addItem(
"SD", tr(
"Recording is in Standard Definition"));
5530 addItem(
"widescreen", tr(
"Recording is Widescreen"));
5531 addItem(
"hdtv", tr(
"Recording is in High Definition"));
5532 addItem(
"hd720", tr(
"Recording is in 720p High Definition"));
5533 addItem(
"hd1080i", tr(
"Recording is in 1080i High Definition"));
5534 addItem(
"hd1080p", tr(
"Recording is in 1080p High Definition"));
5535 addItem(
"uhd4Ki", tr(
"Recording is in 4k(interlaced) UHD resolution"));
5536 addItem(
"uhd4Kp", tr(
"Recording is in 4k UHD resolution"));
5537 addItem(
"mpeg2", tr(
"Recording is using MPEG-2 codec"));
5538 addItem(
"avchd", tr(
"Recording is using AVC/H.264 codec"));
5539 addItem(
"hevc", tr(
"Recording is using HEVC/H.265 codec"));
5548 item->DisplayState(state,
"icons");
5553 QDateTime now = QDateTime::currentDateTime();
5557 QMap<int, JobQueueEntry> jobs;
5560 for (
const auto& job : std::as_const(jobs))
5562 m_jobs.insert(qMakePair(job.chanid, job.recstartts), job);
5569 const QDateTime &recstartts)
5572 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5573 auto end = values.cend();
5574 for (
auto iter = values.cbegin(); iter != end; ++iter)
5576 if (iter->type == jobType)
5583 const QDateTime &recstartts)
5586 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5587 auto end = values.cend();
5588 for (
auto iter = values.cbegin(); iter != end; ++iter)
5590 if (iter->type == jobType)
5597 const QDateTime &recstartts)
5599 return IsJobQueued(jobType, chanid, recstartts) ||
5600 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