From 80fc25aecb6398e2b8688d98c227f1917aed779b Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 27 Feb 2019 04:18:52 +0100 Subject: [PATCH] carla-vst: Fix typo leading to bufsize of 1, add ardour workaround Signed-off-by: falkTX --- source/plugin/carla-vst.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/plugin/carla-vst.cpp b/source/plugin/carla-vst.cpp index bf1eaeb45..5a1226e9f 100644 --- a/source/plugin/carla-vst.cpp +++ b/source/plugin/carla-vst.cpp @@ -84,7 +84,9 @@ public: // find host type const String hostFilename(File::getSpecialLocation(File::hostApplicationPath).getFileName()); - if (hostFilename.startsWith("Bitwig")) + /**/ if (hostFilename.startsWith("ardour")) + fHostType = kHostTypeArdour; + else if (hostFilename.startsWith("Bitwig")) fHostType = kHostTypeBitwig; fHost.resourceDir = carla_strdup(resDir.getFullPathName().toRawUTF8()); @@ -218,12 +220,12 @@ public: const uint32_t bufferSize = static_cast(hostCallback(audioMasterGetBlockSize)); const double sampleRate = static_cast(hostCallback(audioMasterGetSampleRate)); - if (bufferSize != 0 && fBufferSize != bufferSize) + if (bufferSize != 0 && fBufferSize != bufferSize && (fHostType != kHostTypeArdour || fBufferSize == 0)) { fBufferSize = bufferSize; if (fDescriptor->dispatcher != nullptr) - fDescriptor->dispatcher(fHandle, NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED, 0, (int32_t)value, nullptr, 0.0f); + fDescriptor->dispatcher(fHandle, NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED, 0, bufferSize, nullptr, 0.0f); } if (carla_isNotZero(sampleRate) && carla_isNotEqual(fSampleRate, sampleRate)) @@ -600,6 +602,7 @@ private: // Host data enum HostType { kHostTypeNull = 0, + kHostTypeArdour, kHostTypeBitwig }; HostType fHostType;