Go to the documentation of this file.
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);
207 static const std::array<const uint,3>
s_artDelay
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";
516 LOG(VB_GENERAL, LOG_ERR,
LOC +
517 "Theme is missing critical theme elements.");
571 "titlesubtitle|shortdate|starttime");
614 QString label = tr(
"Password for group '%1':").arg(newRecGroup);
652 const QString &grouplabel)
658 infoMap[
"title"] = grouplabel;
665 if (!groupname.isEmpty() && !
m_progLists[groupname].empty())
690 if (countInGroup >= 1)
693 float groupSize = 0.0;
695 for (
auto *
info : group)
699 uint64_t filesize =
info->GetFilesize();
706 groupSize += filesize;
710 desc = tr(
"There is/are %n recording(s) in this display "
711 "group, which consume(s) %1 GiB.",
"", countInGroup)
712 .arg(groupSize / 1024.0F / 1024.0F / 1024.0F, 0,
'f', 2);
716 desc = tr(
"There is no recording in this display group.");
719 infoMap[
"description"] = desc;
720 infoMap[
"rec_count"] = QString(
"%1").arg(countInGroup);
729 ratingState->
Reset();
749 bool force_preview_reload)
765 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
766 QString(
"UpdateUIListItem called with a title unknown "
767 "to us in m_recordingList\n\t\t\t%1")
772 static const std::array<const std::string,9>
disp_flags
774 "playlist",
"watched",
"preserve",
775 "cutlist",
"autoexpire",
"editing",
776 "bookmark",
"inuse",
"transcoded"
791 disp_flag_stat[8] = ((pginfo->
GetProgramFlags() & FL_TRANSCODED) != 0U);
793 for (
size_t i = 0; i <
disp_flags.size(); ++i)
799 bool is_sel,
bool force_preview_reload)
816 pginfo->ToMap(infoMap);
824 if (groupname == pginfo->GetTitle().toLower())
826 item->
SetText(tempSubTitle,
"titlesubtitle");
830 "titlesubtitlefull");
847 QString
rating = QString::number(pginfo->GetStars(10));
852 if (oldimgfile.isEmpty() || force_preview_reload)
859 pginfo->CalculateProgress(pginfo->QueryLastPlayPos());
861 pginfo->ToMap(infoMap);
895 if (arthost.isEmpty())
902 pginfo->GetInetRef(), pginfo->GetSeason(),
924 if (item->
GetText(
"is_item_initialized").isNull())
926 QMap<AudioProps, QString> audioFlags;
927 audioFlags[AUD_DOLBY] =
"dolby";
928 audioFlags[AUD_SURROUND] =
"surround";
929 audioFlags[AUD_STEREO] =
"stereo";
930 audioFlags[AUD_MONO] =
"mono";
932 QMap<VideoProps, QString> codecFlags;
933 codecFlags[VID_MPEG2] =
"mpeg2";
934 codecFlags[VID_AVC] =
"avc";
935 codecFlags[VID_HEVC] =
"hevc";
937 QMap<SubtitleProps, QString> subtitleFlags;
938 subtitleFlags[SUB_SIGNED] =
"deafsigned";
939 subtitleFlags[SUB_ONSCREEN] =
"onscreensub";
940 subtitleFlags[SUB_NORMAL] =
"subtitles";
941 subtitleFlags[SUB_HARDHEAR] =
"cc";
951 pginfo->ToMap(infoMap);
956 if (groupname == pginfo->GetTitle().toLower())
958 item->
SetText(tempSubTitle,
"titlesubtitle");
962 "titlesubtitlefull");
967 item->
DisplayState(QString::number(pginfo->GetStars(10)),
972 QMap<AudioProps, QString>::iterator ait;
973 for (ait = audioFlags.begin(); ait != audioFlags.end(); ++ait)
975 if (pginfo->GetAudioProperties() & ait.key())
979 uint props = pginfo->GetVideoProperties();
981 QMap<VideoProps, QString>::iterator cit;
982 for (cit = codecFlags.begin(); cit != codecFlags.end(); ++cit)
984 if (props & cit.key())
991 if (props & VID_PROGRESSIVE)
996 if (props & VID_1080)
1003 if (props & VID_1080)
1006 if (props & VID_720)
1008 if (!(props & (VID_4K | VID_1080 | VID_720)))
1010 if (props & VID_HDTV)
1012 else if (props & VID_WIDESCREEN)
1018 QMap<SubtitleProps, QString>::iterator sit;
1019 for (sit = subtitleFlags.begin(); sit != subtitleFlags.end(); ++sit)
1021 if (pginfo->GetSubtitleType() & sit.key())
1025 item->
DisplayState(pginfo->GetCategoryTypeString(),
"categorytype");
1028 item->
SetText(
"yes",
"is_item_initialized");
1045 const auto watchedPercent = pginfo->GetWatchedPercent();
1047 item->
SetProgress1(0, showProgress ? 100 : 0, watchedPercent);
1048 item->
SetProgress2(0, 100, pginfo->GetRecordedPercent());
1055 if (token.isEmpty())
1062 (
asAvailable == sel_pginfo->GetAvailableStatus()))
1078 if (list.size() < 5)
1080 LOG(VB_GENERAL, LOG_ERR,
"HandlePreviewEvent() -- too few args");
1081 for (
uint i = 0; i < (
uint) list.size(); i++)
1083 LOG(VB_GENERAL, LOG_INFO, QString(
"%1: %2")
1084 .arg(i).arg(list[i]));
1089 uint recordingID = list[0].toUInt();
1090 const QString& previewFile = list[1];
1091 const QString& message = list[2];
1094 for (
uint i = 4; i < (
uint) list.size(); i++)
1096 const QString& token = list[i];
1107 QString tokens(
"\n\t\t\ttokens: ");
1108 for (
uint i = 4; i < (
uint) list.size(); i++)
1109 tokens += list[i] +
", ";
1110 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1111 "Ignoring PREVIEW_SUCCESS, no matcing token" + tokens);
1115 if (previewFile.isEmpty())
1117 LOG(VB_GENERAL, LOG_ERR,
LOC +
1118 "Ignoring PREVIEW_SUCCESS, no preview file.");
1130 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1131 "Ignoring PREVIEW_SUCCESS, item no longer on screen.");
1136 LOG(VB_GUI, LOG_INFO,
LOC + QString(
"Loading preview %1,\n\t\t\tmsg %2")
1137 .arg(previewFile, message));
1139 item->
SetImage(previewFile,
"preview",
true);
1153 uint32_t flags = FL_NONE;
1158 QMap <QString, int>::iterator it;
1161 iconMap[
"commflagged"] = FL_COMMFLAG;
1162 iconMap[
"cutlist"] = FL_CUTLIST;
1163 iconMap[
"autoexpire"] = FL_AUTOEXP;
1164 iconMap[
"processing"] = FL_COMMPROCESSING;
1165 iconMap[
"editing"] = FL_EDITING;
1166 iconMap[
"bookmark"] = FL_BOOKMARK;
1167 iconMap[
"inuse"] = (FL_INUSERECORDING |
1170 iconMap[
"transcoded"] = FL_TRANSCODED;
1171 iconMap[
"watched"] = FL_WATCHED;
1172 iconMap[
"preserved"] = FL_PRESERVED;
1180 iconImage->
SetVisible((flags & (*it)) != 0U);
1194 iconMap[
"1dolby"] = AUD_DOLBY;
1195 iconMap[
"2surround"] = AUD_SURROUND;
1196 iconMap[
"3stereo"] = AUD_STEREO;
1200 bool haveIcon =
false;
1201 if (pginfo && iconState)
1216 if (iconState && !haveIcon)
1220 if (pginfo && iconState)
1226 if (props & VID_PROGRESSIVE)
1229 iconMap[
"hd1080p"] = VID_1080;
1234 iconMap[
"hd1080i"] = VID_1080;
1239 iconMap[
"widescreen"] = VID_WIDESCREEN;
1258 iconMap[
"damaged"] = VID_DAMAGED;
1262 if (pginfo && iconState)
1277 if (iconState && !haveIcon)
1280 iconMap[
"deafsigned"] = SUB_SIGNED;
1281 iconMap[
"onscreensub"] = SUB_ONSCREEN;
1282 iconMap[
"subtitles"] = SUB_NORMAL;
1287 if (pginfo && iconState)
1302 if (iconState && !haveIcon)
1327 if (!freereportText && !usedProgress && !
GetChild(
"diskspacetotal") &&
1337 usageMap[
"diskspacetotal"] = locale.toString((freeSpaceTotal / 1024.0),
1339 usageMap[
"diskspaceused"] = locale.toString((freeSpaceUsed / 1024.0),
1341 usageMap[
"diskspacefree"] = locale.toString(
1342 ((freeSpaceTotal - freeSpaceUsed) / 1024.0),
1346 if (freeSpaceTotal > 0.0)
1347 perc = (100.0 * freeSpaceUsed) / freeSpaceTotal;
1349 usageMap[
"diskspacepercentused"] = QString::number((
int)perc);
1350 usageMap[
"diskspacepercentfree"] = QString::number(100 - (
int)perc);
1352 QString size = locale.toString(((freeSpaceTotal - freeSpaceUsed) / 1024.0),
1355 QString usestr = tr(
"%1% used, %2 GB free",
"Diskspace")
1356 .arg(QString::number((
int)perc),
1360 freereportText->
SetText(usestr);
1364 usedProgress->
SetTotal((
int)freeSpaceTotal);
1365 usedProgress->
SetUsed((
int)freeSpaceUsed);
1388 const QString& key = (*it);
1389 QString
tmp = (key ==
"All Programs") ?
"All" : key;
1396 QVariant::fromValue(key));
1400 item->SetText(name);
1410 int best_pref = INT_MAX;
1412 QStringList::iterator it;
1415 const QString& groupname = (*it);
1418 QVariant::fromValue(groupname.toLower()));
1420 int pref = groupPreferences.indexOf(groupname.toLower());
1421 if ((pref >= 0) && (pref < best_pref))
1428 QString displayName = groupname;
1429 if (displayName.isEmpty())
1438 item->SetText(groupname,
"groupname");
1439 item->SetText(displayName,
"name");
1440 item->SetText(displayName);
1442 int count =
m_progLists[groupname.toLower()].size();
1443 item->SetText(QString::number(count),
"reccount");
1458 QString newRecGroup = sel_item->
GetData().toString();
1474 if (!nextGroup.isEmpty())
1483 QString groupname = sel_item->
GetData().toString();
1484 QString grouplabel = sel_item->
GetText();
1499 ProgramMap::iterator pmit =
m_progLists.find(groupname);
1505 for (
auto & prog : progList)
1508 prog->GetAvailableStatus() ==
asDeleted)
1517 if (!progList.empty())
1522 tr(
"There are no recordings available") :
1523 tr(
"There are no recordings in your current view");
1532 QStringList &groupSelPref, QStringList &itemSelPref,
1533 QStringList &itemTopPref)
1539 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1541 i < groupList->GetCount(); i++)
1545 groupSelPref.push_back(prefSelGroup->
GetData().toString());
1549 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i++)
1553 itemSelPref.push_back(groupSelPref.front());
1554 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1556 for (
int i = curPos; (i >= 0) && (i < recordingList->GetCount()); i--)
1560 itemSelPref.push_back(groupSelPref.front());
1561 itemSelPref.push_back(QString::number(pginfo->GetRecordingID()));
1565 for (
int i = topPos + 1; i >= topPos - 1; i--)
1567 if (i >= 0 && i < recordingList->GetCount())
1573 itemTopPref.push_front(QString::number(pginfo->GetRecordingID()));
1574 itemTopPref.push_front(groupSelPref.front());
1578 itemTopPref.push_back(groupSelPref.front());
1579 itemTopPref.push_back(QString::number(pginfo->GetRecordingID()));
1589 const QStringList &groupSelPref,
const QStringList &itemSelPref,
1590 const QStringList &itemTopPref)
1595 if (!prefSelGroup ||
1596 !groupSelPref.contains(prefSelGroup->
GetData().toString()) ||
1597 !itemSelPref.contains(prefSelGroup->
GetData().toString()))
1603 QString groupname = prefSelGroup->
GetData().toString();
1607 for (
uint i = 0; i+1 < (
uint)itemSelPref.size(); i+=2)
1609 if (itemSelPref[i] != groupname)
1612 uint recordingID = itemSelPref[i+1].toUInt();
1617 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1620 i = itemSelPref.size();
1628 for (
uint i = 0; i+1 < (
uint)itemTopPref.size(); i+=2)
1630 if (itemTopPref[i] != groupname)
1633 uint recordingID = itemTopPref[i+1].toUInt();
1638 if (pginfo && (pginfo->GetRecordingID() == recordingID))
1641 i = itemTopPref.size();
1650 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect success (%1,%2)")
1651 .arg(sel).arg(top));
1658 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Reselect failure (%1,%2)")
1659 .arg(sel).arg(top));
1669 QStringList groupSelPref;
1670 QStringList itemSelPref;
1671 QStringList itemTopPref;
1673 groupSelPref, itemSelPref, itemTopPref))
1682 QMap<uint, AvailableStatusType> asCache;
1688 uint asRecordingID = prog->GetRecordingID();
1689 asCache[asRecordingID] = prog->GetAvailableStatus();
1708 bool isAllProgsGroup = (
m_recGroup ==
"All Programs");
1709 QMap<QString, QString> sortedList;
1710 QMap<int, QString> searchRule;
1711 QMap<int, QDateTime> recidLastEventTime;
1712 QMap<int, ProgramInfo*> recidWatchListProgram;
1723 query.
prepare(
"SELECT recordid,title FROM record "
1724 "WHERE search > 0 AND search != :MANUAL;");
1729 while (query.
next())
1731 QString tmpTitle = query.
value(1).toString();
1733 searchRule[query.
value(0).toInt()] = tmpTitle;
1739 bool isUnknownCategory = (
m_recGroup == tr(
"Unknown"));
1740 bool isDeletedGroup = (
m_recGroup ==
"Deleted");
1741 bool isLiveTvGroup = (
m_recGroup ==
"LiveTV");
1743 std::vector<ProgramInfo*> list;
1746 for (
auto *
p : list)
1748 if (
p->IsDeletePending())
1753 const QString& pRecgroup(
p->GetRecordingGroup());
1754 const bool isLiveTVProg(pRecgroup ==
"LiveTV");
1761 if (pRecgroup ==
"Deleted")
1765 if (!isDeletedGroup)
1770 !isLiveTvGroup && isLiveTVProg)
1779 else if (isCategoryFilter)
1782 if (isUnknownCategory ? !
p->GetCategory().isEmpty()
1787 else if (!isAllProgsGroup && pRecgroup !=
m_recGroup)
1792 if (
p->GetTitle().isEmpty())
1793 p->SetTitle(tr(
"_NO_TITLE_"));
1800 uint asRecordingID =
p->GetRecordingID();
1801 if (asCache.contains(asRecordingID))
1802 p->SetAvailableStatus(asCache[asRecordingID],
"UpdateUILists");
1808 QString tmpTitle = tr(
"Live TV");
1809 sortedList[tmpTitle.toLower()] = tmpTitle;
1811 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1819 p->GetTitle(),
p->GetSortTitle(),
m_viewMask, titleSort,
1820 p->GetRecordingPriority());
1821 sTitle = sTitle.toLower();
1823 if (!sortedList.contains(sTitle))
1824 sortedList[sTitle] =
p->GetTitle();
1825 m_progLists[sortedList[sTitle].toLower()].push_front(
p);
1826 m_progLists[sortedList[sTitle].toLower()].setAutoDelete(
false);
1831 !pRecgroup.isEmpty() && !isLiveTVProg)
1833 sortedList[pRecgroup.toLower()] = pRecgroup;
1835 m_progLists[pRecgroup.toLower()].setAutoDelete(
false);
1841 QString catl =
p->GetCategory().toLower();
1842 sortedList[catl] =
p->GetCategory();
1848 !searchRule[
p->GetRecordingRuleID()].isEmpty() &&
1849 p->GetTitle() != searchRule[
p->GetRecordingRuleID()])
1851 QString tmpTitle = QString(
"(%1)")
1852 .arg(searchRule[
p->GetRecordingRuleID()]);
1853 sortedList[tmpTitle.toLower()] = tmpTitle;
1855 m_progLists[tmpTitle.toLower()].setAutoDelete(
false);
1859 !isLiveTVProg && pRecgroup !=
"Deleted")
1861 int rid =
p->GetRecordingRuleID();
1862 auto letIt = recidLastEventTime.find(rid);
1863 if (letIt == recidLastEventTime.end() || *letIt < p->GetLastModifiedTime())
1865 recidLastEventTime[rid] =
p->GetLastModifiedTime();
1871 LOG(VB_FILE, LOG_INFO, QString(
"Auto-expire off: %1")
1872 .arg(
p->GetTitle()));
1874 else if (
p->IsWatched())
1877 LOG(VB_FILE, LOG_INFO,
1878 QString(
"Marked as 'watched': %1")
1879 .arg(
p->GetTitle()));
1883 auto wlpIt = recidWatchListProgram.find(rid);
1884 if (wlpIt == recidWatchListProgram.end())
1886 recidWatchListProgram[rid] =
p;
1890 (*wlpIt)->SetRecordingPriority2(
wlEarlier);
1891 LOG(VB_FILE, LOG_INFO,
1892 QString(
"Not the earliest: %1")
1893 .arg((*wlpIt)->GetTitle()));
1895 recidWatchListProgram[rid] =
p;
1900 LOG(VB_FILE, LOG_INFO,
1901 QString(
"Not the earliest: %1")
1902 .arg(
p->GetTitle()));
1910 for (
auto *
p : std::as_const(recidWatchListProgram))
1919 if (sortedList.empty())
1921 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"SortedList is Empty");
1925 if (!isAllProgsGroup)
1937 if (episodeSort ==
"OrigAirDate")
1939 QMap<QString, ProgramList>::Iterator Iprog;
1942 if (!Iprog.key().isEmpty())
1944 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
1951 else if (episodeSort ==
"Id")
1953 QMap<QString, ProgramList>::Iterator Iprog;
1956 if (!Iprog.key().isEmpty())
1958 std::stable_sort((*Iprog).begin(), (*Iprog).end(),
1965 else if (episodeSort ==
"Date")
1967 QMap<QString, ProgramList>::iterator it;
1970 if (!it.key().isEmpty())
1972 std::stable_sort((*it).begin(), (*it).end(),
1979 else if (episodeSort ==
"Season")
1981 QMap<QString, ProgramList>::iterator it;
1984 if (!it.key().isEmpty())
1986 std::stable_sort((*it).begin(), (*it).end(),
1997 query.
prepare(
"SELECT recordid, last_delete FROM record;");
2001 while (query.
next())
2003 int recid = query.
value(0).toInt();
2005 QDateTime last_delete =
2008 if (last_delete.isValid())
2010 auto it = recidLastEventTime.find(recid);
2011 if (it != recidLastEventTime.end() && last_delete > *it)
2013 recidLastEventTime[recid] = last_delete;
2022 int recid = (*pit)->GetRecordingRuleID();
2024 (*pit)->SetRecordingPriority2(recidLastEventTime[recid].toSecsSinceEpoch()/60);
2026 LOG(VB_FILE, LOG_INFO, QString(
" %1 %2 %3")
2029 .arg((*pit)->GetRecordingPriority2())
2030 .arg((*pit)->GetTitle()));
2044 (
std::find(sortedList.cbegin(), sortedList.cend(), tr(
"Live TV"))
2045 == sortedList.cend()))
2061 query.
prepare(
"SELECT distinct recgroup from recorded WHERE "
2062 "deletepending = 0 ORDER BY recgroup");
2066 while (query.
next())
2068 name = query.
value(0).toString();
2069 if (name !=
"Deleted" && name !=
"LiveTV" && !name.startsWith(
'.'))
2097 groupSelPref, itemSelPref, itemTopPref);
2110 while (!
tmp.isEmpty())
2122 QCoreApplication::postEvent(
2136 const bool ignoreBookmark =
false;
2137 const bool ignoreProgStart =
false;
2138 const bool ignoreLastPlayPos =
false;
2139 const bool underNetworkControl =
false;
2141 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2142 underNetworkControl);
2155 const bool ignoreBookmark =
false;
2156 const bool ignoreProgStart =
true;
2157 const bool ignoreLastPlayPos =
true;
2158 const bool underNetworkControl =
false;
2160 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2161 underNetworkControl);
2174 const bool ignoreBookmark =
true;
2175 const bool ignoreProgStart =
true;
2176 const bool ignoreLastPlayPos =
true;
2177 const bool underNetworkControl =
false;
2179 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2180 underNetworkControl);
2193 const bool ignoreBookmark =
true;
2194 const bool ignoreProgStart =
true;
2195 const bool ignoreLastPlayPos =
false;
2196 const bool underNetworkControl =
false;
2198 PlayX(*pginfo, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
2199 underNetworkControl);
2203 bool ignoreBookmark,
2204 bool ignoreProgStart,
2205 bool ignoreLastPlayPos,
2206 bool underNetworkControl)
2210 Play(pginfo,
false, ignoreBookmark, ignoreProgStart, ignoreLastPlayPos, underNetworkControl);
2257 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2259 QString(
"availability status: %1 ")
2260 .arg(pginfo->GetAvailableStatus()));
2263 tr(
"This recording is already being deleted"));
2265 else if (!pginfo->QueryIsDeleteCandidate())
2268 pginfo->QueryIsInUse(byWho);
2270 LOG(VB_GENERAL, LOG_ERR, QString(
"deleteSelected(%1) -- failed ")
2272 QString(
"delete candidate: %1 in use by %2")
2273 .arg(pginfo->QueryIsDeleteCandidate()).arg(byWho));
2275 if (byWho.isEmpty())
2278 tr(
"This recording is already being deleted"));
2283 tr(
"This recording is currently in use by:") +
"\n" +
2331 if (which ==
"groupmenu")
2351 else if (which ==
"actionmenu")
2365 QString label = tr(
"Group List Menu");
2406 bool inPlaylist,
bool ignoreBookmark,
bool ignoreProgStart,
2407 bool ignoreLastPlayPos,
bool underNetworkControl)
2409 bool playCompleted =
false;
2437 ignoreProgStart =
true;
2453 QCoreApplication::postEvent(
2460 return playCompleted;
2464 bool forceMetadataDelete)
2471 if (!forceMetadataDelete &&
2481 if (!forceMetadataDelete)
2486 forceMetadataDelete, forgetHistory);
2516 label = tr(
"Are you sure you want to delete:");
break;
2518 label = tr(
"Recording file does not exist.\n"
2519 "Are you sure you want to delete:");
2522 label = tr(
"Are you sure you want to stop:");
break;
2529 if (delItem !=
nullptr)
2579 tr(
"Yes, delete it and the remaining %1 list items")
2588 nullptr, !defaultIsYes);
2592 nullptr, !defaultIsYes);
2599 tr(
"No, and keep the remaining %1 list items")
2600 .arg(other_delete_cnt),
2620 tr(
"This recording is currently in "
2621 "use by:") +
"\n" + byWho);
2627 tr(
"This recording is currently "
2634 tr(
"This recording is currently being "
2635 "deleted and is unavailable"));
2640 tr(
"This recording has been "
2641 "deleted and is unavailable"));
2646 tr(
"The file for this recording can "
2652 tr(
"The file for this recording is "
2658 tr(
"This recording is not yet "
2665 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2666 "all items in the playlist",
"",
m_playList.size());
2678 menu->AddItem(tr(
"Toggle playlist for this Category/Title"),
2683 menu->AddItem(tr(
"Toggle playlist for this Group"),
2689 menu->AddItem(tr(
"Toggle playlist for this recording"),
2696 menu->AddItem(tr(
"Delete, and allow re-record"),
2704 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2705 "all items in the playlist",
"",
m_playList.size());
2722 QString label = tr(
"There is %n item(s) in the playlist. Actions affect "
2723 "all items in the playlist",
"",
m_playList.size());
2729 QList<uint>::Iterator it;
2730 bool isTranscoding =
true;
2731 bool isFlagging =
true;
2732 bool isMetadataLookup =
true;
2733 bool isRunningUserJob1 =
true;
2734 bool isRunningUserJob2 =
true;
2735 bool isRunningUserJob3 =
true;
2736 bool isRunningUserJob4 =
true;
2746 isTranscoding =
false;
2754 isMetadataLookup =
false;
2758 isRunningUserJob1 =
false;
2762 isRunningUserJob2 =
false;
2766 isRunningUserJob3 =
false;
2770 isRunningUserJob4 =
false;
2771 if (!isTranscoding && !isFlagging && !isRunningUserJob1 &&
2772 !isRunningUserJob2 && !isRunningUserJob3 && !isRunningUserJob4)
2787 if (!isMetadataLookup)
2793 if (!command.isEmpty())
2797 if (!isRunningUserJob1)
2799 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2804 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2810 if (!command.isEmpty())
2814 if (!isRunningUserJob2)
2816 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2821 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2827 if (!command.isEmpty())
2831 if (!isRunningUserJob3)
2833 menu->AddItem(tr(
"Begin") +
' ' + jobTitle,
2838 menu->AddItem(tr(
"Stop") +
' ' + jobTitle,
2844 if (!command.isEmpty())
2848 if (!isRunningUserJob4)
2850 menu->AddItem(QString(
"%1 %2").arg(tr(
"Begin"), jobTitle),
2855 menu->AddItem(QString(
"%1 %2").arg(tr(
"Stop"), jobTitle),
2926 menu->AddItem(tr(
"Play from last played position"),
2929 menu->AddItem(tr(
"Play from bookmark"),
2931 menu->AddItem(tr(
"Play from beginning"),
2934 menu->AddItem(tr(
"Clear last played position"),
2950 tr(
"Disable Auto Expire") : tr(
"Enable Auto Expire");
2952 tr(
"Do not preserve this episode") : tr(
"Preserve this episode");
2973 menu->AddItem(tr(
"Edit Recording Schedule"),
2987 static const std::array<const int,kMaxJobs>
kJobs
3018 const std::array<const bool,kMaxJobs> add
3028 const std::array<const QString,kMaxJobs*2> desc
3031 tr(
"Stop Transcoding"), tr(
"Begin Transcoding"),
3032 tr(
"Stop Commercial Detection"), tr(
"Begin Commercial Detection"),
3033 tr(
"Stop Metadata Lookup"), tr(
"Begin Metadata Lookup"),
3040 for (
size_t i = 0; i <
kMaxJobs; i++)
3045 QString stop_desc = desc[(i*2)+0];
3046 QString start_desc = desc[(i*2)+1];
3048 if (start_desc.toUInt())
3051 "UserJobDesc"+start_desc, tr(
"User Job") +
" #" + start_desc);
3052 stop_desc = tr(
"Stop") +
' ' + jobTitle;
3053 start_desc = tr(
"Begin") +
' ' + jobTitle;
3061 menu->AddItem((running) ? stop_desc : start_desc,
3062 kMySlots[(i * 2) + (running ? 0 : 1)], submenu);
3070 QString label = tr(
"Transcoding profiles");
3074 menu->AddItemV(tr(
"Default"), QVariant::fromValue(-1));
3075 menu->AddItemV(tr(
"Autodetect"), QVariant::fromValue(0));
3078 query.
prepare(
"SELECT r.name, r.id "
3079 "FROM recordingprofiles r, profilegroups p "
3080 "WHERE p.name = 'Transcoders' "
3081 "AND r.profilegroup = p.id "
3082 "AND r.name != 'RTjpeg/MPEG4' "
3083 "AND r.name != 'MPEG2' ");
3091 while (query.
next())
3093 QString transcoder_name = query.
value(0).toString();
3094 int transcoder_id = query.
value(1).toInt();
3097 if (transcoder_name ==
"High Quality")
3098 transcoder_name = tr(
"High Quality");
3099 else if (transcoder_name ==
"Medium Quality")
3100 transcoder_name = tr(
"Medium Quality");
3101 else if (transcoder_name ==
"Low Quality")
3102 transcoder_name = tr(
"Low Quality");
3104 menu->AddItemV(transcoder_name, QVariant::fromValue(transcoder_id));
3129 label = tr(
"Recording file cannot be found");
3131 label = tr(
"Recording file contains no data");
3133 tr(
"Recording Options");
3175 bool sameProgram =
false;
3262 QString timedate = QString(
"%1 - %2")
3276 return QString(
"\n%1%2\n%3").arg(title, extra, timedate);
3281 QList<uint>::Iterator it;
3339 QList<uint>::Iterator it;
3344 if (pginfo !=
nullptr)
3415 "",
"", jobHost, jobFlags);
3422 QList<uint>::Iterator it;
3457 QString forceDeleteStr(
"0");
3467 list.push_back(forceDeleteStr);
3468 list.push_back(forgetHistory ?
"1" :
"0");
3489 uint recordingID = 0;
3496 uint recordingID = 0;
3512 QCoreApplication::postEvent(
this, e);
3520 QString title = pginfo->
GetTitle().toLower();
3552 const QString& recgroup)
3555 std::array<ProgramList::iterator,2> _it {
3557 std::array<ProgramList::iterator,2> _end {
3560 if (recgroup !=
"LiveTV")
3562 swap( _it[0], _it[1]);
3563 swap(_end[0], _end[1]);
3566 for (
uint i = 0; i < 2; i++)
3569 const auto& end = _end[i];
3570 for (; it != end; ++it)
3572 if ((*it)->GetRecordingID() == recordingID)
3595 pginfo->SaveWatched(on);
3636 pginfo->SavePreserve(on);
3655 for (
auto *pl : std::as_const(
m_progLists[groupname]))
3657 if (pl && (pl->GetAvailableStatus() ==
asAvailable))
3731 QStringList tokens = command.simplified().split(
" ");
3733 if (tokens.size() >= 4 && (tokens[1] ==
"PLAY" || tokens[1] ==
"RESUME"))
3735 if (tokens.size() == 6 && tokens[2] ==
"PROGRAM")
3737 int clientID = tokens[5].toInt();
3739 LOG(VB_GENERAL, LOG_INFO,
LOC +
3740 QString(
"NetworkControl: Trying to %1 program '%2' @ '%3'")
3741 .arg(tokens[1], tokens[3], tokens[4]));
3745 LOG(VB_GENERAL, LOG_ERR,
LOC +
3746 "NetworkControl: Already playing");
3748 QString msg = QString(
3749 "NETWORK_CONTROL RESPONSE %1 ERROR: Unable to play, "
3750 "player is already playing another recording.")
3758 uint chanid = tokens[3].toUInt();
3764 QString msg = QString(
"NETWORK_CONTROL RESPONSE %1 OK")
3771 const bool ignoreBookmark = (tokens[1] ==
"PLAY");
3772 const bool ignoreProgStart =
true;
3773 const bool ignoreLastPlayPos =
true;
3774 const bool underNetworkControl =
true;
3775 PlayX(pginfo, ignoreBookmark, ignoreProgStart,
3776 ignoreLastPlayPos, underNetworkControl);
3780 QString message = QString(
"NETWORK_CONTROL RESPONSE %1 "
3781 "ERROR: Could not find recording for "
3783 .arg(tokens[5], tokens[3], tokens[4]);
3794 if ((event->key() == Qt::Key_LaunchMedia) &&
3795 (event->modifiers() ==
3796 (Qt::ShiftModifier |
3797 Qt::ControlModifier |
3800 Qt::KeypadModifier)))
3814 QStringList actions;
3818 for (
int i = 0; i < actions.size() && !handled; ++i)
3820 const QString&
action = actions[i];
3825 else if (
action ==
"MENU")
3829 else if (
action ==
"NEXTFAV")
3836 else if (
action ==
"TOGGLEFAV")
3862 if (!nextGroup.isEmpty())
3865 else if (
action ==
"NEXTVIEW")
3872 else if (
action ==
"PREVVIEW")
3887 else if (
action ==
"CHANGERECGROUP")
3891 else if (
action ==
"CHANGEGROUPVIEW")
3895 else if (
action ==
"EDIT")
3907 else if (
action ==
"CUSTOMEDIT")
3909 else if (
action ==
"GUIDE")
3911 else if (
action ==
"UPCOMING")
3940 QString resultid = dce->
GetId();
3942 if (resultid ==
"transcode" && dce->GetResult() >= 0)
3947 auto *me =
dynamic_cast<MythEvent *
>(event);
3951 const QString& message = me->
Message();
3953 if (message.startsWith(
"RECORDING_LIST_CHANGE"))
3955 QStringList tokens = message.simplified().split(
" ");
3956 uint recordingID = 0;
3957 if (tokens.size() >= 3)
3958 recordingID = tokens[2].toUInt();
3960 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
3970 else if (recordingID && (tokens[1] ==
"ADD"))
3979 else if (recordingID && (tokens[1] ==
"DELETE"))
3988 else if (message.startsWith(
"NETWORK_CONTROL"))
3990 QStringList tokens = message.simplified().split(
" ");
3991 if ((tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
3998 Qt::KeyboardModifiers modifiers =
4000 Qt::ControlModifier |
4004 auto *keyevent =
new QKeyEvent(QEvent::KeyPress,
4005 Qt::Key_LaunchMedia, modifiers);
4008 keyevent =
new QKeyEvent(QEvent::KeyRelease,
4009 Qt::Key_LaunchMedia, modifiers);
4013 else if (message.startsWith(
"UPDATE_FILE_SIZE"))
4015 QStringList tokens = message.simplified().split(
" ");
4016 if (tokens.size() >= 3)
4019 uint recordingID = tokens[1].toUInt();
4020 uint64_t filesize = tokens[2].toLongLong(&ok);
4026 recordingID, filesize,
4031 else if (message ==
"UPDATE_UI_LIST")
4041 else if (message.startsWith(
"UPDATE_UI_ITEM"))
4043 QStringList tokens = message.simplified().split(
" ");
4044 if (tokens.size() < 3)
4047 uint recordingID = tokens[1].toUInt();
4053 else if (message ==
"UPDATE_USAGE_UI")
4057 else if (message ==
"RECONNECT_SUCCESS")
4061 else if (message ==
"LOCAL_PBB_DELETE_RECORDINGS")
4064 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i+=3)
4066 uint recordingID = me->ExtraDataList()[i+0].toUInt();
4072 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4073 QString(
"LOCAL_PBB_DELETE_RECORDINGS - "
4074 "No matching recording %1")
4079 QString forceDeleteStr = me->ExtraDataList()[i+1];
4080 QString forgetHistoryStr = me->ExtraDataList()[i+2];
4083 list.push_back(forceDeleteStr);
4084 list.push_back(forgetHistoryStr);
4086 "LOCAL_PBB_DELETE_RECORDINGS");
4098 else if (message ==
"DELETE_SUCCESSES")
4102 else if (message ==
"DELETE_FAILURES")
4104 if (me->ExtraDataList().size() < 3)
4107 for (
uint i = 0; i+2 < (
uint)me->ExtraDataList().size(); i += 3)
4110 me->ExtraDataList()[i+0].toUInt());
4118 bool forceDelete = me->ExtraDataList()[1].toUInt() != 0U;
4127 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4128 "Delete failures not handled due to "
4129 "pre-existing popup.");
4136 else if (message ==
"PREVIEW_SUCCESS")
4140 else if (message ==
"PREVIEW_FAILED" && me->ExtraDataCount() >= 5)
4142 for (
uint i = 4; i < (
uint) me->ExtraDataCount(); i++)
4144 const QString& token = me->ExtraData(i);
4150 else if (message ==
"AVAILABILITY" && me->ExtraDataCount() == 8)
4152 static constexpr std::chrono::milliseconds kMaxUIWaitTime = 10s;
4153 QStringList list = me->ExtraDataList();
4154 uint recordingID = list[0].toUInt();
4157 uint64_t fs = list[3].toULongLong();
4159 tm.setHMS(list[4].toUInt(), list[5].toUInt(),
4160 list[6].toUInt(), list[7].toUInt());
4161 QTime now = QTime::currentTime();
4162 auto time_elapsed = std::chrono::milliseconds(tm.msecsTo(now));
4163 if (time_elapsed < 0ms)
4164 time_elapsed += 24h;
4175 if (time_elapsed >= kMaxUIWaitTime)
4184 (time_elapsed < kMaxUIWaitTime))
4194 const bool ignoreBookmark =
false;
4195 const bool ignoreProgStart =
false;
4196 const bool ignoreLastPlayPos =
true;
4197 const bool underNetworkControl =
false;
4199 ignoreBookmark, ignoreProgStart, ignoreLastPlayPos,
4200 underNetworkControl);
4208 QCoreApplication::postEvent(
4212 if (old_avail != availableStatus)
4215 else if ((message ==
"PLAY_PLAYLIST") && !
m_playListPlay.empty())
4229 const bool ignoreBookmark =
false;
4230 const bool ignoreProgStart =
true;
4231 const bool ignoreLastPlayPos =
true;
4232 const bool underNetworkControl =
false;
4234 Play(*pginfo,
true, ignoreBookmark, ignoreProgStart,
4235 ignoreLastPlayPos, underNetworkControl);
4237 else if ((message ==
"SET_PLAYBACK_URL") && (me->ExtraDataCount() == 2))
4239 uint recordingID = me->ExtraData(0).toUInt();
4242 info->SetPathname(me->ExtraData(1));
4244 else if ((message ==
"FOUND_ARTWORK") && (me->ExtraDataCount() >= 5))
4247 uint recordingID = me->ExtraData(3).toUInt();
4248 const QString& group = me->ExtraData(4);
4249 const QString& fn = me->ExtraData(5);
4263 else if (!group.isEmpty() &&
4273 else if (message ==
"EXIT_TO_MENU" ||
4274 message ==
"CANCEL_PLAYLIST")
4289 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4290 QString(
"Failed to remove %1, reloading list")
4299 groupname = sel_item->
GetData().toString();
4304 auto pit = (*git).begin();
4305 while (pit != (*git).end())
4307 if ((*pit)->GetRecordingID() == recordingID)
4309 if (!git.key().isEmpty() && git.key() == groupname)
4313 QVariant::fromValue(*pit));
4317 if (item_cur && (item_by_data == item_cur))
4327 pit = (*git).erase(pit);
4337 if (!groupname.isEmpty() && (git.key() == groupname))
4346 sel_item = next_item;
4349 groupname = sel_item->
GetData().toString();
4378 if (pginfo ==
nullptr)
4388 QCoreApplication::postEvent(
this,
new MythEvent(
"UPDATE_UI_LIST"));
4395 if (helpPopup->Create())
4405 if (viewPopup->Create())
4427 QStringList groupNames;
4428 QStringList displayNames;
4430 QStringList displayGroups;
4436 uint totalItems = 0;
4439 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Groups")));
4440 groupNames.append(
"");
4443 query.
prepare(
"SELECT recgroup, COUNT(title) FROM recorded "
4444 "WHERE deletepending = 0 AND watched <= :WATCHED "
4445 "GROUP BY recgroup");
4449 while (query.
next())
4451 QString dispGroup = query.
value(0).toString();
4455 (dispGroup !=
"Deleted"))
4456 totalItems += items;
4458 groupNames.append(dispGroup);
4460 dispGroup = (dispGroup ==
"Default") ? tr(
"Default") : dispGroup;
4461 dispGroup = (dispGroup ==
"Deleted") ? tr(
"Deleted") : dispGroup;
4462 dispGroup = (dispGroup ==
"LiveTV") ? tr(
"Live TV") : dispGroup;
4464 displayNames.append(tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup));
4471 displayNames.push_front(tr(
"%1 [%n item(s)]",
nullptr, totalItems)
4473 groupNames.push_front(
"All Programs");
4477 query.
prepare(
"SELECT DISTINCT category, COUNT(title) FROM recorded "
4478 "WHERE deletepending = 0 AND watched <= :WATCHED "
4479 "GROUP BY category");
4483 int unknownCount = 0;
4484 while (query.
next())
4487 QString dispGroup = query.
value(0).toString();
4488 if (dispGroup.isEmpty())
4490 unknownCount += items;
4491 dispGroup = tr(
"Unknown");
4493 else if (dispGroup == tr(
"Unknown"))
4495 unknownCount += items;
4499 (dispGroup != tr(
"Unknown")))
4501 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4502 groups += dispGroup;
4508 if (unknownCount > 0)
4510 QString dispGroup = tr(
"Unknown");
4511 uint items = unknownCount;
4512 displayGroups += tr(
"%1 [%n item(s)]",
nullptr, items).arg(dispGroup);
4513 groups += dispGroup;
4520 displayNames.append(QString(
"------- %1 -------").arg(tr(
"Categories")));
4521 groupNames.append(
"");
4523 displayGroups.sort();
4524 QStringList::iterator it;
4525 for (it = displayGroups.begin(); it != displayGroups.end(); ++it)
4526 displayNames.append(*it);
4527 for (it = groups.begin(); it != groups.end(); ++it)
4528 groupNames.append(*it);
4530 QString label = tr(
"Change Filter");
4535 if (recGroupPopup->Create())
4547 delete recGroupPopup;
4564 QString newRecGroup = recGroup;
4566 if (newRecGroup.isEmpty())
4573 newRecGroup =
"Default";
4575 newRecGroup =
"All Programs";
4577 newRecGroup =
"LiveTV";
4579 newRecGroup =
"Deleted";
4611 query.
prepare(
"SELECT recgroup, password FROM recgroups "
4612 "WHERE password IS NOT NULL AND password <> '';");
4616 while (query.
next())
4618 QString recgroup = query.
value(0).toString();
4621 recgroup =
"Default";
4623 recgroup =
"All Programs";
4625 recgroup =
"LiveTV";
4627 recgroup =
"Deleted";
4655 "SELECT g.recgroup, COUNT(r.title) FROM recgroups g "
4656 "LEFT JOIN recorded r ON g.recgroupid=r.recgroupid AND r.deletepending = 0 "
4657 "WHERE g.recgroupid != 2 AND g.recgroupid != 3 "
4658 "GROUP BY g.recgroupid ORDER BY g.recgroup");
4660 QStringList displayNames(tr(
"Add New"));
4661 QStringList groupNames(
"addnewgroup");
4666 while (query.
next())
4668 QString dispGroup = query.
value(0).toString();
4669 groupNames.push_back(dispGroup);
4671 if (dispGroup ==
"Default")
4672 dispGroup = tr(
"Default");
4673 else if (dispGroup ==
"LiveTV")
4674 dispGroup = tr(
"Live TV");
4675 else if (dispGroup ==
"Deleted")
4676 dispGroup = tr(
"Deleted");
4678 displayNames.push_back(tr(
"%1 [%n item(s)]",
"", query.
value(1).toInt())
4682 QString label = tr(
"Select Recording Group") +
4688 if (rgChanger->Create())
4718 QStringList groupNames(tr(
"Default"));
4719 QStringList displayNames(
"Default");
4722 for (
const auto& name : std::as_const(list))
4724 displayNames.push_back(name);
4725 groupNames.push_back(name);
4728 QString label = tr(
"Select Playback Group") +
4734 if (pgChanger->Create())
4748 QList<uint>::Iterator it;
4753 if (tmpItem !=
nullptr)
4765 QList<uint>::Iterator it;
4770 if (tmpItem !=
nullptr)
4788 if (editMetadata->Create())
4796 delete editMetadata;
4801 const QString &newSubtitle,
4802 const QString &newDescription,
4803 const QString &newInetref,
4819 if (groupname == pginfo->GetTitle().toLower() &&
4820 newTitle != pginfo->GetTitle())
4826 QString tempSubTitle = newTitle;
4827 if (!newSubtitle.trimmed().isEmpty())
4828 tempSubTitle = QString(
"%1 - \"%2\"")
4829 .arg(tempSubTitle, newSubtitle);
4835 if (newSeason > 0 || newEpisode > 0)
4839 seasone = QString(
"s%1e%2")
4842 seasonx = QString(
"%1x%2")
4847 item->
SetText(tempSubTitle,
"titlesubtitle");
4848 item->
SetText(newTitle,
"title");
4849 item->
SetText(newSubtitle,
"subtitle");
4850 item->
SetText(newInetref,
"inetref");
4851 item->
SetText(seasonx,
"00x00");
4852 item->
SetText(seasone,
"s00e00");
4853 item->
SetText(season,
"season");
4854 item->
SetText(episode,
"episode");
4855 if (newDescription !=
nullptr)
4856 item->
SetText(newDescription,
"description");
4859 pginfo->SaveInetRef(newInetref);
4860 pginfo->SaveSeasonEpisode(newSeason, newEpisode);
4869 newRecGroup = newRecGroup.simplified();
4871 if (newRecGroup.isEmpty())
4874 if (newRecGroup ==
"addnewgroup")
4880 tr(
"New Recording Group"));
4885 if (newgroup->Create())
4905 if ((
p->GetRecordingGroup() ==
"LiveTV") &&
4906 (newRecGroup !=
"LiveTV"))
4908 p->SaveAutoExpire(defaultAutoExpire);
4910 else if ((
p->GetRecordingGroup() !=
"LiveTV") &&
4911 (newRecGroup ==
"LiveTV"))
4929 if ((
p->GetRecordingGroup() ==
"LiveTV") && (newRecGroup !=
"LiveTV"))
4930 p->SaveAutoExpire(defaultAutoExpire);
4931 else if ((
p->GetRecordingGroup() !=
"LiveTV") && (newRecGroup ==
"LiveTV"))
4944 if (newPlayGroup.isEmpty() || !tmpItem)
4947 if (newPlayGroup == tr(
"Default"))
4948 newPlayGroup =
"Default";
4952 QList<uint>::Iterator it;
4985 if (pwChanger->Create())
5001 query.
prepare(
"UPDATE recgroups SET password = :PASSWD WHERE "
5002 "recgroup = :RECGROUP");
5004 query.
bindValue(
":PASSWD", newPassword);
5010 if (newPassword.isEmpty())
5029 LOG(VB_GENERAL, LOG_ERR,
LOC +
5030 "Theme is missing 'groups' button list.");
5037 for (
int i = 0; i <
m_list.size(); ++i)
5040 QVariant::fromValue(
m_data.at(i)));
5060 if (item->
GetData().toString().isEmpty())
5063 QString group = item->
GetData().toString();
5171 LOG(VB_GENERAL, LOG_ERR,
LOC +
5172 "Window 'passwordchanger' is missing required elements.");
5235 LOG(VB_GENERAL, LOG_ERR,
LOC +
5236 "Window 'editmetadata' is missing required elements.");
5277 QString newRecDescription =
nullptr;
5278 QString newRecInetref =
nullptr;
5279 uint newRecSeason = 0;
5280 uint newRecEpisode = 0;
5287 if (newRecTitle.isEmpty())
5290 emit
result(newRecTitle, newRecSubtitle, newRecDescription,
5291 newRecInetref, newRecSeason, newRecEpisode);
5301 "recording online..."),
5329 lookup->SetSubtype(
type);
5331 lookup->SetAllowGeneric(
true);
5332 lookup->SetHandleImages(
false);
5340 lookup->SetAutomatic(
false);
5389 Qt::QueuedConnection);
5391 if (resultsdialog->Create())
5404 if (!mfsr || !mfsr->m_result)
5422 QString title = tr(
"No match found for this recording. You can "
5423 "try entering a TVDB/TMDB number, season, and "
5424 "episode manually.");
5428 if (okPopup->Create())
5444 LOG(VB_GENERAL, LOG_ERR,
LOC +
5445 "Window 'iconhelp' is missing required elements.");
5451 addItem(
"watched", tr(
"Recording has been watched"));
5452 addItem(
"commflagged", tr(
"Commercials are flagged"));
5453 addItem(
"cutlist", tr(
"An editing cutlist is present"));
5454 addItem(
"autoexpire", tr(
"The program is able to auto-expire"));
5455 addItem(
"processing", tr(
"Commercials are being flagged"));
5456 addItem(
"bookmark", tr(
"A bookmark is set"));
5458 addItem(
"inuse", tr(
"Recording is in use"));
5459 addItem(
"transcoded", tr(
"Recording has been transcoded"));
5462 addItem(
"mono", tr(
"Recording is in Mono"));
5463 addItem(
"stereo", tr(
"Recording is in Stereo"));
5464 addItem(
"surround", tr(
"Recording is in Surround Sound"));
5465 addItem(
"dolby", tr(
"Recording is in Dolby Surround Sound"));
5467 addItem(
"cc", tr(
"Recording is Closed Captioned"));
5468 addItem(
"subtitles", tr(
"Recording has Subtitles Available"));
5469 addItem(
"onscreensub", tr(
"Recording is Subtitled"));
5471 addItem(
"SD", tr(
"Recording is in Standard Definition"));
5472 addItem(
"widescreen", tr(
"Recording is Widescreen"));
5473 addItem(
"hdtv", tr(
"Recording is in High Definition"));
5474 addItem(
"hd720", tr(
"Recording is in 720p High Definition"));
5475 addItem(
"hd1080i", tr(
"Recording is in 1080i High Definition"));
5476 addItem(
"hd1080p", tr(
"Recording is in 1080p High Definition"));
5477 addItem(
"uhd4Ki", tr(
"Recording is in 4k(interlaced) UHD resolution"));
5478 addItem(
"uhd4Kp", tr(
"Recording is in 4k UHD resolution"));
5479 addItem(
"mpeg2", tr(
"Recording is using MPEG-2 codec"));
5480 addItem(
"avchd", tr(
"Recording is using AVC/H.264 codec"));
5481 addItem(
"hevc", tr(
"Recording is using HEVC/H.265 codec"));
5490 item->DisplayState(state,
"icons");
5495 QDateTime now = QDateTime::currentDateTime();
5499 QMap<int, JobQueueEntry> jobs;
5502 for (
const auto& job : std::as_const(jobs))
5504 m_jobs.insert(qMakePair(job.chanid, job.recstartts), job);
5511 const QDateTime &recstartts)
5514 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5515 auto end = values.cend();
5516 for (
auto iter = values.cbegin(); iter != end; ++iter)
5518 if (iter->type == jobType)
5525 const QDateTime &recstartts)
5528 QList<JobQueueEntry> values = m_jobs.values(qMakePair(chanid, recstartts));
5529 auto end = values.cend();
5530 for (
auto iter = values.cbegin(); iter != end; ++iter)
5532 if (iter->type == jobType)
5539 const QDateTime &recstartts)
5541 return IsJobQueued(jobType, chanid, recstartts) ||
5542 IsJobRunning(jobType, chanid, recstartts);
void Add(const ProgramInfo &pginfo)
Adds a ProgramInfo to the cache.
void DeleteRecording(uint recordingID, bool forceDelete, bool forgetHistory)
void ApplyRecordPlayGroupChange(const QString &newplaygroup)
Sets the recording group, both in this RecordingInfo and in the database.
void toggleRecGroupView(bool setOn)
void updateIcons(const ProgramInfo *pginfo=nullptr)
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...
void LoadInBackground(const QString &message="")
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
void SetAvailableStatus(AvailableStatusType status, const QString &where)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythScreenStack * GetMainStack()
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
void doCreateTranscodingProfilesMenu()
void SetMaxLength(int length)
void DeleteForceAllRemaining(void)
static void * RunPlaybackBox(void *player, bool showTV)
void stopPlaylistFlagging()
bool IsSameProgram(const ProgramInfo *ProgInfo) const
void UpdateLastDelete(bool setTime) const
Set or unset the record.last_delete field.
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
#define ACTION_VIEWSCHEDULED
QString GetMasterHostName(void)
static const QRegularExpression kReSearchTypeName
virtual uint64_t GetFilesize(void) const
void UpdateUIGroupList(const QStringList &groupPreferences)
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
@ kCheckForPlaylistAction
void setPlayGroup(QString newPlayGroup)
static const Type kMythEventMessage
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Image widget, displays a single image or multiple images in sequence.
static int comp_season(const ProgramInfo *a, const ProgramInfo *b)
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
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 SaveBookmark(uint64_t frame)
Clears any existing bookmark in DB and if frame is greater than 0 sets a new bookmark.
void SetRecordingStatus(RecStatus::Type status)
QString GetHostname(void) const
void updateRecGroup(MythUIButtonListItem *sel_item)
~PlaybackBox(void) override
void ShowNotification(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
QString m_currentGroup
Group currently selected.
QString GetRecordingGroup() const
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())
std::array< MythUIImage *, kNumArtImages > m_artImage
virtual void ResetMap(const InfoMap &infoMap)
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
static int comp_recordDate(const ProgramInfo *a, const ProgramInfo *b)
uint64_t GetFreeSpaceTotalMB(void) const
void saveRecMetadata(const QString &newTitle, const QString &newSubtitle, const QString &newDescription, const QString &newInetref, uint season, uint episode)
void doPlaylistBeginUserJob2()
void SetRecGroupPassword(const QString &newPassword)
static bool ChangeJobCmds(int jobID, int newCmds)
void customEvent(QEvent *event) override
static int comp_programid(const ProgramInfo *a, const ProgramInfo *b)
static QString CreateProgramInfoString(const ProgramInfo &pginfo)
void doPlaylistBeginFlagging()
MythScreenStack * m_popupStack
void SetItemIcons(MythUIButtonListItem *item, ProgramInfo *pginfo)
MythUIImage * m_previewImage
#define ACTION_LISTRECORDEDEPISODES
@ kStartTVIgnoreLastPlayPos
Holds information on a TV Program one might wish to record.
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
virtual void ShowUpcomingScheduled(void) const
Show the upcoming recordings for this recording rule.
static int comp_originalAirDate(const ProgramInfo *a, const ProgramInfo *b)
void setRecGroup(QString newRecGroup)
void GetOrdered(std::vector< ProgramInfo * > &list, bool newest_first=false)
void ForgetHistory(void)
Forget the recording of a program so it will be recorded again.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
uint GetRecordingID(void) const
void stopPlaylistUserJob3()
QString getRecGroupPassword(const QString &recGroup)
bool Create(void) override
int m_listOrder
listOrder controls the ordering of the recordings in the list
static int comp_recordDate_rev(const ProgramInfo *a, const ProgramInfo *b)
void doBeginTranscoding()
void UpdateUIRecGroupList(void)
This class is used as a container for messages.
void showViewChanger(void)
bool Create(void) override
QStringList m_playerSelectedNewShow
#define ACTION_TOGGLERECORD
static constexpr std::chrono::milliseconds kInvalidateTimeMs
static void RemoveListener(QObject *listener)
Stop receiving notifications when a preview event is generated.
void ItemVisible(MythUIButtonListItem *item)
QVariant value(int i) const
void updateGroupInfo(const QString &groupname, const QString &grouplabel)
static bool comp_recordDate_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
MythUITextEdit * m_oldPasswordEdit
void doJobQueueJob(int jobType, int jobFlags=0)
MythDialogBox * m_menuDialog
static bool comp_originalAirDate_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
void SetCanTakeFocus(bool set=true)
Set whether this widget can take focus.
Internal representation of a recording rule, mirrors the record table.
void PlayFromLastPlayPos()
PlaybackBox(MythScreenStack *parent, const QString &name, TV *player=nullptr, bool showTV=false)
void SetEditing(bool editing)
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
static bool comp_season_less_than(const ProgramInfo *a, const ProgramInfo *b)
void toggleCategoryView(bool setOn)
A text entry and edit widget.
static int comp_programid_rev(const ProgramInfo *a, const ProgramInfo *b)
void ShowDeletePopup(DeletePopupType type)
void ScheduleUpdateUIList(void)
int m_watchListMaxAge
add 1 to the Watch List scord up to this many days
#define ACTION_PREVRECORDED
virtual void ShowGuide(void) const
Show the program guide.
void doPlaylistWatchedSetOn()
bool IsPathSet(void) const
bool m_playingSomething
playingSomething is set to true iff a full screen recording is playing
bool IsInUsePlaying(void) const
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void Closed(QString, int)
PlaybackBox * m_parentScreen
void DeleteForgetHistory(void)
Screen in which all other widgets are contained and rendered.
static bool comp_recordDate_less_than(const ProgramInfo *a, const ProgramInfo *b)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
bool IsJobRunning(int jobType, uint chanid, const QDateTime &recstartts)
static QString construct_sort_title(QString title, const QString &sortTitle, PlaybackBox::ViewMask viewmask, PlaybackBox::ViewTitleSort sortType, int recpriority)
QString GetText(void) const
bool IsUsageUIVisible(void) const
void doPlaylistExpireSetting(bool turnOn)
void Reset(void) override
Reset the image back to the default defined in the theme.
void passwordClosed(void)
bool m_needUpdate
Does the recording list need to be refilled.
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
void checkPassword(const QString &password)
void stopPlaylistUserJob2()
uint32_t GetProgramFlags(void) const
QString GetRecordingGroup(void) const
void ItemLoaded(MythUIButtonListItem *item)
bool IsLastPlaySet(void) const
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 doPlaylistBeginTranscoding()
void UndeleteRecording(uint recordingID)
virtual void ShowDetails(void) const
Show the Program Details screen.
PlaybackBoxHelper m_helper
Main helper thread.
void ShowMenu(void) override
const QString & Message() const
void RemoveProgram(uint recordingID, bool forgetHistory, bool forceMetadataDelete)
void stopPlaylistJobQueueJob(int jobType)
void stopPlaylistTranscoding()
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
void playSelectedPlaylist(bool Random)
bool IsWatched(void) const
static PlaybackBox::ViewMask m_viewMaskToggle(PlaybackBox::ViewMask mask, PlaybackBox::ViewMask toggle)
void showRecGroupPasswordChanger()
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
static void push_onto_del(QStringList &list, const ProgramInfo &pginfo)
MythUIType * GetFocusWidget(void) const
constexpr static int kNumArtImages
QHash< QString, QString > InfoMap
static const QString sLocation
bool IsPreserved(void) const
void addListener(QObject *listener)
Add a listener to the observable.
static QStringList GetNames(void)
bool Create(void) override
QString GetInetRef(void) const
void SetValue(int val) override
void doPlaylistBeginLookup()
QString m_watchGroupLabel
void SetText(const QString &text, bool moveCursor=true)
MythUIButtonList * m_groupList
virtual void ShowPrevious(void) const
Show the previous recordings for this recording rule.
void AcceptItem(MythUIButtonListItem *item)
static int GetJobsInQueue(QMap< int, JobQueueEntry > &jobs, int findJobs=JOB_LIST_NOT_DONE)
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
MythMenu * createPlaylistMenu()
void SetPathname(const QString &pn)
void OldPasswordChanged(void)
MythUIProgressBar * m_recordedProgress
QList< uint > m_playListPlay
list of items being played.
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
virtual void EditCustom(void)
Creates a dialog for creating a custom recording rule.
static bool IsJobQueuedOrRunning(int jobType, uint chanid, const QDateTime &recstartts)
RecStatus::Type GetRecordingStatus(void) const
void updateRecList(MythUIButtonListItem *sel_item)
void doPlaylistBeginUserJob3()
void stopPlaylistLookup()
static constexpr const char * ACTION_1
void toggleWatchedView(bool setOn)
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void ItemSelected(MythUIButtonListItem *item)
void doPlaylistAllowRerecord()
void groupSelectorClosed(void)
MythMenu * createTranscodingProfilesMenu()
void Set(int start, int total, int used)
bool IsJobQueued(int jobType, uint chanid, const QDateTime &recstartts)
QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability=true)
MythMenu * createPlayFromMenu()
bool SetFocusWidget(MythUIType *widget=nullptr)
void saveViewChanges(void)
Basic menu dialog, message and a list of options.
static bool comp_originalAirDate_less_than(const ProgramInfo *a, const ProgramInfo *b)
void processNetworkControlCommands(void)
static MythThemedMenu * menu
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
QString GetTitle(void) const
QString GetDescription(void) const
int GetIntValue(void) const override
bool Create(void) override
void DisplayPopupMenu(void)
static void DBError(const QString &where, const MSqlQuery &query)
void DeleteRecordings(const QStringList &list)
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
void BuildFocusList(void)
def rating(profile, smoonURL, gate)
void ShowRecGroupChangerUsePlaylist(void)
void HandleRecordingAddEvent(const ProgramInfo &evinfo)
bool HasCutlist(void) const
void ScheduleLoad(bool updateUI=true)
ProgramInfoCache::UpdateStates Update(const ProgramInfo &pginfo)
Updates a ProgramInfo in the cache.
bool IsJobQueuedOrRunning(int jobType, uint chanid, const QDateTime &recstartts)
void HandlePreviewEvent(const QStringList &list)
Updates the UI properties for a new preview file.
void toggleTitleView(bool setOn)
virtual void SetTextFromMap(const InfoMap &infoMap)
@ kDateShort
Default local time.
QString extract_commflag_state(const ProgramInfo &pginfo)
ProgramInfo * GetRecordingInfo(uint recordingID) const
static int comp_season_rev(const ProgramInfo *a, const ProgramInfo *b)
void deleteSelected(MythUIButtonListItem *item)
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
void fillRecGroupPasswordCache(void)
void Refresh(void)
Refreshed the cache.
void togglePreserveEpisode()
void run(const QString &name, Class *object, void(Class::*fn)())
static void AddListener(QObject *listener)
Request notifications when a preview event is generated.
void toggleSearchView(bool setOn)
MythMenu * createPlaylistStorageMenu()
@ kStartTVIgnoreProgStart
void SetPassword(bool isPassword)
static const std::array< const int, kMaxJobs > kJobs
void DeleteIgnoreAllRemaining(void)
static constexpr uint8_t kArtworkCoverTimeout
uint GetAudioProperties(void) const
void SetEnabled(bool enable)
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
MythUITextEdit * m_newPasswordEdit
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
QString GetPlaybackGroup(void) const
static int comp_originalAirDate_rev(const ProgramInfo *a, const ProgramInfo *b)
void setGroupFilter(const QString &newRecGroup)
static int comp_recpriority2(const ProgramInfo *a, const ProgramInfo *b)
void doPlaylistExpireSetOff()
virtual void SetFilesize(uint64_t sz)
int m_progsInDB
total number of recordings in DB
void PlaylistDelete(bool forgetHistory=false)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static bool extract_one_del(QStringList &list, uint &recordingID)
static QString extract_main_state(const ProgramInfo &pginfo, const TV *player)
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
void popupClosed(const QString &which, int result)
bool Create(void) override
QMap< QString, QString > m_recGroupPwCache
int GetNumSetting(const QString &key, int defaultval=0)
QStringList m_titleList
list of pages
static bool save_position(const MythUIButtonList *groupList, const MythUIButtonList *recordingList, QStringList &groupSelPref, QStringList &itemSelPref, QStringList &itemTopPref)
QDate GetOriginalAirDate(void) const
void SaveAutoExpire(AutoExpireType autoExpire, bool updateDelete=false)
Set "autoexpire" field in "recorded" table to "autoExpire".
void showMetadataEditor()
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
void selected(MythUIButtonListItem *item)
uint GetVideoProperties(void) const
class PlaybackBox::PbbJobQueue m_jobQueue
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
void WaitForLoadToComplete(void) const
MythMenu * createPlaylistJobMenu()
bool IsLoadInProgress(void) const
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
QString m_curGroupPassword
bool GetBoolSetting(const QString &key, bool defaultval=false)
static constexpr size_t kMaxJobs
void ShowActionPopup(const ProgramInfo &pginfo)
void UpdateUIListItem(ProgramInfo *pginfo, bool force_preview_reload)
std::array< QTimer *, kNumArtImages > m_artTimer
void toggleWatchListView(bool setOn)
AutoDeleteDeque< ProgramInfo * > ProgramList
void doPlaylistWatchedSetting(bool turnOn)
duration< CHRONO_TYPE, ratio< 86400 > > days
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
uint GetEpisode(void) const
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
void doPlaylistBeginUserJob1()
Holds information on recordings and videos.
bool LoadTemplate(const QString &title, const QString &category="Default", const QString &categoryType="Default")
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void stopPlaylistUserJob4()
void PlayX(const ProgramInfo &pginfo, bool ignoreBookmark, bool ignoreProgStart, bool ignoreLastPlayPos, bool underNetworkControl)
QSet< QString > m_previewTokens
Outstanding preview image requests.
void changeProfileAndTranscode(int id)
QList< uint > m_playList
list of selected items "play list"
Dialog asking for user confirmation. Ok and optional Cancel button.
void ToStringList(QStringList &list) const
Serializes ProgramInfo into a QStringList which can be passed over a socket.
ProgramInfo * GetCurrentProgram(void) const override
uint GetSeason(void) const
void SetCheckState(MythUIStateType::StateType state)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
static bool IsJobStatusRunning(int status)
void customEvent(QEvent *event) override
void doAllowRerecord()
Callback function when Allow Re-record is pressed in Watch Recordings.
void PlaylistDeleteForgetHistory(void)
int m_allOrder
allOrder controls the ordering of the "All Programs" list
QString GetCategoryTypeString(void) const
Returns catType as a string.
QString extract_job_state(const ProgramInfo &pginfo)
static QMap< QString, QString > iconMap
QString GetPlaybackURL(bool checkMaster=false, bool forceCheckLocal=false)
Returns filename or URL to be used to play back this recording.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
void doPlaylistWatchedSetOff()
void ShowRecGroupChangerNoPlaylist(void)
static bool comp_recpriority2_less_than(const ProgramInfo *a, const ProgramInfo *b)
void UpdateFileSize(uint recordingID, uint64_t filesize, UpdateStates flags)
Updates a ProgramInfo in the cache.
static std::array< PlaybackBoxCb, kMaxJobs *2 > kMySlots
QString m_artHostOverride
void processNetworkControlCommand(const QString &command)
void HandleUpdateItemEvent(uint recordingId, uint flags)
void togglePlayListTitle(void)
void SaveWatched(bool watchedFlag)
Set "watched" field in recorded/videometadata to "watchedFlag".
virtual void SetText(const QString &text)
void ShowGroupPopup(void)
void ApplyTranscoderProfileChangeById(int id)
virtual void SetVisible(bool visible)
QStringList m_delList
Recording[s] currently selected for deletion.
ProgramMap m_progLists
lists of programs by page
TVState
TVState is an enumeration of the states used by TV and TVRec.
bool IsAutoExpirable(void) const
void result(const QString &)
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
MythUIButton * m_okButton
static const Type kEventType
MythUIText * m_noRecordingsText
ProgramInfo * FindProgramInUILists(const ProgramInfo &pginfo)
MythMainWindow * GetMythMainWindow(void)
MythUIButtonList * m_recgroupList
bool Remove(uint recordingID)
Marks a ProgramInfo in the cache for deletion on the next call to Refresh().
void SetFlagging(bool flagging)
A widget for offering a range of numerical values where only the the bounding values and interval are...
void SelectNextRecGroup(void)
void doPlaylistBeginUserJob4()
void displayRecGroup(const QString &newRecGroup="")
MythMenu * createStorageMenu()
static bool comp_programid_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
static QString extract_subtitle(const ProgramInfo &pginfo, const QString &groupname)
MythUIProgressBar * m_watchedProgress
MythScreenStack * GetStack(const QString &Stackname)
void ShowPlayGroupChangerNoPlaylist(void)
static bool IsJobStatusQueued(int status)
void StopRecording(const ProgramInfo &pginfo)
void stopPlaylistUserJob1()
bool m_watchListAutoExpire
exclude recording not marked for auto-expire from the Watch List
MythMenu * createRecordingMenu()
ProgramInfoCache m_programInfoCache
bool Play(const ProgramInfo &rec, bool inPlaylist, bool ignoreBookmark, bool ignoreProgStart, bool ignoreLastPlayPos, bool underNetworkControl)
QString m_groupDisplayName
QString GetProgramID(void) const
bool QueryIsInUse(QStringList &byWho) const
Returns true if Program is in use.
MythMenu * createJobMenu()
static void restore_position(MythUIButtonList *groupList, MythUIButtonList *recordingList, const QStringList &groupSelPref, const QStringList &itemSelPref, const QStringList &itemTopPref)
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.
std::chrono::hours m_watchListBlackOut
adjust exclusion of a title from the Watch List after a delete
@ kDateTimeFull
Default local time.
static bool comp_season_rev_less_than(const ProgramInfo *a, const ProgramInfo *b)
int GetRecordingPriority2(void) const
QString LocateArtwork(const QString &inetref, uint season, VideoArtworkType type, const ProgramInfo *pginfo, const QString &groupname=nullptr)
Dialog prompting the user to enter a text string.
QMap< QString, QString > m_recGroupType
void SaveSetting(const QString &key, int newValue)
@ kTime
Default local time.
void toggleLiveTVView(bool setOn)
static constexpr uint8_t kArtworkBannerTimeout
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
static bool comp_programid_less_than(const ProgramInfo *a, const ProgramInfo *b)
bool m_alwaysShowWatchedProgress
void togglePlayListItem(void)
MythUIButtonList * m_recordingList
uint64_t GetFreeSpaceUsedMB(void) const
virtual int IncrRef(void)
Increments reference count.
uint GetSubtitleType(void) const
AvailableStatusType GetAvailableStatus(void) const
void ShowRecordedEpisodes()
void PlaylistDeleteKeepHistory(void)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void doPlaylistJobQueueJob(int jobType, int jobFlags=0)
void dispatch(const MythEvent &event)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
bool IsBookmarkSet(void) const
std::deque< QString > m_networkControlCommands
uint32_t MythRandom()
generate 32 random bits
void doPlaylistExpireSetOn()
static void ShowAvailabilityPopup(const ProgramInfo &pginfo)
bool m_watchListStart
use the Watch List as the initial view
static const std::array< const uint, 3 > s_artDelay
void CheckAvailability(const ProgramInfo &pginfo, CheckAvailabilityType cat=kCheckForCache)
void removeListener(QObject *listener)
Remove a listener to the observable.
void ShowRecGroupChanger(bool use_playlist=false)
Used to change the recording group of a program or playlist.
static constexpr uint16_t kArtworkFanTimeout
void ForceFreeSpaceUpdate(void)
This widget is used for grouping other widgets for display when a particular named state is called....
void SaveBoolSetting(const QString &key, bool newValue)
static const std::array< const std::string, 9 > disp_flags
friend class PlaybackBoxListItem
bool HasPathname(void) const
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)
void HandleRecordingRemoveEvent(uint recordingID)
bool DisplayState(const QString &name)
void ShowPlayGroupChangerUsePlaylist(void)
void SaveLastPlayPos(uint64_t frame)
TODO Move to RecordingInfo.
bool Create(void) override
QString GetSetting(const QString &key, const QString &defaultval="")
bool m_usingGroupSelector
@ kStartTVByNetworkCommand
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
void ShowPlayGroupChanger(bool use_playlist=false)
Used to change the play group of a program or playlist.
QString GetSubtitle(void) const
void toggleView(PlaybackBox::ViewMask itemMask, bool setOn)