本文整理汇总了C++中CMusicDatabaseDirectory::ContainsSongs方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicDatabaseDirectory::ContainsSongs方法的具体用法?C++ CMusicDatabaseDirectory::ContainsSongs怎么用?C++ CMusicDatabaseDirectory::ContainsSongs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicDatabaseDirectory
的用法示例。
在下文中一共展示了CMusicDatabaseDirectory::ContainsSongs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddItemToPlayList
/// \brief Add unique file and folders and its subfolders to playlist
/// \param pItem The file item to add
void CGUIWindowMusicBase::AddItemToPlayList(const CFileItem* pItem, CFileItemList &queuedItems)
{
if (!pItem->CanQueue() || pItem->IsRAR() || pItem->IsZIP() || pItem->IsParentFolder()) // no zip/rar enques thank you!
return;
if (pItem->IsMusicDb() && pItem->m_bIsFolder && !pItem->IsParentFolder())
{ // we have a music database folder, just grab the "all" item underneath it
CMusicDatabaseDirectory dir;
if (!dir.ContainsSongs(pItem->m_strPath))
{ // grab the ALL item in this category
// Genres will still require 2 lookups, and queuing the entire Genre folder
// will require 3 lookups (genre, artist, album)
CFileItem item(pItem->m_strPath + "-1/", true);
item.SetCanQueue(true); // workaround for CanQueue() check above
AddItemToPlayList(&item, queuedItems);
return;
}
}
if (pItem->m_bIsFolder || (m_gWindowManager.GetActiveWindow() == WINDOW_MUSIC_NAV && pItem->IsPlayList()))
{
// Check if we add a locked share
if ( pItem->m_bIsShareOrDrive )
{
CFileItem item = *pItem;
if ( !g_passwordManager.IsItemUnlocked( &item, "music" ) )
return ;
}
// recursive
CFileItemList items;
GetDirectory(pItem->m_strPath, items);
//OnRetrieveMusicInfo(items);
FormatAndSort(items);
for (int i = 0; i < items.Size(); ++i)
AddItemToPlayList(items[i], queuedItems);
}
else
{
if (pItem->IsPlayList())
{
auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem));
if (pPlayList.get())
{
// load it
if (!pPlayList->Load(pItem->m_strPath))
{
CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0);
return; //hmmm unable to load playlist?
}
CPlayList playlist = *pPlayList;
for (int i = 0; i < (int)playlist.size(); ++i)
AddItemToPlayList(&playlist[i], queuedItems);
return;
}
}
else if(pItem->IsInternetStream())
{ // just queue the internet stream, it will be expanded on play
queuedItems.Add(new CFileItem(*pItem));
}
else if (!pItem->IsNFO() && pItem->IsAudio())
{
CFileItem *itemCheck = queuedItems.Get(pItem->m_strPath);
if (!itemCheck || itemCheck->m_lStartOffset != pItem->m_lStartOffset)
{ // add item
CLog::Log(LOGDEBUG, "Adding item (%s) to playlist", pItem->m_strPath.c_str());
queuedItems.Add(new CFileItem(*pItem));
}
}
}
}