本文整理汇总了C++中CCdIoSupport::GetCdInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CCdIoSupport::GetCdInfo方法的具体用法?C++ CCdIoSupport::GetCdInfo怎么用?C++ CCdIoSupport::GetCdInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCdIoSupport
的用法示例。
在下文中一共展示了CCdIoSupport::GetCdInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCdInfo
CCdInfo* CMediaManager::GetCdInfo(const std::string& devicePath)
{
#ifdef TARGET_WINDOWS
if(!m_bhasoptical)
return NULL;
std::string strDevice = TranslateDevicePath(devicePath, false);
std::map<std::string,CCdInfo*>::iterator it;
{
CSingleLock waitLock(m_muAutoSource);
it = m_mapCdInfo.find(strDevice);
if(it != m_mapCdInfo.end())
return it->second;
}
CCdInfo* pCdInfo=NULL;
CCdIoSupport cdio;
pCdInfo = cdio.GetCdInfo((char*)strDevice.c_str());
if(pCdInfo!=NULL)
{
CSingleLock waitLock(m_muAutoSource);
m_mapCdInfo.insert(std::pair<std::string,CCdInfo*>(strDevice,pCdInfo));
}
return pCdInfo;
#else
return MEDIA_DETECT::CDetectDVDMedia::GetCdInfo();
#endif
}
示例2: DetectMediaType
// Generates the drive url, (like iso9660://)
// from the CCdInfo class
void CDetectDVDMedia::DetectMediaType()
{
bool bCDDA(false);
CLog::Log(LOGINFO, "Detecting DVD-ROM media filesystem...");
CStdString strNewUrl;
CCdIoSupport cdio;
// Delete old CD-Information
if ( m_pCdInfo != NULL )
{
delete m_pCdInfo;
m_pCdInfo = NULL;
}
// Detect new CD-Information
m_pCdInfo = cdio.GetCdInfo();
if (m_pCdInfo == NULL)
{
CLog::Log(LOGERROR, "Detection of DVD-ROM media failed.");
return ;
}
CLog::Log(LOGINFO, "Tracks overall:%i; Audio tracks:%i; Data tracks:%i",
m_pCdInfo->GetTrackCount(),
m_pCdInfo->GetAudioTrackCount(),
m_pCdInfo->GetDataTrackCount() );
// Detect ISO9660(mode1/mode2), CDDA filesystem or UDF
if (m_pCdInfo->IsISOHFS(1) || m_pCdInfo->IsIso9660(1) || m_pCdInfo->IsIso9660Interactive(1))
{
strNewUrl = "iso9660://";
m_isoReader.Scan();
}
else
{
if (m_pCdInfo->IsUDF(1) || m_pCdInfo->IsUDFX(1))
strNewUrl = "D:\\";
else if (m_pCdInfo->IsAudio(1))
{
strNewUrl = "cdda://local/";
bCDDA = true;
}
else
strNewUrl = "D:\\";
}
if (m_pCdInfo->IsISOUDF(1))
{
if (!g_advancedSettings.m_detectAsUdf)
{
strNewUrl = "iso9660://";
m_isoReader.Scan();
}
else
{
strNewUrl = "D:\\";
}
}
CLog::Log(LOGINFO, "Using protocol %s", strNewUrl.c_str());
if (m_pCdInfo->IsValidFs())
{
if (!m_pCdInfo->IsAudio(1))
CLog::Log(LOGINFO, "Disc label: %s", m_pCdInfo->GetDiscLabel().c_str());
}
else
{
CLog::Log(LOGWARNING, "Filesystem is not supported");
}
CStdString strLabel = "";
if (bCDDA)
{
strLabel = "Audio-CD";
}
else
{
strLabel = m_pCdInfo->GetDiscLabel();
strLabel.TrimRight(" ");
}
SetNewDVDShareUrl( strNewUrl , bCDDA, strLabel);
}