From 42cc43f89d567a94d1b28cd908a547933ced0b9f Mon Sep 17 00:00:00 2001 From: Owen Green Date: Fri, 18 Dec 2020 16:53:12 +0000 Subject: [PATCH 1/2] Ensure realtime objects run parameter constrainsts on creation --- include/wrapper/Realtime.hpp | 46 +++--------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/include/wrapper/Realtime.hpp b/include/wrapper/Realtime.hpp index cb70677..e6e183a 100644 --- a/include/wrapper/Realtime.hpp +++ b/include/wrapper/Realtime.hpp @@ -53,7 +53,7 @@ public: RealTime() : mControls{mInBuf + ControlOffset(this),ControlSize(this)}, - mClient{Wrapper::setParams(this, mParams, mControls)} + mClient{Wrapper::setParams(this, mParams, mControls,true)} { init(); } @@ -61,6 +61,7 @@ public: void init() { // auto& client = mClient; + mDelegate.init(*this,mClient,mControls); mCalcFunc = make_calc_function(); Wrapper::getInterfaceTable()->fClearUnitOutputs(this, 1); @@ -111,56 +112,15 @@ public: void next(int) { -// auto& client = mWrapper->client(); -// auto& params = mWrapper->params(); -// const Unit* unit = this; - mControls.reset(mInBuf + ControlOffset(this)); + mControls.reset(mInBuf + ControlOffset(this)); mDelegate.next(*this,mClient,mParams,mControls); -// bool trig = IsModel_t::value ? !mPrevTrig && in0(0) > 0 : false; -// bool shouldProcess = IsModel_t::value ? trig : true; -// mPrevTrig = trig; -// -// if(shouldProcess) -// { -// mWrapper->mControlsIterator.reset(mInBuf + mSpecialIndex + -// 1); // mClient.audioChannelsIn()); -// 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)]) -// { mAudioInputs[asUnsigned(i)].reset(IN(i), 0, fullBufferSize()); } -// } -// for (index i = 0; i < client.audioChannelsOut(); ++i) -// { -// assert(i <= std::numeric_limits::max()); -// if (mOutputConnections[asUnsigned(i)]) -// mOutputs[asUnsigned(i)].reset(out(static_cast(i)), 0, -// fullBufferSize()); -// } -// for (index i = 0; i < client.controlChannelsOut(); ++i) -// { -// assert(i <= std::numeric_limits::max()); -// mOutputs[asUnsigned(i)].reset(out(static_cast(i)), 0, 1); -// } -// client.process(mAudioInputs, mOutputs, mContext); -// // } } private: Delegate mDelegate; FloatControlsIter mControls; Params mParams{Client::getParameterDescriptors()}; Client mClient; - // std::vector mInputConnections; - // std::vector mOutputConnections; - // std::vector mAudioInputs; - // std::vector mOutputs; - // FluidContext mContext; - Wrapper* mWrapper{static_cast(this)}; - // bool mPrevTrig; }; } From d49ba1bbb0a466cef6f328a9b723a90da738f35c Mon Sep 17 00:00:00 2001 From: Owen Green Date: Fri, 18 Dec 2020 17:35:46 +0000 Subject: [PATCH 2/2] Add retro-proof constructors for DataSet and LabelSet (simply consume surplus name argument rather than forwarding up the chain) --- release-packaging/Classes/FluidDataSet.sc | 1 + release-packaging/Classes/FluidLabelSet.sc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/release-packaging/Classes/FluidDataSet.sc b/release-packaging/Classes/FluidDataSet.sc index a9ca6a5..9df17cc 100644 --- a/release-packaging/Classes/FluidDataSet.sc +++ b/release-packaging/Classes/FluidDataSet.sc @@ -1,6 +1,7 @@ FluidDataSet : FluidDataObject { + *new{|server| ^super.new(server) } addPointMsg{|label,buffer| buffer = this.prEncodeBuffer(buffer); diff --git a/release-packaging/Classes/FluidLabelSet.sc b/release-packaging/Classes/FluidLabelSet.sc index 75e48f5..7f0d9c3 100644 --- a/release-packaging/Classes/FluidLabelSet.sc +++ b/release-packaging/Classes/FluidLabelSet.sc @@ -1,5 +1,7 @@ FluidLabelSet : FluidDataObject { + *new{|server| ^super.new(server) } + addLabelMsg{|identifier,label| ^this.prMakeMsg(\addLabel,id,identifier.asSymbol,label.asSymbol); }