public class TimeCode extends Object implements Cloneable
TimeCode
object stores time and control codes as described in
SMPTE standard 12M-1999.
A TimeCode
object contains the following fields:
Time address | |
---|---|
hours | integer, range 0 - 23 |
minutes | integer, range 0 - 59 |
seconds | integer, range 0 - 59 |
frame | integer, range 0 - 29 |
Flags | |
drop frame flag | boolean |
color frame flag | boolean |
field/phase frame flag | boolean |
bgf0 | boolean |
bgf1 | boolean |
bgf2 | boolean |
Binary groups for user-defined data and control codes | |
binary group 1 | integer, range 0 - 15 |
binary group 2 | integer, range 0 - 15 |
… | |
binary group 8 | integer, range 0 - 15 |
Class TimeCode
contains methods to convert between the fields
listed above and a more compact representation where the fields are packed
into two 32-bit integers. In the packed integer representations, bit 0 is the
least significant bit, and bit 31 is the most significant bit of the integer
value.
The time address and flags fields can be packed in three different ways:
bits | packing for 24-frame film | packing for 60-field television | packing for 50-field television |
---|---|---|---|
0 - 3 |
frame units | frame units | frame units |
4 - 5 |
frame tens | frame tens | frame tens |
6 |
unused, set to 0 | drop frame flag | unused, set to 0 |
7 |
unused, set to 0 | color frame flag | color frame flag |
8 - 11 |
seconds units | seconds units | seconds units |
12 - 14 |
seconds tens | seconds tens | seconds tens |
15 |
phase flag | field/phase flag | bgf0 |
16 - 19 |
minutes units | minutes units | minutes units |
20 - 22 |
minutes tens | minutes tens | minutes tens |
23 |
bgf0 | bgf0 | bgf2 |
24 - 27 |
hours units | hours units | hours units |
28 - 29 |
hours tens | hours tens | hours tens |
30 |
bgf1 | bgf1 | bgf1 |
31 |
bgf2 | bgf2 | field/phase flag |
User-defined data and control codes are packed as follows:
bits | field |
---|---|
0 - 3 |
binary group 1 |
4 - 7 |
binary group 2 |
8 - 11 |
binary group 3 |
12 - 15 |
binary group 4 |
12 - 15 |
binary group 5 |
16 - 19 |
binary group 6 |
24 - 27 |
binary group 7 |
28 - 31 |
binary group 8 |
Modifier and Type | Class and Description |
---|---|
static class |
TimeCode.Packing
Bit packing variants
|
Modifier and Type | Field and Description |
---|---|
int |
timeAndFlags |
int |
userData |
Constructor and Description |
---|
TimeCode() |
TimeCode(int timeAndFlags,
int userData) |
TimeCode(TimeCode other) |
Modifier and Type | Method and Description |
---|---|
TimeCode |
clone() |
boolean |
equals(Object obj) |
int |
getBinaryGroup(int group) |
int |
getFrame() |
int |
getHours() |
int |
getMinutes() |
int |
getSeconds() |
int |
getTimeAndFlags() |
int |
getTimeAndFlags(TimeCode.Packing packing) |
int |
getUserData() |
boolean |
hasBgf0() |
boolean |
hasBgf1() |
boolean |
hasBgf2() |
boolean |
hasColorFrame() |
boolean |
hasDropFrame() |
boolean |
hasFieldPhase() |
int |
hashCode() |
void |
setBgf0(boolean value) |
void |
setBgf1(boolean value) |
void |
setBgf2(boolean value) |
void |
setBinaryGroup(int group,
int value) |
void |
setColorFrame(boolean value) |
void |
setDropFrame(boolean value) |
void |
setFieldPhase(boolean value) |
void |
setFrame(int value) |
void |
setHours(int value) |
void |
setMinutes(int value) |
void |
setSeconds(int value) |
void |
setTimeAndFlags(int value) |
void |
setTimeAndFlags(int value,
TimeCode.Packing packing) |
void |
setUserData(int value) |
String |
toString() |
public TimeCode()
public TimeCode(TimeCode other)
public TimeCode(int timeAndFlags, int userData)
public int getHours()
public void setHours(int value)
public int getMinutes()
public void setMinutes(int value)
public int getSeconds()
public void setSeconds(int value)
public int getFrame()
public void setFrame(int value)
public boolean hasDropFrame()
public void setDropFrame(boolean value)
public boolean hasColorFrame()
public void setColorFrame(boolean value)
public boolean hasFieldPhase()
public void setFieldPhase(boolean value)
public boolean hasBgf0()
public void setBgf0(boolean value)
public boolean hasBgf1()
public void setBgf1(boolean value)
public boolean hasBgf2()
public void setBgf2(boolean value)
public int getBinaryGroup(int group)
public void setBinaryGroup(int group, int value)
public int getTimeAndFlags()
public int getTimeAndFlags(TimeCode.Packing packing)
public void setTimeAndFlags(int value)
public void setTimeAndFlags(int value, TimeCode.Packing packing)
public int getUserData()
public void setUserData(int value)