本文整理汇总了C++中Composition::getElapsedRealTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Composition::getElapsedRealTime方法的具体用法?C++ Composition::getElapsedRealTime怎么用?C++ Composition::getElapsedRealTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composition
的用法示例。
在下文中一共展示了Composition::getElapsedRealTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
AudioSegmentResizeFromStartCommand::execute()
{
Composition *c = m_segment->getComposition();
if (!m_newSegment) {
RealTime oldRT = c->getElapsedRealTime(m_oldStartTime);
RealTime newRT = c->getElapsedRealTime(m_newStartTime);
m_newSegment = m_segment->clone(false);
m_newSegment->setStartTime(m_newStartTime);
// Compute an audio start time that will keep the audio exactly where
// it was in time.
RealTime audioStartTime =
m_segment->getAudioStartTime() - (oldRT - newRT);
// Do not allow a negative audio start time.
// ??? This is a stopgap measure as the audio segment preview code
// will crash if the audio start time is negative. Need to fix the
// preview code, then check to see if the playback code works
// properly given a negative start time. Then this can be removed.
if (audioStartTime <= RealTime::zeroTime)
m_newSegment->setAudioStartTime(RealTime::zeroTime);
else
m_newSegment->setAudioStartTime(
m_segment->getAudioStartTime() - (oldRT - newRT));
}
c->addSegment(m_newSegment);
m_newSegment->setEndMarkerTime(m_segment->getEndMarkerTime());
c->detachSegment(m_segment);
m_detached = false;
}