From 6d69b0f291f99e5f6b7c3e8138821c83427f624a Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 5 Aug 2020 18:56:22 +0100 Subject: [PATCH] Revert "Fix RT triggering" This reverts commit 89886c143fb5c4f68198a7050cb974a48ee49fd1. --- include/FluidSCWrapper.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index c3e00e4..515b469 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -307,7 +307,7 @@ public: auto& client = mWrapper->client(); auto& params = mWrapper->params(); const Unit* unit = this; - bool trig = IsModel_t::value ? !mPrevTrig && in0(0) > 0 : false; + bool trig = IsModel_t::value ? mPrevTrig && in0(0) > 0 : false; bool shouldProcess = IsModel_t::value ? trig : true; mPrevTrig = trig; @@ -318,7 +318,7 @@ public: Wrapper::setParams(mWrapper, params, mWrapper->mControlsIterator); // forward on inputs N + audio inputs as params params.constrainParameterValues(); - } + for (index i = 0; i < client.audioChannelsIn(); ++i) { if (mInputConnections[asUnsigned(i)]) @@ -337,7 +337,7 @@ public: mOutputs[asUnsigned(i)].reset(out(static_cast(i)), 0, 1); } client.process(mAudioInputs, mOutputs, mContext); -// } + } } private: std::vector mInputConnections; @@ -594,7 +594,7 @@ public: return true; } - static void destroy(World* /*world*/, void* data) + static void destroy(World* world, void* data) { if(!data) return; auto& s = *static_cast*>(data); @@ -995,17 +995,17 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase return std::string(recv ? recv : ""); } - static auto fromArgs(Unit* /*x*/, FloatControlsIter& args, std::string, int) + static auto fromArgs(Unit* x, FloatControlsIter& args, std::string, int) { // first is string size, then chars index size = static_cast(args.next()); -// auto ft = FluidSCWrapper::getInterfaceTable(); -// auto w = x->mWorld; + auto ft = FluidSCWrapper::getInterfaceTable(); + auto w = x->mWorld; // char* chunk = // static_cast(ft->fRTAlloc(w, asUnsigned(size + 1))); std::string res; - res.resize(asUnsigned(size)); + res.resize(size); // if (!chunk) // { @@ -1015,7 +1015,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase // } for (index i = 0; i < size; ++i) - res[asUnsigned(i)] = static_cast(args.next()); + res[i] = static_cast(args.next()); // res[size] = 0; // terminate string // auto res = std::string{chunk}; @@ -1415,7 +1415,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase return true; }, nullptr, // NRT Thread: No-op - [](World* /*w*/, void* data) // RT thread: clean up + [](World* w, void* data) // RT thread: clean up { MessageData* m = static_cast(data); // m->~MessageData(); @@ -1451,7 +1451,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase // float* values = static_cast( // ft->fRTAlloc(x->mNode->mWorld, asUnsigned(numArgs) * sizeof(float))); - float* values = new float[asUnsigned(numArgs)]; + float* values = new float[numArgs]; // copy return data ToFloatArray::convert(values, static_cast(result)); @@ -1492,7 +1492,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase // float* values = static_cast( // ft->fRTAlloc(x->mNode->mWorld, asUnsigned(numArgs) * sizeof(float))); - float* values = new float[asUnsigned(numArgs)]; + float* values = new float[numArgs]; ToFloatArray::convert(values, std::tuple(result), offsets, std::index_sequence_for());