java.lang.Object
org.mbari.vcr4j.time.Timecode
A container for a timecode string in the format of HH:MM:SS:FF (hour:minute:second:frame)
If a frameRate is provided the string will be decomposed into frames and framerate
- Since:
- 2015-09-24T10:59:00
- Author:
- Brian Schlining
-
Field Details
-
EMPTY_TIMECODE_STRING
- See Also:
-
-
Constructor Details
-
Timecode
public Timecode(double frames, double frameRate) -
Timecode
-
Timecode
-
-
Method Details
-
isValid
public boolean isValid()- Returns:
- true if the timecode is formatted as HH:MM:SS:FF and the individual fields are possible field values. false if this is not a valid timecode representation.
-
isComplete
public boolean isComplete()- Returns:
- true If the following are all available: A valid timecode string, a valid framerate and a valid frame value. false otherwise.
-
getHMSF
If the timecode is in a valid format then this will be present. Use this to access the hour, minute, second, frame fields.- Returns:
- The hmsf object, if present
-
getFrameRate
public double getFrameRate()- Returns:
- The frameRate or NaN if no framerate was provided
-
getFrames
public double getFrames()- Returns:
- The frame count represented by the timecode string. If no frameRate was provided this can not be calculated so NaN is returned.
-
getSeconds
public double getSeconds()- Returns:
- the timecode as elapsed seconds. NaN is returned if the frameRate was not provided or if the timecode string is invalid
-
toString
The string represented. This may NOT necessarily be a valid timecode string if you did not provide one. You can use theisValid()method to check if the string is a valid timecode representation. -
zero
-