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


C++ CFileItemPtr::GetPropertyInt方法代码示例

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


在下文中一共展示了CFileItemPtr::GetPropertyInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnPrepareFileItems

void CGUIWindowVideoNav::OnPrepareFileItems(CFileItemList &items)
{
  CGUIWindowVideoBase::OnPrepareFileItems(items);

  // set fanart
  CQueryParams params;
  CVideoDatabaseDirectory dir;
  dir.GetQueryParams(items.m_strPath,params);
  if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
    CGUIWindowMusicNav::SetupFanart(items);

  NODE_TYPE node = dir.GetDirectoryChildType(items.m_strPath);

  // now filter as necessary
  bool filterWatched=false;
  if (node == NODE_TYPE_EPISODES
  ||  node == NODE_TYPE_SEASONS
  ||  node == NODE_TYPE_TITLE_MOVIES
  ||  node == NODE_TYPE_TITLE_TVSHOWS
  ||  node == NODE_TYPE_TITLE_MUSICVIDEOS
  ||  node == NODE_TYPE_RECENTLY_ADDED_EPISODES
  ||  node == NODE_TYPE_RECENTLY_ADDED_MOVIES
  ||  node == NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS)
    filterWatched = true;
  if (items.IsPlugin())
    filterWatched = true;
  if (items.IsSmartPlayList())
  {
    if (items.GetContent() == "tvshows")
      node = NODE_TYPE_TITLE_TVSHOWS; // so that the check below works
    filterWatched = true;
  }

  int watchMode = g_settings.GetWatchMode(m_vecItems->GetContent());

  for (int i = 0; i < items.Size(); i++)
  {
    CFileItemPtr item = items.Get(i);
    if(item->HasVideoInfoTag() && (node == NODE_TYPE_TITLE_TVSHOWS || node == NODE_TYPE_SEASONS))
    {
      if (watchMode == VIDEO_SHOW_UNWATCHED)
        item->GetVideoInfoTag()->m_iEpisode = item->GetPropertyInt("unwatchedepisodes");
      if (watchMode == VIDEO_SHOW_WATCHED)
        item->GetVideoInfoTag()->m_iEpisode = item->GetPropertyInt("watchedepisodes");
      item->SetProperty("numepisodes", item->GetVideoInfoTag()->m_iEpisode);
    }

    if(filterWatched)
    {
      if((watchMode==VIDEO_SHOW_WATCHED   && item->GetVideoInfoTag()->m_playCount== 0)
      || (watchMode==VIDEO_SHOW_UNWATCHED && item->GetVideoInfoTag()->m_playCount > 0))
      {
        items.Remove(i);
        i--;
      }
    }
  }
}
开发者ID:Bobbin007,项目名称:xbmc,代码行数:58,代码来源:GUIWindowVideoNav.cpp

示例2: FillDetails

void CFileItemHandler::FillDetails(ISerializable* info, CFileItemPtr item, const Value& fields, Value &result)
{
  if (info == NULL || fields.size() == 0)
    return;

  CVariant data;
  info->Serialize(data);

  Value serialization;
  data.toJsonValue(serialization);

  for (unsigned int i = 0; i < fields.size(); i++)
  {
    CStdString field = fields[i].asString();

    if (item)
    {
      if (item->IsAlbum() && item->HasProperty("album_" + field))
      {
        if (field == "rating")
          result[field] = item->GetPropertyInt("album_rating");
        else if (field == "label")
          result["album_label"] = item->GetProperty("album_label");
        else
          result[field] = item->GetProperty("album_" + field);

        continue;
      }

      if (item->HasProperty("artist_" + field))
      {
        result[field] = item->GetProperty("artist_" + field);
        continue;
      }

      if (field == "fanart")
      {
        CStdString cachedFanArt = item->GetCachedFanart();
        if (!cachedFanArt.IsEmpty())
        {
          result["fanart"] = cachedFanArt.c_str();
        }

        continue;
      }
    }

    if (serialization.isMember(field) && !result.isMember(field))
      result[field] = serialization[field];
  }
}
开发者ID:SilkyPantsDan,项目名称:xbmc,代码行数:51,代码来源:FileItemHandler.cpp

示例3: HandleQualityList

bool CGUIDialogBoxeeCtx::HandleQualityList()
{
  const CFileItemList* linksFileItemList = m_item.GetLinksList();

  if (!linksFileItemList)
  {
    return true;
  }

  if (linksFileItemList->Size() == 1)
  {
    return true;
  }

  int FocusedItem = 0;
  m_pDlgVideoQuality = (CGUIDialogBoxeeVideoQuality*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_VIDEO_QUALITY);
  m_pDlgVideoQuality->Reset();
  for (int i=0; i<linksFileItemList->Size(); i++)
  {
    CFileItemPtr linkFileItemToAdd = linksFileItemList->Get(i);
    m_pDlgVideoQuality->Add((*linkFileItemToAdd));
    // if the user ask for a different quality - switch to a different link
    if (m_item.GetPropertyInt("quality") ==linkFileItemToAdd->GetPropertyInt("quality"))
    {
      FocusedItem = i;
    }
  }

  m_pDlgVideoQuality->ChangeDialogType(LIST_CVQ_DIALOG);
  m_pDlgVideoQuality->SetFocusedItem(FocusedItem);
  m_pDlgVideoQuality->DoModal();

  if (m_pDlgVideoQuality->IsCanceled())
  {
    return false;
  }
  int chosenItemPos = m_pDlgVideoQuality->GetSelectedItemPos();
  CFileItemPtr chosenItem = linksFileItemList->Get(chosenItemPos);

  if(m_pDlgVideoQuality->GetSavePerference())
  {
    BOXEE::Boxee::GetInstance().GetMetadataEngine().UpdateProviderPerf(chosenItem->GetProperty("link-provider"),chosenItem->GetPropertyInt("quality"));
  }

  // if the user ask for a different quality - switch to a different link
  if (m_item.GetPropertyInt("quality") !=chosenItem->GetPropertyInt("quality"))
  {
    CLog::Log(LOGDEBUG,"CGUIDialogBoxeeCtx::HandleQualityList change quality to  %d", chosenItem->GetPropertyInt("quality"));

    if (chosenItem.get() == NULL)
    {
      CLog::Log(LOGERROR,"CGUIDialogBoxeeMediaAction::OnPlayMedia choose NULL item");
      return false;
    }

    // copy the relevant properties from the chosen item
    m_item.m_strPath =  chosenItem->m_strPath;
    m_item.SetProperty("link-boxeetype", chosenItem->GetProperty("link-boxeetype"));
    m_item.SetProperty("link-provider", chosenItem->GetProperty("link-provider"));
    m_item.SetProperty("link-providername", chosenItem->GetProperty("link-providername"));
    m_item.SetProperty("link-providerthumb", chosenItem->GetProperty("link-providerthumb"));
    m_item.SetProperty("link-countrycodes", chosenItem->GetProperty("link-countrycodes"));
    m_item.SetProperty("link-countryrel", chosenItem->GetPropertyBOOL("link-countryrel"));
    m_item.SetProperty("quality-lbl", chosenItem->GetProperty("quality-lbl"));
    m_item.SetProperty("quality", chosenItem->GetPropertyInt("quality"));

    OnPlay();
  }

  return true;
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:71,代码来源:GUIDialogBoxeeCtx.cpp


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