clap

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

commit fd83c02be8d9e05f40a8e62eaaf882342d529936
parent 43d80c5faf90e3d87546a321f1528a3418c21846
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Wed, 17 Jan 2024 17:46:04 +0100

Rename clap_plugin_id_t to clap_universal_plugin_id_t

Diffstat:
MChangeLog.md | 5+++++
Minclude/clap/clap.h | 2+-
Minclude/clap/factory/draft/plugin-state-converter.h | 6+++---
Minclude/clap/factory/preset-discovery.h | 4++--
Dinclude/clap/plugin-id.h | 23-----------------------
Ainclude/clap/universal-plugin-id.h | 26++++++++++++++++++++++++++
6 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md @@ -36,6 +36,7 @@ We may decide to remove the `*_COMPAT` IDs in the future once their usage become * `CLAP_EXT_CV` the interface wasn't satisfying. ## Stabilize factory + * `CLAP_PRESET_DISCOVERY_FACTORY_ID` Note: we kept the last draft factory ID in order to not break plugins already using it. @@ -44,6 +45,10 @@ Note: we kept the last draft factory ID in order to not break plugins already us * Introduction of a new factory which provides a plugin state convertion mechanism. +## Refactoring + +* `clap_plugin_id_t` was renamed to `clap_universal_plugin_id_t` to make it clear that it can describe more than just a CLAP plugin ID. + ## Documentation * [events.h](include/clap/events.h): Clarify how "Port Channel Key NoteID" matching works diff --git a/include/clap/clap.h b/include/clap/clap.h @@ -33,7 +33,7 @@ #include "plugin.h" #include "plugin-features.h" #include "host.h" -#include "plugin-id.h" +#include "universal-plugin-id.h" #include "ext/ambisonic.h" #include "ext/audio-ports-activation.h" diff --git a/include/clap/factory/draft/plugin-state-converter.h b/include/clap/factory/draft/plugin-state-converter.h @@ -1,7 +1,7 @@ #pragma once #include "../../id.h" -#include "../../plugin-id.h" +#include "../../universal-plugin-id.h" #include "../../stream.h" #include "../../version.h" @@ -12,8 +12,8 @@ extern "C" { typedef struct clap_plugin_state_converter_descriptor { clap_version_t clap_version; - clap_plugin_id_t src_plugin_id; - clap_plugin_id_t dst_plugin_id; + clap_universal_plugin_id_t src_plugin_id; + clap_universal_plugin_id_t dst_plugin_id; const char *name; const char *vendor; diff --git a/include/clap/factory/preset-discovery.h b/include/clap/factory/preset-discovery.h @@ -44,7 +44,7 @@ #include "../private/std.h" #include "../private/macros.h" #include "../version.h" -#include "../plugin-id.h" +#include "../universal-plugin-id.h" // Use it to retrieve const clap_preset_discovery_factory_t* from // clap_plugin_entry.get_factory() @@ -133,7 +133,7 @@ typedef struct clap_preset_discovery_metadata_receiver { // Adds a plug-in id that this preset can be used with. void(CLAP_ABI *add_plugin_id)(const struct clap_preset_discovery_metadata_receiver *receiver, - const clap_plugin_id_t *plugin_id); + const clap_universal_plugin_id_t *plugin_id); // Sets the sound pack to which the preset belongs to. void(CLAP_ABI *set_soundpack_id)(const struct clap_preset_discovery_metadata_receiver *receiver, diff --git a/include/clap/plugin-id.h b/include/clap/plugin-id.h @@ -1,23 +0,0 @@ -#pragma once - -// Pair of plugin ABI and plugin identifier. -typedef struct clap_plugin_id { - // The plugin ABI name, in lowercase. - // eg: "clap", "vst3", "vst2", "au", "lv2", ... - const char *abi; - - // The plugin ID, formatted as follow: - // - // CLAP: use the plugin id - // eg: "com.u-he.diva" - // - // AU: format the string like "type:subt:manu" - // eg: "aumu:SgXT:VmbA" - // - // VST2: print the id as a signed 32-bits integer - // eg: "-4382976" - // - // VST3: print the id as a standard UUID - // eg: "123e4567-e89b-12d3-a456-426614174000" - const char *id; -} clap_plugin_id_t; diff --git a/include/clap/universal-plugin-id.h b/include/clap/universal-plugin-id.h @@ -0,0 +1,26 @@ +#pragma once + +// Pair of plugin ABI and plugin identifier. +// +// If you want to represent other formats please send us an update to the comment with the +// name of the abi and the representation of the id. +typedef struct clap_universal_plugin_id { + // The plugin ABI name, in lowercase. + // eg: "clap", "vst3", "vst2", "au", ... + const char *abi; + + // The plugin ID, formatted as follow: + // + // CLAP: use the plugin id + // eg: "com.u-he.diva" + // + // AU: format the string like "type:subt:manu" + // eg: "aumu:SgXT:VmbA" + // + // VST2: print the id as a signed 32-bits integer + // eg: "-4382976" + // + // VST3: print the id as a standard UUID + // eg: "123e4567-e89b-12d3-a456-426614174000" + const char *id; +} clap_universal_plugin_id_t;