78 return time / TIME_SCALE_sec / 60 / 60;
84 return (
time / TIME_SCALE_sec / 60) % 60;
90 return (
time / TIME_SCALE_sec) % 60;
96 return (
time / TIME_SCALE_ms) % 1000;
129 int frames = FRAMES + 30*SECONDS + 30*60*MINUTES + 30*60*60*HOURS;
130 int minutes_to_drop_frames = (MINUTES - MINUTES/10) + (HOURS * 54);
131 frames -= 2*minutes_to_drop_frames;
132 int64_t expectedMillis = 1000LL * frames * 1001/30000;
134 expectedMillis %= 1000;
135 CHECK (time_millis (t) == expectedMillis);
137 CHECK (time_seconds (t) == SECONDS);
138 CHECK (time_minutes (t) == MINUTES);
139 CHECK (time_hours (t) == HOURS);
143 CHECK (dropframe_frames (t) == FRAMES);
156 for (
int hrs = 0; hrs <= 24; hrs += 6)
157 for (
int min = 0; min <= 59; min += 1)
158 for (
int sec = 0; sec <= 59; sec += 10)
159 for (
int frame = 0; frame <= 29; frame++)
162 if (min % 10 and sec == 0 and frame < 2)
174 CHECK (dropframe_frames (t) == frame);
175 CHECK (dropframe_seconds (t) == sec);
176 CHECK (dropframe_minutes (t) == min);
177 CHECK (dropframe_hours (t) == hrs % 24);
181 for (
int i = 0; i < 59; i++)
183 int frame = (i % 10 == 0) ? 0 : 2;
185 CHECK (dropframe_frames (t) == frame);
static const raw_time_64 SCALE
Number of micro ticks (µs) per second as basic time scale.
a mutable time value, behaving like a plain number, allowing copy and re-accessing
Lumiera's internal time value datatype.
void verify_DropFrame_conv()
void verify_completeMapping()
Calculations to support mapping into NTSC drop frame timecode.
int time_millis(raw_time_64 time)
int dropframe_seconds(raw_time_64 timecode)
int time_seconds(raw_time_64 time)
int dropframe_minutes(raw_time_64 timecode)
int dropframe_hours(raw_time_64 timecode)
int time_minutes(raw_time_64 time)
int dropframe_frames(raw_time_64 timecode)
int time_hours(raw_time_64 time)
raw_time_64 build_time_from_ntsc_drop_frame(uint frames, uint secs, uint mins, uint hours)
Build effective time from a NTSC drop frame timecode.
int64_t raw_time_64
Raw µ-tick time representation used in Lumiera.
int64_t calculate_ntsc_drop_frame_number(raw_time_64 time)
Compute the consecutive frame number from a given time, which is interpreted at the NTSC drop frame t...
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
a family of time value like entities and their relationships.