+int Timecode::getFrameCount(const QString duration) const
+{
+ if (m_dropFrame) {
+ //Get Hours, Minutes, Seconds, Frames from timecode
+ int hours, minutes, seconds, frames;
+
+ hours = duration.section(':', 0, 0).toInt();
+ if (duration.contains('.')) {
+ minutes = duration.section('.', 0, 0).section(':', 1, 1).toInt();
+ seconds = duration.section('.', 1, 1).section(':', 0, 0).toInt();
+ frames = duration.section('.', 1, 1).section(':', 1, 1).toInt();
+ } else {
+ //Handle Drop Frame timecode frame calculations, even if the timecode supplied uses incorrect "99:99:99:99" format instead of "99:99.99:99"
+ minutes = duration.section(':', 1, 1).toInt();
+ seconds = duration.section(':', 2, 2).toInt();
+ frames = duration.section(':', 3, 3).toInt();
+ }
+
+ //Calculate the frame count
+ int dropRate = (int)((ceil(m_displayedFramesPerSecond) / 30) * 2);
+ frames += ((hours * 60 + minutes) * 60 + seconds) * m_displayedFramesPerSecond;
+ frames -= dropRate * ((hours * 60 + minutes) - (floor((hours * 60 + minutes) / 10)));
+ return frames;
+ }
+ return (int)((duration.section(':', 0, 0).toInt()*3600.0 + duration.section(':', 1, 1).toInt()*60.0 + duration.section(':', 2, 2).toInt()) * m_realFps + duration.section(':', 3, 3).toInt());
+}
+
+QString Timecode::getDisplayTimecode(const GenTime & time, bool frameDisplay) const
+{
+ if (frameDisplay) return QString::number((int) time.frames(m_realFps));
+ return getTimecode(time);
+}
+
+QString Timecode::getTimecode(const GenTime & time) const