diff --git a/src/steam/asset/meta/time-grid.cpp b/src/steam/asset/meta/time-grid.cpp index 02c3c3d4b..e6d098366 100644 --- a/src/steam/asset/meta/time-grid.cpp +++ b/src/steam/asset/meta/time-grid.cpp @@ -40,7 +40,7 @@ namespace meta { namespace error = lumiera::error; - + /** * @internal to be invoked indirectly by means of the Builder. * @todo drafted in 2010 -- usage of the builder feels unsatisfactory as of 2018 @@ -84,11 +84,10 @@ namespace meta { advice::Provision(bindingID).setAdvice(quantiser); return gridImplementation; } - - - } + }//(End)Impl helper. - /** + + /** * TimeGrid implementation: a trivial time grid, * starting at a given point in time and using a * constant grid spacing. @@ -96,7 +95,7 @@ namespace meta { * @note The actual implementation is mixed in, * together with the Quantiser API; the intended use * of this implementation is to publish it via the advice - * framework, when building and registering the meta asset. + * framework, when building and registering the meta asset. */ class SimpleTimeGrid : public TimeGrid @@ -120,7 +119,7 @@ namespace meta { /** Setup of a TimeGrid: validate the settings configured into this builder instance, * then decide on the implementation strategy for the time grid. Convert the given * frames per second into an appropriate gridSpacing time and build a suitable - * name-ID to denote the TimeGrid-meta-Asset to be built. + * name-ID to denote the TimeGrid-meta-Asset to be built. * @return shared_ptr holding onto the new asset::Meta, which has already been * registered with the AssetManager. * @throw error::Config in case of invalid frames-per-second. The AssetManager @@ -147,9 +146,9 @@ namespace meta { } GridID nameID (id); - // build new Meta-Asset, registered with AssetManager, and publish into Advice-System + // build new Meta-Asset, registered with AssetManager, and publish into Advice-System return publishWrapped (*new SimpleTimeGrid(origin, fps, nameID)); ///////////////////////////TICKET #840 currently this replaces an existing Registration. What do we actually want here? - } + } /////////////////////////// Remark 1/2025 : Tests meanwhile rely on being able just to replace a Grid without much ado. Seems natural this way... /* === TimeGrid shortcut builder functions === */ diff --git a/src/steam/engine/node-builder.hpp b/src/steam/engine/node-builder.hpp index 10b65297a..87b3f8ccb 100644 --- a/src/steam/engine/node-builder.hpp +++ b/src/steam/engine/node-builder.hpp @@ -441,8 +441,7 @@ namespace engine { return attachParamFun ([automation = forward(aFun)] (TurnoutSystem& turnoutSys) { - Time nomTime = Time::ZERO; ////////////////////OOO need to retrieve that from turnoutSys - return automation(nomTime); + return automation (turnoutSys.getNomTime()); }); } diff --git a/tests/core/steam/engine/node-builder-test.cpp b/tests/core/steam/engine/node-builder-test.cpp index 0b133827a..ae43e54ad 100644 --- a/tests/core/steam/engine/node-builder-test.cpp +++ b/tests/core/steam/engine/node-builder-test.cpp @@ -19,17 +19,28 @@ #include "lib/test/run.hpp" #include "steam/engine/node-builder.hpp" #include "steam/engine/diagnostic-buffer-provider.hpp" +#include "steam/asset/meta/time-grid.hpp" #include "lib/test/diagnostic-output.hpp" +#include "lib/time/timequant.hpp" +#include "lib/time/timecode.hpp" +#include "lib/symbol.hpp" //#include "lib/util.hpp" - +using lib::Symbol; using std::string; +using lib::time::Time; +using lib::time::QuTime; +using lib::time::FrameNr; +using lib::time::SmpteTC; namespace steam { namespace engine{ namespace test { + namespace { + Symbol SECONDS_GRID = "grid_sec"; + } @@ -41,6 +52,9 @@ namespace test { virtual void run (Arg) { + seedRand(); // used for simple time-based „automation“ + steam::asset::meta::TimeGrid::build (SECONDS_GRID, 1); + build_simpleNode(); build_Node_fixedParam(); build_Node_dynamicParam(); @@ -114,13 +128,37 @@ namespace test { } - /** @test TODO build a Node with dynamically generated parameter - * @todo WIP 12/24 🔁 define ⟶ implement + /** @test build a Node with dynamically generated parameter + * - use a processing function which takes a parameter + * - use an _automation functor,_ which just quantises + * the time into an implicitly defined grid + * - install both into a render node + * - set a random _nominal time_ for invocation + * @todo 12/24 ✔ define ⟶ ✔ implement */ void build_Node_dynamicParam() { - UNIMPLEMENTED ("build node with param-functor"); + auto procFun = [](long param, int* buff){ *buff = int(param); }; + auto autoFun = [](Time nomTime){ return FrameNr::quant (nomTime, SECONDS_GRID); }; + + ProcNode node{prepareNode("Test") + .preparePort() + .invoke("fun()", procFun) + .attachAutomation (autoFun) + .completePort() + .build()}; + + // invoke with a random »nominal Time« <10s with ms granularity + Time theTime{rani(10'000),0}; + int res = invokeRenderNode (node, theTime); + + // for verification: quantise the given Time into SMPTE timecode; + QuTime qantTime (theTime, SECONDS_GRID); + CHECK (res == SmpteTC(qantTime).secs); + // Explanation: since the param-functor quantises into a 1-second grid + // and the given time is below 1 minute, the seconds field + // of SMPTE Timecode should match the parameter value } @@ -135,7 +173,7 @@ namespace test { /** @test TODO - * @todo WIP 12/24 define ⟶ implement + * @todo WIP 12/24 🔁 define ⟶ implement */ void build_ParamNode() diff --git a/tests/core/steam/engine/node-feed-test.cpp b/tests/core/steam/engine/node-feed-test.cpp index 623a1dd8f..cc1b1a7db 100644 --- a/tests/core/steam/engine/node-feed-test.cpp +++ b/tests/core/steam/engine/node-feed-test.cpp @@ -36,7 +36,6 @@ using lib::Several; using lib::makeSeveral; using lib::time::Time; -using lib::time::FSecs; using lib::time::FrameNr; using lib::test::showType; using std::make_tuple; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index c36ed5484..855954cfc 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -88462,8 +88462,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + + @@ -89071,11 +89072,24 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + - - + + + + + + + + + +
@@ -98041,7 +98055,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension)
- +