if (duration.isEmpty()) {
return 0;
}
-
int hours, minutes, seconds, frames;
int offset = 0;
if (duration.at(0) == '-') {
int frameNumber = ((m_displayedFramesPerSecond * 3600 * hours) + (m_displayedFramesPerSecond * 60 * minutes) + (m_displayedFramesPerSecond * seconds) + frames) - (m_dropFrames * (totalMinutes - floor(totalMinutes / 10)));
return frameNumber;
}
- return (int)(hours * 3600.0 + minutes * 60.0 + seconds * m_realFps + frames);
+ return (int)((hours * 3600.0 + minutes * 60.0 + seconds) * m_realFps + frames);
}
QString Timecode::getDisplayTimecode(const GenTime & time, bool frameDisplay) const
//static
-QString Timecode::getStringTimecode(int frames, const double &fps)
+QString Timecode::getStringTimecode(int frames, const double &fps, bool showFrames)
{
// Returns the timecode in an hh:mm:ss format
}
int seconds = (int)(frames / fps);
+ int frms = frames % (int) (fps + 0.5);
int minutes = seconds / 60;
seconds = seconds % 60;
int hours = minutes / 60;
text.append(QString::number(minutes).rightJustified(2, '0', false));
text.append(':');
text.append(QString::number(seconds).rightJustified(2, '0', false));
+ if (showFrames) {
+ text.append('.');
+ text.append(QString::number(frms).rightJustified(2, '0', false));
+ }
return text;
}