hook automatic element-tracking into Timeline asset
This commit is contained in:
parent
fc0cefcadc
commit
b35c4b4871
3 changed files with 31 additions and 10 deletions
|
|
@ -212,7 +212,9 @@ namespace asset {
|
|||
ASSERT (sequence);
|
||||
RBinding newBinding = Session::current->getRoot().attach (MObject::create (sequence));
|
||||
ASSERT (newBinding);
|
||||
return new Timeline (idi, newBinding);
|
||||
PTimeline newTimeline = Timeline::create (idi, newBinding);
|
||||
ENSURE (newTimeline);
|
||||
return newTimeline.get();
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
//#include "proc/mobject/placement.hpp"
|
||||
//#include "proc/mobject/session/mobjectfactory.hpp"
|
||||
#include "proc/mobject/session/binding.hpp"
|
||||
#include "proc/assetmanager.hpp"
|
||||
|
||||
namespace asset {
|
||||
|
||||
|
|
@ -35,13 +36,26 @@ namespace asset {
|
|||
Timeline::Timeline (const Asset::Ident& idi, RBinding const& sequenceBinding)
|
||||
: Struct (idi)
|
||||
, boundSeqence_(sequenceBinding)
|
||||
// : track (makeDefaultTrack ())
|
||||
// , clips (0)
|
||||
{
|
||||
REQUIRE (boundSeqence_);
|
||||
}
|
||||
|
||||
|
||||
PTimeline
|
||||
Timeline::create (Asset::Ident const& idi, RBinding const& sequenceBinding)
|
||||
{
|
||||
REQUIRE (getRegistry);
|
||||
|
||||
PTimeline newElement (AssetManager::instance().wrap (*new Timeline(idi, sequenceBinding)));
|
||||
getRegistry().append (newElement);
|
||||
|
||||
ENSURE (newElement);
|
||||
ENSURE (getRegistry().isRegistered(*newElement));
|
||||
return newElement;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
//#include "proc/mobject/placement.hpp"
|
||||
#include "proc/mobject/mobject-ref.hpp"
|
||||
//#include "proc/mobject/session/binding.hpp" ////TODO avoidable??
|
||||
//#include "lib/p.hpp"
|
||||
#include "lib/p.hpp"
|
||||
#include "lib/element-tracker.hpp"
|
||||
|
||||
|
||||
|
|
@ -79,27 +79,32 @@ namespace asset {
|
|||
|
||||
|
||||
// using lumiera::P;
|
||||
class Timeline;
|
||||
typedef lumiera::P<Timeline> PTimeline;
|
||||
|
||||
|
||||
/**
|
||||
* TODO type comment
|
||||
*/
|
||||
class Timeline
|
||||
: public Struct
|
||||
, public lib::AutoRegistered<Timeline>
|
||||
{
|
||||
typedef mobject::session::RBinding RBinding;
|
||||
|
||||
RBinding boundSeqence_;
|
||||
|
||||
public:
|
||||
void detach() { TODO("Timeline-Session registration"); }
|
||||
Timeline (Ident const&, RBinding const&);
|
||||
|
||||
public:
|
||||
/** create and register a new Timeline instance */
|
||||
static PTimeline create (Asset::Ident const& idi, RBinding const& sequenceBinding);
|
||||
|
||||
// void detach() { TODO("Timeline-Session registration"); }
|
||||
|
||||
protected:
|
||||
Timeline (const Asset::Ident& idi, RBinding const& sequenceBinding);
|
||||
friend class StructFactoryImpl;
|
||||
};
|
||||
|
||||
|
||||
typedef P<Timeline> PTimeline;
|
||||
|
||||
|
||||
///////////////////////////TODO currently just fleshing the API
|
||||
|
|
|
|||
Loading…
Reference in a new issue