本文整理汇总了C++中AFfilehandle::checkCanRead方法的典型用法代码示例。如果您正苦于以下问题:C++ AFfilehandle::checkCanRead方法的具体用法?C++ AFfilehandle::checkCanRead怎么用?C++ AFfilehandle::checkCanRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AFfilehandle
的用法示例。
在下文中一共展示了AFfilehandle::checkCanRead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: afSeekFrame
AFframecount afSeekFrame (AFfilehandle file, int trackid, AFframecount frame)
{
if (!_af_filehandle_ok(file))
return -1;
if (!file->checkCanRead())
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (track->ms->isDirty() && track->ms->setup(file, track) == AF_FAIL)
return -1;
if (frame < 0)
return track->nextvframe;
/* Optimize the case of seeking to the current position. */
if (frame == track->nextvframe)
return track->nextvframe;
/* Limit request to the number of frames in the file. */
if (track->totalvframes != -1)
if (frame > track->totalvframes)
frame = track->totalvframes - 1;
/*
Now that the modules are not dirty and frame
represents a valid virtual frame, we call
_AFsetupmodules again after setting track->nextvframe.
_AFsetupmodules will look at track->nextvframe and
compute track->nextfframe in clever and mysterious
ways.
*/
track->nextvframe = frame;
if (track->ms->setup(file, track) == AF_FAIL)
return -1;
return track->nextvframe;
}