public interface TimecodeValue extends Comparable<TimecodeValue>
Specifies videotape or audio tape timecode information. The timecode interface is capable of representing timecode values specified by SMPTE 12M.
To make values of this type, use the following methods from the MAJ forge:
Forge.makeTimecode(long, short, boolean);Forge.calculateTimecode(short, short, short, short, short, boolean);Forge.calculateDuration(TimecodeValue, TimecodeValue);>Forge.calculateEndTimecode(TimecodeValue, TimecodeValue);toString():
Forge.parseTimecode(String).TimecodeSegment| Modifier and Type | Method and Description |
|---|---|
TimecodeValue |
clone()
Create a cloned copy of this timecode value.
|
int |
compareTo(TimecodeValue o)
Chronologically compare this timecode value to another one based on real time,
which is calculated to take account of frames per second and drop frame values.
|
TimeStruct |
convertToRealTime()
Converts the timecode value to a real time, taking account of the frames
per second and drop frame values.
|
boolean |
getDropFrame()
Determines whether the timecode is drop (
true value) or
nondrop (false value). |
short |
getFramesPerSecond()
Returns the frames per second of the videotape or audio tape of the timecode.
|
long |
getStartTimecode()
Returns the timecode value by the number of frames offset from
the start of the video or audio.
|
void |
setDropFrame(boolean dropFrame)
Sets whether the timecode is drop (
true value) or
nondrop (false value). |
void |
setFramesPerSecond(short framesPerSecond)
Sets the frames per second of the videotape or audio tape of the timecode.
|
void |
setStartTimecode(long offsetFrame)
Sets the timecode value by the number of frames offset from the
start of the video or audio.
|
String |
toString()
Formats a timecode value representation in accordance with the SMPTE and EBU specifications.
|
boolean getDropFrame()
Determines whether the timecode is drop (true value) or
nondrop (false value).
If drop is set to true, the real frames-per-second rate represented
by the timecode is 29.97. Calculations of the real time represented by a timecode
or to create a textual representation of the time code drop 108 selected frames
per hour.
void setDropFrame(boolean dropFrame)
Sets whether the timecode is drop (true value) or
nondrop (false value).
dropFrame - Is the timecode a drop value?@UInt16 short getFramesPerSecond()
Returns the frames per second of the videotape or audio tape of the timecode.
void setFramesPerSecond(@UInt16 short framesPerSecond)
Sets the frames per second of the videotape or audio tape of the timecode.
framesPerSecond - Frames per second of the videotape or audiotape of the timecode.@FrameOffset long getStartTimecode()
Returns the timecode value by the number of frames offset from the start of the video or audio.
void setStartTimecode(@FrameOffset long offsetFrame)
Sets the timecode value by the number of frames offset from the start of the video or audio.
offsetFrame - Frame offset value to use to set the timecode.TimeStruct convertToRealTime() throws NumberFormatException
Converts the timecode value to a real time, taking account of the frames
per second and drop frame values. The value returned is a
TimeStruct value, containing the
hours, minutes, seconds and fractions of a second represented by the
frame offset value returned by getStartTimecode().
NumberFormatException - The timecode value is larger than the range it is
possible to represent with a time structure value.int compareTo(TimecodeValue o) throws NullPointerException
Chronologically compare this timecode value to another one based on real time, which is calculated to take account of frames per second and drop frame values.
compareTo in interface Comparable<TimecodeValue>o - Timecode value to compare this value to.NullPointerException - The given timecode value to compare to this one is null.TimecodeValue clone()
Create a cloned copy of this timecode value.
String toString()
Formats a timecode value representation in accordance with the SMPTE and EBU specifications. Specifically:
The format of the returned value is "hh:mm:ss;ff(.p)?" for timecodes with drop
frames and "hh:mm:ss:ff(.p)?" for timecodes with no drop frame. The components of the
value of the timecode are:
hh is the number of hoursmm is the number of minutes;ss is the number of seconds;ff is the number of frames through this second;(.p)? for frame rates over 30, whether the frame is the first (.0) or second
(.1) of the pair.toString in class ObjectForge.parseTimecode(String)(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.