|
1 | 1 | use std::{collections::BTreeMap, ffi::{CStr, c_char, c_void}, iter::zip, ptr::{null, null_mut}, sync::{Arc, atomic::{AtomicBool, AtomicUsize, Ordering}}}; |
2 | 2 |
|
3 | 3 | use atomic_refcell::AtomicRefCell; |
4 | | -use clap_sys::{events::clap_input_events, ext::{audio_ports::CLAP_EXT_AUDIO_PORTS, gui::{clap_host_gui, CLAP_EXT_GUI}, latency::CLAP_EXT_LATENCY, note_ports::CLAP_EXT_NOTE_PORTS, params::{clap_host_params, CLAP_EXT_PARAMS}, render::CLAP_EXT_RENDER, state::{clap_host_state, CLAP_EXT_STATE}, tail::{clap_host_tail, CLAP_EXT_TAIL}, timer_support::{clap_host_timer_support, CLAP_EXT_TIMER_SUPPORT}}, host::clap_host, plugin::clap_plugin, process::{clap_process, clap_process_status, CLAP_PROCESS_CONTINUE, CLAP_PROCESS_CONTINUE_IF_NOT_QUIET, CLAP_PROCESS_ERROR, CLAP_PROCESS_TAIL}}; |
| 4 | +use clap_sys::{events::clap_input_events, ext::{audio_ports::CLAP_EXT_AUDIO_PORTS, draft::undo::{CLAP_EXT_UNDO, clap_host_undo}, gui::{CLAP_EXT_GUI, clap_host_gui}, latency::CLAP_EXT_LATENCY, note_ports::CLAP_EXT_NOTE_PORTS, params::{CLAP_EXT_PARAMS, clap_host_params}, render::CLAP_EXT_RENDER, state::{CLAP_EXT_STATE, clap_host_state}, tail::{CLAP_EXT_TAIL, clap_host_tail}, timer_support::{CLAP_EXT_TIMER_SUPPORT, clap_host_timer_support}}, host::clap_host, plugin::clap_plugin, process::{CLAP_PROCESS_CONTINUE, CLAP_PROCESS_CONTINUE_IF_NOT_QUIET, CLAP_PROCESS_ERROR, CLAP_PROCESS_TAIL, clap_process, clap_process_status}}; |
5 | 5 | use tracing::error; |
6 | 6 | use plinth_core::signals::{ptr_signal::{PtrSignal, PtrSignalMut}, signal::SignalMut}; |
7 | 7 | use raw_window_handle::RawWindowHandle; |
@@ -59,6 +59,7 @@ pub struct PluginInstance<P: ClapPlugin> { |
59 | 59 | pub(super) host_ext_state: *const clap_host_state, |
60 | 60 | host_ext_tail: *const clap_host_tail, |
61 | 61 | pub(super) host_ext_timer_support: *const clap_host_timer_support, |
| 62 | + pub(super) host_ext_undo: *const clap_host_undo, |
62 | 63 | } |
63 | 64 |
|
64 | 65 | impl<P: ClapPlugin> PluginInstance<P> { |
@@ -148,6 +149,7 @@ impl<P: ClapPlugin> PluginInstance<P> { |
148 | 149 | host_ext_state: null(), |
149 | 150 | host_ext_tail: null(), |
150 | 151 | host_ext_timer_support: null(), |
| 152 | + host_ext_undo: null(), |
151 | 153 | } |
152 | 154 | } |
153 | 155 |
|
@@ -193,6 +195,7 @@ impl<P: ClapPlugin> PluginInstance<P> { |
193 | 195 | instance.host_ext_state = unsafe { ((*instance.host).get_extension.unwrap())(instance.host, CLAP_EXT_STATE.as_ptr()) as _ }; |
194 | 196 | instance.host_ext_tail = unsafe { ((*instance.host).get_extension.unwrap())(instance.host, CLAP_EXT_TAIL.as_ptr()) as _ }; |
195 | 197 | instance.host_ext_timer_support = unsafe { ((*instance.host).get_extension.unwrap())(instance.host, CLAP_EXT_TIMER_SUPPORT.as_ptr()) as _ }; |
| 198 | + instance.host_ext_undo = unsafe { ((*instance.host).get_extension.unwrap())(instance.host, CLAP_EXT_UNDO.as_ptr()) as _ }; |
196 | 199 |
|
197 | 200 | instance.plugin.as_mut().unwrap().init(); |
198 | 201 | }); |
|
0 commit comments