30using boost::lexical_cast;
54 return toString(frameNr)+
"#";
98 string srcCode = generateRandomFrameNr();
122 CHECK (5 == frames2 - frames1);
127 CHECK (srcCode ==
string(frames1));
128 CHECK (srcCode !=
string(frames2));
140 cout << timecode.describe()<<
"=\""<<timecode<<
"\" time = "<< timecode.getTime() << endl;
146 UNIMPLEMENTED (
"verify frame count time format");
153 UNIMPLEMENTED (
"verify fractional seconds as timecode format");
160 UNIMPLEMENTED (
"verify hour-minutes-seconds-millis timecode");
177 Time raw(555,23,42,5);
181 cout <<
"----SMPTE-----" << endl;
183 CHECK (
" 5:42:23:13" ==
string(smpte));
185 CHECK (13 == smpte.
frames);
186 CHECK (23 == smpte.
secs);
187 CHECK (42 == smpte.
mins);
188 CHECK ( 5 == smpte.
hours);
189 CHECK ( 1 == smpte.
sgn);
190 CHECK (
"SMPTE" == smpte.
describe());
193 CHECK (
" 5:42:23:14" ==
string(smpte));
195 CHECK (
" 5:42:24:01" ==
string(smpte));
197 CHECK (
" 5:40:00:01" ==
string(smpte));
198 CHECK (smpte.
mins-- == 40);
199 CHECK (--smpte.
mins == 38);
200 CHECK (
" 5:38:00:01" ==
string(smpte));
207 CHECK (
"- 0:21:59:24"==
string(smpte));
210 CHECK (-1 == smpte.
sgn);
211 CHECK (smpte.
mins > 0);
212 CHECK (smpte.
secs > 0);
216 CHECK (
"- 0:22:00:00"==
string(smpte));
217 CHECK (smpte.
getTime() == tx -
Time(1000/25,0,0,0));
219 CHECK (
"- 0:21:59:24"==
string(smpte));
224 CHECK (
" 1:38:00:01"==
string(smpte));
225 CHECK (+1 == smpte.
sgn);
228 smpte.
secs -= 2*60*60;
230 CHECK (
"- 0:21:59:24"==
string(smpte));
233 CHECK (
" 0:21:59:24"==
string(smpte));
234 CHECK (tx == -smpte.
getTime());
235 CHECK (+1 == smpte.
sgn);
238 CHECK (smpte.
secs == 61);
239 CHECK (smpte.
getTime() ==
Time(1000*24/25, 01, 22));
240 CHECK (smpte.
secs == 61);
241 CHECK (
" 0:21:61:24"==
string(smpte));
243 CHECK (smpte.
secs == 1);
244 CHECK (smpte.
mins == 22);
245 CHECK (
" 0:22:01:24"==
string(smpte));
248 CHECK (
" 0:22:01:25"==
string(smpte));
250 CHECK (
"- 0:37:58:00"==
string(smpte));
256 CHECK (
"--2:59:61:-26"==
string(smpte));
260 CHECK (
" 1:00:00:01"==
string(smpte));
266 CHECK (
" 1:00:00:-1"==
string(smpte));
268 CHECK (
"--1:00:00:01"==
string(smpte));
276 UNIMPLEMENTED (
"verify especially SMPTE-drop-frame timecode");
283 UNIMPLEMENTED (
"verify Timecode values can be copied and assigned properly");
void setValueRaw(NUM newVal)
A frame counting timecode value.
static const FrameRate PAL
predefined constant for PAL framerate
static EncapsulatedMutation nudge(int adjustment)
build a time mutation to nudge the target time value by an offset, defined as number of steps on an i...
static EncapsulatedMutation changeTime(Time)
Convenience factory to yield a simple Mutation changing the absolute start time.
grid aligned time specification, referring to a specific scale.
void accept(Mutation const &)
receive change message, which might cause re-quantisation
format::Traits< FMT >::TimeCode formatAs() const
create new time code instance, then castInto
static PQuant retrieve(Symbol gridID)
Access an existing grid definition or quantiser, known by the given symbolic ID.
Classical Timecode value reminiscent to SMPTE format.
void invertOrientation()
flip the orientation of min, sec, and frames.
basic constant internal time value.
a mutable time value, behaving like a plain number, allowing copy and re-accessing
Lumiera's internal time value datatype.
Modifying time and timecode values.
int64_t FrameCnt
relative framecount or frame number.
std::shared_ptr< const Quantiser > PQuant
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Implementation namespace for support and library code.
int rani(uint bound=_iBOUND())
Test runner and basic definitions for tests.
std::string toString(TY const &val) noexcept
get some string representation of any object, reliably.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
To establish a reference scale for quantised time values.
Timecode handling library This header defines the foundation interface TCode to represent a grid alig...
Support library to represent grid-aligned time specifications This is part of Lumiera's time and time...
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...