From 784b094fa7c415d062b0667e48e8f8f89e92bdda Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 26 Dec 2010 23:00:34 +0100 Subject: [PATCH] fix compilation problems with draft code --- src/lib/time/timevalue.hpp | 49 ++++++++++++----------- tests/lib/time/time-formats-test.cpp | 8 ++-- tests/lib/time/time-quantisation-test.cpp | 8 ++-- tests/lib/time/time-value-test.cpp | 6 +-- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp index 6f4eb0427..58095f85e 100644 --- a/src/lib/time/timevalue.hpp +++ b/src/lib/time/timevalue.hpp @@ -36,6 +36,8 @@ extern "C" { namespace lib { namespace time { + using lumiera::Time; + /** * fixed format time specification. @@ -46,6 +48,7 @@ namespace time { : boost::totally_ordered > { + protected: gavl_time_t t_; public: @@ -62,11 +65,11 @@ namespace time { operator gavl_time_t () const { return t_; } // Supporting totally_ordered - friend bool operator< (Time const& t1, Time const& t2) { return t1.t_ < t2.t_; } - friend bool operator< (Time const& t1, gavl_time_t t2) { return t1.t_ < t2 ; } - friend bool operator> (Time const& t1, gavl_time_t t2) { return t1.t_ > t2 ; } - friend bool operator== (Time const& t1, Time const& t2) { return t1.t_ == t2.t_; } - friend bool operator== (Time const& t1, gavl_time_t t2) { return t1.t_ == t2 ; } + friend bool operator< (TimeValue const& t1, TimeValue const& t2) { return t1.t_ < t2.t_; } + friend bool operator< (TimeValue const& t1, gavl_time_t t2) { return t1.t_ < t2 ; } + friend bool operator> (TimeValue const& t1, gavl_time_t t2) { return t1.t_ > t2 ; } + friend bool operator== (TimeValue const& t1, TimeValue const& t2) { return t1.t_ == t2.t_; } + friend bool operator== (TimeValue const& t1, gavl_time_t t2) { return t1.t_ == t2 ; } }; @@ -97,21 +100,21 @@ namespace time { /** * Lumiera's internal time value datatype */ - class Time - : public TimeValue - { - public: - explicit - Time (TimeValue val=0) - : TimeValue(val) - { } - - Time ( long millis - , uint secs - , uint mins =0 - , uint hours=0 - ); - }; +//class Time +// : public TimeValue +// { +// public: +// explicit +// Time (TimeValue val=0) +// : TimeValue(val) +// { } +// +// Time ( long millis +// , uint secs +// , uint mins =0 +// , uint hours=0 +// ); +// }; class Offset @@ -128,9 +131,9 @@ namespace time { inline Offset operator- (Time const& end, Time const& start) { - TimeVar distance(end); - distance -= start; - return Offset(distance); +// TimeVar distance(end); +// distance -= start; +// return Offset(distance); } typedef const Offset TimeDistance; diff --git a/tests/lib/time/time-formats-test.cpp b/tests/lib/time/time-formats-test.cpp index 5a60473ae..ac9a52c5d 100644 --- a/tests/lib/time/time-formats-test.cpp +++ b/tests/lib/time/time-formats-test.cpp @@ -25,12 +25,12 @@ #include "lib/time/timecode.hpp" #include "lib/util.hpp" -//#include +#include //#include //#include -//using boost::lexical_cast; -//using util::isnil; +using boost::lexical_cast; +using util::isnil; //using std::rand; //using std::cout; //using std::endl; @@ -40,6 +40,8 @@ namespace lib { namespace time{ namespace test{ + using lumiera::Time; + /******************************************************** * @test verify handling of grid aligned timecode values. diff --git a/tests/lib/time/time-quantisation-test.cpp b/tests/lib/time/time-quantisation-test.cpp index 5e6660e2d..ac3dd9393 100644 --- a/tests/lib/time/time-quantisation-test.cpp +++ b/tests/lib/time/time-quantisation-test.cpp @@ -25,12 +25,12 @@ #include "lib/time/quantiser.hpp" #include "lib/util.hpp" -//#include +#include //#include //#include -//using boost::lexical_cast; -//using util::isnil; +using boost::lexical_cast; +using util::isnil; //using std::rand; //using std::cout; //using std::endl; @@ -40,6 +40,8 @@ namespace lib { namespace time{ namespace test{ + using lumiera::Time; + /******************************************************** * @test verify handling of time values, time intervals. diff --git a/tests/lib/time/time-value-test.cpp b/tests/lib/time/time-value-test.cpp index b40ca5189..e9e602d17 100644 --- a/tests/lib/time/time-value-test.cpp +++ b/tests/lib/time/time-value-test.cpp @@ -25,12 +25,12 @@ #include "lib/time/timevalue.hpp" #include "lib/util.hpp" -//#include +#include //#include //#include -//using boost::lexical_cast; -//using util::isnil; +using boost::lexical_cast; +using util::isnil; //using std::rand; //using std::cout; //using std::endl;