#cp.apple.fcpxml.timecode

Functions for working with timecode in Final Cut Pro XML. Note that a timecode does not have any concept of a frame rate, so it is simple a structure of hours, minutes, seconds and frames.

To calculate the exact number of frames for a timecode, call the timecode:totalFramesWithFPS(fps) method, where fps is a number.

To calculate the exact number of seconds for a timecode, call the timecode:timeWithFrameDuration(frameDuration) method, where frameDuration is the frame duration as a time value.

Note, this currently does not support "Drop Frame" timecodes.


#API Overview

Constructors - API calls which return an object, typically one that offers API methods

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Constructors

Signaturecp.apple.fcpxml.timecode.fromFFSSMMHH(timecodeString) -> timecode
TypeConstructor
DescriptionParses a timecode string in the format FFSSMMHH and returns a new timecode object.
Parameters
  • timecodeString - The timecode string.
Returns
  • The new timecode object.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 61

Signaturecp.apple.fcpxml.timecode.fromHH_MM_SS_FF(timecodeString) -> timecode
TypeConstructor
DescriptionParses a timecode string in the format HH:MM:SS:FF and returns a new timecode object.
Parameters
  • timecodeString - The timecode string.
Returns
  • The new timecode object.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 47

Signaturecp.apple.fcpxml.timecode.new(hours, minutes, seconds, frames)
TypeConstructor
DescriptionCreates a new timecode object.
Parameters
  • hours - The number of hours.
  • minutes - The number of minutes.
  • seconds - The number of seconds.
  • frames - The number of frames.
Returns
  • The new timecode object.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 25

#Methods

Signaturecp.apple.fcpxml.timecode:__tostring() -> string
TypeMethod
DescriptionReturns the timecode as a string in the format HH:MM:SS:FF.
Parameters
  • None
Returns
  • The timecode string.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 102

Signaturecp.apple.fcpxml.timecode:timeWithFrameDuration(frameDuration) -> time
TypeMethod
DescriptionCalculates the time for the timecode, given the frame duration time value.
Parameters
  • frameDuration - The frame duration as a time value.
Returns
  • The time value.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 75

Signaturecp.apple.fcpxml.timecode:totalFramesWithFPS(fps) -> number
TypeMethod
DescriptionCalculates the total number of frames for the timecode, given the specified frame rate.
Parameters
  • fps - The frame rate as a number.
Returns
  • The total number of frames as a number.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/apple/fcpxml/timecode.lua line 89