From c6c721482696273b9ca67bc0850925c61981b1da Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 14 Jun 2010 02:08:45 +0200 Subject: [PATCH] try to break the design deadlock with sequence / track creation --- src/proc/asset/struct-factory-impl.hpp | 9 ++++- src/proc/asset/struct-scheme.hpp | 4 +-- src/proc/mobject/session/mobjectfactory.cpp | 11 +++++- src/proc/mobject/session/mobjectfactory.hpp | 4 ++- src/proc/mobject/session/track.cpp | 15 ++++++++- src/proc/mobject/session/track.hpp | 25 ++++++++++++-- wiki/renderengine.html | 37 +++++++++++++++++---- 7 files changed, 90 insertions(+), 15 deletions(-) diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index 82050fc5e..bfae323c7 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -203,7 +203,14 @@ namespace asset { { // when we reach this point it is clear a suitable sequence doesn't yet exist in the model TODO ("actually extract properties/capabilities from the query..."); - return new Sequence (createIdent (caps)); + string trackID = extractID ("track", caps); + Query desiredTrack (isnil (trackID)? "" : "id("+trackID+")"); +// PTrack track = Session::current->query (desiredTrack); ///////////////////////////////////TICKET #639 + // TODO: handle the following cases + // - 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 } diff --git a/src/proc/asset/struct-scheme.hpp b/src/proc/asset/struct-scheme.hpp index c8e0d09a4..69161ffbc 100644 --- a/src/proc/asset/struct-scheme.hpp +++ b/src/proc/asset/struct-scheme.hpp @@ -22,7 +22,7 @@ /** @file struct-scheme.hpp - ** Naming and labelling scheme for structural assets. + ** Naming and labeling scheme for structural assets. ** Preconfigured traits data for the relevant types encountered in ** Lumiera's session data model. ** @@ -68,7 +68,7 @@ namespace asset{ - /* ==== structural asset ID scheme ==== */ /////////////////////////////////////////////TICKET #565 : better organisation of this naming scheme + /* ==== structural asset ID scheme ==== */ /////////////////////////////////////////////TICKET #565 : better organization of this naming scheme template struct StructTraits diff --git a/src/proc/mobject/session/mobjectfactory.cpp b/src/proc/mobject/session/mobjectfactory.cpp index d08bc7e3a..0b1373710 100644 --- a/src/proc/mobject/session/mobjectfactory.cpp +++ b/src/proc/mobject/session/mobjectfactory.cpp @@ -84,12 +84,21 @@ namespace session { /** */ Placement - MObjectFactory::operator() (PTrackAsset& trackDef) + MObjectFactory::operator() (PTrackAsset& trackDef) /////////////////////TICKET #581 kill kill kill the track-asset { TODO ("what needs to be registered when creating an Track-MO?"); return Placement (*new Track (trackDef), &deleterFunc); } + /** fabricate a new track-MObject, using the given unique ID */ + Placement + MObjectFactory::operator() (TrackID const& id) + { + TODO ("what needs to be registered when creating an Track-MO?"); + TODO ("assure the ID is indeed unique and not already used for another track"); //////////TICKET #638 + return Placement (*new Track (id), &deleterFunc); + } + /** */ Placement MObjectFactory::operator() (const asset::Effect& processorDef) diff --git a/src/proc/mobject/session/mobjectfactory.hpp b/src/proc/mobject/session/mobjectfactory.hpp index 972bc6628..509975676 100644 --- a/src/proc/mobject/session/mobjectfactory.hpp +++ b/src/proc/mobject/session/mobjectfactory.hpp @@ -25,6 +25,7 @@ #define MOBJECT_SESSION_MOBJECTFACTORY_H #include "proc/mobject/mobject.hpp" +#include "proc/asset/entry-id.hpp" #include "lib/symbol.hpp" @@ -68,7 +69,8 @@ namespace session { Placement operator() (DefsManager&); Placement operator() (asset::Clip const&, asset::Media const&); Placement operator() (asset::Clip const&, vector); - Placement operator() (PTrackAsset&); + Placement operator() (PTrackAsset&); ////////////////////////////////////////////////////TICKET #581 kill kill kill the track-asset + Placement operator() (asset::EntryID const&); ////////////TICKET #581 use this one instead Placement operator() (asset::Effect const&); Placement