hook automatic element-tracking into Sequence asset

This commit is contained in:
Fischlurch 2010-10-19 04:29:05 +02:00
parent b35c4b4871
commit 83ea56e3ec
3 changed files with 27 additions and 7 deletions

View file

@ -23,6 +23,7 @@
#include "proc/asset/sequence.hpp"
//#include "proc/mobject/session/track.hpp"
#include "proc/assetmanager.hpp"
//#include "proc/mobject/placement.hpp"
//#include "proc/mobject/session/mobjectfactory.hpp"
@ -33,10 +34,20 @@ namespace asset {
/** create an empty default configured Sequence */
Sequence::Sequence (const Asset::Ident& idi)
: Struct (idi)
// : track (makeDefaultTrack ())
// , clips (0)
{ }
PSequence
Sequence::create (Asset::Ident const& idi)
{
REQUIRE (getRegistry);
PSequence newSeq (AssetManager::instance().wrap (*new Sequence (idi)));
getRegistry().append (newSeq);
ENSURE (newSeq);
ENSURE (getRegistry().isRegistered(*newSeq));
return newSeq;
}

View file

@ -53,6 +53,8 @@
//#include "proc/mobject/mobject.hpp"
//#include "proc/mobject/placement.hpp"
#include "proc/mobject/mobject-ref.hpp"
#include "lib/p.hpp"
#include "lib/element-tracker.hpp"
//#include <vector>
//#include <string>
@ -71,21 +73,26 @@ namespace session {
namespace asset {
class Sequence;
typedef lumiera::P<Sequence> PSequence;
/**
* TODO type comment
*/
class Sequence
: public Struct
, public lib::AutoRegistered<Sequence>
{
typedef mobject::session::RTrack RTrack;
Sequence (Ident const&); ///////////TODO pass in track here
public:
void detach() { TODO("Session-Sequence registration"); }
/** create and register a new Sequence instance */
static PSequence create (Asset::Ident const& idi);
protected:
Sequence (const Asset::Ident& idi);
friend class StructFactoryImpl;
};

View file

@ -230,7 +230,9 @@ namespace asset {
// - track doesn't exist --> create and root attach it
// - track exists and is root attached, but belongs already to a sequence --> throw
// - track exists, but isn't root attached ---> what do do here? steal it??
return new Sequence (createIdent (caps)); ///////////TODO fed track in here
PSequence newSequence = Sequence::create (createIdent (caps)); ///////////TODO fed track in here
ENSURE (newSequence);
return newSequence.get();
}