diff --git a/src/lib/test/test-helper.hpp b/src/lib/test/test-helper.hpp index e124055b1..8a778840f 100644 --- a/src/lib/test/test-helper.hpp +++ b/src/lib/test/test-helper.hpp @@ -26,6 +26,7 @@ #include "lib/symbol.hpp" +#include "lib/time/timevalue.hpp" #include #include @@ -102,10 +103,10 @@ namespace test{ /** create a random but not insane Time value */ - inline Time + inline lib::time::Time randTime () { - return Time (500 * (rand() % 2), (rand() % 600)); + return lib::time::Time (500 * (rand() % 2), (rand() % 600)); } /** create garbage string of given length diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index 53cd1f1fd..d67231e89 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -28,6 +28,7 @@ #include "proc/asset/unknown.hpp" #include "proc/mobject/session/clip.hpp" #include "proc/mobject/session/mobjectfactory.hpp" +#include "lib/time/timevalue.hpp" #include "lib/util.hpp" #include "include/logging.h" @@ -36,6 +37,8 @@ using util::isnil; +using lib::time::FSecs; +using lib::time::Duration; using boost::format; using boost::regex; @@ -44,11 +47,10 @@ using boost::regex_search; using std::tr1::dynamic_pointer_cast; -namespace asset - { +namespace asset { - namespace // Implementation details - { + namespace { // Implementation details + /** helper: extract a name token out of a given path/filename * @return sanitised token based on the name (minus extension), * empty string if not the common filename pattern. @@ -116,7 +118,7 @@ namespace asset } - lumiera::Time + Duration Media::getLength() const { return len_; @@ -157,7 +159,7 @@ namespace asset if (isnil (key.name)) key.name=extractName(file); TODO ("file exists?"); TODO ("extract media file properties"); - Time length(25); + Duration length(FSecs(5)); TODO ("detecting and wiring multichannel compound media!"); pM = new Media (key,file,length); } diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index d3b2c9024..bdd37da18 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -39,6 +39,7 @@ #include "proc/asset.hpp" #include "lib/factory.hpp" +#include "lib/time/timevalue.hpp" #include "proc/mobject/mobject.hpp" #include "proc/mobject/session/clip.hpp" @@ -52,7 +53,7 @@ namespace asset { class ProcPatt; using lumiera::P; - using lumiera::Time; + using lib::time::Duration; template<> @@ -71,7 +72,7 @@ namespace asset { class Media : public Asset { string filename_; - const Time len_; + const Duration len_; public: typedef P PMedia; @@ -105,11 +106,11 @@ namespace asset { PClipMO createClip (); /** @return the overall length of the media represented by this asset */ - virtual Time getLength () const; + virtual Duration getLength () const; protected: - Media (const Asset::Ident& idi, const string& file, Time length) + Media (const Asset::Ident& idi, const string& file, Duration length) : Asset(idi), filename_(file), len_(length) {} friend class MediaFactory; diff --git a/src/proc/asset/unknown.cpp b/src/proc/asset/unknown.cpp index ca25adf74..f8d3b81f1 100644 --- a/src/proc/asset/unknown.cpp +++ b/src/proc/asset/unknown.cpp @@ -38,7 +38,7 @@ namespace asset { * on using the Unknown::getOrg() function. * @note we don't depend on the refered media... */ - Unknown::Unknown (const Asset::Ident& idi, string name, Time length) + Unknown::Unknown (const Asset::Ident& idi, string name, Duration length) : Media (idi, name, length) { TODO ("implement some sensible behaviour for the »unknown media« placeholder..."); diff --git a/src/proc/asset/unknown.hpp b/src/proc/asset/unknown.hpp index fa3f5a291..31f3df6b0 100644 --- a/src/proc/asset/unknown.hpp +++ b/src/proc/asset/unknown.hpp @@ -25,13 +25,16 @@ #define ASSET_UNKNOWN_H #include "proc/asset/media.hpp" +#include "lib/time/timevalue.hpp" namespace asset { + using lib::time::FSecs; + using lib::time::Duration; - const lumiera::Time DUMMY_TIME (25); ///< @todo solve config management + const Duration DUMMY_TIME (FSecs(5)); ///< @todo solve config management /** * Placeholder Asset for unknown or unavailable media source. @@ -42,7 +45,7 @@ namespace asset { class Unknown : public Media { protected: - Unknown (const Asset::Ident& idi, string name="", Time length=DUMMY_TIME); + Unknown (const Asset::Ident& idi, string name="", Duration length=DUMMY_TIME); friend class MediaFactory; public: diff --git a/src/proc/engine/rendergraph.hpp b/src/proc/engine/rendergraph.hpp index 718d3dfdb..a77eac68b 100644 --- a/src/proc/engine/rendergraph.hpp +++ b/src/proc/engine/rendergraph.hpp @@ -26,11 +26,16 @@ #include "proc/common.hpp" #include "proc/state.hpp" +#include "lib/time/timevalue.hpp" namespace engine { + using lib::time::TimeSpan; + using lib::time::FSecs; + using lib::time::Time; + class ExitNode; /** @@ -41,11 +46,15 @@ namespace engine { protected: ExitNode * output; - /** begin of the timerange covered by this RenderGraph */ - lumiera::Time start; + /** timerange covered by this RenderGraph */ + TimeSpan segment_; - /**end (exclusive) of the timerange */ - lumiera::Time end; + public: + RenderGraph() + : segment_(Time::ZERO, FSecs(5)) + { + UNIMPLEMENTED ("anything regarding the Fixture datastructure"); + } }; diff --git a/src/proc/mobject/mobject-ref.hpp b/src/proc/mobject/mobject-ref.hpp index e8c7cad5c..e4e5b3935 100644 --- a/src/proc/mobject/mobject-ref.hpp +++ b/src/proc/mobject/mobject-ref.hpp @@ -147,7 +147,7 @@ namespace mobject { /** resolves the referred placement to an * ExplicitPlacement and returns the found start time */ - lumiera::Time const& + lib::time::Time const& getStartTime() { return pRef_.resolve().time; diff --git a/src/proc/mobject/mobject.cpp b/src/proc/mobject/mobject.cpp index f55c588aa..f844510fa 100644 --- a/src/proc/mobject/mobject.cpp +++ b/src/proc/mobject/mobject.cpp @@ -23,8 +23,10 @@ #include "proc/mobject/mobject.hpp" #include "proc/mobject/session/mobjectfactory.hpp" +#include "lib/time/timevalue.hpp" #include "lib/util.hpp" +using lib::time::Time; using util::isnil; namespace mobject { @@ -39,7 +41,7 @@ namespace mobject { MObject::MObject() - : length_() + : length_(Time::ZERO) , shortID_() { } diff --git a/src/proc/mobject/mobject.hpp b/src/proc/mobject/mobject.hpp index a8ea73313..c20bd64dd 100644 --- a/src/proc/mobject/mobject.hpp +++ b/src/proc/mobject/mobject.hpp @@ -31,6 +31,7 @@ #include "proc/mobject/builder/buildertool.hpp" #include "proc/mobject/placement.hpp" #include "proc/asset.hpp" //TODO finally not needed? +#include "lib/time/timevalue.hpp" #include #include @@ -68,10 +69,9 @@ namespace mobject { boost::equality_comparable< MObject > { protected: - typedef lumiera::Time Time; + typedef lib::time::Duration Duration; - // TODO: how to represent time intervals best? - Time length_; + Duration length_; mutable string shortID_; @@ -93,7 +93,7 @@ namespace mobject { /** MObject self-test (usable for asserting) */ virtual bool isValid() const =0; - virtual Time& getLength() =0; ///< @todo how to deal with the time/length field?? ////TICKET #448 + virtual Duration& getLength() =0; ////////////////////TICKET #448 virtual bool operator== (const MObject& oo) const =0; ///< needed for handling by lumiera::P diff --git a/src/proc/mobject/placement.hpp b/src/proc/mobject/placement.hpp index 5cd8206dc..94f6b2cca 100644 --- a/src/proc/mobject/placement.hpp +++ b/src/proc/mobject/placement.hpp @@ -69,6 +69,7 @@ #include "pre.hpp" #include "lib/hash-indexed.hpp" +#include "lib/time/timevalue.hpp" #include "proc/mobject/session/locatingpin.hpp" #include "proc/asset/pipe.hpp" //////////////TICKET #109 : get rid of this @@ -123,7 +124,7 @@ namespace mobject { typedef HashIndexed, lib::hash::LuidH> HashInd; typedef shared_ptr _SmartPtr; typedef void (*Deleter)(MObject*); - typedef lumiera::Time Time; + typedef lib::time::Time Time; typedef asset::shared_ptr Pipe; ////TICKET #109 : get rid of this diff --git a/src/proc/mobject/session/abstractmo.hpp b/src/proc/mobject/session/abstractmo.hpp index 53abf0466..1140f3c39 100644 --- a/src/proc/mobject/session/abstractmo.hpp +++ b/src/proc/mobject/session/abstractmo.hpp @@ -54,7 +54,7 @@ namespace session { public: - Time& + Duration& getLength() { return length_; diff --git a/src/proc/mobject/session/clip.cpp b/src/proc/mobject/session/clip.cpp index af388fd9b..426cd8e57 100644 --- a/src/proc/mobject/session/clip.cpp +++ b/src/proc/mobject/session/clip.cpp @@ -25,6 +25,11 @@ #include "proc/assetmanager.hpp" #include "proc/asset/media.hpp" #include "proc/asset/clip.hpp" +#include "lib/time/mutation.hpp" +#include "lib/util.hpp" + +using lib::time::Mutation; +using util::isnil; namespace mobject { namespace session { @@ -33,9 +38,8 @@ namespace session { * Initially, this clip will cover the whole source media length. */ Clip::Clip (const asset::Clip& clipDef, const Media& mediaDef) - : start_(0), - mediaDef_(mediaDef), - clipDef_(clipDef) + : mediaDef_(mediaDef) + , clipDef_(clipDef) { setupLength(); throwIfInvalid(); @@ -50,7 +54,7 @@ namespace session { Clip::isValid () const { TODO ("check consistency of clip length def, implies accessing the underlying media def"); - return length_ > Time(0); + return !isnil(length_); } @@ -58,7 +62,7 @@ namespace session { Clip::setupLength() { TODO ("really calculate the length of a clip and set length field"); - this->length_ = mediaDef_.getLength(); + this->length_.accept (Mutation::changeDuration(mediaDef_.getLength())); } diff --git a/src/proc/mobject/session/clip.hpp b/src/proc/mobject/session/clip.hpp index 6a6251103..52e134926 100644 --- a/src/proc/mobject/session/clip.hpp +++ b/src/proc/mobject/session/clip.hpp @@ -25,6 +25,7 @@ #define MOBJECT_SESSION_CLIP_H #include "proc/mobject/session/abstractmo.hpp" +#include "lib/time/timevalue.hpp" namespace asset { @@ -36,6 +37,8 @@ namespace mobject { namespace session { using asset::Media; + using lib::time::TimeVar; + typedef P PMedia; typedef P PClipAsset; @@ -67,7 +70,7 @@ namespace session { protected: /** start position in source */ - Time start_; + TimeVar start_; /** @todo using a mere ref here is against the scheme and only done as temporal solution, until we work out how to handle diff --git a/src/proc/mobject/session/locatingpin.cpp b/src/proc/mobject/session/locatingpin.cpp index 1c98c3df1..059e38290 100644 --- a/src/proc/mobject/session/locatingpin.cpp +++ b/src/proc/mobject/session/locatingpin.cpp @@ -189,7 +189,7 @@ namespace session { RelativeLocation& - LocatingPin::operator() (PlaRef& refObj, Time offset) + LocatingPin::operator() (PlaRef& refObj, Offset const& offset) { return static_cast (addChain (new RelativeLocation (refObj, offset))); diff --git a/src/proc/mobject/session/locatingpin.hpp b/src/proc/mobject/session/locatingpin.hpp index 04feae332..dc58ac944 100644 --- a/src/proc/mobject/session/locatingpin.hpp +++ b/src/proc/mobject/session/locatingpin.hpp @@ -48,6 +48,7 @@ #include "proc/common.hpp" +#include "lib/time/timevalue.hpp" #include #include @@ -96,7 +97,9 @@ namespace mobject { class LocatingPin { protected: - typedef lumiera::Time Time; + typedef lib::time::Time Time; + typedef lib::time::TimeVar TimeVar; + typedef lib::time::Offset Offset; typedef Time* Track; //TODO dummy declaration; we don't use Tracks as first-class entity any longer typedef std::tr1::shared_ptr Pipe; typedef std::pair SolutionData; //TICKET #100 (ichthyo considers better passing of solution by subclass) @@ -119,7 +122,7 @@ namespace mobject { /* Factory functions for adding LocatingPins */ FixedLocation& operator() (Time start, Track track=0); - RelativeLocation& operator() (PlacementRef& refObj, Time offset=Time(0)); //////////TODO: warning, just a dummy placeholder for now!! + RelativeLocation& operator() (PlacementRef& refObj, Offset const& offset=Offset(Time::ZERO)); //////////TODO: warning, just a dummy placeholder for now!! LocatingPin (const LocatingPin&); LocatingPin& operator= (const LocatingPin&); @@ -145,8 +148,8 @@ protected: */ struct LocatingSolution { - Time minTime; - Time maxTime; + TimeVar minTime; + TimeVar maxTime; Track minTrack; // TODO don't use Tracks Track maxTrack; bool impo; diff --git a/src/proc/mobject/session/relativelocation.hpp b/src/proc/mobject/session/relativelocation.hpp index 46b2a6d4b..bea3e134b 100644 --- a/src/proc/mobject/session/relativelocation.hpp +++ b/src/proc/mobject/session/relativelocation.hpp @@ -33,6 +33,8 @@ namespace mobject { namespace session { + using lib::time::Offset; + /** * @todo just a design sketch, nothing finished yet. @@ -56,14 +58,14 @@ namespace session { }; protected: - RelativeLocation (PlaRef const& a, Time ofs) : anchor_(a), offset_(ofs) { } + RelativeLocation (PlaRef const& a, Offset const& ofs) : anchor_(a), offset_(ofs) { } friend class LocatingPin; /** the kind of relation denoted by this Placement */ RelType relType; /** Offset the actual position by this (time) value relative to the anchor point. */ - Time offset_; + Offset offset_; //TODO: suitable representation? diff --git a/src/proc/mobject/session/segment.hpp b/src/proc/mobject/session/segment.hpp index 3a0835c87..9c39533e2 100644 --- a/src/proc/mobject/session/segment.hpp +++ b/src/proc/mobject/session/segment.hpp @@ -28,6 +28,7 @@ #include "proc/common.hpp" #include "proc/mobject/explicitplacement.hpp" +#include "lib/time/timevalue.hpp" using std::list; @@ -46,12 +47,10 @@ namespace mobject { class Segment { protected: - typedef lumiera::Time Time; + typedef lib::time::TimeSpan Span; /** begin of this timeline segment. */ - Time start; - /** duration (span) of this timeline segment. */ - Time length; + Span span_; /** relevant MObjects comprising this segment. */ list elements; diff --git a/src/proc/mobject/session/track.cpp b/src/proc/mobject/session/track.cpp index 73e811b90..78ca7a52a 100644 --- a/src/proc/mobject/session/track.cpp +++ b/src/proc/mobject/session/track.cpp @@ -32,7 +32,7 @@ namespace session { * will be set to 0 */ Track::Track (TrackID const& trackID) - : start_(0) + : start_(Time::ZERO) //////////////////////////////////TODO something more inspired please , id_(trackID) { throwIfInvalid(); diff --git a/src/proc/mobject/session/track.hpp b/src/proc/mobject/session/track.hpp index 60fb8afa5..998c51899 100644 --- a/src/proc/mobject/session/track.hpp +++ b/src/proc/mobject/session/track.hpp @@ -26,6 +26,7 @@ #include "proc/mobject/session/meta.hpp" #include "proc/asset/entry-id.hpp" +#include "lib/time/timevalue.hpp" @@ -33,6 +34,7 @@ namespace mobject { namespace session { //////////////////////////////////////////////////////TICKET #637 using lumiera::P; + using lib::time::Time; class Track; @@ -52,6 +54,9 @@ namespace session { using asset::TrackID; + //////////////////////////////////////////////////////TICKET #646 + //////////////////////////////////////////////////////TICKET #715 + /** * A Track is grouping device within the Session. * The corresponding Placement by which this Track object is referred @@ -73,7 +78,7 @@ namespace session { */ class Track : public Meta { - Time start_; + Time start_; /////////////////////////////////TODO: this doesn't belong here. The start position is governed by the Placement!!! TrackID id_;