Skip to content

Commit

Permalink
Adjust state context's documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Jan 8, 2024
1 parent b9a6470 commit aa670d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/clap/ext/state-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
/// 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 in doubt, fallback to clap_plugin_state.
///
/// If the plugin implements CLAP_EXT_STATE_CONTEXT then it is mandatory to also implement
/// CLAP_EXT_STATE.
///
/// It is unspecified which context is equivalent to clap_plugin_state.{save,load}()

#ifdef __cplusplus
extern "C" {
Expand All @@ -33,15 +35,14 @@ extern "C" {
static CLAP_CONSTEXPR const char CLAP_EXT_STATE_CONTEXT[] = "clap.state-context/2";

enum clap_plugin_state_context_type {
// suitable for loading a state as a preset
// suitable for storing and loading a state as a preset
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
// suitable for storing and loading a state within a project/song
CLAP_STATE_CONTEXT_FOR_PROJECT = 3,

};

typedef struct clap_plugin_state_context {
Expand Down
4 changes: 4 additions & 0 deletions include/clap/ext/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
/// values and non-parameter state. This is used to persist a plugin's state
/// between project reloads, when duplicating and copying plugin instances, and
/// for host-side preset management.
///
/// If you need to know if the save/load operation is meant for duplicating a plugin
/// instance, for saving/loading a plugin preset or while saving/loading the project
/// then have a look at clap_plugin_state_context_t.

static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap.state";

Expand Down

0 comments on commit aa670d1

Please sign in to comment.