drastic.mCmdIF
Class TCXlat

java.lang.Object
  extended bydrastic.mCmdIF.TCXlat

public class TCXlat
extends java.lang.Object

Title: TCXlat

Description: Convert between time code strings and frames

Copyright: Copyright © 1998-2007

Company: Drastic Technologies Ltd.
523 The Queensway, Suite 102
Toronto, ON, M8Y 1J7
CANADA
416 255 5636
fax 255 8780
http://www.drastictech.com
engineering@drastictech.com

Version:
1.0
Author:
not attributable

Field Summary
 java.lang.String szTc
          This string is a global string to solve the problem with older Java MS VM's.
static char TC2_CHAR_100
           
static char TC2_CHAR_2398
           
static char TC2_CHAR_50
           
static char TC2_CHAR_5994
           
static char TC2_CHAR_60
           
static char TC2_CHAR_DF
           
static char TC2_CHAR_FILM
           
static char TC2_CHAR_NDF
           
static char TC2_CHAR_NTSCFILM
           
static char TC2_CHAR_PAL
           
(package private) static int TC2_FIVEMIN_5994
          frames per five minutes in 720p DF
static int TC2_FTYPE_FIELD
          Frame conversion to/from time code is in fields
(package private) static int TC2_HOUR_100
          hundreds of second per hour
(package private) static int TC2_HOUR_50
          frames per hour for 720p PAL
(package private) static int TC2_HOUR_5994
          frames per hour for 720p NTSC DF
(package private) static int TC2_HOUR_60
          frames per hour for 720p NTSC
(package private) static int TC2_HOUR_DROP
          frames per hour in drop frame mode
(package private) static int TC2_HOUR_FILM
          frames per hour in film
(package private) static int TC2_HOUR_NDF
          frames per hour in non-drop mode
(package private) static int TC2_HOUR_PAL
          frames per hour in pal mode
(package private) static int TC2_ILLEGAL
           
static char TC2_MARK_100
           
static char TC2_MARK_2398
           
static char TC2_MARK_50
           
static char TC2_MARK_5994
           
static char TC2_MARK_60
           
static char TC2_MARK_DF
           
static char TC2_MARK_FILM
           
static char TC2_MARK_NDF
           
static char TC2_MARK_NTSCFILM
           
static char TC2_MARK_PAL
           
static int TC2_MIN_STRING_SIZE
          Required size of a timecode string
(package private) static int TC2_MINUTE_100
          hundreds of second per hour
(package private) static int TC2_MINUTE_50
          frames per minute in 720p PAL
(package private) static int TC2_MINUTE_5994
          frames per minute in 720p DF
(package private) static int TC2_MINUTE_60
          frames per minute in 720p NDF
(package private) static int TC2_MINUTE_DROP
          frames per minute in drop frame mode
(package private) static int TC2_MINUTE_FILM
          frames per minute in film
(package private) static int TC2_MINUTE_NDF
          frames per minute in non-drop mode
(package private) static int TC2_MINUTE_PAL
          frames per minute in pal mode
(package private) static int TC2_NTSCFILM_50SECDROP
          50 second drop
(package private) static int TC2_POS_FRAMES
           
(package private) static int TC2_POS_HOURS
           
(package private) static int TC2_POS_MINUTES
           
(package private) static int TC2_POS_SECONDS
           
(package private) static int TC2_SECOND_100
          hundreds of seconds per second
(package private) static int TC2_SECOND_50
          frames per second for 720p PAL
(package private) static int TC2_SECOND_5994
          frames per second for 720p NTSC DF
(package private) static int TC2_SECOND_60
          frames per second for 720p NTSC
(package private) static int TC2_SECOND_DROP
          frames per second for drop frame ntsc
(package private) static int TC2_SECOND_FILM
          frames per second for film
(package private) static int TC2_SECOND_NDF
          frames per second for non drop frame ntsc
(package private) static int TC2_SECOND_PAL
          frames per second for pal
static int TC2_STREXT_ALLCOLON
          No ";" just ":" in the output string
static int TC2_STREXT_CF
          Add CF Flag in BCD
static int TC2_STREXT_FLAG
          Add DF Flag in BCD
static int TC2_STREXT_ISBSTR
          Strings are BSTR (vb mostly)
static int TC2_STREXT_LEADING
          Include leading 0s
