clap_sys/ext/
state_context.rs

1use crate::{cstr, plugin::*, stream::*};
2
3use std::ffi::CStr;
4
5pub const CLAP_EXT_STATE_CONTEXT: &CStr = cstr!("clap.state-context/2");
6
7pub const CLAP_STATE_CONTEXT_FOR_PRESET: clap_plugin_state_context_type = 1;
8pub const CLAP_STATE_CONTEXT_FOR_DUPLICATE: clap_plugin_state_context_type = 2;
9pub const CLAP_STATE_CONTEXT_FOR_PROJECT: clap_plugin_state_context_type = 3;
10
11pub type clap_plugin_state_context_type = u32;
12
13#[repr(C)]
14#[derive(Debug, Copy, Clone)]
15pub struct clap_plugin_state_context {
16    pub save: Option<
17        unsafe extern "C" fn(
18            plugin: *const clap_plugin,
19            stream: *const clap_ostream,
20            context_type: clap_plugin_state_context_type,
21        ) -> bool,
22    >,
23    pub load: Option<
24        unsafe extern "C" fn(
25            plugin: *const clap_plugin,
26            stream: *const clap_istream,
27            context_type: clap_plugin_state_context_type,
28        ) -> bool,
29    >,
30}