From fd83c02be8d9e05f40a8e62eaaf882342d529936 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 17 Jan 2024 17:46:31 +0100 Subject: [PATCH] Rename clap_plugin_id_t to clap_universal_plugin_id_t --- ChangeLog.md | 5 +++++ include/clap/clap.h | 2 +- include/clap/factory/draft/plugin-state-converter.h | 6 +++--- include/clap/factory/preset-discovery.h | 4 ++-- include/clap/{plugin-id.h => universal-plugin-id.h} | 9 ++++++--- 5 files changed, 17 insertions(+), 9 deletions(-) rename include/clap/{plugin-id.h => universal-plugin-id.h} (66%) diff --git a/ChangeLog.md b/ChangeLog.md index 2cbdf2e3..8f021deb 100644 --- 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 index b37328a2..6da56764 100644 --- 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 index 19c96ad3..315926e7 100644 --- 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 index f9c8e434..794f4967 100644 --- 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/universal-plugin-id.h similarity index 66% rename from include/clap/plugin-id.h rename to include/clap/universal-plugin-id.h index 438cbfe8..dda0cab2 100644 --- a/include/clap/plugin-id.h +++ b/include/clap/universal-plugin-id.h @@ -1,9 +1,12 @@ #pragma once // Pair of plugin ABI and plugin identifier. -typedef struct clap_plugin_id { +// +// 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", "lv2", ... + // eg: "clap", "vst3", "vst2", "au", ... const char *abi; // The plugin ID, formatted as follow: @@ -20,4 +23,4 @@ typedef struct clap_plugin_id { // VST3: print the id as a standard UUID // eg: "123e4567-e89b-12d3-a456-426614174000" const char *id; -} clap_plugin_id_t; +} clap_universal_plugin_id_t;