本文整理汇总了C++中CFileItemList::GetFileCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::GetFileCount方法的具体用法?C++ CFileItemList::GetFileCount怎么用?C++ CFileItemList::GetFileCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::GetFileCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFilteredItems
bool CGUIWindowPVRRecordings::GetFilteredItems(const std::string &filter, CFileItemList &items)
{
bool listchanged = CGUIWindowPVRBase::GetFilteredItems(filter, items);
int watchMode = CMediaSettings::GetInstance().GetWatchedMode("recordings");
CFileItemPtr item;
for (int i = 0; i < items.Size(); i++)
{
item = items.Get(i);
if (item->IsParentFolder()) // Don't delete the go to parent folder
continue;
if (!item->HasPVRRecordingInfoTag())
continue;
int iPlayCount = item->GetPVRRecordingInfoTag()->GetPlayCount();
if ((watchMode == WatchedModeWatched && iPlayCount == 0) ||
(watchMode == WatchedModeUnwatched && iPlayCount > 0))
{
items.Remove(i);
i--;
listchanged = true;
}
}
// Remove the parent folder item, if it's the only item in the folder.
if (items.GetObjectCount() == 0 && items.GetFileCount() > 0 && items.Get(0)->IsParentFolder())
items.Remove(0);
return listchanged;
}
示例2: ByFolderThumbPercentage
// returns true if:
// 1. Have more than 75% folders and
// 2. Have more than percent folders with thumbs
bool CAutoSwitch::ByFolderThumbPercentage(bool hideParentDirItems, int percent, const CFileItemList &vecItems)
{
int numItems = vecItems.Size();
if (!hideParentDirItems)
numItems--;
if (numItems <= 0) return false;
int fileCount = vecItems.GetFileCount();
if (fileCount > 0.25f * numItems) return false;
int numThumbs = 0;
for (int i = 0; i < vecItems.Size(); i++)
{
const CFileItemPtr item = vecItems[i];
if (item->m_bIsFolder && item->HasArt("thumb"))
{
numThumbs++;
if (numThumbs >= 0.01f * percent * (numItems - fileCount))
return true;
}
}
return false;
}
示例3: ApplyWatchedFilter
bool CGUIWindowVideoNav::ApplyWatchedFilter(CFileItemList &items)
{
bool listchanged = false;
CVideoDatabaseDirectory dir;
NODE_TYPE node = dir.GetDirectoryChildType(items.GetPath());
// now filter watched items as necessary
bool filterWatched=false;
if (node == NODE_TYPE_EPISODES
|| node == NODE_TYPE_SEASONS
|| node == NODE_TYPE_SETS
|| node == NODE_TYPE_TAGS
|| 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.IsVideoDb())
filterWatched = true;
if (items.GetContent() == "tvshows" &&
(items.IsSmartPlayList() || items.IsLibraryFolder()))
node = NODE_TYPE_TITLE_TVSHOWS; // so that the check below works
int watchMode = CMediaSettings::GetInstance().GetWatchedMode(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 == WatchedModeUnwatched)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("unwatchedepisodes").asInteger();
if (watchMode == WatchedModeWatched)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("watchedepisodes").asInteger();
if (watchMode == WatchedModeAll)
item->GetVideoInfoTag()->m_iEpisode = (int)item->GetProperty("totalepisodes").asInteger();
item->SetProperty("numepisodes", item->GetVideoInfoTag()->m_iEpisode);
listchanged = true;
}
if (filterWatched)
{
if(!item->IsParentFolder() && // Don't delete the go to parent folder
((watchMode == WatchedModeWatched && item->GetVideoInfoTag()->GetPlayCount() == 0) ||
(watchMode == WatchedModeUnwatched && item->GetVideoInfoTag()->GetPlayCount() > 0)))
{
items.Remove(i);
i--;
listchanged = true;
}
}
}
// Remove the parent folder icon, if it's the only thing in the folder. This is needed for hiding seasons.
if (items.GetObjectCount() == 0 && items.GetFileCount() > 0 && items.Get(0)->IsParentFolder())
items.Remove(0);
if(node == NODE_TYPE_TITLE_TVSHOWS || node == NODE_TYPE_SEASONS)
{
// the watched filter may change the "numepisodes" property which is reflected in the TV_SHOWS and SEASONS nodes
// therefore, the items labels have to be refreshed, and possibly the list needs resorting as well.
items.ClearSortState(); // this is needed to force resorting even if sort method did not change
FormatAndSort(items);
}
return listchanged;
}
示例4: ByFileCount
/// \brief Auto Switch method based on whether there is more than 25% files.
/// \param iPercent Percent of non-default thumbs to autoswitch on
bool CAutoSwitch::ByFileCount(const CFileItemList& vecItems)
{
if (vecItems.Size() == 0) return false;
float fPercent = (float)vecItems.GetFileCount() / vecItems.Size();
return (fPercent > 0.25);
}