+ framenumber = framenumber + dropFrames*9*d;
+}
+
+int frRound = round(framerate);
+int frames = framenumber % frRound;
+int seconds = (framenumber \ frRound) % 60;
+int minutes = ((framenumber \ frRound) \ 60) % 60;
+int hours = (((framenumber \ frRound) \ 60) \ 60);
+
+
+------------------------------------------------------------------------------------
+
+//CONVERT DROP FRAME TIMECODE TO A FRAME NUMBER
+//Code by David Heidelberger, adapted from Andrew Duncan
+//Given ints called hours, minutes, seconds, frames, and a double called framerate
+
+int dropFrames = round(framerate*.066666); //Number of drop frames is 6% of framerate rounded to nearest integer
+int timeBase = round(framerate); //We don’t need the exact framerate anymore, we just need it rounded to nearest integer
+
+int hourFrames = timeBase*60*60; //Number of frames per hour (non-drop)
+int minuteFrames = timeBase*60; //Number of frames per minute (non-drop)
+int totalMinutes = (60*hours) + minutes; //Total number of minuts
+int frameNumber = ((hourFrames * hours) + (minuteFrames * minutes) + (timeBase * seconds) + frames) - (dropFrames * (totalMinutes - (totalMinutes \ 10)));
+return frameNumber;
+
+*/
+
+
+
+#include <KDebug>
+#include <KLocalizedString>
+
+#include "timecode.h"
+
+Timecode::Timecode(Formats format, double framesPerSecond)
+{
+ setFormat(framesPerSecond, format);