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


C++ Format::OnNewFile方法代码示例

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


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

示例1: LoadVGMFile

bool VGMFile::LoadVGMFile()
{
	bool val = Load();
	if (!val)
		return false;
	Format* fmt = GetFormat();
	if (fmt)
		fmt->OnNewFile(this);

	pRoot->AddLogItem(new LogItem(wstring(L"Loaded \"" + name + L"\" successfully.").c_str(), LOG_LEVEL_INFO, L"VGMFile"));
	return val;
}
开发者ID:ArtFromCode,项目名称:vgmtrans,代码行数:12,代码来源:VGMFile.cpp

示例2: CountBytesOfVal

void SonyPS2Scanner::SearchForSampColl (RawFile* file)
{
	uint32_t nFileLength = file->size();
	if (nFileLength < 32)
		return;

	if (StringToLower(file->GetExtension()) == L"bd")
	{
		// Hack for incorrectly ripped bd files.  Should ALWAYS start with 16 0x00 bytes (must... suppress... rage)
		// If it doesn't, we'll throw out this file and create a new one with the correct formating
		uint8_t buf[16];
		file->GetBytes(0, 16, buf);
		int num = CountBytesOfVal(buf, 16, 0);		//The first 16 bytes must be all 0x00
		if (num != 16)
		{
			uint32_t newFileSize = file->size() + 16;
			uint8_t* newdataBuf = new uint8_t[newFileSize];
			file->GetBytes(0, file->size(), newdataBuf+16);
			memset(newdataBuf, 0, 16);
			pRoot->CreateVirtFile(newdataBuf, newFileSize, file->GetFileName(), file->GetParRawFileFullPath().c_str());
			return;
		}

		SonyPS2SampColl* sampColl = new SonyPS2SampColl(file, 0);
		//sampColl->LoadVGMFile();
		Format* fmt = sampColl->GetFormat();
		if (fmt)
			fmt->OnNewFile(sampColl);
	}

	//uint8_t buf[32];
	//file->GetBytes(0, 32, buf);
	//int num = CountBytesOfVal(buf, 16, 0);		//The first 16 bytes must be all 0x00
	//if (num != 16)	
	//	return;
	//num = CountBytesOfVal(buf+16, 16, 0);	//It is either extremely unlikely or impossible for bytes 16-31 to be all 0
	//if (num == 16)
	//	return;

	//SonyPS2SampColl* sampColl = new SonyPS2SampColl(file, 0);
	//sampColl->LoadVGMFile();
}
开发者ID:Kajiu,项目名称:vgmtrans,代码行数:42,代码来源:SonyPS2Scanner.cpp


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