Cleanup
[carla.git] / source / includes / clap / ext / state.h
blob329ba45f6ccba3cfed6597ec84261b6094b3f803
1 #pragma once
3 #include "../plugin.h"
4 #include "../stream.h"
6 static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap.state";
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 typedef struct clap_plugin_state {
13 // Saves the plugin state into stream.
14 // Returns true if the state was correctly saved.
15 // [main-thread]
16 bool (CLAP_ABI *save)(const clap_plugin_t *plugin, const clap_ostream_t *stream);
18 // Loads the plugin state from stream.
19 // Returns true if the state was correctly restored.
20 // [main-thread]
21 bool (CLAP_ABI *load)(const clap_plugin_t *plugin, const clap_istream_t *stream);
22 } clap_plugin_state_t;
24 typedef struct clap_host_state {
25 // Tell the host that the plugin state has changed and should be saved again.
26 // If a parameter value changes, then it is implicit that the state is dirty.
27 // [main-thread]
28 void (CLAP_ABI *mark_dirty)(const clap_host_t *host);
29 } clap_host_state_t;
31 #ifdef __cplusplus
33 #endif