本文整理汇总了C++中CPVRRecordingPtr::GetLastPlayedPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRRecordingPtr::GetLastPlayedPosition方法的具体用法?C++ CPVRRecordingPtr::GetLastPlayedPosition怎么用?C++ CPVRRecordingPtr::GetLastPlayedPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRRecordingPtr
的用法示例。
在下文中一共展示了CPVRRecordingPtr::GetLastPlayedPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetResumeLabel
std::string CPVRGUIActions::GetResumeLabel(const CFileItem &item) const
{
std::string resumeString;
const CPVRRecordingPtr recording(CPVRItem(CFileItemPtr(new CFileItem(item))).GetRecording());
if (recording && !recording->IsDeleted())
{
// First try to find the resume position on the back-end, if that fails use video database
int positionInSeconds = recording->GetLastPlayedPosition();
// If the back-end does report a saved position it will be picked up by FileItem
if (positionInSeconds < 0)
{
CVideoDatabase db;
if (db.Open())
{
CBookmark bookmark;
std::string itemPath(recording->m_strFileNameAndPath);
if (db.GetResumeBookMark(itemPath, bookmark) )
positionInSeconds = lrint(bookmark.timeInSeconds);
db.Close();
}
}
// Suppress resume from 0
if (positionInSeconds > 0)
resumeString = StringUtils::Format(g_localizeStrings.Get(12022).c_str(),
StringUtils::SecondsToTimeString(positionInSeconds, TIME_FORMAT_HH_MM_SS).c_str());
}
return resumeString;
}