From 372a804bdba679f505701b39e11bbec63ff1519c Mon Sep 17 00:00:00 2001 From: Timo Kaluza Date: Thu, 28 Dec 2023 09:19:09 +0100 Subject: [PATCH 1/2] added project load as explicit option --- include/clap/ext/state-context.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/clap/ext/state-context.h b/include/clap/ext/state-context.h index 4ab5f6f4..e27bcef1 100644 --- a/include/clap/ext/state-context.h +++ b/include/clap/ext/state-context.h @@ -10,7 +10,8 @@ /// on the context. /// /// Briefly, when loading a preset or duplicating a device, the plugin may want to partially load -/// the state and initialize certain things differently. +/// the state and initialize certain things differently, like handling limited resources or fixed +/// connections to external hardware resources. /// /// Save and Load operations may have a different context. /// All three operations should be equivalent: @@ -20,6 +21,8 @@ /// clap_plugin_state_context.save(CLAP_STATE_CONTEXT_FOR_PRESET), /// CLAP_STATE_CONTEXT_FOR_PRESET) /// +/// If in doubt, choose CLAP_STATE_CONTEXT_FOR_PRESET as option. +/// /// If the plugin implements CLAP_EXT_STATE_CONTEXT then it is mandatory to also implement /// CLAP_EXT_STATE. @@ -27,14 +30,18 @@ extern "C" { #endif -static CLAP_CONSTEXPR const char CLAP_EXT_STATE_CONTEXT[] = "clap.state-context.draft/1"; +static CLAP_CONSTEXPR const char CLAP_EXT_STATE_CONTEXT[] = "clap.state-context.draft/2"; enum clap_plugin_state_context_type { - // suitable for duplicating a plugin instance - CLAP_STATE_CONTEXT_FOR_DUPLICATE = 1, - // suitable for loading a state as a preset - CLAP_STATE_CONTEXT_FOR_PRESET = 2, + CLAP_STATE_CONTEXT_FOR_PRESET = 1, + + // suitable for duplicating a plugin instance + CLAP_STATE_CONTEXT_FOR_DUPLICATE = 2, + + // suitable for loading a state during loading a project/song + CLAP_STATE_CONTEXT_FOR_PROJECT = 3, + }; typedef struct clap_plugin_state_context { From 59e922087f3b00b19e8ff70398000d5fb3a6c302 Mon Sep 17 00:00:00 2001 From: defiantnerd Date: Thu, 28 Dec 2023 09:25:41 +0100 Subject: [PATCH 2/2] added project load as explicit option --- include/clap/ext/state-context.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/clap/ext/state-context.h b/include/clap/ext/state-context.h index 4ab5f6f4..e27bcef1 100644 --- a/include/clap/ext/state-context.h +++ b/include/clap/ext/state-context.h @@ -10,7 +10,8 @@ /// on the context. /// /// Briefly, when loading a preset or duplicating a device, the plugin may want to partially load -/// the state and initialize certain things differently. +/// the state and initialize certain things differently, like handling limited resources or fixed +/// connections to external hardware resources. /// /// Save and Load operations may have a different context. /// All three operations should be equivalent: @@ -20,6 +21,8 @@ /// clap_plugin_state_context.save(CLAP_STATE_CONTEXT_FOR_PRESET), /// CLAP_STATE_CONTEXT_FOR_PRESET) /// +/// If in doubt, choose CLAP_STATE_CONTEXT_FOR_PRESET as option. +/// /// If the plugin implements CLAP_EXT_STATE_CONTEXT then it is mandatory to also implement /// CLAP_EXT_STATE. @@ -27,14 +30,18 @@ extern "C" { #endif -static CLAP_CONSTEXPR const char CLAP_EXT_STATE_CONTEXT[] = "clap.state-context.draft/1"; +static CLAP_CONSTEXPR const char CLAP_EXT_STATE_CONTEXT[] = "clap.state-context.draft/2"; enum clap_plugin_state_context_type { - // suitable for duplicating a plugin instance - CLAP_STATE_CONTEXT_FOR_DUPLICATE = 1, - // suitable for loading a state as a preset - CLAP_STATE_CONTEXT_FOR_PRESET = 2, + CLAP_STATE_CONTEXT_FOR_PRESET = 1, + + // suitable for duplicating a plugin instance + CLAP_STATE_CONTEXT_FOR_DUPLICATE = 2, + + // suitable for loading a state during loading a project/song + CLAP_STATE_CONTEXT_FOR_PROJECT = 3, + }; typedef struct clap_plugin_state_context {