本文整理汇总了C++中CFileItemPtr::IsOnDVD方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::IsOnDVD方法的具体用法?C++ CFileItemPtr::IsOnDVD怎么用?C++ CFileItemPtr::IsOnDVD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::IsOnDVD方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveDVDItems
int CPlayList::RemoveDVDItems()
{
std::vector <std::string> vecFilenames;
// Collect playlist items from DVD share
ivecItems it;
it = m_vecItems.begin();
while (it != m_vecItems.end() )
{
CFileItemPtr item = *it;
if ( item->IsCDDA() || item->IsOnDVD() )
{
vecFilenames.push_back( item->GetPath() );
}
++it;
}
// Delete them from playlist
int nFileCount = vecFilenames.size();
if ( nFileCount )
{
std::vector <std::string>::iterator it;
it = vecFilenames.begin();
while (it != vecFilenames.end() )
{
std::string& strFilename = *it;
Remove( strFilename );
++it;
}
vecFilenames.erase( vecFilenames.begin(), vecFilenames.end() );
}
return nFileCount;
}
示例2: OnPlayMedia
bool CGUIWindowPrograms::OnPlayMedia(int iItem)
{
if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false;
CFileItemPtr pItem = m_vecItems->Get(iItem);
if (pItem->IsDVD())
return MEDIA_DETECT::CAutorun::PlayDisc();
if (pItem->m_bIsFolder) return false;
// launch xbe...
char szPath[1024];
char szParameters[1024];
m_database.IncTimesPlayed(pItem->GetPath());
int iRegion = m_iRegionSet?m_iRegionSet:GetRegion(iItem);
DWORD dwTitleId = 0;
if (!pItem->IsOnDVD())
dwTitleId = m_database.GetTitleId(pItem->GetPath());
if (!dwTitleId)
dwTitleId = CUtil::GetXbeID(pItem->GetPath());
CStdString strTrainer = m_database.GetActiveTrainer(dwTitleId);
if (strTrainer != "")
{
CTrainer trainer;
if (trainer.Load(strTrainer))
{
m_database.GetTrainerOptions(strTrainer,dwTitleId,trainer.GetOptions(),trainer.GetNumberOfOptions());
CUtil::InstallTrainer(trainer);
}
}
m_database.Close();
memset(szParameters, 0, sizeof(szParameters));
strcpy(szPath, pItem->GetPath().c_str());
if (pItem->IsShortCut())
{
CUtil::RunShortcut(pItem->GetPath().c_str());
return false;
}
if (strlen(szParameters))
CUtil::RunXBE(szPath, szParameters,F_VIDEO(iRegion));
else
CUtil::RunXBE(szPath,NULL,F_VIDEO(iRegion));
return true;
}
示例3: GetDirectory
//.........这里部分代码省略.........
if (bProgressVisible)
{
m_dlgProgress->SetLine(2,item->GetLabel());
m_dlgProgress->Progress();
}
if (item->m_bIsFolder && !item->IsParentFolder() && !item->IsPlugin() && g_guiSettings.GetBool("mygames.slowgameparsing"))
{ // folder item - let's check for a default.xbe file, and flatten if we have one
CStdString defaultXBE;
URIUtils::AddFileToFolder(item->GetPath(), "default.xbe", defaultXBE);
item->SetPath(defaultXBE);
item->m_bIsFolder = false;
}
if (item->m_bIsFolder && !item->IsParentFolder() && !item->IsPlugin() && !g_guiSettings.GetBool("mygames.slowgameparsing"))
{ // folder item - let's check for a default.xbe file, and flatten if we have one
CStdString defaultXBE;
URIUtils::AddFileToFolder(item->GetPath(), "default.xbe", defaultXBE);
if (CFile::Exists(defaultXBE))
{ // yes, format the item up
item->SetPath(defaultXBE);
item->m_bIsFolder = false;
}
}
else if (item->IsShortCut())
{ // resolve the shortcut to set it's description etc.
// and save the old shortcut path (so we can reassign it later)
CShortcut cut;
if (cut.Create(item->GetPath()))
{
shortcutPath = item->GetPath();
item->SetPath(cut.m_strPath);
item->SetThumbnailImage(cut.m_strThumb);
LABEL_MASKS labelMasks;
m_guiState->GetSortMethodLabelMasks(labelMasks);
CLabelFormatter formatter("", labelMasks.m_strLabel2File);
if (!cut.m_strLabel.IsEmpty())
{
item->SetLabel(cut.m_strLabel);
__stat64 stat;
if (CFile::Stat(item->GetPath(),&stat) == 0)
item->m_dwSize = stat.st_size;
formatter.FormatLabel2(item.get());
item->SetLabelPreformated(true);
}
}
}
if (item->IsXBE())
{
if (URIUtils::GetFileName(item->GetPath()).Equals("default_ffp.xbe"))
{
m_vecItems->Remove(i--);
continue;
}
// add to database if not already there
DWORD dwTitleID = item->IsOnDVD() ? 0 : m_database.GetProgramInfo(item.get());
if (!dwTitleID)
{
CStdString description;
if (CUtil::GetXBEDescription(item->GetPath(), description) && (!item->IsLabelPreformated() && !item->GetLabel().IsEmpty()))
{
item->SetLabel(description);
if (!g_guiSettings.GetBool("mygames.slowgameparsing"))
{
CLog::Log(LOGNOTICE,"Added to database: %s",description.c_str());
}
}
dwTitleID = CUtil::GetXbeID(item->GetPath());
if (!item->IsOnDVD())
m_database.AddProgramInfo(item.get(), dwTitleID);
}
// SetOverlayIcons()
if (m_database.ItemHasTrainer(dwTitleID))
{
if (m_database.GetActiveTrainer(dwTitleID) != "")
item->SetOverlayImage(CGUIListItem::ICON_OVERLAY_TRAINED);
else
item->SetOverlayImage(CGUIListItem::ICON_OVERLAY_HAS_TRAINER);
}
}
if (!shortcutPath.IsEmpty())
item->SetPath(shortcutPath);
}
m_database.CommitTransaction();
// set the cached thumbs
items.SetThumbnailImage("");
items.SetCachedProgramThumbs();
items.SetCachedProgramThumb();
if (!items.HasThumbnail())
items.SetUserProgramThumb();
if (bProgressVisible)
m_dlgProgress->Close();
return true;
}