adapt Core + Proc to use the new Time framework
This commit is contained in:
parent
ef126283eb
commit
042598f04c
19 changed files with 81 additions and 46 deletions
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
|
||||
#include "lib/symbol.hpp"
|
||||
#include "lib/time/timevalue.hpp"
|
||||
|
||||
#include <typeinfo>
|
||||
#include <string>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Media> 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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...");
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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_()
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <boost/noncopyable.hpp>
|
||||
#include <boost/operators.hpp>
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Placement<MObject>, lib::hash::LuidH> HashInd;
|
||||
typedef shared_ptr<MObject> _SmartPtr;
|
||||
typedef void (*Deleter)(MObject*);
|
||||
typedef lumiera::Time Time;
|
||||
typedef lib::time::Time Time;
|
||||
typedef asset::shared_ptr<asset::Pipe> Pipe; ////TICKET #109 : get rid of this
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace session {
|
|||
|
||||
public:
|
||||
|
||||
Time&
|
||||
Duration&
|
||||
getLength()
|
||||
{
|
||||
return length_;
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Media> PMedia;
|
||||
typedef P<asset::Clip> 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
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ namespace session {
|
|||
|
||||
|
||||
RelativeLocation&
|
||||
LocatingPin::operator() (PlaRef& refObj, Time offset)
|
||||
LocatingPin::operator() (PlaRef& refObj, Offset const& offset)
|
||||
{
|
||||
return static_cast<RelativeLocation&>
|
||||
(addChain (new RelativeLocation (refObj, offset)));
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
|
||||
#include "proc/common.hpp"
|
||||
#include "lib/time/timevalue.hpp"
|
||||
|
||||
#include <utility>
|
||||
#include <tr1/memory>
|
||||
|
|
@ -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<asset::Pipe> Pipe;
|
||||
typedef std::pair<Time,Pipe> 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<MObject>& refObj, Time offset=Time(0)); //////////TODO: warning, just a dummy placeholder for now!!
|
||||
RelativeLocation& operator() (PlacementRef<MObject>& 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;
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ExplicitPlacement> elements;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue