当前位置: 首页>>代码示例>>C++>>正文


C++ CPVRRecording::GetLastPlayedPosition方法代码示例

本文整理汇总了C++中CPVRRecording::GetLastPlayedPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRRecording::GetLastPlayedPosition方法的具体用法?C++ CPVRRecording::GetLastPlayedPosition怎么用?C++ CPVRRecording::GetLastPlayedPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPVRRecording的用法示例。


在下文中一共展示了CPVRRecording::GetLastPlayedPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;

    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->SetThumbnailImage(current->m_strThumbnailPath);

    if (!current->m_strFanartPath.IsEmpty())
      pFileItem->SetProperty("Fanart_Image", current->m_strFanartPath);

    // Set the play count either directly from client (if supported) or from video db
    if (g_PVRClients->SupportsRecordingPlayCount(pFileItem->GetPVRRecordingInfoTag()->m_iClientId))
    {
      pFileItem->GetPVRRecordingInfoTag()->m_playCount=pFileItem->GetPVRRecordingInfoTag()->m_iRecPlayCount;
    }
    else
    {
      CVideoDatabase db;
      if (db.Open())
      pFileItem->GetPVRRecordingInfoTag()->m_playCount=db.GetPlayCount(*pFileItem);
    }
    pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pFileItem->GetPVRRecordingInfoTag()->m_playCount > 0);

    // Set the resumePoint either directly from client (if supported) or from video db
    int positionInSeconds = current->GetLastPlayedPosition();
    if (positionInSeconds > 0)
    {
      // If the back-end does report a saved position then make sure there is a corresponding resume bookmark
      CBookmark bookmark;
      bookmark.timeInSeconds = positionInSeconds;
      bookmark.totalTimeInSeconds = (double)current->GetDuration();
      pFileItem->GetPVRRecordingInfoTag()->m_resumePoint = bookmark;
    }
    else if (positionInSeconds < 0)
    {
      CVideoDatabase db;
      if (db.Open())
      {
        CBookmark bookmark;
        if (db.GetResumeBookMark(current->m_strFileNameAndPath, bookmark))
          pFileItem->GetPVRRecordingInfoTag()->m_resumePoint = bookmark;
        db.Close();
      }
    }

    results->Add(pFileItem);
  }
}
开发者ID:A600,项目名称:xbmc,代码行数:61,代码来源:PVRRecordings.cpp


注:本文中的CPVRRecording::GetLastPlayedPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。