Lumiera  0.pre.03
»edit your freedom«
Seconds Struct Reference

#include "lib/time/formats.hpp"

Description

Simple timecode specification as fractional seconds.

Similar to HMS, a specification of seconds is quantisation agnostic, but usually some implicit quantisation is used anyway, be it on actual data frames, audio frames, or just on some smaller time interval, e.g. full milliseconds.

Note
Seconds is implemented as rational number and thus uses decimal format, not the usual sexagesimal time format

Definition at line 135 of file formats.hpp.

Static Public Member Functions

static TimeValue evaluate (Secs const &, QuantR)
 
static TimeValue parse (string const &, QuantR)
 try to parse a time specification in seconds or fractional seconds. More...
 
static void rebuild (Secs &, QuantR, TimeValue const &)
 

Additional Inherited Members

- Public Member Functions inherited from NoInstance< X >
 NoInstance (NoInstance const &)
 

Member Function Documentation

◆ parse()

TimeValue parse ( string const &  seconds,
QuantR  grid 
)
static

try to parse a time specification in seconds or fractional seconds.

The value is interpreted relative to the origin of a the given time grid This parser recognises full seconds, fractional seconds and both together. In any case, the actual number is required to end with a trailing 'sec'

Example specifications
       12sec       -->  12     * TimeValue::SCALE
       -4sec       --> -4      * TimeValue::SCALE
       5/4sec      -->  1.25   * TimeValue::SCALE
       -5/25sec    --> -0.2    * TimeValue::SCALE
       1+1/2sec    -->  1.5    * TimeValue::SCALE
       1-1/25sec   -->  0.96   * TimeValue::SCALE
       -12-1/4sec  --> -11.75  * TimeValue::SCALE
Parameters
secondsstring containing a time spec in seconds
gridcoordinate system the parsed value is based on
Returns
the corresponding (opaque internal) lumiera time value
Exceptions
error::Invalidin case of parsing failure
Note
the string may contain any additional content, as long as a regular-expression search is able to pick out a suitable value

Definition at line 122 of file timecode.cpp.

+ Inheritance diagram for Seconds:
+ Collaboration diagram for Seconds:

The documentation for this struct was generated from the following files: