Browse Source

Load and test all internal plugins

tags/v2.3.0-RC1
falkTX 5 years ago
parent
commit
96e56c02d4
2 changed files with 28 additions and 5 deletions
  1. +2
    -1
      source/tests/Makefile
  2. +26
    -4
      source/tests/carla-host-plugin.c

+ 2
- 1
source/tests/Makefile View File

@@ -87,6 +87,7 @@ ansi-%_run: $(BINDIR)/ansi-%
$(BINDIR)/ansi-$*

carla-%_run: $(BINDIR)/carla-%
# valgrind $(BINDIR)/carla-$*
valgrind --leak-check=full --show-leak-kinds=all --suppressions=valgrind.supp $(BINDIR)/carla-$*

# ---------------------------------------------------------------------------------------------------------------------
@@ -120,7 +121,7 @@ $(BINDIR)/ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h .
# ---------------------------------------------------------------------------------------------------------------------

$(BINDIR)/carla-host-plugin: carla-host-plugin.c
$(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -Wno-declaration-after-statement -Wno-pedantic -lcarla_host-plugin -ansi -o $@
$(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -g -O0 -Wno-declaration-after-statement -Wno-pedantic -lcarla_host-plugin -std=c99 -o $@

# ---------------------------------------------------------------------------------------------------------------------



+ 26
- 4
source/tests/carla-host-plugin.c View File

@@ -18,6 +18,7 @@
#include "CarlaNativePlugin.h"

#include <assert.h>
#include <stdio.h>

static uint32_t get_buffer_size(NativeHostHandle h)
{
@@ -78,8 +79,8 @@ int main(void)

const char* const utils_folder = carla_utils_get_library_folder();
assert(utils_folder != NULL && utils_folder[0] != '\0');
/*
carla_juce_init();*/
carla_juce_init();

const NativePluginDescriptor* const rack = carla_get_native_rack_plugin();
assert(rack != NULL);
@@ -99,12 +100,33 @@ int main(void)
const CarlaHostHandle patchbay_host_handle = carla_create_native_plugin_host_handle(patchbay, patchbay_handle);
assert(patchbay_host_handle);

uint32_t plugins_count = 0;
const NativePluginDescriptor* const plugin_descriptors = carla_get_native_plugins_data(&plugins_count);
assert(plugins_count != 0);
assert(plugin_descriptors != NULL);

for (uint32_t i=0; i<plugins_count; ++i)
{
const NativePluginDescriptor* const plugin_descriptor = &plugin_descriptors[i];
assert(plugin_descriptor->label != NULL);

printf("Loading plugin #%u '%s'\n", i+1, plugin_descriptor->label);

if ((plugin_descriptor->hints & NATIVE_PLUGIN_USES_CONTROL_VOLTAGE) == 0x0) {
assert(carla_add_plugin(rack_host_handle, BINARY_NATIVE, PLUGIN_INTERNAL, "", "", plugin_descriptor->label, 0, NULL, 0x0));
}

if (plugin_descriptor->midiIns <= 1 && plugin_descriptor->midiOuts <= 1) {
assert(carla_add_plugin(patchbay_host_handle, BINARY_NATIVE, PLUGIN_INTERNAL, "", "", plugin_descriptor->label, 0, NULL, 0x0));
}
}

rack->cleanup(patchbay_handle);
rack->cleanup(rack_handle);

carla_host_handle_free(patchbay_host_handle);
carla_host_handle_free(rack_host_handle);
/*
carla_juce_cleanup();*/
carla_juce_cleanup();
return 0;
}

Loading…
Cancel
Save