本文整理汇总了C++中BlockFile::Read方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockFile::Read方法的具体用法?C++ BlockFile::Read怎么用?C++ BlockFile::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockFile
的用法示例。
在下文中一共展示了BlockFile::Read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxASSERT
void WaveTrack::Read64K(sampleType * buffer, WaveBlock * b,
sampleCount start, sampleCount len)
{
wxASSERT(b);
wxASSERT(start >= 0);
wxASSERT(start + len <= ((b->len + 65535) / 65536));
start *= 2;
len *= 2;
BlockFile *f = b->f;
bool opened = f->OpenReadHeader();
wxASSERT(opened);
f->SeekTo(headerTagLen + start * sizeof(sampleType));
int result = f->Read((void *) buffer, (int) (len * sizeof(sampleType)));
wxASSERT(result == (int) (len * sizeof(sampleType)));
f->Close();
}
示例2: Read
void WaveTrack::Read(sampleType * buffer, WaveBlock * b,
sampleCount start, sampleCount len)
{
wxASSERT(b);
wxASSERT(start >= 0);
wxASSERT(start + len <= b->len);
BlockFile *f = b->f;
bool opened = f->OpenReadData();
wxASSERT(opened);
f->SeekTo(totalHeaderLen + (start * sizeof(sampleType)));
int result = f->Read((void *) buffer, (int) (len * sizeof(sampleType)));
if (result != (int) (len * sizeof(sampleType))) {
printf("Expected to read %d bytes, got %d bytes.\n",
len * sizeof(sampleType), result);
}
wxASSERT(result == (int) (len * sizeof(sampleType)));
f->Close();
}