Browse Source

Implement carla_plugin_discovery_skip

Signed-off-by: falkTX <falktx@falktx.com>
fix-audiofile-buffering
falkTX 1 year ago
parent
commit
c4f73b32ca
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 21 additions and 3 deletions
  1. +7
    -0
      source/backend/CarlaUtils.h
  2. +14
    -3
      source/backend/utils/PluginDiscovery.cpp

+ 7
- 0
source/backend/CarlaUtils.h View File

@@ -316,6 +316,13 @@ CARLA_PLUGIN_EXPORT CarlaPluginDiscoveryHandle carla_plugin_discovery_start(cons
*/ */
CARLA_PLUGIN_EXPORT bool carla_plugin_discovery_idle(CarlaPluginDiscoveryHandle handle); CARLA_PLUGIN_EXPORT bool carla_plugin_discovery_idle(CarlaPluginDiscoveryHandle handle);


/*!
* Skip the current plugin being discovered.
* Carla automatically skips a plugin if 30s have passed without a reply from the discovery side,
* this function allows to manually abort earlier than that.
*/
CARLA_PLUGIN_EXPORT void carla_plugin_discovery_skip(CarlaPluginDiscoveryHandle handle);

/*! /*!
* Stop plugin discovery. * Stop plugin discovery.
* Can be called early while the scanning is still active. * Can be called early while the scanning is still active.


+ 14
- 3
source/backend/utils/PluginDiscovery.cpp View File

@@ -150,6 +150,12 @@ public:
return true; return true;
} }


void skip()
{
if (isPipeRunning())
stopPipeServer(1000);
}

protected: protected:
bool msgReceived(const char* const msg) noexcept bool msgReceived(const char* const msg) noexcept
{ {
@@ -377,7 +383,7 @@ private:
if (fCheckCacheCallback(fCallbackPtr, filename.toRawUTF8(), fNextSha1Sum)) if (fCheckCacheCallback(fCallbackPtr, filename.toRawUTF8(), fNextSha1Sum))
{ {
fPluginsFoundInBinary = true; fPluginsFoundInBinary = true;
carla_stdout("Skipping \"%s\", using cache", filename.toRawUTF8());
carla_debug("Skipping \"%s\", using cache", filename.toRawUTF8());
return; return;
} }
} }
@@ -613,12 +619,17 @@ CarlaPluginDiscoveryHandle carla_plugin_discovery_start(const char* const discov
return new CarlaPluginDiscovery(discoveryTool, ptype, std::move(files), discoveryCb, checkCacheCb, callbackPtr); return new CarlaPluginDiscovery(discoveryTool, ptype, std::move(files), discoveryCb, checkCacheCb, callbackPtr);
} }


bool carla_plugin_discovery_idle(CarlaPluginDiscoveryHandle handle)
bool carla_plugin_discovery_idle(const CarlaPluginDiscoveryHandle handle)
{ {
return static_cast<CarlaPluginDiscovery*>(handle)->idle(); return static_cast<CarlaPluginDiscovery*>(handle)->idle();
} }


void carla_plugin_discovery_stop(CarlaPluginDiscoveryHandle handle)
void carla_plugin_discovery_skip(const CarlaPluginDiscoveryHandle handle)
{
static_cast<CarlaPluginDiscovery*>(handle)->skip();
}

void carla_plugin_discovery_stop(const CarlaPluginDiscoveryHandle handle)
{ {
delete static_cast<CarlaPluginDiscovery*>(handle); delete static_cast<CarlaPluginDiscovery*>(handle);
} }


Loading…
Cancel
Save