com #EndRegion **** Directives created by AutoIt3Wrapper_GUI **** #FUNCTION# Name.: _tcAdd Description.: Returns addition of two timecodes Syntax.: _tcAdd($fTc1, fTc2 ) Parameters.: $fTc1 - First timecode in hh:mm:ss.ff format $fTc2 - Second timecode in hh:mm:ss.ff format $fFormat - Time base - "P" (default): PAL (25 fps) "M" : millisecond Return value.: Sum of the two timecode in the selected format Func _tcAdd ( $fTc1, $fTc2, $fFormat = "P", $fHourFormat = 1 ) Local $fMs1 = _tcToMs ( $fTc1 ) Local $fMs2 = _tcToMs ( $fTc2 ) Local $fSumMs = $fMs1 + $fMs2 Return _msToTc ( $fSumMs, $fFormat, $fHourFormat ) EndFunc #FUNCTION# Name.: _tcsSub Description.: Returns addition of two timecodes Syntax.: _tcSub($fTc1, fTc2 ) Parameters.: $fTc1 - First timecode in hh:mm:ss.ff format $fTc2 - Second timecode in hh:mm:ss.ff format $fFormat - Time base - "P" (default): PAL (25 fps) "M" : millisecond Return value.: Subtract $fTc2 from $fTc1 in the source format Func _tcSub ( $fTc1, $fTc2, $fFormat = "P" ) Local $fMs1 = _tcToMs ( $fTc1 ) Local $fMs2 = _tcToMs ( $fTc2 ) Local $fSumMs = $fMs1 - $fMs2 If $fSumMs $palTC1 = "00:01:12.20" $palTC2 = "23:59:50.02" $msTC1 = "00:01:12.800" $msTC2 = "23:59:50.120" MsgBox ( 0, "1", _tcAdd ( $palTC1, $palTC2 ) ) Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns PAL TC format MsgBox ( 0, "2", _tcAdd ( $palTC1, $palTC2, "M" ) ) Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns time with milliseconds format MsgBox ( 0, "3", _tcAdd ( $palTC1, $palTC2, "M", 0 ) ) Adds $palTC1 to $palTC2, hours can be infinite, returns time with milliseconds format MsgBox ( 0, "4", _tcAdd ( $msTC1, $msTC2 ) ) Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns PAL TC format MsgBox ( 0, "5", _tcAdd ( $msTC1, $msTC2, "M" ) ) Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns time with milliseconds format MsgBox ( 0, "6", _tcAdd ( $msTC1, $msTC2, "M", 0 ) ) Adds $palTC1 to $palTC2, hours can be infinite, returns time with milliseconds format MsgBox ( 0, "7", _tcSub ( $palTC2, $palTC1 ) ) Subtract $palTC1 from $palTC2, returns PAL TC format MsgBox ( 0, "8", _tcSub ( $palTC2, $palTC1, "M" ) ) Subtract $palTC1 from $palTC2, time with milliseconds format MsgBox ( 0, "9", _tcSub ( $msTC1, $msTC2 ) ) Subtract $palTC1 from $palTC2, returns PAL TC format - when hits zero, counts back from 24:00:00.00 MsgBox ( 0, "10", _tcSub ( $msTC1, $msTC2, "M" ) ) Subtract $palTC1 from $palTC2, time with milliseconds format - when hits zero, counts back from 24:00:00.000 MsgBox ( 0, "11", _tcFormatChange ( $palTC2 ) ) Convert PAL TC to time with milliseconds and back MsgBox ( 0, "12", _tcFormatChange ( $msTC2 ) ) Convert PAL TC to time with milliseconds and backĪny of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. PDF Software Development, Training and More.Expand collapse popup #Region **** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=PAL Timecode Calculator UDF #AutoIt3Wrapper_Res_LegalCopyright=horvath. You may have to change the format rule for the two input fields to allow for whatever is applicable in your case. Take a look at this document, which shows how this is implemented in a PDF form: To display the difference in another timecode, you can use this code: var t1 = this.getField("Time1").value Įvent.value = frames_to_timecode (timecode_to_frames(t2) - timecode_to_frames(t1)) to display the difference in frames of two fields you would use this: var t1 = this.getField("Time1").value Įvent.value = timecode_to_frames(t2) - timecode_to_frames(t1) How you can use calculations in your document. This is the equivalent of the Python script you've found. Use the following as a document level script: var framerate = 24
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |