本文整理汇总了C++中CFileItem::IsOnDVD方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsOnDVD方法的具体用法?C++ CFileItem::IsOnDVD怎么用?C++ CFileItem::IsOnDVD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsOnDVD方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
bool CAudioDecoder::Create(const CFileItem &file, __int64 seekOffset, unsigned int nBufferSize)
{
Destroy();
CSingleLock lock(m_critSection);
// create our pcm buffer
m_pcmBuffer.Create((int)std::max<unsigned int>(2, nBufferSize) *
INTERNAL_BUFFER_LENGTH);
// reset our playback timing variables
m_eof = false;
// get correct cache size
unsigned int filecache = g_guiSettings.GetInt("cacheaudio.lan");
if ( file.IsHD() )
filecache = g_guiSettings.GetInt("cache.harddisk");
else if ( file.IsOnDVD() )
filecache = g_guiSettings.GetInt("cacheaudio.dvdrom");
else if ( file.IsInternetStream() )
filecache = g_guiSettings.GetInt("cacheaudio.internet");
// create our codec
bool codecInitialized = false;
m_codec=CodecFactory::CreateCodecDemux(file.m_strPath, file.GetContentType(), filecache * 1024, codecInitialized);
if (!m_codec || (!codecInitialized && !m_codec->Init(file.m_strPath, filecache * 1024)))
{
CLog::Log(LOGERROR, "CAudioDecoder: Unable to Init Codec while loading file %s", file.m_strPath.c_str());
Destroy();
return false;
}
m_blockSize = m_codec->m_Channels * m_codec->m_BitsPerSample / 8;
if( m_codec->UseHWDecoding() || m_codec->UsePassthrough() )
m_outputUnitSize = sizeof(char);
else
m_outputUnitSize = sizeof(float);
if (seekOffset)
m_codec->Seek(seekOffset);
m_status = STATUS_QUEUING;
return true;
}
示例2: Create
bool CAudioDecoder::Create(const CFileItem &file, __int64 seekOffset, unsigned int nBufferSize)
{
Destroy();
CSingleLock lock(m_critSection);
// create our pcm buffer
m_pcmBuffer.Create((int)std::max<unsigned int>(2, nBufferSize) *
INTERNAL_BUFFER_LENGTH);
// reset our playback timing variables
m_eof = false;
// get correct cache size
unsigned int filecache = g_guiSettings.GetInt("cacheaudio.internet");
if ( file.IsHD() )
filecache = g_guiSettings.GetInt("cache.harddisk");
else if ( file.IsOnDVD() )
filecache = g_guiSettings.GetInt("cacheaudio.dvdrom");
else if ( file.IsOnLAN() )
filecache = g_guiSettings.GetInt("cacheaudio.lan");
// create our codec
m_codec=CodecFactory::CreateCodecDemux(file.GetPath(), file.GetMimeType(), filecache * 1024);
if (!m_codec || !m_codec->Init(file.GetPath(), filecache * 1024))
{
CLog::Log(LOGERROR, "CAudioDecoder: Unable to Init Codec while loading file %s", file.GetPath().c_str());
Destroy();
return false;
}
m_blockSize = m_codec->m_Channels * m_codec->m_BitsPerSample / 8;
// set total time from the given tag
if (file.HasMusicInfoTag() && file.GetMusicInfoTag()->GetDuration())
m_codec->SetTotalTime(file.GetMusicInfoTag()->GetDuration());
if (seekOffset)
m_codec->Seek(seekOffset);
m_status = STATUS_QUEUING;
return true;
}
示例3: GetPlayers
void CPlayerSelectionRule::GetPlayers(const CFileItem& item, VECPLAYERCORES &vecCores)
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: considering rule: %s", m_name.c_str());
if (m_bStreamDetails && !item.HasVideoInfoTag()) return;
if (m_tAudio >= 0 && (m_tAudio > 0) != item.IsAudio()) return;
if (m_tVideo >= 0 && (m_tVideo > 0) != item.IsVideo()) return;
if (m_tInternetStream >= 0 && (m_tInternetStream > 0) != item.IsInternetStream()) return;
if (m_tRemote >= 0 && (m_tRemote > 0) != item.IsRemote()) return;
if (m_tBD >= 0 && (m_tBD > 0) != (item.IsBDFile() && item.IsOnDVD())) return;
if (m_tDVD >= 0 && (m_tDVD > 0) != item.IsDVD()) return;
if (m_tDVDFile >= 0 && (m_tDVDFile > 0) != item.IsDVDFile()) return;
if (m_tDVDImage >= 0 && (m_tDVDImage > 0) != item.IsDVDImage()) return;
CRegExp regExp(false, CRegExp::autoUtf8);
if (m_bStreamDetails)
{
if (!item.GetVideoInfoTag()->HasStreamDetails())
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: cannot check rule: %s, no StreamDetails", m_name.c_str());
return;
}
CStreamDetails streamDetails = item.GetVideoInfoTag()->m_streamDetails;
if (CompileRegExp(m_audioCodec, regExp) && !MatchesRegExp(streamDetails.GetAudioCodec(), regExp)) return;
std::stringstream itoa;
itoa << streamDetails.GetAudioChannels();
std::string audioChannelsstr = itoa.str();
if (CompileRegExp(m_audioChannels, regExp) && !MatchesRegExp(audioChannelsstr, regExp)) return;
if (CompileRegExp(m_videoCodec, regExp) && !MatchesRegExp(streamDetails.GetVideoCodec(), regExp)) return;
if (CompileRegExp(m_videoResolution, regExp) &&
!MatchesRegExp(CStreamDetails::VideoDimsToResolutionDescription(streamDetails.GetVideoWidth(), streamDetails.GetVideoHeight()), regExp)) return;
if (CompileRegExp(m_videoAspect, regExp) &&
!MatchesRegExp(CStreamDetails::VideoAspectToAspectDescription(streamDetails.GetVideoAspect()), regExp)) return;
}
CURL url(item.GetPath());
if (CompileRegExp(m_fileTypes, regExp) && !MatchesRegExp(url.GetFileType(), regExp)) return;
if (CompileRegExp(m_protocols, regExp) && !MatchesRegExp(url.GetProtocol(), regExp)) return;
if (CompileRegExp(m_mimeTypes, regExp) && !MatchesRegExp(item.GetMimeType(), regExp)) return;
if (CompileRegExp(m_fileName, regExp) && !MatchesRegExp(item.GetPath(), regExp)) return;
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: matches rule: %s", m_name.c_str());
for (unsigned int i = 0; i < vecSubRules.size(); i++)
vecSubRules[i]->GetPlayers(item, vecCores);
PLAYERCOREID playerCoreId = GetPlayerCore();
if (playerCoreId != EPC_NONE)
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: adding player: %s (%d) for rule: %s", m_playerName.c_str(), playerCoreId, m_name.c_str());
vecCores.push_back(GetPlayerCore());
}
}