|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pelzer.util.Timecode
public class Timecode
Offers methods to act on timecodes, SMPTE or otherwise. Has special support for audio timecodes,
which look like SMPTE but have 75 frames/sec. This class does some nice things, such as when you
pass in "00:00:75:00" as a timecode, it normalizes the data to "00:01:15:00". If you pass in a
code with a fifth parameter, that parameter is assumed to be samples. Any non-numeric character
can be used as a delimiter, so both "00|01|12|34" and "00a01b12c34" are equivalent.
toSamples() returns the total number of samples that this code represents, and is the
most accurate representation with which to do arithmetic on.
| Nested Class Summary | |
|---|---|
class |
Timecode.TimecodeException
|
static class |
Timecode.Type
|
| Constructor Summary | |
|---|---|
Timecode()
Deprecated. This is here for XMLEncode/Decode only. Use Timecode(com.pelzer.util.Timecode.Type) instead. |
|
Timecode(float seconds)
Creates a new CD timecode based on seconds using default seconds->frames rate from UploadConstants |
|
Timecode(float seconds,
Timecode.Type type)
Creates a new timecode of the given type based on seconds. |
|
Timecode(String timecode)
Creates a new CD timecode based on a string in the form HH:MM:SS:FF |
|
Timecode(String timecode,
Timecode.Type type)
Creates a new timecode of the given type based on a string in the form HH:MM:SS:FF |
|
Timecode(Timecode.Type type)
Creates a new blank timecode of the given type set at 00:00:00:00 |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
equals(Object obj)
|
String |
getCode()
|
String |
getCodeWithSamples()
|
int |
getFrames()
|
float |
getFramesPerSecond()
|
int |
getHours()
|
int |
getMinutes()
|
long |
getSamples()
|
float |
getSamplesPerSecond()
|
int |
getSeconds()
|
void |
normalize()
Goes through the system and sanitizes badly formed values : 00:00:60:00 will become 00:01:00:00, etc. |
void |
setCode(double seconds)
|
void |
setCode(float seconds)
Sets the object up based on seconds... |
void |
setCode(int frames)
Set the code based on frames, framesPerSecond defaults to 75. |
void |
setCode(String timecode)
Sets the object based on a string in the form HH:MM:SS:FF |
void |
setFrames(int value)
|
void |
setFramesPerSecond(float value)
|
void |
setHours(int value)
|
void |
setMinutes(int value)
|
void |
setSamples(long value)
|
void |
setSamplesPerSecond(float value)
|
void |
setSeconds(int value)
|
void |
setUseSamples(boolean b)
If true, samples per second will be used in computing fractions of frames. |
double |
toDoubleSeconds()
|
double |
toFrames()
|
String |
toHHMMSS()
Uses the default ":" delimiter |
String |
toHHMMSS(String delimiter)
Units smaller than seconds are ignored completely. |
int |
toIntSeconds()
Hours are added to the minutes and minutes are added to the seconds value so seconds could be larger than 60. |
String |
toMMSS()
Uses the default ":" delimiter |
String |
toMMSS(String delimiter)
Hours are added to the minutes value so minutes could be larger than 60. |
long |
toSamples()
|
float |
toSeconds()
|
String |
toString()
|
boolean |
useSamples()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Timecode()
Timecode(com.pelzer.util.Timecode.Type) instead.
public Timecode(Timecode.Type type)
public Timecode(String timecode)
throws Timecode.TimecodeException
Timecode.TimecodeException
public Timecode(String timecode,
Timecode.Type type)
throws Timecode.TimecodeException
Timecode.TimecodeExceptionpublic Timecode(float seconds)
public Timecode(float seconds,
Timecode.Type type)
| Method Detail |
|---|
public void clear()
public void setHours(int value)
public int getHours()
public void setMinutes(int value)
public int getMinutes()
public void setSeconds(int value)
public int getSeconds()
public void setFrames(int value)
public int getFrames()
public void setFramesPerSecond(float value)
public float getFramesPerSecond()
public void setSamples(long value)
public long getSamples()
public void setSamplesPerSecond(float value)
public float getSamplesPerSecond()
public boolean useSamples()
public void setUseSamples(boolean b)
public void setCode(String timecode)
throws Timecode.TimecodeException
Timecode.TimecodeExceptionpublic void setCode(float seconds)
setFramesPerSecond().)
public void setCode(double seconds)
public void setCode(int frames)
public void normalize()
public String getCode()
public String getCodeWithSamples()
public float toSeconds()
public double toDoubleSeconds()
public double toFrames()
public long toSamples()
public String toString()
toString in class Objectpublic int toIntSeconds()
public String toMMSS(String delimiter)
delimiter -
public String toMMSS()
public String toHHMMSS()
public String toHHMMSS(String delimiter)
delimiter -
public boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||