本文整理汇总了C++中CPVRRecording::UpdateMetadata方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRRecording::UpdateMetadata方法的具体用法?C++ CPVRRecording::UpdateMetadata怎么用?C++ CPVRRecording::UpdateMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRRecording
的用法示例。
在下文中一共展示了CPVRRecording::UpdateMetadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetContents
void CPVRRecordings::GetContents(const CStdString &strDirectory, CFileItemList *results)
{
for (unsigned int iRecordingPtr = 0; iRecordingPtr < m_recordings.size(); iRecordingPtr++)
{
CPVRRecording *current = m_recordings.at(iRecordingPtr);
bool directMember = !HasAllRecordingsPathExtension(strDirectory);
if (!IsDirectoryMember(RemoveAllRecordingsPathExtension(strDirectory), current->m_strDirectory, directMember))
continue;
current->UpdateMetadata();
CFileItemPtr pFileItem(new CFileItem(*current));
pFileItem->SetLabel2(current->RecordingTimeAsLocalTime().GetAsLocalizedDateTime(true, false));
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
pFileItem->SetPath(current->m_strFileNameAndPath);
if (!current->m_strIconPath.IsEmpty())
pFileItem->SetIconImage(current->m_strIconPath);
if (!current->m_strThumbnailPath.IsEmpty())
pFileItem->SetArt("thumb", current->m_strThumbnailPath);
if (!current->m_strFanartPath.IsEmpty())
pFileItem->SetArt("fanart", current->m_strFanartPath);
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pFileItem->GetPVRRecordingInfoTag()->m_playCount > 0);
results->Add(pFileItem);
}
}
示例2: GetAll
void CPVRRecordings::GetAll(CFileItemList &items)
{
CSingleLock lock(m_critSection);
for (unsigned int iRecordingPtr = 0; iRecordingPtr < m_recordings.size(); iRecordingPtr++)
{
CPVRRecording *current = m_recordings.at(iRecordingPtr);
current->UpdateMetadata();
CFileItemPtr pFileItem(new CFileItem(*current));
pFileItem->SetLabel2(current->RecordingTimeAsLocalTime().GetAsLocalizedDateTime(true, false));
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
pFileItem->SetPath(current->m_strFileNameAndPath);
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pFileItem->GetPVRRecordingInfoTag()->m_playCount > 0);
items.Add(pFileItem);
}
}
示例3: GetSubDirectories
void CPVRRecordings::GetSubDirectories(const CStdString &strBase, CFileItemList *results)
{
CStdString strUseBase = TrimSlashes(strBase);
std::set<CStdString> unwatchedFolders;
for (unsigned int iRecordingPtr = 0; iRecordingPtr < m_recordings.size(); iRecordingPtr++)
{
CPVRRecording *current = m_recordings.at(iRecordingPtr);
const CStdString strCurrent = GetDirectoryFromPath(current->m_strDirectory, strUseBase);
if (strCurrent.empty())
continue;
CStdString strFilePath;
if(strUseBase.empty())
strFilePath = StringUtils::Format("pvr://recordings/%s/", strCurrent.c_str());
else
strFilePath = StringUtils::Format("pvr://recordings/%s/%s/", strUseBase.c_str(), strCurrent.c_str());
if (!results->Contains(strFilePath))
{
current->UpdateMetadata();
CFileItemPtr pFileItem;
pFileItem.reset(new CFileItem(strCurrent, true));
pFileItem->SetPath(strFilePath);
pFileItem->SetLabel(strCurrent);
pFileItem->SetLabelPreformated(true);
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
// Initialize folder overlay from play count (either directly from client or from video database)
if (current->m_playCount > 0)
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_WATCHED, false);
else
unwatchedFolders.insert(strFilePath);
results->Add(pFileItem);
}
else
{
CFileItemPtr pFileItem;
pFileItem=results->Get(strFilePath);
if (pFileItem->m_dateTime<current->RecordingTimeAsLocalTime())
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
// Unset folder overlay if recording is unwatched
if (unwatchedFolders.find(strFilePath) == unwatchedFolders.end())
{
if (current->m_playCount == 0)
{
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, false);
unwatchedFolders.insert(strFilePath);
}
}
}
}
int subDirectories = results->Size();
CFileItemList files;
GetContents(strBase, &files);
if (results->Size() == 1 && files.Size() == 0)
{
CStdString strGetPath = StringUtils::Format("%s/%s/", strUseBase.c_str(), results->Get(0)->GetLabel().c_str());
results->Clear();
CLog::Log(LOGDEBUG, "CPVRRecordings - %s - '%s' only has 1 subdirectory, selecting that directory ('%s')",
__FUNCTION__, strUseBase.c_str(), strGetPath.c_str());
GetSubDirectories(strGetPath, results);
return;
}
results->Append(files);
// Add 'All Recordings' item (if we have at least one subdirectory in the list)
if (subDirectories > 0)
{
CStdString strLabel(g_localizeStrings.Get(19270)); // "* All recordings"
CFileItemPtr pItem(new CFileItem(strLabel));
CStdString strAllPath;
if(strUseBase.empty())
strAllPath = "pvr://recordings";
else
strAllPath = StringUtils::Format("pvr://recordings/%s", strUseBase.c_str());
pItem->SetPath(AddAllRecordingsPathExtension(strAllPath));
pItem->SetSpecialSort(SortSpecialOnTop);
pItem->SetLabelPreformated(true);
pItem->m_bIsFolder = true;
pItem->m_bIsShareOrDrive = false;
for(int i=0; i<results->Size(); ++i)
{
if(pItem->m_dateTime < results->Get(i)->m_dateTime)
pItem->m_dateTime = results->Get(i)->m_dateTime;
}
results->AddFront(pItem, 0);
}
}