static int TC2_STREXT_MARKS
          Add : marks in string
static int TC2_STREXT_MASK
           
static int TC2_STREXT_MAX30
          Max 29 frames for output (24 in PAL)
static int TC2_STREXT_SAVEBITS
          GOP Save unused bits
static int TC2_STREXT_SHIFT7
          GOP Tc is shifted in DWORD
static int TC2_STREXT_TYPE
          Add ' N', ' D', ' P' or ' F' at end;
static int TC2_STRTYPE_ASCII
          Std ascii string
static int TC2_STRTYPE_BCD
          RS-422 BCD or Packed int
static int TC2_STRTYPE_GOP
          MPEG Gop TC
static int TC2_STRTYPE_HEX
          Hex packed int
static int TC2_STRTYPE_INVERT
          Frames first
static int TC2_STRTYPE_MASK
           
static int TC2_STRTYPE_OVER_24_HOUR
          Allow time codes larger then 24 hours - 1 frame
(package private) static int TC2_TCFLAG_CF
           
(package private) static int TC2_TCFLAG_DF
           
static int TC2_TCTYPE_100
          Hundredths of a second HH:MM:SS:/100 100 FPS effective
static int TC2_TCTYPE_2398
          23.98 TRUE (actual 23.98 drop per Avid)
static int TC2_TCTYPE_50
          Double PAL 50 FPS
static int TC2_TCTYPE_5994
          720p DROP 59.94 FPS
static int TC2_TCTYPE_60
          720p 60 FPS
static int TC2_TCTYPE_DF
          Drop Frame 29.97 FPS time code
static int TC2_TCTYPE_FILM
          Film 24 FPS time code
static int TC2_TCTYPE_MASK
           
static int TC2_TCTYPE_NDF
          Non Drop Frame 30 FPS time code
static int TC2_TCTYPE_NTSCFILM
          23.98 FILM for NTSC 23.98 FPS (This is actually 24)
static int TC2_TCTYPE_PAL
          PAL 25 FPS time code
(package private) static int TC2_TENMIN_DROP
          frames per ten minutes in drop frame
 
Constructor Summary
TCXlat()
           
 
Method Summary
 java.lang.String getTCType(long dwTcType)
          Return a short string representation of a time code type
 long tc2Frame(char[] pszTcIn, int dwFlags, long dwTcOut)
          Convert the character array pszTcIn (like "10:02:22:12") to a frame count as specified by dwFlags
 long tc2Frame(java.lang.String strTcIn, int dwFlags, long dwTcOut)
          Convert a time code string (like "10:02:22:12") to a frame count
 int tc2Maximum(int dwFlags)
          Returns the maximum number of frames possible in a given time code type as frames or fields.
 char[] tc2String(long dwTcIn, int dwFlags, char[] pszTcOut)
          Convert the frame count dwTcIn to the string pszTcOut as specified by dwFlags
 int ub2String(int dwUbIn, int dwFlags, byte[] pszUbOut)
          Convert the numeric userbits in dwUbIn to the byte array pszUbOut as specified by dwFlags
 int ub2Value(byte[] pszUbIn, int dwFlags, int dwUbOut)
          Convert the user bit hex string in pszUbIn to the numberic value in dwUbOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

szTc

public java.lang.String szTc
This string is a global string to solve the problem with older Java MS VM's. It is set on each call of the tc2frame function and if the string value passed to the tc2frame function is null it will then set the string to this global value.


TC2_MIN_STRING_SIZE

public static final int TC2_MIN_STRING_SIZE
Required size of a timecode string

See Also:
Constant Field Values

TC2_TCTYPE_MASK

public static final int TC2_TCTYPE_MASK
See Also:
Constant Field Values

TC2_TCTYPE_FILM

public static final int TC2_TCTYPE_FILM
Film 24 FPS time code

See Also:
Constant Field Values

TC2_MARK_FILM

public static final char TC2_MARK_FILM
See Also:
Constant Field Values

TC2_CHAR_FILM

public static final char TC2_CHAR_FILM
See Also:
Constant Field Values

TC2_TCTYPE_NDF

public static final int TC2_TCTYPE_NDF
Non Drop Frame 30 FPS time code

See Also:
Constant Field Values

TC2_MARK_NDF

public static final char TC2_MARK_NDF
See Also:
Constant Field Values

