2
2
3
3
#include "../../plugin.h"
4
4
5
- static CLAP_CONSTEXPR const char CLAP_EXT_UNDO [] = "clap.undo/2 " ;
5
+ static CLAP_CONSTEXPR const char CLAP_EXT_UNDO [] = "clap.undo/3 " ;
6
6
7
7
#ifdef __cplusplus
8
8
extern "C" {
@@ -76,14 +76,23 @@ typedef struct clap_plugin_undo {
76
76
bool (CLAP_ABI * can_use_delta_format_version )(const clap_plugin_t * plugin ,
77
77
clap_id format_version );
78
78
79
- // Applies synchronously a delta.
79
+ // Undo using the delta.
80
80
// Returns true on success.
81
81
//
82
82
// [main-thread]
83
- bool (CLAP_ABI * apply_delta )(const clap_plugin_t * plugin ,
84
- clap_id format_version ,
85
- const void * delta ,
86
- size_t delta_size );
83
+ bool (CLAP_ABI * undo )(const clap_plugin_t * plugin ,
84
+ clap_id format_version ,
85
+ const void * delta ,
86
+ size_t delta_size );
87
+
88
+ // Redo using the delta.
89
+ // Returns true on success.
90
+ //
91
+ // [main-thread]
92
+ bool (CLAP_ABI * redo )(const clap_plugin_t * plugin ,
93
+ clap_id format_version ,
94
+ const void * delta ,
95
+ size_t delta_size );
87
96
88
97
// Sets the undo context.
89
98
// flags: bitmask of clap_undo_context_flags values
@@ -112,7 +121,7 @@ typedef struct clap_host_undo {
112
121
//
113
122
// name: mandatory null terminated string describing the change, this is displayed to the user
114
123
//
115
- // deltas : optional, they are binary blobs used to perform the undo and redo. When not available
124
+ // delta : optional, it is a binary blobs used to perform the undo and redo. When not available
116
125
// the host will save the plugin state and use state->load() to perform undo and redo.
117
126
//
118
127
// Note: the provided delta may be used for incremental state saving and crash recovery. The
@@ -128,18 +137,16 @@ typedef struct clap_host_undo {
128
137
// [main-thread]
129
138
void (CLAP_ABI * change_made )(const clap_host_t * host ,
130
139
const char * name ,
131
- const void * redo_delta ,
132
- size_t redo_delta_size ,
133
- const void * undo_delta ,
134
- size_t undo_delta_size );
140
+ const void * delta ,
141
+ size_t delta_size );
135
142
136
143
// Asks the host to perform the next undo step.
137
- // This operation may be asynchronous.
144
+ // This operation may be asynchronous and isn't available while the host is within a change .
138
145
// [main-thread]
139
146
void (CLAP_ABI * undo )(const clap_host_t * host );
140
147
141
148
// Asks the host to perform the next redo step.
142
- // This operation may be asynchronous.
149
+ // This operation may be asynchronous and isn't available while the host is within a change .
143
150
// [main-thread]
144
151
void (CLAP_ABI * redo )(const clap_host_t * host );
145
152
0 commit comments