diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index 07b8d49..88bbea0 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -24,6 +24,26 @@ class FluidSCWrapper; namespace impl { + template + struct AssignBuffer + { + void operator()(const typename BufferT::type &p, World *w) + { + if (auto b = static_cast(p.get())) + b->assignToRT(w); + } + }; + + template + struct CleanUpBuffer + { + void operator()(const typename BufferT::type &p) + { + if (auto b = static_cast(p.get())) b->cleanUp(); + } + }; + + // Iterate over kr/ir inputs via callbacks from params object struct FloatControlsIter { @@ -295,33 +315,17 @@ private: bool exchangeBuffers(World *world) { - mParams.template forEachParamType(world); + mParams.template forEachParamType(world); return true; } bool tidyUp(World *) { - mParams.template forEachParamType(); + mParams.template forEachParamType(); return true; } - template - struct AssignBuffer - { - void operator()(const typename BufferT::type &p, World *w) - { - if (auto b = static_cast(p.get())) b->assignToRT(w); - } - }; - template - struct CleanUpBuffer - { - void operator()(const typename BufferT::type &p) - { - if (auto b = static_cast(p.get())) b->cleanUp(); - } - }; FloatControlsIter mControlsIterator; FifoMsg mFifoMsg; @@ -627,9 +631,10 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase } return true; }, - [](World*, void* data) //RT thread: response + [](World* world, void* data) //RT thread: response { MessageData* m = static_cast(data); + MessageDescriptor::template forEachArg(m->args, world); messageOutput(m->wrapper,m->name,m->result); return true; }