public class Timecode extends Object
| Modifier and Type | Method and Description |
|---|---|
Timecode |
add(SampleCount samples)
Add some samples to this timecode
|
Timecode |
addPrecise(SampleCount samples)
Add some samples to this timecode, throwing an exception if precision would be lost
|
boolean |
between(Timecode start,
Timecode end) |
TimecodeBuilder |
builder()
Return a TimecodeBuilder for this Timecode instance
|
boolean |
eq(Timecode that) |
boolean |
equals(Object o) |
boolean |
ge(Timecode that) |
long |
getDaysPart() |
long |
getDurationInFrames()
Returns the duration of the timecode (from 00:00:00:00) in frames
|
long |
getDurationInFrames(boolean allowDropFrameRemoval)
Returns the duration of the timecode (from 00:00:00:00) in frames
|
long |
getDurationInSeconds()
Returns the duration of the timecode in seconds (from 00:00:00:00), ignoring frames
|
long |
getFramesPart() |
long |
getFramesPartAsMicroseconds()
Get the frames part of this timecode in microseconds
|
long |
getFramesPartAsMilliseconds()
Get the frames part of this timecode in milliseconds
|
long |
getHoursPart() |
static Timecode |
getInstance(long frameNumber,
boolean dropFrame,
Timebase timebase) |
static Timecode |
getInstance(long frameNumber,
boolean dropFrame,
Timebase timebase,
boolean supportDays)
Deprecated.
use method without supportDays
|
static Timecode |
getInstance(SampleCount samples) |
static Timecode |
getInstance(SampleCount samples,
boolean dropFrame)
Deprecated.
drop frame timecode is not correctly supported currently
|
static Timecode |
getInstance(SampleCount samples,
boolean dropFrame,
boolean supportDays)
Deprecated.
use method without supportDays (supportDays is now implicitly true) or dropFrame (drop frame timecode is not
correctly supported currently)
|
static Timecode |
getInstance(String encoded)
Parse a Timecode encoded in the encoded style for this library (
[-][dd:]hh:mm:ss:ff@timebase). |
static Timecode |
getInstance(String smpte,
Timebase timebase)
Part a Timecode encoded in the SMPTE style (
[dd:]hh:mm:ss:ff - or [dd:]hh:mm:ss;ff for
drop-frame
timecode) alongside a timebase. |
long |
getMinutesPart() |
SampleCount |
getSampleCount()
Returns a sample count as a delta from the timecode 00:00:00:00
|
SampleCount |
getSampleCount(Timecode from)
Returns a sample count as an offset from the provided timecode
The resulting timecode will be expressed in the same timebase as this object |
SampleCount |
getSampleCountPrecise(Timecode from)
Returns a sample count as an offset from the provided timecode
The resulting timecode will be expressed in the same timebase as this object |
long |
getSecondsPart() |
static Timecode |
getSmpteTimecode(String smpte,
Timebase timebase)
Deprecated.
|
Timebase |
getTimebase() |
boolean |
gt(Timecode that) |
int |
hashCode() |
boolean |
isDropFrame() |
boolean |
isNegative() |
boolean |
le(Timecode that) |
boolean |
lt(Timecode that) |
Timecode |
resample(Timebase toRate)
Resample this timecode to another timebase
|
Timecode |
resamplePrecise(Timebase toRate)
Resamples
|
Timecode |
subtract(SampleCount samples)
Subtract some samples from this timecode
|
String |
toEncodedString()
Returns the timecode in the Encoded Timecode format for this library.
|
String |
toEncodedString(boolean includeDays)
Returns the timecode in the Encoded Timecode format for this library.
|
String |
toFfmpegString()
Returns the timecode in FFmpeg format.
|
String |
toISODurationWithFrames(boolean includeDays)
Returns the timecode in a format that is similar to the ISO 8601 Duration format, except with an F field
for frames.
|
String |
toSMPTEString()
Return a SMPTE string of the format, dropping the days component.
|
String |
toSMPTEString(boolean includeDays)
Return a SMPTE-style string of the format
[-][dd:]hh:mm:ss:ff (or [-][dd:]hh:mm:ss;ff for
drop-frame
timecode) |
String |
toString()
Returns the timecode as a String, formatted as either:
hh:mm:ss:ff for non-dropframe timecode (where ff is of arbitrary length)
hh:mm:ss;ff for dropframe timecode (where ff is of arbitrary length)
|
String |
toVidispineString()
Deprecated.
use getSampleCount().toEncodedString();
|
static Timecode |
valueOf(String encoded)
Parse a Timecode encoded in the encoded style for this library (
[-][dd:]hh:mm:ss:ff@timebase). |
public TimecodeBuilder builder()
public long getDurationInFrames()
public long getDurationInFrames(boolean allowDropFrameRemoval)
public long getDurationInSeconds()
public long getFramesPartAsMicroseconds()
public long getFramesPartAsMilliseconds()
public boolean isDropFrame()
public boolean isNegative()
public long getFramesPart()
public long getSecondsPart()
public long getMinutesPart()
public long getHoursPart()
public long getDaysPart()
public Timebase getTimebase()
public String toSMPTEString()
[-]hh:mm:ss:ff (or [-]hh:mm:ss;ff for drop-frame timecode)public String toSMPTEString(boolean includeDays)
[-][dd:]hh:mm:ss:ff (or [-][dd:]hh:mm:ss;ff for
drop-frame
timecode)includeDays - if true (and this timecode has a days component), emit a timecode with a days field. If false then the days component
will
be ignoredpublic String toFfmpegString()
01:01:01:01:00 will be encoded as 25:01:01.000000)public String toISODurationWithFrames(boolean includeDays)
public String toEncodedString()
smpte
timecode including days@rate
where
rate is denominator:[numerator] (where numerator, if omitted,
is 1). See Timebase for further information on the encoding of the timebasepublic String toEncodedString(boolean includeDays)
smpte
timecode optionally including days@rate
where
rate is denominator:[numerator] (where numerator, if omitted,
is 1). See Timebase for further information on the encoding of the timebaseincludeDays - true if the days component should be emitted too (if non-zero)@Deprecated public String toVidispineString()
frames@rate where rate
is
denominator:[numerator] (where numerator, if omitted,
is 1)public boolean eq(Timecode that)
public boolean gt(Timecode that)
public boolean lt(Timecode that)
public boolean le(Timecode that)
public boolean ge(Timecode that)
public Timecode subtract(SampleCount samples)
samples - public Timecode add(SampleCount samples)
samples - public Timecode addPrecise(SampleCount samples) throws ResamplingException
samples - ResamplingException - if the requested addition would result in a loss of accuracy due to resamplingpublic SampleCount getSampleCount()
public SampleCount getSampleCount(Timecode from)
this objectfrom - the start timecodefrom and thisResamplingException - if the delta cannot be expressed without losing accuracypublic SampleCount getSampleCountPrecise(Timecode from) throws ResamplingException
this objectfrom - the start timecodefrom and thisResamplingException - if the delta cannot be expressed without losing accuracypublic Timecode resample(Timebase toRate)
toRate - the destination ratepublic Timecode resamplePrecise(Timebase toRate) throws ResamplingException
toRate - ResamplingExceptionpublic String toString()
public static final Timecode getInstance(long frameNumber, boolean dropFrame, Timebase timebase)
frameNumber - dropFrame - set to true to indicate that the frame-rate excludes dropframestimebase - public static final Timecode getInstance(SampleCount samples)
@Deprecated public static final Timecode getInstance(SampleCount samples, boolean dropFrame)
samples - dropFrame - @Deprecated public static final Timecode getInstance(SampleCount samples, boolean dropFrame, boolean supportDays)
samples - dropFrame - supportDays - public static final Timecode getInstance(String encoded)
[-][dd:]hh:mm:ss:ff@timebase). See Timebase.getInstance(java.lang.String) for information on valid timebase representationsencoded - a timecode encoded as hh:mm:ss:ff@timebaseRuntimeException - if the encoded string is not well-formed or could not be parsedpublic static final Timecode valueOf(String encoded)
[-][dd:]hh:mm:ss:ff@timebase). See Timebase.getInstance(java.lang.String) for information on valid timebase representationsencoded - a timecode encoded as hh:mm:ss:ff@timebaseRuntimeException - if the encoded string is not well-formed or could not be parsed@Deprecated public static final Timecode getSmpteTimecode(String smpte, Timebase timebase)
[-][dd:]hh:mm:ss:ff -or [-][dd:]hh:mm:ss;ff for drop-frame
timecode
alongside a timebasesmpte - timebase - public static final Timecode getInstance(String smpte, Timebase timebase)
[dd:]hh:mm:ss:ff - or [dd:]hh:mm:ss;ff for
drop-frame
timecode) alongside a timebase.smpte - the SMPTE-encoded timecodetimebase - the timebase to interpret the SMPTE timecode inRuntimeException - if parsing fails@Deprecated public static final Timecode getInstance(long frameNumber, boolean dropFrame, Timebase timebase, boolean supportDays)
frameNumber - the frame offset from zerodropFrame - set to true to indicate that the frame-rate excludes dropframes (keep false for PAL)timebase - the timebasesupportDays - true if the resulting Timecode may use the days field (default false)Copyright © 2016. All rights reserved.