Skip to content

Latest commit

 

History

History
113 lines (82 loc) · 2.62 KB

TapeTimecode.md

File metadata and controls

113 lines (82 loc) · 2.62 KB

TapeTimecode class

TapeTimecode Class Methods

TapeTimecode Instance Methods

TapeTimecode Class Methods

TapeTimecode.isTimecode(str)

Check whether str is a valid tape timecode string representation.

Returns

(Boolean): true - str is valid, false - otherwise

Example

TapeTimecode.isValid("01:00:00:12");
// => true
TapeTimecode.isValid("00:00:53;13");
// => true
TapeTimecode.isValid("01:00:00:1234");
// => false

TapeTimecode.parseTimecode(tc, timecodeRate, dropFrame)

Parse tape timecode from string tc.

Arguments

  1. tc (String): string to parse
  2. timecodeRate (Integer): frames per second
  3. dropFrame (Boolean): is timecode drop frame or non-drop frame

Returns

(Integer): frame number corresponding to the parsed timecode

Example

TapeTimecode.parseTimecode("00:00:01:12", 24, false);
// => 36

TapeTimecode Instance Methods

TapeTimecode.prototype.getTimecodeAtFrame(frame)

Get tape timecode at frame frame.

Arguments

  1. frame (Integer): frame number

Returns

(String): tape timecode

Example

ttc.getTimecodeAtFrame(36);
// => "01:00:01:12"

TapeTimecode.prototype.getFrameByTimecode(tc)

Get frame number by tape timecode.

Arguments

  1. tc (String): tape timecode

Returns

(Integer): frame number

Example

ttc.getFrameByTimecode("01:00:01:12");
// => 36

TapeTimecode.prototype.getTapeFps()

Get the tape frame rate of this tape timecode instance.

Returns

(Integer): tape frame rate


TapeTimecode.prototype.getTimecodedDuration()

Get timeline duration as tape timecode.

Returns

(String): tape timecode

Example

ttc.getTimecodedDuration();
// => "00:33:28:12"

TapeTimecode.prototype.isDropFrame()

Return true if this tape timecode instance is drop frame.

Returns

(Boolean): true for drop frame, false for non-drop frame