fix some further 32/64bit problems
- use the C99 qualifier for size_t ('z') in printf
- use Long Long number literals in GUI timeline ruler
This commit is contained in:
parent
1b50665a2b
commit
1b5de947b1
13 changed files with 87 additions and 60 deletions
|
|
@ -511,12 +511,12 @@ TimelineRuler::calculate_major_spacing() const
|
||||||
15l * GAVL_TIME_SCALE,
|
15l * GAVL_TIME_SCALE,
|
||||||
30l * GAVL_TIME_SCALE,
|
30l * GAVL_TIME_SCALE,
|
||||||
60l * GAVL_TIME_SCALE,
|
60l * GAVL_TIME_SCALE,
|
||||||
2l * 60l * GAVL_TIME_SCALE,
|
2ll * 60ll * GAVL_TIME_SCALE,
|
||||||
5l * 60l * GAVL_TIME_SCALE,
|
5ll * 60ll * GAVL_TIME_SCALE,
|
||||||
10l * 60l * GAVL_TIME_SCALE,
|
10ll * 60ll * GAVL_TIME_SCALE,
|
||||||
15l * 60l * GAVL_TIME_SCALE,
|
15ll * 60ll * GAVL_TIME_SCALE,
|
||||||
30l * 60l * GAVL_TIME_SCALE,
|
30ll * 60ll * GAVL_TIME_SCALE,
|
||||||
60l * 60l * GAVL_TIME_SCALE
|
60ll * 60ll * GAVL_TIME_SCALE
|
||||||
};
|
};
|
||||||
|
|
||||||
for(i = 0; i < sizeof(major_spacings) / sizeof(gavl_time_t); i++)
|
for(i = 0; i < sizeof(major_spacings) / sizeof(gavl_time_t); i++)
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ lumiera_frame_duration (FrameRate const& fps)
|
||||||
|
|
||||||
namespace { // implementation helper
|
namespace { // implementation helper
|
||||||
|
|
||||||
inline long
|
inline long long
|
||||||
calculate_quantisation (gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
|
calculate_quantisation (gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
|
||||||
{
|
{
|
||||||
time -= origin;
|
time -= origin;
|
||||||
|
|
@ -105,9 +105,11 @@ namespace { // implementation helper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long
|
int64_t
|
||||||
lumiera_quantise_frames (gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
|
lumiera_quantise_frames (gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
|
||||||
{
|
{
|
||||||
|
ENSURE (sizeof(int64_t) <= sizeof(long long));
|
||||||
|
|
||||||
return calculate_quantisation (time, origin, grid);
|
return calculate_quantisation (time, origin, grid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ lumiera_tmpbuf_print_time (gavl_time_t time);
|
||||||
* @return number of the grid interval containing the given time.
|
* @return number of the grid interval containing the given time.
|
||||||
* @warning the resulting value is limited to (Time::Min, Time::MAX)
|
* @warning the resulting value is limited to (Time::Min, Time::MAX)
|
||||||
*/
|
*/
|
||||||
long
|
int64_t
|
||||||
lumiera_quantise_frames (gavl_time_t time, gavl_time_t origin, gavl_time_t grid);
|
lumiera_quantise_frames (gavl_time_t time, gavl_time_t origin, gavl_time_t grid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <tr1/functional>
|
#include <tr1/functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdio>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
@ -126,7 +127,7 @@ namespace time {
|
||||||
{
|
{
|
||||||
size_t space = std::snprintf (printbuffer_, bufsiz, formatSpec_, val);
|
size_t space = std::snprintf (printbuffer_, bufsiz, formatSpec_, val);
|
||||||
REQUIRE (space < bufsiz, "Digxel value exceeded available buffer size. "
|
REQUIRE (space < bufsiz, "Digxel value exceeded available buffer size. "
|
||||||
"For showing %s, %lu+1 chars instead of just %lu+1 would be required."
|
"For showing %s, %zu+1 chars instead of just %zu+1 would be required."
|
||||||
, cStr(lexical_cast<string>(val)), space, len); ///////////TICKET #197
|
, cStr(lexical_cast<string>(val)), space, len); ///////////TICKET #197
|
||||||
}
|
}
|
||||||
ENSURE (!empty());
|
ENSURE (!empty());
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,9 @@ namespace time {
|
||||||
/// direct assignment prohibited
|
/// direct assignment prohibited
|
||||||
Time& operator= (Time const);
|
Time& operator= (Time const);
|
||||||
|
|
||||||
|
/// suppress possible direct conversions
|
||||||
|
Time(int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const Time MAX ;
|
static const Time MAX ;
|
||||||
static const Time MIN ;
|
static const Time MIN ;
|
||||||
|
|
@ -269,6 +272,7 @@ namespace time {
|
||||||
: TimeValue(calcResult)
|
: TimeValue(calcResult)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
explicit
|
||||||
Time (FSecs const& fractionalSeconds);
|
Time (FSecs const& fractionalSeconds);
|
||||||
|
|
||||||
Time ( long millis
|
Time ( long millis
|
||||||
|
|
@ -314,6 +318,11 @@ namespace time {
|
||||||
: Offset(Offset(timeSpec).abs())
|
: Offset(Offset(timeSpec).abs())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
explicit
|
||||||
|
Duration (FSecs const& timeSpan_in_secs)
|
||||||
|
: Offset(Offset(Time(timeSpan_in_secs)).abs())
|
||||||
|
{ }
|
||||||
|
|
||||||
Duration (TimeSpan const& interval);
|
Duration (TimeSpan const& interval);
|
||||||
Duration (ulong count, FrameRate const& fps);
|
Duration (ulong count, FrameRate const& fps);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,15 @@ namespace util {
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct IDiv<long long>
|
||||||
|
: lldiv_t
|
||||||
|
{
|
||||||
|
IDiv<long long> (long long num, long long den)
|
||||||
|
: lldiv_t(lldiv (num,den))
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/** floor function for integer arithmetics.
|
/** floor function for integer arithmetics.
|
||||||
* Unlike the built-in integer division, this function
|
* Unlike the built-in integer division, this function
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ namespace meta {
|
||||||
PGrid
|
PGrid
|
||||||
TimeGrid::build (Symbol gridID, FrameRate frames_per_second)
|
TimeGrid::build (Symbol gridID, FrameRate frames_per_second)
|
||||||
{
|
{
|
||||||
return build (gridID,frames_per_second, Time(0));
|
return build (gridID,frames_per_second, Time(0,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ out: TestSubMO1\(ID= [0-9]{3}\)
|
||||||
out: TestSubMO2\(ID= [0-9]{3}\)
|
out: TestSubMO2\(ID= [0-9]{3}\)
|
||||||
out: TestSubMO21\(ID= [0-9]{3}\)
|
out: TestSubMO21\(ID= [0-9]{3}\)
|
||||||
out: specialAPI()
|
out: specialAPI()
|
||||||
out: pID\(\w{8,16}\)
|
out: pID\(\w{6,16}\)
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ namespace test {
|
||||||
GridBuilder spec = asset::Meta::create (myGrID);
|
GridBuilder spec = asset::Meta::create (myGrID);
|
||||||
|
|
||||||
CHECK ( spec.fps_ == 1);
|
CHECK ( spec.fps_ == 1);
|
||||||
CHECK ( spec.origin_ == Time(0));
|
CHECK ( spec.origin_ == TimeValue(0));
|
||||||
CHECK (!spec.predecessor_);
|
CHECK (!spec.predecessor_);
|
||||||
|
|
||||||
spec.fps_ = testFps;
|
spec.fps_ = testFps;
|
||||||
|
|
@ -118,8 +118,8 @@ namespace test {
|
||||||
CHECK (!util::isnil (simplePALGrid->ident.name)); // note: name-ID filled in automatically
|
CHECK (!util::isnil (simplePALGrid->ident.name)); // note: name-ID filled in automatically
|
||||||
cout << "simple PAL Grid: " << simplePALGrid->ident << endl;
|
cout << "simple PAL Grid: " << simplePALGrid->ident << endl;
|
||||||
|
|
||||||
CHECK (Time(2) == simplePALGrid->timeOf(50));
|
CHECK (Time(0,2) == simplePALGrid->timeOf(50));
|
||||||
CHECK (Time(2) == simplePALGrid->timeOf(FSecs(2)));
|
CHECK (Time(0,2) == simplePALGrid->timeOf(FSecs(2)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,13 @@ namespace test{
|
||||||
const uint MAX_FRAMES = 25*500;
|
const uint MAX_FRAMES = 25*500;
|
||||||
const uint DIRT_GRAIN = 50;
|
const uint DIRT_GRAIN = 50;
|
||||||
|
|
||||||
const FSecs F25(1,25); // duration of one PAL frame
|
const FSecs F25(1,25); // duration of one PAL frame
|
||||||
|
|
||||||
|
inline Time
|
||||||
|
secs (int seconds)
|
||||||
|
{
|
||||||
|
return Time(FSecs(seconds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,7 +90,7 @@ namespace test{
|
||||||
uint frames = (rand() % MAX_FRAMES);
|
uint frames = (rand() % MAX_FRAMES);
|
||||||
FSecs dirt = (F25 / (rand() % DIRT_GRAIN));
|
FSecs dirt = (F25 / (rand() % DIRT_GRAIN));
|
||||||
|
|
||||||
Time rawTime = dirt + frames*F25;
|
Time rawTime (dirt + frames*F25);
|
||||||
|
|
||||||
CHECK (Time( frames *F25) <= rawTime);
|
CHECK (Time( frames *F25) <= rawTime);
|
||||||
CHECK (Time((frames+1)*F25) > rawTime);
|
CHECK (Time((frames+1)*F25) > rawTime);
|
||||||
|
|
@ -152,51 +158,51 @@ namespace test{
|
||||||
{
|
{
|
||||||
// origin at lower end of the time range
|
// origin at lower end of the time range
|
||||||
FixedFrameQuantiser case1 (1, Time::MIN);
|
FixedFrameQuantiser case1 (1, Time::MIN);
|
||||||
CHECK (Time(0) == case1.gridAlign(Time::MIN ));
|
CHECK (secs(0) == case1.gridAlign(Time::MIN ));
|
||||||
CHECK (Time(0) == case1.gridAlign(Time::MIN +TimeValue(1) ));
|
CHECK (secs(0) == case1.gridAlign(Time::MIN +TimeValue(1) ));
|
||||||
CHECK (Time(1) == case1.gridAlign(Time::MIN +Time(1) ));
|
CHECK (secs(1) == case1.gridAlign(Time::MIN +secs(1) ));
|
||||||
CHECK (Time::MAX -Time(1) > case1.gridAlign( Time(-1) ));
|
CHECK (Time::MAX -secs(1) > case1.gridAlign( secs(-1) ));
|
||||||
CHECK (Time::MAX -Time(1) <= case1.gridAlign( Time (0) ));
|
CHECK (Time::MAX -secs(1) <= case1.gridAlign( secs (0) ));
|
||||||
CHECK (Time::MAX > case1.gridAlign( Time (0) ));
|
CHECK (Time::MAX > case1.gridAlign( secs (0) ));
|
||||||
CHECK (Time::MAX == case1.gridAlign( Time(+1) ));
|
CHECK (Time::MAX == case1.gridAlign( secs(+1) ));
|
||||||
CHECK (Time::MAX == case1.gridAlign( Time(+2) ));
|
CHECK (Time::MAX == case1.gridAlign( secs(+2) ));
|
||||||
|
|
||||||
// origin at upper end of the time range
|
// origin at upper end of the time range
|
||||||
FixedFrameQuantiser case2 (1, Time::MAX);
|
FixedFrameQuantiser case2 (1, Time::MAX);
|
||||||
CHECK (Time( 0) == case2.gridAlign(Time::MAX ));
|
CHECK (secs( 0) == case2.gridAlign(Time::MAX ));
|
||||||
CHECK (Time(-1) == case2.gridAlign(Time::MAX -TimeValue(1) )); // note: next lower frame
|
CHECK (secs(-1) == case2.gridAlign(Time::MAX -TimeValue(1) )); // note: next lower frame
|
||||||
CHECK (Time(-1) == case2.gridAlign(Time::MAX -Time(1) )); // i.e. the same as a whole frame down
|
CHECK (secs(-1) == case2.gridAlign(Time::MAX -secs(1) )); // i.e. the same as a whole frame down
|
||||||
CHECK (Time::MIN +Time(1) < case2.gridAlign( Time(+2) ));
|
CHECK (Time::MIN +secs(1) < case2.gridAlign( secs(+2) ));
|
||||||
CHECK (Time::MIN +Time(1) >= case2.gridAlign( Time(+1) ));
|
CHECK (Time::MIN +secs(1) >= case2.gridAlign( secs(+1) ));
|
||||||
CHECK (Time::MIN < case2.gridAlign( Time(+1) ));
|
CHECK (Time::MIN < case2.gridAlign( secs(+1) ));
|
||||||
CHECK (Time::MIN == case2.gridAlign( Time( 0) )); // note: because of downward truncating,
|
CHECK (Time::MIN == case2.gridAlign( secs( 0) )); // note: because of downward truncating,
|
||||||
CHECK (Time::MIN == case2.gridAlign( Time(-1) )); // resulting values will already exceed
|
CHECK (Time::MIN == case2.gridAlign( secs(-1) )); // resulting values will already exceed
|
||||||
CHECK (Time::MIN == case2.gridAlign( Time(-2) )); // allowed range and thus will be clipped
|
CHECK (Time::MIN == case2.gridAlign( secs(-2) )); // allowed range and thus will be clipped
|
||||||
|
|
||||||
// maximum frame size is half the time range
|
// maximum frame size is half the time range
|
||||||
Duration hugeFrame(Offset(Time::MAX));
|
Duration hugeFrame(Offset(Time::MAX));
|
||||||
FixedFrameQuantiser case3 (hugeFrame);
|
FixedFrameQuantiser case3 (hugeFrame);
|
||||||
CHECK (Time::MIN == case3.gridAlign(Time::MIN ));
|
CHECK (Time::MIN == case3.gridAlign(Time::MIN ));
|
||||||
CHECK (Time::MIN == case3.gridAlign(Time::MIN +TimeValue(1) ));
|
CHECK (Time::MIN == case3.gridAlign(Time::MIN +TimeValue(1) ));
|
||||||
CHECK (Time::MIN == case3.gridAlign( Time(-1) ));
|
CHECK (Time::MIN == case3.gridAlign( secs(-1) ));
|
||||||
CHECK (Time(0) == case3.gridAlign( Time( 0) ));
|
CHECK (TimeValue(0) == case3.gridAlign( secs( 0) ));
|
||||||
CHECK (Time(0) == case3.gridAlign( Time(+1) ));
|
CHECK (TimeValue(0) == case3.gridAlign( secs(+1) ));
|
||||||
CHECK (Time(0) == case3.gridAlign(Time::MAX -TimeValue(1) ));
|
CHECK (TimeValue(0) == case3.gridAlign(Time::MAX -TimeValue(1) ));
|
||||||
CHECK (Time::MAX == case3.gridAlign(Time::MAX ));
|
CHECK (Time::MAX == case3.gridAlign(Time::MAX ));
|
||||||
|
|
||||||
// now displacing this grid by +1sec....
|
// now displacing this grid by +1sec....
|
||||||
FixedFrameQuantiser case4 (hugeFrame, Time(1));
|
FixedFrameQuantiser case4 (hugeFrame, secs(1));
|
||||||
CHECK (Time::MIN == case4.gridAlign(Time::MIN ));
|
CHECK (Time::MIN == case4.gridAlign(Time::MIN ));
|
||||||
CHECK (Time::MIN == case4.gridAlign(Time::MIN +TimeValue(1) )); // clipped...
|
CHECK (Time::MIN == case4.gridAlign(Time::MIN +TimeValue(1) )); // clipped...
|
||||||
CHECK (Time::MIN == case4.gridAlign(Time::MIN +Time(1) )); // but now exact (unclipped)
|
CHECK (Time::MIN == case4.gridAlign(Time::MIN +secs(1) )); // but now exact (unclipped)
|
||||||
CHECK (Time::MIN == case4.gridAlign( Time(-1) ));
|
CHECK (Time::MIN == case4.gridAlign( secs(-1) ));
|
||||||
CHECK (Time::MIN == case4.gridAlign( Time( 0) ));
|
CHECK (Time::MIN == case4.gridAlign( secs( 0) ));
|
||||||
CHECK (Time(0) == case4.gridAlign( Time(+1) )); //.....now exactly the frame number zero
|
CHECK (TimeValue(0) == case4.gridAlign( secs(+1) )); //.....now exactly the frame number zero
|
||||||
CHECK (Time(0) == case4.gridAlign(Time::MAX -TimeValue(1) ));
|
CHECK (TimeValue(0) == case4.gridAlign(Time::MAX -TimeValue(1) ));
|
||||||
CHECK (Time(0) == case4.gridAlign(Time::MAX )); //.......still truncated down to frame #0
|
CHECK (TimeValue(0) == case4.gridAlign(Time::MAX )); //.......still truncated down to frame #0
|
||||||
|
|
||||||
// larger frames aren't possible
|
// larger frames aren't possible
|
||||||
Duration not_really_larger(Time(10000) + hugeFrame);
|
Duration not_really_larger(secs(10000) + hugeFrame);
|
||||||
CHECK (hugeFrame == not_really_larger);
|
CHECK (hugeFrame == not_really_larger);
|
||||||
|
|
||||||
// frame sizes below the time micro grid get trapped
|
// frame sizes below the time micro grid get trapped
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ namespace test{
|
||||||
// Extended SMPTE: extension of the axis beyond origin towards negative values
|
// Extended SMPTE: extension of the axis beyond origin towards negative values
|
||||||
smpte.hours -= 6;
|
smpte.hours -= 6;
|
||||||
CHECK ("- 0:21:59:24"== string(smpte)); // representation is symmetrical to origin
|
CHECK ("- 0:21:59:24"== string(smpte)); // representation is symmetrical to origin
|
||||||
CHECK (tx - Time(6*60*60) == smpte.getTime()); // Continuous time axis
|
CHECK (tx - Time(0,0,0,6) == smpte.getTime()); // Continuous time axis
|
||||||
|
|
||||||
CHECK (-1 == smpte.sgn); // Note: for these negative (extended) SMPTE...
|
CHECK (-1 == smpte.sgn); // Note: for these negative (extended) SMPTE...
|
||||||
CHECK (smpte.mins > 0); // ...the representation is really flipped around zero
|
CHECK (smpte.mins > 0); // ...the representation is really flipped around zero
|
||||||
|
|
@ -161,13 +161,13 @@ namespace test{
|
||||||
++smpte; // but the orientation of the increment on the *whole* TC values is unaltered
|
++smpte; // but the orientation of the increment on the *whole* TC values is unaltered
|
||||||
CHECK ("- 0:21:59:24"== string(smpte)); // so this actually *advanced* time by one frame
|
CHECK ("- 0:21:59:24"== string(smpte)); // so this actually *advanced* time by one frame
|
||||||
CHECK (tx == smpte.getTime());
|
CHECK (tx == smpte.getTime());
|
||||||
CHECK (tx < Time(0));
|
CHECK (tx < TimeValue(0));
|
||||||
|
|
||||||
smpte.mins -= 2*60; // now lets flip the representation again...
|
smpte.mins -= 2*60; // now lets flip the representation again...
|
||||||
CHECK (" 1:38:00:01"== string(smpte));
|
CHECK (" 1:38:00:01"== string(smpte));
|
||||||
CHECK (+1 == smpte.sgn);
|
CHECK (+1 == smpte.sgn);
|
||||||
CHECK (smpte.getTime() > 0);
|
CHECK (smpte.getTime() > 0);
|
||||||
CHECK (tx + Time(2*60*60) == smpte.getTime());
|
CHECK (tx + Time(0,0,0,2) == smpte.getTime());
|
||||||
smpte.secs -= 2*60*60; // and again...
|
smpte.secs -= 2*60*60; // and again...
|
||||||
CHECK (tx == smpte.getTime());
|
CHECK (tx == smpte.getTime());
|
||||||
CHECK ("- 0:21:59:24"== string(smpte));
|
CHECK ("- 0:21:59:24"== string(smpte));
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ namespace test{
|
||||||
virtual void
|
virtual void
|
||||||
run (Arg arg)
|
run (Arg arg)
|
||||||
{
|
{
|
||||||
Time ref (random_or_get(arg));
|
Time ref (0,random_or_get(arg),0,0);
|
||||||
CHECK (Time(0) < ref);
|
CHECK (TimeValue(0) < ref);
|
||||||
|
|
||||||
checkSimpleUsage (ref);
|
checkSimpleUsage (ref);
|
||||||
check_theFullStory (ref);
|
check_theFullStory (ref);
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,8 @@ namespace test{
|
||||||
CHECK (o1 == o2);
|
CHECK (o1 == o2);
|
||||||
CHECK (o1 == org);
|
CHECK (o1 == org);
|
||||||
|
|
||||||
// integer interpreted as second
|
// time in seconds
|
||||||
Time t1(1);
|
Time t1(FSecs(1));
|
||||||
CHECK (t1 == TimeValue(GAVL_TIME_SCALE));
|
CHECK (t1 == TimeValue(GAVL_TIME_SCALE));
|
||||||
|
|
||||||
// create from fractional seconds
|
// create from fractional seconds
|
||||||
|
|
@ -190,7 +190,7 @@ namespace test{
|
||||||
CHECK (th+th == t1);
|
CHECK (th+th == t1);
|
||||||
CHECK (t1-th == th);
|
CHECK (t1-th == th);
|
||||||
CHECK (((t1-th)*=2) == t1);
|
CHECK (((t1-th)*=2) == t1);
|
||||||
CHECK (th-th == Time(0));
|
CHECK (th-th == TimeValue(0));
|
||||||
|
|
||||||
// that was indeed a temporary and didn't affect the originals
|
// that was indeed a temporary and didn't affect the originals
|
||||||
CHECK (t1 == TimeValue(GAVL_TIME_SCALE));
|
CHECK (t1 == TimeValue(GAVL_TIME_SCALE));
|
||||||
|
|
@ -252,14 +252,14 @@ namespace test{
|
||||||
CHECK (distance == backwards.abs());
|
CHECK (distance == backwards.abs());
|
||||||
|
|
||||||
Duration len1(Time(23,4,5,6));
|
Duration len1(Time(23,4,5,6));
|
||||||
CHECK (len1 == Time(FSecs(23,1000)) + Time(4 + 5*60 + 6*3600));
|
CHECK (len1 == Time(FSecs(23,1000)) + Time(0, 4 + 5*60 + 6*3600));
|
||||||
|
|
||||||
Duration len2(Time(-10)); // negative specs...
|
Duration len2(Time(FSecs(-10))); // negative specs...
|
||||||
CHECK (len2 == Time(10));//
|
CHECK (len2 == Time(FSecs(10)));//
|
||||||
CHECK (len2 > zero); // will be taken absolute
|
CHECK (len2 > zero); // will be taken absolute
|
||||||
|
|
||||||
Duration unit(50, FrameRate::PAL);
|
Duration unit(50, FrameRate::PAL);
|
||||||
CHECK (Time(2) == unit); // duration of 50 frames at 25fps is... (guess what)
|
CHECK (Time(0,2,0,0) == unit); // duration of 50 frames at 25fps is... (guess what)
|
||||||
|
|
||||||
CHECK (FrameRate::PAL.duration() == Time(FSecs(1,25)));
|
CHECK (FrameRate::PAL.duration() == Time(FSecs(1,25)));
|
||||||
CHECK (FrameRate::NTSC.duration() == Time(FSecs(1001,30000)));
|
CHECK (FrameRate::NTSC.duration() == Time(FSecs(1001,30000)));
|
||||||
|
|
@ -296,7 +296,7 @@ namespace test{
|
||||||
CHECK (theLength == Offset(org,five).abs());
|
CHECK (theLength == Offset(org,five).abs());
|
||||||
|
|
||||||
Time endpoint = interval.end();
|
Time endpoint = interval.end();
|
||||||
TimeSpan successor (endpoint, Duration(Time(2)));
|
TimeSpan successor (endpoint, Duration(Time(0,2,0,0)));
|
||||||
|
|
||||||
CHECK (Offset(interval,endpoint) == Offset(org,five).abs());
|
CHECK (Offset(interval,endpoint) == Offset(org,five).abs());
|
||||||
CHECK (Offset(endpoint,successor.end()) == Duration(successor));
|
CHECK (Offset(endpoint,successor.end()) == Duration(successor));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue