Package com.peterphi.std.types
Class TimecodeBuilder
java.lang.Object
com.peterphi.std.types.TimecodeBuilder
Constructs Timecode instances
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a Timecode instance with the fields defined in this builderstatic TimecodeBuilder
fromEncodedValue
(String encoded) Parse a Timecode encoded in the "vidispine style" (hh:mm:ss:ff@timebase
).static TimecodeBuilder
fromFrames
(long signedFrameNumber, Timebase rate) static TimecodeBuilder
fromFrames
(long signedFrameNumber, Timebase rate, boolean dropFrame) static TimecodeBuilder
fromSamples
(SampleCount samples, boolean dropFrame) static TimecodeBuilder
Part a Timecode encoded in the SMPTE style ([dd:]hh:mm:ss:ff
- or[dd:]hh:mm:ss;ff
for drop-frame timecode)static TimecodeBuilder
fromTimecode
(Timecode timecode) long
getDays()
long
long
getHours()
long
getRate()
long
boolean
toString()
withDays
(long days) withDropFrame
(boolean dropFrame) withFrames
(long frames) withHours
(long hours) withMinutes
(long minutes) withNegative
(boolean negative) withSeconds
(long seconds) withTime
(org.joda.time.DateTime dateTime) withTime
(org.joda.time.LocalTime time) withTimecode
(Timecode timecode) Reset this builder to the values in the provided Timecode
-
Constructor Details
-
TimecodeBuilder
public TimecodeBuilder()
-
-
Method Details
-
withTimecode
Reset this builder to the values in the provided Timecode- Parameters:
timecode
-- Returns:
-
withTime
-
withTime
-
withTime
-
withTime
-
withNegative
-
withDays
-
withHours
-
withMinutes
-
withSeconds
-
withFrames
-
withDropFrame
-
withRate
-
build
Constructs a Timecode instance with the fields defined in this builder- Returns:
- Throws:
IllegalArgumentException
- if any of the fields are invalid/incompatible
-
isNegative
public boolean isNegative() -
getDays
public long getDays() -
getHours
public long getHours() -
getMinutes
public long getMinutes() -
getSeconds
public long getSeconds() -
getFrames
public long getFrames() -
getRate
-
isDropFrame
-
toString
-
fromTimecode
-
fromEncodedValue
Parse a Timecode encoded in the "vidispine style" (hh:mm:ss:ff@timebase
). SeeTimebase.getInstance(java.lang.String)
for information on valid timebase representations- Parameters:
encoded
- a timecode encoded ashh:mm:ss:ff@timebase
- Returns:
- a parsed timecode object
- Throws:
RuntimeException
- if the encoded string is not well-formed or could not be parsed
-
fromSMPTE
Part a Timecode encoded in the SMPTE style ([dd:]hh:mm:ss:ff
- or[dd:]hh:mm:ss;ff
for drop-frame timecode)- Parameters:
smpte
- the SMPTE-encoded timecode- Returns:
- a parsed timecode object
- Throws:
RuntimeException
- if parsing fails
-
fromSamples
-
fromFrames
-
fromFrames
-