本文整理汇总了C++中VideoEntryPtr::getDuration方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoEntryPtr::getDuration方法的具体用法?C++ VideoEntryPtr::getDuration怎么用?C++ VideoEntryPtr::getDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoEntryPtr
的用法示例。
在下文中一共展示了VideoEntryPtr::getDuration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: o_fortressRotation_init
void Mechanical::o_fortressRotation_init(uint16 var, const ArgumentsArray &args) {
_fortressRotationGears = getInvokingResource<MystAreaVideo>();
VideoEntryPtr gears = _fortressRotationGears->playMovie();
gears->setLooping(true);
gears->seek(Audio::Timestamp(0, 1800 * _fortressPosition, 600));
gears->setRate(0);
_fortressRotationSounds[0] = args[0];
_fortressRotationSounds[1] = args[1];
_fortressRotationSounds[2] = args[2];
_fortressRotationSounds[3] = args[3];
_fortressRotationBrake = 0;
// WORKAROUND for the tower rotation bug in Myst ME.
// The original engine only allowed to visit two out of the three small islands,
// preventing the game from being fully completable.
// The fortress rotation is computed from the current position in the movie
// hcgears.mov. The version of this movie that shipped with the ME edition is
// too short to allow to visit all the islands.
// ScummVM simulates a longer movie by counting the number of times the movie
// looped and adding that time to the current movie position.
// Hence allowing the fortress position to be properly computed.
uint32 movieDuration = gears->getDuration().convertToFramerate(600).totalNumberOfFrames();
if (movieDuration == 3680) {
_fortressRotationShortMovieWorkaround = true;
_fortressRotationShortMovieCount = 0;
_fortressRotationShortMovieLast = 0;
}
_fortressRotationRunning = true;
_gearsWereRunning = false;
}
示例2: playMovie
VideoEntryPtr MystAreaVideo::playMovie() {
// Check if the video is already running
VideoEntryPtr handle = _vm->_video->findVideo(_videoFile);
// If the video is not running, play it
if (!handle) {
handle = _vm->_video->playMovie(_videoFile, Audio::Mixer::kSFXSoundType);
if (!handle)
error("Failed to open '%s'", _videoFile.c_str());
handle->moveTo(_left, _top);
handle->setLooping(_loop != 0);
Common::Rational rate;
if (_playRate != 0) {
rate = Common::Rational(_playRate, 100);
} else {
rate = 1;
}
if (_direction == -1) {
rate = -rate;
handle->seek(handle->getDuration());
}
handle->setRate(rate);
} else {
// Resume the video
handle->pause(false);
handle->start();
}
if (_playBlocking) {
_vm->waitUntilMovieEnds(handle);
return VideoEntryPtr();
}
return handle;
}