From 82cc1dc77fba01475e01778e422c25fe737e9d18 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Tue, 14 May 2019 13:05:18 +0100 Subject: [PATCH] Set client sampling rate in time for it to be available the first time process is called include/FluidSCWrapper.hpp --- include/FluidSCWrapper.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index 095b449..7a8e40c 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -97,6 +97,7 @@ public: return; } + mClient.sampleRate(fullSampleRate()); mInputConnections.reserve(mClient.audioChannelsIn()); mOutputConnections.reserve(mClient.audioChannelsOut()); mAudioInputs.reserve(mClient.audioChannelsIn()); @@ -115,11 +116,12 @@ public: } for (int i = 0; i < static_cast(mClient.controlChannelsOut()); ++i) { mOutputs.emplace_back(nullptr, 0, 0); } - + + set_calc_function(); Wrapper::getInterfaceTable()->fClearUnitOutputs(this, 1); - mClient.sampleRate(fullSampleRate()); + } @@ -137,7 +139,7 @@ public: { if (mOutputConnections[i]) mOutputs[i].reset(out(static_cast(i)), 0, fullBufferSize()); } - for (size_t i = 0; i < mClient.controlChannelsOut(); ++i) { mOutputs[i].reset(out(static_cast(i)), 0, 1); } + for (size_t i = 0; i < mClient.controlChannelsOut(); ++i) { mOutputs[i].reset(out(i), 0, 1); } mClient.process(mAudioInputs, mOutputs); } @@ -177,7 +179,7 @@ public: if (args->tags && ((std::string{args->tags}.size() - 1) != Client::getParameterDescriptors().count())) { - std::cout << "ERROR: " << Wrapper::getName() << " wrong number of arguments. Expected " + std::cout << "ERROR: " << Wrapper::getName() << " wrong number of arguments. Expected " << Client::getParameterDescriptors().count() << ", got " << (std::string{args->tags}.size() - 1) << ". Your .sc file and binary plugin might be different versions." << std::endl; return;