Browse Source

Add discovery workaround for JUCE-based CLAP plugins

Signed-off-by: falkTX <falktx@falktx.com>
pull/1723/head
falkTX 2 years ago
parent
commit
7a56a64213
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 29 additions and 5 deletions
  1. +29
    -5
      source/discovery/carla-discovery.cpp

+ 29
- 5
source/discovery/carla-discovery.cpp View File

@@ -1861,10 +1861,26 @@ struct carla_clap_host : clap_host_t {
request_callback = carla_request_callback; request_callback = carla_request_callback;
} }


static CLAP_ABI const void* carla_get_extension(const clap_host_t*, const char*) { return nullptr; }
static CLAP_ABI void carla_request_restart(const clap_host_t*) {}
static CLAP_ABI void carla_request_process(const clap_host_t*) {}
static CLAP_ABI void carla_request_callback(const clap_host_t*) {}
static CLAP_ABI const void* carla_get_extension(const clap_host_t* const host, const char* const extension_id)
{
carla_stdout("carla_get_extension %p %s", host, extension_id);
return nullptr;
}

static CLAP_ABI void carla_request_restart(const clap_host_t* const host)
{
carla_stdout("carla_request_restart %p", host);
}

static CLAP_ABI void carla_request_process(const clap_host_t* const host)
{
carla_stdout("carla_request_process %p", host);
}

static CLAP_ABI void carla_request_callback(const clap_host_t* const host)
{
carla_stdout("carla_request_callback %p", host);
}
}; };


static void do_clap_check(lib_t& libHandle, const char* const filename, const bool doInit) static void do_clap_check(lib_t& libHandle, const char* const filename, const bool doInit)
@@ -1932,6 +1948,13 @@ static void do_clap_check(lib_t& libHandle, const char* const filename, const bo
const clap_plugin_t* const plugin = factory->create_plugin(factory, &host, desc->id); const clap_plugin_t* const plugin = factory->create_plugin(factory, &host, desc->id);
CARLA_SAFE_ASSERT_CONTINUE(plugin != nullptr); CARLA_SAFE_ASSERT_CONTINUE(plugin != nullptr);


// FIXME this is not needed per spec, but JUCE-based CLAP plugins crash without it :(
if (!plugin->init(plugin))
{
plugin->destroy(plugin);
continue;
}

uint hints = 0x0; uint hints = 0x0;
uint audioIns = 0; uint audioIns = 0;
uint audioOuts = 0; uint audioOuts = 0;
@@ -2035,7 +2058,8 @@ static void do_clap_check(lib_t& libHandle, const char* const filename, const bo
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// start crash-free plugin test // start crash-free plugin test


plugin->init(plugin);
// FIXME already initiated before, because broken plugins etc
// plugin->init(plugin);


// TODO // TODO




Loading…
Cancel
Save