TC2_CHAR_NDF

public static final char TC2_CHAR_NDF
See Also:
Constant Field Values

TC2_TCTYPE_DF

public static final int TC2_TCTYPE_DF
Drop Frame 29.97 FPS time code

See Also:
Constant Field Values

TC2_MARK_DF

public static final char TC2_MARK_DF
See Also:
Constant Field Values

TC2_CHAR_DF

public static final char TC2_CHAR_DF
See Also:
Constant Field Values

TC2_TCTYPE_PAL

public static final int TC2_TCTYPE_PAL
PAL 25 FPS time code

See Also:
Constant Field Values

TC2_MARK_PAL

public static final char TC2_MARK_PAL
See Also:
Constant Field Values

TC2_CHAR_PAL

public static final char TC2_CHAR_PAL
See Also:
Constant Field Values

TC2_TCTYPE_50

public static final int TC2_TCTYPE_50
Double PAL 50 FPS

See Also:
Constant Field Values

TC2_MARK_50

public static final char TC2_MARK_50
See Also:
Constant Field Values

TC2_CHAR_50

public static final char TC2_CHAR_50
See Also:
Constant Field Values

TC2_TCTYPE_5994

public static final int TC2_TCTYPE_5994
720p DROP 59.94 FPS

See Also:
Constant Field Values

TC2_MARK_5994

public static final char TC2_MARK_5994
See Also:
Constant Field Values

TC2_CHAR_5994

public static final char TC2_CHAR_5994
See Also:
Constant Field Values

TC2_TCTYPE_60

public static final int TC2_TCTYPE_60
720p 60 FPS

See Also:
Constant Field Values

TC2_MARK_60

public static final char TC2_MARK_60
See Also:
Constant Field Values

TC2_CHAR_60

public static final char TC2_CHAR_60
See Also:
Constant Field Values

TC2_TCTYPE_NTSCFILM

public static final int TC2_TCTYPE_NTSCFILM
23.98 FILM for NTSC 23.98 FPS (This is actually 24)

See Also:
Constant Field Values

TC2_MARK_NTSCFILM

public static final char TC2_MARK_NTSCFILM
See Also:
Constant Field Values

TC2_CHAR_NTSCFILM

public static final char TC2_CHAR_NTSCFILM
See Also:
Constant Field Values

TC2_TCTYPE_2398

public static final int TC2_TCTYPE_2398
23.98 TRUE (actual 23.98 drop per Avid)

See Also:
Constant Field Values

TC2_MARK_2398

public static final char TC2_MARK_2398
See Also:
Constant Field Values

TC2_CHAR_2398

public static final char TC2_CHAR_2398
See Also:
Constant Field Values

TC2_TCTYPE_100

public static final int TC2_TCTYPE_100
Hundredths of a second HH:MM:SS:/100 100 FPS effective

See Also:
Constant Field Values

TC2_MARK_100

public static final char TC2_MARK_100
See Also:
Constant Field Values

TC2_CHAR_100

public static final char TC2_CHAR_100
See Also:
Constant Field Values

TC2_FTYPE_FIELD

public static final int TC2_FTYPE_FIELD
Frame conversion to/from time code is in fields

See Also:
Constant Field Values

TC2_STRTYPE_MASK

public static final int TC2_STRTYPE_MASK
See Also:
Constant Field Values

TC2_STRTYPE_ASCII

public static final int TC2_STRTYPE_ASCII
Std ascii string

See Also:
Constant Field Values

TC2_STRTYPE_BCD

public static final int TC2_STRTYPE_BCD
RS-422 BCD or Packed int

See Also:
Constant Field Values

TC2_STRTYPE_HEX

public static final int TC2_STRTYPE_HEX
Hex packed int

See Also:
Constant Field Values

TC2_STRTYPE_GOP

public static final int TC2_STRTYPE_GOP
MPEG Gop TC

See Also:
Constant Field Values

TC2_STRTYPE_INVERT

public static final int TC2_STRTYPE_INVERT
Frames first

See Also:
Constant Field Values

TC2_STRTYPE_OVER_24_HOUR

public static final int TC2_STRTYPE_OVER_24_HOUR
Allow time codes larger then 24 hours - 1 frame

See Also:
Constant Field Values

TC2_STREXT_MASK

