Browse Source

Only run LS in bridge mode when absolutely necessary

tags/1.9.7
falkTX 9 years ago
parent
commit
77643b3425
4 changed files with 25 additions and 3 deletions
  1. +15
    -2
      source/backend/engine/CarlaEngine.cpp
  2. +4
    -0
      source/backend/engine/CarlaEngineInternal.cpp
  3. +6
    -0
      source/backend/engine/CarlaEngineInternal.hpp
  4. +0
    -1
      source/backend/plugin/CarlaPluginLinuxSampler.cpp

+ 15
- 2
source/backend/engine/CarlaEngine.cpp View File

@@ -491,9 +491,18 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype,
preferBridges = true;
}
// FIXME: linuxsampler inside carla-rack/patchbay plugin has some issues (only last kit makes noise)
else if (getType() == kEngineTypePlugin)
else if (getType() == kEngineTypePlugin && (ptype == PLUGIN_GIG || ptype == PLUGIN_SFZ))
{
if (ptype == PLUGIN_GIG || ptype == PLUGIN_SFZ)
// if we're not loading a project consider all is ok
if (! pData->loadingProject)
pData->firstLinuxSamplerInstance = true;

// loading a project, revert first status if set
else if (pData->firstLinuxSamplerInstance)
pData->firstLinuxSamplerInstance = false;

// now check if bridge is needed
if (! pData->firstLinuxSamplerInstance)
preferBridges = true;
}
}
@@ -1839,6 +1848,10 @@ bool CarlaEngine::loadProjectInternal(juce::XmlDocument& xmlDoc)
return false;
}

#ifndef BUILD_BRIDGE
const ScopedValueSetter<bool> _svs(pData->loadingProject, true, false);
#endif

// completely load file
xmlElement = xmlDoc.getDocumentElement(false);
CARLA_SAFE_ASSERT_RETURN_ERR(xmlElement != nullptr, "Failed to completely parse project file");


+ 4
- 0
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -103,6 +103,10 @@ CarlaEngine::ProtectedData::ProtectedData(CarlaEngine* const engine) noexcept
callbackPtr(nullptr),
fileCallback(nullptr),
fileCallbackPtr(nullptr),
#ifndef BUILD_BRIDGE
firstLinuxSamplerInstance(true),
loadingProject(false),
#endif
hints(0x0),
bufferSize(0),
sampleRate(0.0),


+ 6
- 0
source/backend/engine/CarlaEngineInternal.hpp View File

@@ -173,6 +173,12 @@ struct CarlaEngine::ProtectedData {
FileCallbackFunc fileCallback;
void* fileCallbackPtr;

#ifndef BUILD_BRIDGE
// special hack for linuxsampler
bool firstLinuxSamplerInstance;
bool loadingProject;
#endif

uint hints;
uint32_t bufferSize;
double sampleRate;


+ 0
- 1
source/backend/plugin/CarlaPluginLinuxSampler.cpp View File

@@ -33,7 +33,6 @@

#include "juce_core.h"

#include "linuxsampler/EngineFactory.h"
#include <linuxsampler/Sampler.h>

// -----------------------------------------------------------------------


Loading…
Cancel
Save