Packageorg.as3lib.kitchensync.utils
Classpublic class TimestampUtil

Provides helpful utility functions for working with Timestamp objects.

See also

Timestamp
Synchronizer


Public Methods
 MethodDefined by
  
add(timestampA:Timestamp, timestampB:Timestamp):Timestamp
[static] Adds the two timestamps and returns a new one that is the sum of the two times.
TimestampUtil
  
framesToMilliseconds(frames:int):int
[static] Convert frames to milliseconds based on the framerate of the Synchronizer.
TimestampUtil
  
[static]
TimestampUtil
  
[static]
TimestampUtil
  
millisecondsToFrames(milliseconds:int):int
[static] Convert milliseconds to frames based on the framerate of the Synchronizer.
TimestampUtil
  
subtract(timestampA:Timestamp, timestampB:Timestamp):Timestamp
[static] Subtracts timestampB from timestampA and returns the difference of the two times.
TimestampUtil
Method detail
add()method
public static function add(timestampA:Timestamp, timestampB:Timestamp):Timestamp

Adds the two timestamps and returns a new one that is the sum of the two times.

Parameters
timestampA:Timestamp
 
timestampB:Timestamp

Returns
Timestamp — the sum of timestampA and timestampB
framesToMilliseconds()method 
public static function framesToMilliseconds(frames:int):int

Convert frames to milliseconds based on the framerate of the Synchronizer.

Parameters
frames:int — - the number in frames to convert

Returns
int — the result in milliseconds

See also

getTimestampFromFrames()method 
public static function getTimestampFromFrames(frames:int):TimestampParameters
frames:int

Returns
Timestamp
getTimestampFromMilliseconds()method 
public static function getTimestampFromMilliseconds(milliseconds:int):TimestampParameters
milliseconds:int

Returns
Timestamp
millisecondsToFrames()method 
public static function millisecondsToFrames(milliseconds:int):int

Convert milliseconds to frames based on the framerate of the Synchronizer.

Parameters
milliseconds:int — - the number in milliseconds to convert

Returns
int — the result rounded to the nearest frame

See also

subtract()method 
public static function subtract(timestampA:Timestamp, timestampB:Timestamp):Timestamp

Subtracts timestampB from timestampA and returns the difference of the two times.

Parameters
timestampA:Timestamp — - the timstamp to subtract from.
 
timestampB:Timestamp — - the ammount of time to subtract from timestampA.

Returns
Timestamp — the difference between timestampA and timestampB