本文整理汇总了C++中VECFILEITEMS类的典型用法代码示例。如果您正苦于以下问题:C++ VECFILEITEMS类的具体用法?C++ VECFILEITEMS怎么用?C++ VECFILEITEMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VECFILEITEMS类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: atoi
bool CGUIWindowPVRBase::ActionInputChannelNumber(int input)
{
std::string strInput = StringUtils::Format("%i", input);
if (CGUIDialogNumeric::ShowAndGetNumber(strInput, g_localizeStrings.Get(19103)))
{
int iChannelNumber = atoi(strInput.c_str());
if (iChannelNumber >= 0)
{
int itemIndex = 0;
VECFILEITEMS items = m_vecItems->GetList();
for (VECFILEITEMS::iterator it = items.begin(); it != items.end(); ++it)
{
if(((*it)->HasPVRChannelInfoTag() && (*it)->GetPVRChannelInfoTag()->ChannelNumber() == iChannelNumber) ||
((*it)->HasEPGInfoTag() && (*it)->GetEPGInfoTag()->HasPVRChannel() && (*it)->GetEPGInfoTag()->PVRChannelNumber() == iChannelNumber))
{
// different handling for guide grid
if ((GetID() == WINDOW_TV_GUIDE || GetID() == WINDOW_RADIO_GUIDE) &&
m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE)
{
CGUIEPGGridContainer* epgGridContainer = (CGUIEPGGridContainer*) GetControl(m_viewControl.GetCurrentControl());
epgGridContainer->SetChannel((*(*it)->GetEPGInfoTag()->ChannelTag()));
}
else
m_viewControl.SetSelectedItem(itemIndex);
return true;
}
itemIndex++;
}
}
}
return false;
}
开发者ID:BenxiangGe,项目名称:boxeebox-xbmc,代码行数:33,代码来源:GUIWindowPVRBase.cpp
示例2: SetInvalid
void CGUIWindowPVRBase::SetInvalid()
{
VECFILEITEMS items = m_vecItems->GetList();
for (VECFILEITEMS::iterator it = items.begin(); it != items.end(); ++it)
(*it)->SetInvalid();
CGUIMediaWindow::SetInvalid();
}
开发者ID:sandersch,项目名称:xbmc,代码行数:7,代码来源:GUIWindowPVRBase.cpp
示例3: OnPrepareFileItems
void CGUIWindowPVRRecordings::OnPrepareFileItems(CFileItemList& items)
{
if (items.IsEmpty())
return;
CFileItemList files;
VECFILEITEMS vecItems = items.GetList();
for (VECFILEITEMS::const_iterator it = vecItems.begin(); it != vecItems.end(); ++it)
{
if (!(*it)->m_bIsFolder)
files.Add((*it));
}
if (!files.IsEmpty())
{
if (m_database.Open())
{
CGUIWindowVideoNav::LoadVideoInfo(files, m_database, false);
m_database.Close();
}
m_thumbLoader.Load(files);
}
CGUIWindowPVRBase::OnPrepareFileItems(items);
}
开发者ID:Almarefa,项目名称:xbmc,代码行数:25,代码来源:GUIWindowPVRRecordings.cpp
示例4: SetInvalid
void CGUIWindowPVRBase::SetInvalid()
{
if (m_refreshTimeout.IsTimePast())
{
VECFILEITEMS items = m_vecItems->GetList();
for (VECFILEITEMS::iterator it = items.begin(); it != items.end(); ++it)
(*it)->SetInvalid();
CGUIMediaWindow::SetInvalid();
m_refreshTimeout.Set(MAX_INVALIDATION_FREQUENCY);
}
}
开发者ID:MrMC,项目名称:mrmc,代码行数:11,代码来源:GUIWindowPVRBase.cpp
示例5: SetInvalid
void CGUIDialogPVRChannelsOSD::SetInvalid()
{
if (m_refreshTimeout.IsTimePast())
{
VECFILEITEMS items = m_vecItems->GetList();
for (VECFILEITEMS::iterator it = items.begin(); it != items.end(); ++it)
(*it)->SetInvalid();
CGUIDialog::SetInvalid();
m_refreshTimeout.Set(MAX_INVALIDATION_FREQUENCY);
}
}
开发者ID:ace20022,项目名称:kodi-cmake,代码行数:11,代码来源:GUIDialogPVRChannelsOSD.cpp
示例6: DeleteDirectory
bool CPVRRecordings::DeleteDirectory(const CFileItem& directory)
{
CFileItemList items;
XFILE::CDirectory::GetDirectory(directory.GetPath(), items);
bool allDeleted = true;
VECFILEITEMS itemList = items.GetList();
CFileItem item;
for (VECFILEITEMS::const_iterator it = itemList.begin(); it != itemList.end(); ++it)
allDeleted &= Delete(*(it->get()));
return allDeleted;
}
开发者ID:69thelememt,项目名称:xbmc,代码行数:15,代码来源:PVRRecordings.cpp
示例7: assert
// this functions can check for:
// * presence of directory on remove share (smb://server/share/dir)
// * presence of remote share on server (smb://server/share)
// * presence of smb server in network (smb://server)
bool CWin32SMBDirectory::RealExists(const CURL& url, bool tryToConnect)
{
assert(url.GetProtocol() == "smb");
if (url.GetHostName().empty())
return true; // 'root' of network is always exist
// TODO: use real caseless string comparison everywhere in this function
if (url.GetShareName().empty() || url.GetShareName() == url.GetFileName())
{
if (!url.GetShareName().empty())
{
std::wstring serverNameW;
std::wstring shareNameW;
SHARE_INFO_1* info = NULL;
// try fast way
if (g_charsetConverter.utf8ToW("\\\\" + url.GetHostName(), serverNameW, false, false, true) &&
g_charsetConverter.utf8ToW(url.GetShareName(), shareNameW, false, false, true) &&
NetShareGetInfo((LPWSTR)serverNameW.c_str(), (LPWSTR)shareNameW.c_str(), 1, (LPBYTE*)&info) == NERR_Success)
{
const bool ret = ((info->shi1_type & STYPE_MASK) == STYPE_DISKTREE);
NetApiBufferFree(info);
return ret;
}
// fallback to slow check
}
CFileItemList entries;
CURL baseUrl(url);
if (url.GetShareName().empty())
baseUrl.SetHostName(""); // scan network for servers
else
{
baseUrl.Reset(); // hack to reset ShareName
baseUrl.SetProtocol("smb");
baseUrl.SetHostName(url.GetHostName()); // scan server for shares
}
if (!GetNetworkResources(baseUrl, entries))
{
if (tryToConnect && !url.GetShareName().empty())
{
CURL authUrl(url);
if (ConnectAndAuthenticate(authUrl))
return RealExists(authUrl, false);
}
return false;
}
const std::string& searchStr = (url.GetShareName().empty()) ? url.GetHostName() : url.GetShareName();
const VECFILEITEMS entrVec = entries.GetList();
for (VECFILEITEMS::const_iterator it = entrVec.begin(); it != entrVec.end(); ++it)
{
if ((*it)->GetLabel() == searchStr)
return true;
}
return false;
}
// use standard win32 file API
std::wstring nameW(prepareWin32SMBDirectoryName(url));
if (nameW.empty())
return false;
DWORD fileAttrs = GetFileAttributesW(nameW.c_str());
if (fileAttrs != INVALID_FILE_ATTRIBUTES)
return (fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0; // is file or directory?
if (tryToConnect)
{
CURL authUrl(url);
if (ConnectAndAuthenticate(authUrl))
return RealExists(authUrl, false);
}
return false;
}
开发者ID:CEikermann,项目名称:xbmc,代码行数:79,代码来源:Win32SMBDirectory.cpp
示例8: GetDirectory
bool CPlayListDirectory::GetDirectory(const CStdString& strPath, VECFILEITEMS &items)
{
if ( !CUtil::IsPlayList(strPath) )
{
CHDDirectory dirLoader;
dirLoader.SetMask(".m3u|.b4s|.pls|.strm");
VECFILEITEMS tmpitems;
CStdString strDir = g_stSettings.m_szAlbumDirectory;
strDir += "\\playlists";
dirLoader.GetDirectory(strDir, tmpitems);
// for each playlist found
for (int i = 0; i < (int)tmpitems.size(); ++i)
{
CFileItem* pItem = tmpitems[i];
CStdString strPlayListName, strPlayList;
strPlayList = CUtil::GetFileName( pItem->m_strPath );
strPlayListName = CUtil::GetFileName( strPlayList );
delete pItem;
CPlayListFactory factory;
CPlayList* pPlayList = factory.Create(strPlayList);
if (pPlayList)
{
if ( pPlayList->Load(strPlayList) )
{
CStdString strPlayListName = pPlayList->GetName();
if (strPlayListName.size())
{
strPlayListName = strPlayListName;
}
}
delete pPlayList;
}
// create an entry....
pItem = new CFileItem(strPlayListName);
pItem->m_strPath = strPlayList;
pItem->m_bIsFolder = true;
pItem->m_bIsShareOrDrive = false;
items.push_back(pItem);
}
CUtil::SetThumbs(items);
CUtil::FillInDefaultIcons(items);
return true;
}
// yes, first add parent path
{
CFileItem *pItem = new CFileItem("..");
pItem->m_strPath = "";
pItem->m_bIsFolder = true;
pItem->m_bIsShareOrDrive = false;
items.push_back(pItem);
}
// open the playlist
CPlayListFactory factory;
CPlayList* pPlayList = factory.Create(strPath);
if (!pPlayList) return false;
if ( pPlayList->Load(strPath) )
{
for (int i = 0; i < (int)pPlayList->size(); ++i)
{
const CPlayList::CPlayListItem& playlistItem = (*pPlayList)[i];
CStdString strLabel;
strLabel = CUtil::GetFileName( playlistItem.GetFileName() );
CFileItem* pItem = new CFileItem(strLabel);
pItem->m_strPath = playlistItem.GetFileName();
pItem->m_bIsFolder = false;
pItem->m_bIsShareOrDrive = false;
items.push_back(pItem);
}
}
delete pPlayList;
CUtil::SetThumbs(items);
CUtil::FillInDefaultIcons(items);
return true;
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:86,代码来源:PlaylistDirectory.cpp
注:本文中的VECFILEITEMS类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论