diff --git a/src/lib/time/formats.hpp b/src/lib/time/formats.hpp index e374c407d..a5cccc321 100644 --- a/src/lib/time/formats.hpp +++ b/src/lib/time/formats.hpp @@ -178,7 +178,7 @@ namespace time { template size_t - typeID() + typeID() const { return TypedContext::ID::get(); } @@ -210,7 +210,7 @@ namespace time { /** check if a specific Format is supported */ template bool - check() + check() const { return flags_[typeID()]; } diff --git a/src/lib/time/quantiser.hpp b/src/lib/time/quantiser.hpp index 20764bf33..c45489032 100644 --- a/src/lib/time/quantiser.hpp +++ b/src/lib/time/quantiser.hpp @@ -78,12 +78,20 @@ namespace time { class Quantiser : public Grid { + protected: + format::Supported supportedFormats_; + + Quantiser() + : supportedFormats_(format::SupportStandardTimecode()) + { } public: - template - bool supports() const; - + bool + supports() const + { + return supportedFormats_.check(); + } //------Grid-API---------------------------------------------- @@ -116,11 +124,11 @@ namespace time { FixedFrameQuantiser (FrameRate const& frames_per_second, TimeValue referencePoint =TimeValue(0)); FixedFrameQuantiser (Duration const& frame_duration, TimeValue referencePoint =TimeValue(0)); - long gridPoint (TimeValue const&) const; TimeValue gridAlign (TimeValue const&) const; TimeValue timeOf (long gridPoint) const; TimeValue timeOf (FSecs, int =0) const; + }; diff --git a/src/lib/time/timequant.hpp b/src/lib/time/timequant.hpp index 161d28bfb..3b25592c3 100644 --- a/src/lib/time/timequant.hpp +++ b/src/lib/time/timequant.hpp @@ -82,7 +82,7 @@ namespace time { inline bool QuTime::supports() const { - return false; ////////////////TODO; + return quantiser_->supports(); } @@ -100,6 +100,7 @@ namespace time { QuTime::castInto (TC& timecode) const { typedef typename TC::Format Format; + REQUIRE (supports()); Format::rebuild (timecode, *quantiser_, TimeValue(*this)); }