Skip to content

Commit

Permalink
Merge pull request #375 from defiantnerd/next
Browse files Browse the repository at this point in the history
added project load as explicit option
  • Loading branch information
abique authored Jan 8, 2024
2 parents 29a0b08 + 01296c4 commit b9a6470
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions include/clap/ext/state-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -20,21 +21,27 @@
/// 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.

#ifdef __cplusplus
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/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 {
Expand Down

0 comments on commit b9a6470

Please sign in to comment.