public static final int TC2_STREXT_MASK
See Also:
Constant Field Values

TC2_STREXT_MARKS

public static final int TC2_STREXT_MARKS
Add : marks in string

See Also:
Constant Field Values

TC2_STREXT_LEADING

public static final int TC2_STREXT_LEADING
Include leading 0s

See Also:
Constant Field Values

TC2_STREXT_TYPE

public static final int TC2_STREXT_TYPE
Add ' N', ' D', ' P' or ' F' at end;

See Also:
Constant Field Values

TC2_STREXT_ALLCOLON

public static final int TC2_STREXT_ALLCOLON
No ";" just ":" in the output string

See Also:
Constant Field Values

TC2_STREXT_FLAG

public static final int TC2_STREXT_FLAG
Add DF Flag in BCD

See Also:
Constant Field Values

TC2_STREXT_CF

public static final int TC2_STREXT_CF
Add CF Flag in BCD

See Also:
Constant Field Values

TC2_STREXT_MAX30

public static final int TC2_STREXT_MAX30
Max 29 frames for output (24 in PAL)

See Also:
Constant Field Values

TC2_STREXT_ISBSTR

public static final int TC2_STREXT_ISBSTR
Strings are BSTR (vb mostly)

See Also:
Constant Field Values

TC2_STREXT_SHIFT7

public static final int TC2_STREXT_SHIFT7
GOP Tc is shifted in DWORD

See Also:
Constant Field Values

TC2_STREXT_SAVEBITS

public static final int TC2_STREXT_SAVEBITS
GOP Save unused bits

See Also:
Constant Field Values

TC2_ILLEGAL

static final int TC2_ILLEGAL
See Also:
Constant Field Values

TC2_POS_HOURS

static final int TC2_POS_HOURS
See Also:
Constant Field Values

TC2_POS_MINUTES

static final int TC2_POS_MINUTES
See Also:
Constant Field Values

TC2_POS_SECONDS

static final int TC2_POS_SECONDS
See Also:
Constant Field Values

TC2_POS_FRAMES

static final int TC2_POS_FRAMES
See Also:
Constant Field Values

TC2_TCFLAG_DF

static final int TC2_TCFLAG_DF
See Also:
Constant Field Values

TC2_TCFLAG_CF

static final int TC2_TCFLAG_CF
See Also:
Constant Field Values

TC2_HOUR_NDF

static final int TC2_HOUR_NDF
frames per hour in non-drop mode

See Also:
Constant Field Values

TC2_HOUR_DROP

static final int TC2_HOUR_DROP
frames per hour in drop frame mode

See Also:
Constant Field Values

TC2_HOUR_PAL

static final int TC2_HOUR_PAL
frames per hour in pal mode

See Also:
Constant Field Values

TC2_HOUR_FILM

static final int TC2_HOUR_FILM
frames per hour in film

See Also:
Constant Field Values

TC2_HOUR_50

static final int TC2_HOUR_50
frames per hour for 720p PAL

See Also:
Constant Field Values

TC2_HOUR_5994

static final int TC2_HOUR_5994
frames per hour for 720p NTSC DF

See Also:
Constant Field Values

TC2_HOUR_60

static final int TC2_HOUR_60
frames per hour for 720p NTSC

See Also:
Constant Field Values

TC2_HOUR_100

static final int TC2_HOUR_100
hundreds of second per hour

See Also:
Constant Field Values

TC2_MINUTE_NDF

static final int TC2_MINUTE_NDF
frames per minute in non-drop mode

See Also:
Constant Field Values

TC2_TENMIN_DROP

static final int TC2_TENMIN_DROP
frames per ten minutes in drop frame

See Also:
Constant Field Values

TC2_MINUTE_DROP

static final int TC2_MINUTE_DROP
frames per minute in drop frame mode

See Also:
Constant Field Values

TC2_MINUTE_PAL

static final int TC2_MINUTE_PAL
frames per minute in pal mode

See Also:
Constant Field Values

TC2_MINUTE_FILM

static final int TC2_MINUTE_FILM
frames per minute in film

See Also:
Constant Field Values

TC2_MINUTE_50

static final int TC2_MINUTE_50
frames per minute in 720p PAL

See Also:
Constant Field Values

TC2_FIVEMIN_5994

static final int TC2_FIVEMIN_5994
frames per five minutes in 720p DF

