# 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

  • fromFFSSMMHH
  • fromHH_MM_SS_FF
  • new

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

  • __tostring
  • timeWithFrameDuration
  • totalFramesWithFPS

# API Documentation

# Constructors

# fromFFSSMMHH

Signature cp.apple.fcpxml.timecode.fromFFSSMMHH(timecodeString) -> timecode
Type Constructor
Description Parses a timecode string in the format FFSSMMHH and returns a new timecode object.
Parameters
  • timecodeString - The timecode string.
Returns
  • The new timecode object.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 61

# fromHH_MM_SS_FF

Signature cp.apple.fcpxml.timecode.fromHH_MM_SS_FF(timecodeString) -> timecode
Type Constructor
Description Parses 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.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 47

# new

Signature cp.apple.fcpxml.timecode.new(hours, minutes, seconds, frames)
Type Constructor
Description Creates 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.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 25

# Methods

# __tostring

Signature cp.apple.fcpxml.timecode:__tostring() -> string
Type Method
Description Returns the timecode as a string in the format HH:MM:SS:FF.
Parameters
  • None
Returns
  • The timecode string.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 102

# timeWithFrameDuration

Signature cp.apple.fcpxml.timecode:timeWithFrameDuration(frameDuration) -> time
Type Method
Description Calculates the time for the timecode, given the frame duration time value.
Parameters
  • frameDuration - The frame duration as a time value.
Returns
  • The time value.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 75

# totalFramesWithFPS

Signature cp.apple.fcpxml.timecode:totalFramesWithFPS(fps) -> number
Type Method
Description Calculates 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.
Notes None
Examples None
Source src/extensions/cp/apple/fcpxml/timecode.lua line 89