commit d1274b8538d173c708552ced7b05120b1df270d4
parent 92f68fcb197e5a88eb0229ea194a899927b3b71e
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Mon, 22 Apr 2024 11:02:45 +0200
Rule for implicit changes
Diffstat:
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/include/clap/ext/draft/undo.h b/include/clap/ext/draft/undo.h
@@ -41,9 +41,6 @@ extern "C" {
/// and maybe an easier experience for the user because there's a single undo context versus one
/// for the host and one for each plugin instance.
-// When supported, the plugin doesn't need to call host->change_made() after a parameter set.
-static CLAP_CONSTEXPR const char CLAP_UNDO_IMPLICIT_PARAM_SET[] = "param-set";
-
enum clap_undo_context_flags {
// While the host is within a change, it is impossible to perform undo or redo.
CLAP_UNDO_IS_WITHIN_CHANGE = 1 << 0,
@@ -79,17 +76,6 @@ typedef struct clap_plugin_undo {
bool(CLAP_ABI *can_use_delta_format_version)(const clap_plugin_t *plugin,
clap_id format_version);
- // Enables implicit change for this change_type.
- // See CLAP_UNDO_IMPLICIT_PARAM_SET.
- //
- // An implicit change is a change that is reported and understood by the host, so it doesn't
- // require the plugin declare it by calling host->change_made().
- // For example, the host could create the undo step after changing a parameter value.
- //
- // Returns true if supported by the plugin.
- // [main-thread]
- bool(CLAP_ABI *enable_implicit_change)(const clap_plugin_t *plugin, const char *change_type);
-
// Applies synchronously a delta.
// Returns true on success.
//
@@ -135,6 +121,10 @@ typedef struct clap_host_undo {
// If the plugin is not able to use a delta, a notification should be produced to the user and
// the crash recovery will do a best effort job, at least restore the latest saved state.
//
+ // Special case: for objects with shared and synchronized state, changes shouldn't be reported
+ // as the host already knows about it.
+ // For example, plugin parameters changes shouldn't produce a call to change_made().
+ //
// [main-thread]
void(CLAP_ABI *change_made)(const clap_host_t *host,
const char *name,