diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index b74602b..33aeaca 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -45,7 +45,7 @@ public: void next(int n) { - setParams(mInBuf + 1); //forward on inputs N + 1 as params + setParams(mInBuf + 1); // forward on inputs N + 1 as params const Unit *unit = this; for (int i = 0; i < mClient.audioChannelsIn(); ++i) { @@ -68,8 +68,10 @@ public: private: template void setParams(float **inputs, std::index_sequence) { - (void)std::initializer_list{( - impl::SetterDispatchImpl::f(mClient, 1, inputs[Is]), 0)...}; + (void)std::initializer_list{ + (impl::SetterDispatchImpl::f(mClient, 1, inputs[Is], + mInputConnections[Is+1]), + 0)...}; } std::vector mInputConnections; @@ -83,22 +85,34 @@ private: namespace impl { template struct SetterDispatchImpl { - static void f(Client &x, long ac, float *av) { x.template setter()(*av); } + static void f(Client &x, long ac, float *av, bool isAudio) { + if (!isAudio) + x.template setter()(*av); + } }; template struct SetterDispatchImpl { - static void f(Client &x, long ac, float *av) { x.template setter()(*av); } + static void f(Client &x, long ac, float *av, bool isAudio) { + if (!isAudio) + x.template setter()(*av); + } }; template struct SetterDispatchImpl { - static void f(Client *x, long ac, float *av) { x->template setter()(*av); } + static void f(Client *x, long ac, float *av, bool isAudio) { + if (!isAudio) + x->template setter()(*av); + } }; template struct SetterDispatchImpl { - static void f(Client *x, long ac, float *av) { x->template setter()(*av); } + static void f(Client *x, long ac, float *av, bool isAudio) { + if (!isAudio) + x->template setter()(*av); + } }; } // namespace impl