当前位置: 首页>>代码示例>>C++>>正文


C++ DataSourceRef::getFilePathHint方法代码示例

本文整理汇总了C++中DataSourceRef::getFilePathHint方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSourceRef::getFilePathHint方法的具体用法?C++ DataSourceRef::getFilePathHint怎么用?C++ DataSourceRef::getFilePathHint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSourceRef的用法示例。


在下文中一共展示了DataSourceRef::getFilePathHint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadImage

ImageSourceRef loadImage( DataSourceRef dataSource, ImageSource::Options options, string extension )
{
#if defined( CINDER_COCOA )
	cocoa::SafeNsAutoreleasePool autorelease;
#endif

	if( extension.empty() )
		extension = getPathExtension( dataSource->getFilePathHint() );
	
	return ImageIoRegistrar::createSource( dataSource, options, extension );
}
开发者ID:todayman,项目名称:Cinder,代码行数:11,代码来源:ImageIo.cpp

示例2: defined

// static
unique_ptr<SourceFile> SourceFile::create( const DataSourceRef &dataSource, size_t sampleRate )
{
	unique_ptr<SourceFile> result;

#if ! defined( CINDER_WINRT ) || ( _MSC_VER > 1800 )
	if( dataSource->getFilePathHint().extension().string() == ".ogg" )
#else
	if( dataSource->getFilePathHint().extension() == ".ogg" )
#endif
		result.reset( new SourceFileOggVorbis( dataSource, sampleRate ) );
	else {
#if defined( CINDER_COCOA )
		result.reset( new cocoa::SourceFileCoreAudio( dataSource, sampleRate ) );
#elif defined( CINDER_MSW )
		result.reset( new msw::SourceFileMediaFoundation( dataSource, sampleRate ) );
#endif
	}

	if( result )
		result->setupSampleRateConversion();

	return result;
}
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:24,代码来源:Source.cpp

示例3: initFromDataSource

void MovieBase::initFromDataSource( DataSourceRef dataSourceRef, const std::string &mimeTypeHint )
{
	startQuickTime();
	if( dataSourceRef->isFilePath() ) { // try to use quicktime's native file handling if possible
		getObj()->mMovie = openMovieFromPath( dataSourceRef->getFilePath() );
		// no need to retain the data source
	}
	else if( dataSourceRef->isUrl() ) { // try to use quicktime's native Url handling if possible
		// Create a loader for this Url and then wait on it
		MovieLoader loader( dataSourceRef->getUrl() );
		loader.waitForLoaded();
		getObj()->mMovie = loader.transferMovieHandle();
		// no need to retain the data source
	}
	else { // we'll need to load from memory; and we'll rer to the data source to make sure it doesn't go away before the movie does
		Buffer buffer( dataSourceRef->getBuffer() );
		getObj()->mMovie = openMovieFromMemory( buffer.getData(), buffer.getDataSize(), dataSourceRef->getFilePathHint(), mimeTypeHint );	
		getObj()->mDataSource = dataSourceRef; // retain a reference to the dataSource so that it doesn't go away before we do
	}
	init();
}
开发者ID:AaronMeyers,项目名称:Cinder,代码行数:21,代码来源:QuickTime.cpp

示例4: loadXML

void ConfigDict::loadXML(DataSourceRef source)
{
	XmlTree doc;
	try {
		doc = XmlTree(source);	
	} catch(rapidxml::parse_error &e) {
		LOG_ERROR("ConfigDict::loadXML - couldnt parse XML data ("<< 
				  "error: "<< e.what() <<" "<<
				  "file: "<< source->getFilePathHint() <<
				  ")");
	}
	
	XmlTree root = *doc.begin();
	
	for(XmlTree::ConstIter setting = root.begin(); setting != root.end(); ++setting) 
	{
		string key = setting->getTag();
		string value = setting->getValue();
		settings.insert(std::pair<string,string>(key, value) );
	}
}
开发者ID:audionerd,项目名称:FieldKit.cpp,代码行数:21,代码来源:ConfigDict.cpp


注:本文中的DataSourceRef::getFilePathHint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。