本文整理汇总了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;
}
示例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();
}