本文整理汇总了C++中CPVRRecordingPtr::GetPlayCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRRecordingPtr::GetPlayCount方法的具体用法?C++ CPVRRecordingPtr::GetPlayCount怎么用?C++ CPVRRecordingPtr::GetPlayCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRRecordingPtr
的用法示例。
在下文中一共展示了CPVRRecordingPtr::GetPlayCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSubDirectories
void CPVRRecordings::GetSubDirectories(const CPVRRecordingsPath &recParentPath, CFileItemList *results)
{
// Only active recordings are fetched to provide sub directories.
// Not applicable for deleted view which is supposed to be flattened.
std::set<CFileItemPtr> unwatchedFolders;
bool bRadio = recParentPath.IsRadio();
for (const auto recording : m_recordings)
{
CPVRRecordingPtr current = recording.second;
if (current->IsDeleted())
continue;
if (current->IsRadio() != bRadio)
continue;
const std::string strCurrent(recParentPath.GetUnescapedSubDirectoryPath(current->m_strDirectory));
if (strCurrent.empty())
continue;
CPVRRecordingsPath recChildPath(recParentPath);
recChildPath.AppendSegment(strCurrent);
std::string strFilePath(recChildPath);
CFileItemPtr pFileItem;
if (m_database.IsOpen())
current->UpdateMetadata(m_database);
if (!results->Contains(strFilePath))
{
pFileItem.reset(new CFileItem(strCurrent, true));
pFileItem->SetPath(strFilePath);
pFileItem->SetLabel(strCurrent);
pFileItem->SetLabelPreformatted(true);
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
// Assume all folders are watched, we'll change the overlay later
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_WATCHED, false);
results->Add(pFileItem);
}
else
{
pFileItem = results->Get(strFilePath);
if (pFileItem->m_dateTime<current->RecordingTimeAsLocalTime())
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
}
if (current->GetPlayCount() == 0)
unwatchedFolders.insert(pFileItem);
}
// Change the watched overlay to unwatched for folders containing unwatched entries
for (auto item : unwatchedFolders)
item->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, false);
}
示例2: ChangeRecordingsPlayCount
bool CPVRRecordings::ChangeRecordingsPlayCount(const CFileItemPtr &item, int count)
{
bool bResult = false;
if (m_database.IsOpen())
{
bResult = true;
CLog::Log(LOGDEBUG, "CPVRRecordings - %s - item path %s", __FUNCTION__, item->GetPath().c_str());
CFileItemList items;
if (item->m_bIsFolder)
{
XFILE::CDirectory::GetDirectory(item->GetPath(), items);
}
else
items.Add(item);
CLog::Log(LOGDEBUG, "CPVRRecordings - %s - will set watched for %d items", __FUNCTION__, items.Size());
for (int i=0;i<items.Size();++i)
{
CLog::Log(LOGDEBUG, "CPVRRecordings - %s - setting watched for item %d", __FUNCTION__, i);
CFileItemPtr pItem=items[i];
if (pItem->m_bIsFolder)
{
CLog::Log(LOGDEBUG, "CPVRRecordings - %s - path %s is a folder, will call recursively", __FUNCTION__, pItem->GetPath().c_str());
if (pItem->GetLabel() != "..")
{
ChangeRecordingsPlayCount(pItem, count);
}
continue;
}
if (!pItem->HasPVRRecordingInfoTag())
continue;
const CPVRRecordingPtr recording = pItem->GetPVRRecordingInfoTag();
if (recording)
{
if (count == INCREMENT_PLAY_COUNT)
recording->IncrementPlayCount();
else
recording->SetPlayCount(count);
// Clear resume bookmark
if (recording->GetPlayCount() > 0)
{
m_database.ClearBookMarksOfFile(pItem->GetPath(), CBookmark::RESUME);
recording->SetResumePoint(CBookmark());
}
if (count == INCREMENT_PLAY_COUNT)
m_database.IncrementPlayCount(*pItem);
else
m_database.SetPlayCount(*pItem, count);
}
}
CServiceBroker::GetPVRManager().PublishEvent(RecordingsInvalidated);
}
return bResult;
}