Package se.datadosen.jalbum
Class TimeCode
java.lang.Object
se.datadosen.jalbum.TimeCode
- All Implemented Interfaces:
com.github.cliftonlabs.json_simple.Jsonable
,Serializable
,Comparable<TimeCode>
public class TimeCode
extends Object
implements Serializable, Comparable<TimeCode>, com.github.cliftonlabs.json_simple.Jsonable
Represents time measurements used by VideoProcessor
- Since:
- v11
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
asMillis()
int
boolean
static TimeCode
fromMillis
(long millis) int
int
getSecs()
int
hashCode()
void
setFrames
(int frames) Deprecated.Use setMillis.void
setMillis
(int millis) void
setSecs
(int secs) toJson()
void
toString()
Return TimeCode formatted as h:m:ss or m:ss.xxx if there are frames too
-
Constructor Details
-
TimeCode
public TimeCode() -
TimeCode
public TimeCode(int secs) -
TimeCode
public TimeCode(int secs, int millis) -
TimeCode
public TimeCode(double millis) -
TimeCode
Parse a time code formatted as hh:mm:ss.ff, hh:mm:ss.xxx or hh:mm:ss as a TimeCode (xxx represents fractions of a second, so .1 means a tenth of a second)- Parameters:
s
- timecode string- Throws:
IllegalArgumentException
- If passed string is null or doesn't format as any of the allowed formats
-
-
Method Details
-
toString
Return TimeCode formatted as h:m:ss or m:ss.xxx if there are frames too -
toShortString
-
getSecs
public int getSecs() -
setSecs
public void setSecs(int secs) -
getMillis
public int getMillis() -
setMillis
public void setMillis(int millis) -
setFrames
Deprecated.Use setMillis. Parameter isn't actually frames, but fractions of a second in millisecond precision- Parameters:
frames
-
-
asMillis
public long asMillis() -
fromMillis
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TimeCode>
-
toJson
- Specified by:
toJson
in interfacecom.github.cliftonlabs.json_simple.Jsonable
-
toJson
- Specified by:
toJson
in interfacecom.github.cliftonlabs.json_simple.Jsonable
- Throws:
IOException
-