Update state2.h
Changed a few details to better match the coding style and ABI reliabilty.
///
/// Scenarios for the save() function:
///
-/// - Context `clap_state_context_preset`: The plugin stores all sound settings into the stream
+/// - Context `CLAP_STATE_CONTEXT_PRESET`: The plugin stores all sound settings into the stream
/// and would NOT include any project specific settings (like the hardware's id)
-/// - Context `clap_state_context_project`: The plugin stores all aound settings including
+/// - Context `CLAP_STATE_CONTEXT_PROJECT`: The plugin stores all aound settings including
/// the project specific settings (like the hardware's id)
-/// - Context `clap_state_context_clone`: The plugin stores all relevant settings that allow
+/// - Context `CLAP_STATE_CONTEXT_CLONE`: The plugin stores all relevant settings that allow
/// a new instance of the plugin to be presented as 'duplicate' effectively, like
/// using the next index of an enumeration, a channel etc.
///
/// Scenarios for the load() function:
///
-/// - Context `clap_state_context_preset`: The plugin restores all sound settings from the stream
+/// - Context `CLAP_STATE_CONTEXT_PRESET`: The plugin restores all sound settings from the stream
/// and would IGNORE any project specific settings (like the hardware's id) which possibly
/// is in the stream.
-/// - Context `clap_state_context_project`: The plugin restores all aound settings including
+/// - Context `CLAP_STATE_CONTEXT_PROJECT`: The plugin restores all aound settings including
/// the project specific settings (like the hardware's id). If no project specific settings
/// are in the stream, those should go to default
-/// - Context `clap_state_context_clone`: The plugin restores all relevant settings that allow
+/// - Context `CLAP_STATE_CONTEXT_CLONE`: The plugin restores all relevant settings that allow
/// this instance of the plugin to be presented as 'duplicate' effectively, but probably
/// changing settings in a useful way (like using the next channel, sidechain or whatever)
///
@@ -67,20 +67,20 @@ typedef struct clap_plugin_state2 {
// the state context
typedef enum {
- clap_state_context_preset = 1,
- clap_state_context_project = 2,
- clap_state_context_clone = 3
+ CLAP_STATE_CONTEXT_PROJECT = 1,
+ CLAP_STATE_CONTEXT_PRESET = 2,
+ CLAP_STATE_CONTEXT_CLONE = 3
} clap_plugin_state_context_t;
// Saves the plugin state for a given context into stream.
// Returns true if the state was correctly saved.
// [main-thread]
- bool (*save)(const clap_plugin_t *plugin, clap_plugin_state_context_t context, const clap_ostream_t *stream);
+ bool (*save)(const clap_plugin_t *plugin, uint32_t context, const clap_ostream_t *stream);
// Loads the plugin state from stream in a given context
- // Returns true if the state was correctly restored.
+ // Returns true if the state was correctly loaded.
// [main-thread]
- bool (*load)(const clap_plugin_t *plugin, clap_plugin_state_context_t context, const clap_istream_t *stream);
+ bool (*load)(const clap_plugin_t *plugin, uint32_t context, const clap_istream_t *stream);
} clap_plugin_state2_t;
#ifdef __cplusplus
