clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit c1f12e895951b20809df321271cc3b0c2083dd34
parent 874619974e3e03a2314921dba33977599ecbab17
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Tue,  3 May 2022 19:34:42 +0200

Start the plugin template

Diffstat:
MCMakeLists.txt | 4++++
Asrc/plugin-template.c | 38++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -18,6 +18,10 @@ add_executable(clap-compile-cpp EXCLUDE_FROM_ALL src/main.cc) target_link_libraries(clap-compile-cpp clap-core) set_target_properties(clap-compile-cpp PROPERTIES CXX_STANDARD 14) +add_library(clap-plugin-template EXCLUDE_FROM_ALL src/plugin-template.c) +target_link_libraries(clap-plugin-template clap-core) +set_target_properties(clap-plugin-template PROPERTIES C_STANDARD 11) + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(clap-compile-c PRIVATE -Wall -Wextra -pedantic) target_compile_options(clap-compile-cpp PRIVATE -Wall -Wextra -pedantic) diff --git a/src/plugin-template.c b/src/plugin-template.c @@ -0,0 +1,38 @@ +#include <clap/clap.h> + +static const clap_plugin_descriptor_t g_plugin_desc = { + .id = "com.your-company.YourPlugin", + .name = "Plugin Name", + .vendor = "Vendor", + .url = "https://your-domain.com/your-plugin", + .manual_url = "https://your-domain.com/your-plugin/manual", + .support_url = "https://your-domain.com/support", + .version = "1.4.2", + .description = "This is a spectral synthesizer made to blow your mind.", + .features = (const char*[]){ + "instrument", "additive", "surround" + }, +}; + +static bool entry_init(const char *plugin_path) +{ + // called only once, and first + return true; +} + +static void entry_deinit(void) +{ + // called last +} + +static const void *entry_get_factory(const char *factory_id) +{ + return NULL; +} + +CLAP_EXPORT const clap_plugin_entry_t clap_entry = { + .clap_version = CLAP_VERSION, + .init = entry_init, + .deinit = entry_deinit, + .get_factory = entry_get_factory, +};