diff --git a/src/proc/asset/pipe.cpp b/src/proc/asset/pipe.cpp index 849211d3e..1f1b9c5a7 100644 --- a/src/proc/asset/pipe.cpp +++ b/src/proc/asset/pipe.cpp @@ -37,12 +37,14 @@ namespace asset { * default wiring. */ Pipe::Pipe ( const Asset::Ident& idi + , string const& streamID , PProcPatt& wiring , string shortName , string longName - ) + ) : Struct (idi) - , wiringTemplate(wiring) + , wiringTemplate_(wiring) + , streamID_(streamID) , shortDesc (shortName) , longDesc (longName) { @@ -50,7 +52,7 @@ namespace asset { if (isnil (shortDesc)) shortDesc = string(idi); } - + PPipe @@ -62,11 +64,11 @@ namespace asset { void Pipe::switchProcPatt (PProcPatt& another) { - wiringTemplate = another; + wiringTemplate_ = another; TODO ("trigger rebuild fixture"); } - - - - + + + + } // namespace asset diff --git a/src/proc/asset/pipe.hpp b/src/proc/asset/pipe.hpp index c018e9c7d..af418d6fd 100644 --- a/src/proc/asset/pipe.hpp +++ b/src/proc/asset/pipe.hpp @@ -55,9 +55,11 @@ namespace asset { * of the model forming a processing pipe * for generating media output */ - class Pipe : public Struct + class Pipe + : public Struct { - PProcPatt wiringTemplate; + PProcPatt wiringTemplate_; + const string streamID_; ///< @todo just a placeholder for now 10/10 public: string shortDesc; @@ -70,13 +72,15 @@ namespace asset { protected: - Pipe (Asset::Ident const&, PProcPatt& wiring, string shortName ="", string longName ="") ; + Pipe (Asset::Ident const&, string const& streamID, PProcPatt& wiring, string shortName ="", string longName ="") ; friend class StructFactory; friend class StructFactoryImpl; public: - const string& getPipeID() const { return ident.name; } - const PProcPatt& getProcPatt() const { return wiringTemplate; } + string const& getPipeID() const { return ident.name; } + string const& getStreamID() const { return streamID_; } + PProcPatt const& getProcPatt() const { return wiringTemplate_; } + /** use another wiring template. Triggers complete rebuild of the render engine. */ void switchProcPatt (PProcPatt& another); diff --git a/src/proc/asset/procpatt.cpp b/src/proc/asset/procpatt.cpp index 4663a3ec7..13d193c2c 100644 --- a/src/proc/asset/procpatt.cpp +++ b/src/proc/asset/procpatt.cpp @@ -55,10 +55,10 @@ namespace asset /** create a new ProcPatt asset as a literal copy - * of this one. The new ProcPatt can then be customized + * of this one. The new ProcPatt can then be customised * independently of the original one. This allows using * some ProcPatt as a template for creating more - * spezialized patterns. + * specialised patterns. */ P ProcPatt::newCopy (string newID) const diff --git a/src/proc/asset/procpatt.hpp b/src/proc/asset/procpatt.hpp index 227679afb..93362055f 100644 --- a/src/proc/asset/procpatt.hpp +++ b/src/proc/asset/procpatt.hpp @@ -33,8 +33,8 @@ using std::vector; -namespace asset - { +namespace asset { + using lumiera::P; using lib::Symbol; @@ -51,7 +51,8 @@ namespace asset * representing information how to build some part * of the render engine's processing nodes network. */ - class ProcPatt : public Struct + class ProcPatt + : public Struct { InstructionSequence instructions_; diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index f59f3ebc3..fbbd6a0ad 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -90,6 +90,7 @@ namespace asset { * Implementation details, especially concerning how configuration * queries are resolved and when to create new objects automatically. * @todo better use a general struct traits class, esp.for creating the Ident + * @todo shouldn't some of the generic factory logic be moved over into the struct baseclass? ////////////////TICKET #565 */ class StructFactoryImpl { @@ -188,6 +189,7 @@ namespace asset { if (isnil (streamID)) streamID = "default"; PProcPatt processingPattern = Session::current->defaults (Query("stream("+streamID+")")); return new Pipe( idi + , streamID , processingPattern ); ///////////////////////TICKET #565 maybe store the capabilities query within the Struct asset somehow? } diff --git a/src/proc/asset/struct-scheme.hpp b/src/proc/asset/struct-scheme.hpp index 5428c171a..c8e0d09a4 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 labeling scheme for structural assets. + ** Naming and labelling scheme for structural assets. ** Preconfigured traits data for the relevant types encountered in ** Lumiera's session data model. ** diff --git a/src/proc/asset/struct.cpp b/src/proc/asset/struct.cpp index f3d4676e6..93c82d6d5 100644 --- a/src/proc/asset/struct.cpp +++ b/src/proc/asset/struct.cpp @@ -49,22 +49,6 @@ namespace asset { - /** query the currently defined properties of this - structural asset for a stream-ID predicate */ - const string - Struct::queryStreamID() const - { - return lumiera::query::extractID ("stream", this->ident.name); - } - - /** query the currently defined properties of this - structural asset for a pipe-ID predicate */ - const string - Struct::queryPipeID() const - { - return lumiera::query::extractID ("pipe", this->ident.name); - } - /** storage for the static StructFactory instance */ diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 59144a2dd..552143ef2 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -31,7 +31,7 @@ ** on demand, just by referral. Thus, the collection of these assets provides a map ** for exploring the current session's structure and allow for tweaking of the ** default behaviour. - ** - Track acts as unique track ID + ** - Track acts as unique track ID (note: to be removed and replaced by a plain \c entryID ) ** - Timeline and Sequence are facades, part of the session API ** - Pipe is an attachment point for wiring connections and defines a StreamType ** - ProcPatt is used as a blueprint in the build process, a standard connection pattern @@ -90,7 +90,7 @@ namespace asset { ID (size_t id); ID (const Struct&); }; - + /** @@ -114,8 +114,6 @@ namespace asset { return static_cast& > (Asset::getID()); } - const string queryStreamID() const; - const string queryPipeID() const; protected: @@ -126,7 +124,7 @@ namespace asset { // definition of ID ctors is possible now, // after providing full definition of class Struct - + inline ID::ID(size_t id) : ID (id) {}; inline ID::ID(const Struct& stru) : ID (stru.getID()) {}; @@ -141,11 +139,11 @@ namespace asset { class StructFactory : public lib::Factory { scoped_ptr impl_; - + protected: StructFactory (); friend class Struct; - + public: typedef P PType; @@ -160,8 +158,8 @@ namespace asset { P newPipe (string pipeID, string streamID); }; - - - + + + } // namespace asset #endif diff --git a/tests/components/proc/asset/basicpipetest.cpp b/tests/components/proc/asset/basicpipetest.cpp index ac62a92e5..70f644ed1 100644 --- a/tests/components/proc/asset/basicpipetest.cpp +++ b/tests/components/proc/asset/basicpipetest.cpp @@ -88,13 +88,13 @@ namespace asset ASSERT (thePipe); ASSERT (thePipe->getProcPatt()); ASSERT (thePipe->getPipeID() == pID_sane); - ASSERT (thePipe->getProcPatt()->queryStreamID() == sID); + ASSERT (thePipe->getStreamID() == sID); ASSERT (thePipe->shortDesc == pID_sane); Asset::Ident idi = thePipe->ident; ASSERT (idi.org == "lumi"); ASSERT (contains (idi.name, thePipe->getPipeID())); - ASSERT (contains (idi.name, thePipe->getProcPatt()->queryStreamID())); + ASSERT (contains (idi.name, thePipe->getStreamID())); Category cat (idi.category); Category refcat (STRUCT,"pipes"); @@ -133,8 +133,8 @@ namespace asset ASSERT (pipe1 == Session::current->defaults (Query())); ASSERT (pipe1->ident.category.hasKind(VIDEO)); ASSERT (pipe1->getProcPatt()); - PProcPatt popa = Session::current->defaults (Query("pipe(default)")); - ASSERT (popa == pipe1->getProcPatt()); + PProcPatt propa = Session::current->defaults (Query("pipe(default)")); + ASSERT (propa == pipe1->getProcPatt()); // several variants to query for "the default pipe" pipe2 = Session::current->defaults(Query ()); @@ -144,10 +144,10 @@ namespace asset pipe2 = asset::Struct::retrieve (Query ("pipe(default)")); ASSERT (pipe2 == pipe1); - string sID = popa->queryStreamID(); // sort of a "default stream type" + string sID = pipe1->getStreamID(); // sort of a "default stream type" PPipe pipe3 = Pipe::query ("stream("+sID+")"); ASSERT (pipe3); - ASSERT (pipe3->getProcPatt()->queryStreamID() == sID); + ASSERT (pipe3->getStreamID() == sID); ASSERT (pipe3->getProcPatt() == Session::current->defaults (Query("stream("+sID+")"))); } diff --git a/tests/components/proc/mobject/session/defsmanagerimpltest.cpp b/tests/components/proc/mobject/session/defsmanagerimpltest.cpp index 49c603d90..954730804 100644 --- a/tests/components/proc/mobject/session/defsmanagerimpltest.cpp +++ b/tests/components/proc/mobject/session/defsmanagerimpltest.cpp @@ -101,7 +101,7 @@ namespace asset { PPipe pipe2 = Struct::retrieve.newPipe (newID("pipe"), sID ); ASSERT (pipe1 != pipe2); - ASSERT (sID == pipe2->getProcPatt()->queryStreamID()); + ASSERT (sID == pipe2->getStreamID()); ASSERT (!find (pipe1->getPipeID()), "accidental clash of random test-IDs"); ASSERT (!find (pipe2->getPipeID()), "accidental clash of random test-IDs"); @@ -116,7 +116,7 @@ lumiera::query::setFakeBypass("stream("+sID+")"); ////////////////////////////// ASSERT ( find (pipe1->getPipeID()), "failure declaring object as default"); ASSERT ( find (pipe2->getPipeID()), "failure declaring object as default"); - ASSERT (sID != pipe1->getProcPatt()->queryStreamID(), "accidental clash"); + ASSERT (sID != pipe1->getStreamID(), "accidental clash"); ASSERT (!Session::current->defaults.define (pipe1, Query ("stream("+sID+")"))); // can't be registered with this query, due to failure caused by wrong stream-ID } diff --git a/tests/components/proc/mobject/session/defsmanagertest.cpp b/tests/components/proc/mobject/session/defsmanagertest.cpp index d06cb625b..107879ffa 100644 --- a/tests/components/proc/mobject/session/defsmanagertest.cpp +++ b/tests/components/proc/mobject/session/defsmanagertest.cpp @@ -117,7 +117,7 @@ namespace test { retrieveConstrainedDefault (string pID, string sID) { PPipe pipe1 = Pipe::query (""); // "the default pipe" - ASSERT (sID != pipe1->getProcPatt()->queryStreamID(), + ASSERT (sID != pipe1->getStreamID(), "stream-ID \"%s\" not suitable for test, because " "the default-pipe \"%s\" happens to have the same " "stream-ID. We need it to be different", @@ -126,7 +126,7 @@ namespace test { string query_for_sID ("stream("+sID+")"); PPipe pipe2 = Pipe::query (query_for_sID); - ASSERT (sID == pipe2->getProcPatt()->queryStreamID()); + ASSERT (sID == pipe2->getStreamID()); ASSERT (pipe2 != pipe1); ASSERT (pipe2 == Pipe::query (query_for_sID)); // reproducible }