TTCEdit - Timecode edit box, Version 1.0. Delphi 2. Freeware.

DESCRIPTION:
TCEdit is an edit box for entering timcode, as used in film, TV, MIDI sequencers, show control systems etc. It restricts user input to Hours, Minutes, Seconds and Frames, and returns both a formatted string as well as the timecode converted to miliseconds.

Once focused on TCEdit, users can enter the hours, minutes and seconds fields as right-entry calculator format. Pressing the '.' key will then transfer entry to the frames field, where right-entry format is also used. The text property then contains a valid timecode string, in the format HH:MM:SS.FF'. The hours, minutes, seconds and frames are also available in the relevant TCEdit property.

EG:
To enter 12 seconds and 15 frames, the user would just type '12.15'. To enter 5 hours, 34 minutes, 5 seconds and 11 frames, type '53405.11'. TCEdit will format this (as you type) as '05:34:05.11'. This is similar to the method used for many tape machines, autolocators and sync systems etc. 

TCEdit also validates entered timecode, once you Exit TCEdit. Entering 99.99 will cause an error message box to appear (unless you modify MaxHours, MaxMins, MaxSecs, MaxFrames to allow this sort of nonsense!). You can then decide how to proceed - normally clearing the timecode, or setting it to the nearest legal value etc.

Note that the MiliSeconds property will only be updated when focus shifts away from TCEdit. 

The text property is validated when it is changed, to see if it's a valid timecode string. If it does not fit the format 'XX:XX:XX.XX" (where XX is any 2 digit number) then it will be rejected. 


ADDED PROPERTIES:

DoFrames : Boolean;
When TRUE moves user entry to the frames part of the timecode. When FALSE, user will be entering into the hours, mins, secs fields. All entry is in right-entry calculator type format. Default is FALSE.

FrameRate : byte;
Timecode frame rate, in frames-per-second. Normal values are: 24 (film), 25 (EBU) or 30 (SMPTE). There is no SMPTE drop frame. Default is 25. FrameRate is also used when validating the timecode. If Frames > (FrameRate - 1) an error message box is generated.

Offset : Boolean;
If the user hits the '+' key when focus is on TCEdit, then Offset is set to TRUE. This would usually indicate that the user wishes the entered time to be offset from another time value (eg; the previous cue in an event list). Pressing the '*' key when in TCEdit will reset Offset to FALSE. Default is FALSE.

Milisecs : Integer;
Milisecs is the miliseconds equivilent of the timecode string. So in EBU (25fps), 00:00:01:02 would make milisecs = 1080. Default is 0.

MaxHours : byte;
Used when validating timecode. If user enters hours above MaxHours, then an error dialog is generated by TCEdit. Default value is 23.

MaxMins : byte;
Used when validating timecode. If user enters minutes above MaxMins, then an error dialog is generated by TCEdit. Default value is 59.

MaxSecs : byte;
Used when validating timecode. If user enters seconds above MaxSecs, then an error dialog is generated by TCEdit. Default value is 59.

Hours : byte;
Contains the current hours in the timecode string. Setting this property will alter just the Hours part of the timecode string. Attempting to set Hours greater than MaxHours will be ignored.

Mins : byte;
Contains the current minutes in the timecode string. Setting this property will alter just the Minutes part of the timecode string. Attempting to set Mins greater than MaxMins will be ignored.

Secs : byte;
Contains the current seconds in the timecode string. Setting this property will alter just the Seconds part of the timecode string. Attempting to set Secs greater than MaxSecs will be ignored.

Frames : byte;
Contains the current frames in the timecode string. Setting this property will alter just the Frames part of the timecode string. Attempting to set Frames > (FrameRate - 1) will be ignored.

DblClickClr : Boolean;
When TRUE, this will allow users to clear the TCEdit to '00:00:00.00' simply by double-clicking on the edit box. Default is FALSE.


PLEASE feel free to modify this component (my first ever!), and have your wicked way with it. All I ask is that you either e-mail me the new component, the application it's used in (ha!) or at least let me know where it's gone. Thanks!

Martin R Coster, Sunny Singapore. mrc@pacific.net.sg
May 1998.
