Browse Source

carla-vst: Fix typo leading to bufsize of 1, add ardour workaround

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.9.14
falkTX 5 years ago
parent
commit
80fc25aecb
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      source/plugin/carla-vst.cpp

+ 6
- 3
source/plugin/carla-vst.cpp View File

@@ -84,7 +84,9 @@ public:
// find host type // find host type
const String hostFilename(File::getSpecialLocation(File::hostApplicationPath).getFileName()); 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; fHostType = kHostTypeBitwig;


fHost.resourceDir = carla_strdup(resDir.getFullPathName().toRawUTF8()); fHost.resourceDir = carla_strdup(resDir.getFullPathName().toRawUTF8());
@@ -218,12 +220,12 @@ public:
const uint32_t bufferSize = static_cast<uint32_t>(hostCallback(audioMasterGetBlockSize)); const uint32_t bufferSize = static_cast<uint32_t>(hostCallback(audioMasterGetBlockSize));
const double sampleRate = static_cast<double>(hostCallback(audioMasterGetSampleRate)); const double sampleRate = static_cast<double>(hostCallback(audioMasterGetSampleRate));


if (bufferSize != 0 && fBufferSize != bufferSize)
if (bufferSize != 0 && fBufferSize != bufferSize && (fHostType != kHostTypeArdour || fBufferSize == 0))
{ {
fBufferSize = bufferSize; fBufferSize = bufferSize;


if (fDescriptor->dispatcher != nullptr) 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)) if (carla_isNotZero(sampleRate) && carla_isNotEqual(fSampleRate, sampleRate))
@@ -600,6 +602,7 @@ private:
// Host data // Host data
enum HostType { enum HostType {
kHostTypeNull = 0, kHostTypeNull = 0,
kHostTypeArdour,
kHostTypeBitwig kHostTypeBitwig
}; };
HostType fHostType; HostType fHostType;


Loading…
Cancel
Save