See Also:
Constant Field Values

TC2_MINUTE_5994

static final int TC2_MINUTE_5994
frames per minute in 720p DF

See Also:
Constant Field Values

TC2_MINUTE_60

static final int TC2_MINUTE_60
frames per minute in 720p NDF

See Also:
Constant Field Values

TC2_MINUTE_100

static final int TC2_MINUTE_100
hundreds of second per hour

See Also:
Constant Field Values

TC2_SECOND_NDF

static final int TC2_SECOND_NDF
frames per second for non drop frame ntsc

See Also:
Constant Field Values

TC2_SECOND_DROP

static final int TC2_SECOND_DROP
frames per second for drop frame ntsc

See Also:
Constant Field Values

TC2_SECOND_PAL

static final int TC2_SECOND_PAL
frames per second for pal

See Also:
Constant Field Values

TC2_SECOND_FILM

static final int TC2_SECOND_FILM
frames per second for film

See Also:
Constant Field Values

TC2_SECOND_50

static final int TC2_SECOND_50
frames per second for 720p PAL

See Also:
Constant Field Values

TC2_SECOND_5994

static final int TC2_SECOND_5994
frames per second for 720p NTSC DF

See Also:
Constant Field Values

TC2_SECOND_60

static final int TC2_SECOND_60
frames per second for 720p NTSC

See Also:
Constant Field Values

TC2_SECOND_100

static final int TC2_SECOND_100
hundreds of seconds per second

See Also:
Constant Field Values

TC2_NTSCFILM_50SECDROP

static final int TC2_NTSCFILM_50SECDROP
50 second drop

See Also:
Constant Field Values
Constructor Detail

TCXlat

public TCXlat()
Method Detail

tc2Maximum

public int tc2Maximum(int dwFlags)
Returns the maximum number of frames possible in a given time code type as frames or fields.

Parameters:
dwFlags - int Time code type flags (TC2_TCTYPE_xxx) and optional TC2_FTYPE_FIELD flag.
Returns:
int the last possible frame in the time code type

tc2String

public char[] tc2String(long dwTcIn,
                        int dwFlags,
                        char[] pszTcOut)
Convert the frame count dwTcIn to the string pszTcOut as specified by dwFlags

Parameters:
dwTcIn - long number of frames, zero based
dwFlags - int TC2_TCTYPE, TC2_STREXT and other TC2 formatring flags
pszTcOut - char[] String legacy representation of the frame time code
Returns:
char[] String returned

tc2Frame

public long tc2Frame(java.lang.String strTcIn,
                     int dwFlags,
                     long dwTcOut)
Convert a time code string (like "10:02:22:12") to a frame count

Parameters:
strTcIn - String the time code string
dwFlags - int TC2_TCTYPE_xxx time code type (DF, NDF, PAL, etc)
dwTcOut - long legacy frame count out
Returns:
long frame count

tc2Frame

public long tc2Frame(char[] pszTcIn,
                     int dwFlags,
                     long dwTcOut)
Convert the character array pszTcIn (like "10:02:22:12") to a frame count as specified by dwFlags

Parameters:
pszTcIn - char[] String the time code string
dwFlags - int TC2_TCTYPE_xxx time code type (DF, NDF, PAL, etc)
dwTcOut - long legacy frame count out
Returns:
long frame count

ub2String

public int ub2String(int dwUbIn,
                     int dwFlags,
                     byte[] pszUbOut)
Convert the numeric userbits in dwUbIn to the byte array pszUbOut as specified by dwFlags

Parameters:
dwUbIn - int user bits numberic value
dwFlags - int TC2_flags, not currently used
pszUbOut - byte[] string character output
Returns:
int 0 if successful

ub2Value

public int ub2Value(byte[] pszUbIn,
                    int dwFlags,
                    int dwUbOut)
Convert the user bit hex string in pszUbIn to the numberic value in dwUbOut

Parameters:
pszUbIn - byte[] Hex string (like "A034C8D2")
dwFlags - int TC2_flags, not currently used
dwUbOut - int legacy numeric value
Returns:
int hex string numeric value

getTCType

public java.lang.String getTCType(long dwTcType)
Return a short string representation of a time code type

Parameters:
dwTcType - long TC2_TCTYPE_xxx flag
Returns:
String short name of time code type