diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index ae794301c..496600fc4 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -143,7 +143,7 @@ namespace asset { } - + @@ -171,75 +171,75 @@ namespace asset { } }; - - - /* ============= specialisations =========================== */ - - template<> - inline Track* - StructFactoryImpl::fabricate (const Query& caps) - { - TODO ("actually extract properties/capabilities from the query..."); - TODO ("make sure AssetManager detects duplicates (currently 4/08 it doesn't)"); /////////////TICKET #102 - return new Track (createIdent (caps)); - } - - template<> - inline const ProcPatt* - StructFactoryImpl::fabricate (const Query& caps) - { - TODO ("actually extract properties/capabilities from the query..."); - return new ProcPatt (createIdent (caps)); - } - - template<> - inline Pipe* - StructFactoryImpl::fabricate (const Query& caps) - { - const Asset::Ident idi (createIdent (caps)); - string pipeID = extractID ("pipe", idi.name); - string streamID = extractID ("stream", caps); - if (isnil (streamID)) streamID = "default"; - PProcPatt processingPattern = Session::current->defaults (Query("stream("+streamID+")")); - return new Pipe( idi - , processingPattern - , pipeID - ); - } - - template<> - inline Timeline* - StructFactoryImpl::fabricate (const Query& caps) - { - TODO ("extract additional properties/capabilities from the query..."); - const Asset::Ident idi (createIdent (caps)); - string sequenceID = extractID ("sequence", caps); - Query desiredSequence (isnil (sequenceID)? "" : "id("+sequenceID+")"); - PSequence sequence = recursive_create_(desiredSequence); - ASSERT (sequence); - RBinding newBinding = Session::current->getRoot().attach (MObject::create (sequence)); - ASSERT (newBinding); - return new Timeline (idi, newBinding); - } - - template<> - inline Sequence* - StructFactoryImpl::fabricate (const Query& caps) - { - // 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..."); - 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 - } - - - - + + + /* ============= specialisations =========================== */ + + template<> + inline Track* + StructFactoryImpl::fabricate (const Query& caps) + { + TODO ("actually extract properties/capabilities from the query..."); + TODO ("make sure AssetManager detects duplicates (currently 4/08 it doesn't)"); /////////////TICKET #102 + return new Track (createIdent (caps)); + } + + template<> + inline const ProcPatt* + StructFactoryImpl::fabricate (const Query& caps) + { + TODO ("actually extract properties/capabilities from the query..."); + return new ProcPatt (createIdent (caps)); + } + + template<> + inline Pipe* + StructFactoryImpl::fabricate (const Query& caps) + { + const Asset::Ident idi (createIdent (caps)); + string pipeID = extractID ("pipe", idi.name); + string streamID = extractID ("stream", caps); + if (isnil (streamID)) streamID = "default"; + PProcPatt processingPattern = Session::current->defaults (Query("stream("+streamID+")")); + return new Pipe( idi + , processingPattern + , pipeID + ); + } + + template<> + inline Timeline* + StructFactoryImpl::fabricate (const Query& caps) + { + TODO ("extract additional properties/capabilities from the query..."); + const Asset::Ident idi (createIdent (caps)); + string sequenceID = extractID ("sequence", caps); + Query desiredSequence (isnil (sequenceID)? "" : "id("+sequenceID+")"); + PSequence sequence = recursive_create_(desiredSequence); + ASSERT (sequence); + RBinding newBinding = Session::current->getRoot().attach (MObject::create (sequence)); + ASSERT (newBinding); + return new Timeline (idi, newBinding); + } + + template<> + inline Sequence* + StructFactoryImpl::fabricate (const Query& caps) + { + // 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..."); + 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 + } + + + + } // namespace asset #endif diff --git a/src/proc/mobject/session/element-query.hpp b/src/proc/mobject/session/element-query.hpp index 6c290c184..ec23eae9b 100644 --- a/src/proc/mobject/session/element-query.hpp +++ b/src/proc/mobject/session/element-query.hpp @@ -76,8 +76,10 @@ namespace session { typedef typename ScopeQuery::iterator Iterator; }; } - - + + + + /** * Access point to session global search and query functions. * This sub-component of the public session interface allows to @@ -114,8 +116,8 @@ namespace session { } }; - - - + + + }} // namespace mobject::session #endif