Description

Flicks module for node.js and commonjs.

Details

Members


<static> _ratio

Description

A shorthand method for referencing the ratio of seconds to Flicks: 1 / 705600000 = 1.4172335600907028e-9

Details

<static> _per_second

Description

A shorthand method for referencing Flicks/second that is also used to test the lookup table. It is probably a couple nanoseconds faster than parsing the object.
Its value is 705600000

Details

<static> _LU

Description

Helper object as a lookup table to speed reference that uses the most common frequencies.

Details

<static> _SI

Description

Helper object of Flicks references using US American (not European) naming conventions for SI prefixes of kilo, mega, giga, tera, etc.

Details

Methods


<static> _tickify( ticks ) → {array}

Description

Returns an array of the number of Flicks in SI units of kilo, mega, giga, terra, peta (units of 1000s) As in: [1204000, '1204 kF', '1204 kilo-Flicks']

Parameters
Name Type Description
ticks number

a positive integer as a whole number

Returns
Examples
 _tickify(120400)
Details

<static> _parity( seconds ) → {boolean}

Description

Checks that the number of Flicks (in parameterized seconds) is a whole number. This is useful if you have a timestamp like 12.234152

Parameters
Name Type Description
seconds number

Can include decimals, can be negative

Returns
Examples
 _parity(16.3452)
Throws

"Not a whole number of flicks" if the decimal amount of seconds cannot be divided into flicks.

"@param mismatch" if the typeof seconds is not a number.

Details

<static> in_seconds( seconds ) → {number}

Description

Gives the number of Flicks in requested number of seconds

Parameters
Name Type Description
seconds number

can include decimals

Returns
Throws

@param mismatch if NAN

Details

<static> per_frame( framerate ) → {number}

Description

Returns the number of Flicks per tick according to frequency - can be used as an alternative to the lookup table. Benchmarking has shown there not to be a negligible difference in speed.

Parameters
Name Type Description
framerate number

must be a number

Returns
Throws

@param mismatch if NAN

Details

<static> computed_length( ticks, frequency ) → {number}

Description

Returns the number of Flicks according to ticks and frequency.

Parameters
Name Type Description
ticks number

total number of ticks

frequency number

the cyclic ratio as a whole number e.g. 30

Returns
Details

<static> to_timecode( flicks, frequency, json ) → {string|object}

Description

This creates a timecode in the form of hh:mm:ss.ff(ffff) by being given Flicks in either short of long-form.

Parameters
Name Type Description
flicks *

number of flicks to encode as timecode, in either long form (as a number) or short-form (as a string)

frequency number

the cyclic rate per second

json boolean

return as timecode or as object in the form {"hours":"hh","minutes":"mm","seconds":"ss","frames":"ff"}

Returns
Throws

Not well formed.

Details