1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use crate::{cstr, plugin::*, stream::*};

use std::ffi::CStr;

pub const CLAP_EXT_STATE_CONTEXT: &CStr = cstr!("clap.state-context.draft/1");

pub const CLAP_STATE_CONTEXT_FOR_DUPLICATE: clap_plugin_state_context_type = 1;
pub const CLAP_STATE_CONTEXT_FOR_PRESET: clap_plugin_state_context_type = 2;

pub type clap_plugin_state_context_type = u32;

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct clap_plugin_state_context {
    pub save: Option<
        unsafe extern "C" fn(
            plugin: *const clap_plugin,
            stream: *const clap_ostream,
            context_type: clap_plugin_state_context_type,
        ) -> bool,
    >,
    pub load: Option<
        unsafe extern "C" fn(
            plugin: *const clap_plugin,
            stream: *const clap_istream,
            context_type: clap_plugin_state_context_type,
        ) -> bool,
    >,
}