+/*
+
+ Timecode calculation code for reference
+ If we ever use Quicktime timecode with 50.94 Drop frame, keep in mind that there is a bug inthe Quicktime code
+
+//CONVERT A FRAME NUMBER TO DROP FRAME TIMECODE
+//Code by David Heidelberger, adapted from Andrew Duncan
+//Given an int called framenumber and a double called framerate
+//Framerate should be 29.97, 59.94, or 23.976, otherwise the calculations will be off.
+
+int d;
+int m;
+
+int dropFrames = round(framerate * .066666); //Number of frames to drop on the minute marks is the nearest integer to 6% of the framerate
+int framesPerHour = round(framerate*60*60); //Number of frames in an hour
+int framesPer24Hours = framesPerHour*24; //Number of frames in a day - timecode rolls over after 24 hours
+int framesPer10Minutes = round(framerate * 60 * 10); //Number of frames per ten minutes
+int framesPerMinute = round(framerate)*60)- dropFrames; //Number of frames per minute is the round of the framerate * 60 minus the number of dropped frames
+
+if (framenumber<0) //Negative time. Add 24 hours.
+{
+ framenumber=framesPer24Hours+framenumber;
+}
+
+//If framenumber is greater than 24 hrs, next operation will rollover clock
+framenumber = framenumber % framesPer24Hours; //% is the modulus operator, which returns a remainder. a % b = the remainder of a/b
+
+d = framenumber\framesPer10Minutes; // \ means integer division, which is a/b without a remainder. Some languages you could use floor(a/b)
+m = framenumber % framesPer10Minutes;
+
+if (m>1)
+{
+ framenumber=framenumber + (dropFrames*9*d) + dropFrames*((m-dropFrames)\framesPerMinute);
+}
+else
+{
+ 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);
+
+
+------------------------------------------------------------------------------------